pwm_out_sim: fix orb handle == 0 is valid & use orb_unsubscribe instead of px4_close

This commit is contained in:
Beat Küng
2016-06-06 16:16:14 +02:00
parent 9fedda43c6
commit dc3bd31e59
+2 -2
View File
@@ -358,11 +358,11 @@ PWMSim::subscribe()
if (unsub_groups & (1 << i)) {
PX4_DEBUG("unsubscribe from actuator_controls_%d", i);
px4_close(_control_subs[i]);
orb_unsubscribe(_control_subs[i]);
_control_subs[i] = -1;
}
if (_control_subs[i] > 0) {
if (_control_subs[i] >= 0) {
_poll_fds[_poll_fds_num].fd = _control_subs[i];
_poll_fds[_poll_fds_num].events = POLLIN;
_poll_fds_num++;