2
0
mirror of https://github.com/koreader/koreader synced 2024-11-18 03:25:46 +00:00

PowerD: Ensure we actually pull battery capacity during early boot.

(i.e., when MONOTONIC returns something lower than 60).

Fix https://github.com/koreader/koreader/pull/8711#issuecomment-1021106079
This commit is contained in:
NiLuJe 2022-01-30 20:52:42 +01:00
parent 43f14b313f
commit 5518a8109b

View File

@ -9,8 +9,8 @@ local BasePowerD = {
aux_batt_capacity = 0, -- auxiliary battery capacity
device = nil, -- device object
last_capacity_pull_time = TimeVal:new{ sec = 0, usec = 0}, -- timestamp of last pull
last_aux_capacity_pull_time = TimeVal:new{ sec = 0, usec = 0}, -- timestamp of last pull
last_capacity_pull_time = TimeVal:new{ sec = -61, usec = 0}, -- timestamp of last pull
last_aux_capacity_pull_time = TimeVal:new{ sec = -61, usec = 0}, -- timestamp of last pull
is_fl_on = false, -- whether the frontlight is on
}
@ -195,8 +195,8 @@ function BasePowerD:getAuxCapacity()
end
function BasePowerD:invalidateCapacityCache()
self.last_capacity_pull_time = TimeVal:new{ sec = 0, usec = 0}
self.last_aux_capacity_pull_time = TimeVal:new{ sec = 0, usec = 0}
self.last_capacity_pull_time = TimeVal:new{ sec = -61, usec = 0}
self.last_aux_capacity_pull_time = TimeVal:new{ sec = -61, usec = 0}
end
function BasePowerD:isAuxCharging()