summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-08-27 13:37:14 -0700
committerKeith Packard <keithp@keithp.com>2012-08-27 13:37:14 -0700
commit28c3923b6180e24a77aecc7162bb2852cec7d770 (patch)
tree768c344846878881fc65dfeea45cd4e610e24656
parenta27b9b5c36cf748e415ba210c8d8ae72d8227a98 (diff)
altos: More SPI slave changes for cc1111 driver
Don't enable DMA in the other direction when doing slave transfers. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/cc1111/ao_spi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cc1111/ao_spi.c b/src/cc1111/ao_spi.c
index e7480fd7..2b4fd186 100644
--- a/src/cc1111/ao_spi.c
+++ b/src/cc1111/ao_spi.c
@@ -204,6 +204,7 @@ ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant
ao_spi_const = SPI_CONST;
+#if !AO_SPI_SLAVE
ao_dma_set_transfer(ao_spi_dma_out_id,
&ao_spi_const,
&SPI_BUF,
@@ -214,10 +215,13 @@ ao_spi_recv_bus(void __xdata *block, uint16_t len) __reentrant
DMA_CFG1_SRCINC_0 |
DMA_CFG1_DESTINC_0 |
DMA_CFG1_PRIORITY_NORMAL);
+#endif
ao_dma_start(ao_spi_dma_in_id);
+#if !AO_SPI_SLAVE
ao_dma_start(ao_spi_dma_out_id);
ao_dma_trigger(ao_spi_dma_out_id);
+#endif
__critical while (!ao_spi_dma_in_done)
ao_sleep(&ao_spi_dma_in_done);
}