diff options
-rw-r--r-- | physical.cpp | 16 | ||||
-rw-r--r-- | physical.hpp | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/physical.cpp b/physical.cpp index 3290661..0de2a53 100644 --- a/physical.cpp +++ b/physical.cpp @@ -41,8 +41,8 @@ void Physical::setInitialState() 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 @@ void Physical::setInitialState() } 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 @@ void Physical::blinkOperation() // 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 @@ class Physical : public sdbusplus::server::object::object< */ 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 * |