Skip to content

Commit 0fde069

Browse files
committed
(experimental) fix for upstream wled#5152
SPI-based LEDs _must_ use HSPI (not VSPI) on esp32 ethernet boards. wled#5152
1 parent a502e39 commit 0fde069

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

wled00/bus_wrapper.h

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -262,41 +262,43 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
262262

263263
#endif
264264

265-
//APA102
265+
// SPI based drivers
266266
#if defined(WLED_USE_ETHERNET) || (defined(BOARD_HAS_PSRAM) && defined(CONFIG_SPIRAM_OCCUPY_VSPI_HOST) && (defined(CONFIG_SPIRAM_TYPE_ESPPSRAM32) || defined(CONFIG_SPIRAM_TYPE_AUTO)))
267267
// fix for #2542 (by @BlackBird77)
268268
// fix for esp32 with PSRAM: if SPI RAM is of type 32MBit, one of the SPI hosts (HSPI or VSPI) will be occupied by the system. Application code should never touch this SPI host.
269269
#define B_HS_DOT_3 NeoPixelBusLg<DotStarBgrFeature, DotStarEsp32HspiHzMethod, NeoGammaNullMethod> //hardware HSPI (was DotStarEsp32DmaHspi5MhzMethod in NPB @ 2.6.9)
270-
#warning "APA102 cannot use VSPI, falling back to HSPI"
270+
#define B_HS_WS1_3 NeoPixelBusLg<NeoRbgFeature, Ws2801MethodBase<TwoWireHspiImple<SpiSpeedHz>>, NeoGammaNullMethod>
271+
#define B_HS_LPD_3 NeoPixelBusLg<Lpd8806GrbFeature, Lpd8806MethodBase<TwoWireHspiImple<SpiSpeedHz>>, NeoGammaNullMethod>
272+
#define B_HS_LPO_3 NeoPixelBusLg<Lpd6803GrbFeature, Lpd6803MethodBase<TwoWireHspiImple<SpiSpeedHz>>, NeoGammaNullMethod>
273+
#define B_HS_P98_3 NeoPixelBusLg<P9813BgrFeature, P9813MethodBase<TwoWireHspiImple<SpiSpeedHz>>, NeoGammaNullMethod>
274+
#warning "APA102 and other SPI based LEDs cannot use VSPI, falling back to HSPI"
271275
#if CONFIG_SPIRAM_OCCUPY_HSPI_HOST
272276
#warning "APA102 uses HSPI driver which might be needed for PSRAM"
273277
#endif
274278
#else
275279
#define B_HS_DOT_3 NeoPixelBusLg<DotStarBgrFeature, DotStarSpiHzMethod, NeoGammaNullMethod> //hardware VSPI
280+
#define B_HS_WS1_3 NeoPixelBusLg<NeoRbgFeature, Ws2801SpiHzMethod, NeoGammaNullMethod>
281+
#define B_HS_LPD_3 NeoPixelBusLg<Lpd8806GrbFeature, Lpd8806SpiHzMethod, NeoGammaNullMethod>
282+
#define B_HS_LPO_3 NeoPixelBusLg<Lpd6803GrbFeature, Lpd6803SpiHzMethod, NeoGammaNullMethod>
283+
#define B_HS_P98_3 NeoPixelBusLg<P9813BgrFeature, P9813SpiHzMethod, NeoGammaNullMethod>
276284
#if CONFIG_SPIRAM_OCCUPY_VSPI_HOST
277285
#warning "APA102 uses VSPI driver which might be needed for PSRAM"
278286
#endif
279287
#endif
280-
#define B_SS_DOT_3 NeoPixelBusLg<DotStarBgrFeature, DotStarMethod, NeoGammaNullMethod> //soft SPI
281288

282-
//LPD8806
283-
#define B_HS_LPD_3 NeoPixelBusLg<Lpd8806GrbFeature, Lpd8806SpiHzMethod, NeoGammaNullMethod>
289+
//APA102 soft SPI
290+
#define B_SS_DOT_3 NeoPixelBusLg<DotStarBgrFeature, DotStarMethod, NeoGammaNullMethod>
291+
292+
//LPD8806 soft SPI
284293
#define B_SS_LPD_3 NeoPixelBusLg<Lpd8806GrbFeature, Lpd8806Method, NeoGammaNullMethod>
285294

286-
//LPD6803
287-
#define B_HS_LPO_3 NeoPixelBusLg<Lpd6803GrbFeature, Lpd6803SpiHzMethod, NeoGammaNullMethod>
295+
//LPD6803 soft SPI
288296
#define B_SS_LPO_3 NeoPixelBusLg<Lpd6803GrbFeature, Lpd6803Method, NeoGammaNullMethod>
289297

290-
//WS2801
291-
#ifdef WLED_USE_ETHERNET
292-
#define B_HS_WS1_3 NeoPixelBusLg<NeoRbgFeature, Ws2801MethodBase<TwoWireHspiImple<SpiSpeedHz>>, NeoGammaNullMethod>
293-
#else
294-
#define B_HS_WS1_3 NeoPixelBusLg<NeoRbgFeature, Ws2801SpiHzMethod, NeoGammaNullMethod>
295-
#endif
298+
//WS2801 soft SPI
296299
#define B_SS_WS1_3 NeoPixelBusLg<NeoRbgFeature, Ws2801Method, NeoGammaNullMethod>
297300

298-
//P9813
299-
#define B_HS_P98_3 NeoPixelBusLg<P9813BgrFeature, P9813SpiHzMethod, NeoGammaNullMethod>
301+
//P9813 soft SPI
300302
#define B_SS_P98_3 NeoPixelBusLg<P9813BgrFeature, P9813Method, NeoGammaNullMethod>
301303

302304
// 48bit & 64bit to 24bit & 32bit RGB(W) conversion

0 commit comments

Comments
 (0)