From ac3e7efceee20af7d943bce3fc594e487f139e39 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Tue, 22 Mar 2016 23:28:41 +1100 Subject: [PATCH] Revert "Added support to invert the WS281x LED data." This reverts commit e352dea7a6228dd7b008765917f227d7387ab409 [formerly 44ab64329641f0e1450174314a955d241641d149]. Former-commit-id: d8cc750d60ac642cbdb611cd925252f09cb907db --- libsrc/leddevice/LedDeviceFactory.cpp | 5 ++--- libsrc/leddevice/LedDeviceWS281x.cpp | 4 ++-- libsrc/leddevice/LedDeviceWS281x.h | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index 8ba6a9d3..49b197f6 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -324,12 +324,11 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) else if (type == "ws281x") { const int gpio = deviceConfig.get("gpio", 18).asInt(); - const int leds = deviceConfig.get("leds", 256).asInt(); + const int leds = deviceConfig.get("leds", 12).asInt(); const uint32_t freq = deviceConfig.get("freq", (Json::UInt)800000ul).asInt(); const int dmanum = deviceConfig.get("dmanum", 5).asInt(); - const int invert = deviceConfig.get("invert", 0).asInt(); - LedDeviceWS281x * ledDeviceWS281x = new LedDeviceWS281x(gpio, leds, freq, dmanum, invert); + LedDeviceWS281x * ledDeviceWS281x = new LedDeviceWS281x(gpio, leds, freq, dmanum); device = ledDeviceWS281x; } #endif diff --git a/libsrc/leddevice/LedDeviceWS281x.cpp b/libsrc/leddevice/LedDeviceWS281x.cpp index b8ea8822..10b5d2e0 100644 --- a/libsrc/leddevice/LedDeviceWS281x.cpp +++ b/libsrc/leddevice/LedDeviceWS281x.cpp @@ -3,13 +3,13 @@ #include "LedDeviceWS281x.h" // Constructor -LedDeviceWS281x::LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, const int dmanum, const int invert) +LedDeviceWS281x::LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, const int dmanum) { initialized = false; led_string.freq = freq; led_string.dmanum = dmanum; led_string.channel[0].gpionum = gpio; - led_string.channel[0].invert = invert; + led_string.channel[0].invert = 0; led_string.channel[0].count = leds; led_string.channel[0].brightness = 255; led_string.channel[0].strip_type = WS2811_STRIP_RGB; diff --git a/libsrc/leddevice/LedDeviceWS281x.h b/libsrc/leddevice/LedDeviceWS281x.h index df8b1082..429a092f 100644 --- a/libsrc/leddevice/LedDeviceWS281x.h +++ b/libsrc/leddevice/LedDeviceWS281x.h @@ -16,9 +16,8 @@ public: /// @param leds The number of leds attached to the gpio pin /// @param freq The target frequency for the data line, default is 800000 /// @param dmanum The DMA channel to use, default is 5 - /// @param invert Invert the output line to support an inverting level shifter /// - LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, const int dmanum, const int invert); + LedDeviceWS281x(const int gpio, const int leds, const uint32_t freq, int dmanum); /// /// Destructor of the LedDevice, waits for DMA to complete and then cleans up