X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Ftwi_at91.c;h=49fd74ae8c41bb496ec9115277cc1400b6f6aade;hb=472dc53614981252f30b7cc4da9199a7a21678ee;hp=a3b2bf73096575eaaae756744aee2303498ba345;hpb=4b7d21af2dd8cc7b1e93e62b3fcde0601377798a;p=bertos.git diff --git a/bertos/cpu/arm/drv/twi_at91.c b/bertos/cpu/arm/drv/twi_at91.c index a3b2bf73..49fd74ae 100644 --- a/bertos/cpu/arm/drv/twi_at91.c +++ b/bertos/cpu/arm/drv/twi_at91.c @@ -181,7 +181,7 @@ bool twi_read(uint8_t id, twi_iaddr_t byte1, twi_iaddr_t byte2, twi_iaddr_t byte /* * Start reception. * Kludge: if we want to receive only 1 byte, the stop but *must* be set here - * (thanks to crappy twi implementation again). + * (thanks to crappy twi implementation again). */ if (size == 1) { @@ -250,10 +250,10 @@ void twi_init(void) /* * Compute twi clock. * CLDIV = ((Tlow * 2^CKDIV) -3) * Tmck - * CHDIV = ((THigh * 2^CKDIV) -3) * Tmck - * Only CLDIV is computed since CLDIV = CHDIV (50% duty cycle) + * CHDIV = ((THigh * 2^CKDIV) -3) * Tmck + * Only CLDIV is computed since CLDIV = CHDIV (50% duty cycle) */ - uint16_t cldiv, ckdiv = 0; + uint16_t cldiv, ckdiv = 0; while ((cldiv = ((CLOCK_FREQ / (2 * CONFIG_TWI_FREQ)) - 3) / (1 << ckdiv)) > 255) ckdiv++; @@ -265,3 +265,4 @@ void twi_init(void) MOD_INIT(twi); } +