@@ -432,7 +432,7 @@ void ESP32RMTController::startOnChannel(int channel)
432432
433433 if (FASTLED_RMT_BUILTIN_DRIVER) {
434434 // -- Use the built-in RMT driver to send all the data in one shot
435- rmt_register_tx_end_callback (doneOnChannel, 0 );
435+ rmt_register_tx_end_callback (doneOnRMTChannel, ( void *) channel );
436436 rmt_write_items (mRMT_channel , mBuffer , mBufferSize , false );
437437 } else {
438438 // -- Use our custom driver to send the data incrementally
@@ -475,13 +475,20 @@ void ESP32RMTController::tx_start()
475475
476476}
477477
478+ // In the case of the build-in driver, they specify the RMT channel
479+ // so we use the arg instead
480+ void ESP32RMTController::doneOnRMTChannel (rmt_channel_t channel, void * arg)
481+ {
482+ doneOnChannel ((int ) arg, (void *) 0 );
483+ }
484+
478485// -- A controller is done
479486// This function is called when a controller finishes writing
480487// its data. It is called either by the custom interrupt
481488// handler (below), or as a callback from the built-in
482489// interrupt handler. It is static because we don't know which
483490// controller is done until we look it up.
484- void ESP32RMTController::doneOnChannel (rmt_channel_t channel, void * arg)
491+ void ESP32RMTController::doneOnChannel (int channel, void * arg)
485492{
486493
487494 // -- Turn off output on the pin
@@ -546,7 +553,7 @@ void IRAM_ATTR ESP32RMTController::interruptHandler(void *arg)
546553 else if (intr_st & BIT (tx_done_bit)) {
547554
548555 RMT.int_clr .val |= BIT (tx_done_bit);
549- doneOnChannel (rmt_channel_t (rmt_channel) , 0 );
556+ doneOnChannel (channel , 0 );
550557
551558 }
552559 }
0 commit comments