summaryrefslogtreecommitdiffstats
path: root/heimdall/source/BridgeManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--heimdall/source/BridgeManager.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp
index 3e85a09..e954f3b 100644
--- a/heimdall/source/BridgeManager.cpp
+++ b/heimdall/source/BridgeManager.cpp
@@ -447,10 +447,9 @@ bool BridgeManager::InitialiseProtocol(void)
return (false);
}
-BridgeManager::BridgeManager(bool verbose, int communicationDelay)
+BridgeManager::BridgeManager(bool verbose)
{
this->verbose = verbose;
- this->communicationDelay = communicationDelay;
libusbContext = nullptr;
deviceHandle = nullptr;
@@ -725,8 +724,7 @@ bool BridgeManager::SendBulkTransfer(unsigned char *data, int length, int timeou
if (result != LIBUSB_SUCCESS && retry)
{
- // max(250, communicationDelay)
- int retryDelay = (communicationDelay > 250) ? communicationDelay : 250;
+ static const int retryDelay = 250;
if (verbose)
Interface::PrintError("libusb error %d whilst sending bulk transfer.", result);
@@ -767,9 +765,6 @@ bool BridgeManager::SendPacket(OutboundPacket *packet, int timeout, bool retry)
if (!SendBulkTransfer(nullptr, 0, timeout, retry))
return (false);
- if (communicationDelay != 0)
- Sleep(communicationDelay);
-
return (true);
}
@@ -789,8 +784,7 @@ bool BridgeManager::ReceivePacket(InboundPacket *packet, int timeout, bool retry
unsigned int attempt = 0;
unsigned int maxAttempts = (retry) ? kReceivePacketMaxAttempts : 1;
- // max(250, communicationDelay)
- int retryDelay = (communicationDelay > 250) ? communicationDelay : 250;
+ static const int retryDelay = 250;
for (; attempt < maxAttempts; attempt++)
{
@@ -818,9 +812,6 @@ bool BridgeManager::ReceivePacket(InboundPacket *packet, int timeout, bool retry
if (attempt == maxAttempts)
return (false);
- if (communicationDelay != 0)
- Sleep(communicationDelay);
-
if (dataTransferred != packet->GetSize() && !packet->IsSizeVariable())
{
if (verbose)