mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[Kobo] Unbreak the FL ramp-up/down (#5421)
I got my wires crossed. It's fast on Mk. 5, slow on Mk. 7. So, slow it down on Mk. 5 so we actually get a ramp and not a jump.
This commit is contained in:
@@ -321,8 +321,9 @@ function KoboPowerD:turnOffFrontlightHW()
|
||||
util.runInSubProcess(function()
|
||||
for i = 1,5 do
|
||||
self:_setIntensity(math.floor(self.fl_intensity - ((self.fl_intensity / 5) * i)))
|
||||
-- NOTE: We generally don't need to sleep when using sysfs as a backend...
|
||||
if self.device:hasNaturalLight() and not self.device:hasNaturalLightMixer() then
|
||||
--- @note: Newer devices appear to block slightly longer on FL ioctls/sysfs, so only sleep on older devices,
|
||||
--- otherwise we get a jump and not a ramp ;).
|
||||
if not self.device:hasNaturalLight() then
|
||||
if (i < 5) then
|
||||
util.usleep(35 * 1000)
|
||||
end
|
||||
@@ -359,7 +360,9 @@ function KoboPowerD:turnOnFrontlightHW()
|
||||
util.runInSubProcess(function()
|
||||
for i = 1,5 do
|
||||
self:_setIntensity(math.ceil(self.fl_min + ((self.fl_intensity / 5) * i)))
|
||||
if self.device:hasNaturalLight() and not self.device:hasNaturalLightMixer() then
|
||||
--- @note: Newer devices appear to block slightly longer on FL ioctls/sysfs, so only sleep on older devices,
|
||||
--- otherwise we get a jump and not a ramp ;).
|
||||
if not self.device:hasNaturalLight() then
|
||||
if (i < 5) then
|
||||
util.usleep(35 * 1000)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user