Rev 2109 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2109 | Rev 2129 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | #include "eeprom.h" |
5 | #include "eeprom.h" |
6 | #include "attitude.h" |
6 | #include "attitude.h" |
7 | #include "output.h" |
7 | #include "output.h" |
8 | #include "rc.h" |
8 | #include "rc.h" |
Line 9... | Line -... | ||
9 | - | ||
10 | #ifdef USE_MK3MAG |
- | |
11 | // TODO: Kick that all outa here! |
- | |
12 | uint8_t compassCalState = 0; |
- | |
13 | #endif |
- | |
14 | 9 | ||
15 | void commands_handleCommands(void) { |
- | |
16 | /* |
- | |
17 | * Get the current command (start/stop motors, calibrate), if any. |
- | |
18 | */ |
10 | void commands_handleCommands(void) { |
19 | uint8_t command = controlMixer_getCommand(); |
11 | uint8_t command = controlMixer_getCommand(); |
20 | uint8_t repeated = controlMixer_isCommandRepeated(); |
12 | uint8_t repeated = controlMixer_isCommandRepeated(); |
21 | uint8_t argument = controlMixer_getArgument(); |
13 | uint8_t argument = controlMixer_getArgument(); |
22 | if (!isFlying) { |
14 | if (!isFlying) { |
- | 15 | if (command == COMMAND_RCCAL && !repeated) { |
|
- | 16 | RC_calibrate(); |
|
- | 17 | rcTrim_writeToEEProm(); |
|
- | 18 | beepNumber(2); // 2 beeps means RC. |
|
23 | if (command == COMMAND_GYROCAL && !repeated) { |
19 | } else if (command == COMMAND_GYROCAL && !repeated) { |
24 | // Gyro calinbration, with or without selecting a new parameter-set. |
20 | // Gyro calibration, with or without selecting a new parameter-set. |
25 | paramSet_readFromEEProm(1); |
21 | // paramSet_readFromEEProm(1); |
26 | analog_calibrate(); |
22 | analog_calibrate(); |
27 | attitude_setNeutral(); |
23 | attitude_setNeutral(); |
28 | controlMixer_setNeutral(); |
24 | controlMixer_setNeutral(); |
29 | beepNumber(1); |
25 | beepNumber(1); // 1 beep means gyro. |
30 | } else if (command == COMMAND_CHMOD && !repeated) { |
26 | } else if (command == COMMAND_CHMOD && !repeated) { |
31 | configuration_setFlightParameters(argument); |
27 | configuration_setFlightParameters(argument); |
32 | } |
28 | } |
33 | } // end !MOTOR_RUN condition. |
29 | } |