Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2125 → Rev 2124

/branches/dongfang_FC_fixedwing/main.c
19,7 → 19,6
 
int16_t main(void) {
uint16_t timer;
static uint8_t profileTimer;
 
// disable interrupts global
cli();
116,7 → 115,6
while (1) {
if (runFlightControl) { // control interval
runFlightControl = 0; // reset Flag, is enabled every 2 ms by ISR of timer0
 
if (!analogDataReady) {
// Analog data should have been ready but is not!!
debugOut.digital[0] |= DEBUG_MAINLOOP_TIMER;
158,7 → 156,7
#ifdef DO_PROFILE
stopProfileTimer(FLIGHT);
#endif
 
// Allow Serial Data Transmit if motors must not updated or motors are not running
if (!runFlightControl || !isFlying) {
usart0_transmitTxData();
176,18 → 174,26
beepBatteryAlarm();
}
}
calculateFeaturedServoValues();
timer = setDelay(20); // every 20 ms
}
 
output_update();
}
 
if (runFlightControl) { // Time for the next iteration was up before the current finished. Signal error.
debugOut.digital[1] |= DEBUG_MAINLOOP_TIMER;
} else {
debugOut.digital[1] &= ~DEBUG_MAINLOOP_TIMER;
}
}
calculateFeaturedServoValues();
 
if (runFlightControl) { // Time for the next iteration was up before the current finished. Signal error.
debugOut.digital[1] |= DEBUG_MAINLOOP_TIMER;
} else {
debugOut.digital[1] &= ~DEBUG_MAINLOOP_TIMER;
}
 
#ifdef DO_PROFILE
static uint8_t profileTimer;
if (profileTimer++ == 0) {
debugProfileTimers(24);
}
#endif
 
}
return (1);
}