mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 01:23:37 +08:00
mc_att_control: make sure to update the polling fd when the selected gyro changes
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user