diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 324d9545df..f344f8b865 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -668,21 +668,19 @@ protected virtual void On_Report(object sender, EventArgs e) int flashWhenLateAt = getFlashWhenLateAt(); if (!lag[ind] && device.Latency >= flashWhenLateAt) { + lag[ind] = true; device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) { LagFlashWarning(ind, true); }), null); - - //LagFlashWarning(ind, true); } else if (lag[ind] && device.Latency < flashWhenLateAt) { + lag[ind] = false; device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) { LagFlashWarning(ind, false); }), null); - - //LagFlashWarning(ind, false); } } else @@ -705,9 +703,6 @@ protected virtual void On_Report(object sender, EventArgs e) { OnDeviceStatusChanged(this, ind); }), null); - - //OnDeviceStatusChanged(this, ind); - } else if (pState.Battery != cState.Battery || device.oldCharging != device.isCharging()) { @@ -717,8 +712,6 @@ protected virtual void On_Report(object sender, EventArgs e) { OnBatteryStatusChange(this, ind, tempBattery, tempCharging); }), null); - - //OnBatteryStatusChange(this, ind, cState.Battery, device.isCharging()); } if (getEnableTouchToggle(ind)) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 63465c045f..c837e8928f 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -77,7 +77,7 @@ public static bool TryParse(string value, ref DS4Color ds4color) try { string[] ss = value.Split(','); - return byte.TryParse(ss[0], out ds4color.red) &&byte.TryParse(ss[1], out ds4color.green) && byte.TryParse(ss[2], out ds4color.blue); + return byte.TryParse(ss[0], out ds4color.red) && byte.TryParse(ss[1], out ds4color.green) && byte.TryParse(ss[2], out ds4color.blue); } catch { return false; } } @@ -650,7 +650,6 @@ private void performDs4Input() { firstActive = DateTime.UtcNow; NativeMethods.HidD_SetNumInputBuffers(hDevice.safeReadHandle.DangerousGetHandle(), 2); - //List latencyList = new List(51); // Set capacity at max + 1 to avoid any list resizing Queue latencyQueue = new Queue(51); // Set capacity at max + 1 to avoid any resizing int tempLatencyCount = 0; long oldtime = 0; @@ -765,10 +764,10 @@ private void performDs4Input() } if (conType == ConnectionType.BT && btInputReport[0] != 0x11) - { - //Received incorrect report, skip it - continue; - } + { + //Received incorrect report, skip it + continue; + } utcNow = DateTime.UtcNow; // timestamp with UTC in case system time zone changes resetHapticState(); @@ -865,7 +864,8 @@ private void performDs4Input() for (int i = 0; i < inputReport.Length; i++) Console.Write(" " + inputReport[i].ToString("x2")); Console.WriteLine(); - } */ + } + */ if (conType == ConnectionType.SONYWA) { @@ -970,13 +970,10 @@ private void performDs4Input() { Action tempAct = null; for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++) - //foreach (Action tempAct in eventQueue) { tempAct = eventQueue.Dequeue(); tempAct.Invoke(); } - - //eventQueue.Clear(); } } @@ -1293,7 +1290,7 @@ public void pushHapticState(DS4HapticState hs) } override - public String ToString() + public string ToString() { return Mac; }