Disarm when configurator sets ARMING_DISABLED_MSP arming disabled flag

Addresses an edge case where the user could turn on the safety switch (on motors tab), arm and spin the motors, and then turn off the safety switch (without disarming first).  In this scenario the motors would keep spinning even though the ARMING_DISABLED_MSP arming disabled flag would be set.

This change checks the arming state and disarms when the configurator sets the ARMING_DISABLED_MSP flag.
This commit is contained in:
Bruce Luckcuck 2018-02-13 09:51:50 -05:00
parent 5593b43af7
commit 076ad942e4
1 changed files with 3 additions and 0 deletions

View File

@ -1779,6 +1779,9 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
const uint8_t command = sbufReadU8(src);
if (command) {
setArmingDisabled(ARMING_DISABLED_MSP);
if (ARMING_FLAG(ARMED)) {
disarm();
}
} else {
unsetArmingDisabled(ARMING_DISABLED_MSP);
}