From 6ae17eb13cc54ebde83543f47df196313e164225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 16 Oct 2020 15:05:52 +0200 Subject: [PATCH] fix EscBattery: remove _battery.publish(); updateBatteryStatus() already publishes --- src/lib/battery/battery.h | 10 +++++----- src/modules/esc_battery/EscBattery.cpp | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/battery/battery.h b/src/lib/battery/battery.h index 0b8bd6645e..dc589d6118 100644 --- a/src/lib/battery/battery.h +++ b/src/lib/battery/battery.h @@ -100,11 +100,6 @@ public: void updateBatteryStatus(const hrt_abstime ×tamp, float voltage_v, float current_a, bool connected, int source, int priority, float throttle_normalized); - /** - * Publishes the uORB battery_status message with the most recently-updated data. - */ - void publish(); - protected: struct { param_t v_empty; @@ -159,6 +154,11 @@ protected: bool _first_parameter_update{true}; 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_* * @tparam T Type of the parameter (int or float) diff --git a/src/modules/esc_battery/EscBattery.cpp b/src/modules/esc_battery/EscBattery.cpp index 0eeb8934e7..9ad04b0c45 100644 --- a/src/modules/esc_battery/EscBattery.cpp +++ b/src/modules/esc_battery/EscBattery.cpp @@ -113,7 +113,6 @@ EscBattery::Run() battery_status_s::BATTERY_SOURCE_ESCS, priority, ctrl.control[actuator_controls_s::INDEX_THROTTLE]); - _battery.publish(); } }