Rev 324 | Rev 328 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 324 | Rev 327 | ||
---|---|---|---|
Line 207... | Line 207... | ||
207 | ErrorCode = 14; |
207 | ErrorCode = 14; |
208 | } |
208 | } |
209 | else if(FC.Error[0] & FC_ERROR0_ACC_TOP) |
209 | else if(FC.Error[0] & FC_ERROR0_ACC_TOP) |
210 | { |
210 | { |
211 | LED_RED_ON; |
211 | LED_RED_ON; |
212 | sprintf(ErrorMSG,"ERR: FC Z-ACC"); |
212 | sprintf(ErrorMSG,"ERR:FC Z-ACC"); |
213 | ErrorCode = 15; |
213 | ErrorCode = 15; |
214 | } |
214 | } |
215 | else if(FC.Error[0] & FC_ERROR0_PRESSURE) |
215 | else if(FC.Error[0] & FC_ERROR0_PRESSURE) |
216 | { |
216 | { |
217 | LED_RED_ON; |
217 | LED_RED_ON; |
218 | sprintf(ErrorMSG,"ERR: Pressure sensor"); |
218 | sprintf(ErrorMSG,"ERR:Pressure sensor"); |
219 | ErrorCode = 16; |
219 | ErrorCode = 16; |
220 | } |
220 | } |
221 | else if(FC.Error[1] & FC_ERROR1_I2C) |
221 | else if(FC.Error[1] & FC_ERROR1_I2C) |
222 | { |
222 | { |
223 | LED_RED_ON; |
223 | LED_RED_ON; |
224 | sprintf(ErrorMSG,"ERR: FC I2C"); |
224 | sprintf(ErrorMSG,"ERR:I2C FC to BL"); |
225 | ErrorCode = 17; |
225 | ErrorCode = 17; |
226 | } |
226 | } |
227 | else if(FC.Error[1] & FC_ERROR1_BL_MISSING) |
227 | else if(FC.Error[1] & FC_ERROR1_BL_MISSING) |
228 | { |
228 | { |
229 | LED_RED_ON; |
229 | LED_RED_ON; |
Line 393... | Line 393... | ||
393 | UART0_TransmitTxData(); // send answer |
393 | UART0_TransmitTxData(); // send answer |
394 | UART1_TransmitTxData(); // send answer |
394 | UART1_TransmitTxData(); // send answer |
395 | UART2_TransmitTxData(); // send answer |
395 | UART2_TransmitTxData(); // send answer |
396 | USB_TransmitTxData(); // send answer |
396 | USB_TransmitTxData(); // send answer |
397 | SPI0_UpdateBuffer(); // handle new SPI Data |
397 | SPI0_UpdateBuffer(); // handle new SPI Data |
- | 398 | ||
398 | // ---------------- Error Check Timing ---------------------------- |
399 | // ---------------- Error Check Timing ---------------------------- |
399 | if(CheckDelay(TimerCheckError)) |
400 | if(CheckDelay(TimerCheckError)) |
400 | { |
401 | { |
401 | TimerCheckError = SetDelay(1000); |
402 | TimerCheckError = SetDelay(1000); |
402 | if(CheckDelay(SPI0_Timeout)) GPS_Navigation(&GPSData, &(ToFlightCtrl.GPSStick)); // process the GPS data even if the FC is not connected |
403 | if(CheckDelay(SPI0_Timeout) && (DebugUART == UART1)) GPS_Navigation(&GPSData, &(ToFlightCtrl.GPSStick)); // process the GPS data even if the FC is not connected |
- | 404 | ||
403 | CheckErrors(); |
405 | if(!CheckDelay(SPI0_Timeout) || (DebugUART == UART1)) CheckErrors(); |
- | 406 | ||
404 | if(FC.StatusFlags & FC_STATUS_FLY) NaviData.FlyingTime++; // we want to count the battery-time |
407 | if(FC.StatusFlags & FC_STATUS_FLY) NaviData.FlyingTime++; // we want to count the battery-time |
405 | // else NaviData.FlyingTime = 0; // not the time per flight |
408 | // else NaviData.FlyingTime = 0; // not the time per flight |
406 | if(SerialLinkOkay) SerialLinkOkay--; |
409 | if(SerialLinkOkay) SerialLinkOkay--; |
407 | if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication |
410 | if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication |
408 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
411 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
409 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
412 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
410 | } |
413 | } |
- | 414 | ||
411 | // ---------------- Logging --------------------------------------- |
415 | // ---------------- Logging --------------------------------------- |
412 | Logging_Update(); // could be block some time for at max. 2 seconds, therefore move time critical part of the mainloop into the ISR of timer 1 |
416 | Logging_Update(); // could be block some time for at max. 2 seconds, therefore move time critical part of the mainloop into the ISR of timer 1 |
- | 417 | ||
413 | /* |
418 | /* |
414 | // test |
419 | // test |
415 | if(CheckDelay(ftimer)) |
420 | if(CheckDelay(ftimer)) |
416 | { |
421 | { |