Rev 368 | Rev 378 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 368 | Rev 369 | ||
---|---|---|---|
Line 377... | Line 377... | ||
377 | // used is for critical timing parts that normaly would handled |
377 | // used is for critical timing parts that normaly would handled |
378 | // within the main loop that could block longer at logging activities |
378 | // within the main loop that could block longer at logging activities |
379 | void EXTIT3_IRQHandler(void) |
379 | void EXTIT3_IRQHandler(void) |
380 | { |
380 | { |
381 | IENABLE; |
381 | IENABLE; |
382 | - | ||
383 | VIC_ITCmd(EXTIT3_ITLine,DISABLE); // disable irq |
382 | VIC_ITCmd(EXTIT3_ITLine,DISABLE); // disable irq |
384 | VIC_SWITCmd(EXTIT3_ITLine,DISABLE); // clear pending bit |
383 | VIC_SWITCmd(EXTIT3_ITLine,DISABLE); // clear pending bit |
385 | Compass_Update(); // update compass communication |
384 | Compass_Update(); // update compass communication |
386 | Analog_Update(); // get new ADC values |
385 | Analog_Update(); // get new ADC values |
387 | VIC_ITCmd(EXTIT3_ITLine, ENABLE); // enable irq |
386 | VIC_ITCmd(EXTIT3_ITLine, ENABLE); // enable irq |
388 | - | ||
389 | IDISABLE; |
387 | IDISABLE; |
390 | } |
388 | } |
Line 391... | Line 389... | ||
391 | 389 | ||
392 | //---------------------------------------------------------------------------------------------------- |
390 | //---------------------------------------------------------------------------------------------------- |
Line 471... | Line 469... | ||
471 | Debug_OK("START"); |
469 | Debug_OK("START"); |
472 | UART1_PutString("\r\n"); |
470 | UART1_PutString("\r\n"); |
Line 473... | Line 471... | ||
473 | 471 | ||
474 | for (;;) // the endless main loop |
472 | for (;;) // the endless main loop |
475 | { |
473 | { |
476 | MainWatchDog = 3500; // stop communication to FC after this timeout |
474 | MainWatchDog = 4500; // stop communication to FC after this timeout |
477 | UART0_ProcessRxData(); // process request |
475 | UART0_ProcessRxData(); // process request |
478 | UART1_ProcessRxData(); // process request |
- | |
479 | USB_ProcessRxData(); // process request |
476 | UART1_ProcessRxData(); // process request |
480 | UART0_TransmitTxData(); // send answer |
477 | UART0_TransmitTxData(); // send answer |
481 | UART1_TransmitTxData(); // send answer |
478 | UART1_TransmitTxData(); // send answer |
482 | UART2_TransmitTxData(); // send answer |
- | |
483 | USB_TransmitTxData(); // send answer |
479 | UART2_TransmitTxData(); // send answer |
- | 480 | SPI0_UpdateBuffer(); // handle new SPI Data |
|
- | 481 | // USB_ProcessRxData(); // process request |
|
Line 484... | Line 482... | ||
484 | SPI0_UpdateBuffer(); // handle new SPI Data |
482 | // USB_TransmitTxData(); // send answer |
485 | 483 | ||
486 | // ---------------- Error Check Timing ---------------------------- |
484 | // ---------------- Error Check Timing ---------------------------- |
487 | if(CheckDelay(TimerCheckError)) |
485 | if(CheckDelay(TimerCheckError)) |
Line 499... | Line 497... | ||
499 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
497 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
500 | } |
498 | } |
501 | // ---------------- Logging --------------------------------------- |
499 | // ---------------- Logging --------------------------------------- |
502 | if(SD_WatchDog) |
500 | if(SD_WatchDog) |
503 | { |
501 | { |
504 | SD_WatchDog = 3000; |
502 | SD_WatchDog = 4000; |
505 | 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 |
503 | 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 |
506 | else if(FC.StatusFlags & FC_STATUS_START) SD_LoggingError = 100; |
504 | else if(FC.StatusFlags & FC_STATUS_START) SD_LoggingError = 100; |
507 | if(!SD_WatchDog) UART1_PutString("\n\rSD-Watchdog - Logging aborted\n\r"); |
505 | if(!SD_WatchDog) UART1_PutString("\n\rSD-Watchdog - Logging aborted\n\r"); |
508 | } |
506 | } |
509 | /* |
507 | /* |