Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some more FL fixes #4924

Merged
merged 5 commits into from Apr 15, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Kill debug

  • Loading branch information...
NiLuJe committed Apr 15, 2019
commit 1b86f76ef20d62450aab22b502c5aa019d0c6bea
@@ -120,7 +120,6 @@ function BasePowerD:normalizeIntensity(intensity)
end

function BasePowerD:setIntensity(intensity)
print("BasePowerD:setIntensity", intensity)
if not self.device:hasFrontlight() then return false end
if intensity == self:frontlightIntensity() then return false end
self.fl_intensity = self:normalizeIntensity(intensity)
@@ -142,10 +142,6 @@ function KoboPowerD:init()
-- See discussion in https://github.com/koreader/koreader/issues/3118#issuecomment-334995879
-- for the reasoning behind this bit of insanity.
if self:isFrontlightOnHW() then
print("init: wasOn: self.hw_intensity", self.hw_intensity)
print("init: wasOn: self.fl_intensity", self.fl_intensity)
print("init: wasOn: self.initial_is_fl_on", self.initial_is_fl_on)
print("init: wasOn: self.is_fl_on", self.is_fl_on)
-- On devices with a mixer, setIntensity will *only* set the FL, so, ensure we honor the warmth, too.
if self.device:hasNaturalLightMixer() then
self:setWarmth(self.fl_warmth)
@@ -154,10 +150,6 @@ function KoboPowerD:init()
self:setIntensity(self:frontlightIntensityHW())
else
-- Use setBrightnes so as *NOT* to set hw_intensity, so toggle will still (mostly) work.
print("init: wasOff: self.hw_intensity", self.hw_intensity)
print("init: wasOff: self.fl_intensity", self.fl_intensity)
print("init: wasOff: self.initial_is_fl_on", self.initial_is_fl_on)
print("init: wasOff: self.is_fl_on", self.is_fl_on)
self.fl:setBrightness(0)
-- And make sure the fact that we started with the FL off propagates as best as possible.
self.initial_is_fl_on = false
@@ -166,10 +158,6 @@ function KoboPowerD:init()
-- So, instead of making things behave properly,
-- setting hw_intensity to 1 would here bypass any KOBO_LIGHT_ON_START behavior, and instead toggle between 0 & 1.
--self.hw_intensity = 1
print("init: wasOff: self.hw_intensity", self.hw_intensity)
print("init: wasOff: self.fl_intensity", self.fl_intensity)
print("init: wasOff: self.initial_is_fl_on", self.initial_is_fl_on)
print("init: wasOff: self.is_fl_on", self.is_fl_on)
end
end
end
@@ -313,10 +301,6 @@ function KoboPowerD:isChargingHW()
end

function KoboPowerD:turnOffFrontlightHW()
print("turnOffFrontlightHW: self.hw_intensity", self.hw_intensity)
print("turnOffFrontlightHW: self.fl_intensity", self.fl_intensity)
print("turnOffFrontlightHW: wasOn: self.initial_is_fl_on", self.initial_is_fl_on)
print("turnOffFrontlightHW: wasOn: self.is_fl_on", self.is_fl_on)
if not self:isFrontlightOnHW() then
return
end
@@ -345,10 +329,6 @@ function KoboPowerD:turnOffFrontlightHW()
end
end
function KoboPowerD:turnOnFrontlightHW()
print("turnOnFrontlightHW: self.hw_intensity", self.hw_intensity)
print("turnOnFrontlightHW: self.fl_intensity", self.fl_intensity)
print("turnOnFrontlightHW: wasOn: self.initial_is_fl_on", self.initial_is_fl_on)
print("turnOnFrontlightHW: wasOn: self.is_fl_on", self.is_fl_on)
if self:isFrontlightOnHW() then
return
end
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.