Skip to content

Commit 86473a8

Browse files
committed
RMTHI backport to NPB 2.7.9
fingers crossed
1 parent 4c6b352 commit 86473a8

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

lib/NeoESP32RmtHI/include/NeoEsp32RmtHIMethod.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ License along with NeoPixel. If not, see
3333
// Use the NeoEspRmtSpeed types from the driver-based implementation
3434
#include <NeoPixelBus.h>
3535

36+
#if !defined(ESP_ERROR_CHECK_WITHOUT_ABORT_SILENT_TIMEOUT)
37+
// macro backported from NPB 2.8.3
38+
#if defined NDEBUG || defined CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
39+
#define ESP_ERROR_CHECK_WITHOUT_ABORT_SILENT_TIMEOUT(x) ({ \
40+
esp_err_t err_rc_ = (x); \
41+
err_rc_; \
42+
})
43+
#else
44+
#define ESP_ERROR_CHECK_WITHOUT_ABORT_SILENT_TIMEOUT(x) ({ \
45+
esp_err_t err_rc_ = (x); \
46+
if (unlikely(err_rc_ != ESP_OK && err_rc_ != ESP_ERR_TIMEOUT)) { \
47+
_esp_error_check_failed_without_abort(err_rc_, __FILE__, __LINE__, \
48+
__ASSERT_FUNC, #x); \
49+
} \
50+
err_rc_; \
51+
})
52+
#endif // NDEBUG
53+
#endif
3654

3755
namespace NeoEsp32RmtHiMethodDriver {
3856
// Install the driver for a specific channel, specifying timing properties

lib/NeoESP32RmtHI/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"owner": "makuna",
88
"name": "NeoPixelBus",
9-
"version": "^2.8.3"
9+
"version": "^2.7.9"
1010
}
1111
]
1212
}

wled00/bus_wrapper.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,21 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
183183
#define B_8266_BB_UCS_4 NeoPixelBusLg<NeoRgbwUcs8904Feature, NeoEsp8266BitBang800KbpsMethod, NeoGammaNullMethod> //4 chan, esp8266, bb (any pin)
184184
#endif
185185

