Merge pull request #7895 from etracer65/dshot_bidir_disable_dual_gyro
Disallow dual gyro in "BOTH" mode if RPM filter enabled
This commit is contained in:
commit
72d0117278
|
@ -457,6 +457,14 @@ static void validateAndFixConfig(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
// Temporary workaround until RPM Filter supports dual-gyro using both sensors
|
||||
// Once support is added remove this block
|
||||
#if defined(USE_MULTI_GYRO) && defined(USE_RPM_FILTER)
|
||||
if (gyroConfig()->gyro_to_use == GYRO_CONFIG_USE_GYRO_BOTH && isRpmFilterEnabled()) {
|
||||
gyroConfigMutable()->gyro_to_use = GYRO_CONFIG_USE_GYRO_1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_VALIDATECONFIG)
|
||||
targetValidateConfiguration();
|
||||
#endif
|
||||
|
|
|
@ -296,14 +296,11 @@ void updateArmingStatus(void)
|
|||
#ifdef USE_RPM_FILTER
|
||||
// USE_RPM_FILTER will only be defined if USE_DSHOT and USE_DSHOT_TELEMETRY are defined
|
||||
// If the RPM filter is anabled and any motor isn't providing telemetry, then disable arming
|
||||
if (motorConfig()->dev.useDshotTelemetry
|
||||
&& (rpmFilterConfig()->gyro_rpm_notch_harmonics || rpmFilterConfig()->dterm_rpm_notch_harmonics)) {
|
||||
if (!isDshotTelemetryActive()) {
|
||||
if (isRpmFilterEnabled() && !isDshotTelemetryActive()) {
|
||||
setArmingDisabled(ARMING_DISABLED_RPMFILTER);
|
||||
} else {
|
||||
unsetArmingDisabled(ARMING_DISABLED_RPMFILTER);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (IS_RC_MODE_ACTIVE(BOXPARALYZE)) {
|
||||
|
|
|
@ -209,4 +209,9 @@ FAST_CODE_NOINLINE void rpmFilterUpdate()
|
|||
}
|
||||
}
|
||||
|
||||
bool isRpmFilterEnabled(void)
|
||||
{
|
||||
return (motorConfig()->dev.useDshotTelemetry && (rpmFilterConfig()->gyro_rpm_notch_harmonics || rpmFilterConfig()->dterm_rpm_notch_harmonics));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,3 +42,4 @@ void rpmFilterInit(const rpmFilterConfig_t *config);
|
|||
float rpmFilterGyro(int axis, float values);
|
||||
float rpmFilterDterm(int axis, float values);
|
||||
void rpmFilterUpdate();
|
||||
bool isRpmFilterEnabled(void);
|
||||
|
|
Loading…
Reference in New Issue