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:
parent
ed7f767a16
commit
37022dcd23
1 changed files with 12 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue