software/liblitesdcard: Add missing SPI_DONE mask on read status.

This commit is contained in:
Florent Kermarrec 2023-02-06 13:09:45 +01:00
parent 61bbfa3eaa
commit a56a178768
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ static uint8_t spi_xfer(uint8_t byte) {
/* Initiate SPI Xfer */ /* Initiate SPI Xfer */
spisdcard_control_write(8*SPI_LENGTH | SPI_START); spisdcard_control_write(8*SPI_LENGTH | SPI_START);
/* Wait SPI Xfer to be done */ /* Wait SPI Xfer to be done */
while(spisdcard_status_read() != SPI_DONE); while((spisdcard_status_read() & SPI_DONE) != SPI_DONE);
/* Read MISO and return it */ /* Read MISO and return it */
return spisdcard_miso_read(); return spisdcard_miso_read();
} }