Skip to content

Commit

Permalink
fix(bw): LONG press RTN to exit Lua script closes tools menu (#5417)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Aug 12, 2024
1 parent c18f358 commit 8443b50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions radio/src/lua/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,7 @@ static bool resumeLua(bool init, bool allowLcdUsage)
luaNextEvent(&evt);
if (evt.event == EVT_KEY_LONG(KEY_EXIT)) {
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
killEvents(evt.event);
}
}

Expand Down Expand Up @@ -1214,12 +1215,14 @@ static bool resumeLua(bool init, bool allowLcdUsage)
TRACE("Script force exit");
luaEmptyEventBuffer();
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
killEvents(evt.event);
}
#if defined(KEYS_GPIO_REG_MENU)
// TODO find another key and add a #define
else if (evt.event == EVT_KEY_LONG(KEY_MENU)) {
luaEmptyEventBuffer();
luaDisplayStatistics = !luaDisplayStatistics;
killEvents(evt.event);
}
#endif
}
Expand Down

0 comments on commit 8443b50

Please sign in to comment.