STM32: correctly evaluate the CPU clocking configuration.
[bertos.git] / 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;
 }