1
0
Fork 0
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:
borisbstyle 2015-12-22 17:42:57 +01:00
parent 27c6db51fb
commit a3fe45d774
8 changed files with 79 additions and 31 deletions

View file

@ -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);