diff --git a/src/main/drivers/pwm_output.c b/src/main/drivers/pwm_output.c index 166d5c8882..c7f2942c0e 100644 --- a/src/main/drivers/pwm_output.c +++ b/src/main/drivers/pwm_output.c @@ -386,6 +386,11 @@ uint32_t getDshotHz(motorPwmProtocolTypes_e pwmProtocolType) } } +FAST_RAM bool pwmIsProcessingDshotCommand(void) +{ + return dshotCommandControl.nextCommandAt; +} + void pwmWriteDshotCommand(uint8_t index, uint8_t motorCount, uint8_t command, bool blocking) { timeUs_t timeNowUs = micros(); @@ -448,11 +453,6 @@ void pwmWriteDshotCommand(uint8_t index, uint8_t motorCount, uint8_t command, bo } } -FAST_RAM bool pwmIsProcessingDshotCommand(void) -{ - return dshotCommandControl.nextCommandAt; -} - uint8_t pwmGetDshotCommand(uint8_t index) { return dshotCommandControl.command[index]; diff --git a/src/main/drivers/pwm_output_dshot.c b/src/main/drivers/pwm_output_dshot.c index 43b94480fc..53e6b3b100 100644 --- a/src/main/drivers/pwm_output_dshot.c +++ b/src/main/drivers/pwm_output_dshot.c @@ -97,8 +97,10 @@ void pwmCompleteDshotMotorUpdate(uint8_t motorCount) UNUSED(motorCount); /* If there is a dshot command loaded up, time it correctly with motor update*/ - if (!pwmProcessDshotCommand(motorCount)) { - return; //Skip motor update + if (pwmIsProcessingDshotCommand()) { + if (!pwmProcessDshotCommand(motorCount)) { + return; + } } for (int i = 0; i < dmaMotorTimerCount; i++) {