Skip to content

Commit

Permalink
feat(lua): Exposes screenshot functionality to Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
rotorman authored Jun 13, 2024
1 parent b4e33fc commit 6eadd48
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions radio/src/lua/api_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,27 @@ static int luaPlayTone(lua_State * L)
return 0;
}

/*luadoc
@function screenshot()
Takes a screenshot
@retval none
@status current Introduced in 2.11
// targets: BW, COLOR
//
// EXAMPLES:
// screenshot()
*/
static int luaScreenshot(lua_State * L)
{
UNUSED(L);
writeScreenshot();
return 0;
}

/*luadoc
@function playHaptic(duration, pause [, flags])
Expand Down Expand Up @@ -2927,6 +2948,7 @@ LROT_BEGIN(etxlib, NULL, 0)
LROT_FUNCENTRY( playTone, luaPlayTone )
LROT_FUNCENTRY( playHaptic, luaPlayHaptic )
LROT_FUNCENTRY( flushAudio, luaFlushAudio )
LROT_FUNCENTRY( screenshot, luaScreenshot )
#if defined(ENABLE_LUA_POPUP_INPUT)
LROT_FUNCENTRY( popupInput, luaPopupInput )
#endif
Expand Down

0 comments on commit 6eadd48

Please sign in to comment.