From 9f9f133f166a82d8f5623338cd22454469aab630 Mon Sep 17 00:00:00 2001 From: Maxim Kulkin Date: Mon, 12 Aug 2019 00:35:22 -0700 Subject: [PATCH] Fix RPI WS281x LED device initialization --- libsrc/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libsrc/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp b/libsrc/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp index d5e47109..553b6082 100644 --- a/libsrc/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp +++ b/libsrc/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp @@ -36,6 +36,7 @@ bool LedDeviceWS281x::init(const QJsonObject &deviceConfig) throw std::runtime_error("WS281x: invalid PWM channel; must be 0 or 1."); } + memset(&_led_string, 0, sizeof(_led_string)); _led_string.freq = deviceConfig["freq"].toInt(800000ul); _led_string.dmanum = deviceConfig["dma"].toInt(5); _led_string.channel[_channel].gpionum = deviceConfig["gpio"].toInt(18);