mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Merge pull request #1505 from blckmn/disable_motors_dshot
Disable output of DSHOT when motors disabled
This commit is contained in:
commit
0415285475
6 changed files with 30 additions and 2 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)
|
||||
|
@ -87,6 +92,10 @@ void pwmCompleteDigitalMotorUpdate(uint8_t motorCount)
|
|||
{
|
||||
UNUSED(motorCount);
|
||||
|
||||
if (!pwmMotorsEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < dmaMotorTimerCount; i++) {
|
||||
//TIM_SetCounter(dmaMotorTimers[i].timer, 0);
|
||||
//TIM_DMACmd(dmaMotorTimers[i].timer, dmaMotorTimers[i].timerDmaSources, ENABLE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue