Vit (20.10.2013 19:11 - 19:14, просмотров: 137) ответил Скрипач на Инициализацию параметров не разглядел. А теперь колитесь, как ВНУТРИ PID_run() обращаться к параметру :о)
Я ж уже показывал --> http://caxapa.ru/455649.html
typedef struct pt {
lc_t lc;
int rc;
//structpointer *
void * ct; // указатель на структуру с параметрами, тип приведётся к указателю на структуру в run()
}pt;
typedef struct PID_param{
int a;
long b;
float c;
}PID_param;
void PID_run(pt * PT){
PID_param * ct = (PID_param *)(PT->ct);
ct->a += 77;
....
}
typedef struct Gisteresis_param{
int f;
int g;
int h;
int i;
}Gisteresis_param;
void Gisteresis_run(pt * PT){
Gisteresis_param * ct = (Gisteresis_param *)(PT->ct);
ct->h += ct->g - 55;
....
}