mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 16:03:34 +08:00
uorb subscription: remove _interval & use orb_get_interval() instead
This commit is contained in:
@@ -86,7 +86,14 @@ public:
|
||||
|
||||
// accessors
|
||||
const struct orb_metadata *getMeta() { return _meta; }
|
||||
int getHandle() { return _handle; }
|
||||
int getHandle() const { return _handle; }
|
||||
|
||||
unsigned getInterval() const
|
||||
{
|
||||
unsigned int interval;
|
||||
orb_get_interval(getHandle(), &interval);
|
||||
return interval;
|
||||
}
|
||||
protected:
|
||||
// accessors
|
||||
void setHandle(int handle) { _handle = handle; }
|
||||
@@ -130,8 +137,7 @@ public:
|
||||
unsigned interval = 0,
|
||||
int instance = 0,
|
||||
List<SubscriptionNode *> *list = nullptr) :
|
||||
SubscriptionBase(meta, interval, instance),
|
||||
_interval(interval)
|
||||
SubscriptionBase(meta, interval, instance)
|
||||
{
|
||||
if (list != nullptr) { list->add(this); }
|
||||
}
|
||||
@@ -141,11 +147,6 @@ public:
|
||||
* updates, a child class must implement it.
|
||||
*/
|
||||
virtual void update() = 0;
|
||||
// accessors
|
||||
unsigned getInterval() { return _interval; }
|
||||
protected:
|
||||
// attributes
|
||||
unsigned _interval;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user