mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 16:58:54 +08:00
uORB remove unnecessary priority from each subscriber
This commit is contained in:
committed by
Lorenz Meier
parent
297c1b777b
commit
526fa9e9dd
@@ -123,9 +123,6 @@ uORB::DeviceNode::open(cdev::file_t *filp)
|
||||
/* If there were any previous publications, allow the subscriber to read them */
|
||||
sd->generation = _generation - (_queue_size < _generation ? _queue_size : _generation);
|
||||
|
||||
/* set priority */
|
||||
sd->set_priority(_priority);
|
||||
|
||||
FILE_PRIV(filp) = (void *)sd;
|
||||
|
||||
ret = CDev::open(filp);
|
||||
@@ -215,9 +212,6 @@ uORB::DeviceNode::read(cdev::file_t *filp, char *buffer, size_t buflen)
|
||||
++sd->generation;
|
||||
}
|
||||
|
||||
/* set priority */
|
||||
sd->set_priority(_priority);
|
||||
|
||||
/*
|
||||
* Clear the flag that indicates that an update has been reported, as
|
||||
* we have just collected it.
|
||||
@@ -362,7 +356,7 @@ uORB::DeviceNode::ioctl(cdev::file_t *filp, int cmd, unsigned long arg)
|
||||
return PX4_OK;
|
||||
|
||||
case ORBIOCGPRIORITY:
|
||||
*(int *)arg = sd->priority();
|
||||
*(int *)arg = get_priority();
|
||||
return PX4_OK;
|
||||
|
||||
case ORBIOCSETQUEUESIZE:
|
||||
|
||||
@@ -175,6 +175,7 @@ public:
|
||||
unsigned int published_message_count() const { return _generation; }
|
||||
const struct orb_metadata *get_meta() const { return _meta; }
|
||||
|
||||
int get_priority() const { return _priority; }
|
||||
void set_priority(uint8_t priority) { _priority = priority; }
|
||||
|
||||
protected:
|
||||
@@ -196,9 +197,6 @@ private:
|
||||
int flags; /**< lowest 8 bits: priority of publisher, 9. bit: update_reported bit */
|
||||
UpdateIntervalData *update_interval; /**< if null, no update interval */
|
||||
|
||||
int priority() const { return flags & 0xff; }
|
||||
void set_priority(uint8_t prio) { flags = (flags & ~0xff) | prio; }
|
||||
|
||||
bool update_reported() const { return flags & (1 << 8); }
|
||||
void set_update_reported(bool update_reported_flag) { flags = (flags & ~(1 << 8)) | (((int)update_reported_flag) << 8); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user