From 1171a56a6b5b0e7384dc5e4eb33fb66545cdaa50 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 10 Jul 2018 00:57:55 -0500 Subject: [PATCH] Make sure calib routine can be skipped on update serial routine Might not be needed --- DS4Windows/DS4Library/DS4Device.cs | 7 ++++++- DS4Windows/DS4Library/DS4Devices.cs | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index daae783..3a09e05 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -407,13 +407,18 @@ namespace DS4Windows private Thread timeoutCheckThread = null; private bool timeoutExecuted = false; private bool timeoutEvent = false; + private bool runCalib; + public bool ShouldRunCalib() + { + return runCalib; + } public DS4Device(HidDevice hidDevice) { hDevice = hidDevice; conType = HidConnectionType(hDevice); Mac = hDevice.readSerial(); - bool runCalib = true; + runCalib = true; if (conType == ConnectionType.USB || conType == ConnectionType.SONYWA) { inputReport = new byte[64]; diff --git a/DS4Windows/DS4Library/DS4Devices.cs b/DS4Windows/DS4Library/DS4Devices.cs index ada6904..f570dce 100644 --- a/DS4Windows/DS4Library/DS4Devices.cs +++ b/DS4Windows/DS4Library/DS4Devices.cs @@ -234,7 +234,8 @@ namespace DS4Windows deviceSerials.Add(serial); } - device.refreshCalibration(); + if (device.ShouldRunCalib()) + device.refreshCalibration(); } } }