mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_BattMonitor: fixed battery percentage with aux info
when we have aux battery information we had assumed the CAN device would provide the battery remaining percentage. We should obey the "do not use CAN SoC" with or without an AUX message This fixes CAN battery monitors with a cell monitor
This commit is contained in:
parent
b95cadf81a
commit
d1e3cdb0a2
@ -166,7 +166,9 @@ void AP_BattMonitor_UAVCAN::update_interim_state(const float voltage, const floa
|
|||||||
|
|
||||||
const uint32_t tnow = AP_HAL::micros();
|
const uint32_t tnow = AP_HAL::micros();
|
||||||
|
|
||||||
if (!_has_battery_info_aux || _mppt.is_detected) {
|
if (!_has_battery_info_aux ||
|
||||||
|
_mppt.is_detected ||
|
||||||
|
option_is_set(AP_BattMonitor_Params::Options::Ignore_UAVCAN_SoC)) {
|
||||||
const uint32_t dt_us = tnow - _interim_state.last_time_micros;
|
const uint32_t dt_us = tnow - _interim_state.last_time_micros;
|
||||||
|
|
||||||
// update total current drawn since startup
|
// update total current drawn since startup
|
||||||
|
Loading…
Reference in New Issue
Block a user