Merge pull request #4320 from mikeller/add_disable_arming_msp_command

Added MSP command to disable arming.
This commit is contained in:
Michael Keller 2017-10-12 12:20:59 +13:00 committed by GitHub
commit ed29295d7a
4 changed files with 17 additions and 3 deletions

View File

@ -1705,6 +1705,17 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
break;
#endif
case MSP_ARMING_DISABLE:
{
const uint8_t command = sbufReadU8(src);
if (command) {
setArmingDisabled(ARMING_DISABLED_MSP);
} else {
unsetArmingDisabled(ARMING_DISABLED_MSP);
}
}
break;
#ifdef USE_FLASHFS
case MSP_DATAFLASH_ERASE:
flashfsEraseCompletely();

View File

@ -33,7 +33,7 @@ static uint32_t enabledSensors = 0;
const char *armingDisableFlagNames[]= {
"NOGYRO", "FAILSAFE", "RXLOSS", "BADRX", "BOXFAILSAFE",
"THROTTLE", "ANGLE", "BOOTGRACE", "NOPREARM", "ARMSWITCH",
"LOAD", "CALIB", "CLI", "CMS", "OSD", "BST"
"LOAD", "CALIB", "CLI", "CMS", "OSD", "BST", "MSP"
};
#endif

View File

@ -50,10 +50,11 @@ typedef enum {
ARMING_DISABLED_CLI = (1 << 12),
ARMING_DISABLED_CMS_MENU = (1 << 13),
ARMING_DISABLED_OSD_MENU = (1 << 14),
ARMING_DISABLED_BST = (1 << 15)
ARMING_DISABLED_BST = (1 << 15),
ARMING_DISABLED_MSP = (1 << 16)
} armingDisableFlags_e;
#define NUM_ARMING_DISABLE_FLAGS 16
#define NUM_ARMING_DISABLE_FLAGS 17
#if defined(OSD) || !defined(MINIMAL_CLI)
extern const char *armingDisableFlagNames[NUM_ARMING_DISABLE_FLAGS];

View File

@ -214,6 +214,8 @@
#define MSP_CAMERA_CONTROL 98
#define MSP_ARMING_DISABLE 99
//
// OSD specific
//