From 7b179086a9976feb43342f1141eee5e37ec17701 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 3 Jul 2024 11:03:09 -0400 Subject: [PATCH] Update main.c revert accidental edits --- main.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index b16d0cf8..75e9bb2f 100644 --- a/main.c +++ b/main.c @@ -800,11 +800,7 @@ int main(int argc, char * argv[]) { fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage); digitalWrite(txLed, txLedOff); digitalWrite(onLed, onLedOff); - - FILE * file6; - file6 = popen("echo 'shutdown due to low battery voltage!' | wall", "r"); - pclose(file6); - + sleep(1); digitalWrite(onLed, onLedOn); sleep(1); @@ -814,6 +810,7 @@ int main(int argc, char * argv[]) { sleep(1); digitalWrite(onLed, onLedOff); + FILE * file6; // = popen("/home/pi/CubeSatSim/log > shutdown_log.txt", "r"); file6 = popen("sudo shutdown -h now > /dev/null 2>&1", "r"); pclose(file6); sleep(10); @@ -2143,8 +2140,6 @@ if (setting == ON) { fprintf(stderr,"Turning Safe Mode ON\n"); fprintf(stderr,"Turning Battery saver mode ON\n"); if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { - command = popen("echo 'reboot due to turning ON Safe Mode!' | wall", "r"); - pclose(command) command = popen("sudo reboot now", "r"); pclose(command); sleep(60); @@ -2159,8 +2154,6 @@ if (setting == ON) { pclose(command); fprintf(stderr,"Turning Battery saver mode OFF\n"); if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { - command = popen("echo 'reboot due to turning OFF Safe Mode!' | wall", "r"); - pclose(command) command = popen("sudo reboot now", "r"); pclose(command); sleep(60);