Fix SD card hotswap bug when the SCSI host is constantly polling
[SCSI2SD.git] / software / SCSI2SD / src / main.c
index 114e8fb..aa144bd 100755 (executable)
@@ -94,7 +94,7 @@ int main()
                                CyExitCriticalSection(interruptState);\r
                        }\r
                }\r
                                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
                {\r
                        // don't waste time scanning SD cards while we're doing disk IO\r
                        lastSDPoll = getTime_ms();\r