mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Disable output of DSHOT when motors disabled
This commit is contained in:
parent
4355d675b2
commit
ec92be725b
5 changed files with 29 additions and 1 deletions
|
@ -57,6 +57,11 @@ uint8_t getTimerIndex(TIM_TypeDef *timer)
|
|||
|
||||
void pwmWriteDigital(uint8_t index, uint16_t value)
|
||||
{
|
||||
|
||||
if (!pwmMotorsEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
motorDmaOutput_t * const motor = &dmaMotors[index];
|
||||
|
||||
uint16_t packet = (value << 1) | 0; // Here goes telemetry bit (false for now)
|
||||
|
@ -83,6 +88,10 @@ void pwmWriteDigital(uint8_t index, uint16_t value)
|
|||
void pwmCompleteDigitalMotorUpdate(uint8_t motorCount)
|
||||
{
|
||||
UNUSED(motorCount);
|
||||
|
||||
if (!pwmMotorsEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < dmaMotorTimerCount; i++) {
|
||||
TIM_SetCounter(dmaMotorTimers[i].timer, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue