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:
parent
5fd0f2df04
commit
deb691bfc8
2 changed files with 5 additions and 1 deletions
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue