diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 71cd3a6f..e329c4e8 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -10,6 +10,20 @@ #include "bus_wrapper.h" #include +// enable additional debug output +#ifdef WLED_DEBUG + #ifndef ESP8266 + #include + #endif + #define DEBUG_PRINT(x) Serial.print(x) + #define DEBUG_PRINTLN(x) Serial.println(x) + #define DEBUG_PRINTF(x...) Serial.printf(x) +#else + #define DEBUG_PRINT(x) + #define DEBUG_PRINTLN(x) + #define DEBUG_PRINTF(x...) +#endif + #define GET_BIT(var,bit) (((var)>>(bit))&0x01) #define SET_BIT(var,bit) ((var)|=(uint16_t)(0x0001<<(bit))) #define UNSET_BIT(var,bit) ((var)&=(~(uint16_t)(0x0001<<(bit)))) @@ -29,7 +43,8 @@ struct BusConfig { type = busType & 0x7F; // bit 7 may be/is hacked to include RGBW info (1=RGBW, 0=RGB) count = len; start = pstart; colorOrder = pcolorOrder; reversed = rev; skipAmount = skip; uint8_t nPins = 1; - if (type > 47) nPins = 2; + if (type == 2 || type == 3) nPins = 4; + else if (type > 47) nPins = 2; else if (type > 40 && type < 46) nPins = NUM_PWM_PINS(type); for (uint8_t i = 0; i < nPins; i++) pins[i] = ppins[i]; } @@ -404,6 +419,13 @@ class BusVirtual : public Bus { } } + uint8_t getPins(uint8_t* pinArray) { + for (uint8_t i = 0; i < 4; i++) { + pinArray[i] = _client[i]; + } + return 4; + } + inline bool isRgbw() { return _rgbw; } diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 9e5dd49f..c52f22b3 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -37,7 +37,7 @@ var nm = LCs[i].name.substring(0,2); // ignore IP address if (nm=="L0" || nm=="L1" || nm=="L2" || nm=="L3") { - var n =s[i].name.substring(2); + var n = LCs[i].name.substring(2); var t = parseInt(d.getElementsByName("LT"+n)[0].value, 10); // LED type SELECT if (t==2 || t==3) continue; } @@ -50,13 +50,14 @@ for (j=i+1; jBack // Autogenerated from wled00/data/settings_leds.htm, do not edit!! const char PAGE_settings_leds[] PROGMEM = R"=====(LED Settings