1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 06:45:16 +03:00

Use the cached value of useDshotTelemetry to ensure consistent runtime use if dshot_bidir is changed (#13589)

This commit is contained in:
Steve Evans 2024-04-28 00:31:50 +01:00 committed by GitHub
parent 54377940e0
commit 565de1b68b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 19 additions and 20 deletions

View file

@ -363,7 +363,7 @@ void updateArmingStatus(void)
#ifdef USE_DSHOT_TELEMETRY
// If Dshot Telemetry is enabled and any motor isn't providing telemetry, then disable arming
if (motorConfig()->dev.useDshotTelemetry && !isDshotTelemetryActive()) {
if (useDshotTelemetry && !isDshotTelemetryActive()) {
setArmingDisabled(ARMING_DISABLED_DSHOT_TELEM);
} else {
unsetArmingDisabled(ARMING_DISABLED_DSHOT_TELEM);
@ -371,7 +371,7 @@ void updateArmingStatus(void)
#endif
#ifdef USE_DSHOT_BITBANG
if (isDshotBitbangActive(&motorConfig()->dev) && dshotBitbangGetStatus() != DSHOT_BITBANG_STATUS_OK) {
if (useDshotTelemetry && isDshotBitbangActive(&motorConfig()->dev) && dshotBitbangGetStatus() != DSHOT_BITBANG_STATUS_OK) {
setArmingDisabled(ARMING_DISABLED_DSHOT_BITBANG);
} else {
unsetArmingDisabled(ARMING_DISABLED_DSHOT_BITBANG);
@ -514,7 +514,7 @@ void tryArm(void)
if (isMotorProtocolDshot()) {
#if defined(USE_ESC_SENSOR) && defined(USE_DSHOT_TELEMETRY)
// Try to activate extended DSHOT telemetry only if no esc sensor exists and dshot telemetry is active
if (!featureIsEnabled(FEATURE_ESC_SENSOR) && motorConfig()->dev.useDshotTelemetry) {
if (!featureIsEnabled(FEATURE_ESC_SENSOR) && useDshotTelemetry) {
dshotCleanTelemetryData();
if (motorConfig()->dev.useDshotEdt) {
dshotCommandWrite(ALL_MOTORS, getMotorCount(), DSHOT_CMD_EXTENDED_TELEMETRY_ENABLE, DSHOT_CMD_TYPE_INLINE);