]> localhost Git - SCSI2SD.git/commitdiff
Fix bug with TEST UNIT READY on spi flash storage
authorMichael McMaster <michael@codesrc.com>
Sat, 30 Jan 2021 12:29:29 +0000 (22:29 +1000)
committerMichael McMaster <michael@codesrc.com>
Sat, 30 Jan 2021 12:29:29 +0000 (22:29 +1000)
software/SCSI2SD/src/flash.c

index dbbf0bd68ef10ae2258bb03cadf33c7e4b4f599f..fea5bf76785c8db75680e4dc148d39747c9755f6 100644 (file)
@@ -134,6 +134,11 @@ static void spiFlash_init(S2S_Device* dev)
     //spiFlash->capacity = (1 << spiFlashByte(0xFF)) / 512;
     // Record value in 512-byte sectors.
     spiFlash->capacity = 1 << (spiFlashByte(0xFF) - 9);
+    
+    if (spiFlash->capacity > 0)
+    {
+        spiFlash->dev.mediaState |= MEDIA_PRESENT | MEDIA_INITIALISED;
+    }
 
     // Don't bother reading the rest. Deselecting will cancel the command.