diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 8b72d0f27..fd3771bc4 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -487,6 +487,7 @@ // ------------------------------------------------ #define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by // + #define USE_WS2812_BTYPE NEO_BB_DEFAULT // BitBang type (NEO_BB_DEFAULT, NEO_BB_WS2812X, NEO_BB_SK6812) #define USE_WS2812_CTYPE NEO_GRB // WS2812 Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW) // #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index 818a42408..6a0b9606f 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -172,6 +172,10 @@ const uint32_t LOOP_SLEEP_DELAY = 50; // Lowest number of milliseconds to #define RGB_REMAP_BRGW 48 #define RGB_REMAP_BGRW 54 +#define NEO_BB_DEFAULT 0 // NeoPixelBus BitBang speed 800kBps with reset time 50 uSec +#define NEO_BB_WS2812X 1 // NeoPixelBus BitBang speed 800kBps with reset time 300 uSec +#define NEO_BB_SK6812 2 // NeoPixelBus BitBang speed 800kBps with reset time 80 uSec + #define MQTT_PUBSUBCLIENT 1 // Mqtt PubSubClient library #define MQTT_TASMOTAMQTT 2 // Mqtt TasmotaMqtt library based on esp-mqtt-arduino - soon obsolete #define MQTT_ESPMQTTARDUINO 3 // Mqtt esp-mqtt-arduino library by Ingo Randolf - obsolete but define is present for debugging purposes diff --git a/sonoff/xplg_ws2812.ino b/sonoff/xplg_ws2812.ino index 479f27065..250866238 100644 --- a/sonoff/xplg_ws2812.ino +++ b/sonoff/xplg_ws2812.ino @@ -39,11 +39,17 @@ typedef NeoRgbFeature selectedNeoFeatureType; #endif // USE_WS2812_CTYPE - #ifdef USE_WS2812_DMA typedef Neo800KbpsMethod selectedNeoSpeedType; #else // USE_WS2812_DMA +// See NeoEspBitBangMethod.h for available options +#if (USE_WS2812_BTYPE == NEO_BB_WS2812X) + typedef NeoEsp8266BitBangWs2812xMethod selectedNeoSpeedType; +#elif (USE_WS2812_BTYPE == NEO_BB_SK6812) + typedef NeoEsp8266BitBangSk6812Method selectedNeoSpeedType; +#else // USE_WS2812_BTYPE typedef NeoEsp8266BitBang800KbpsMethod selectedNeoSpeedType; +#endif // USE_WS2812_BTYPE #endif // USE_WS2812_DMA NeoPixelBus *strip = nullptr;