55,52 → 55,6 |
// enable interrupts global |
sei(); |
|
printf("\n\r==================================="); |
printf("\n\rFlightControl"); |
printf("\n\rHardware: Custom"); |
printf("\n\r CPU: Atmega644"); |
if (CPUType == ATMEGA644P) |
printf("p"); |
printf("\n\rSoftware: V%d.%d%c",VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH + 'a'); |
printf("\n\r==================================="); |
|
// Wait for a short time (otherwise the RC channel check won't work below) |
// timer = SetDelay(500); |
// while(!CheckDelay(timer)); |
|
// Instead, while away the time by flashing the 2 outputs: |
// First J16, then J17. Makes it easier to see which is which. |
timer = setDelay(200); |
outputSet(0,1); |
GRN_OFF; |
RED_ON; |
while (!checkDelay(timer)) |
; |
|
timer = setDelay(200); |
outputSet(0, 0); |
outputSet(1, 1); |
RED_OFF; |
GRN_ON; |
while (!checkDelay(timer)) |
; |
|
timer = setDelay(200); |
while (!checkDelay(timer)) |
; |
outputSet(1,0); |
GRN_OFF; |
|
printf("\n\r==================================="); |
|
#ifdef USE_NAVICTRL |
printf("\n\rSupport for NaviCtrl"); |
#endif |
|
#ifdef USE_DIRECT_GPS |
printf("\n\rDirect (no NaviCtrl) navigation"); |
#endif |
|
controlMixer_setNeutral(); |
|
// Cal. attitude sensors and reset integrals. |
109,11 → 63,10 |
// Init flight parameters |
// flight_setNeutral(); |
|
// This is not a busy-wait operation and should be OK. |
beep(2000); |
|
printf("\n\n\r"); |
|
while (1) { |
while (1) { |
if (runFlightControl) { // control interval |
runFlightControl = 0; // reset Flag, is enabled every 2 ms by ISR of timer0 |
|