1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +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; break;
case MSP_REBOOT: case MSP_REBOOT:
if (mspPostProcessFn) { if (!ARMING_FLAG(ARMED)) {
*mspPostProcessFn = mspRebootFn; if (mspPostProcessFn) {
*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:
// get channel number if (!ARMING_FLAG(ARMED)) {
// switch all motor lines HI // get channel number
// reply with the count of ESC found // switch all motor lines HI
sbufWriteU8(dst, esc4wayInit()); // reply with the count of ESC found
if (mspPostProcessFn) { sbufWriteU8(dst, esc4wayInit());
*mspPostProcessFn = msp4WayIfFn; if (mspPostProcessFn) {
*mspPostProcessFn = msp4WayIfFn;
}
} }
break; break;
#endif #endif