Rev 2015 | Rev 2052 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2015 | Rev 2048 | ||
---|---|---|---|
Line 55... | Line 55... | ||
55 | #include "flight.h" |
55 | #include "flight.h" |
56 | #include "eeprom.h" |
56 | #include "eeprom.h" |
57 | #include "attitude.h" |
57 | #include "attitude.h" |
58 | #include "output.h" |
58 | #include "output.h" |
Line -... | Line 59... | ||
- | 59 | ||
- | 60 | uint8_t compassCalState = 0; |
|
59 | 61 | ||
60 | void commands_handleCommands(void) { |
62 | void commands_handleCommands(void) { |
61 | /* |
63 | /* |
62 | * Get the current command (start/stop motors, calibrate), if any. |
64 | * Get the current command (start/stop motors, calibrate), if any. |
63 | */ |
65 | */ |
Line 84... | Line 86... | ||
84 | analog_calibrateGyros(); |
86 | analog_calibrateGyros(); |
85 | attitude_setNeutral(); |
87 | attitude_setNeutral(); |
86 | flight_setNeutral(); |
88 | flight_setNeutral(); |
87 | controlMixer_setNeutral(); |
89 | controlMixer_setNeutral(); |
88 | beepNumber(getActiveParamSet()); |
90 | beepNumber(getActiveParamSet()); |
89 | } else if (staticParams.bitConfig & (CFG_COMPASS_ACTIVE |
91 | } else if (staticParams.bitConfig & (CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE) && argument == 7) { |
90 | | CFG_GPS_ACTIVE) && argument == 7) { |
- | |
91 | // If right stick is centered and down |
92 | // If right stick is centered and down |
92 | // TODO: Out of here! State machine instead. |
- | |
93 | compassCalState = 1; |
93 | compassCalState = 1; |
94 | beep(1000); |
94 | beep(1000); |
95 | } |
95 | } |
96 | } |
96 | } |
Line 121... | Line 121... | ||
121 | } else if (command == COMMAND_STOP) { |
121 | } else if (command == COMMAND_STOP) { |
122 | isFlying = 0; |
122 | isFlying = 0; |
123 | MKFlags &= ~(MKFLAG_MOTOR_RUN); |
123 | MKFlags &= ~(MKFLAG_MOTOR_RUN); |
124 | } |
124 | } |
125 | } |
125 | } |
- | 126 | ||
- | 127 | /* |
|
- | 128 | * if (controlMixer_testCompassCalState()) { |
|
- | 129 | compassCalState++; |
|
- | 130 | if (compassCalState < 5) |
|
- | 131 | beepNumber(compassCalState); |
|
- | 132 | else |
|
- | 133 | beep(1000); |
|
- | 134 | } |
|
- | 135 | * |
|
- | 136 | */ |
|
- | 137 | ||
- | 138 | uint8_t commands_isCalibratingCompass(void) { |
|
- | 139 | return RC_testCompassCalState(); |
|
- | 140 | } |