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:
parent
a17ff53ecf
commit
d64bbdffe5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user