Skip to content

Commit

Permalink
Don't force reboot in a loop if device is on charger
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Jul 18, 2024
1 parent c6f1a01 commit 49ad4e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion software/firmware/src/tasks/time_aligned_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void TimeAlignedTask(void *scheduled_experiment)
}

// Ask the storage task to shutdown if the battery is critically low or an experiment has ended
if ((battery_voltage <= BATTERY_CRITICAL) || experiment_ended)
if ((!battery_monitor_is_plugged_in() && (battery_voltage <= BATTERY_CRITICAL)) || experiment_ended)
storage_flush_and_shutdown();

// Sleep until the next time-aligned task iteration
Expand Down

0 comments on commit 49ad4e8

Please sign in to comment.