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 mhkabir committed Apr 15, 2018
1 parent 123f11f commit c52fefb
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 @@ -2008,8 +2008,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 @@ -2043,8 +2042,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 c52fefb

Please sign in to comment.