55// PIN CONFIGURATION
66#define LEDPIN 2 // strip pin. Any for ESP32, gpio2 or 3 is recommended for ESP8266 (gpio2/3 are labeled D4/RX on NodeMCU and Wemos)
77// #define USE_APA102 // Uncomment for using APA102 LEDs.
8- #define BTNPIN -1 // button pin. Needs to have pullup (gpio0 recommended)
9- #define IR_PIN 0 // infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
8+ #ifdef WLED_USE_H801
9+ #define BTNPIN -1 // button pin. Needs to have pullup (gpio0 recommended)
10+ #define IR_PIN 0 // infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
11+ #else
12+ #define BTNPIN 0 // button pin. Needs to have pullup (gpio0 recommended)
13+ #define IR_PIN 4 // infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
14+ #endif
1015#define RLYPIN -1 // pin for relay, will be set HIGH if LEDs are on (-1 to disable). Also usable for standby leds, triggers,...
1116#define AUXPIN -1 // debug auxiliary output pin (-1 to disable)
1217
2025 #endif
2126#endif
2227
23- #ifndef WLED_DISABLE_ANALOG_LEDS
28+ #ifdef WLED_USE_ANALOG_LEDS
2429 // PWM pins - PINs 15,13,12,14 (W2 = 04)are used with H801 Wifi LED Controller
25- #define RPIN 15 // R pin for analog LED strip
26- #define GPIN 13 // G pin for analog LED strip
27- #define BPIN 12 // B pin for analog LED strip
28- #define WPIN 14 // W pin for analog LED strip (W1: 14, W2: 04)
29- #define W2PIN 04 // W2 pin for analog LED strip
30- //
31- /* PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
32- #define RPIN 5 //R pin for analog LED strip
33- #define GPIN 12 //G pin for analog LED strip
34- #define BPIN 13 //B pin for analog LED strip
35- #define WPIN 15 //W pin for analog LED strip (W1: 14, W2: 04)
36- */
30+ #ifdef WLED_USE_H801
31+ #define RPIN 15 // R pin for analog LED strip
32+ #define GPIN 13 // G pin for analog LED strip
33+ #define BPIN 12 // B pin for analog LED strip
34+ #define WPIN 14 // W pin for analog LED strip (W1: 14, W2: 04)
35+ #define W2PIN 04 // W2 pin for analog LED strip
36+ #else
37+ // PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
38+ #define RPIN 5 // R pin for analog LED strip
39+ #define GPIN 12 // G pin for analog LED strip
40+ #define BPIN 15 // B pin for analog LED strip
41+ #define WPIN 13 // W pin for analog LED strip (W1: 14, W2: 04)
42+ #endif
3743#endif
3844
3945// automatically uses the right driver method for each platform
@@ -120,7 +126,7 @@ class NeoPixelWrapper
120126 _pGrbw->Begin ();
121127 break ;
122128
123- #ifndef WLED_DISABLE_ANALOG_LEDS
129+ #ifdef WLED_USE_ANALOG_LEDS
124130 // init PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
125131 pinMode (RPIN, OUTPUT);
126132 pinMode (GPIN, OUTPUT);
@@ -140,7 +146,7 @@ class NeoPixelWrapper
140146 }
141147 }
142148
143- #ifndef WLED_DISABLE_ANALOG_LEDS
149+ #ifdef WLED_USE_ANALOG_LEDS
144150 void SetRgbwPwm (uint8_t r, uint8_t g, uint8_t b, uint8_t w, uint8_t w2=0 )
145151 {
146152 analogWrite (RPIN, r);
@@ -164,7 +170,7 @@ class NeoPixelWrapper
164170 {
165171 case NeoPixelType_Grb: {
166172 _pGrb->Show ();
167- #ifndef WLED_DISABLE_ANALOG_LEDS
173+ #ifdef WLED_USE_ANALOG_LEDS
168174 RgbColor color = _pGrb->GetPixelColor (0 );
169175 b = _pGrb->GetBrightness ();
170176 SetRgbwPwm (color.R * b / 255 , color.G * b / 255 , color.B * b / 255 , 0 );
@@ -173,7 +179,7 @@ class NeoPixelWrapper
173179 break ;
174180 case NeoPixelType_Grbw: {
175181 _pGrbw->Show ();
176- #ifndef WLED_DISABLE_ANALOG_LEDS
182+ #ifdef WLED_USE_ANALOG_LEDS
177183 RgbwColor colorW = _pGrbw->GetPixelColor (0 );
178184 b = _pGrbw->GetBrightness ();
179185 // check color values for Warm / COld white mix (for RGBW) // EsplanexaDevice.cpp
0 commit comments