Housekeeping for rmt channels

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

Housekeeping for rmt channels

Postby jumjum123 » Tue Dec 06, 2016 3:22 pm

I'm working on conversion of neopixels from nkolban.
An rmt channel is used inside. Free channels are easy to handle as long as I've all functions under my control.
With librarys, built by somebody else its not that easy anymore, there could be a conflict using same channel.
Is there a function to find "free" rmt channels ?
Or are there plans to support something similiar to dynamic handling of interrupts for rmt channels ?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Housekeeping for rmt channels

Postby kolban » Tue Dec 06, 2016 4:11 pm

I think one must assume that the RMT channels are a "shared" resource and any third party libraries that you link with should document what channels they use and how many adjacent channels might be needed. Ideally those could then be configured. There doesn't appear to be a higher level "broker" that says "give me a channel" ... instead, your logic and the logic of third party libraries have to collaborate to avoid stepping on each other.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Housekeeping for rmt channels

Postby ESP_Angus » Tue Dec 06, 2016 8:27 pm

Probably the best pattern to support this, is to encourage libraries not to hard-coded RMT channels, but instead take an rmt_channel_t parameter for intiailisation, ie

Code: Select all

my_library_init(RMT_CHANNEL_1);
Then in your app's main task where you initialise all libraries, you can coordinate RMT channels there.

Who is online

Users browsing this forum: Bing [Bot] and 279 guests