mc_att_control: make sure to update the polling fd when the selected gyro changes

This commit is contained in:
Beat Küng
2017-03-04 05:59:10 +08:00
committed by Lorenz Meier
parent ec33607912
commit 3f6783fce7
@@ -1124,11 +1124,12 @@ MulticopterAttitudeControl::task_main()
/* wakeup source: gyro data from sensor selected by the sensor app */
px4_pollfd_struct_t poll_fds = {};
poll_fds.fd = _sensor_gyro_sub[_selected_gyro];
poll_fds.events = POLLIN;
while (!_task_should_exit) {
poll_fds.fd = _sensor_gyro_sub[_selected_gyro];
/* wait for up to 100ms for data */
int pret = px4_poll(&poll_fds, 1, 100);