Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2123 → Rev 2124

/branches/dongfang_FC_fixedwing/commands.c
7,32 → 7,24
#include "output.h"
#include "rc.h"
 
#ifdef USE_MK3MAG
// TODO: Kick that all outa here!
uint8_t compassCalState = 0;
#endif
 
void commands_handleCommands(void) {
/*
* Get the current command (start/stop motors, calibrate), if any.
*/
uint8_t command = controlMixer_getCommand();
uint8_t repeated = controlMixer_isCommandRepeated();
uint8_t argument = controlMixer_getArgument();
if (!isFlying) {
if (command == COMMAND_GYROCAL && !repeated) {
if (command == COMMAND_RCCAL && !repeated) {
RC_calibrate();
rcTrim_writeToEEProm();
beepNumber(2); // 2 beeps means RC.
} else if (command == COMMAND_GYROCAL && !repeated) {
// Gyro calinbration, with or without selecting a new parameter-set.
paramSet_readFromEEProm(1);
// paramSet_readFromEEProm(1);
analog_calibrate();
attitude_setNeutral();
controlMixer_setNeutral();
 
RC_calibrate();
rcTrim_writeToEEProm();
 
beepNumber(1);
beepNumber(1); // 1 beep means gyro.
} else if (command == COMMAND_CHMOD && !repeated) {
configuration_setFlightParameters(argument);
}
} // end !MOTOR_RUN condition.
}
}