mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Fix compiler errors if you remove -flto=auto from standard build flags (#14381)
This commit is contained in:
parent
0136c5a54c
commit
a98645b44a
3 changed files with 6 additions and 4 deletions
|
@ -306,7 +306,7 @@ FAST_CODE_NOINLINE void updateDshotTelemetry(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned motorCount = dshotMotorCount;
|
const unsigned motorCount = MIN(MAX_SUPPORTED_MOTORS, dshotMotorCount);
|
||||||
uint32_t erpmTotal = 0;
|
uint32_t erpmTotal = 0;
|
||||||
uint32_t rpmSamples = 0;
|
uint32_t rpmSamples = 0;
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,10 @@ PG_REGISTER_WITH_RESET_FN(boardConfig_t, boardConfig, PG_BOARD_CONFIG, 0);
|
||||||
void pgResetFn_boardConfig(boardConfig_t *boardConfig)
|
void pgResetFn_boardConfig(boardConfig_t *boardConfig)
|
||||||
{
|
{
|
||||||
if (boardInformationIsSet()) {
|
if (boardInformationIsSet()) {
|
||||||
strncpy(boardConfig->manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH + 1);
|
strncpy(boardConfig->manufacturerId, getManufacturerId(), sizeof(boardConfig->manufacturerId) - 1);
|
||||||
strncpy(boardConfig->boardName, getBoardName(), MAX_BOARD_NAME_LENGTH + 1);
|
boardConfig->manufacturerId[sizeof(boardConfig->manufacturerId) - 1] = 0; // ensure zero-termination of string
|
||||||
|
strncpy(boardConfig->boardName, getBoardName(), sizeof(boardConfig->boardName) - 1);
|
||||||
|
boardConfig->boardName[sizeof(boardConfig->boardName) - 1] = 0; // ensure zero-termination of string
|
||||||
boardConfig->boardInformationSet = true;
|
boardConfig->boardInformationSet = true;
|
||||||
} else {
|
} else {
|
||||||
boardConfig->boardInformationSet = false;
|
boardConfig->boardInformationSet = false;
|
||||||
|
|
|
@ -1359,7 +1359,7 @@ SD_Error_t SD_GetCardStatus(SD_CardStatus_t* pCardStatus)
|
||||||
static SD_Error_t SD_PowerON(void)
|
static SD_Error_t SD_PowerON(void)
|
||||||
{
|
{
|
||||||
SD_Error_t ErrorState;
|
SD_Error_t ErrorState;
|
||||||
uint32_t Response;
|
uint32_t Response = 0; // Avoid (invalid) maybe-unitialized compiler error.
|
||||||
uint32_t Count;
|
uint32_t Count;
|
||||||
uint32_t ValidVoltage;
|
uint32_t ValidVoltage;
|
||||||
uint32_t SD_Type;
|
uint32_t SD_Type;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue