Normal mode failure if battery < 3.5 V

pull/72/head
alanbjohnston 5 years ago committed by GitHub
parent d79b308c7e
commit 8ffe4ff249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1043,7 +1043,11 @@ if (firstTime != ON)
// printf("\n");
batteryVoltage = voltage[map[BAT]];
if (batteryVoltage < 3.5)
{
NormalModeFailure = 1;
printf("Safe Mode!\n");
}
FILE *cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r");
if (cpuTempSensor) {
double cpuTemp;
@ -1117,7 +1121,11 @@ if (sim_mode)
batt -= (batt > 3.5) ? current[map[BAT]]/30000: current[map[BAT]]/3000;
if (batt < 3.0)
{
batt = 3.0;
NormalModeFailure = 1;
printf("Safe Mode!\n");
}
if (batt > 4.5)
batt = 4.5;

Loading…
Cancel
Save

Powered by TurnKey Linux.