mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Abort the px4io worker task if subscribing to the required ORB topics fails.
This commit is contained in:
parent
a4b0e3ecbe
commit
0589346ce6
@ -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 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user