/*..........................................................................*/ static void interrupt ISR_tmr() { /* see NOTE01 */ QK_ISR_ENTRY(); /* inform QK-nano about ISR entry */ QF_tickISR(); /* process all time events (timers) */ Video_printNumAt(20, 17, VIDEO_FGND_YELLOW, ++l_tickCtr); QK_ISR_EXIT(); /* inform QK-nano about ISR exit */ }
__interrupt void timerA_ISR(void) { #ifdef NDEBUG __low_power_mode_off_on_exit(); #endif QK_ISR_ENTRY(); /* inform QK-nano about ISR entry */ QF_tickISR(); QK_ISR_EXIT(); /* inform QK-nano about ISR exit */ }
/*..........................................................................*/ static void interrupt ISR_tmr(void) { QK_ISR_ENTRY(); /* inform QK-nano about ISR entry */ QF_tickISR(); /* process all armed time events */ QActive_postISR((QActive *)&AO_Tunnel, TIME_TICK_SIG, 0); QActive_postISR((QActive *)&AO_Ship, TIME_TICK_SIG, 0); QActive_postISR((QActive *)&AO_Missile, TIME_TICK_SIG, 0); QK_ISR_EXIT(); /* inform QK-nano about ISR exit */ }
/*..........................................................................*/ void SysTick_Handler(void) { static uint32_t btn_debounced = USR_SW1; static uint8_t debounce_state = 0U; uint32_t btn; QK_ISR_ENTRY(); /* infrom QK about entering an ISR */ QF_tickISR(); /* process all armed time events */ /* debounce the USER button... */ btn = GPIOF->DATA_Bits[USR_SW1]; /* read the User Sw1 */ switch (debounce_state) { case 0: if (btn != btn_debounced) { debounce_state = 1U; /* transition to the next state */ } break; case 1: if (btn != btn_debounced) { debounce_state = 2U; /* transition to the next state */ } else { debounce_state = 0U; /* transition back to state 0 */ } break; case 2: if (btn != btn_debounced) { debounce_state = 3U; /* transition to the next state */ } else { debounce_state = 0U; /* transition back to state 0 */ } break; case 3: if (btn != btn_debounced) { btn_debounced = btn; /* save the debounced button value */ if (btn == 0U) { /* is the button depressed? */ QActive_postISR((QActive *)&AO_Pelican, PEDS_WAITING_SIG, 0U); } else { /* button released */ } } debounce_state = 0U; /* transition back to state 0 */ break; } QK_ISR_EXIT(); /* inform QK-nano about exiting the ISR */ }
__interrupt void timerB0_ISR(void) { #define DEBUG_INTERRUPT #ifdef DEBUG_INTERRUPT static uint16_t ctr = 0; if(++ctr > (SYSTICK_HZ/2U)) { ctr = 0; LED_toggle(); } #endif //static uint16_t tickISRTime = 0; //uint16_t t1 = TBR; //__low_power_mode_off_on_exit(); QK_ISR_ENTRY(); /* inform QK-nano about ISR entry */ QF_tickISR(); //tickISRTime = TBR - t1; QK_ISR_EXIT(); /* inform QK-nano about ISR exit */ }
void SysTick_Handler(void) { QF_tickISR(); }
/*..........................................................................*/ static void interrupt ISR_tmr() { _enable(); /* enable interrupts */ QF_tickISR(); /*<-- process the QF clock tick */ _disable(); /* disable interrupts again */ outp(0x20, 0x20); /* write EOI to the master PIC */ }