1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/stm32: Fix CLOCK_CORECLOCK on stm32l0/l1

With the previous order of the operation there was a loss of precision
when using certain values as the divider
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2022-03-01 17:08:02 +01:00
parent a17ff53ecf
commit d64bbdffe5
No known key found for this signature in database
GPG Key ID: E8A81A5DC532BFC3

View File

@ -71,7 +71,7 @@ extern "C" {
* PLL_MUL: multiplier, allowed values: 3, 4, 6, 8, 12, 16, 24, 32, 48. Default is 4.
* CORECLOCK -> 32MHz MAX!
*/
#define CLOCK_CORECLOCK ((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_DIV) * CONFIG_CLOCK_PLL_MUL)
#define CLOCK_CORECLOCK ((CLOCK_PLL_SRC * CONFIG_CLOCK_PLL_MUL) / CONFIG_CLOCK_PLL_DIV)
#if CLOCK_CORECLOCK > MHZ(32)
#error "SYSCLK cannot exceed 32MHz"
#endif