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

Redo after rebase

This commit is contained in:
Mark Haslinghuis 2025-07-06 18:23:21 +02:00
parent 5796be02d9
commit b124d44336
4 changed files with 9 additions and 5 deletions

@ -1 +1 @@
Subproject commit 85c98d6a3ca7bb4803b7c978515f1ed47d6949b8 Subproject commit 103aaa73056fb502f1adb5f85280b2f75dc8f350

View file

@ -196,7 +196,9 @@ static const void *cmsx_FirmwareInit(displayPort_t *pDisp)
UNUSED(pDisp); UNUSED(pDisp);
strncpy(manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH); strncpy(manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH);
manufacturerId[MAX_MANUFACTURER_ID_LENGTH] = 0;
strncpy(boardName, getBoardName(), MAX_BOARD_NAME_LENGTH); strncpy(boardName, getBoardName(), MAX_BOARD_NAME_LENGTH);
boardName[MAX_BOARD_NAME_LENGTH] = 0;
return NULL; return NULL;
} }

View file

@ -43,7 +43,9 @@ void initBoardInformation(void)
boardInformationSet = boardConfig()->boardInformationSet; boardInformationSet = boardConfig()->boardInformationSet;
if (boardInformationSet) { if (boardInformationSet) {
strncpy(manufacturerId, boardConfig()->manufacturerId, MAX_MANUFACTURER_ID_LENGTH); strncpy(manufacturerId, boardConfig()->manufacturerId, MAX_MANUFACTURER_ID_LENGTH);
manufacturerId[MAX_MANUFACTURER_ID_LENGTH] = 0;
strncpy(boardName, boardConfig()->boardName, MAX_BOARD_NAME_LENGTH); strncpy(boardName, boardConfig()->boardName, MAX_BOARD_NAME_LENGTH);
boardName[MAX_BOARD_NAME_LENGTH] = 0;
} }
#endif #endif
@ -87,7 +89,7 @@ bool setManufacturerId(const char *newManufacturerId)
#if !defined(BOARD_NAME) #if !defined(BOARD_NAME)
if (!boardInformationSet || strlen(manufacturerId) == 0) { if (!boardInformationSet || strlen(manufacturerId) == 0) {
strncpy(manufacturerId, newManufacturerId, MAX_MANUFACTURER_ID_LENGTH); strncpy(manufacturerId, newManufacturerId, MAX_MANUFACTURER_ID_LENGTH);
manufacturerId[MAX_MANUFACTURER_ID_LENGTH] = 0;
boardInformationWasUpdated = true; boardInformationWasUpdated = true;
return true; return true;
@ -105,7 +107,7 @@ bool setBoardName(const char *newBoardName)
#if !defined(BOARD_NAME) #if !defined(BOARD_NAME)
if (!boardInformationSet || strlen(boardName) == 0) { if (!boardInformationSet || strlen(boardName) == 0) {
strncpy(boardName, newBoardName, MAX_BOARD_NAME_LENGTH); strncpy(boardName, newBoardName, MAX_BOARD_NAME_LENGTH);
boardName[MAX_BOARD_NAME_LENGTH] = 0;
boardInformationWasUpdated = true; boardInformationWasUpdated = true;
return true; return true;

View file

@ -33,8 +33,8 @@
typedef struct boardConfig_s { typedef struct boardConfig_s {
uint8_t signature[SIGNATURE_LENGTH]; uint8_t signature[SIGNATURE_LENGTH];
char manufacturerId[MAX_MANUFACTURER_ID_LENGTH]; char manufacturerId[MAX_MANUFACTURER_ID_LENGTH + 1];
char boardName[MAX_BOARD_NAME_LENGTH]; char boardName[MAX_BOARD_NAME_LENGTH + 1];
uint8_t boardInformationSet; uint8_t boardInformationSet;
uint8_t signatureSet; uint8_t signatureSet;
} boardConfig_t; } boardConfig_t;