diff --git a/BrcmPatchRAM.xcodeproj/project.pbxproj b/BrcmPatchRAM.xcodeproj/project.pbxproj
index dfacc8e..fd4a65b 100644
--- a/BrcmPatchRAM.xcodeproj/project.pbxproj
+++ b/BrcmPatchRAM.xcodeproj/project.pbxproj
@@ -1263,7 +1263,7 @@
D4F91B071A2998CE0030D10D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 2.2.8;
+ CURRENT_PROJECT_VERSION = 2.2.9;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx10.6;
@@ -1274,7 +1274,7 @@
D4F91B081A2998CE0030D10D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 2.2.8;
+ CURRENT_PROJECT_VERSION = 2.2.9;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx10.6;
diff --git a/BrcmPatchRAM/BrcmPatchRAM.cpp b/BrcmPatchRAM/BrcmPatchRAM.cpp
index dcdc09f..18133da 100644
--- a/BrcmPatchRAM/BrcmPatchRAM.cpp
+++ b/BrcmPatchRAM/BrcmPatchRAM.cpp
@@ -195,6 +195,21 @@ IOService* BrcmPatchRAM::probe(IOService *provider, SInt32 *probeScore)
mBlurpWait = 400;
#endif
+ mProbeDelay = 0;
+ OSNumber* probeDelay = OSDynamicCast(OSNumber, getProperty("ProbeDelay"));
+ if (probeDelay)
+ mProbeDelay = probeDelay->unsigned32BitValue();
+
+ mInitialDelay = 100;
+ OSNumber* initialDelay = OSDynamicCast(OSNumber, getProperty("InitialDelay"));
+ if (initialDelay)
+ mInitialDelay = initialDelay->unsigned32BitValue();
+
+ mPostResetDelay = 20;
+ OSNumber* postResetDelay = OSDynamicCast(OSNumber, getProperty("PostResetDelay"));
+ if (postResetDelay)
+ mPostResetDelay = postResetDelay->unsigned32BitValue();
+
OSString* displayName = OSDynamicCast(OSString, getProperty(kDisplayName));
if (displayName)
provider->setProperty(kUSBProductString, displayName);
@@ -209,6 +224,8 @@ IOService* BrcmPatchRAM::probe(IOService *provider, SInt32 *probeScore)
firmwareStore->getFirmware(mVendorId, mProductId, firmwareKey);
}
+ IOSleep(mProbeDelay);
+
uploadFirmware();
publishPersonality();
@@ -417,7 +434,7 @@ void BrcmPatchRAM::uploadFirmwareThread(void *arg, wait_result_t wait)
{
BrcmPatchRAM* me = static_cast<BrcmPatchRAM*>(arg);
me->resetDevice();
- IOSleep(20);
+ IOSleep(me->mPostResetDelay);
me->uploadFirmware();
#ifndef TARGET_ELCAPITAN
me->publishPersonality();
@@ -1239,7 +1256,7 @@ bool BrcmPatchRAM::performUpgrade()
// If this IOSleep is not issued, the device is not ready to receive
// the firmware instructions and we will deadlock due to lack of
// responses.
- IOSleep(10);
+ IOSleep(mInitialDelay);
// Write first instruction to trigger response
if ((data = OSDynamicCast(OSData, iterator->getNextObject())))
diff --git a/BrcmPatchRAM/BrcmPatchRAM.h b/BrcmPatchRAM/BrcmPatchRAM.h
index e216533..e6a10e8 100644
--- a/BrcmPatchRAM/BrcmPatchRAM.h
+++ b/BrcmPatchRAM/BrcmPatchRAM.h
@@ -77,7 +77,10 @@ private:
UInt16 mVendorId;
UInt16 mProductId;
-
+ UInt32 mProbeDelay;
+ UInt32 mPostResetDelay;
+ UInt32 mInitialDelay;
+
USBDeviceShim mDevice;
USBInterfaceShim mInterface;
USBPipeShim mInterruptPipe;
@@ -190,4 +193,4 @@ public:
#endif //NON_RESIDENT
-#endif //__BrcmPatchRAM__
\ No newline at end of file
+#endif //__BrcmPatchRAM__