Skip to content

Commit 52163b0

Browse files
Fix for occasional write hangs
I believe the write hangs were happening because the SD card wasn't ready for the end block write command. This adds a _wait_for_ready call before the command is sent.
1 parent 54827b8 commit 52163b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

adafruit_sdcard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ def writeblocks(self, start_block: int, buf: ReadableBuffer) -> int:
500500
)
501501
offset += 512
502502
nblocks -= 1
503+
self._wait_for_ready(card)
503504
self._cmd_nodata(card, _TOKEN_STOP_TRAN, 0x0)
504505
return 0
505506

0 commit comments

Comments
 (0)