summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-05-25 15:41:12 +0930
committerAndrew Jeffery <andrew@aj.id.au>2019-04-08 13:48:50 +0930
commitbf0b0a929025255da9ef1b53982b51f034e9566d (patch)
treea4b464e5c8464185af624e3a2c4208224750b4d0
parent30552c95285892a81dc4ae704263cc98d07f3208 (diff)
downloadphosphor-led-sysfs-bf0b0a929025255da9ef1b53982b51f034e9566d.zip
phosphor-led-sysfs-bf0b0a929025255da9ef1b53982b51f034e9566d.tar.gz
physical: Cleanup unnecessary variables
Change-Id: Ib5897e4f7226993c2deb1feb6e2e39d5a0f0cb5a Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--physical.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/physical.cpp b/physical.cpp
index 2b404b6..77d3d4f 100644
--- a/physical.cpp
+++ b/physical.cpp
@@ -31,14 +31,9 @@ void Physical::setInitialState()
{
// LED is blinking. Get the on and off delays and derive percent duty
auto delayOn = led.getDelayOn();
- auto delayOff = led.getDelayOff();
-
- // Calculate duty from millisecond delay values and derive percentage on
- periodMs = delayOn + delayOff;
- auto factor = periodMs / 100;
- auto dutyOn = delayOn / factor;
-
- this->dutyOn(dutyOn);
+ periodMs = delayOn + led.getDelayOff();
+ auto percentScale = periodMs / 100;
+ this->dutyOn(delayOn / percentScale);
}
else
{
OpenPOWER on IntegriCloud