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:
parent
89607c699b
commit
cafe727f3a
5 changed files with 9 additions and 13 deletions
|
@ -360,13 +360,12 @@ void updateArmingStatus(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#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 enabled and any motor isn't providing telemetry, then disable arming
|
||||
if (isRpmFilterEnabled() && !isDshotTelemetryActive()) {
|
||||
setArmingDisabled(ARMING_DISABLED_RPMFILTER);
|
||||
#ifdef USE_DSHOT_TELEMETRY
|
||||
// If Dshot Telemetry is enabled and any motor isn't providing telemetry, then disable arming
|
||||
if (motorConfig()->dev.useDshotTelemetry && !isDshotTelemetryActive()) {
|
||||
setArmingDisabled(ARMING_DISABLED_DSHOT_TELEM);
|
||||
} else {
|
||||
unsetArmingDisabled(ARMING_DISABLED_RPMFILTER);
|
||||
unsetArmingDisabled(ARMING_DISABLED_DSHOT_TELEM);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ const char *armingDisableFlagNames[]= {
|
|||
"PARALYZE",
|
||||
"GPS",
|
||||
"RESCUE_SW",
|
||||
"RPMFILTER",
|
||||
"DSHOT_TELEM",
|
||||
"REBOOT_REQD",
|
||||
"DSHOT_BBANG",
|
||||
"NO_ACC_CAL",
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef enum {
|
|||
ARMING_DISABLED_PARALYZE = (1 << 17),
|
||||
ARMING_DISABLED_GPS = (1 << 18),
|
||||
ARMING_DISABLED_RESC = (1 << 19),
|
||||
ARMING_DISABLED_RPMFILTER = (1 << 20),
|
||||
ARMING_DISABLED_DSHOT_TELEM = (1 << 20),
|
||||
ARMING_DISABLED_REBOOT_REQUIRED = (1 << 21),
|
||||
ARMING_DISABLED_DSHOT_BITBANG = (1 << 22),
|
||||
ARMING_DISABLED_ACC_CALIBRATION = (1 << 23),
|
||||
|
|
|
@ -338,7 +338,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr)
|
|||
|
||||
// Add esc warnings
|
||||
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) {
|
||||
warningText[dshotEscErrorLength++] = 'R';
|
||||
}
|
||||
|
|
|
@ -482,6 +482,7 @@
|
|||
#ifndef USE_DSHOT_TELEMETRY
|
||||
#undef USE_RPM_FILTER
|
||||
#undef USE_DSHOT_TELEMETRY_STATS
|
||||
#undef USE_DYN_IDLE
|
||||
#endif
|
||||
|
||||
#if !defined(USE_BOARD_INFO)
|
||||
|
@ -568,10 +569,6 @@ extern uint8_t __config_end;
|
|||
#define RAM_CODE __attribute__((section(".ram_code")))
|
||||
#endif
|
||||
|
||||
#if !defined(USE_RPM_FILTER)
|
||||
#undef USE_DYN_IDLE
|
||||
#endif
|
||||
|
||||
#ifndef USE_ITERM_RELAX
|
||||
#undef USE_ABSOLUTE_CONTROL
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue