aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-08-21 23:44:22 -0700
committerpx4dev <px4@purgatory.org>2012-08-21 23:44:22 -0700
commit88f0080a0ffb299006950c0453eabddb7d17f078 (patch)
treeea769b9b10ba256942ec93d5b42515f1057f7f4f /apps/drivers
parent8c22e2a092a5527e5e4af2a54ecdeac586ffbfa7 (diff)
downloadpx4-firmware-88f0080a0ffb299006950c0453eabddb7d17f078.tar.gz
px4-firmware-88f0080a0ffb299006950c0453eabddb7d17f078.tar.bz2
px4-firmware-88f0080a0ffb299006950c0453eabddb7d17f078.zip
Fix an architectural issue with the ORB that prevented publication from interrupt context.
ORB topic advertisements are now global handles that can be used in any context. It is still possible to open a topic node as a publisher, but it's not the default. As a consequence, the type of the handle returned from orb_advertise has changed; all other API remains the same.
Diffstat (limited to 'apps/drivers')
-rw-r--r--apps/drivers/drv_orb_dev.h3
-rw-r--r--apps/drivers/hmc5883/hmc5883.cpp2
-rw-r--r--apps/drivers/mpu6000/mpu6000.cpp4
-rw-r--r--apps/drivers/ms5611/ms5611.cpp2
4 files changed, 7 insertions, 4 deletions
diff --git a/apps/drivers/drv_orb_dev.h b/apps/drivers/drv_orb_dev.h
index b3fc01a5f..50288f690 100644
--- a/apps/drivers/drv_orb_dev.h
+++ b/apps/drivers/drv_orb_dev.h
@@ -81,4 +81,7 @@
/** Set the minimum interval at which the topic can be seen to be updated for this subscription */
#define ORBIOCSETINTERVAL _ORBIOC(12)
+/** Get the global advertiser handle for the topic */
+#define ORBIOCGADVERTISER _ORBIOC(13)
+
#endif /* _DRV_UORB_H */
diff --git a/apps/drivers/hmc5883/hmc5883.cpp b/apps/drivers/hmc5883/hmc5883.cpp
index a98b30efc..0fa1f365d 100644
--- a/apps/drivers/hmc5883/hmc5883.cpp
+++ b/apps/drivers/hmc5883/hmc5883.cpp
@@ -147,7 +147,7 @@ private:
mag_scale _scale;
bool _collect_phase;
- int _mag_topic;
+ orb_advert_t _mag_topic;
unsigned _reads;
unsigned _measure_errors;
diff --git a/apps/drivers/mpu6000/mpu6000.cpp b/apps/drivers/mpu6000/mpu6000.cpp
index 7576fc1d9..951e1a062 100644
--- a/apps/drivers/mpu6000/mpu6000.cpp
+++ b/apps/drivers/mpu6000/mpu6000.cpp
@@ -181,12 +181,12 @@ private:
struct accel_report _accel_report;
struct accel_scale _accel_scale;
float _accel_range_scale;
- int _accel_topic;
+ orb_advert_t _accel_topic;
struct gyro_report _gyro_report;
struct gyro_scale _gyro_scale;
float _gyro_range_scale;
- int _gyro_topic;
+ orb_advert_t _gyro_topic;
unsigned _reads;
perf_counter_t _sample_perf;
diff --git a/apps/drivers/ms5611/ms5611.cpp b/apps/drivers/ms5611/ms5611.cpp
index ee366f668..8f8f96217 100644
--- a/apps/drivers/ms5611/ms5611.cpp
+++ b/apps/drivers/ms5611/ms5611.cpp
@@ -125,7 +125,7 @@ private:
int32_t _dT;
int64_t _temp64;
- int _baro_topic;
+ orb_advert_t _baro_topic;
unsigned _reads;
unsigned _measure_errors;