Update main.c fixes to quotes

beta-v1.3.2-battery-saver-2
Alan Johnston 2 years ago committed by GitHub
parent 061921a4c1
commit 8576430d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2255,12 +2255,12 @@ int battery_saver_check() {
void battery_saver(int setting) {
if (setting == ON) {
if ((mode == APRS) || (mode == SSTV) || (mode == CW)) {
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) {
if (battery_saver_check() == 0) {
FILE *command = popen("touch /home/pi/CubeSatSim/battery_saver", "r");
pclose(command);
fprintf(stderr,"Turning Battery saver mode ON\n");
*command = popen("if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi", "r");
*command = popen("if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo force_turbo=1 >> /boot/config.txt'; fi", "r");
pclose(command);
*command = popen("sudo reboot now", "r");
pclose(command);
@ -2269,7 +2269,7 @@ if (setting == ON) {
}
}
} else if (setting == OFF) {
if ((mode == APRS) || (mode == SSTV) || (mode == CW)) {
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) {
if (battery_saver_check() == 1) {
FILE *command = popen("rm /home/pi/CubeSatSim/battery_saver", "r");
pclose(command);

Loading…
Cancel
Save

Powered by TurnKey Linux.