mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
avoid double esc startup sounds on f7
This commit is contained in:
parent
1cbff2b9aa
commit
f736561701
2 changed files with 12 additions and 8 deletions
|
@ -393,10 +393,6 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
||||||
( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH))
|
( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH))
|
||||||
/ getDshotHz(pwmProtocolType);
|
/ getDshotHz(pwmProtocolType);
|
||||||
pwmDshotSetDirectionOutput(motor, true);
|
pwmDshotSetDirectionOutput(motor, true);
|
||||||
if (useDshotTelemetry) {
|
|
||||||
// avoid high line during startup to prevent bootloader activation
|
|
||||||
*timerChCCR(timerHardware) = 0xffff;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT);
|
pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -420,6 +416,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
||||||
TIM_CtrlPWMOutputs(timer, ENABLE);
|
TIM_CtrlPWMOutputs(timer, ENABLE);
|
||||||
TIM_Cmd(timer, ENABLE);
|
TIM_Cmd(timer, ENABLE);
|
||||||
}
|
}
|
||||||
|
#ifdef USE_DSHOT_TELEMETRY
|
||||||
|
if (useDshotTelemetry) {
|
||||||
|
// avoid high line during startup to prevent bootloader activation
|
||||||
|
*timerChCCR(timerHardware) = 0xffff;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
motor->configured = true;
|
motor->configured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,10 +354,6 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
||||||
( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH))
|
( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH))
|
||||||
/ getDshotHz(pwmProtocolType);
|
/ getDshotHz(pwmProtocolType);
|
||||||
pwmDshotSetDirectionOutput(motor, true);
|
pwmDshotSetDirectionOutput(motor, true);
|
||||||
if (useDshotTelemetry) {
|
|
||||||
// avoid high line during startup to prevent bootloader activation
|
|
||||||
*timerChCCR(timerHardware) = 0xffff;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT);
|
pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -386,6 +382,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
||||||
LL_TIM_EnableARRPreload(timer);
|
LL_TIM_EnableARRPreload(timer);
|
||||||
LL_TIM_EnableCounter(timer);
|
LL_TIM_EnableCounter(timer);
|
||||||
}
|
}
|
||||||
|
#ifdef USE_DSHOT_TELEMETRY
|
||||||
|
if (useDshotTelemetry) {
|
||||||
|
// avoid high line during startup to prevent bootloader activation
|
||||||
|
*timerChCCR(timerHardware) = 0xffff;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
motor->configured = true;
|
motor->configured = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue