1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 17:55:28 +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,14 +1074,17 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
break; break;
case MSP_REBOOT: case MSP_REBOOT:
if (!ARMING_FLAG(ARMED)) {
if (mspPostProcessFn) { if (mspPostProcessFn) {
*mspPostProcessFn = mspRebootFn; *mspPostProcessFn = mspRebootFn;
} }
}
break; break;
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE #ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
case MSP_SET_4WAY_IF: case MSP_SET_4WAY_IF:
if (!ARMING_FLAG(ARMED)) {
// get channel number // get channel number
// switch all motor lines HI // switch all motor lines HI
// reply with the count of ESC found // reply with the count of ESC found
@ -1089,6 +1092,7 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
if (mspPostProcessFn) { if (mspPostProcessFn) {
*mspPostProcessFn = msp4WayIfFn; *mspPostProcessFn = msp4WayIfFn;
} }
}
break; break;
#endif #endif