mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-24 15:41: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();
|
||||
timeoutEvent = false;
|
||||
|
||||
int maxBatteryValue = 0;
|
||||
int tempBattery = 0;
|
||||
|
||||
while (!exitInputThread)
|
||||
{
|
||||
oldCharging = charging;
|
||||
@ -807,8 +810,8 @@ namespace DS4Windows
|
||||
try
|
||||
{
|
||||
charging = (inputReport[30] & 0x10) != 0;
|
||||
int maxBatteryValue = charging ? BATTERY_MAX_USB : BATTERY_MAX;
|
||||
int tempBattery = (inputReport[30] & 0x0f) * 100 / maxBatteryValue;
|
||||
maxBatteryValue = charging ? BATTERY_MAX_USB : BATTERY_MAX;
|
||||
tempBattery = (inputReport[30] & 0x0f) * 100 / maxBatteryValue;
|
||||
battery = Math.Min((byte)tempBattery, (byte)100);
|
||||
cState.Battery = (byte)battery;
|
||||
//System.Diagnostics.Debug.WriteLine("CURRENT BATTERY: " + (inputReport[30] & 0x0f) + " | " + tempBattery + " | " + battery);
|
||||
|
Loading…
Reference in New Issue
Block a user