mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-06 05:47:52 +00:00
#766 Strange Flickering in OTX
Strange Flickering happening on OTX. Refreshing the screen on every cycle fixed the problem
This commit is contained in:
parent
d97c2fc85c
commit
8d7b472f0e
@ -37,6 +37,8 @@ local DISP_ATTR = dsmLib.DISP_ATTR
|
|||||||
|
|
||||||
local DSM_Context = dsmLib.DSM_Context
|
local DSM_Context = dsmLib.DSM_Context
|
||||||
|
|
||||||
|
local IS_EDGETX = false -- DEFAULT until Init changed it
|
||||||
|
|
||||||
local LCD_W_USABLE = LCD_W-10
|
local LCD_W_USABLE = LCD_W-10
|
||||||
-- X for Menu Lines
|
-- X for Menu Lines
|
||||||
local LCD_X_LINE_MENU = 10
|
local LCD_X_LINE_MENU = 10
|
||||||
@ -383,6 +385,10 @@ local function GUI_HandleEvent(event, touchState)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function init_screen_pos()
|
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
|
if LCD_W == 480 then -- TX16
|
||||||
-- use defaults in the script header
|
-- use defaults in the script header
|
||||||
elseif LCD_W == 128 then --TX12 (128x64) -- Still needs some work on the vertical
|
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
|
refreshInterval = 20 -- 200ms
|
||||||
end
|
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
|
-- 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()
|
GUI_Display()
|
||||||
ctx.Refresh_Display=false
|
ctx.Refresh_Display=false
|
||||||
lastRefresh=getTime()
|
lastRefresh=getTime()
|
||||||
|
@ -76,7 +76,7 @@ local LCD_MENU_BGCOLOR = MENU_TITLE_BGCOLOR
|
|||||||
-- LINE SELECTED
|
-- LINE SELECTED
|
||||||
local LCD_SELECTED_COLOR = TEXT_INVERTED_COLOR
|
local LCD_SELECTED_COLOR = TEXT_INVERTED_COLOR
|
||||||
local LCD_SELECTED_BGCOLOR = TEXT_INVERTED_BGCOLOR
|
local LCD_SELECTED_BGCOLOR = TEXT_INVERTED_BGCOLOR
|
||||||
local LCD_EDIT_BGCOLOR = WARNING_COLOR
|
local LCD_EDIT_BGCOLOR = MENU_TITLE_BGCOLOR -- WARNING_COLOR
|
||||||
-- NORMAL TEXT
|
-- NORMAL TEXT
|
||||||
local LCD_NORMAL_COLOR = TEXT_COLOR
|
local LCD_NORMAL_COLOR = TEXT_COLOR
|
||||||
local LCD_DISABLE_COLOR = TEXT_DISABLE_COLOR
|
local LCD_DISABLE_COLOR = TEXT_DISABLE_COLOR
|
||||||
@ -628,8 +628,10 @@ local function DSM_Run(event,touchState)
|
|||||||
refreshInterval = 20 -- 200ms
|
refreshInterval = 20 -- 200ms
|
||||||
end
|
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
|
-- 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()
|
GUI_Display()
|
||||||
ctx.Refresh_Display=false
|
ctx.Refresh_Display=false
|
||||||
lastRefresh=getTime()
|
lastRefresh=getTime()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user