From a82071a3e37715c43671db54dd2f5b07d04b7681 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 29 Sep 2017 13:01:16 +0000 Subject: [PATCH] Solved reading multiple MMC/SD commands at a time. --- DiscImageChef.Core/Devices/Dumping/SecureDigital.cs | 2 +- DiscImageChef.Core/Devices/Scanning/SecureDigital.cs | 2 +- DiscImageChef.Devices/Device/MmcCommands/MMC.cs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index b0152bc29..d03852886 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -84,7 +84,7 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.BlockMedia[0].SecureDigital = new SecureDigitalType(); - uint blocksToRead = 1; + uint blocksToRead = 128; uint blockSize = 512; ulong blocks = 0; byte[] cid = null; diff --git a/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs b/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs index 5a68ed0f3..d2fa42035 100644 --- a/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs @@ -59,7 +59,7 @@ namespace DiscImageChef.Core.Devices.Scanning uint timeout = 5; double duration = 0; ushort currentProfile = 0x0001; - uint blocksToRead = 1; + uint blocksToRead = 128; uint blockSize = 512; bool byteAddressed = true; diff --git a/DiscImageChef.Devices/Device/MmcCommands/MMC.cs b/DiscImageChef.Devices/Device/MmcCommands/MMC.cs index 9f02a8a9f..7d64e20a6 100644 --- a/DiscImageChef.Devices/Device/MmcCommands/MMC.cs +++ b/DiscImageChef.Devices/Device/MmcCommands/MMC.cs @@ -127,7 +127,13 @@ namespace DiscImageChef.Devices error = lastError != 0; if(transferLength > 1) + { + byte[] foo = new byte[0]; + SendMmcCommand(MmcCommands.StopTransmission, false, false, MmcFlags.Response_R1b | MmcFlags.ResponseSPI_R1b | MmcFlags.CommandAC, + 0, 0, 0, ref foo, out uint[] responseStop, out double stopDuration, out bool stopSense, timeout); + duration += stopDuration; DicConsole.DebugWriteLine("MMC Device", "READ_MULTIPLE_BLOCK took {0} ms.", duration); + } else DicConsole.DebugWriteLine("MMC Device", "READ_SINGLE_BLOCK took {0} ms.", duration);