From 0c40db9fd8c3587aa6101c3a430eb007a36bb4bc Mon Sep 17 00:00:00 2001 From: Andrijan Ostrun Date: Thu, 25 Mar 2021 12:54:54 +0100 Subject: [PATCH 1/2] Fixed RMT Init gpio pin --- .../FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp | 4 ++-- components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp index fa657f8..b738426 100644 --- a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp +++ b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp @@ -276,13 +276,13 @@ void ESP32RMTController::init() // NOTE: In ESP-IDF 4.1++, there is a #define to init, but that doesn't exist // in earlier versions #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 1, 0) - rmt_config_t rmt_tx = RMT_DEFAULT_CONFIG_TX(gpio_num_t(0), rmt_channel); + rmt_config_t rmt_tx = RMT_DEFAULT_CONFIG_TX(gpio_num_t(mPin), rmt_channel); #else rmt_config_t rmt_tx; memset((void*) &rmt_tx, 0, sizeof(rmt_tx)); rmt_tx.channel = rmt_channel; rmt_tx.rmt_mode = RMT_MODE_TX; - rmt_tx.gpio_num = gpio_num_t(0); // The particular pin will be assigned later + rmt_tx.gpio_num = gpio_num_t(mPin); #endif rmt_tx.mem_block_num = MEM_BLOCK_NUM; diff --git a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.h b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.h index a9b5e30..e358774 100644 --- a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.h +++ b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.h @@ -248,7 +248,7 @@ class ESP32RMTController // -- Initialize RMT subsystem // This only needs to be done once - static void init(); + void init(); // -- Show this string of pixels // This is the main entry point for the pixel controller From 8bcdfac5ba61a377c6ddae95f585a198d044d60c Mon Sep 17 00:00:00 2001 From: Andrijan Ostrun Date: Thu, 25 Mar 2021 13:04:16 +0100 Subject: [PATCH 2/2] Removed unnecessary gpio_num_t --- .../FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp index b738426..23f144b 100644 --- a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp +++ b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp @@ -276,13 +276,13 @@ void ESP32RMTController::init() // NOTE: In ESP-IDF 4.1++, there is a #define to init, but that doesn't exist // in earlier versions #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 1, 0) - rmt_config_t rmt_tx = RMT_DEFAULT_CONFIG_TX(gpio_num_t(mPin), rmt_channel); + rmt_config_t rmt_tx = RMT_DEFAULT_CONFIG_TX(mPin, rmt_channel); #else rmt_config_t rmt_tx; memset((void*) &rmt_tx, 0, sizeof(rmt_tx)); rmt_tx.channel = rmt_channel; rmt_tx.rmt_mode = RMT_MODE_TX; - rmt_tx.gpio_num = gpio_num_t(mPin); + rmt_tx.gpio_num = mPin; #endif rmt_tx.mem_block_num = MEM_BLOCK_NUM;