1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 17:25:18 +03:00

Don't allow MSP_REBOOT and MSP_SET_4WAY_IF to execute when ARMed

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2016-12-11 20:40:46 +10:00
parent ed7f767a16
commit 37022dcd23

View file

@ -1074,20 +1074,24 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
break;
case MSP_REBOOT:
if (mspPostProcessFn) {
*mspPostProcessFn = mspRebootFn;
if (!ARMING_FLAG(ARMED)) {
if (mspPostProcessFn) {
*mspPostProcessFn = mspRebootFn;
}
}
break;
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
case MSP_SET_4WAY_IF:
// get channel number
// switch all motor lines HI
// reply with the count of ESC found
sbufWriteU8(dst, esc4wayInit());
if (mspPostProcessFn) {
*mspPostProcessFn = msp4WayIfFn;
if (!ARMING_FLAG(ARMED)) {
// get channel number
// switch all motor lines HI
// reply with the count of ESC found
sbufWriteU8(dst, esc4wayInit());
if (mspPostProcessFn) {
*mspPostProcessFn = msp4WayIfFn;
}
}
break;
#endif