File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,14 @@ screen = {
7070
7171cms = {
7272 menuOpen = false ,
73+ synced = false ,
7374 init = function (cmsConfig )
7475 screen .config = assert (cmsConfig , " Resolution not supported" )
7576 screen .reset ()
7677 screen .clear ()
7778 protocol .cms .close ()
7879 cms .menuOpen = false
80+ cms .synced = false
7981 end ,
8082 open = function ()
8183 protocol .cms .open (screen .config .rows , screen .config .cols )
@@ -112,6 +114,7 @@ cms = {
112114 screen .buffer = cRleDecode (screen .data )
113115 screen .draw ()
114116 screen .reset ()
117+ cms .synced = true
115118 end
116119 else
117120 protocol .cms .refresh ()
Original file line number Diff line number Diff line change 1- lastMenuEventTime = 0
1+ local lastMenuEventTime = 0
2+ local INTERVAL = 80
23
34local function init ()
45 cms .init (radio )
56end
67
8+ local function stickMovement ()
9+ local threshold = 30
10+ return math.abs (getValue (' ele' )) > threshold or math.abs (getValue (' ail' )) > threshold or math.abs (getValue (' rud' )) > threshold
11+ end
12+
713local function run (event )
8- lastMenuEventTime = getTime ()
14+ if stickMovement () then
15+ cms .synced = false
16+ lastMenuEventTime = getTime ()
17+ end
918 cms .update ()
1019 if (cms .menuOpen == false ) then
1120 cms .open ()
1221 end
13- if (event == radio .refresh .event ) then
22+ if (event == radio .refresh .event ) or ( lastMenuEventTime + INTERVAL < getTime () and not cms . synced ) then
1423 cms .refresh ()
1524 end
1625 if (event == EVT_VIRTUAL_EXIT ) then
You can’t perform that action at this time.
0 commit comments