Rev 2099 | Rev 2103 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2099 | Rev 2102 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | uint8_t requiredMotors; |
18 | uint8_t requiredMotors; |
Line 19... | Line 19... | ||
19 | 19 | ||
Line 20... | Line 20... | ||
20 | VersionInfo_t versionInfo; |
20 | VersionInfo_t versionInfo; |
21 | 21 | ||
22 | // MK flags. TODO: Replace by enum. State machine. |
22 | // MK flags. TODO: Replace by enum. State machine. |
Line 23... | Line 23... | ||
23 | uint16_t isFlying = 0; |
23 | FlightMode_t currentFlightMode = FLIGHT_MODE_MANUAL; |
24 | volatile uint8_t MKFlags = 0; |
24 | volatile uint8_t isMotorRunning = 0; |
25 | 25 | ||
26 | const MMXLATION XLATIONS[] = { |
26 | const MMXLATION XLATIONS[] = { |
Line 101... | Line 101... | ||
101 | DDRB |= (1<<DDB1)|(1<<DDB0); |
101 | DDRB |= (1<<DDB1)|(1<<DDB0); |
102 | RED_OFF; |
102 | RED_OFF; |
103 | GRN_OFF; |
103 | GRN_OFF; |
104 | } |
104 | } |
Line 105... | Line 105... | ||
105 | 105 | ||
106 | void configuration_setFlightParameters() { |
106 | void configuration_setFlightParameters(uint8_t newFlightMode) { |
107 | // Implement: Update of stuff in flight.c |
107 | updateFlightParametersToFlightMode(currentFlightMode = newFlightMode); |
Line 108... | Line 108... | ||
108 | } |
108 | } |
109 | 109 | ||
110 | // Called after a change in configuration parameters, as a hook for modules to take over changes. |
110 | // Called after a change in configuration parameters, as a hook for modules to take over changes. |
111 | void configuration_paramSetDidChange(void) { |
111 | void configuration_paramSetDidChange(void) { |
112 | // This should be OK to do here as long as we don't change parameters during emergency flight. We don't. |
112 | // This should be OK to do here as long as we don't change parameters during emergency flight. We don't. |
113 | configuration_setFlightParameters(); |
113 | configuration_setFlightParameters(currentFlightMode); |
114 | // Immediately load changes to output, and also signal the paramset change. |
114 | // Immediately load changes to output, and also signal the paramset change. |
Line 115... | Line 115... | ||
115 | output_init(); |
115 | output_init(); |
116 | } |
- | |
117 | 116 | } |
|
118 | void setOtherDefaults(void) { |
117 | |
119 | 118 | void setOtherDefaults(void) { |
|
Line 120... | Line 119... | ||
120 | // Control |
119 | // Control |