From 28c3923b6180e24a77aecc7162bb2852cec7d770 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 27 Aug 2012 13:37:14 -0700 Subject: [PATCH] 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 --- src/cc1111/ao_spi.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.30.2