1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00

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) { if (dumpMask & DUMP_ALL) {
cliMcuId(NULL); cliMcuId(NULL);
#if defined(USE_BOARD_INFO) && defined(USE_SIGNATURE) #if defined(USE_SIGNATURE)
cliSignature(""); cliSignature("");
#endif #endif
} }
@ -5342,7 +5342,7 @@ const clicmd_t cmdTable[] = {
CLI_COMMAND_DEF("servo", "configure servos", NULL, cliServo), CLI_COMMAND_DEF("servo", "configure servos", NULL, cliServo),
#endif #endif
CLI_COMMAND_DEF("set", "change setting", "[<name>=<value>]", cliSet), 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), CLI_COMMAND_DEF("signature", "get / set the board type signature", "[signature]", cliSignature),
#endif #endif
#ifdef USE_SERVOS #ifdef USE_SERVOS

View file

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

View file

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