Skip to content

Commit

Permalink
fixes #3253 clears LUA key event buffer after switching to telemetry …
Browse files Browse the repository at this point in the history
…view
  • Loading branch information
bug400 authored and pfeerick committed Oct 18, 2023
1 parent 4ae4a7c commit 49a3886
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions radio/src/lua/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,18 @@ static bool resumeLua(bool init, bool allowLcdUsage)
bool scriptWasRun = false;
bool fullGC = !allowLcdUsage;
static uint8_t luaDisplayStatistics = false;

#if defined(PCBTARANIS)
static MenuHandlerFunc oldMenuHandler= (MenuHandlerFunc) NULL;

// clear event buffer after switching to telemetry view
if(menuHandlers[menuLevel]== menuViewTelemetry) {
if(oldMenuHandler!= menuViewTelemetry) luaEmptyEventBuffer();
}
oldMenuHandler= menuHandlers[menuLevel];
#endif


// Run in the right interactive mode
if (lua_status(lsScripts) == LUA_YIELD && allowLcdUsage != luaLcdAllowed) {
#if defined(PCBTARANIS)
Expand Down

0 comments on commit 49a3886

Please sign in to comment.