diff --git a/radio/src/gui/colorlcd/radio_ghost_module_config.cpp b/radio/src/gui/colorlcd/radio_ghost_module_config.cpp index f5a835452..0fc095160 100644 --- a/radio/src/gui/colorlcd/radio_ghost_module_config.cpp +++ b/radio/src/gui/colorlcd/radio_ghost_module_config.cpp @@ -134,10 +134,24 @@ void RadioGhostModuleConfig::onEvent(event_t event) reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_CLOSE; moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL; RTOS_WAIT_MS(10); - deleteLater(); + Page::onEvent(event); break; } - Page::onEvent(event); +} + +void RadioGhostModuleConfig::checkEvents() +{ + Page::checkEvents(); + + if (reusableBuffer.ghostMenu.menuStatus == GHST_MENU_STATUS_UNOPENED) { // Handles situation where module is plugged after tools start + reusableBuffer.ghostMenu.buttonAction = GHST_BTN_NONE; + reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_OPEN; + moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL; + } + else if (reusableBuffer.ghostMenu.menuStatus == GHST_MENU_STATUS_CLOSING) { + RTOS_WAIT_MS(10); + deleteLater(); + } } #endif diff --git a/radio/src/gui/colorlcd/radio_ghost_module_config.h b/radio/src/gui/colorlcd/radio_ghost_module_config.h index 5a5264615..42f209052 100644 --- a/radio/src/gui/colorlcd/radio_ghost_module_config.h +++ b/radio/src/gui/colorlcd/radio_ghost_module_config.h @@ -30,6 +30,7 @@ class RadioGhostModuleConfig: public Page #if defined(HARDWARE_KEYS) void onEvent(event_t event) override; + void checkEvents(); #endif protected: