@@ -124,15 +124,6 @@ static void ghostmoduleconfig_cb(lv_event_t* e)
124
124
}
125
125
}
126
126
127
- #if defined(HARDWARE_KEYS) && !defined(PCBPL18)
128
- void RadioGhostModuleConfig::onCancel ()
129
- {
130
- reusableBuffer.ghostMenu .buttonAction = GHST_BTN_JOYLEFT;
131
- reusableBuffer.ghostMenu .menuAction = GHST_MENU_CTRL_NONE;
132
- moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
133
- }
134
- #endif
135
-
136
127
RadioGhostModuleConfig::RadioGhostModuleConfig (uint8_t moduleIdx) :
137
128
Page(ICON_RADIO_TOOLS), moduleIdx(moduleIdx)
138
129
{
@@ -162,21 +153,23 @@ void RadioGhostModuleConfig::buildBody(Window* window)
162
153
}
163
154
164
155
#if defined(HARDWARE_KEYS) && !defined(PCBPL18)
165
- void RadioGhostModuleConfig::onEvent ( event_t event )
156
+ void RadioGhostModuleConfig::onCancel ( )
166
157
{
167
- switch (event) {
168
- case EVT_KEY_LONG (KEY_EXIT):
169
- memclear (&reusableBuffer.ghostMenu , sizeof (reusableBuffer.ghostMenu ));
170
- reusableBuffer.ghostMenu .buttonAction = GHST_BTN_NONE;
171
- reusableBuffer.ghostMenu .menuAction = GHST_MENU_CTRL_CLOSE;
172
- moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
173
- RTOS_WAIT_MS (10 );
174
- Page::onEvent (event);
158
+ reusableBuffer.ghostMenu .buttonAction = GHST_BTN_JOYLEFT;
159
+ reusableBuffer.ghostMenu .menuAction = GHST_MENU_CTRL_NONE;
160
+ moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
161
+ }
162
+
163
+ void RadioGhostModuleConfig::onLongPressRTN ()
164
+ {
165
+ memclear (&reusableBuffer.ghostMenu , sizeof (reusableBuffer.ghostMenu ));
166
+ reusableBuffer.ghostMenu .buttonAction = GHST_BTN_NONE;
167
+ reusableBuffer.ghostMenu .menuAction = GHST_MENU_CTRL_CLOSE;
168
+ moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
169
+ RTOS_WAIT_MS (10 );
175
170
#if defined(TRIMS_EMULATE_BUTTONS)
176
- setHatsAsKeys (false ); // switch trims back to normal
171
+ setHatsAsKeys (false ); // switch trims back to normal
177
172
#endif
178
- break ;
179
- }
180
173
}
181
174
182
175
void RadioGhostModuleConfig::checkEvents ()
0 commit comments