Update main.c revert accidental edits

beta-dw
Alan Johnston 1 year ago committed by GitHub
parent e224c01bc9
commit 7b179086a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -800,11 +800,7 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage); fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage);
digitalWrite(txLed, txLedOff); digitalWrite(txLed, txLedOff);
digitalWrite(onLed, onLedOff); digitalWrite(onLed, onLedOff);
FILE * file6;
file6 = popen("echo 'shutdown due to low battery voltage!' | wall", "r");
pclose(file6);
sleep(1); sleep(1);
digitalWrite(onLed, onLedOn); digitalWrite(onLed, onLedOn);
sleep(1); sleep(1);
@ -814,6 +810,7 @@ int main(int argc, char * argv[]) {
sleep(1); sleep(1);
digitalWrite(onLed, onLedOff); 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"); file6 = popen("sudo shutdown -h now > /dev/null 2>&1", "r");
pclose(file6); pclose(file6);
sleep(10); sleep(10);
@ -2143,8 +2140,6 @@ if (setting == ON) {
fprintf(stderr,"Turning Safe Mode ON\n"); fprintf(stderr,"Turning Safe Mode ON\n");
fprintf(stderr,"Turning Battery saver mode ON\n"); fprintf(stderr,"Turning Battery saver mode ON\n");
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { 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"); command = popen("sudo reboot now", "r");
pclose(command); pclose(command);
sleep(60); sleep(60);
@ -2159,8 +2154,6 @@ if (setting == ON) {
pclose(command); pclose(command);
fprintf(stderr,"Turning Battery saver mode OFF\n"); fprintf(stderr,"Turning Battery saver mode OFF\n");
if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { 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"); command = popen("sudo reboot now", "r");
pclose(command); pclose(command);
sleep(60); sleep(60);

Loading…
Cancel
Save

Powered by TurnKey Linux.