Rename CLOCK_FREQ macro to CPU_FREQ: now clock frequency has to be set in the makefile.
[bertos.git] / bertos / cpu / arm / drv / twi_at91.c
index 44957c45d7c11e7c2b4f9677e661b4684de84fbb..cb2097eabf6328a1958c60c8046d86aa4187703f 100644 (file)
@@ -254,7 +254,7 @@ void twi_init(void)
         * Only CLDIV is computed since CLDIV = CHDIV (50% duty cycle)
         */
        uint16_t cldiv, ckdiv = 0;
-       while ((cldiv = ((CLOCK_FREQ / (2 * CONFIG_I2C_FREQ)) - 3) / (1 << ckdiv)) > 255)
+       while ((cldiv = ((CPU_FREQ / (2 * CONFIG_I2C_FREQ)) - 3) / (1 << ckdiv)) > 255)
                ckdiv++;
 
        /* Atmel errata states that ckdiv *must* be less than 5 for unknown reason */