Changes to RMT driver implementation?
Posted: Mon Dec 23, 2019 10:00 pm
I have been maintaining the ESP32 support for the FastLED library (http://fastled.io/), and I've noticed some changes to the ESP32 IDF RMT code that I'm concerned about.
We use the RMT device to drive clockless RGB LED strips, such as those built on the popular WS281X and SK681X chips. We don't use the ESP32 IDF driver, however, because we want to convert the RGB data into RMT items on-the-fly. That is, each time the RMT device finishes sending the buffer, it generates an interrupt, and we refill it with newly computed rmt_item32_t's. We offer an option to use the driver provided with ESP32 IDF, but it requires all of the color data to be converted to 32-bit items first -- a substantial memory overhead.
OK, so here is the issue: in the latest version of ESP32 IDF, I noticed that a lot of the API functions rely on having information from the p_rmt_obj array, which is only created when rmt_driver_install is called. I'm worried that when our code calls functions like rmt_tx_start, it will crash because the p_rmt_obj array is full of null pointers.
Can anyone from the ESP32 IDF team comment on these changes? What do you recommend we do for our custom driver?
Thanks!
For reference, here is the FastLED RMT driver code:
https://github.com/FastLED/FastLED/blob ... mt_esp32.h
We use the RMT device to drive clockless RGB LED strips, such as those built on the popular WS281X and SK681X chips. We don't use the ESP32 IDF driver, however, because we want to convert the RGB data into RMT items on-the-fly. That is, each time the RMT device finishes sending the buffer, it generates an interrupt, and we refill it with newly computed rmt_item32_t's. We offer an option to use the driver provided with ESP32 IDF, but it requires all of the color data to be converted to 32-bit items first -- a substantial memory overhead.
OK, so here is the issue: in the latest version of ESP32 IDF, I noticed that a lot of the API functions rely on having information from the p_rmt_obj array, which is only created when rmt_driver_install is called. I'm worried that when our code calls functions like rmt_tx_start, it will crash because the p_rmt_obj array is full of null pointers.
Can anyone from the ESP32 IDF team comment on these changes? What do you recommend we do for our custom driver?
Thanks!
For reference, here is the FastLED RMT driver code:
https://github.com/FastLED/FastLED/blob ... mt_esp32.h