Skip to content

Commit

Permalink
commander: Remove usb_ connected flag on battery warnings
Browse files Browse the repository at this point in the history
Battery warning gets only fired if a battery is inserted.
  • Loading branch information
Simone Guscetti authored and MaEtUgR committed Apr 11, 2018
1 parent 711b21c commit 98c240f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/modules/commander/commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2061,8 +2061,7 @@ Commander::run()
}

status_changed = true;
} else if (!status_flags.usb_connected &&
battery.warning == battery_status_s::BATTERY_WARNING_CRITICAL &&
} else if (battery.warning == battery_status_s::BATTERY_WARNING_CRITICAL &&
!critical_battery_voltage_actions_done) {
critical_battery_voltage_actions_done = true;

Expand Down Expand Up @@ -2096,8 +2095,7 @@ Commander::run()

status_changed = true;

} else if (!status_flags.usb_connected &&
battery.warning == battery_status_s::BATTERY_WARNING_EMERGENCY &&
} else if (battery.warning == battery_status_s::BATTERY_WARNING_EMERGENCY &&
!emergency_battery_voltage_actions_done) {
emergency_battery_voltage_actions_done = true;

Expand Down

0 comments on commit 98c240f

Please sign in to comment.