From 019ab3523bac6fbb5febde8826c63f084ab9edfa Mon Sep 17 00:00:00 2001 From: arighi Date: Mon, 10 May 2010 14:36:48 +0000 Subject: [PATCH] STM32: correctly evaluate the CPU clocking configuration. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3642 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/drv/clock_stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bertos/cpu/cortex-m3/drv/clock_stm32.c b/bertos/cpu/cortex-m3/drv/clock_stm32.c index 20959595..cd8e0f42 100644 --- a/bertos/cpu/cortex-m3/drv/clock_stm32.c +++ b/bertos/cpu/cortex-m3/drv/clock_stm32.c @@ -71,7 +71,7 @@ INLINE uint16_t pll_clock(void) /* Hopefully this is evaluate at compile time... */ for (div = 2; div; div--) for (mul = 2; mul <= 16; mul++) - if (CPU_FREQ >= (PLL_VCO / div * mul)) + if (CPU_FREQ <= (PLL_VCO / div * mul)) break; return mul << 8 | div; } -- 2.25.1