1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

FIX: Missing IFDEF USE_TIMER and USE_RPM_FILTER (#14201)

This commit is contained in:
Jay Blackman 2025-01-26 04:01:17 +11:00 committed by GitHub
parent 5fd0f2df04
commit deb691bfc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -452,7 +452,7 @@ static void validateAndFixConfig(void)
motorConfigMutable()->dev.useContinuousUpdate = false;
}
#if defined(USE_DSHOT_TELEMETRY)
#if defined(USE_DSHOT_TELEMETRY) && defined(USE_TIMER)
bool nChannelTimerUsed = false;
for (unsigned i = 0; i < getMotorCount(); i++) {
const ioTag_t tag = motorConfig()->dev.ioTags[i];

View file

@ -161,12 +161,16 @@ void initDshotTelemetry(const timeUs_t looptimeUs)
// erpmToHz is used by bidir dshot and ESC telemetry
erpmToHz = ERPM_PER_LSB / SECONDS_PER_MINUTE / (motorConfig()->motorPoleCount / 2.0f);
#ifdef USE_RPM_FILTER
if (motorConfig()->dev.useDshotTelemetry) {
// init LPFs for RPM data
for (unsigned i = 0; i < dshotMotorCount; i++) {
pt1FilterInit(&motorFreqLpf[i], pt1FilterGain(rpmFilterConfig()->rpm_filter_lpf_hz, looptimeUs * 1e-6f));
}
}
#else
UNUSED(looptimeUs);
#endif
}
static uint32_t dshot_decode_eRPM_telemetry_value(uint16_t value)