[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:
NiLuJe authored and Frans de Jonge committed 2019-09-24 20:27:28 +02:00
1 parent 02218cb9e2
commit e7cfc65780
1 file changed
+6 -3
+6 -3
View File
@@ -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