mirror of
https://github.com/bbulkow/FastLED-idf.git
synced 2025-08-03 20:55:13 +02:00
Further fix for channels, the done handler wasn't quite right
This commit is contained in:
@@ -432,7 +432,7 @@ void ESP32RMTController::startOnChannel(int channel)
|
|||||||
|
|
||||||
if (FASTLED_RMT_BUILTIN_DRIVER) {
|
if (FASTLED_RMT_BUILTIN_DRIVER) {
|
||||||
// -- Use the built-in RMT driver to send all the data in one shot
|
// -- Use the built-in RMT driver to send all the data in one shot
|
||||||
rmt_register_tx_end_callback(doneOnChannel, 0);
|
rmt_register_tx_end_callback(doneOnRMTChannel, (void *) channel);
|
||||||
rmt_write_items(mRMT_channel, mBuffer, mBufferSize, false);
|
rmt_write_items(mRMT_channel, mBuffer, mBufferSize, false);
|
||||||
} else {
|
} else {
|
||||||
// -- Use our custom driver to send the data incrementally
|
// -- Use our custom driver to send the data incrementally
|
||||||
@@ -475,13 +475,20 @@ void ESP32RMTController::tx_start()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In the case of the build-in driver, they specify the RMT channel
|
||||||
|
// so we use the arg instead
|
||||||
|
void ESP32RMTController::doneOnRMTChannel(rmt_channel_t channel, void * arg)
|
||||||
|
{
|
||||||
|
doneOnChannel((int) arg, (void *) 0);
|
||||||
|
}
|
||||||
|
|
||||||
// -- A controller is done
|
// -- A controller is done
|
||||||
// This function is called when a controller finishes writing
|
// This function is called when a controller finishes writing
|
||||||
// its data. It is called either by the custom interrupt
|
// its data. It is called either by the custom interrupt
|
||||||
// handler (below), or as a callback from the built-in
|
// handler (below), or as a callback from the built-in
|
||||||
// interrupt handler. It is static because we don't know which
|
// interrupt handler. It is static because we don't know which
|
||||||
// controller is done until we look it up.
|
// controller is done until we look it up.
|
||||||
void ESP32RMTController::doneOnChannel(rmt_channel_t channel, void * arg)
|
void ESP32RMTController::doneOnChannel(int channel, void * arg)
|
||||||
{
|
{
|
||||||
|
|
||||||
// -- Turn off output on the pin
|
// -- Turn off output on the pin
|
||||||
@@ -546,7 +553,7 @@ void IRAM_ATTR ESP32RMTController::interruptHandler(void *arg)
|
|||||||
else if (intr_st & BIT(tx_done_bit)) {
|
else if (intr_st & BIT(tx_done_bit)) {
|
||||||
|
|
||||||
RMT.int_clr.val |= BIT(tx_done_bit);
|
RMT.int_clr.val |= BIT(tx_done_bit);
|
||||||
doneOnChannel(rmt_channel_t(rmt_channel), 0);
|
doneOnChannel(channel, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -274,7 +274,15 @@ public:
|
|||||||
// handler (below), or as a callback from the built-in
|
// handler (below), or as a callback from the built-in
|
||||||
// interrupt handler. It is static because we don't know which
|
// interrupt handler. It is static because we don't know which
|
||||||
// controller is done until we look it up.
|
// controller is done until we look it up.
|
||||||
static void IRAM_ATTR doneOnChannel(rmt_channel_t channel, void * arg);
|
static void IRAM_ATTR doneOnChannel(int channel, void * arg);
|
||||||
|
|
||||||
|
// -- A controller is done
|
||||||
|
// This function is called when a controller finishes writing
|
||||||
|
// its data. It is called either by the custom interrupt
|
||||||
|
// handler (below), or as a callback from the built-in
|
||||||
|
// interrupt handler. It is static because we don't know which
|
||||||
|
// controller is done until we look it up.
|
||||||
|
static void IRAM_ATTR doneOnRMTChannel(rmt_channel_t rmt_channel, void * arg);
|
||||||
|
|
||||||
// -- Custom interrupt handler
|
// -- Custom interrupt handler
|
||||||
// This interrupt handler handles two cases: a controller is
|
// This interrupt handler handles two cases: a controller is
|
||||||
|
Reference in New Issue
Block a user