projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix timer test
[bertos.git]
/
bertos
/
cpu
/
arm
/
drv
/
twi_at91.c
diff --git
a/bertos/cpu/arm/drv/twi_at91.c
b/bertos/cpu/arm/drv/twi_at91.c
index b0b84be5cb4bb7b4cb5f02ed3bced106e636d02c..49fd74ae8c41bb496ec9115277cc1400b6f6aade 100644
(file)
--- a/
bertos/cpu/arm/drv/twi_at91.c
+++ b/
bertos/cpu/arm/drv/twi_at91.c
@@
-39,6
+39,7
@@
#include "twi_at91.h"
#include "twi_at91.h"
+#include "cfg/cfg_twi.h"
#include <cfg/compiler.h>
#include <cfg/debug.h>
#include <cfg/macros.h>
#include <cfg/compiler.h>
#include <cfg/debug.h>
#include <cfg/macros.h>
@@
-180,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
/*
* 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)
{
*/
if (size == 1)
{
@@
-249,10
+250,10
@@
void twi_init(void)
/*
* Compute twi clock.
* CLDIV = ((Tlow * 2^CKDIV) -3) * Tmck
/*
* 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++;
while ((cldiv = ((CLOCK_FREQ / (2 * CONFIG_TWI_FREQ)) - 3) / (1 << ckdiv)) > 255)
ckdiv++;
@@
-264,3
+265,4
@@
void twi_init(void)
MOD_INIT(twi);
}
MOD_INIT(twi);
}
+