mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Merge pull request #2023 from martinbudden/bf_gyro_fixes
Minor fixes to gyro ISR code, as per review
This commit is contained in:
commit
9fe1ebd1aa
2 changed files with 10 additions and 1 deletions
|
@ -66,7 +66,11 @@
|
|||
|
||||
gyro_t gyro; // gyro access functions
|
||||
|
||||
#if defined(GYRO_USES_SPI) && defined(USE_MPU_DATA_READY_SIGNAL)
|
||||
static volatile int32_t gyroADC[XYZ_AXIS_COUNT];
|
||||
#else
|
||||
static int32_t gyroADC[XYZ_AXIS_COUNT];
|
||||
#endif
|
||||
|
||||
static int32_t gyroZero[XYZ_AXIS_COUNT] = { 0, 0, 0 };
|
||||
static const gyroConfig_t *gyroConfig;
|
||||
|
@ -391,7 +395,8 @@ static bool gyroUpdateISR(gyroDev_t* gyroDev)
|
|||
float gyroADCf = (float)gyroADC[axis] * gyroDev->scale;
|
||||
gyroADCf = softLpfFilterApplyFn(softLpfFilter[axis], gyroADCf);
|
||||
gyroADCf = notchFilter1ApplyFn(notchFilter1[axis], gyroADCf);
|
||||
gyro.gyroADCf[axis] = notchFilter2ApplyFn(notchFilter2[axis], gyroADCf);
|
||||
gyroADCf = notchFilter2ApplyFn(notchFilter2[axis], gyroADCf);
|
||||
gyro.gyroADCf[axis] = gyroADCf;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue