1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

Fix Dshot telemetry (#13140)

* Fix Dshot telemetry

* Revert check per review
This commit is contained in:
Mark Haslinghuis 2023-11-23 22:56:14 +01:00 committed by GitHub
parent 89607c699b
commit cafe727f3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 13 deletions

View file

@ -360,13 +360,12 @@ void updateArmingStatus(void)
} }
#endif #endif
#ifdef USE_RPM_FILTER #ifdef USE_DSHOT_TELEMETRY
// USE_RPM_FILTER will only be defined if USE_DSHOT and USE_DSHOT_TELEMETRY are defined // If Dshot Telemetry is enabled and any motor isn't providing telemetry, then disable arming
// If the RPM filter is enabled and any motor isn't providing telemetry, then disable arming if (motorConfig()->dev.useDshotTelemetry && !isDshotTelemetryActive()) {
if (isRpmFilterEnabled() && !isDshotTelemetryActive()) { setArmingDisabled(ARMING_DISABLED_DSHOT_TELEM);
setArmingDisabled(ARMING_DISABLED_RPMFILTER);
} else { } else {
unsetArmingDisabled(ARMING_DISABLED_RPMFILTER); unsetArmingDisabled(ARMING_DISABLED_DSHOT_TELEM);
} }
#endif #endif

View file

@ -54,7 +54,7 @@ const char *armingDisableFlagNames[]= {
"PARALYZE", "PARALYZE",
"GPS", "GPS",
"RESCUE_SW", "RESCUE_SW",
"RPMFILTER", "DSHOT_TELEM",
"REBOOT_REQD", "REBOOT_REQD",
"DSHOT_BBANG", "DSHOT_BBANG",
"NO_ACC_CAL", "NO_ACC_CAL",

View file

@ -60,7 +60,7 @@ typedef enum {
ARMING_DISABLED_PARALYZE = (1 << 17), ARMING_DISABLED_PARALYZE = (1 << 17),
ARMING_DISABLED_GPS = (1 << 18), ARMING_DISABLED_GPS = (1 << 18),
ARMING_DISABLED_RESC = (1 << 19), ARMING_DISABLED_RESC = (1 << 19),
ARMING_DISABLED_RPMFILTER = (1 << 20), ARMING_DISABLED_DSHOT_TELEM = (1 << 20),
ARMING_DISABLED_REBOOT_REQUIRED = (1 << 21), ARMING_DISABLED_REBOOT_REQUIRED = (1 << 21),
ARMING_DISABLED_DSHOT_BITBANG = (1 << 22), ARMING_DISABLED_DSHOT_BITBANG = (1 << 22),
ARMING_DISABLED_ACC_CALIBRATION = (1 << 23), ARMING_DISABLED_ACC_CALIBRATION = (1 << 23),

View file

@ -338,7 +338,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr)
// Add esc warnings // Add esc warnings
if (ARMING_FLAG(ARMED) && osdConfig()->esc_rpm_alarm != ESC_RPM_ALARM_OFF if (ARMING_FLAG(ARMED) && osdConfig()->esc_rpm_alarm != ESC_RPM_ALARM_OFF
&& (dshotTelemetryState.motorState[k].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_eRPM)) != 0 && isDshotMotorTelemetryActive(k)
&& (dshotTelemetryState.motorState[k].telemetryData[DSHOT_TELEMETRY_TYPE_eRPM] * 100 * 2 / motorConfig()->motorPoleCount) <= osdConfig()->esc_rpm_alarm) { && (dshotTelemetryState.motorState[k].telemetryData[DSHOT_TELEMETRY_TYPE_eRPM] * 100 * 2 / motorConfig()->motorPoleCount) <= osdConfig()->esc_rpm_alarm) {
warningText[dshotEscErrorLength++] = 'R'; warningText[dshotEscErrorLength++] = 'R';
} }

View file

@ -482,6 +482,7 @@
#ifndef USE_DSHOT_TELEMETRY #ifndef USE_DSHOT_TELEMETRY
#undef USE_RPM_FILTER #undef USE_RPM_FILTER
#undef USE_DSHOT_TELEMETRY_STATS #undef USE_DSHOT_TELEMETRY_STATS
#undef USE_DYN_IDLE
#endif #endif
#if !defined(USE_BOARD_INFO) #if !defined(USE_BOARD_INFO)
@ -568,10 +569,6 @@ extern uint8_t __config_end;
#define RAM_CODE __attribute__((section(".ram_code"))) #define RAM_CODE __attribute__((section(".ram_code")))
#endif #endif
#if !defined(USE_RPM_FILTER)
#undef USE_DYN_IDLE
#endif
#ifndef USE_ITERM_RELAX #ifndef USE_ITERM_RELAX
#undef USE_ABSOLUTE_CONTROL #undef USE_ABSOLUTE_CONTROL
#endif #endif