1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Extend gyro filter implementation debugging for pitch and yaw axis.

* Introduce CLI parameter gyro_filter_debug_axis which defaults to 'ROLL',
  the previous behavior. When set to either PITCH, or YAW, the debug logging
  implementation in the gyro filtering will use that axis instead.
This commit is contained in:
AJ Christensen 2019-01-19 11:01:46 +13:00
parent 8e2cba97da
commit 5bcf35c7af
5 changed files with 14 additions and 2 deletions

View file

@ -159,6 +159,7 @@ typedef struct gyroSensor_s {
gyroAnalyseState_t gyroAnalyseState;
#endif
flight_dynamics_index_t gyroDebugAxis;
} gyroSensor_t;
STATIC_UNIT_TESTED FAST_RAM_ZERO_INIT gyroSensor_t gyroSensor1;
@ -228,6 +229,7 @@ void pgResetFn_gyroConfig(gyroConfig_t *gyroConfig)
gyroConfig->gyro_lowpass_type = FILTER_BIQUAD;
gyroConfig->gyro_lowpass2_hz = 0;
#endif
gyroConfig->gyro_filter_debug_axis = FD_ROLL;
}
#ifdef USE_MULTI_GYRO
@ -414,6 +416,7 @@ static void gyroPreInitSensor(const gyroDeviceConfig_t *config)
static bool gyroInitSensor(gyroSensor_t *gyroSensor, const gyroDeviceConfig_t *config)
{
gyroSensor->gyroDebugAxis = gyroConfig()->gyro_filter_debug_axis;
gyroSensor->gyroDev.gyro_high_fsr = gyroConfig()->gyro_high_fsr;
gyroSensor->gyroDev.gyroAlign = config->align;
gyroSensor->gyroDev.mpuIntExtiTag = config->extiTag;