mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-08 21:00:34 +08:00
battery: re-introduced check of LITHIUM_BATTERY_RECOGNITION_VOLTAGE
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -100,7 +100,8 @@ Battery::Battery(int index, ModuleParams *parent, const int sample_interval_us,
|
||||
|
||||
void Battery::updateBatteryStatus(const InputSample &sample)
|
||||
{
|
||||
_connected_state_hysteresis.set_state_and_update(sample.valid(), sample.timestamp);
|
||||
const bool battery_connected = sample.valid() && sample.voltage_v >= LITHIUM_BATTERY_RECOGNITION_VOLTAGE;
|
||||
_connected_state_hysteresis.set_state_and_update(battery_connected, sample.timestamp);
|
||||
|
||||
if (!sample.valid()) {
|
||||
_last_valid_current_timestamp = 0;
|
||||
|
||||
Reference in New Issue
Block a user