Rev 483 | Rev 485 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 483 | Rev 484 | ||
---|---|---|---|
Line 430... | Line 430... | ||
430 | ErrorGpsFixLost = 0; |
430 | ErrorGpsFixLost = 0; |
431 | } |
431 | } |
Line 432... | Line 432... | ||
432 | 432 | ||
433 | 433 | ||
434 | 434 | ||
435 | void Polling(void) |
435 | u8 Polling(void) |
436 | { |
436 | { |
437 | static u8 running = 0, oldFcFlags = 0, count5sec; |
437 | static u8 running = 0, oldFcFlags = 0, count5sec; |
438 | static u32 old_ms = 0; |
438 | static u32 old_ms = 0; |
439 | if(running) return; |
439 | if(running) {/*DebugOut.Analog[18]++;*/ return(1);}; |
440 | running = 1; |
440 | running = 1; |
441 | if(CountMilliseconds != old_ms) // 1 ms |
441 | if(CountMilliseconds != old_ms) // 1 ms |
Line 476... | Line 476... | ||
476 | if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication |
476 | if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication |
477 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
477 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
478 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
478 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
479 | } |
479 | } |
480 | running = 0; |
480 | running = 0; |
- | 481 | return(0); |
|
481 | } |
482 | } |
Line 482... | Line 483... | ||
482 | 483 | ||
483 | // the handler will be cyclic called by the timer 1 ISR |
484 | // the handler will be cyclic called by the timer 1 ISR |
484 | // used is for critical timing parts that normaly would handled |
485 | // used is for critical timing parts that normaly would handled |
Line 487... | Line 488... | ||
487 | { |
488 | { |
488 | IENABLE; |
489 | IENABLE; |
489 | VIC_ITCmd(EXTIT3_ITLine,DISABLE); // disable irq |
490 | VIC_ITCmd(EXTIT3_ITLine,DISABLE); // disable irq |
490 | // Compass_Update(); // update compass communication |
491 | // Compass_Update(); // update compass communication |
491 | // Analog_Update(); // get new ADC values |
492 | // Analog_Update(); // get new ADC values |
492 | if(!PollingTimeout) |
493 | if(PollingTimeout == 0) |
493 | { |
494 | { |
494 | PollingTimeout = 5; |
495 | // if(Polling() == 0) DebugOut.Analog[16]++; |
495 | Polling(); |
496 | Polling(); |
496 | DebugOut.Analog[16]++; |
- | |
497 | } |
497 | } |
Line 498... | Line 498... | ||
498 | 498 | ||
499 | VIC_SWITCmd(EXTIT3_ITLine,DISABLE); // clear pending bit |
499 | VIC_SWITCmd(EXTIT3_ITLine,DISABLE); // clear pending bit |
500 | VIC_ITCmd(EXTIT3_ITLine, ENABLE); // enable irq |
500 | VIC_ITCmd(EXTIT3_ITLine, ENABLE); // enable irq |
Line 590... | Line 590... | ||
590 | LED_RED_OFF; |
590 | LED_RED_OFF; |
591 | Settings_GetParamValue(PID_SEND_NMEA, &NMEA_Interval); |
591 | Settings_GetParamValue(PID_SEND_NMEA, &NMEA_Interval); |
592 | UART1_PutString("\r\n"); |
592 | UART1_PutString("\r\n"); |
593 | for (;;) // the endless main loop |
593 | for (;;) // the endless main loop |
594 | { |
594 | { |
- | 595 | PollingTimeout = 5; |
|
595 | Polling(); |
596 | Polling(); |
596 | PollingTimeout = 10; |
- | |
597 | // ---------------- Logging --------------------------------------- |
597 | // ---------------- Logging --------------------------------------- |
- | 598 | ||
598 | if(SD_WatchDog) |
599 | if(SD_WatchDog) |
599 | { |
600 | { |
600 | SD_WatchDog = 30000; |
601 | SD_WatchDog = 30000; |
601 | if(SDCardInfo.Valid == 1) 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 |
602 | if(SDCardInfo.Valid == 1) 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 |
602 | else if(FC.StatusFlags & FC_STATUS_START) SD_LoggingError = 100; |
603 | else if(FC.StatusFlags & FC_STATUS_START) SD_LoggingError = 100; |
603 | if(!SD_WatchDog) UART1_PutString("\n\rSD-Watchdog - Logging aborted\n\r"); |
604 | if(!SD_WatchDog) UART1_PutString("\n\rSD-Watchdog - Logging aborted\n\r"); |
604 | } |
605 | } |
605 | - | ||
606 | /* |
606 | /* |
607 | if(CheckDelay(ftimer)) |
607 | if(CheckDelay(ftimer)) |
608 | { |
608 | { |
Line 609... | Line 609... | ||
609 | 609 |