Subversion Repositories NaviCtrl

Rev

Rev 485 | Rev 488 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 485 Rev 487
Line 303... Line 303...
303
                sprintf(ErrorMSG,"compass not calibr.");
303
                sprintf(ErrorMSG,"compass not calibr.");
304
                newErrorCode = 31;
304
                newErrorCode = 31;
305
                StopNavigation = 1;
305
                StopNavigation = 1;
306
                UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE;
306
                UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE;
307
        }
307
        }
-
 
308
        else if(CompassValueErrorCount > 30)
-
 
309
        {
-
 
310
                LED_RED_ON;
-
 
311
                sprintf(ErrorMSG,"compass sensor error");
-
 
312
                newErrorCode = 34;
-
 
313
                StopNavigation = 1;
-
 
314
                UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE;
-
 
315
        }
308
        else if(Compass_Heading < 0)
316
        else if(Compass_Heading < 0)
309
        {
317
        {
310
                LED_RED_ON;
318
                LED_RED_ON;
311
                sprintf(ErrorMSG,"bad compass value ");
319
                sprintf(ErrorMSG,"bad compass value ");
312
                newErrorCode = 6;
320
                newErrorCode = 6;
Line 455... Line 463...
455
                if(CheckDelay(TimerCheckError) || (FC.StatusFlags & FC_STATUS_START && !(oldFcFlags & FC_STATUS_START))) // Timer or FY wants to start
463
                if(CheckDelay(TimerCheckError) || (FC.StatusFlags & FC_STATUS_START && !(oldFcFlags & FC_STATUS_START))) // Timer or FY wants to start
456
                {
464
                {
457
                        if(CheckDelay(TimerCheckError))
465
                        if(CheckDelay(TimerCheckError))
458
                         {
466
                         {
459
                          TimerCheckError = SetDelay(1000);
467
                          TimerCheckError = SetDelay(1000);
-
 
468
                          if(CompassValueErrorCount) CompassValueErrorCount--;
460
                          if(++count5sec == 5)
469
                          if(++count5sec == 5)
461
                           {
470
                           {
462
                                count5sec = 0;
471
                                count5sec = 0;
463
                                FreqGpsProcessedIn5Sec = CountGpsProcessedIn5Sec * 2;
472
                                FreqGpsProcessedIn5Sec = CountGpsProcessedIn5Sec * 2;
464
                                FreqNewGpsDataIn5Sec = CountNewGpsDataIn5Sec * 2;
473
                                FreqNewGpsDataIn5Sec = CountNewGpsDataIn5Sec * 2;
Line 476... Line 485...
476
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
485
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
477
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
486
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
478
                        if(StopNavigation && (Parameter.NaviGpsModeControl >=  50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000;
487
                        if(StopNavigation && (Parameter.NaviGpsModeControl >=  50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000;
479
                }
488
                }
480
 running = 0;
489
 running = 0;
-
 
490
if(!PollingTimeout) DebugOut.Analog[17]++;
481
 return(0);
491
 return(0);
482
}
492
}
Line 483... Line 493...
483
 
493
 
484
// the handler will be cyclic called by the timer 1 ISR
494
// the handler will be cyclic called by the timer 1 ISR
Line 589... Line 599...
589
        fifo_purge(&UART1_rx_fifo); // flush the whole fifo init buffer
599
        fifo_purge(&UART1_rx_fifo); // flush the whole fifo init buffer
590
        LED_GRN_ON;
600
        LED_GRN_ON;
591
        LED_RED_OFF;
601
        LED_RED_OFF;
592
    Settings_GetParamValue(PID_SEND_NMEA, &NMEA_Interval);
602
    Settings_GetParamValue(PID_SEND_NMEA, &NMEA_Interval);
593
        UART1_PutString("\r\n");
603
        UART1_PutString("\r\n");
-
 
604
        CompassValueErrorCount = 0;
594
        for (;;) // the endless main loop
605
        for (;;) // the endless main loop
595
        {
606
        {
596
                PollingTimeout = 5;
607
                PollingTimeout = 5;
597
                Polling();
608
                Polling();
598
                // ---------------- Logging  ---------------------------------------
609
                // ---------------- Logging  ---------------------------------------