physical: 'frequency' is really periodicity
Change-Id: I1007d2a7104fa07351c89c52a860cde83b2d509c
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/physical.cpp b/physical.cpp
index 3290661..0de2a53 100644
--- a/physical.cpp
+++ b/physical.cpp
@@ -41,8 +41,8 @@
auto delayOff = led.getDelayOff();
// Calculate frequency and then percentage ON
- frequency = delayOn + delayOff;
- auto factor = frequency / 100;
+ periodMs = delayOn + delayOff;
+ auto factor = periodMs / 100;
auto dutyOn = delayOn / factor;
// Update.
@@ -50,10 +50,10 @@
}
else
{
- // This is hardcoded for now. This will be changed to this->frequency()
- // when frequency is implemented.
+ // This is hardcoded for now. This will be changed to this->period()
+ // when configurable periodicity is implemented.
// TODO
- frequency = 1000;
+ periodMs = 1000;
// LED is either ON or OFF
auto brightness = led.getBrightness();
@@ -137,11 +137,11 @@
// Write DutyON. Value in percentage 1_millisecond.
// so 50% input becomes 500. Driver wants string input
- auto percentage = frequency / 100;
- led.setDelayOn(dutyOn * percentage);
+ auto factor = periodMs / 100;
+ led.setDelayOn(dutyOn * factor);
// Write DutyOFF. Value in milli seconds so 50% input becomes 500.
- led.setDelayOff((100 - dutyOn) * percentage);
+ led.setDelayOff((100 - dutyOn) * factor);
return;
}
diff --git a/physical.hpp b/physical.hpp
index 3d99066..e588de2 100644
--- a/physical.hpp
+++ b/physical.hpp
@@ -69,10 +69,10 @@
*/
SysfsLed& led;
- /** @brief Frequency range that the LED can operate on.
- * Will be removed when frequency is put into interface
+ /** @brief The period that the LED will operate on, in milliseconds
+ * Will be removed when periodicity is put into interface
*/
- uint32_t frequency;
+ uint32_t periodMs;
/** @brief reads sysfs and then setsup the parameteres accordingly
*