software/liblitesdcard: Only use sdcard_stop_transmission when nblocks > 1 (thanks @bayi).

Similar to what is already done for reads.
This commit is contained in:
Florent Kermarrec 2023-03-24 08:39:24 +01:00
parent c3e93620ec
commit e55f0da7c7
1 changed files with 2 additions and 1 deletions

View File

@ -552,7 +552,8 @@ void sdcard_write(uint32_t block, uint32_t count, uint8_t* buf)
sdcard_write_single_block(block); sdcard_write_single_block(block);
/* Stop transmission (Only for multiple block writes) */ /* Stop transmission (Only for multiple block writes) */
sdcard_stop_transmission(); if (nblocks > 1)
sdcard_stop_transmission();
/* Wait for DMA Reader to complete */ /* Wait for DMA Reader to complete */
while ((sdmem2block_dma_done_read() & 0x1) == 0); while ((sdmem2block_dma_done_read() & 0x1) == 0);