mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:03:33 +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) {
|
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)
|
void Battery::sumDischarged(const hrt_abstime ×tamp, float current_a)
|
||||||
{
|
{
|
||||||
// Not a valid measurement
|
// Not a valid measurement
|
||||||
|
|||||||
@@ -155,11 +155,6 @@ protected:
|
|||||||
bool _first_parameter_update{true};
|
bool _first_parameter_update{true};
|
||||||
void updateParams() override;
|
void updateParams() override;
|
||||||
|
|
||||||
/**
|
|
||||||
* Publishes the uORB battery_status message with the most recently-updated data.
|
|
||||||
*/
|
|
||||||
void publish();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function helps migrating and syncing from/to deprecated parameters. BAT_* BAT1_*
|
* This function helps migrating and syncing from/to deprecated parameters. BAT_* BAT1_*
|
||||||
* @tparam T Type of the parameter (int or float)
|
* @tparam T Type of the parameter (int or float)
|
||||||
|
|||||||
Reference in New Issue
Block a user