Fix issue that caused 0 bytes per sector mutlidev
authorMichael McMaster <michael@codesrc.com>
Sat, 19 Dec 2020 13:24:25 +0000 (23:24 +1000)
committerMichael McMaster <michael@codesrc.com>
Sat, 19 Dec 2020 13:24:25 +0000 (23:24 +1000)
src/firmware/scsi.c
src/firmware/sd.c

index db7224df7ef7f2e18d90b3b857b74b8454db0f70..bf0108a9bce5879817fada759101fecf0031af0e 100755 (executable)
@@ -1152,6 +1152,8 @@ void scsiInit()
 \r
                        state->syncOffset = 0;\r
                        state->syncPeriod = 0;\r
+\r
+                       state->bytesPerSector = targets[i].cfg->bytesPerSector;\r
                }\r
        }\r
        firstInit = 0;\r
index e694b8932de338094f756094188105cca9d58067..5ab4c1c0d47336c6b080d14b57e37f9a42dd70cf 100755 (executable)
@@ -298,7 +298,7 @@ static void sd_earlyInit(S2S_Device* dev)
        for (int i = 0; i < S2S_MAX_TARGETS; ++i)\r
        {\r
                sdCardDevice->targets[i].device = dev;\r
-               sdCardDevice->targets[i].cfg = (const S2S_TargetCfg*)\r
+               sdCardDevice->targets[i].cfg = (S2S_TargetCfg*)\r
                        (&(sdCardDevice->cfg[0]) + sizeof(S2S_BoardCfg) + (i * sizeof(S2S_TargetCfg)));\r
        }\r
        sdCardDevice->lastPollMediaTime = s2s_getTime_ms();\r