mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Additional delay never eventuates with new pwm_protocol and disabling of feature for OS42 and MS - why needed for 125?
This commit is contained in:
parent
d384fae9f4
commit
b953e1c0b4
4 changed files with 4 additions and 16 deletions
|
@ -1046,7 +1046,8 @@ void changeProfile(uint8_t profileIndex)
|
||||||
beeperConfirmationBeeps(profileIndex + 1);
|
beeperConfirmationBeeps(profileIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeControlRateProfile(uint8_t profileIndex) {
|
void changeControlRateProfile(uint8_t profileIndex)
|
||||||
|
{
|
||||||
if (profileIndex > MAX_RATEPROFILES) {
|
if (profileIndex > MAX_RATEPROFILES) {
|
||||||
profileIndex = MAX_RATEPROFILES - 1;
|
profileIndex = MAX_RATEPROFILES - 1;
|
||||||
}
|
}
|
||||||
|
@ -1054,17 +1055,6 @@ void changeControlRateProfile(uint8_t profileIndex) {
|
||||||
activateControlRateConfig();
|
activateControlRateConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleOneshotFeatureChangeOnRestart(void)
|
|
||||||
{
|
|
||||||
// Shutdown PWM on all motors prior to soft restart
|
|
||||||
StopPwmAllMotors();
|
|
||||||
delay(50);
|
|
||||||
// Apply additional delay when OneShot125 feature changed from on to off state
|
|
||||||
if (feature(FEATURE_ONESHOT125) && !featureConfigured(FEATURE_ONESHOT125)) {
|
|
||||||
delay(ONESHOT_FEATURE_CHANGED_DELAY_ON_BOOT_MS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void latchActiveFeatures()
|
void latchActiveFeatures()
|
||||||
{
|
{
|
||||||
activeFeaturesLatch = masterConfig.enabledFeatures;
|
activeFeaturesLatch = masterConfig.enabledFeatures;
|
||||||
|
|
|
@ -50,7 +50,6 @@ typedef enum {
|
||||||
FEATURE_VTX = 1 << 25,
|
FEATURE_VTX = 1 << 25,
|
||||||
} features_e;
|
} features_e;
|
||||||
|
|
||||||
void handleOneshotFeatureChangeOnRestart(void);
|
|
||||||
void latchActiveFeatures(void);
|
void latchActiveFeatures(void);
|
||||||
bool featureConfigured(uint32_t mask);
|
bool featureConfigured(uint32_t mask);
|
||||||
bool feature(uint32_t mask);
|
bool feature(uint32_t mask);
|
||||||
|
|
|
@ -2563,12 +2563,12 @@ static void cliRateProfile(char *cmdline) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cliReboot(void) {
|
static void cliReboot(void)
|
||||||
|
{
|
||||||
cliPrint("\r\nRebooting");
|
cliPrint("\r\nRebooting");
|
||||||
bufWriterFlush(cliWriter);
|
bufWriterFlush(cliWriter);
|
||||||
waitForSerialPortToFinishTransmitting(cliPort);
|
waitForSerialPortToFinishTransmitting(cliPort);
|
||||||
stopMotors();
|
stopMotors();
|
||||||
handleOneshotFeatureChangeOnRestart();
|
|
||||||
systemReset();
|
systemReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1969,7 +1969,6 @@ void mspProcess(void)
|
||||||
if (isRebootScheduled) {
|
if (isRebootScheduled) {
|
||||||
waitForSerialPortToFinishTransmitting(candidatePort->port);
|
waitForSerialPortToFinishTransmitting(candidatePort->port);
|
||||||
stopMotors();
|
stopMotors();
|
||||||
handleOneshotFeatureChangeOnRestart();
|
|
||||||
// On real flight controllers, systemReset() will do a soft reset of the device,
|
// 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
|
// 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.
|
// cleared so that the software doesn't continuously attempt to reboot itself.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue