mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-02 18:12:32 +01:00
Add wait period after device is enabled.
Seems to be needed for exclusive mode to behave better with recent Windows 10 update
This commit is contained in:
parent
4af6404b49
commit
f042120ede
@ -284,6 +284,7 @@ namespace DS4Windows
|
|||||||
throw new Exception("Error disabling device, error code = " + Marshal.GetLastWin32Error());
|
throw new Exception("Error disabling device, error code = " + Marshal.GetLastWin32Error());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//System.Threading.Thread.Sleep(50);
|
||||||
sw.Start();
|
sw.Start();
|
||||||
while (sw.ElapsedMilliseconds < 50)
|
while (sw.ElapsedMilliseconds < 50)
|
||||||
{
|
{
|
||||||
@ -305,6 +306,15 @@ namespace DS4Windows
|
|||||||
throw new Exception("Error enabling device, error code = " + Marshal.GetLastWin32Error());
|
throw new Exception("Error enabling device, error code = " + Marshal.GetLastWin32Error());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//System.Threading.Thread.Sleep(10);
|
||||||
|
sw.Restart();
|
||||||
|
while (sw.ElapsedMilliseconds < 10)
|
||||||
|
{
|
||||||
|
// Use SpinWait to keep control of current thread. Using Sleep could potentially
|
||||||
|
// cause other events to get run out of order
|
||||||
|
System.Threading.Thread.SpinWait(20);
|
||||||
|
}
|
||||||
|
sw.Stop();
|
||||||
NativeMethods.SetupDiDestroyDeviceInfoList(deviceInfoSet);
|
NativeMethods.SetupDiDestroyDeviceInfoList(deviceInfoSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user