Logging leds (#50)

* switch to new logger for folowing led devices:
LedDeviceAtmo
LedDeviceFactory
LedDeviceFadeCandy
LedDeviceHyperionUsbasp
LedDeviceLightpack-hidapi
LedDevicePiBlaster
LedDeviceWS281x
LedRs232Device

leddevice base class defines logger already as protected member _log

* migrate to new logger for led devices.
still todo:
LedDeviceWS2812b
LedDeviceWs2812SPI
LedDeviceTinkerforge
LedDeviceLightpack
LedDeviceMultiLightpack
This commit is contained in:
redPanther
2016-06-25 22:08:17 +02:00
committed by brindosch
parent 67afee975f
commit 4033de85ec
20 changed files with 83 additions and 85 deletions

View File

@@ -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;
Debug( Logger::getInstance("LedDevice"), "whiteAlgorithm : %s", whiteAlgorithm.c_str());
Debug( _log, "whiteAlgorithm : %s", whiteAlgorithm.c_str());
initialized = false;
led_string.freq = freq;
led_string.dmanum = dmanum;
if (pwmchannel != 0 && pwmchannel != 1) {
Error( Logger::getInstance("LedDevice"), "WS281x: invalid PWM channel; must be 0 or 1.");
Error( _log, "WS281x: invalid PWM channel; must be 0 or 1.");
throw -1;
}
chan = pwmchannel;
@@ -32,7 +32,7 @@ LedDeviceWS281x::LedDeviceWS281x(const int gpio, const int leds, const uint32_t
led_string.channel[!chan].brightness = 0;
led_string.channel[!chan].strip_type = WS2811_STRIP_RGB;
if (ws2811_init(&led_string) < 0) {
Error( Logger::getInstance("LedDevice"), "Unable to initialize ws281x library.");
Error( _log, "Unable to initialize ws281x library.");
throw -1;
}
initialized = true;