Skip to content

Commit

Permalink
Fix SD card IO timeout wrapping
Browse files Browse the repository at this point in the history
Fix for issue: ZuluSCSI/ZuluSCSI-firmware#328

This should fix the issue, though it hasn't been tested.

Thank you @carlk3 for doing some code review.
  • Loading branch information
morio authored and erichelgeson committed Dec 13, 2023
1 parent 11bd685 commit bc7ee25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ bool SdioCard::stopTransmission(bool blocking)
}
else
{
uint32_t end = millis() + 5000;
while (millis() < end && isBusy())
uint32_t start = millis();
while ((uint32_t)(millis() - start) < 5000 && isBusy())
{
if (m_stream_callback)
{
Expand Down

0 comments on commit bc7ee25

Please sign in to comment.