Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Guyer <sam.guyer@gmail.com>2020-12-16 00:01:15 +0300
committerSam Guyer <sam.guyer@gmail.com>2020-12-16 00:01:15 +0300
commitfdba020808ed6c384114e8573b8ff9c43d2b6abd (patch)
tree9e4baf3e51f9918f4f4b7e3e1755c034682b148e
parentfed7c1c58336790ce0e5e45fd7c5f33d123e4a8f (diff)
Fix for issue #1130: don't use pin 0 to configure the RMT device
-rw-r--r--src/platforms/esp/32/clockless_rmt_esp32.cpp6
-rw-r--r--src/platforms/esp/32/clockless_rmt_esp32.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/platforms/esp/32/clockless_rmt_esp32.cpp b/src/platforms/esp/32/clockless_rmt_esp32.cpp
index a9a854b5..119702c3 100644
--- a/src/platforms/esp/32/clockless_rmt_esp32.cpp
+++ b/src/platforms/esp/32/clockless_rmt_esp32.cpp
@@ -84,7 +84,7 @@ uint32_t * ESP32RMTController::getPixelBuffer(int size_in_bytes)
// -- Initialize RMT subsystem
// This only needs to be done once
-void ESP32RMTController::init()
+void ESP32RMTController::init(gpio_num_t pin)
{
if (gInitialized) return;
@@ -95,7 +95,7 @@ void ESP32RMTController::init()
rmt_config_t rmt_tx;
rmt_tx.channel = rmt_channel_t(i);
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 = pin; // The particular pin will be assigned later
rmt_tx.mem_block_num = FASTLED_RMT_MEM_BLOCKS;
rmt_tx.clk_div = DIVIDER;
rmt_tx.tx_config.loop_en = false;
@@ -141,7 +141,7 @@ void IRAM_ATTR ESP32RMTController::showPixels()
{
if (gNumStarted == 0) {
// -- First controller: make sure everything is set up
- ESP32RMTController::init();
+ ESP32RMTController::init(mPin);
#if FASTLED_ESP32_FLASH_LOCK == 1
// -- Make sure no flash operations happen right now
diff --git a/src/platforms/esp/32/clockless_rmt_esp32.h b/src/platforms/esp/32/clockless_rmt_esp32.h
index 68861b50..2e723179 100644
--- a/src/platforms/esp/32/clockless_rmt_esp32.h
+++ b/src/platforms/esp/32/clockless_rmt_esp32.h
@@ -239,8 +239,9 @@ public:
uint32_t * getPixelBuffer(int size_in_bytes);
// -- Initialize RMT subsystem
- // This only needs to be done once
- static void init();
+ // This only needs to be done once. The particular pin is not important,
+ // because we need to configure the RMT channels on the fly.
+ static void init(gpio_num_t pin);
// -- Show this string of pixels
// This is the main entry point for the pixel controller