Move event.* code into event_m[04].*.

Slightly more duplication of code now. Need a base class...
This commit is contained in:
Jared Boone
2016-01-12 22:00:42 -08:00
parent e73a9f98a1
commit 731cea1b96
11 changed files with 42 additions and 30 deletions

View File

@@ -44,7 +44,7 @@ constexpr auto EVT_MASK_SPECTRUM = EVENT_MASK(1);
class EventDispatcher {
public:
void run() {
events_initialize(chThdSelf());
thread_event_loop = chThdSelf();
lpc43xx::creg::m0apptxevent::enable();
baseband_thread.thread_main = chThdSelf();
@@ -63,7 +63,21 @@ public:
is_running = false;
}
static inline void events_flag(const eventmask_t events) {
if( thread_event_loop ) {
chEvtSignal(thread_event_loop, events);
}
}
static inline void events_flag_isr(const eventmask_t events) {
if( thread_event_loop ) {
chEvtSignalI(thread_event_loop, events);
}
}
private:
static Thread* thread_event_loop;
BasebandThread baseband_thread;
RSSIThread rssi_thread;