Fix dual gyro default logic

With the changes to add dual gyro support and the SPRACINGF7DUAL target, the defaulting logic of which gyro(s) to use was changed. The logic defaulted to using "BOTH" unless the target specifically selected a gyro.

I think this logic is backwards in that the first gyro should be selected by default unless the target specifies something different.  The previous logic would cause all of the previous dual-gyro targets to default to "BOTH" even though they have different gyro types.  This is probably not a good idea and definitely would cause an unexpected change for the users.

The SPRACINGF7DUAL target has two of the same gyro so defaulting to "BOTH" is appropriate.  So now the target specifies that both gyros should be used in this case as the default.
This commit is contained in:
Bruce Luckcuck 2018-05-02 20:06:08 -04:00
parent 6d72a853dd
commit 8abbb84a55
2 changed files with 2 additions and 4 deletions

View File

@ -179,12 +179,8 @@ static void gyroInitLowpassFilterLpf(gyroSensor_t *gyroSensor, int slot, int typ
PG_REGISTER_WITH_RESET_TEMPLATE(gyroConfig_t, gyroConfig, PG_GYRO_CONFIG, 2);
#ifndef GYRO_CONFIG_USE_GYRO_DEFAULT
#ifdef USE_DUAL_GYRO
#define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_BOTH
#else
#define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
#endif
#endif
PG_RESET_TEMPLATE(gyroConfig_t, gyroConfig,
.gyro_align = ALIGN_DEFAULT,

View File

@ -76,6 +76,8 @@
#define ACC_1_ALIGN ACC_MPU6500_1_ALIGN
#define ACC_2_ALIGN ACC_MPU6500_2_ALIGN
#define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_BOTH
#define USE_BARO
#define USE_BARO_BMP280
#define USE_BARO_MS5611