From 0f0a676f7c8048302c680e994be011d290c0fa89 Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Sat, 30 Jan 2021 22:29:29 +1000 Subject: [PATCH] Fix bug with TEST UNIT READY on spi flash storage --- software/SCSI2SD/src/flash.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/software/SCSI2SD/src/flash.c b/software/SCSI2SD/src/flash.c index dbbf0bd..fea5bf7 100644 --- a/software/SCSI2SD/src/flash.c +++ b/software/SCSI2SD/src/flash.c @@ -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. -- 2.38.5