Skip to content

Commit

Permalink
fix low battery error
Browse files Browse the repository at this point in the history
  • Loading branch information
profezzorn committed Dec 23, 2019
1 parent 39acb10 commit ca84dd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion props/prop_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ class PropBase : CommandParser, Looper, protected SaberBase {

// Select preset (font/style)
virtual void SetPreset(int preset_num, bool announce) {
TRACE("start");
#ifdef IDLE_OFF_TIME
last_on_time_ = millis();
#endif
Expand Down Expand Up @@ -288,6 +289,7 @@ class PropBase : CommandParser, Looper, protected SaberBase {

if (on) On();
if (announce) SaberBase::DoNewFont();
TRACE("end");
}

// Go to the next Preset.
Expand Down Expand Up @@ -734,7 +736,7 @@ class PropBase : CommandParser, Looper, protected SaberBase {
}
if (battery_monitor.low()) {
// TODO: FIXME
if (current_style() && current_style()->Charging()) {
if (current_style() && !current_style()->Charging()) {
if (SaberBase::IsOn()) {
STDOUT.print("Battery low, turning off. Battery voltage: ");
STDOUT.println(battery_monitor.battery());
Expand Down

0 comments on commit ca84dd4

Please sign in to comment.