mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
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
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user