mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
2khz Support Added
This commit is contained in:
parent
27c6db51fb
commit
a3fe45d774
8 changed files with 79 additions and 31 deletions
|
@ -38,15 +38,17 @@ int16_t gyroADC[XYZ_AXIS_COUNT];
|
|||
int16_t gyroZero[FLIGHT_DYNAMICS_INDEX_COUNT] = { 0, 0, 0 };
|
||||
|
||||
static gyroConfig_t *gyroConfig;
|
||||
static uint8_t gyroFIRFilter;
|
||||
static int8_t * gyroFIRTable = 0L;
|
||||
static int16_t gyroFIRState[3][FILTER_TAPS];
|
||||
|
||||
|
||||
gyro_t gyro; // gyro access functions
|
||||
sensor_align_e gyroAlign = 0;
|
||||
|
||||
void useGyroConfig(gyroConfig_t *gyroConfigToUse, int8_t filter)
|
||||
void useGyroConfig(gyroConfig_t *gyroConfigToUse, int8_t * filterTableToUse)
|
||||
{
|
||||
gyroConfig = gyroConfigToUse;
|
||||
gyroFIRFilter = filter;
|
||||
gyroFIRTable = filterTableToUse;
|
||||
}
|
||||
|
||||
void gyroSetCalibrationCycles(uint16_t calibrationCyclesRequired)
|
||||
|
@ -124,8 +126,8 @@ void gyroUpdate(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (gyroFIRFilter) {
|
||||
filterApplyFIR(gyroADC);
|
||||
if (gyroFIRTable) {
|
||||
filterApplyFIR(gyroADC, gyroFIRState, gyroFIRTable);
|
||||
}
|
||||
|
||||
alignSensors(gyroADC, gyroADC, gyroAlign);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue