mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Fix missing #if for PINIO_COUNT (#14515)
Allow user to supply CFLAGS_DISABLED to Makefile. Fix missing #if..endif for PINIO_COUNT in pinio.c. Fix other strncpy build warning/errors for build with CFLAGS_DISABLED="-flto=auto".
This commit is contained in:
parent
01329e3350
commit
b6d37008f5
4 changed files with 11 additions and 1 deletions
|
@ -196,7 +196,9 @@ static const void *cmsx_FirmwareInit(displayPort_t *pDisp)
|
|||
UNUSED(pDisp);
|
||||
|
||||
strncpy(manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH + 1);
|
||||
manufacturerId[MAX_MANUFACTURER_ID_LENGTH] = 0;
|
||||
strncpy(boardName, getBoardName(), MAX_BOARD_NAME_LENGTH + 1);
|
||||
boardName[MAX_BOARD_NAME_LENGTH] = 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,9 @@ void initBoardInformation(void)
|
|||
boardInformationSet = boardConfig()->boardInformationSet;
|
||||
if (boardInformationSet) {
|
||||
strncpy(manufacturerId, boardConfig()->manufacturerId, MAX_MANUFACTURER_ID_LENGTH + 1);
|
||||
manufacturerId[MAX_MANUFACTURER_ID_LENGTH] = 0;
|
||||
strncpy(boardName, boardConfig()->boardName, MAX_BOARD_NAME_LENGTH + 1);
|
||||
boardName[MAX_BOARD_NAME_LENGTH] = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -87,6 +89,7 @@ bool setManufacturerId(const char *newManufacturerId)
|
|||
#if !defined(BOARD_NAME)
|
||||
if (!boardInformationSet || strlen(manufacturerId) == 0) {
|
||||
strncpy(manufacturerId, newManufacturerId, MAX_MANUFACTURER_ID_LENGTH + 1);
|
||||
manufacturerId[MAX_MANUFACTURER_ID_LENGTH] = 0;
|
||||
|
||||
boardInformationWasUpdated = true;
|
||||
|
||||
|
@ -105,6 +108,7 @@ bool setBoardName(const char *newBoardName)
|
|||
#if !defined(BOARD_NAME)
|
||||
if (!boardInformationSet || strlen(boardName) == 0) {
|
||||
strncpy(boardName, newBoardName, MAX_BOARD_NAME_LENGTH + 1);
|
||||
boardName[MAX_BOARD_NAME_LENGTH] = 0;
|
||||
|
||||
boardInformationWasUpdated = true;
|
||||
|
||||
|
|
|
@ -104,9 +104,11 @@ void pgResetFn_pinioConfig(pinioConfig_t *config)
|
|||
config->config[1] = PINIO2_CONFIG;
|
||||
config->config[2] = PINIO3_CONFIG;
|
||||
config->config[3] = PINIO4_CONFIG;
|
||||
#if PINIO_COUNT > 4
|
||||
config->config[4] = PINIO5_CONFIG;
|
||||
config->config[5] = PINIO6_CONFIG;
|
||||
config->config[6] = PINIO7_CONFIG;
|
||||
config->config[7] = PINIO8_CONFIG;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue