projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
64e2e66
)
altos: Reset i2c controller at boot time
author
Keith Packard
<keithp@keithp.com>
Sat, 2 Jun 2012 23:56:41 +0000
(16:56 -0700)
committer
Keith Packard
<keithp@keithp.com>
Sat, 2 Jun 2012 23:56:41 +0000
(16:56 -0700)
In case it's wedged.
Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_i2c_stm.c
patch
|
blob
|
history
diff --git
a/src/stm/ao_i2c_stm.c
b/src/stm/ao_i2c_stm.c
index d82342db14e500631850729adec5cb061e401ad8..c205706d37669390bfec37081031abfd6bd61b6f 100644
(file)
--- a/
src/stm/ao_i2c_stm.c
+++ b/
src/stm/ao_i2c_stm.c
@@
-362,8
+362,12
@@
void
ao_i2c_channel_init(uint8_t index)
{
struct stm_i2c *stm_i2c = ao_i2c_stm_info[index].stm_i2c;
+ int i;
/* Turn I2C off while configuring */
+ stm_i2c->cr1 = (1 << STM_I2C_CR1_SWRST);
+ for (i = 0; i < 100; i++)
+ asm("nop");
stm_i2c->cr1 = 0;
stm_i2c->cr2 = AO_STM_I2C_CR2;