IRQ: Make handlers more independent of EventDispatcher.

EventDispatcher is such a hairball...
This commit is contained in:
Jared Boone 2017-01-31 12:02:51 -08:00
parent f4fdc21c20
commit bf7f5d2567
4 changed files with 18 additions and 17 deletions

View file

@ -27,8 +27,11 @@
using namespace lpc43xx;
#include "event_m0.hpp"
static Thread* thread_rtc_event = NULL;
void rtc_interrupt_enable() {
thread_rtc_event = chThdSelf();
rtc::interrupt::enable_second_inc();
nvicEnableVector(RTC_IRQn, CORTEX_PRIORITY_MASK(LPC_RTC_IRQ_PRIORITY));
}
@ -39,7 +42,7 @@ CH_IRQ_HANDLER(RTC_IRQHandler) {
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
EventDispatcher::event_isr_rtc_tick();
chEvtSignalI(thread_rtc_event, EVT_MASK_RTC_TICK);
chSysUnlockFromIsr();
rtc::interrupt::clear_all();