mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
Make lcd.clear() color aware on color screens (#4504)
* Make lcd.clear() color aware on color screens * Compilation fix
This commit is contained in:
parent
86d897b23f
commit
1910af51b6
2 changed files with 11 additions and 5 deletions
|
@ -39,21 +39,29 @@ static int luaLcdRefresh(lua_State *L)
|
|||
}
|
||||
|
||||
/*luadoc
|
||||
@function lcd.clear()
|
||||
@function lcd.clear([color])
|
||||
|
||||
Clear the LCD screen
|
||||
|
||||
@param color (optionnal, only on color screens)
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
|
||||
@notice This function only works in stand-alone and telemetry scripts.
|
||||
*/
|
||||
static int luaLcdClear(lua_State *L)
|
||||
{
|
||||
if (luaLcdAllowed) lcdClear();
|
||||
if (luaLcdAllowed) {
|
||||
#if defined(COLORLCD)
|
||||
LcdFlags color = luaL_optunsigned(L, 1, TEXT_BGCOLOR);
|
||||
lcd->clear(color);
|
||||
#else
|
||||
lcdClear();
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*luadoc
|
||||
@function lcd.drawPoint(x, y)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue