1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Always stop motor PWM prior to soft restart

This commit is contained in:
ProDrone 2015-05-21 16:02:49 +02:00
parent 655bd574c2
commit d1d73d933e

View file

@ -940,9 +940,11 @@ void changeControlRateProfile(uint8_t profileIndex)
void handleOneshotFeatureChangeOnRestart(void)
{
// When OneShot125 feature changed state, shutdown PWM on all motors and apply a delay before
// Shutdown PWM on all motors prior to soft restart
StopPwmAllMotors();
delay(50);
// When OneShot125 feature changed state apply additional delay
if ((masterConfig.enabledFeatures ^ activeFeaturesLatch) & FEATURE_ONESHOT125) {
StopPwmAllMotors();
delay(ONESHOT_FEATURE_CHANGED_DELAY_ON_BOOT_MS);
}
}