From 8cc837230281818b9be442d58bc5b4e80a79d93c Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Thu, 6 Jun 2024 13:50:44 +0300 Subject: [PATCH] Revert "uORB: ack uorb topic" This reverts commit 7fbba1dc087f79f5fc0e04bc7c3094f8f76e1a4c. --- platforms/common/uORB/Subscription.hpp | 11 ----------- platforms/common/uORB/SubscriptionInterval.hpp | 11 ----------- platforms/common/uORB/uORB.cpp | 5 ----- platforms/common/uORB/uORB.h | 2 -- platforms/common/uORB/uORBDeviceNode.hpp | 2 -- platforms/common/uORB/uORBManager.cpp | 6 ------ platforms/common/uORB/uORBManager.hpp | 8 -------- 7 files changed, 45 deletions(-) diff --git a/platforms/common/uORB/Subscription.hpp b/platforms/common/uORB/Subscription.hpp index eefa7e310413..6850e280d5e3 100644 --- a/platforms/common/uORB/Subscription.hpp +++ b/platforms/common/uORB/Subscription.hpp @@ -143,17 +143,6 @@ class Subscription return valid() ? Manager::orb_data_copy(_node, dst, _last_generation, true) : false; } - void ack() - { - if (!valid()) { - subscribe(); - } - - if (valid()) { - Manager::orb_data_ack(_node, _last_generation); - } - } - /** * Copy the struct * @param dst The uORB message struct we are updating. diff --git a/platforms/common/uORB/SubscriptionInterval.hpp b/platforms/common/uORB/SubscriptionInterval.hpp index 045011a00634..83f27a520dea 100644 --- a/platforms/common/uORB/SubscriptionInterval.hpp +++ b/platforms/common/uORB/SubscriptionInterval.hpp @@ -100,17 +100,6 @@ class SubscriptionInterval return false; } - /** - * Acknowledge a new update. - */ - void ack() - { - _subscription.ack(); - const hrt_abstime now = hrt_absolute_time(); - // shift last update time forward, but don't let it get further behind than the interval - _last_update = math::constrain(_last_update + _interval_us, now - _interval_us, now); - } - /** * Copy the struct if updated. * @param dst The destination pointer where the struct will be copied. diff --git a/platforms/common/uORB/uORB.cpp b/platforms/common/uORB/uORB.cpp index 3dcf20155e4d..d09be27d6326 100644 --- a/platforms/common/uORB/uORB.cpp +++ b/platforms/common/uORB/uORB.cpp @@ -130,11 +130,6 @@ int orb_check(orb_sub_t handle, bool *updated) return uORB::Manager::get_instance()->orb_check(handle, updated); } -int orb_ack(orb_sub_t handle) -{ - return uORB::Manager::get_instance()->orb_ack(handle); -} - int orb_exists(const struct orb_metadata *meta, int instance) { return uORB::Manager::orb_exists(meta, instance); diff --git a/platforms/common/uORB/uORB.h b/platforms/common/uORB/uORB.h index 3b3b80ee7ee1..2006ef08ebcd 100644 --- a/platforms/common/uORB/uORB.h +++ b/platforms/common/uORB/uORB.h @@ -246,8 +246,6 @@ extern int orb_copy(const struct orb_metadata *meta, orb_sub_t handle, void *buf */ extern int orb_check(orb_sub_t handle, bool *updated) __EXPORT; -extern int orb_ack(orb_sub_t handle) __EXPORT; - /** * @see uORB::Manager::orb_exists() */ diff --git a/platforms/common/uORB/uORBDeviceNode.hpp b/platforms/common/uORB/uORBDeviceNode.hpp index 83e1d5752e33..c0f94174b757 100644 --- a/platforms/common/uORB/uORBDeviceNode.hpp +++ b/platforms/common/uORB/uORBDeviceNode.hpp @@ -219,8 +219,6 @@ class DeviceNode */ bool copy(void *dst, orb_advert_t &handle, unsigned &generation); - void ack(unsigned &generation) { generation = _generation.load(); } - static bool register_callback(orb_advert_t &node_handle, SubscriptionCallback *callback_sub, int8_t poll_lock, hrt_abstime last_update, uint32_t interval_us, uorb_cb_handle_t &cb_handle) { diff --git a/platforms/common/uORB/uORBManager.cpp b/platforms/common/uORB/uORBManager.cpp index e2846c096bbc..73f559470db1 100644 --- a/platforms/common/uORB/uORBManager.cpp +++ b/platforms/common/uORB/uORBManager.cpp @@ -365,12 +365,6 @@ int uORB::Manager::orb_check(orb_sub_t handle, bool *updated) return PX4_OK; } -int uORB::Manager::orb_ack(orb_sub_t handle) -{ - ((uORB::SubscriptionInterval *)handle)->ack(); - return PX4_OK; -} - int uORB::Manager::orb_set_interval(orb_sub_t handle, unsigned interval) { ((uORB::SubscriptionInterval *)handle)->set_interval_us(interval * 1000); diff --git a/platforms/common/uORB/uORBManager.hpp b/platforms/common/uORB/uORBManager.hpp index 96e95c7b04b5..cfc297cfedc1 100644 --- a/platforms/common/uORB/uORBManager.hpp +++ b/platforms/common/uORB/uORBManager.hpp @@ -292,9 +292,6 @@ class Manager */ static int orb_check(orb_sub_t handle, bool *updated); - - static int orb_ack(orb_sub_t handle); - /** * Check if a topic has already been created and published (advertised) * @@ -360,11 +357,6 @@ class Manager static uint8_t orb_get_queue_size(const orb_advert_t &node_handle) {return node(node_handle)->get_queue_size();} - static void orb_data_ack(orb_advert_t &node_handle, unsigned &generation) - { - node(node_handle)->ack(generation); - } - static bool orb_data_copy(orb_advert_t &node_handle, void *dst, unsigned &generation, bool only_if_updated) {