107,7 → 107,7 |
*/ |
|
void controlMixer_periodicTask(void) { |
int16_t tempPRTY[4] = { 0, 0, 0, 0 }; |
int16_t tempPRYT[4] = { 0, 0, 0, 0 }; |
|
// Decode commands. |
uint8_t rcCommand = (RC_getSignalQuality() >= SIGNAL_OK) ? RC_getCommand() : COMMAND_NONE; |
139,18 → 139,18 |
} |
|
// This will init the values (not just add to them). |
RC_periodicTaskAndPRTY(tempPRTY); |
RC_periodicTaskAndPRYT(tempPRYT); |
|
// Add external control to RC |
EC_periodicTaskAndPRTY(tempPRTY); |
EC_periodicTaskAndPRYT(tempPRYT); |
|
FC_periodicTaskAndPRTY(tempPRTY); |
FC_periodicTaskAndPRYT(tempPRYT); |
|
// Commit results to global variable and also measure control activity. |
controls[CONTROL_THROTTLE] = tempPRTY[CONTROL_THROTTLE]; |
controls[CONTROL_ELEVATOR] = tempPRTY[CONTROL_ELEVATOR]; |
controls[CONTROL_AILERONS] = tempPRTY[CONTROL_AILERONS]; |
controls[CONTROL_RUDDER] = tempPRTY[CONTROL_RUDDER]; |
controls[CONTROL_THROTTLE] = tempPRYT[CONTROL_THROTTLE]; |
controls[CONTROL_ELEVATOR] = tempPRYT[CONTROL_ELEVATOR]; |
controls[CONTROL_AILERONS] = tempPRYT[CONTROL_AILERONS]; |
controls[CONTROL_RUDDER] = tempPRYT[CONTROL_RUDDER]; |
// dampenControlActivity(); |
|
// We can safely do this even with a bad signal - the variables will not have been updated then. |