Merge pull request #7542 from mikeller/add_mcu_type_msp

Added the MCU type to MSP.
This commit is contained in:
Michael Keller 2019-02-07 23:55:21 +13:00 committed by GitHub
commit 3672bead17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View File

@ -5012,7 +5012,7 @@ static void printConfig(char *cmdline, bool doDiff)
if (dumpMask & DUMP_ALL) {
cliMcuId(NULL);
#if defined(USE_BOARD_INFO) && defined(USE_SIGNATURE)
#if defined(USE_SIGNATURE)
cliSignature("");
#endif
}
@ -5342,7 +5342,7 @@ const clicmd_t cmdTable[] = {
CLI_COMMAND_DEF("servo", "configure servos", NULL, cliServo),
#endif
CLI_COMMAND_DEF("set", "change setting", "[<name>=<value>]", cliSet),
#if defined(USE_BOARD_INFO) && defined(USE_SIGNATURE)
#if defined(USE_SIGNATURE)
CLI_COMMAND_DEF("signature", "get / set the board type signature", "[signature]", cliSignature),
#endif
#ifdef USE_SERVOS

View File

@ -515,12 +515,21 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
value = getManufacturerId();
sbufWriteU8(dst, strlen(value));
sbufWriteString(dst, value);
#else
sbufWriteU8(dst, 0);
sbufWriteU8(dst, 0);
#endif
#if defined(USE_SIGNATURE)
// Signature
sbufWriteData(dst, getSignature(), SIGNATURE_LENGTH);
#else
uint8_t emptySignature[SIGNATURE_LENGTH];
memset(emptySignature, 0, sizeof(emptySignature));
sbufWriteData(dst, &emptySignature, sizeof(emptySignature));
#endif
#endif // USE_BOARD_INFO
sbufWriteU8(dst, MCU_TYPE_ID);
break;
}

View File

@ -265,3 +265,7 @@
#ifndef USE_DSHOT_TELEMETRY
#undef USE_RPM_FILTER
#endif
#if !defined(USE_BOARD_INFO)
#undef USE_SIGNATURE
#endif