reset NormalModeFailure when V > 3.5V

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

@ -1128,12 +1128,16 @@ if (firstTime != ON)
// printf("\n"); // printf("\n");
batteryVoltage = voltage[map[BAT]]; batteryVoltage = voltage[map[BAT]];
if (batteryVoltage < 3.5) if (batteryVoltage < 3.5)
{ {
NormalModeFailure = 1; NormalModeFailure = 1;
printf("Safe Mode!\n"); printf("Safe Mode!\n");
} }
else
NormalModeFailure = 0;
FILE *cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); FILE *cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r");
if (cpuTempSensor) { if (cpuTempSensor) {
double cpuTemp; double cpuTemp;
@ -1212,6 +1216,9 @@ if (sim_mode)
NormalModeFailure = 1; NormalModeFailure = 1;
printf("Safe Mode!\n"); printf("Safe Mode!\n");
} }
else
NormalModeFailure = 0;
if (batt > 4.5) if (batt > 4.5)
batt = 4.5; batt = 4.5;

Loading…
Cancel
Save

Powered by TurnKey Linux.