From 4d187460bdcb97bf6d0a3550e4e03c4c223e4cc1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 26 Mar 2013 14:26:38 -0700 Subject: [PATCH] altos/stm: Ensure SPI always sends 0xff during receive SD cards require 0xff when fetching data Signed-off-by: Keith Packard --- src/stm/ao_spi_stm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stm/ao_spi_stm.c b/src/stm/ao_spi_stm.c index 7b4af964..56329c24 100644 --- a/src/stm/ao_spi_stm.c +++ b/src/stm/ao_spi_stm.c @@ -160,6 +160,8 @@ ao_spi_recv(void *block, uint16_t len, uint8_t spi_index) uint8_t mosi_dma_index = ao_spi_stm_info[AO_SPI_INDEX(spi_index)].mosi_dma_index; uint8_t miso_dma_index = ao_spi_stm_info[AO_SPI_INDEX(spi_index)].miso_dma_index; + spi_dev_null = 0xff; + /* Set up transmit DMA to make the SPI hardware actually run */ ao_dma_set_transfer(mosi_dma_index, &stm_spi->dr, -- 2.30.2