wait for RX before reading, and ensure that the byte is read out by using a volatile dummy variable
This commit is contained in:
parent
731e1da844
commit
31850d2e29
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue