Selaa lähdekoodia

Fix SD card IO timeout wrapping

Fix for issue: https://github.com/ZuluSCSI/ZuluSCSI-firmware/issues/328

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

Thank you @carlk3 for doing some code review.
Morio 2 vuotta sitten
vanhempi
sitoutus
bc7ee25984
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

+ 2 - 2
lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

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