diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 4738b80..342595c 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -276,7 +276,7 @@ namespace DS4Windows { // Do first run check for Quick Charge checks. Needed so old device will // be removed before performing another controller scan - if (getQuickCharge()) + /*if (getQuickCharge()) { for (int i = 0, devlen = DS4Controllers.Length; i < devlen; i++) { @@ -291,6 +291,7 @@ namespace DS4Windows } } } + */ DS4Devices.findControllers(); IEnumerable devices = DS4Devices.getDS4Controllers(); diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index f2d40e2..4dbd77d 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -639,6 +639,8 @@ namespace DS4Windows Queue latencyQueue = new Queue(51); // Set capacity at max + 1 to avoid any resizing int tempLatencyCount = 0; long oldtime = 0; + string currerror = string.Empty; + long curtime = 0; Stopwatch sw = new Stopwatch(); sw.Start(); timeoutEvent = false; @@ -646,8 +648,8 @@ namespace DS4Windows while (!exitInputThread) { oldCharging = charging; - string currerror = string.Empty; - long curtime = sw.ElapsedMilliseconds; + currerror = string.Empty; + curtime = sw.ElapsedMilliseconds; this.lastTimeElapsed = curtime - oldtime; //latencyList.Add(this.lastTimeElapsed); latencyQueue.Enqueue(this.lastTimeElapsed); @@ -888,7 +890,10 @@ namespace DS4Windows if (conType == ConnectionType.BT) { if (DisconnectBT(true)) + { + timeoutExecuted = true; return; // all done + } } else if (conType == ConnectionType.SONYWA) { @@ -897,6 +902,16 @@ namespace DS4Windows } } + if (oldCharging != charging && conType == ConnectionType.BT) + { + if (Global.getQuickCharge() && charging) + { + DisconnectBT(true); + timeoutExecuted = true; + return; + } + } + if (Report != null) Report(this, EventArgs.Empty);