Minor changes

This commit is contained in:
Travis Nickles 2017-07-26 21:38:34 -05:00
parent 436d0ed1ef
commit 60a21a9fe3
2 changed files with 15 additions and 4 deletions

View File

@ -695,6 +695,7 @@ namespace DS4Windows
public bool[] inWarnMonitor = new bool[4] { false, false, false, false }; public bool[] inWarnMonitor = new bool[4] { false, false, false, false };
private byte[] currentBattery = new byte[4] { 0, 0, 0, 0 }; private byte[] currentBattery = new byte[4] { 0, 0, 0, 0 };
private bool[] charging = new bool[4] { false, false, false, false }; private bool[] charging = new bool[4] { false, false, false, false };
private string[] tempStrings = new string[4] { string.Empty, string.Empty, string.Empty, string.Empty };
// Called every time a new input report has arrived // Called every time a new input report has arrived
protected virtual void On_Report(object sender, EventArgs e) protected virtual void On_Report(object sender, EventArgs e)
@ -714,9 +715,13 @@ namespace DS4Windows
if (getFlushHIDQueue(ind)) if (getFlushHIDQueue(ind))
device.FlushHID(); device.FlushHID();
if (!string.IsNullOrEmpty(device.error)) string devError = tempStrings[ind] = device.error;
if (!string.IsNullOrEmpty(devError))
{ {
LogDebug(device.error); device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state)
{
LogDebug(devError);
}), null);
} }
if (inWarnMonitor[ind]) if (inWarnMonitor[ind])
@ -749,8 +754,9 @@ namespace DS4Windows
device.getCurrentState(CurrentState[ind]); device.getCurrentState(CurrentState[ind]);
DS4State cState = CurrentState[ind]; DS4State cState = CurrentState[ind];
device.getPreviousState(PreviousState[ind]); DS4State pState = device.getPreviousStateRef();
DS4State pState = PreviousState[ind]; //device.getPreviousState(PreviousState[ind]);
//DS4State pState = PreviousState[ind];
if (!device.firstReport && device.IsAlive()) if (!device.firstReport && device.IsAlive())
{ {

View File

@ -1239,6 +1239,11 @@ namespace DS4Windows
return cState; return cState;
} }
public DS4State getPreviousStateRef()
{
return pState;
}
private bool isDS4Idle() private bool isDS4Idle()
{ {
if (cState.Square || cState.Cross || cState.Circle || cState.Triangle) if (cState.Square || cState.Cross || cState.Circle || cState.Triangle)