From 5bb4e14aad7285f0b641eada0ae32a69a218a1e9 Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Fri, 29 Apr 2022 13:26:22 +0800 Subject: [PATCH] system/uorb: always let orb_advertise, orb_advertise_queue for instance 0 1.orb_advertise, orb_advertise_queue for instance 0 2.orb_advertise_multi, orb_advertise__multi_queue for specified instance 3.If orb_advertise_multi_queue with instance is NULL, auto increase instance from existing base. Signed-off-by: Jiuzhu Dong --- system/uorb/uORB/uORB.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index b59913d75..4cfe6b29d 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -235,14 +235,18 @@ int orb_advertise_multi_queue(FAR const struct orb_metadata *meta, static inline int orb_advertise(FAR const struct orb_metadata *meta, FAR const void *data) { - return orb_advertise_multi_queue(meta, data, NULL, 1); + int instance = 0; + + return orb_advertise_multi_queue(meta, data, &instance, 1); } static inline int orb_advertise_queue(FAR const struct orb_metadata *meta, FAR const void *data, unsigned int queue_size) { - return orb_advertise_multi_queue(meta, data, NULL, queue_size); + int instance = 0; + + return orb_advertise_multi_queue(meta, data, &instance, queue_size); } static inline int orb_advertise_multi(FAR const struct orb_metadata *meta,