diff options
author | px4dev <px4@purgatory.org> | 2013-07-06 00:00:10 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-07-06 00:00:10 -0700 |
commit | 0589346ce6ccbcee03437ee293cc03d900bf76d9 (patch) | |
tree | 67a1ea4dac9c878c166161a1a7de900976093666 /src/drivers/px4io/px4io.cpp | |
parent | a4b0e3ecbe2d012eac7545cce14829866bacc813 (diff) | |
download | px4-firmware-0589346ce6ccbcee03437ee293cc03d900bf76d9.tar.gz px4-firmware-0589346ce6ccbcee03437ee293cc03d900bf76d9.tar.bz2 px4-firmware-0589346ce6ccbcee03437ee293cc03d900bf76d9.zip |
Abort the px4io worker task if subscribing to the required ORB topics fails.
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 663609aed..5895a4eb5 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -572,6 +572,14 @@ PX4IO::task_main() _t_param = orb_subscribe(ORB_ID(parameter_update)); orb_set_interval(_t_param, 500); /* 2Hz update rate max. */ + if ((_t_actuators < 0) || + (_t_armed < 0) || + (_t_vstatus < 0) || + (_t_param < 0)) { + log("subscription(s) failed"); + goto out; + } + /* poll descriptor */ pollfd fds[4]; fds[0].fd = _t_actuators; @@ -668,6 +676,7 @@ PX4IO::task_main() unlock(); +out: debug("exiting"); /* clean up the alternate device node */ |