mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 06:33:33 +08:00
Abort the px4io worker task if subscribing to the required ORB topics fails.
This commit is contained in:
@@ -572,6 +572,14 @@ PX4IO::task_main()
|
|||||||
_t_param = orb_subscribe(ORB_ID(parameter_update));
|
_t_param = orb_subscribe(ORB_ID(parameter_update));
|
||||||
orb_set_interval(_t_param, 500); /* 2Hz update rate max. */
|
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 */
|
/* poll descriptor */
|
||||||
pollfd fds[4];
|
pollfd fds[4];
|
||||||
fds[0].fd = _t_actuators;
|
fds[0].fd = _t_actuators;
|
||||||
@@ -668,6 +676,7 @@ PX4IO::task_main()
|
|||||||
|
|
||||||
unlock();
|
unlock();
|
||||||
|
|
||||||
|
out:
|
||||||
debug("exiting");
|
debug("exiting");
|
||||||
|
|
||||||
/* clean up the alternate device node */
|
/* clean up the alternate device node */
|
||||||
|
|||||||
Reference in New Issue
Block a user