186+
187+
// RMT driver selection
188+
#if !defined(WLED_USE_SHARED_RMT) && !defined(__riscv) && defined(ARDUINO_ARCH_ESP32) && (ESP_IDF_VERSION_MAJOR >= 4)
189+
190+
#include <NeoEsp32RmtHIMethod.h>
191+
#define NeoEsp32RmtMethod(x) NeoEsp32RmtHIN ## x ## Method
192+
#else
193+
#define NeoEsp32RmtMethod(x) NeoEsp32RmtN ## x ## Method
194+
#endif
195+
196+
186197
/*** ESP32 Neopixel methods ***/
187198
#ifdef ARDUINO_ARCH_ESP32
188199
//RGB
189-
#define B_32_RN_NEO_3 NeoPixelBusLg<NeoGrbFeature, NeoEsp32RmtNWs2812xMethod, NeoGammaNullMethod>
200+
#define B_32_RN_NEO_3 NeoPixelBusLg<NeoGrbFeature, NeoEsp32RmtMethod(Ws2812x), NeoGammaNullMethod>
190201
#ifndef WLED_NO_I2S0_PIXELBUS
191202
#define B_32_I0_NEO_3 NeoPixelBusLg<NeoGrbFeature, NeoEsp32I2s0800KbpsMethod, NeoGammaNullMethod>
192203
#endif
@@ -195,7 +206,7 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
195206
#endif
196207
//#define B_32_BB_NEO_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32BitBang800KbpsMethod> // NeoEsp8266BitBang800KbpsMethod
197208
//RGBW
198-
#define B_32_RN_NEO_4 NeoPixelBusLg<NeoGrbwFeature, NeoEsp32RmtNWs2812xMethod, NeoGammaNullMethod>
209+
#define B_32_RN_NEO_4 NeoPixelBusLg<NeoGrbwFeature, NeoEsp32RmtMethod(Ws2812x), NeoGammaNullMethod>
199210
#ifndef WLED_NO_I2S0_PIXELBUS
200211
#define B_32_I0_NEO_4 NeoPixelBusLg<NeoGrbwFeature, NeoEsp32I2s0800KbpsMethod, NeoGammaNullMethod>
201212
#endif
@@ -204,7 +215,7 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
204215
#endif
205216
//#define B_32_BB_NEO_4 NeoPixelBrightnessBus<NeoGrbwFeature, NeoEsp32BitBang800KbpsMethod> // NeoEsp8266BitBang800KbpsMethod
206217
//400Kbps
207-
#define B_32_RN_400_3 NeoPixelBusLg<NeoGrbFeature, NeoEsp32RmtN400KbpsMethod, NeoGammaNullMethod>
218+
#define B_32_RN_400_3 NeoPixelBusLg<NeoGrbFeature, NeoEsp32RmtMethod(400Kbps), NeoGammaNullMethod>
208219
#ifndef WLED_NO_I2S0_PIXELBUS
209220
#define B_32_I0_400_3 NeoPixelBusLg<NeoGrbFeature, NeoEsp32I2s0400KbpsMethod, NeoGammaNullMethod>
210221
#endif
@@ -213,7 +224,7 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
213224
#endif
214225
//#define B_32_BB_400_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32BitBang400KbpsMethod> // NeoEsp8266BitBang400KbpsMethod
215226
//TM1814 (RGBW)
216-
#define B_32_RN_TM1_4 NeoPixelBusLg<NeoWrgbTm1814Feature, NeoEsp32RmtNTm1814Method, NeoGammaNullMethod>
227+
#define B_32_RN_TM1_4 NeoPixelBusLg<NeoWrgbTm1814Feature, NeoEsp32RmtMethod(Tm1814), NeoGammaNullMethod>
217228
#ifndef WLED_NO_I2S0_PIXELBUS
218229
#define B_32_I0_TM1_4 NeoPixelBusLg<NeoWrgbTm1814Feature, NeoEsp32I2s0Tm1814Method, NeoGammaNullMethod>
219230
#endif
@@ -222,7 +233,7 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
222233
#endif
223234
//Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S)
224235
//TM1829 (RGB)
225-
#define B_32_RN_TM2_3 NeoPixelBusLg<NeoBrgFeature, NeoEsp32RmtNTm1829Method, NeoGammaNullMethod>
236+
#define B_32_RN_TM2_3 NeoPixelBusLg<NeoBrgFeature, NeoEsp32RmtMethod(Tm1829), NeoGammaNullMethod>
226237
#ifndef WLED_NO_I2S0_PIXELBUS
227238
#define B_32_I0_TM2_3 NeoPixelBusLg<NeoBrgFeature, NeoEsp32I2s0Tm1829Method, NeoGammaNullMethod>
228239
#endif
@@ -231,7 +242,7 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
231242
#endif
232243
//Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S)
233244
//UCS8903
234-
#define B_32_RN_UCS_3 NeoPixelBusLg<NeoRgbUcs8903Feature, NeoEsp32RmtNWs2812xMethod, NeoGammaNullMethod>
245+
#define B_32_RN_UCS_3 NeoPixelBusLg<NeoRgbUcs8903Feature, NeoEsp32RmtMethod(Ws2812x), NeoGammaNullMethod>
235246
#ifndef WLED_NO_I2S0_PIXELBUS
236247
#define B_32_I0_UCS_3 NeoPixelBusLg<NeoRgbUcs8903Feature, NeoEsp32I2s0800KbpsMethod, NeoGammaNullMethod>
237248
#endif
@@ -240,7 +251,7 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca
240251
#endif
241252
//Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S)
242253
//UCS8904
243-
#define B_32_RN_UCS_4 NeoPixelBusLg<NeoRgbwUcs8904Feature, NeoEsp32RmtNWs2812xMethod, NeoGammaNullMethod>
254+
#define B_32_RN_UCS_4 NeoPixelBusLg<NeoRgbwUcs8904Feature, NeoEsp32RmtMethod(Ws2812x), NeoGammaNullMethod>
244255
#ifndef WLED_NO_I2S0_PIXELBUS
245256
#define B_32_I0_UCS_4 NeoPixelBusLg<NeoRgbwUcs8904Feature, NeoEsp32I2s0800KbpsMethod, NeoGammaNullMethod>
246257
#endif

0 commit comments

Comments
 (0)