mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Fix ordering of gyro filtering and overflow/yaw-spin logic
Since the gyro overflow and yaw-spin logic uses filtered gyro data they need to be after the filter application. Currently the logic is before causing it to operate on one sample old data. This won't prevent the logic from working and it's not a critical fix, but it's better to have the checks after the filtering.
This commit is contained in:
parent
8980ba1065
commit
8e0128a2b2
1 changed files with 6 additions and 6 deletions
|
@ -949,6 +949,12 @@ static FAST_CODE FAST_CODE_NOINLINE void gyroUpdateSensor(gyroSensor_t *gyroSens
|
|||
return;
|
||||
}
|
||||
|
||||
if (gyroDebugMode == DEBUG_NONE) {
|
||||
filterGyro(gyroSensor);
|
||||
} else {
|
||||
filterGyroDebug(gyroSensor);
|
||||
}
|
||||
|
||||
#ifdef USE_GYRO_OVERFLOW_CHECK
|
||||
if (gyroConfig()->checkOverflow && !gyroHasOverflowProtection) {
|
||||
checkForOverflow(gyroSensor, currentTimeUs);
|
||||
|
@ -961,12 +967,6 @@ static FAST_CODE FAST_CODE_NOINLINE void gyroUpdateSensor(gyroSensor_t *gyroSens
|
|||
}
|
||||
#endif
|
||||
|
||||
if (gyroDebugMode == DEBUG_NONE) {
|
||||
filterGyro(gyroSensor);
|
||||
} else {
|
||||
filterGyroDebug(gyroSensor);
|
||||
}
|
||||
|
||||
#ifdef USE_GYRO_DATA_ANALYSE
|
||||
if (isDynamicFilterActive()) {
|
||||
gyroDataAnalyse(&gyroSensor->gyroAnalyseState, gyroSensor->notchFilterDyn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue