X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Ftwi_at91.c;h=cb2097eabf6328a1958c60c8046d86aa4187703f;hb=ad53b3429de000659e3daa00f3e9be56413e9944;hp=49fd74ae8c41bb496ec9115277cc1400b6f6aade;hpb=d2f1e8ab86f41a6a4165cd5f61a5eece1d8e8de6;p=bertos.git diff --git a/bertos/cpu/arm/drv/twi_at91.c b/bertos/cpu/arm/drv/twi_at91.c index 49fd74ae..cb2097ea 100644 --- a/bertos/cpu/arm/drv/twi_at91.c +++ b/bertos/cpu/arm/drv/twi_at91.c @@ -39,7 +39,7 @@ #include "twi_at91.h" -#include "cfg/cfg_twi.h" +#include "cfg/cfg_i2c.h" #include #include #include @@ -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_TWI_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 */