From dbe0cdeaa350086f6570d469cf205107bde4336b Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 29 Nov 2021 21:35:20 +0100 Subject: [PATCH] Final fix for ESP32 WS2812 --- .../NeoPixelBus/src/internal/NeoEsp32RmtMethod.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h index 2d1f184d8..2ed7e4a0e 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h @@ -50,6 +50,12 @@ extern "C" #include } +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) +#define NEOPIXELBUS_RMT_INT_FLAGS (ESP_INTR_FLAG_LOWMED) +#else +#define NEOPIXELBUS_RMT_INT_FLAGS (ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_LEVEL1) +#endif + class NeoEsp32RmtSpeed { public: @@ -554,7 +560,7 @@ public: config.clk_div = T_SPEED::RmtClockDivider; ESP_ERROR_CHECK(rmt_config(&config)); - ESP_ERROR_CHECK(rmt_driver_install(_channel.RmtChannelNumber, 0, 0)); + ESP_ERROR_CHECK(rmt_driver_install(_channel.RmtChannelNumber, 0, NEOPIXELBUS_RMT_INT_FLAGS)); ESP_ERROR_CHECK(rmt_translator_init(_channel.RmtChannelNumber, T_SPEED::Translate)); }