From 31850d2e2997f5823eb712be74bd6860812f9710 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Fri, 6 Nov 2009 15:40:15 +0000 Subject: [PATCH] wait for RX before reading, and ensure that the byte is read out by using a volatile dummy variable --- platform/msb430/dev/sd-arch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/msb430/dev/sd-arch.c b/platform/msb430/dev/sd-arch.c index 1d48c61e0..02f5666f0 100755 --- a/platform/msb430/dev/sd-arch.c +++ b/platform/msb430/dev/sd-arch.c @@ -72,11 +72,13 @@ void sd_arch_spi_write_block(uint8_t *bytes, int amount) { int i; + volatile char dummy; for(i = 0; i < amount; i++) { UART_TX = bytes[i]; UART_WAIT_TXDONE(); - UART_RX; + UART_WAIT_RX(); + dummy = UART_RX; } }