From e7cfc657809472b8fe1f89c1dbbe7c605c3263ff Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 24 Sep 2019 20:27:28 +0200 Subject: [PATCH] [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. --- frontend/device/kobo/powerd.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/device/kobo/powerd.lua b/frontend/device/kobo/powerd.lua index ba1060f80..95370e904 100644 --- a/frontend/device/kobo/powerd.lua +++ b/frontend/device/kobo/powerd.lua @@ -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