Rev 2109 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2108 | - | 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" |
||
8 | #include "rc.h" |
||
9 | |||
10 | void commands_handleCommands(void) { |
||
11 | uint8_t command = controlMixer_getCommand(); |
||
12 | uint8_t repeated = controlMixer_isCommandRepeated(); |
||
13 | uint8_t argument = controlMixer_getArgument(); |
||
14 | if (!isFlying) { |
||
2129 | - | 15 | if (command == COMMAND_RCCAL && !repeated) { |
16 | RC_calibrate(); |
||
17 | rcTrim_writeToEEProm(); |
||
18 | beepNumber(2); // 2 beeps means RC. |
||
19 | } else if (command == COMMAND_GYROCAL && !repeated) { |
||
20 | // Gyro calibration, with or without selecting a new parameter-set. |
||
21 | // paramSet_readFromEEProm(1); |
||
2108 | - | 22 | analog_calibrate(); |
23 | attitude_setNeutral(); |
||
24 | controlMixer_setNeutral(); |
||
2129 | - | 25 | beepNumber(1); // 1 beep means gyro. |
2108 | - | 26 | } else if (command == COMMAND_CHMOD && !repeated) { |
27 | configuration_setFlightParameters(argument); |
||
28 | } |
||
2129 | - | 29 | } |
2108 | - | 30 | } |