Move M4 MAPP IRQ handler to be with the event handler class.

event.[ch]pp and event_m4.[ch]pp are looking almost the same now...
This commit is contained in:
Jared Boone 2016-01-04 12:44:28 -08:00
parent 0fe5409357
commit 229c1e9a3c
2 changed files with 16 additions and 19 deletions

View File

@ -21,9 +21,6 @@
#include "event_m4.hpp" #include "event_m4.hpp"
#include "lpc43xx_cpp.hpp"
using namespace lpc43xx;
#include "ch.h" #include "ch.h"
Thread* thread_event_loop = nullptr; Thread* thread_event_loop = nullptr;
@ -31,19 +28,3 @@ Thread* thread_event_loop = nullptr;
void events_initialize(Thread* const event_loop_thread) { void events_initialize(Thread* const event_loop_thread) {
thread_event_loop = event_loop_thread; thread_event_loop = event_loop_thread;
} }
extern "C" {
CH_IRQ_HANDLER(MAPP_IRQHandler) {
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
events_flag_isr(EVT_MASK_BASEBAND);
chSysUnlockFromIsr();
creg::m0apptxevent::clear();
CH_IRQ_EPILOGUE();
}
}

View File

@ -117,6 +117,22 @@ static void shutdown() {
halt(); halt();
} }
extern "C" {
CH_IRQ_HANDLER(MAPP_IRQHandler) {
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
events_flag_isr(EVT_MASK_BASEBAND);
chSysUnlockFromIsr();
creg::m0apptxevent::clear();
CH_IRQ_EPILOGUE();
}
}
class EventDispatcher { class EventDispatcher {
public: public:
void run() { void run() {