1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00

avoid double esc startup sounds on f7 (#8215)

avoid double esc startup sounds on f7
This commit is contained in:
Michael Keller 2019-05-09 01:01:56 +12:00 committed by GitHub
commit 7830c7445e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -393,10 +393,6 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH))
/ getDshotHz(pwmProtocolType);
pwmDshotSetDirectionOutput(motor, true);
if (useDshotTelemetry) {
// avoid high line during startup to prevent bootloader activation
*timerChCCR(timerHardware) = 0xffff;
}
#else
pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT);
#endif
@ -420,6 +416,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
TIM_CtrlPWMOutputs(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;
}

View file

@ -354,10 +354,6 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH))
/ getDshotHz(pwmProtocolType);
pwmDshotSetDirectionOutput(motor, true);
if (useDshotTelemetry) {
// avoid high line during startup to prevent bootloader activation
*timerChCCR(timerHardware) = 0xffff;
}
#else
pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT);
#endif
@ -386,6 +382,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
LL_TIM_EnableARRPreload(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;
}
#endif