mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
Improve dshot_edt_always_decode condition checking logic
This commit is contained in:
parent
d5f8526ae6
commit
b5b3de1cb1
1 changed files with 2 additions and 2 deletions
|
@ -181,7 +181,7 @@ void initDshotTelemetry(const timeUs_t looptimeUs)
|
||||||
|
|
||||||
// erpmToHz is used by bidir dshot and ESC telemetry
|
// erpmToHz is used by bidir dshot and ESC telemetry
|
||||||
erpmToHz = ERPM_PER_LSB / SECONDS_PER_MINUTE / (motorConfig()->motorPoleCount / 2.0f);
|
erpmToHz = ERPM_PER_LSB / SECONDS_PER_MINUTE / (motorConfig()->motorPoleCount / 2.0f);
|
||||||
edtAlwaysDecode = motorConfig()->dev.useDshotEdtAlwaysDecode == DSHOT_EDT_ALWAYS_DECODE_ON;
|
edtAlwaysDecode = motorConfig()->dev.useDshotEdtAlwaysDecode;
|
||||||
|
|
||||||
#ifdef USE_RPM_FILTER
|
#ifdef USE_RPM_FILTER
|
||||||
if (motorConfig()->dev.useDshotTelemetry) {
|
if (motorConfig()->dev.useDshotTelemetry) {
|
||||||
|
@ -216,7 +216,7 @@ static void dshot_decode_telemetry_value(uint8_t motorIndex, uint32_t *pDecoded,
|
||||||
{
|
{
|
||||||
uint16_t value = dshotTelemetryState.motorState[motorIndex].rawValue;
|
uint16_t value = dshotTelemetryState.motorState[motorIndex].rawValue;
|
||||||
bool isEdtEnabled = (dshotTelemetryState.motorState[motorIndex].telemetryTypes & DSHOT_EXTENDED_TELEMETRY_MASK) != 0;
|
bool isEdtEnabled = (dshotTelemetryState.motorState[motorIndex].telemetryTypes & DSHOT_EXTENDED_TELEMETRY_MASK) != 0;
|
||||||
isEdtEnabled |= edtAlwaysDecode;
|
isEdtEnabled = isEdtEnabled || (edtAlwaysDecode == DSHOT_EDT_ALWAYS_DECODE_ON);
|
||||||
|
|
||||||
// https://github.com/bird-sanctuary/extended-dshot-telemetry
|
// https://github.com/bird-sanctuary/extended-dshot-telemetry
|
||||||
// Extract telemetry type field and check for eRPM conditions in one operation
|
// Extract telemetry type field and check for eRPM conditions in one operation
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue