Merge pull request #704 from blckmn/pwm_abort

stop all PWM on all motors on soft reset
This commit is contained in:
J Blackman 2016-07-10 08:35:30 +10:00 committed by GitHub
commit 5c31b59de8
5 changed files with 5 additions and 10 deletions

View File

@ -666,9 +666,10 @@ void stopMotors(void)
delay(50); // give the timers and ESCs a chance to react.
}
void StopPwmAllMotors()
void stopPwmAllMotors()
{
pwmShutdownPulsesForAllMotors(motorCount);
delayMicroseconds(1500);
}
#ifndef USE_QUAD_MIXER_ONLY

View File

@ -215,4 +215,4 @@ void mixTable(void);
void syncMotors(bool enabled);
void writeMotors(void);
void stopMotors(void);
void StopPwmAllMotors(void);
void stopPwmAllMotors(void);

View File

@ -2574,7 +2574,7 @@ static void cliRebootEx(bool bootLoader)
cliPrint("\r\nRebooting");
bufWriterFlush(cliWriter);
waitForSerialPortToFinishTransmitting(cliPort);
stopMotors();
stopPwmAllMotors();
if (bootLoader) {
systemResetToBootloader();
return;

View File

@ -1967,7 +1967,7 @@ void mspProcess(void)
if (isRebootScheduled) {
waitForSerialPortToFinishTransmitting(candidatePort->port);
stopMotors();
stopPwmAllMotors();
// On real flight controllers, systemReset() will do a soft reset of the device,
// reloading the program. But to support offline testing this flag needs to be
// cleared so that the software doesn't continuously attempt to reboot itself.

View File

@ -335,12 +335,6 @@ void init(void)
mixerUsePWMOutputConfiguration(pwmOutputConfiguration, use_unsyncedPwm);
/*
// TODO is this needed here? enables at the end
if (!feature(FEATURE_ONESHOT125))
motorControlEnable = true;
*/
systemState |= SYSTEM_STATE_MOTORS_READY;
#ifdef BEEPER