Final fix for ESP32 WS2812

This commit is contained in:
Stephan Hadinger 2021-11-29 21:35:20 +01:00
parent 990065df69
commit dbe0cdeaa3
1 changed files with 7 additions and 1 deletions

View File

@ -50,6 +50,12 @@ extern "C"
#include <driver/rmt.h>
}
#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));
}