mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
Fixes #1796 - needs tests on the nightly builds. Caution I removed the
lcd.lock() function completely
This commit is contained in:
parent
ed16ed9cc4
commit
1066176b0f
5 changed files with 4 additions and 23 deletions
|
@ -298,13 +298,6 @@ void lcdSetContrast();
|
|||
extern display_t lcd_buf[DISPLAY_BUF_SIZE];
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
extern bool lcd_locked;
|
||||
#define LCD_LOCKED() lcd_locked
|
||||
#else
|
||||
#define LCD_LOCKED() 0
|
||||
#endif
|
||||
|
||||
char * strAppend(char * dest, const char * source);
|
||||
char * strAppendDate(char * str, bool time=false);
|
||||
char * strAppendFilename(char * dest, const char * filename, const int size);
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
|
||||
display_t displayBuf[DISPLAY_BUF_SIZE];
|
||||
|
||||
#if defined(LUA)
|
||||
bool lcd_locked = false;
|
||||
#endif
|
||||
|
||||
void lcd_clear()
|
||||
{
|
||||
memset(displayBuf, 0, sizeof(displayBuf));
|
||||
|
|
|
@ -346,12 +346,6 @@ static int luaGetGeneralSettings(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int luaLcdLock(lua_State *L)
|
||||
{
|
||||
lcd_locked = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int luaLcdClear(lua_State *L)
|
||||
{
|
||||
lcd_clear();
|
||||
|
@ -1522,7 +1516,6 @@ const luaL_Reg modelLib[] = {
|
|||
};
|
||||
|
||||
const luaL_Reg lcdLib[] = {
|
||||
{ "lock", luaLcdLock },
|
||||
{ "clear", luaLcdClear },
|
||||
{ "getLastPos", luaLcdGetLastPos },
|
||||
{ "drawPoint", luaLcdDrawPoint },
|
||||
|
@ -2029,8 +2022,6 @@ void luaDoGc()
|
|||
|
||||
void luaTask(uint8_t evt)
|
||||
{
|
||||
lcd_locked = false;
|
||||
|
||||
uint32_t t0 = get_tmr10ms();
|
||||
static uint32_t lastLuaTime = 0;
|
||||
uint16_t interval = (lastLuaTime == 0 ? 0 : (t0 - lastLuaTime));
|
||||
|
|
|
@ -2420,7 +2420,7 @@ void perMain()
|
|||
const char *warn = s_warning;
|
||||
uint8_t menu = s_menu_count;
|
||||
|
||||
if (!LCD_LOCKED()) {
|
||||
if (!LUA_STANDALONE_SCRIPT_RUNNING()) {
|
||||
lcd_clear();
|
||||
if (menuEvent) {
|
||||
m_posVert = menuEvent == EVT_ENTRY_UP ? g_menuPos[g_menuStackPtr] : 0;
|
||||
|
@ -2436,7 +2436,7 @@ void perMain()
|
|||
luaTask(evt);
|
||||
#endif
|
||||
|
||||
if (!LCD_LOCKED()) {
|
||||
if (!LUA_STANDALONE_SCRIPT_RUNNING()) {
|
||||
if (warn) DISPLAY_WARNING(evt);
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
if (menu) {
|
||||
|
|
|
@ -1566,7 +1566,7 @@ enum AUDIO_SOUNDS {
|
|||
#define luaGetCpuUsed(idx) scriptInternalData[idx].instructions
|
||||
#define LUA_LOAD_MODEL_SCRIPTS() luaState |= INTERPRETER_RELOAD_PERMANENT_SCRIPTS
|
||||
#define LUA_LOAD_MODEL_SCRIPT(idx) luaState |= INTERPRETER_RELOAD_PERMANENT_SCRIPTS
|
||||
|
||||
#define LUA_STANDALONE_SCRIPT_RUNNING() (luaState == INTERPRETER_RUNNING_STANDALONE_SCRIPT)
|
||||
// Lua PROTECT/UNPROTECT
|
||||
#include <setjmp.h>
|
||||
struct our_longjmp {
|
||||
|
@ -1583,6 +1583,7 @@ enum AUDIO_SOUNDS {
|
|||
#else
|
||||
#define LUA_LOAD_MODEL_SCRIPTS()
|
||||
#define LUA_LOAD_MODEL_SCRIPT(idx)
|
||||
#define LUA_STANDALONE_SCRIPT_RUNNING() (0)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue