wait for RX before reading, and ensure that the byte is read out by using a volatile dummy variable

This commit is contained in:
nvt-se 2009-11-06 15:40:15 +00:00
parent 731e1da844
commit 31850d2e29

View file

@ -72,11 +72,13 @@ void
sd_arch_spi_write_block(uint8_t *bytes, int amount) sd_arch_spi_write_block(uint8_t *bytes, int amount)
{ {
int i; int i;
volatile char dummy;
for(i = 0; i < amount; i++) { for(i = 0; i < amount; i++) {
UART_TX = bytes[i]; UART_TX = bytes[i];
UART_WAIT_TXDONE(); UART_WAIT_TXDONE();
UART_RX; UART_WAIT_RX();
dummy = UART_RX;
} }
} }