diff --git a/include/hyperion/Hyperion.h b/include/hyperion/Hyperion.h index e25f1aae..5a9e0159 100644 --- a/include/hyperion/Hyperion.h +++ b/include/hyperion/Hyperion.h @@ -70,7 +70,7 @@ public: /// @param[in] ledColor The color to write to the leds /// @param[in] timeout_ms The time the leds are set to the given color [ms] /// - void setColor(int priority, RgbColor &ledColor, const int timeout_ms); + void setColor(int priority, const RgbColor &ledColor, const int timeout_ms); /// /// Writes the given colors to all leds for the given time and priority @@ -79,7 +79,7 @@ public: /// @param[in] ledColors The colors to write to the leds /// @param[in] timeout_ms The time the leds are set to the given colors [ms] /// - void setColors(int priority, std::vector &ledColors, const int timeout_ms); + void setColors(int priority, const std::vector &ledColors, const int timeout_ms); /// /// Sets/Updates a part of the color transformation. diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 02bf4252..631ff2a5 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -22,12 +22,10 @@ LedDevice* Hyperion::constructDevice(const Json::Value& deviceConfig) LedDevice* device = nullptr; if (deviceConfig["type"].asString() == "ws2801") { - const std::string name = "WS-2801"; const std::string output = deviceConfig["output"].asString(); - const unsigned interval = deviceConfig["interval"].asInt(); const unsigned rate = deviceConfig["rate"].asInt(); - LedDeviceWs2801* deviceWs2801 = new LedDeviceWs2801(name, output, interval, rate); + LedDeviceWs2801* deviceWs2801 = new LedDeviceWs2801(output, rate); deviceWs2801->open(); device = deviceWs2801; @@ -117,7 +115,7 @@ unsigned Hyperion::getLedCount() const return _ledString.leds().size(); } -void Hyperion::setColor(int priority, RgbColor & color, const int timeout_ms) +void Hyperion::setColor(int priority, const RgbColor &color, const int timeout_ms) { // create led output std::vector ledColors(_ledString.leds().size(), color); @@ -126,7 +124,7 @@ void Hyperion::setColor(int priority, RgbColor & color, const int timeout_ms) setColors(priority, ledColors, timeout_ms); } -void Hyperion::setColors(int priority, std::vector& ledColors, const int timeout_ms) +void Hyperion::setColors(int priority, const std::vector& ledColors, const int timeout_ms) { if (timeout_ms > 0) { diff --git a/test/TestSpi.cpp b/test/TestSpi.cpp index c955ad88..8d28784a 100644 --- a/test/TestSpi.cpp +++ b/test/TestSpi.cpp @@ -54,7 +54,7 @@ void setColor(char* colorStr) unsigned ledCnt = 50; std::vector buff(ledCnt, color); - LedDeviceWs2801 ledDevice("SpiPi", "/dev/spidev0.0", 20000, 40000); + LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000); ledDevice.open(); ledDevice.write(buff); } @@ -68,7 +68,7 @@ void doCircle() unsigned ledCnt = 50; std::vector data(ledCnt, RgbColor::BLACK); - LedDeviceWs2801 ledDevice("SpiPi", "/dev/spidev0.0", 20000, 40000); + LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000); ledDevice.open(); timespec loopTime;