fixed SPI_FLUSH. current implementation waits for rx buffer to fill first. Thus, if we call SPI_FLUSH to make sure the rx fifo is empty when the rx fifo is already empty, we enter an infinite loop

This commit is contained in:
William Huang 2014-07-21 23:25:12 -04:00
parent d7cf3b1f74
commit 1e39c9a454

View file

@ -63,7 +63,6 @@
#error "You must include spi-arch.h before spi.h for the CC2538." #error "You must include spi-arch.h before spi.h for the CC2538."
#endif #endif
#define SPI_FLUSH() do { \ #define SPI_FLUSH() do { \
SPI_WAITFOREORx(); \
while (REG(SSI0_BASE + SSI_SR) & SSI_SR_RNE) { \ while (REG(SSI0_BASE + SSI_SR) & SSI_SR_RNE) { \
SPI_RXBUF; \ SPI_RXBUF; \
} \ } \