mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
uORB::Subscription minor API cleanup
* the forceInit() method was combined with the existing subscribe() * delete unused last_update()
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
||||
int fd = orb_subscribe_multi(_subscription.get_topic(), _subscription.get_instance());
|
||||
|
||||
// try to register callback again
|
||||
if (_subscription.forceInit()) {
|
||||
if (_subscription.subscribe()) {
|
||||
if (_subscription.get_node() && _subscription.get_node()->register_callback(this)) {
|
||||
ret = true;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
void call() override
|
||||
{
|
||||
// schedule immediately if no interval, otherwise check time elapsed
|
||||
if ((_interval == 0) || (hrt_elapsed_time(&_last_update) >= _interval)) {
|
||||
if ((_interval_us == 0) || (hrt_elapsed_time(&_last_update) >= _interval_us)) {
|
||||
_work_item->ScheduleNow();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user