aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uORB
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-12-29 08:00:12 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-12-29 08:00:12 +0100
commitf4e0dc2857da7a8b42b7439ae57310b23c902cd9 (patch)
treed31b6697458c5f54672ea6b5bbc3a267e6fa1be5 /src/modules/uORB
parentacb4844939f971a1a33515316f5e6c7c8f668f12 (diff)
parent22f744f0e17f83a706998381d1977c9cb24d457a (diff)
downloadpx4-firmware-f4e0dc2857da7a8b42b7439ae57310b23c902cd9.tar.gz
px4-firmware-f4e0dc2857da7a8b42b7439ae57310b23c902cd9.tar.bz2
px4-firmware-f4e0dc2857da7a8b42b7439ae57310b23c902cd9.zip
Merge remote-tracking branch 'upstream/master' into dev_ros
Conflicts: .gitmodules
Diffstat (limited to 'src/modules/uORB')
-rw-r--r--src/modules/uORB/uORB.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/modules/uORB/uORB.h b/src/modules/uORB/uORB.h
index a6e9171ed..707ff1efd 100644
--- a/src/modules/uORB/uORB.h
+++ b/src/modules/uORB/uORB.h
@@ -68,6 +68,33 @@ typedef const struct orb_metadata *orb_id_t;
#define ORB_ID(_name) &__orb_##_name
/**
+ * Generates a pointer to the uORB metadata structure for
+ * a given topic.
+ *
+ * The topic must have been declared previously in scope
+ * with ORB_DECLARE().
+ *
+ * @param _name The name of the topic.
+ * @param _count The class ID of the topic
+ */
+#define ORB_ID_DOUBLE(_name, _count) ((_count == CLASS_DEVICE_PRIMARY) ? &__orb_##_name##0 : &__orb_##_name##1)
+
+/**
+ * Generates a pointer to the uORB metadata structure for
+ * a given topic.
+ *
+ * The topic must have been declared previously in scope
+ * with ORB_DECLARE().
+ *
+ * @param _name The name of the topic.
+ * @param _count The class ID of the topic
+ */
+#define ORB_ID_TRIPLE(_name, _count) \
+ ((_count == CLASS_DEVICE_PRIMARY) ? &__orb_##_name##0 : \
+ ((_count == CLASS_DEVICE_SECONDARY) ? &__orb_##_name##1 : \
+ (((_count == CLASS_DEVICE_TERTIARY) ? &__orb_##_name##2 : 0))))
+
+/**
* Declare (prototype) the uORB metadata for a topic.
*
* Note that optional topics are declared weak; this allows a potential