Browse Source

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

sbg
Beat Küng 8 years ago committed by Lorenz Meier
parent
commit
3f6783fce7
  1. 3
      src/modules/mc_att_control/mc_att_control_main.cpp

3
src/modules/mc_att_control/mc_att_control_main.cpp

@ -1124,11 +1124,12 @@ MulticopterAttitudeControl::task_main()
/* wakeup source: gyro data from sensor selected by the sensor app */ /* wakeup source: gyro data from sensor selected by the sensor app */
px4_pollfd_struct_t poll_fds = {}; px4_pollfd_struct_t poll_fds = {};
poll_fds.fd = _sensor_gyro_sub[_selected_gyro];
poll_fds.events = POLLIN; poll_fds.events = POLLIN;
while (!_task_should_exit) { while (!_task_should_exit) {
poll_fds.fd = _sensor_gyro_sub[_selected_gyro];
/* wait for up to 100ms for data */ /* wait for up to 100ms for data */
int pret = px4_poll(&poll_fds, 1, 100); int pret = px4_poll(&poll_fds, 1, 100);

Loading…
Cancel
Save