diff --git a/Lua_scripts/DSM FwdPrg_05_BW.lua b/Lua_scripts/DSM FwdPrg_05_BW.lua index 527701a..1865aad 100644 --- a/Lua_scripts/DSM FwdPrg_05_BW.lua +++ b/Lua_scripts/DSM FwdPrg_05_BW.lua @@ -37,6 +37,8 @@ local DISP_ATTR = dsmLib.DISP_ATTR local DSM_Context = dsmLib.DSM_Context +local IS_EDGETX = false -- DEFAULT until Init changed it + local LCD_W_USABLE = LCD_W-10 -- X for Menu Lines local LCD_X_LINE_MENU = 10 @@ -383,6 +385,10 @@ local function GUI_HandleEvent(event, touchState) end local function init_screen_pos() + -- osName in OpenTX is nil, otherwise is EDGETX + local ver, radio, maj, minor, rev, osname = getVersion() + IS_EDGETX = osname~=nil + if LCD_W == 480 then -- TX16 -- use defaults in the script header elseif LCD_W == 128 then --TX12 (128x64) -- Still needs some work on the vertical @@ -440,8 +446,10 @@ local function DSM_Run(event) refreshInterval = 20 -- 200ms end + if (not IS_EDGETX) then -- OPENTX NEEDS REFRESH ON EVERY CYCLE + GUI_Display() -- Refresh display only if needed and no faster than 500ms, utilize more CPU to speedup DSM communications - if (ctx.Refresh_Display and (getTime()-lastRefresh) > refreshInterval) then --300ms from last refresh + elseif (ctx.Refresh_Display and (getTime()-lastRefresh) > refreshInterval) then --300ms from last refresh GUI_Display() ctx.Refresh_Display=false lastRefresh=getTime() diff --git a/Lua_scripts/DSM FwdPrg_05_Color.lua b/Lua_scripts/DSM FwdPrg_05_Color.lua index bb5a497..4086c6b 100644 --- a/Lua_scripts/DSM FwdPrg_05_Color.lua +++ b/Lua_scripts/DSM FwdPrg_05_Color.lua @@ -76,7 +76,7 @@ local LCD_MENU_BGCOLOR = MENU_TITLE_BGCOLOR -- LINE SELECTED local LCD_SELECTED_COLOR = TEXT_INVERTED_COLOR local LCD_SELECTED_BGCOLOR = TEXT_INVERTED_BGCOLOR -local LCD_EDIT_BGCOLOR = WARNING_COLOR +local LCD_EDIT_BGCOLOR = MENU_TITLE_BGCOLOR -- WARNING_COLOR -- NORMAL TEXT local LCD_NORMAL_COLOR = TEXT_COLOR local LCD_DISABLE_COLOR = TEXT_DISABLE_COLOR @@ -628,8 +628,10 @@ local function DSM_Run(event,touchState) refreshInterval = 20 -- 200ms end + if (not IS_EDGETX) then -- OPENTX NEEDS REFRESH ON EVERY CYCLE + GUI_Display() -- Refresh display only if needed and no faster than 300ms, utilize more CPU to speedup DSM communications - if (ctx.Refresh_Display and (getTime()-lastRefresh) > refreshInterval) then --300ms from last refresh + elseif (ctx.Refresh_Display and (getTime()-lastRefresh) > refreshInterval) then --300ms from last refresh GUI_Display() ctx.Refresh_Display=false lastRefresh=getTime()