Skip to content

Commit

Permalink
Update main.c moved safemode
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbjohnston authored Mar 6, 2024
1 parent 9bde7ff commit 5731a50
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,6 @@ int main(int argc, char * argv[]) {

// FILE * rpitx_restart = popen("sudo systemctl restart rpitx", "r");
// pclose(rpitx_restart);

if (battery_saver_check() == ON) {
SafeMode = 1;
fprintf(stderr, "Safe Mode is activated by config setting!\n");
}
else
SafeMode = 0;

mode = FSK;
frameCnt = 1;
Expand Down Expand Up @@ -198,11 +191,16 @@ int main(int argc, char * argv[]) {

battery_saver_mode = battery_saver_check();
/**/
if (battery_saver_mode == ON)
if (battery_saver_mode == ON) {
SafeMode = 1;
fprintf(stderr, "Safe Mode! Battery_saver_mode is ON\n\n");
else
}
else {
fprintf(stderr, "\nBattery_saver_mode is OFF\n\n");
SafeMode = 0;
}
/**/

fflush(stderr);

if (mode == AFSK)
Expand Down

0 comments on commit 5731a50

Please sign in to comment.