mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Fixes from review.
This commit is contained in:
parent
b4c44d8a46
commit
432f330e60
3 changed files with 19 additions and 19 deletions
|
@ -2323,11 +2323,7 @@ static void cliMcuId(char *cmdline)
|
|||
{
|
||||
UNUSED(cmdline);
|
||||
|
||||
cliPrint("mcu_id 0x");
|
||||
cliPrintf("%08x", U_ID_0);
|
||||
cliPrintf("%08x", U_ID_1);
|
||||
cliPrintf("%08x", U_ID_2);
|
||||
cliPrintLinefeed();
|
||||
cliPrintLinef("mcu_id %08x%08x%08x", U_ID_0, U_ID_1, U_ID_2);
|
||||
}
|
||||
|
||||
static void printFeature(uint8_t dumpMask, const featureConfig_t *featureConfig, const featureConfig_t *featureConfigDefault)
|
||||
|
|
|
@ -464,12 +464,12 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
|
|||
// Board name with explicit length
|
||||
char *value = getBoardName();
|
||||
sbufWriteU8(dst, strlen(value));
|
||||
sbufWriteData(dst, value, strlen(value));
|
||||
sbufWriteString(dst, value);
|
||||
|
||||
// Manufacturer id with explicit length
|
||||
value = getManufacturerId();
|
||||
sbufWriteU8(dst, strlen(value));
|
||||
sbufWriteData(dst, value, strlen(value));
|
||||
sbufWriteString(dst, value);
|
||||
|
||||
#if defined(USE_SIGNATURE)
|
||||
// Signature
|
||||
|
@ -2078,16 +2078,20 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
|
|||
#if defined(USE_BOARD_INFO)
|
||||
case MSP_SET_BOARD_INFO:
|
||||
if (!boardInformationIsSet()) {
|
||||
char boardName[MAX_BOARD_NAME_LENGTH + 1] = {0};
|
||||
char manufacturerId[MAX_MANUFACTURER_ID_LENGTH + 1] = {0};
|
||||
uint8_t length = sbufReadU8(src);
|
||||
for (unsigned int i = 0; i < length; i++) {
|
||||
boardName[i] = sbufReadU8(src);
|
||||
char boardName[MAX_BOARD_NAME_LENGTH + 1];
|
||||
sbufReadData(src, boardName, MIN(length, MAX_BOARD_NAME_LENGTH));
|
||||
if (length > MAX_BOARD_NAME_LENGTH) {
|
||||
sbufAdvance(src, length - MAX_BOARD_NAME_LENGTH);
|
||||
}
|
||||
boardName[length] = '\0';
|
||||
length = sbufReadU8(src);
|
||||
for (unsigned int i = 0; i < length; i++) {
|
||||
manufacturerId[i] = sbufReadU8(src);
|
||||
char manufacturerId[MAX_MANUFACTURER_ID_LENGTH + 1];
|
||||
sbufReadData(src, manufacturerId, MIN(length, MAX_MANUFACTURER_ID_LENGTH));
|
||||
if (length > MAX_MANUFACTURER_ID_LENGTH) {
|
||||
sbufAdvance(src, length - MAX_MANUFACTURER_ID_LENGTH);
|
||||
}
|
||||
manufacturerId[length] = '\0';
|
||||
|
||||
setBoardName(boardName);
|
||||
setManufacturerId(manufacturerId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue