diff --git a/libsrc/leddevice/LedDeviceWS281x.cpp b/libsrc/leddevice/LedDeviceWS281x.cpp index 8349c70b..1f943efa 100644 --- a/libsrc/leddevice/LedDeviceWS281x.cpp +++ b/libsrc/leddevice/LedDeviceWS281x.cpp @@ -6,13 +6,13 @@ LedDeviceWS281x::LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, const int dmanum, const int pwmchannel, const int invert, const int rgbw, const std::string& whiteAlgorithm) { _whiteAlgorithm = whiteAlgorithm; -std::cout << "whiteAlgorithm :" << whiteAlgorithm << ":\n"; + Debug( Logger::getInstance("LedDevice"), "whiteAlgorithm : %s", whiteAlgorithm.c_str()); initialized = false; led_string.freq = freq; led_string.dmanum = dmanum; if (pwmchannel != 0 && pwmchannel != 1) { - std::cout << "WS281x: invalid PWM channel; must be 0 or 1." << std::endl; + Error( Logger::getInstance("LedDevice"), "WS281x: invalid PWM channel; must be 0 or 1."); throw -1; } chan = pwmchannel; @@ -32,7 +32,7 @@ std::cout << "whiteAlgorithm :" << whiteAlgorithm << ":\n"; led_string.channel[!chan].brightness = 0; led_string.channel[!chan].strip_type = WS2811_STRIP_RGB; if (ws2811_init(&led_string) < 0) { - std::cout << "Unable to initialize ws281x library." << std::endl; + Error( Logger::getInstance("LedDevice"), "Unable to initialize ws281x library."); throw -1; } initialized = true; @@ -95,7 +95,6 @@ LedDeviceWS281x::~LedDeviceWS281x() { if (initialized) { - std::cout << "Shutdown WS281x PWM and DMA channel" << std::endl; ws2811_fini(&led_string); } initialized = false; diff --git a/libsrc/leddevice/LedDeviceWS281x.h b/libsrc/leddevice/LedDeviceWS281x.h index 557598a8..6bae11f3 100644 --- a/libsrc/leddevice/LedDeviceWS281x.h +++ b/libsrc/leddevice/LedDeviceWS281x.h @@ -5,6 +5,7 @@ #include #include +#include class LedDeviceWS281x : public LedDevice { diff --git a/libsrc/leddevice/LedUdpDevice.cpp b/libsrc/leddevice/LedUdpDevice.cpp index b8126592..d8b4fd12 100644 --- a/libsrc/leddevice/LedUdpDevice.cpp +++ b/libsrc/leddevice/LedUdpDevice.cpp @@ -15,7 +15,6 @@ // Local Hyperion includes #include "LedUdpDevice.h" - LedUdpDevice::LedUdpDevice(const std::string& outputDevice, const unsigned baudrate, const int latchTime_ns) : mDeviceName(outputDevice), mBaudRate_Hz(baudrate), @@ -26,7 +25,7 @@ LedUdpDevice::LedUdpDevice(const std::string& outputDevice, const unsigned baudr QString str = QString::fromStdString(mDeviceName); QStringList _list = str.split(":"); if (_list.size() != 2) { - printf ("ERROR: LedUdpDevice: Error parsing hostname:port\n"); + Error( Logger::getInstance("LedDevice"), "LedUdpDevice: Error parsing hostname:port"); exit (-1); } QHostInfo info = QHostInfo::fromName(_list.at(0)); diff --git a/libsrc/leddevice/LedUdpDevice.h b/libsrc/leddevice/LedUdpDevice.h index cd9e2463..9afec475 100644 --- a/libsrc/leddevice/LedUdpDevice.h +++ b/libsrc/leddevice/LedUdpDevice.h @@ -7,6 +7,7 @@ // Hyperion includes #include +#include /// /// The LedUdpDevice implements an abstract base-class for LedDevices using the SPI-device.