Rev 1645 | Rev 1805 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1645 | Rev 1775 | ||
---|---|---|---|
Line 134... | Line 134... | ||
134 | // while(!CheckDelay(timer)); |
134 | // while(!CheckDelay(timer)); |
Line 135... | Line 135... | ||
135 | 135 | ||
136 | // Instead, while away the time by flashing the 2 outputs: |
136 | // Instead, while away the time by flashing the 2 outputs: |
137 | // First J16, then J17. Makes it easier to see which is which. |
137 | // First J16, then J17. Makes it easier to see which is which. |
138 | timer = SetDelay(200); |
138 | timer = SetDelay(200); |
139 | J16_ON; |
139 | OUTPUT_ON(0); |
140 | GRN_OFF; |
140 | GRN_OFF; |
141 | RED_ON; |
141 | RED_ON; |
Line 142... | Line 142... | ||
142 | while(!CheckDelay(timer)); |
142 | while(!CheckDelay(timer)); |
143 | 143 | ||
- | 144 | timer = SetDelay(200); |
|
144 | timer = SetDelay(200); |
145 | OUTPUT_OFF(0); |
145 | J16_OFF; |
146 | OUTPUT_ON(1); |
146 | RED_OFF; |
- | |
147 | GRN_ON; |
147 | RED_OFF; |
Line 148... | Line 148... | ||
148 | J17_ON; |
148 | GRN_ON; |
149 | while(!CheckDelay(timer)); |
149 | while(!CheckDelay(timer)); |
150 | 150 | ||
Line 151... | Line 151... | ||
151 | timer = SetDelay(200); |
151 | timer = SetDelay(200); |
Line 152... | Line 152... | ||
152 | while(!CheckDelay(timer)); |
152 | while(!CheckDelay(timer)); |
Line 184... | Line 184... | ||
184 | #if (defined (USE_MK3MAG)) |
184 | #if (defined (USE_MK3MAG)) |
185 | if(CPUType == ATMEGA644P) printf("\n\rSupport for GPS at 2nd UART"); |
185 | if(CPUType == ATMEGA644P) printf("\n\rSupport for GPS at 2nd UART"); |
186 | else printf("\n\rSupport for GPS at 1st UART"); |
186 | else printf("\n\rSupport for GPS at 1st UART"); |
187 | #endif |
187 | #endif |
Line 188... | Line 188... | ||
188 | 188 | ||
Line 189... | Line 189... | ||
189 | controlMixer_setNeutral(0); |
189 | controlMixer_setNeutral(); |
190 | 190 | ||
Line 191... | Line 191... | ||
191 | // Cal. attitude sensors and reset integrals. |
191 | // Cal. attitude sensors and reset integrals. |
Line 216... | Line 216... | ||
216 | 216 | ||
217 | J4HIGH; |
217 | J4HIGH; |
218 | flight_control(); |
218 | flight_control(); |
Line -... | Line 219... | ||
- | 219 | J4LOW; |
|
- | 220 | ||
- | 221 | /* |
|
219 | J4LOW; |
222 | * If the motors are running (MKFlags & MKFLAG_MOTOR_RUN in flight.c), transmit |
- | 223 | * the throttle vector just computed. Otherwise, if motor test is engaged, transmit |
|
- | 224 | * the test throttle vector. If no testing, stop all motors. |
|
- | 225 | */ |
|
Line 220... | Line 226... | ||
220 | 226 | // Obsoleted. |
|
Line 221... | Line 227... | ||
221 | sendMotorData(); // the flight control code |
227 | // transmitMotorThrottleData(); |
222 | 228 | ||
Line 267... | Line 273... | ||
267 | } |
273 | } |
Line 268... | Line 274... | ||
268 | 274 | ||
Line 269... | Line 275... | ||
269 | usart0_ProcessRxData(); |
275 | usart0_ProcessRxData(); |
- | 276 | ||
- | 277 | if(CheckDelay(timer)) { |
|
- | 278 | if (UBat <= UBAT_AT_5V) { |
|
270 | 279 | // Do nothing. The voltage on the input side of the regulator is <5V; |
|
271 | if(CheckDelay(timer)) { |
280 | // we must be running off USB power. Keep it quiet. |
272 | if(UBat < staticParams.LowVoltageWarning) { |
281 | } else if(UBat < staticParams.LowVoltageWarning) { |
- | 282 | beepBatteryAlarm(); |
|
273 | beepBatteryAlarm(); |
283 | } |
274 | } |
284 | |
275 | #ifdef USE_NAVICTRL |
285 | #ifdef USE_NAVICTRL |
276 | SPI_StartTransmitPacket(); |
286 | SPI_StartTransmitPacket(); |
277 | SendSPI = 4; |
287 | SendSPI = 4; |