Cervantes: Make sure the warmth scaling is accurate

For some mysterious reason, we init fl_warmth_max to 100 on Kobo &
Cervantes, despite this being the case on absolutely none of them.

TL;DR: We update it according to nl_max during init, but this was
missing on Cervantes.
reviewable/pr11238/r1
NiLuJe 5 months ago
parent 9ab866598a
commit a2e0642998

@ -51,10 +51,13 @@ function CervantesPowerD:init()
if self.device:hasNaturalLight() then
local nl_config = G_reader_settings:readSetting("natural_light_config")
if nl_config then
for key,val in pairs(nl_config) do
for key, val in pairs(nl_config) do
self.device.frontlight_settings[key] = val
end
end
-- Does this device's NaturalLight use a custom scale?
self.fl_warmth_min = self.device.frontlight_settings.nl_min or self.fl_warmth_min
self.fl_warmth_max = self.device.frontlight_settings.nl_max or self.fl_warmth_max
-- If this device has a mixer, we can use the ioctl for brightness control, as it's much lower latency.
if self.device:hasNaturalLightMixer() then
local kobolight = require("ffi/kobolight")

@ -139,8 +139,7 @@ function KoboPowerD:init()
--- @note: Newer devices appear to block slightly longer on FL ioctls/sysfs, so we only really need a delay on older devices.
self.device.frontlight_settings.ramp_delay = self.device.frontlight_settings.ramp_delay or (self.device:hasNaturalLight() and 0.0 or 0.025)
-- If this device has natural light (currently only KA1 & Forma)
-- Use the SysFS interface, and ioctl otherwise.
-- If this device has natural light, use the sysfs interface, and ioctl otherwise.
-- NOTE: On the Forma, nickel still appears to prefer using ntx_io to handle the FL,
-- but it does use sysfs for the NL...
if self.device:hasNaturalLight() then

Loading…
Cancel
Save