mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Added clamping to the battery capacity to work around buggy OS drivers
This commit is contained in:
parent
539e5ed57a
commit
a6b573bc5c
|
|
@ -452,6 +452,11 @@ void SystemStatus::getStatusBattery()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (batteryCapacity < 0)
|
||||||
|
batteryCapacity = 0;
|
||||||
|
if (batteryCapacity > 100)
|
||||||
|
batteryCapacity = 100;
|
||||||
|
|
||||||
mHasBattery = hasBattery;
|
mHasBattery = hasBattery;
|
||||||
mBatteryCharging = batteryCharging;
|
mBatteryCharging = batteryCharging;
|
||||||
mBatteryCapacity = batteryCapacity;
|
mBatteryCapacity = batteryCapacity;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue