mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-21 06:51:01 +00:00
Move event.* code into event_m[04].*.
Slightly more duplication of code now. Need a base class...
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user