Fix bug with TEST UNIT READY on spi flash storage

This commit is contained in:
Michael McMaster 2021-01-30 22:29:29 +10:00
parent b5cfe91cc5
commit 0f0a676f7c

View File

@ -135,6 +135,11 @@ static void spiFlash_init(S2S_Device* dev)
// 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.
nNOR_CS_Write(1); // Deselect