From: arighi Date: Mon, 10 May 2010 14:36:48 +0000 (+0000) Subject: STM32: correctly evaluate the CPU clocking configuration. X-Git-Tag: 2.5.0~275 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=019ab3523bac6fbb5febde8826c63f084ab9edfa;p=bertos.git STM32: correctly evaluate the CPU clocking configuration. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3642 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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; }