From a5452e884a1f1119d87e12e42d6ca9745617d054 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 5 May 2014 03:33:12 +1000 Subject: Cleaned up command line interface - Removed the "--delay " argument. - Improved Action usage info. --- heimdall/source/BridgeManager.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'heimdall/source/BridgeManager.cpp') 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) -- cgit v1.1