/*..........................................................................*/ static void interrupt tmrISR(void) { dispPreemptions(TMR_ISR_PRIO); /* for testing only, NOTE01 */ QK_ISR_ENTRY(); /* inform QK-nano about entering the ISR */ QF_tick(); /* process all armed time events */ BSP_busyDelay(); /* for testing, NOTE02 */ QK_ISR_EXIT(); /* inform QK-nano about exiting the ISR */ }
//............................................................................ void interrupt ISR_tmr(void) { dispPreemptions(TMR_ISR_PRIO); // for testing only, NOTE01 QK_ISR_ENTRY(); // inform QK about entering the ISR QF::tick(); // call QF_tick() outside of critical section #ifdef Q_SPY l_tickTime += 0x10000; // add 16-bit rollover #endif busyDelay(); // for testing, NOTE02 QK_ISR_EXIT(); // inform QK about exiting the ISR }
/*..........................................................................*/ static void interrupt kbdISR() { uint8_t key = inport(0x60); /* key scan code from 8042 kbd controller */ uint8_t kcr = inport(0x61); /* get keyboard control register */ dispPreemptions(KBD_ISR_PRIO); /* for testing only, NOTE01 */ QK_ISR_ENTRY(); /* inform QK-nano about entering the ISR */ outportb(0x61, (uint8_t)(kcr | 0x80)); /* toggle acknowledge bit high */ outportb(0x61, kcr); /* toggle acknowledge bit low */ if (key == (uint8_t)129) { /* ESC key pressed? */ QActive_postISR((QActive *)&AO_Table, TERMINATE_SIG, 0); } Video_printNumAt(60, 12 + 0, VIDEO_FGND_YELLOW, key);/* display the key */ BSP_busyDelay(); /* for testing, NOTE02 */ QK_ISR_EXIT(); /* inform QK-nano about exiting the ISR */ }
//............................................................................ void interrupt ISR_kbd(void) { dispPreemptions(KBD_ISR_PRIO); // for testing only, NOTE01 QK_ISR_ENTRY(); // inform QK about entering the ISR uint8_t key = inp(0x60); // key code from the 8042 kbd controller uint8_t kcr = inp(0x61); // get keyboard control register outp(0x61, (uint8_t)(kcr | 0x80)); // toggle acknowledge bit high outp(0x61, kcr); // toggle acknowledge bit low if (key == (uint8_t)129) { // ESC key pressed? static QEvent term = {TERMINATE_SIG, 0}; // static event QF::publish(&term); // publish to all interested AOs } else { static QEvent test = {TEST_SIG, 0}; // static event AO_Table->postFIFO(&test); // post a test event to Table } Video::printNumAt(60, 12 + 0, Video::FGND_YELLOW, key); // display key busyDelay(); // for testing, NOTE02 QK_ISR_EXIT(); // inform QK about exiting the ISR }