mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-25 08:01:49 +01:00
Change scope of some variables
This commit is contained in:
parent
6ff8221e5e
commit
712f470b9e
@ -649,6 +649,9 @@ namespace DS4Windows
|
|||||||
sw.Start();
|
sw.Start();
|
||||||
timeoutEvent = false;
|
timeoutEvent = false;
|
||||||
|
|
||||||
|
int maxBatteryValue = 0;
|
||||||
|
int tempBattery = 0;
|
||||||
|
|
||||||
while (!exitInputThread)
|
while (!exitInputThread)
|
||||||
{
|
{
|
||||||
oldCharging = charging;
|
oldCharging = charging;
|
||||||
@ -807,8 +810,8 @@ namespace DS4Windows
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
charging = (inputReport[30] & 0x10) != 0;
|
charging = (inputReport[30] & 0x10) != 0;
|
||||||
int maxBatteryValue = charging ? BATTERY_MAX_USB : BATTERY_MAX;
|
maxBatteryValue = charging ? BATTERY_MAX_USB : BATTERY_MAX;
|
||||||
int tempBattery = (inputReport[30] & 0x0f) * 100 / maxBatteryValue;
|
tempBattery = (inputReport[30] & 0x0f) * 100 / maxBatteryValue;
|
||||||
battery = Math.Min((byte)tempBattery, (byte)100);
|
battery = Math.Min((byte)tempBattery, (byte)100);
|
||||||
cState.Battery = (byte)battery;
|
cState.Battery = (byte)battery;
|
||||||
//System.Diagnostics.Debug.WriteLine("CURRENT BATTERY: " + (inputReport[30] & 0x0f) + " | " + tempBattery + " | " + battery);
|
//System.Diagnostics.Debug.WriteLine("CURRENT BATTERY: " + (inputReport[30] & 0x0f) + " | " + tempBattery + " | " + battery);
|
||||||
|
Loading…
Reference in New Issue
Block a user