From 6348720776d83c23965caf3554239298a416796f Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 19 Sep 2017 21:36:33 -0500 Subject: [PATCH] Minor tweak --- DS4Windows/DS4Control/DS4LightBar.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DS4Windows/DS4Control/DS4LightBar.cs b/DS4Windows/DS4Control/DS4LightBar.cs index 097304e..f845d91 100644 --- a/DS4Windows/DS4Control/DS4LightBar.cs +++ b/DS4Windows/DS4Control/DS4LightBar.cs @@ -34,6 +34,7 @@ namespace DS4Windows public static DS4Color[] forcedColor = new DS4Color[4]; public static byte[] forcedFlash = new byte[4]; internal const int PULSE_FLASH_DURATION = 2000; + internal const int PULSE_FLASH_SEGMENTS = PULSE_FLASH_DURATION / 40; internal const int PULSE_CHARGING_DURATION = 4000; public static void updateLightBar(DS4Device device, int deviceNum, DS4State cState, @@ -124,7 +125,7 @@ namespace DS4Windows if (elapsed < PULSE_FLASH_DURATION) { elapsed = elapsed / 40; - ratio = 100.0 * (elapsed / ((double)PULSE_FLASH_DURATION * 0.025)); + ratio = 100.0 * (elapsed / PULSE_FLASH_SEGMENTS); } else { @@ -137,7 +138,7 @@ namespace DS4Windows if (elapsed < PULSE_FLASH_DURATION) { elapsed = elapsed / 40; - ratio = (0 - 100.0) * (elapsed / ((double)PULSE_FLASH_DURATION * 0.025)) + 100.0; + ratio = (0 - 100.0) * (elapsed / PULSE_FLASH_SEGMENTS) + 100.0; } else {