[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.
pull/5425/head
NiLuJe 5 years ago committed by Frans de Jonge
parent 02218cb9e2
commit e7cfc65780

@ -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

Loading…
Cancel
Save