Browse Source

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>
pull/6201/merge
Damien George 4 years ago
parent
commit
a1bc32d8a8
  1. 1
      drivers/sdcard/sdcard.py

1
drivers/sdcard/sdcard.py

@ -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")

Loading…
Cancel
Save