diff options
| author | Damien George <damien@micropython.org> | 2021-04-23 23:44:37 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-04-23 23:44:37 +1000 |
| commit | a1bc32d8a8fbb09bc04c2ca07b10475f7ddde8c3 (patch) | |
| tree | edc7268bc6c7f57480437333c340176c2017e499 /drivers/sdcard/sdcard.py | |
| parent | bb2007b05ccf0e41684cc61f1677c11b7df93f7a (diff) | |
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>
Diffstat (limited to 'drivers/sdcard/sdcard.py')
| -rw-r--r-- | drivers/sdcard/sdcard.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/sdcard/sdcard.py b/drivers/sdcard/sdcard.py index c991fe560..0ba3076a3 100644 --- a/drivers/sdcard/sdcard.py +++ b/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") |
