mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Fixed the problem of reads from the SPI where the first byte was sometimes lost.The SPI read function now only generates an idle symbol if there is not a byte
already in the reception buffer.
This commit is contained in:
parent
91a4322d2b
commit
f59e89cfb9
@ -84,7 +84,9 @@ sd_arch_spi_write_block(uint8_t *bytes, int amount)
|
|||||||
unsigned
|
unsigned
|
||||||
sd_arch_spi_read(void)
|
sd_arch_spi_read(void)
|
||||||
{
|
{
|
||||||
|
if((U1IFG & URXIFG1) == 0) {
|
||||||
UART_TX = SPI_IDLE;
|
UART_TX = SPI_IDLE;
|
||||||
UART_WAIT_RX();
|
UART_WAIT_RX();
|
||||||
|
}
|
||||||
return UART_RX;
|
return UART_RX;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user