mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-23 23:21:49 +01:00
Change to keep lightbar from sticking in some situations
Hopefully resolves issue #126.
This commit is contained in:
parent
a7f4dec009
commit
677191e8b4
@ -578,11 +578,13 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
private byte outputPendCount = 0;
|
||||
private void performDs4Output()
|
||||
{
|
||||
try
|
||||
{
|
||||
int lastError = 0;
|
||||
outputPendCount = 3;
|
||||
while (!exitOutputThread)
|
||||
{
|
||||
bool result = false;
|
||||
@ -593,6 +595,7 @@ namespace DS4Windows
|
||||
{
|
||||
outputReportBuffer.CopyTo(outputReport, 0);
|
||||
outputRumble = false;
|
||||
outputPendCount--;
|
||||
}
|
||||
|
||||
result = writeOutput();
|
||||
@ -1096,12 +1099,17 @@ namespace DS4Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
bool output = false;
|
||||
bool output = outputPendCount > 0;
|
||||
for (int i = 0, arlen = outputReport.Length; !output && i < arlen; i++)
|
||||
output = outputReport[i] != outputReportBuffer[i];
|
||||
|
||||
if (output)
|
||||
{
|
||||
if (outputPendCount == 0)
|
||||
{
|
||||
outputPendCount = 3;
|
||||
}
|
||||
|
||||
outputRumble = true;
|
||||
Monitor.Pulse(outputReportBuffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user