Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1921 → Rev 1922

/branches/dongfang_FC_fixedwing/controlMixer.c
11,7 → 11,7
uint16_t maxControl[2] = {0, 0};
uint16_t controlActivity = 0;
int16_t control[4] = {0, 0, 0, 0};
int32_t controlIntegrals[4] = {0, 0, 0, 0};
// int32_t controlIntegrals[4] = {0, 0, 0, 0};
 
// Internal variables for reading commands made with an R/C stick.
uint8_t lastCommand = COMMAND_NONE;
88,13 → 88,15
int16_t tmp = control[index];
 
// TODO: Scale by some factor. To be determined.
controlIntegrals[index] += tmp * 4;
// controlIntegrals[index] += tmp * 4;
/*
if (controlIntegrals[index] > PITCHROLLOVER180) {
controlIntegrals[index] -= PITCHROLLOVER360;
} else if (controlIntegrals[index] <= -PITCHROLLOVER180) {
controlIntegrals[index] += PITCHROLLOVER360;
}
*/212e
 
control[index] = newValue;
tmp -= newValue;