diff options
author | Simon Wilks <sjwilks@gmail.com> | 2014-10-31 08:58:58 +0100 |
---|---|---|
committer | Simon Wilks <sjwilks@gmail.com> | 2014-10-31 08:58:58 +0100 |
commit | c7a3a0db5230d1506c81c5f15254002b64cddf32 (patch) | |
tree | 67a6e97b1dbeba069bd7e55165e4edfb876e4302 /src/modules | |
parent | 9f3c3529593033d9acc94fb978a2aa6e34a3d1d9 (diff) | |
download | px4-firmware-c7a3a0db5230d1506c81c5f15254002b64cddf32.tar.gz px4-firmware-c7a3a0db5230d1506c81c5f15254002b64cddf32.tar.bz2 px4-firmware-c7a3a0db5230d1506c81c5f15254002b64cddf32.zip |
Don't go into an error state if we are temporarily powering via USB on the bench
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/commander/commander.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index b72ebcc50..46caddd46 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1407,8 +1407,8 @@ int commander_thread_main(int argc, char *argv[]) last_idle_time = system_load.tasks[0].total_runtime; /* check if board is connected via USB */ - //struct stat statbuf; - //on_usb_power = (stat("/dev/ttyACM0", &statbuf) == 0); + struct stat statbuf; + on_usb_power = (stat("/dev/ttyACM0", &statbuf) == 0); } /* if battery voltage is getting lower, warn using buzzer, etc. */ @@ -1418,7 +1418,7 @@ int commander_thread_main(int argc, char *argv[]) status.battery_warning = VEHICLE_BATTERY_WARNING_LOW; status_changed = true; - } else if (status.condition_battery_voltage_valid && status.battery_remaining < 0.09f + } else if (!on_usb_power && status.condition_battery_voltage_valid && status.battery_remaining < 0.09f && !critical_battery_voltage_actions_done && low_battery_voltage_actions_done) { /* critical battery voltage, this is rather an emergency, change state machine */ critical_battery_voltage_actions_done = true; |