summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-09-03 01:20:20 -0500
committerKeith Packard <keithp@keithp.com>2016-09-03 01:23:51 -0500
commitd80995c4535a3655ca1b9ca674d6839cfef84c4e (patch)
tree19e76f0f907bcb1a9c14cfc9ec61c9d3bd964c79
parentaf2eefbed43e56885a7321319d69b7be17354cdd (diff)
altos/stm: Set i2c recv DMA to HIGH
Make sure receive DMA is higher than any TX dma so that it always runs in preference. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/stm/ao_i2c_stm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stm/ao_i2c_stm.c b/src/stm/ao_i2c_stm.c
index ae111ecb..29a8f173 100644
--- a/src/stm/ao_i2c_stm.c
+++ b/src/stm/ao_i2c_stm.c
@@ -138,7 +138,7 @@ ao_i2c_ev_isr(uint8_t index)
ao_wakeup(&ao_i2c_state[index]);
}
if (sr1 & (1 << STM_I2C_SR1_RXNE)) {
- if (ao_i2c_recv_len[index]) {
+ if (ao_i2c_recv_len[index]) {
*(ao_i2c_recv_data[index]++) = stm_i2c->dr;
if (!--ao_i2c_recv_len[index])
ao_wakeup(&ao_i2c_recv_len[index]);
@@ -255,7 +255,7 @@ ao_i2c_send(void *block, uint16_t len, uint8_t index, uint8_t stop)
(0 << STM_DMA_CCR_PINC) |
(0 << STM_DMA_CCR_CIRC) |
(STM_DMA_CCR_DIR_MEM_TO_PER << STM_DMA_CCR_DIR));
-
+
ao_dma_start(tx_dma_index);
ao_arch_block_interrupts();
while (!ao_dma_done[tx_dma_index])
@@ -331,7 +331,7 @@ ao_i2c_recv(void *block, uint16_t len, uint8_t index, uint8_t stop)
block,
len,
(0 << STM_DMA_CCR_MEM2MEM) |
- (STM_DMA_CCR_PL_MEDIUM << STM_DMA_CCR_PL) |
+ (STM_DMA_CCR_PL_HIGH << STM_DMA_CCR_PL) |
(STM_DMA_CCR_MSIZE_8 << STM_DMA_CCR_MSIZE) |
(STM_DMA_CCR_PSIZE_8 << STM_DMA_CCR_PSIZE) |
(1 << STM_DMA_CCR_MINC) |