Rev 1927 | Rev 2102 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1910 | - | 1 | #include <stdlib.h> |
2 | #include "commands.h" |
||
3 | #include "controlMixer.h" |
||
4 | #include "flight.h" |
||
5 | #include "eeprom.h" |
||
6 | #include "attitude.h" |
||
7 | #include "output.h" |
||
2099 | - | 8 | #include "rc.h" |
1910 | - | 9 | |
2099 | - | 10 | #ifdef USE_MK3MAG |
11 | // TODO: Kick that all outa here! |
||
12 | uint8_t compassCalState = 0; |
||
13 | #endif |
||
14 | |||
1910 | - | 15 | void commands_handleCommands(void) { |
2099 | - | 16 | /* |
17 | * Get the current command (start/stop motors, calibrate), if any. |
||
18 | */ |
||
19 | uint8_t command = controlMixer_getCommand(); |
||
20 | uint8_t repeated = controlMixer_isCommandRepeated(); |
||
21 | uint8_t argument = controlMixer_getArgument(); |
||
1910 | - | 22 | |
2099 | - | 23 | if (!(MKFlags & MKFLAG_MOTOR_RUN)) { |
24 | if (command == COMMAND_GYROCAL && !repeated) { |
||
25 | // Gyro calinbration, with or without selecting a new parameter-set. |
||
26 | paramSet_readFromEEProm(1); |
||
27 | analog_calibrateGyros(); |
||
28 | attitude_setNeutral(); |
||
29 | controlMixer_setNeutral(); |
||
30 | beepNumber(1); |
||
31 | } |
||
1910 | - | 32 | |
2099 | - | 33 | // save the ACC neutral setting to eeprom |
34 | /* |
||
35 | else { |
||
36 | if (command == COMMAND_ACCCAL && !repeated) { |
||
37 | // Run gyro and acc. meter calibration but do not repeat it. |
||
38 | analog_calibrateAcc(); |
||
39 | attitude_setNeutral(); |
||
40 | controlMixer_setNeutral(); |
||
41 | beepNumber(getActiveParamSet()); |
||
42 | } |
||
43 | } |
||
44 | */ |
||
45 | } // end !MOTOR_RUN condition. |
||
1910 | - | 46 | } |