Subversion Repositories FlightCtrl

Rev

Rev 2122 | 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
 
10
void commands_handleCommands(void) {
2102 - 11
        uint8_t command = controlMixer_getCommand();
12
        uint8_t repeated = controlMixer_isCommandRepeated();
13
        uint8_t argument = controlMixer_getArgument();
2108 - 14
        if (!isFlying) {
2124 - 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) {
2102 - 20
                        // Gyro calinbration, with or without selecting a new parameter-set.
2124 - 21
                        // paramSet_readFromEEProm(1);
2106 - 22
                        analog_calibrate();
2102 - 23
                        attitude_setNeutral();
24
                        controlMixer_setNeutral();
2124 - 25
                        beepNumber(1);  // 1 beep means gyro.
2102 - 26
                } else if (command == COMMAND_CHMOD && !repeated) {
27
                        configuration_setFlightParameters(argument);
28
                }
2124 - 29
        }
1910 - 30
}