Skip to content

Commit a24a65d

Browse files
pazosFrenzie
authored andcommitted
[Android] some tolino/nook waveform fixes (koreader#933)
1 parent 9eba0f5 commit a24a65d

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

ffi/framebuffer_android.lua

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ local has_eink_full_support = android.isEinkFull()
1515
local rk_full, rk_partial, rk_a2, rk_auto = 1, 2, 3, 4 -- luacheck: ignore
1616

1717
-- for *some* freescale devices
18-
local ntx_du, ntx_gc16, ntx_auto, ntx_regal, ntx_full = 1, 2, 5, 7, 34 -- luacheck: ignore
18+
local update_full, update_partial = 32, 0 -- luacheck: ignore
19+
local waveform_du, waveform_gc16, waveform_regal = 1, 2, 7 -- luacheck: ignore
20+
local partial_du, partial_gc16, partial_regal = waveform_du, waveform_gc16, waveform_regal -- luacheck: ignore
21+
local full_gc16, full_regal = update_full + waveform_gc16, update_full + waveform_regal -- luacheck: ignore
1922

2023
-- update a region of the screen
2124
local function updatePartial(mode, delay, x, y, w, h)
@@ -38,11 +41,12 @@ local function updateFull()
3841
-- freescale ntx platform
3942
if has_eink_screen and (eink_platform == "freescale") then
4043
if has_eink_full_support then
41-
-- we handle the screen entirely. Add a delay before a full update.
42-
updatePartial(ntx_full, 50)
44+
-- we handle the screen entirely. No delay is needed
45+
updatePartial(full_gc16, 0)
4346
else
44-
-- we're racing against system driver, update without delay to avoid artifacts
45-
updatePartial(ntx_full, 0)
47+
-- we're racing against system driver. Let the system win and apply
48+
-- a full update after it.
49+
updatePartial(full_gc16, 500)
4650
end
4751
-- rockchip rk3x platform
4852
elseif has_eink_screen and (eink_platform == "rockchip") then
@@ -115,35 +119,35 @@ end
115119
function framebuffer:refreshPartialImp(x, y, w, h)
116120
self:_updateWindow()
117121
if has_eink_full_support then
118-
updatePartial(ntx_auto, 0, x, y, w, h)
122+
updatePartial(partial_regal, 0, x, y, w, h)
119123
end
120124
end
121125

122126
function framebuffer:refreshFlashPartialImp(x, y, w, h)
123127
self:_updateWindow()
124128
if has_eink_full_support then
125-
updatePartial(ntx_gc16, 0, x, y, w, h)
129+
updatePartial(full_regal, 0, x, y, w, h)
126130
end
127131
end
128132

129133
function framebuffer:refreshUIImp(x, y, w, h)
130134
self:_updateWindow()
131135
if has_eink_full_support then
132-
updatePartial(ntx_auto, 0, x, y, w, h)
136+
updatePartial(partial_regal, 0, x, y, w, h)
133137
end
134138
end
135139

136140
function framebuffer:refreshFlashUIImp(x, y, w, h)
137141
self:_updateWindow()
138142
if has_eink_full_support then
139-
updatePartial(ntx_gc16, 0, x, y, w, h)
143+
updatePartial(full_regal, 0, x, y, w, h)
140144
end
141145
end
142146

143147
function framebuffer:refreshFastImp(x, y, w, h)
144148
self:_updateWindow()
145149
if has_eink_full_support then
146-
updatePartial(ntx_du, 0, x, y, w, h)
150+
updatePartial(partial_du, 0, x, y, w, h)
147151
end
148152
end
149153

0 commit comments

Comments
 (0)