mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
mc_att_control_main: fix bound check for gyro instance
This commit is contained in:
parent
bbd47389e0
commit
7d5cd02c70
@ -828,7 +828,7 @@ MulticopterAttitudeControl::sensor_correction_poll()
|
||||
}
|
||||
|
||||
/* update the latest gyro selection */
|
||||
if (_sensor_correction.selected_gyro_instance <= sizeof(_sensor_gyro_sub) / sizeof(_sensor_gyro_sub[0])) {
|
||||
if (_sensor_correction.selected_gyro_instance < sizeof(_sensor_gyro_sub) / sizeof(_sensor_gyro_sub[0])) {
|
||||
_selected_gyro = _sensor_correction.selected_gyro_instance;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user