From f34731c1a92a146bbc5e4c79178eedc780b354d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Mon, 4 Nov 2013 16:12:35 +0100 Subject: [PATCH] cc2538: spi: Do not call SPI_WAITFOREORx() at end of init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the SSI has never been used and spi_init() is called, then the SSI receive FIFO is empty and remains so, so calling SPI_WAITFOREORx() at the end of spi_init() waits endlessly for SSI_SR.RNE to be set. Hence, this call must be removed in order to avoid a deadlock. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/dev/spi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/cpu/cc2538/dev/spi.c b/cpu/cc2538/dev/spi.c index f60792da7..2a8d48d92 100644 --- a/cpu/cc2538/dev/spi.c +++ b/cpu/cc2538/dev/spi.c @@ -91,8 +91,5 @@ spi_init(void) /* Enable the SSI */ REG(SSI0_BASE + SSI_CR1) |= SSI_CR1_SSE; - - /* Clear the RX FIFO */ - SPI_WAITFOREORx(); } /** @} */