battery: separate out publishing from updating

to allow smart battery drivers to use the battery class and
filling in additional information in case it makes sense.
This commit is contained in:
Matthias Grob
2021-12-07 21:06:51 +01:00
parent e70d70468a
commit fdc40880d0
10 changed files with 40 additions and 17 deletions
@@ -83,7 +83,7 @@ AnalogBattery::updateBatteryStatusADC(hrt_abstime timestamp, float voltage_raw,
Battery::setConnected(connected);
Battery::updateVoltage(voltage_v);
Battery::updateCurrent(current_a);
Battery::updateBatteryStatus(timestamp);
Battery::updateAndPublishBatteryStatus(timestamp);
}
bool AnalogBattery::is_valid()