Skip to content

Commit c858fca

Browse files
fix: remove KEYS_GPIO_REG_MENU
1 parent 5afb123 commit c858fca

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

radio/src/gui/common/stdlcd/radio_sdmanager.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,12 @@ void menuRadioSdManager(event_t _event)
304304

305305
switch (_event) {
306306

307-
#if defined(KEYS_GPIO_REG_MENU)
308307
case EVT_KEY_LONG(KEY_MENU):
309308
if (SD_CARD_PRESENT() && s_editMode == 0) {
310309
POPUP_MENU_ADD_ITEM(STR_SD_INFO);
311310
POPUP_MENU_START(onSdManagerMenu);
312311
}
313312
break;
314-
#endif
315313

316314
case EVT_KEY_BREAK(KEY_EXIT):
317315
REFRESH_FILES();

radio/src/lua/api_general.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,11 +1694,12 @@ Stops key state machine. See [Key Events](../key_events.md) for the detailed des
16941694
*/
16951695
static int luaKillEvents(lua_State * L)
16961696
{
1697-
#if defined(KEYS_GPIO_REG_MENU)
1698-
#define IS_MASKABLE(key) \
1699-
((key) != KEY_EXIT && (key) != KEY_ENTER && \
1700-
((scriptInternalData[0].reference == SCRIPT_STANDALONE) || \
1701-
(key) != KEY_PAGEDN))
1697+
#if !defined(COLORLCD)
1698+
#define IS_KEY_AVAIL(key) (keysGetSupported() & (1 << (key)))
1699+
#define IS_STANDALONE() (scriptInternalData[0].reference == SCRIPT_STANDALONE)
1700+
#define IS_MASKABLE(key) \
1701+
((key) != KEY_EXIT && (key) != KEY_ENTER && \
1702+
(!IS_KEY_AVAIL(KEY_MENU) || (IS_STANDALONE() || ((key) != KEY_PAGEDN))))
17021703
#else
17031704
#define IS_MASKABLE(key) ((key) != KEY_EXIT && (key) != KEY_ENTER)
17041705
#endif
@@ -1711,6 +1712,12 @@ static int luaKillEvents(lua_State * L)
17111712
luaEmptyEventBuffer();
17121713
}
17131714
return 0;
1715+
1716+
#undef IS_MASKABLE
1717+
#if !defined(COLORLCD)
1718+
#undef IS_STANDALONE
1719+
#undef IS_KEY_AVAIL
1720+
#endif
17141721
}
17151722

17161723
#if LCD_DEPTH > 1 && !defined(COLORLCD)

radio/src/lua/interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,8 @@ static bool resumeLua(bool init, bool allowLcdUsage)
12411241
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
12421242
killEvents(evt.event);
12431243
}
1244-
#if defined(KEYS_GPIO_REG_MENU)
1245-
// TODO find another key and add a #define
1244+
#if !defined(COLORLCD)
1245+
// TODO find another key
12461246
else if (evt.event == EVT_KEY_LONG(KEY_MENU)) {
12471247
luaEmptyEventBuffer();
12481248
luaDisplayStatistics = !luaDisplayStatistics;

0 commit comments

Comments
 (0)