From 114b07699a796e30cf65360e6a6f8ec870608b3c Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 6 Sep 2019 09:41:55 -0500 Subject: [PATCH] Create CRC table in ControlService --- DS4Windows/DS4Control/ControlService.cs | 2 ++ DS4Windows/DS4Library/DS4Device.cs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index a4afcb8..3466ae6 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -140,6 +140,8 @@ namespace DS4Windows private object busEvtQueueLock = new object(); public ControlService() { + Crc32Algorithm.InitializeTable(DS4Device.DefaultPolynomial); + //sp.Stream = Properties.Resources.EE; // Cause thread affinity to not be tied to main GUI thread tempThread = new Thread(() => { diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index b80e13f..24846c7 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -459,7 +459,6 @@ namespace DS4Windows touchpad = new DS4Touchpad(); sixAxis = new DS4SixAxis(); - Crc32Algorithm.InitializeTable(DefaultPolynomial); if (runCalib) RefreshCalibration(); @@ -727,7 +726,7 @@ namespace DS4Windows const int BT_INPUT_REPORT_CRC32_POS = BT_OUTPUT_REPORT_LENGTH - 4; //last 4 bytes of the 78-sized input report are crc32 - const uint DefaultPolynomial = 0xedb88320u; + public const uint DefaultPolynomial = 0xedb88320u; uint HamSeed = 2351727372; private unsafe void performDs4Input()