Rev 792 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 792 | Rev 793 | ||
---|---|---|---|
Line 225... | Line 225... | ||
225 | { |
225 | { |
226 | LED_RED_ON; |
226 | LED_RED_ON; |
227 | sprintf(ErrorMSG,"ERR: PARACHUTE"); |
227 | sprintf(ErrorMSG,"ERR: PARACHUTE"); |
228 | newErrorCode = 43; |
228 | newErrorCode = 43; |
229 | } |
229 | } |
- | 230 | else if(FC.Error[1] & FC_ERROR1_SPI_RX) |
|
- | 231 | { |
|
- | 232 | LED_RED_ON; |
|
- | 233 | sprintf(ErrorMSG,"FC spi rx error "); |
|
- | 234 | newErrorCode = 8; |
|
- | 235 | StopNavigation = 1; |
|
- | 236 | } |
|
- | 237 | else if(CntSpiErrorPerSecond > 2) |
|
- | 238 | { |
|
- | 239 | LED_RED_ON; |
|
- | 240 | newErrorCode = 8; |
|
- | 241 | sprintf(ErrorMSG,"FC spi CRC error"); |
|
- | 242 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_SPI_RX; |
|
- | 243 | } |
|
230 | else if(FC.Error[0] & FC_ERROR0_GYRO_NICK) |
244 | else if(FC.Error[0] & FC_ERROR0_GYRO_NICK) |
231 | { |
245 | { |
232 | LED_RED_ON; |
246 | LED_RED_ON; |
233 | sprintf(ErrorMSG,"ERR: FC Nick Gyro"); |
247 | sprintf(ErrorMSG,"ERR: FC Nick Gyro"); |
234 | newErrorCode = 10; |
248 | newErrorCode = 10; |
Line 316... | Line 330... | ||
316 | sprintf(ErrorMSG,"bad compass value "); |
330 | sprintf(ErrorMSG,"bad compass value "); |
317 | newErrorCode = 6; |
331 | newErrorCode = 6; |
318 | StopNavigation = 1; |
332 | StopNavigation = 1; |
319 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE; |
333 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE; |
320 | } |
334 | } |
321 | else if((FC.Error[1] & FC_ERROR1_SPI_RX)) |
- | |
322 | { |
- | |
323 | LED_RED_ON; |
- | |
324 | sprintf(ErrorMSG,"FC spi rx error "); |
- | |
325 | newErrorCode = 8; |
- | |
326 | StopNavigation = 1; |
- | |
327 | } |
- | |
328 | else if(FC.Error[0] & FC_ERROR0_CAREFREE) |
335 | else if(FC.Error[0] & FC_ERROR0_CAREFREE) |
329 | { |
336 | { |
330 | LED_RED_ON; |
337 | LED_RED_ON; |
331 | sprintf(ErrorMSG,"FC: Carefree Error"); |
338 | sprintf(ErrorMSG,"FC: Carefree Error"); |
332 | newErrorCode = 20; |
339 | newErrorCode = 20; |
Line 594... | Line 601... | ||
594 | // + one second timer |
601 | // + one second timer |
595 | // ++++++++++++++++++++++++++++++++++++++++++++++++ |
602 | // ++++++++++++++++++++++++++++++++++++++++++++++++ |
596 | if(CheckDelay(TimerSecond)) // one second Timer |
603 | if(CheckDelay(TimerSecond)) // one second Timer |
597 | { |
604 | { |
598 | TimerSecond += 1000; |
605 | TimerSecond += 1000; |
599 | - | ||
600 | if(FC.StatusFlags & FC_STATUS_FLY) |
606 | if(FC.StatusFlags & FC_STATUS_FLY) |
601 | { |
607 | { |
602 | NaviData.FlyingTime++; // we want to count the battery-time |
608 | NaviData.FlyingTime++; // we want to count the battery-time |
603 | TimeSinceMotorStart++; |
609 | TimeSinceMotorStart++; |
604 | } |
610 | } |
Line 617... | Line 623... | ||
617 | else |
623 | else |
618 | if(FC_Temperatur < FC_Temperatur_raw/10) FC_Temperatur++; |
624 | if(FC_Temperatur < FC_Temperatur_raw/10) FC_Temperatur++; |
619 | } |
625 | } |
620 | } |
626 | } |
621 | // ++++++++++++++++++++++++++++++++++++++++++++++++ |
627 | // ++++++++++++++++++++++++++++++++++++++++++++++++ |
622 | - | ||
623 | - | ||
624 | // ---------------- Error Check Timing ---------------------------- |
628 | // ---------------- Error Check Timing ---------------------------- |
625 | if(CheckDelay(TimerCheckError) || (FC.StatusFlags & FC_STATUS_START && !(oldFcFlags & FC_STATUS_START))) // Timer or FY wants to start |
629 | if(CheckDelay(TimerCheckError) || (FC.StatusFlags & FC_STATUS_START && !(oldFcFlags & FC_STATUS_START))) // Timer or FY wants to start |
626 | { |
630 | { |
627 | if(CheckDelay(TimerCheckError)) |
631 | if(CheckDelay(TimerCheckError)) |
628 | { |
632 | { |
Line 652... | Line 656... | ||
652 | if(EE_Parameter.Revision == 0) RequestConfigFromFC = 1; |
656 | if(EE_Parameter.Revision == 0) RequestConfigFromFC = 1; |
653 | if(SerialLinkOkay) SerialLinkOkay--; |
657 | if(SerialLinkOkay) SerialLinkOkay--; |
654 | if(SerialLinkOkay < 250 - 6) NCFlags |= NC_FLAG_NOSERIALLINK; // 6 seconds timeout for serial communication |
658 | if(SerialLinkOkay < 250 - 6) NCFlags |= NC_FLAG_NOSERIALLINK; // 6 seconds timeout for serial communication |
655 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
659 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
656 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
660 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
- | 661 | CntSpiErrorPerSecond = 0; |
|
657 | } |
662 | } |
658 | running = 0; |
663 | running = 0; |
659 | // if(!PollingTimeout) DebugOut.Analog[17]++; |
664 | // if(!PollingTimeout) DebugOut.Analog[17]++; |
660 | return(0); |
665 | return(0); |
661 | } |
666 | } |