Skip to content

Commit

Permalink
Revert "uORB: ack uorb topic"
Browse files Browse the repository at this point in the history
This reverts commit 7fbba1d.
  • Loading branch information
jlaitine committed Jun 6, 2024
1 parent a1b1f2d commit 01cff3a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 45 deletions.
11 changes: 0 additions & 11 deletions platforms/common/uORB/Subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 0 additions & 11 deletions platforms/common/uORB/SubscriptionInterval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions platforms/common/uORB/uORB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions platforms/common/uORB/uORB.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*/
Expand Down
2 changes: 0 additions & 2 deletions platforms/common/uORB/uORBDeviceNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,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)
{
Expand Down
6 changes: 0 additions & 6 deletions platforms/common/uORB/uORBManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions platforms/common/uORB/uORBManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 01cff3a

Please sign in to comment.