X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Favr%2Fdrv%2Fi2c_avr.c;h=7425240305cebea0ea6ca383111c88305934b758;hb=fe0a14d1434098bfd0780d06a2a7e55f27940d27;hp=2681bb75cdab39144fa33f1e8bdd00e80eab12cd;hpb=03c14d1d807783de7b8560727843802c00b19d0f;p=bertos.git diff --git a/bertos/cpu/avr/drv/i2c_avr.c b/bertos/cpu/avr/drv/i2c_avr.c index 2681bb75..74252403 100644 --- a/bertos/cpu/avr/drv/i2c_avr.c +++ b/bertos/cpu/avr/drv/i2c_avr.c @@ -38,7 +38,7 @@ * \author Bernie Innocenti */ -#include "hw/hw_cpu.h" /* CLOCK_FREQ */ +#include /* CPU_FREQ */ #include "cfg/cfg_i2c.h" @@ -237,7 +237,7 @@ void i2c_builtin_init(void) /* * Set speed: - * F = CLOCK_FREQ / (16 + 2*TWBR * 4^TWPS) + * F = CPU_FREQ / (16 + 2*TWBR * 4^TWPS) */ #ifndef CONFIG_I2C_FREQ #warning Using default value of 300000L for CONFIG_I2C_FREQ @@ -245,7 +245,7 @@ void i2c_builtin_init(void) #endif #define TWI_PRESC 1 /* 4 ^ TWPS */ - TWBR = (CLOCK_FREQ / (2 * CONFIG_I2C_FREQ * TWI_PRESC)) - (8 / TWI_PRESC); + TWBR = (CPU_FREQ / (2 * CONFIG_I2C_FREQ * TWI_PRESC)) - (8 / TWI_PRESC); TWSR = 0; TWCR = BV(TWEN); );