10 #include "../uart/uart.h"
11 #include "../usbser/usbser.h"
18 static xQueueHandle consoleQueue = NULL;
23 void rtcISRInit (void)
25 #if defined CFG_CONSOLE_USB
26 usbserGetRxQueue (&consoleQueue);
27 #elif defined CFG_CONSOLE_UART0
28 uart0GetRxQueue (&consoleQueue);
29 #elif defined CFG_CONSOLE_UART1
30 uart1GetRxQueue (&consoleQueue);
32 #error "Eeek! No console devices defined!"
39 void rtcISR (void) __attribute__ ((naked));
42 portENTER_SWITCHING_ISR ();
44 portBASE_TYPE taskWoken = pdFALSE;
46 RTC_CCR = (RTC_CCR_CLKEN | RTC_CCR_CLKSRC);
47 SCB_PCONP |= SCB_PCONP_PCRTC;
49 if (RTC_ILR & RTC_ILR_RTCCIF)
53 if (consoleQueue && xQueueSendFromISR (consoleQueue, &c, (portBASE_TYPE) pdFALSE))
56 RTC_ILR = RTC_ILR_RTCCIF;
59 if (RTC_ILR & RTC_ILR_RTCALF)
63 if (consoleQueue && xQueueSendFromISR (consoleQueue, &c, (portBASE_TYPE) pdFALSE))
66 RTC_ILR = RTC_ILR_RTCALF;
69 VIC_VectAddr = (unsigned portLONG) 0;
71 RTC_CCR = (RTC_CCR_CLKEN | RTC_CCR_CLKSRC);
72 SCB_PCONP &= ~SCB_PCONP_PCRTC;
74 portEXIT_SWITCHING_ISR (taskWoken);