Added MSP command to disable arming.

This commit is contained in:
mikeller 2017-10-11 01:43:29 +13:00
parent a4040caebd
commit 5692fc6688
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; break;
#endif #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 #ifdef USE_FLASHFS
case MSP_DATAFLASH_ERASE: case MSP_DATAFLASH_ERASE:
flashfsEraseCompletely(); flashfsEraseCompletely();

View File

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

View File

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

View File

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