Merge remote-tracking branch 'arendst/development' into development

This commit is contained in:
sle 2021-03-11 12:16:05 +01:00
commit 4f5280cd66
15 changed files with 149 additions and 84 deletions

View File

@ -17,6 +17,11 @@ All notable changes to this project will be documented in this file.
- Extent compile time SetOptions support (#11204) - Extent compile time SetOptions support (#11204)
- ESP32 Extent BLE (#11212) - ESP32 Extent BLE (#11212)
- ESP32 support for WS2812 hardware driver via RMT or I2S
- ESP32 support for secondary I2C controller
### Changed ### Changed
- ESP32 core library from v1.0.5-rc6 to v1.0.5 - ESP32 core library from v1.0.5-rc6 to v1.0.5
- TasmotaSerial library from v3.2.0 to v3.3.0 - TasmotaSerial library from v3.2.0 to v3.3.0

View File

@ -31,7 +31,7 @@ See [CHANGELOG.md](CHANGELOG.md) for detailed change information.
Unless your Tasmota powered device exhibits a problem or you need to make use of a feature that is not available in the Tasmota version currently installed on your device, leave your device alone - it works so don't make unnecessary changes! If the release version (i.e., the master branch) exhibits unexpected behaviour for your device and configuration, you should upgrade to the latest development version instead to see if your problem is resolved as some bugs in previous releases or development builds may already have been resolved. Unless your Tasmota powered device exhibits a problem or you need to make use of a feature that is not available in the Tasmota version currently installed on your device, leave your device alone - it works so don't make unnecessary changes! If the release version (i.e., the master branch) exhibits unexpected behaviour for your device and configuration, you should upgrade to the latest development version instead to see if your problem is resolved as some bugs in previous releases or development builds may already have been resolved.
The Tasmota development codebase is checked every 1-2 hours for changes. If new commits have been merged and they compile successfuly, new binary files for every variant will be posted at http://ota.tasmota.com/tasmota/ (this web address can be used for OTA updates too). It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted. Every commit made to the development branch, which is compiling successfuly, will post new binary files at http://ota.tasmota.com/tasmota/ (this web address can be used for OTA updates too). It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted.
Note that there is a chance, as with any upgrade, that the device may not function as expected. You must always account for the possibility that you may need to flash the device via the serial programming interface if the OTA upgrade fails. Even with the master release, you should always attempt to test the device or a similar prototype before upgrading a device which is in production or is hard to reach. And, as always, make a backup of the device configuration before beginning any firmware update. Note that there is a chance, as with any upgrade, that the device may not function as expected. You must always account for the possibility that you may need to flash the device via the serial programming interface if the OTA upgrade fails. Even with the master release, you should always attempt to test the device or a similar prototype before upgrading a device which is in production or is hard to reach. And, as always, make a backup of the device configuration before beginning any firmware update.
@ -125,6 +125,7 @@ People helping to keep the show on the road:
- Flexiti for his initial timer implementation - Flexiti for his initial timer implementation
- reloxx13 for his [TasmoAdmin](https://github.com/reloxx13/TasmoAdmin) management tool - reloxx13 for his [TasmoAdmin](https://github.com/reloxx13/TasmoAdmin) management tool
- Joachim Banzhaf for his TSL2561 library and driver - Joachim Banzhaf for his TSL2561 library and driver
- Andre Thomas for providing many drivers
- Gijs Noorlander for his MHZ19, SenseAir and updated PubSubClient drivers - Gijs Noorlander for his MHZ19, SenseAir and updated PubSubClient drivers
- Erik Montnemery for his HomeAssistant Discovery concept and many code tuning tips - Erik Montnemery for his HomeAssistant Discovery concept and many code tuning tips
- Federico Leoni for continued HomeAssistant Discovery support - Federico Leoni for continued HomeAssistant Discovery support
@ -136,7 +137,6 @@ People helping to keep the show on the road:
- Gennaro Tortone for implementing and maintaining Eastron drivers - Gennaro Tortone for implementing and maintaining Eastron drivers
- Raymond Mouthaan for managing Wemos Wiki information - Raymond Mouthaan for managing Wemos Wiki information
- Norbert Richter for his [decode-config.py](https://github.com/tasmota/decode-config) tool - Norbert Richter for his [decode-config.py](https://github.com/tasmota/decode-config) tool
- Andre Thomas for providing [thehackbox](http://thehackbox.org/tasmota/) OTA support and daily development builds
- Joel Stein, digiblur and Shantur Rathore for their Tuya research and driver - Joel Stein, digiblur and Shantur Rathore for their Tuya research and driver
- Frogmore42 for providing many issue answers - Frogmore42 for providing many issue answers
- Jason2866 for platformio support and providing many issue answers - Jason2866 for platformio support and providing many issue answers

View File

@ -114,10 +114,6 @@ typedef int SerConfu8;
typedef int SerialConfig; typedef int SerialConfig;
//#define analogWrite(a, b) //#define analogWrite(a, b)
//
// WS2812
//
#define NeoEsp8266BitBang800KbpsMethod NeoEsp32BitBang800KbpsMethod
// //
// UDP // UDP
// //

View File

@ -34,7 +34,9 @@ lib_ignore =
extends = env:tasmota32 extends = env:tasmota32
board = esp32cam board = esp32cam
board_build.f_cpu = 240000000L board_build.f_cpu = 240000000L
build_flags = ${common32.build_flags} -DFIRMWARE_WEBCAM board_build.flash_mode = qio
board_build.f_flash = 80000000L
build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -lc-psram-workaround -lm-psram-workaround -DFIRMWARE_WEBCAM
lib_extra_dirs = lib/libesp32, lib/lib_basic lib_extra_dirs = lib/libesp32, lib/lib_basic
[env:tasmota32-odroidgo] [env:tasmota32-odroidgo]
@ -45,7 +47,7 @@ board_build.flash_mode = qio
board_build.f_flash = 80000000L board_build.f_flash = 80000000L
upload_speed = 2000000 upload_speed = 2000000
board_build.partitions = esp32_partition_app1984k_spiffs12M.csv board_build.partitions = esp32_partition_app1984k_spiffs12M.csv
build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DFIRMWARE_ODROID_GO build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -lc-psram-workaround -lm-psram-workaround -DFIRMWARE_ODROID_GO
lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display
[env:tasmota32-core2] [env:tasmota32-core2]
@ -56,7 +58,7 @@ board_build.flash_mode = qio
board_build.f_flash = 80000000L board_build.f_flash = 80000000L
upload_speed = 2000000 upload_speed = 2000000
board_build.partitions = esp32_partition_app1984k_spiffs12M.csv board_build.partitions = esp32_partition_app1984k_spiffs12M.csv
build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DFIRMWARE_M5STACK_CORE2 build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -lc-psram-workaround -lm-psram-workaround -DFIRMWARE_M5STACK_CORE2
lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display, lib/lib_audio lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display, lib/lib_audio
[env:tasmota32-bluetooth] [env:tasmota32-bluetooth]

View File

@ -330,7 +330,7 @@
#define D_CMND_DEVGROUP_SEND "DevGroupSend" #define D_CMND_DEVGROUP_SEND "DevGroupSend"
#define D_CMND_DEVGROUP_SHARE "DevGroupShare" #define D_CMND_DEVGROUP_SHARE "DevGroupShare"
#define D_CMND_DEVGROUPSTATUS "DevGroupStatus" #define D_CMND_DEVGROUPSTATUS "DevGroupStatus"
#define D_CMND_DEVGROUP_DEVICE "DevGroupTie" #define D_CMND_DEVGROUP_TIE "DevGroupTie"
#define D_CMND_SERIALSEND "SerialSend" #define D_CMND_SERIALSEND "SerialSend"
#define D_CMND_SERIALDELIMITER "SerialDelimiter" #define D_CMND_SERIALDELIMITER "SerialDelimiter"
#define D_CMND_BAUDRATE "Baudrate" #define D_CMND_BAUDRATE "Baudrate"

View File

@ -494,7 +494,9 @@
// -- Optional light modules ---------------------- // -- Optional light modules ----------------------
#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by // #define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
// #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow // #define USE_WS2812_DMA // ESP8266 only, DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
#define USE_WS2812_RMT 0 // ESP32 only, hardware RMT support (default). Specify the RMT channel 0..7. This should be preferred to software bit bang.
// #define USE_WS2812_I2S 0 // ESP32 only, hardware I2S support. Specify the I2S channel 0..2. This is exclusive from RMT. By default, prefer RMT support
// #define USE_WS2812_INVERTED // Use inverted data signal // #define USE_WS2812_INVERTED // Use inverted data signal
#define USE_WS2812_HARDWARE NEO_HW_WS2812 // Hardware type (NEO_HW_WS2812, NEO_HW_WS2812X, NEO_HW_WS2813, NEO_HW_SK6812, NEO_HW_LC8812, NEO_HW_APA106, NEO_HW_P9813) #define USE_WS2812_HARDWARE NEO_HW_WS2812 // Hardware type (NEO_HW_WS2812, NEO_HW_WS2812X, NEO_HW_WS2813, NEO_HW_SK6812, NEO_HW_LC8812, NEO_HW_APA106, NEO_HW_P9813)
#define USE_WS2812_CTYPE NEO_GRB // Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW) #define USE_WS2812_CTYPE NEO_GRB // Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW)

View File

@ -999,6 +999,9 @@ void SettingsDefaultSet2(void) {
Settings.dimmer_step = DEFAULT_DIMMER_STEP; Settings.dimmer_step = DEFAULT_DIMMER_STEP;
// Device Groups
*(uint32_t *)&Settings.device_group_tie = 0x04030201;
// Display // Display
// Settings.display_model = 0; // Settings.display_model = 0;
Settings.display_mode = 1; Settings.display_mode = 1;

View File

@ -1969,7 +1969,8 @@ int8_t I2cWriteBuffer(uint8_t addr, uint8_t reg, uint8_t *reg_data, uint16_t len
return 0; return 0;
} }
void I2cScan(char *devs, unsigned int devs_len) void I2cScan(char *devs, unsigned int devs_len, uint32_t bus = 0);
void I2cScan(char *devs, unsigned int devs_len, uint32_t bus)
{ {
// Return error codes defined in twi.h and core_esp8266_si2c.c // Return error codes defined in twi.h and core_esp8266_si2c.c
// I2C_OK 0 // I2C_OK 0
@ -1984,8 +1985,13 @@ void I2cScan(char *devs, unsigned int devs_len)
snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_JSON_I2CSCAN_DEVICES_FOUND_AT)); snprintf_P(devs, devs_len, PSTR("{\"" D_CMND_I2CSCAN "\":\"" D_JSON_I2CSCAN_DEVICES_FOUND_AT));
for (address = 1; address <= 127; address++) { for (address = 1; address <= 127; address++) {
Wire.beginTransmission(address); #ifdef ESP32
error = Wire.endTransmission(); TwoWire & myWire = (bus == 0) ? Wire : Wire1;
#else
TwoWire & myWire = Wire;
#endif
myWire.beginTransmission(address);
error = myWire.endTransmission();
if (0 == error) { if (0 == error) {
any = 1; any = 1;
snprintf_P(devs, devs_len, PSTR("%s 0x%02x"), devs, address); snprintf_P(devs, devs_len, PSTR("%s 0x%02x"), devs, address);

View File

@ -36,7 +36,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix
#ifdef USE_DEVICE_GROUPS_SEND #ifdef USE_DEVICE_GROUPS_SEND
D_CMND_DEVGROUP_SEND "|" D_CMND_DEVGROUP_SEND "|"
#endif // USE_DEVICE_GROUPS_SEND #endif // USE_DEVICE_GROUPS_SEND
D_CMND_DEVGROUP_SHARE "|" D_CMND_DEVGROUPSTATUS "|" D_CMND_DEVGROUP_DEVICE "|" D_CMND_DEVGROUP_SHARE "|" D_CMND_DEVGROUPSTATUS "|" D_CMND_DEVGROUP_TIE "|"
#endif // USE_DEVICE_GROUPS #endif // USE_DEVICE_GROUPS
D_CMND_SENSOR "|" D_CMND_DRIVER D_CMND_SENSOR "|" D_CMND_DRIVER
#ifdef ESP32 #ifdef ESP32
@ -2071,9 +2071,14 @@ void CmndWifiPower(void)
#ifdef USE_I2C #ifdef USE_I2C
void CmndI2cScan(void) void CmndI2cScan(void)
{ {
if (TasmotaGlobal.i2c_enabled) { if ((1 == XdrvMailbox.index) && (TasmotaGlobal.i2c_enabled)) {
I2cScan(TasmotaGlobal.mqtt_data, sizeof(TasmotaGlobal.mqtt_data)); I2cScan(TasmotaGlobal.mqtt_data, sizeof(TasmotaGlobal.mqtt_data));
} }
#ifdef ESP32
if ((2 == XdrvMailbox.index) && (TasmotaGlobal.i2c_enabled_2)) {
I2cScan(TasmotaGlobal.mqtt_data, sizeof(TasmotaGlobal.mqtt_data), 1);
}
#endif
} }
void CmndI2cDriver(void) void CmndI2cDriver(void)
@ -2138,7 +2143,13 @@ void CmndDevGroupTie(void)
if (XdrvMailbox.data_len > 0) { if (XdrvMailbox.data_len > 0) {
Settings.device_group_tie[XdrvMailbox.index - 1] = XdrvMailbox.payload; Settings.device_group_tie[XdrvMailbox.index - 1] = XdrvMailbox.payload;
} }
ResponseCmndIdxNumber(Settings.device_group_tie[XdrvMailbox.index - 1]); char * ptr = TasmotaGlobal.mqtt_data;
*ptr++ = '{';
for (uint32_t i = 0; i < MAX_DEV_GROUP_NAMES; i++) {
ptr += sprintf(ptr, PSTR("\"%s%u\":%u,"), D_CMND_DEVGROUP_TIE, i + 1, Settings.device_group_tie[i]);
}
*(ptr - 1) = '}';
*ptr = 0;
} }
} }
#endif // USE_DEVICE_GROUPS #endif // USE_DEVICE_GROUPS

View File

@ -1742,6 +1742,12 @@ void GpioInit(void)
if (TasmotaGlobal.i2c_enabled) { if (TasmotaGlobal.i2c_enabled) {
Wire.begin(Pin(GPIO_I2C_SDA), Pin(GPIO_I2C_SCL)); Wire.begin(Pin(GPIO_I2C_SDA), Pin(GPIO_I2C_SCL));
} }
#ifdef ESP32
TasmotaGlobal.i2c_enabled_2 = (PinUsed(GPIO_I2C_SCL, 1) && PinUsed(GPIO_I2C_SDA, 1));
if (TasmotaGlobal.i2c_enabled_2) {
Wire1.begin(Pin(GPIO_I2C_SDA, 1), Pin(GPIO_I2C_SCL, 1));
}
#endif
#endif // USE_I2C #endif // USE_I2C
TasmotaGlobal.devices_present = 0; TasmotaGlobal.devices_present = 0;

View File

@ -84,6 +84,12 @@ const uint8_t MAX_PCF8574 = 4; // Max number of PCF8574 devices
const uint8_t MAX_RULE_SETS = 3; // Max number of rule sets of size 512 characters const uint8_t MAX_RULE_SETS = 3; // Max number of rule sets of size 512 characters
const uint16_t MAX_RULE_SIZE = 512; // Max number of characters in rules const uint16_t MAX_RULE_SIZE = 512; // Max number of characters in rules
#ifdef ESP32
const uint8_t MAX_I2C = 2; // Max number of I2C controllers (ESP32 = 2)
#else
const uint8_t MAX_I2C = 0; // Max number of I2C controllers (ESP8266 = 0, no choice)
#endif
// Changes to the following MAX_ defines need to be in line with enum SettingsTextIndex // Changes to the following MAX_ defines need to be in line with enum SettingsTextIndex
const uint8_t MAX_MQTT_PREFIXES = 3; // Max number of MQTT prefixes (cmnd, stat, tele) const uint8_t MAX_MQTT_PREFIXES = 3; // Max number of MQTT prefixes (cmnd, stat, tele)
const uint8_t MAX_SSIDS = 2; // Max number of SSIDs const uint8_t MAX_SSIDS = 2; // Max number of SSIDs

View File

@ -141,6 +141,9 @@ struct {
bool blinkstate; // LED state bool blinkstate; // LED state
bool pwm_present; // Any PWM channel configured with SetOption15 0 bool pwm_present; // Any PWM channel configured with SetOption15 0
bool i2c_enabled; // I2C configured bool i2c_enabled; // I2C configured
#ifdef ESP32
bool i2c_enabled_2; // I2C configured, second controller on ESP32, Wire1
#endif
bool ntp_force_sync; // Force NTP sync bool ntp_force_sync; // Force NTP sync
bool skip_light_fade; // Temporarily skip light fading bool skip_light_fade; // Temporarily skip light fading
bool restart_halt; // Do not restart but stay in wait loop bool restart_halt; // Do not restart but stay in wait loop

View File

@ -386,8 +386,8 @@ const uint16_t kGpioNiceList[] PROGMEM = {
\*-------------------------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------------------------*/
#ifdef USE_I2C #ifdef USE_I2C
AGPIO(GPIO_I2C_SCL), // I2C SCL AGPIO(GPIO_I2C_SCL) + MAX_I2C, // I2C SCL
AGPIO(GPIO_I2C_SDA), // I2C SDA AGPIO(GPIO_I2C_SDA) + MAX_I2C, // I2C SDA
#endif #endif
#ifdef USE_SPI #ifdef USE_SPI

View File

@ -2210,7 +2210,7 @@ void LightHandleDevGroupItem(void)
static bool send_state = false; static bool send_state = false;
static bool restore_power = false; static bool restore_power = false;
if (Settings.device_group_tie[*XdrvMailbox.topic] != Light.device) return; if (Settings.flag4.multiple_device_groups ? Settings.device_group_tie[*XdrvMailbox.topic] != Light.device : !(XdrvMailbox.index & DGR_FLAG_LOCAL)) return;
bool more_to_come; bool more_to_come;
uint32_t value = XdrvMailbox.payload; uint32_t value = XdrvMailbox.payload;
switch (XdrvMailbox.command_code) { switch (XdrvMailbox.command_code) {

View File

@ -47,81 +47,106 @@ void (* const Ws2812Command[])(void) PROGMEM = {
#include <NeoPixelBus.h> #include <NeoPixelBus.h>
#if (USE_WS2812_HARDWARE == NEO_HW_P9813)
typedef P9813BgrFeature selectedNeoFeatureType;
#undef USE_WS2812_DMA
#undef USE_WS2812_INVERTED
#elif (USE_WS2812_CTYPE == NEO_GRB)
typedef NeoGrbFeature selectedNeoFeatureType;
#elif (USE_WS2812_CTYPE == NEO_BRG)
typedef NeoBrgFeature selectedNeoFeatureType;
#elif (USE_WS2812_CTYPE == NEO_RBG)
typedef NeoRbgFeature selectedNeoFeatureType;
#elif (USE_WS2812_CTYPE == NEO_RGBW)
typedef NeoRgbwFeature selectedNeoFeatureType;
#elif (USE_WS2812_CTYPE == NEO_GRBW)
typedef NeoGrbwFeature selectedNeoFeatureType;
#else // USE_WS2812_CTYPE
typedef NeoRgbFeature selectedNeoFeatureType;
#endif // USE_WS2812_CTYPE
#ifdef USE_WS2812_DMA
#ifdef USE_WS2812_INVERTED
// See NeoEspDmaMethod.h for available options // See NeoEspDmaMethod.h for available options
#if (USE_WS2812_HARDWARE == NEO_HW_WS2812X)
typedef NeoEsp8266DmaInvertedWs2812xMethod selectedNeoSpeedType;
#elif (USE_WS2812_HARDWARE == NEO_HW_SK6812)
typedef NeoEsp8266DmaInvertedSk6812Method selectedNeoSpeedType;
#elif (USE_WS2812_HARDWARE == NEO_HW_APA106)
typedef NeoEsp8266DmaInvertedApa106Method selectedNeoSpeedType;
#else // USE_WS2812_HARDWARE
typedef NeoEsp8266DmaInverted800KbpsMethod selectedNeoSpeedType;
#endif // USE_WS2812_HARDWARE
#else // No USE_WS2812_INVERTED
#if (USE_WS2812_HARDWARE == NEO_HW_WS2812X)
typedef NeoEsp8266DmaWs2812xMethod selectedNeoSpeedType;
#elif (USE_WS2812_HARDWARE == NEO_HW_SK6812)
typedef NeoEsp8266DmaSk6812Method selectedNeoSpeedType;
#elif (USE_WS2812_HARDWARE == NEO_HW_APA106)
typedef NeoEsp8266DmaApa106Method selectedNeoSpeedType;
#else // USE_WS2812_HARDWARE
typedef NeoEsp8266Dma800KbpsMethod selectedNeoSpeedType;
#endif // USE_WS2812_HARDWARE
#endif // No USE_WS2812_INVERTED
#else // No USE_WS2812_DMA
#ifdef USE_WS2812_INVERTED
// See NeoEspBitBangMethod.h for available options // See NeoEspBitBangMethod.h for available options
// Build `selectedNeoFeatureType` as Neo-Rgb-Feature
// parametrized as: NEO_FEATURE_NEO+NEO_FEATURE_TYPE+NEO_FEATURE_FEATURE
#define CONCAT2(A,B) CONCAT2_(A,B) // ensures expansion first, see https://stackoverflow.com/questions/3221896/how-can-i-guarantee-full-macro-expansion-of-a-parameter-before-paste
#define CONCAT2_(A,B) A ## B
#define CONCAT3(A,B,C) CONCAT3_(A,B,C) // ensures expansion first, see https://stackoverflow.com/questions/3221896/how-can-i-guarantee-full-macro-expansion-of-a-parameter-before-paste
#define CONCAT3_(A,B,C) A ## B ## C
#define NEO_FEATURE_NEO Neo
#define NEO_FEATURE_FEATURE Feature
// select the right Neo feature based on USE_WS2812_CTYPE
// NEO_FEATURE_TYPE can be one of: Rgb (default), Grb, Brg, Rgb, Rgbw, Grbw
#if (USE_WS2812_CTYPE == NEO_GRB)
#define NEO_FEATURE_TYPE Grb
#elif (USE_WS2812_CTYPE == NEO_BRG)
#define NEO_FEATURE_TYPE Brg
#elif (USE_WS2812_CTYPE == NEO_RBG)
#define NEO_FEATURE_TYPE Rbg
#elif (USE_WS2812_CTYPE == NEO_RGBW)
#define NEO_FEATURE_TYPE Rbgw
#elif (USE_WS2812_CTYPE == NEO_GRBW)
#define NEO_FEATURE_TYPE Grbw
#else
#define NEO_FEATURE_TYPE Rgb
#endif
// Exception for NEO_HW_P9813
#if (USE_WS2812_HARDWARE == NEO_HW_P9813)
#undef NEO_FEATURE_NEO
#undef NEO_FEATURE_TYPE
#define NEO_FEATURE_NEO P9813 // P9813BgrFeature
#define NEO_FEATURE_TYPE Bgr
#undef USE_WS2812_DMA
#undef USE_WS2812_INVERTED
#endif // USE_WS2812_CTYPE
typedef CONCAT3(NEO_FEATURE_NEO,NEO_FEATURE_TYPE,NEO_FEATURE_FEATURE) selectedNeoFeatureType;
// selectedNeoSpeedType is built as Neo+Esp8266+Dma+Inverted+Ws2812x+Method
// Or NEO_NEO+NEO_CHIP+NEO_PROTO+NEO_INV+NEO_HW+Method
#define CONCAT6(A,B,C,D,E,F) CONCAT6_(A,B,C,D,E,F) // ensures expansion first, see https://stackoverflow.com/questions/3221896/how-can-i-guarantee-full-macro-expansion-of-a-parameter-before-paste
#define CONCAT6_(A,B,C,D,E,F) A ## B ## C ## D ## E ## F
#define NEO_NEO Neo
#ifdef ESP32
#define NEO_CHIP Esp32
#else
#define NEO_CHIP Esp8266
#endif
// Proto = DMA or BigBang
#if defined(USE_WS2812_DMA) && defined(ESP8266)
#define NEO_PROTO Dma
#elif defined(USE_WS2812_RMT) && defined(ESP32)
#define NEO_PROTO CONCAT2(Rmt,USE_WS2812_RMT)
#elif defined(USE_WS2812_I2S) && defined(ESP32)
#define NEO_PROTO CONCAT2(I2s,USE_WS2812_I2S)
#else
#define NEO_PROTO BitBang
#endif
#ifdef USE_WS2812_INVERTED
#define NEO_INV Inverted
#else
#define NEO_INV
#endif
#if (USE_WS2812_HARDWARE == NEO_HW_WS2812X) #if (USE_WS2812_HARDWARE == NEO_HW_WS2812X)
typedef NeoEsp8266BitBangWs2812xInvertedMethod selectedNeoSpeedType; #define NEO_HW Ws2812x
#elif (USE_WS2812_HARDWARE == NEO_HW_SK6812) #elif (USE_WS2812_HARDWARE == NEO_HW_SK6812)
typedef NeoEsp8266BitBangSk6812InvertedMethod selectedNeoSpeedType; #define NEO_HW Sk6812
#elif (USE_WS2812_HARDWARE == NEO_HW_APA106)
#define NEO_HW Apa106
#else // USE_WS2812_HARDWARE #else // USE_WS2812_HARDWARE
typedef NeoEsp8266BitBang400KbpsInvertedMethod selectedNeoSpeedType; #define NEO_HW 800Kbps
#endif // USE_WS2812_HARDWARE #endif // USE_WS2812_HARDWARE
#else // No USE_WS2812_INVERTED
#if (USE_WS2812_HARDWARE == NEO_HW_P9813) #if (USE_WS2812_HARDWARE == NEO_HW_P9813)
typedef P9813Method selectedNeoSpeedType; #undef NEO_NEO
#elif (USE_WS2812_HARDWARE == NEO_HW_WS2812X) #define NEO_NEO
typedef NeoEsp8266BitBangWs2812xMethod selectedNeoSpeedType; #undef NEO_CHIP
#elif (USE_WS2812_HARDWARE == NEO_HW_SK6812) #define NEO_CHIP
typedef NeoEsp8266BitBangSk6812Method selectedNeoSpeedType; #undef NEO_PROTO
#else // USE_WS2812_HARDWARE #define NEO_PROTO
typedef NeoEsp8266BitBang800KbpsMethod selectedNeoSpeedType; #undef NEO_INV
#endif // USE_WS2812_HARDWARE #define NEO_INV
#undef NEO_HW
#define NEO_HW P9813 // complete driver is P9813Method
#endif
#endif // No USE_WS2812_INVERTED #if defined(ESP8266) && defined(USE_WS2812_DMA)
typedef CONCAT6(NEO_NEO,NEO_CHIP,NEO_PROTO,NEO_INV,NEO_HW,Method) selectedNeoSpeedType;
#endif // No USE_WS2812_DMA #else // Dma : different naming scheme
typedef CONCAT6(NEO_NEO,NEO_CHIP,NEO_PROTO,NEO_HW,NEO_INV,Method) selectedNeoSpeedType;
#endif
NeoPixelBus<selectedNeoFeatureType, selectedNeoSpeedType> *strip = nullptr; NeoPixelBus<selectedNeoFeatureType, selectedNeoSpeedType> *strip = nullptr;