mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-13 14:51:37 +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:
@@ -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);
|
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
|
// callbacks
|
||||||
for (auto item : _callbacks) {
|
for (auto item : _callbacks) {
|
||||||
item->call();
|
item->call();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark at least one data has been published */
|
|
||||||
_data_valid = true;
|
|
||||||
|
|
||||||
ATOMIC_LEAVE;
|
ATOMIC_LEAVE;
|
||||||
|
|
||||||
/* notify any poll waiters */
|
/* notify any poll waiters */
|
||||||
|
|||||||
Reference in New Issue
Block a user