Commander: put battery warning and failsafe action in separate functions

This commit is contained in:
Matthias Grob
2022-01-14 15:30:56 +01:00
committed by Daniel Agar
parent 367b6123e1
commit 8eed43b515
3 changed files with 12 additions and 11 deletions
+2 -2
View File
@@ -3889,8 +3889,8 @@ void Commander::battery_status_check()
// execute battery failsafe if the state has gotten worse while we are armed
if (battery_warning_level_increased_while_armed) {
battery_failsafe(&_mavlink_log_pub, _status, _status_flags, _internal_state, _battery_warning,
(low_battery_action_t)_param_com_low_bat_act.get());
warn_user_about_battery(&_mavlink_log_pub, _battery_warning);
act_on_battery_failsafe(_internal_state, _battery_warning, (low_battery_action_t)_param_com_low_bat_act.get());
}
// Handle shutdown request from emergency battery action