diff options
author | Cluster <clusterrr@clusterrr.com> | 2020-09-05 16:00:42 +0300 |
---|---|---|
committer | Cluster <clusterrr@clusterrr.com> | 2020-09-05 16:00:42 +0300 |
commit | 462e3648f53ed67bb5c135dc9d210f77c2b18333 (patch) | |
tree | 5e994e38f25c7f0aa4d773e22946f16ba8d1c565 /FamicomDumperConnection | |
parent | 395a7bbd4a28656fdd5412f92bbd8f5a8aaba78f (diff) |
Error checks.
Diffstat (limited to 'FamicomDumperConnection')
-rw-r--r-- | FamicomDumperConnection/FamicomDumperConnection.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/FamicomDumperConnection/FamicomDumperConnection.cs b/FamicomDumperConnection/FamicomDumperConnection.cs index 44be053..8f3a2f2 100644 --- a/FamicomDumperConnection/FamicomDumperConnection.cs +++ b/FamicomDumperConnection/FamicomDumperConnection.cs @@ -42,7 +42,7 @@ namespace com.clusterrr.Famicom.DumperConnection private FTDI d2xxPort = null;
private ushort maxReadPacketSize = DefaultmaxReadPacketSize;
private ushort maxWritePacketSize = DefaultmaxWritePacketSize;
- private uint timeout;
+ private uint timeout = 5000;
enum DumperCommand
{
@@ -101,7 +101,6 @@ namespace com.clusterrr.Famicom.DumperConnection public FamicomDumperConnection(string portName = null)
{
this.PortName = portName;
- Timeout = 5000;
}
/// <summary>
@@ -446,7 +445,7 @@ namespace com.clusterrr.Famicom.DumperConnection try
{
Timeout = 100;
- for (int i = 0; i < 30; i++)
+ for (int i = 0; i < 300; i++)
{
try
{
@@ -662,7 +661,7 @@ namespace com.clusterrr.Famicom.DumperConnection if (recv.Command == DumperCommand.FLASH_WRITE_ERROR)
throw new IOException($"Flash write error");
else if (recv.Command == DumperCommand.FLASH_WRITE_TIMEOUT)
- throw new TimeoutException($"Flash write timeout");
+ throw new IOException($"Flash write timeout");
else if (recv.Command != DumperCommand.PRG_WRITE_DONE)
throw new IOException($"Invalid data received: {recv.Command}");
}
|