From ba32cc36a055a5157a05a929d38896a8ad2d90f2 Mon Sep 17 00:00:00 2001 From: Brian Bulkowski Date: Mon, 14 Sep 2020 23:38:35 -0700 Subject: [PATCH] Fix issue with multiple channels. Hadn't propigated use of mRMT_channels into the IRQ handler. --- .../FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp | 8 +++++--- 1 file changed, 5 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 1aa27f7..2d0eb45 100644 --- a/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp +++ b/components/FastLED-idf/platforms/esp/32/clockless_rmt_esp32.cpp @@ -527,8 +527,10 @@ void IRAM_ATTR ESP32RMTController::interruptHandler(void *arg) ESP32RMTController * pController = gOnChannel[channel]; if (pController != NULL) { - int tx_done_bit = channel * 3; - int tx_next_bit = channel + 24; + int rmt_channel = pController->mRMT_channel; + + int tx_done_bit = rmt_channel * 3; + int tx_next_bit = rmt_channel + 24; if (intr_st & BIT(tx_next_bit)) { // -- More to send on this channel @@ -544,7 +546,7 @@ void IRAM_ATTR ESP32RMTController::interruptHandler(void *arg) else if (intr_st & BIT(tx_done_bit)) { RMT.int_clr.val |= BIT(tx_done_bit); - doneOnChannel(rmt_channel_t(channel), 0); + doneOnChannel(rmt_channel_t(rmt_channel), 0); } }