Fix SD card hotswap bug when the SCSI host is constantly polling
authorMichael McMaster <michael@codesrc.com>
Mon, 27 May 2019 10:02:08 +0000 (20:02 +1000)
committerMichael McMaster <michael@codesrc.com>
Mon, 27 May 2019 10:02:08 +0000 (20:02 +1000)
software/SCSI2SD/src/main.c

index 114e8fb..aa144bd 100755 (executable)
@@ -94,7 +94,7 @@ int main()
                                CyExitCriticalSection(interruptState);\r
                        }\r
                }\r
-               else if (scsiDev.phase >= 0)\r
+               else if ((scsiDev.phase >= 0) && (blockDev.state & DISK_PRESENT))\r
                {\r
                        // don't waste time scanning SD cards while we're doing disk IO\r
                        lastSDPoll = getTime_ms();\r