Added support for old and new IDF

This commit is contained in:
2022-01-03 17:12:02 +01:00
parent 5a3c3866d1
commit a18abff773
2 changed files with 8 additions and 0 deletions

View File

@@ -429,7 +429,11 @@ void ESP32RMTController::startOnChannel(int channel)
mRMT_channel = rmt_channel_t(channel * MEM_BLOCK_NUM);
// -- Assign the pin to this channel
#ifdef OLD_IDF
rmt_set_pin(mRMT_channel, RMT_MODE_TX, mPin);
#else
rmt_set_gpio(mRMT_channel, RMT_MODE_TX, mPin, false);
#endif
if (FASTLED_RMT_BUILTIN_DRIVER) {
// -- Use the built-in RMT driver to send all the data in one shot

View File

@@ -113,11 +113,15 @@ FASTLED_NAMESPACE_BEGIN
extern "C" {
#endif
#include "esp_idf_version.h"
//#include "esp32-hal.h"
#include "esp_intr_alloc.h"
#include "driver/gpio.h"
#include "driver/rmt.h"
#ifdef OLD_IDF
#else
#include "esp_private/periph_ctrl.h"
#endif
#include "freertos/semphr.h"
#include "soc/rmt_struct.h"