STM32: correctly evaluate the CPU clocking configuration.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 10 May 2010 14:36:48 +0000 (14:36 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 10 May 2010 14:36:48 +0000 (14:36 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3642 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/clock_stm32.c

index 20959595a05fe803dbd144b3beff50e2c2cb5f17..cd8e0f4286d708a0c377b6a5696b23e62fe589a7 100644 (file)
@@ -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;
 }