AP_InertialSensor: add fix for icm42688 stuck gyro issue #238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the SpeedyBeeF405 Wing has been added as a target, and it uses the ICM42688 IMU, I believe it's important to also include this. It should also work for any other FC that uses this same IMU.
The ICM42688 has a feature called AFSR where it automatically switches from a low noise, low range to higher noise, high range (of motion) mode if needed. During this switch, the gyro data output may freeze for a few milliseconds, leading to unwanted behaviour. This code is to disable the AFSR feature on IMU init.
This is directly based on #25332, which fixed #25025. I have just left out the gyro logging related changes.
This should also be added to master_custom_light branch, I believe.