mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-13 08:33:39 +00:00
Expose static EventDispatcher to stop main loop.
Used to fix reboot into HackRF firmware.
This commit is contained in:
parent
57293bc5eb
commit
c52f5fa26c
@ -90,6 +90,7 @@ private:
|
|||||||
|
|
||||||
static MessageHandlerMap message_map;
|
static MessageHandlerMap message_map;
|
||||||
Thread* EventDispatcher::thread_event_loop = nullptr;
|
Thread* EventDispatcher::thread_event_loop = nullptr;
|
||||||
|
bool EventDispatcher::is_running = false;
|
||||||
|
|
||||||
EventDispatcher::EventDispatcher(
|
EventDispatcher::EventDispatcher(
|
||||||
ui::Widget* const top_widget,
|
ui::Widget* const top_widget,
|
||||||
@ -101,6 +102,7 @@ EventDispatcher::EventDispatcher(
|
|||||||
init_message_queues();
|
init_message_queues();
|
||||||
|
|
||||||
thread_event_loop = chThdSelf();
|
thread_event_loop = chThdSelf();
|
||||||
|
is_running = true;
|
||||||
touch_manager.on_event = [this](const ui::TouchEvent event) {
|
touch_manager.on_event = [this](const ui::TouchEvent event) {
|
||||||
this->on_touch_event(event);
|
this->on_touch_event(event);
|
||||||
};
|
};
|
||||||
|
@ -50,7 +50,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
void request_stop();
|
static void request_stop();
|
||||||
|
|
||||||
void set_display_sleep(const bool sleep);
|
void set_display_sleep(const bool sleep);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ private:
|
|||||||
ui::Painter painter;
|
ui::Painter painter;
|
||||||
ui::Context& context;
|
ui::Context& context;
|
||||||
uint32_t encoder_last = 0;
|
uint32_t encoder_last = 0;
|
||||||
bool is_running = true;
|
static bool is_running;
|
||||||
bool sd_card_present = false;
|
bool sd_card_present = false;
|
||||||
bool display_sleep = false;
|
bool display_sleep = false;
|
||||||
bool halt = false;
|
bool halt = false;
|
||||||
|
@ -251,8 +251,8 @@ Context& SystemView::context() const {
|
|||||||
/* HackRFFirmwareView ****************************************************/
|
/* HackRFFirmwareView ****************************************************/
|
||||||
|
|
||||||
HackRFFirmwareView::HackRFFirmwareView(NavigationView& nav) {
|
HackRFFirmwareView::HackRFFirmwareView(NavigationView& nav) {
|
||||||
button_yes.on_select = [&nav](Button&){
|
button_yes.on_select = [](Button&){
|
||||||
m4_request_shutdown();
|
EventDispatcher::request_stop();
|
||||||
};
|
};
|
||||||
|
|
||||||
button_no.on_select = [&nav](Button&){
|
button_no.on_select = [&nav](Button&){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user