aboutsummaryrefslogtreecommitdiff
path: root/apps/px4/fmu/fmu.cpp
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/px4/fmu/fmu.cpp
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/px4/fmu/fmu.cpp')
-rw-r--r--apps/px4/fmu/fmu.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/px4/fmu/fmu.cpp b/apps/px4/fmu/fmu.cpp
index 83bc62509..3016cb01e 100644
--- a/apps/px4/fmu/fmu.cpp
+++ b/apps/px4/fmu/fmu.cpp
@@ -89,7 +89,7 @@ private:
int _task;
int _t_actuators;
int _t_armed;
- int _t_outputs;
+ orb_advert_t _t_outputs;
unsigned _num_outputs;
volatile bool _task_should_exit;
@@ -566,15 +566,13 @@ fake(int argc, char *argv[])
ac.control[3] = strtol(argv[4], 0, 0) / 100.0f;
- int handle = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &ac);
+ orb_advert_t handle = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &ac);
if (handle < 0) {
puts("advertise failed");
exit(1);
}
- close(handle);
-
exit(0);
}