Update main.c fix battery saver turn off

beta-v1.3.2-battery-saver-3
Alan Johnston 2 years ago committed by GitHub
parent 5361a5b93d
commit 88ecd3f2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2264,7 +2264,7 @@ int battery_saver_check() {
void battery_saver(int setting) {
if (setting == ON) {
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) {
if (battery_saver_check() == 0) {
if (battery_saver_check() == OFF) {
FILE *command = popen("touch /home/pi/CubeSatSim/battery_saver", "r");
pclose(command);
fprintf(stderr,"Turning Battery saver mode ON\n");
@ -2279,7 +2279,7 @@ if (setting == ON) {
}
} else if (setting == OFF) {
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) {
if (battery_saver_check() == 1) {
if (battery_saver_check() == ON) {
FILE *command = popen("rm /home/pi/CubeSatSim/battery_saver", "r");
pclose(command);
fprintf(stderr,"Turning Battery saver mode OFF\n");

Loading…
Cancel
Save

Powered by TurnKey Linux.