drivers/sdcard: Add sleep_ms(1) delay in SDCard.readinto sync loop.

So this driver works on faster MCUs (that run this loop fast) with older,
slower SD cards.

Fixes issue #7129.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2021-04-23 23:44:37 +10:00
parent bb2007b05c
commit a1bc32d8a8

View File

@ -176,6 +176,7 @@ class SDCard:
self.spi.readinto(self.tokenbuf, 0xFF)
if self.tokenbuf[0] == _TOKEN_DATA:
break
time.sleep_ms(1)
else:
self.cs(1)
raise OSError("timeout waiting for response")