refactor uorb: inline orb_publish_auto

It is a very small core function that needs to be fast.
This commit is contained in:
Beat Küng
2018-07-23 09:17:03 +02:00
committed by Lorenz Meier
parent 875ee794ef
commit 7753dd4b4e
2 changed files with 21 additions and 23 deletions
-17
View File
@@ -67,23 +67,6 @@ int orb_unadvertise(orb_advert_t handle)
return uORB::Manager::get_instance()->orb_unadvertise(handle);
}
int orb_publish_auto(const struct orb_metadata *meta, orb_advert_t *handle, const void *data, int *instance,
int priority)
{
if (*handle == nullptr) {
*handle = orb_advertise_multi(meta, data, instance, priority);
if (*handle != nullptr) {
return 0;
}
} else {
return orb_publish(meta, *handle, data);
}
return -1;
}
int orb_publish(const struct orb_metadata *meta, orb_advert_t handle, const void *data)
{
return uORB::Manager::get_instance()->orb_publish(meta, handle, data);