diff options
author | Keith Packard <keithp@keithp.com> | 2012-05-28 11:47:28 -0600 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-05-28 11:47:28 -0600 |
commit | 47bc9b2a39b7a8d3ef3fe8acc7fbf0512695e548 (patch) | |
tree | 17bdfdc1c987c44a516d02fdf2a9d730e4a181c4 | |
parent | 8164cd95db62e4564b3a9ba5c06a74c870c03841 (diff) |
altos: Clear stm i2c transfer timeout alarm
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/stm/ao_i2c_stm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/stm/ao_i2c_stm.c b/src/stm/ao_i2c_stm.c index 763ae6cd..d82342db 100644 --- a/src/stm/ao_i2c_stm.c +++ b/src/stm/ao_i2c_stm.c @@ -250,10 +250,9 @@ ao_i2c_send(void *block, uint16_t len, uint8_t index, uint8_t stop) ao_alarm(1 + len); cli(); while (!ao_dma_done[tx_dma_index]) - if (ao_sleep(&ao_dma_done[tx_dma_index])) { - printf ("send timeout\n"); + if (ao_sleep(&ao_dma_done[tx_dma_index])) break; - } + ao_clear_alarm(); ao_dma_done_transfer(tx_dma_index); out_cr2("send enable isr", stm_i2c, AO_STM_I2C_CR2 | (1 << STM_I2C_CR2_ITEVTEN) | (1 << STM_I2C_CR2_ITERREN)); |