mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
uORB::DeviceNode mark advertised on write
- this is a workaround if multiple publishers for the same topic exists and one unadvertises (eg uORB::Publication destruction)
This commit is contained in:
parent
efc6a5036b
commit
ce67fee6b9
@ -219,14 +219,16 @@ uORB::DeviceNode::write(cdev::file_t *filp, const char *buffer, size_t buflen)
|
||||
|
||||
memcpy(_data + (_meta->o_size * (generation % _queue_size)), buffer, _meta->o_size);
|
||||
|
||||
/* Mark at least one data has been published */
|
||||
_data_valid = true;
|
||||
|
||||
mark_as_advertised();
|
||||
|
||||
// callbacks
|
||||
for (auto item : _callbacks) {
|
||||
item->call();
|
||||
}
|
||||
|
||||
/* Mark at least one data has been published */
|
||||
_data_valid = true;
|
||||
|
||||
ATOMIC_LEAVE;
|
||||
|
||||
/* notify any poll waiters */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user