Create CRC table in ControlService

This commit is contained in:
Travis Nickles 2019-09-06 09:41:55 -05:00
parent 2a6cc418d6
commit 114b07699a
2 changed files with 3 additions and 2 deletions

View File

@ -140,6 +140,8 @@ namespace DS4Windows
private object busEvtQueueLock = new object(); private object busEvtQueueLock = new object();
public ControlService() public ControlService()
{ {
Crc32Algorithm.InitializeTable(DS4Device.DefaultPolynomial);
//sp.Stream = Properties.Resources.EE; //sp.Stream = Properties.Resources.EE;
// Cause thread affinity to not be tied to main GUI thread // Cause thread affinity to not be tied to main GUI thread
tempThread = new Thread(() => { tempThread = new Thread(() => {

View File

@ -459,7 +459,6 @@ namespace DS4Windows
touchpad = new DS4Touchpad(); touchpad = new DS4Touchpad();
sixAxis = new DS4SixAxis(); sixAxis = new DS4SixAxis();
Crc32Algorithm.InitializeTable(DefaultPolynomial);
if (runCalib) if (runCalib)
RefreshCalibration(); 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 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; uint HamSeed = 2351727372;
private unsafe void performDs4Input() private unsafe void performDs4Input()