mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-12 06:41:36 +08:00
battery: omit separate publish() function
This commit is contained in:
@@ -167,16 +167,11 @@ void Battery::updateBatteryStatus(const hrt_abstime ×tamp, float voltage_v,
|
||||
}
|
||||
|
||||
if (source == _params.source) {
|
||||
publish();
|
||||
_battery_status.timestamp = hrt_absolute_time();
|
||||
_battery_status_pub.publish(_battery_status);
|
||||
}
|
||||
}
|
||||
|
||||
void Battery::publish()
|
||||
{
|
||||
_battery_status.timestamp = hrt_absolute_time();
|
||||
_battery_status_pub.publish(_battery_status);
|
||||
}
|
||||
|
||||
void Battery::sumDischarged(const hrt_abstime ×tamp, float current_a)
|
||||
{
|
||||
// Not a valid measurement
|
||||
|
||||
Reference in New Issue
Block a user