From fc7288c813b0ffc5c1bdba78d69ee11bc30ff0ae Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:31:20 -0600 Subject: [PATCH] suppress (don't fix) compiler warnings for 3rd party libraries - STM32F4 and STM32F7 --- .../Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c | 3 +++ .../Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c b/lib/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c index 4aa38e731f..a1bf0317ee 100644 --- a/lib/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c +++ b/lib/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c @@ -423,6 +423,8 @@ void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct) /* Get the PLLM value */ pllm = (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wduplicated-branches" if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE) { /* Get the I2S source clock value */ @@ -433,6 +435,7 @@ void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct) i2sclk = (uint32_t)(((HSI_VALUE / pllm) * plln) / pllr); } #endif /* I2S_EXTERNAL_CLOCK_VAL */ +#pragma GCC diagnostic pop /* Compute the Real divider depending on the MCLK output state, with a floating point */ if(I2S_InitStruct->I2S_MCLKOutput == I2S_MCLKOutput_Enable) diff --git a/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c b/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c index 4d9e318453..b3d1033aee 100644 --- a/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c +++ b/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c @@ -248,6 +248,8 @@ HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart) return HAL_ERROR; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wduplicated-branches" if(huart->Init.HwFlowCtl != UART_HWCONTROL_NONE) { /* Check the parameters */ @@ -258,6 +260,7 @@ HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart) /* Check the parameters */ assert_param(IS_UART_INSTANCE(huart->Instance)); } +#pragma GCC diagnostic pop if(huart->gState == HAL_UART_STATE_RESET) {