Auto-select pixel driving method based on LEDPIN
This commit is contained in:
parent
9904c10984
commit
6aaf544079
@ -5,22 +5,28 @@
|
|||||||
//#define WORKAROUND_ESP32_BITBANG
|
//#define WORKAROUND_ESP32_BITBANG
|
||||||
//see https://github.com/Aircoookie/WLED/issues/2 for flicker free ESP32 support
|
//see https://github.com/Aircoookie/WLED/issues/2 for flicker free ESP32 support
|
||||||
|
|
||||||
#define LEDPIN 2 //strip pin. Only effective for ESP32, ESP8266 must use gpio2
|
#define LEDPIN 2 //strip pin. Any for ESP32, gpio2 is recommended for ESP8266
|
||||||
|
|
||||||
//uncomment this if red and green are swapped
|
//uncomment this if red and green are swapped
|
||||||
//#define SWAPRG
|
//#define SWAPRG
|
||||||
|
|
||||||
//automatically uses the right driver method for each platform
|
//automatically uses the right driver method for each platform
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
#ifdef WORKAROUND_ESP32_BITBANG
|
#ifdef WORKAROUND_ESP32_BITBANG
|
||||||
#define PIXELMETHOD NeoEsp32BitBangWs2813Method
|
#define PIXELMETHOD NeoEsp32BitBangWs2813Method
|
||||||
#else
|
#else
|
||||||
#define PIXELMETHOD NeoEsp32RmtWS2813_V3Method
|
#define PIXELMETHOD NeoEsp32RmtWS2813_V3Method
|
||||||
#endif
|
#endif
|
||||||
#else //esp8266
|
#else //esp8266
|
||||||
//you may change to DMA method on pin GPIO3 here
|
//autoselect the right method depending on strip pin
|
||||||
#define PIXELMETHOD NeoEsp8266Uart800KbpsMethod
|
#if LEDPIN == 2
|
||||||
//#define PIXELMETHOD NeoEsp8266Dma800KbpsMethod
|
#define PIXELMETHOD NeoEsp8266Uart800KbpsMethod
|
||||||
|
#elif LEDPIN == 3
|
||||||
|
#define PIXELMETHOD NeoEsp8266Dma800KbpsMethod
|
||||||
|
#else
|
||||||
|
#define PIXELMETHOD NeoEsp8266BitBang800KbpsMethod
|
||||||
|
#pragma message "Software BitBang will be used because of your selected LED pin. This may cause flicker. Use GPIO 2 or 3 for best results."
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//handle swapping Red and Green automatically
|
//handle swapping Red and Green automatically
|
||||||
|
@ -258,13 +258,8 @@ void getBuildInfo()
|
|||||||
#endif
|
#endif
|
||||||
oappend("button-pin: gpio");
|
oappend("button-pin: gpio");
|
||||||
oappendi(buttonPin);
|
oappendi(buttonPin);
|
||||||
oappend("\r\n");
|
oappend("\r\nstrip-pin: gpio");
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
|
||||||
oappend("strip-pin: gpio");
|
|
||||||
oappendi(LEDPIN);
|
oappendi(LEDPIN);
|
||||||
#else
|
|
||||||
oappend("strip-pin: gpio2");
|
|
||||||
#endif
|
|
||||||
oappend("\r\nbuild-type: dev\r\n");
|
oappend("\r\nbuild-type: dev\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user