STM32CubeH7
STM32CubeH7 copied to clipboard
implicit declaration LL_RCC_CalcPLLClockFreq
Describe the set-up
- Compile framework with PlatformIO and compiler flag
-Wimplicit-function-declaration(does not defineUSE_FULL_LL_DRIVER).
Describe the bug
stm32h7xx_ll_utils.c uses LL_RCC_CalcPLLClockFreq() in several places. stm32h7xx_ll_rcc.h is included, which declares the function. However, the declaration of this function is gates by the definition of USE_FULL_LL_DRIVER. Failing to define USE_FULL_LL_DRIVER results in a compiler warning "implicit declaration of function 'LL_RCC_CalcPLLClockFreq'". This may result in linker issues.
How To Reproduce
Compile stm32h7xx_ll_utils.c with the compiler flag -Wimplicit-function-declaration and without defining USE_FULL_LL_DRIVER.
Additional context
I propose to move the declaration of LL_RCC_CalcPLLClockFreq() outside of the USE_FULL_LL_DRIVER block in stm32h7xx_ll_rcc.h.
The warning was given for this line: https://github.com/STMicroelectronics/STM32CubeH7/blob/b340b13929e36a3427b8d94e8b1006022f82273f/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c#L929