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 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2022-04-29 13:26:22 +08:00 committed by Alan Carvalho de Assis
parent 53ee04ba3c
commit 5bb4e14aad

@ -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,