Page 1 of 1

Housekeeping for rmt channels

Posted: Tue Dec 06, 2016 3:22 pm
by jumjum123
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 ?

Re: Housekeeping for rmt channels

Posted: Tue Dec 06, 2016 4:11 pm
by kolban
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.

Re: Housekeeping for rmt channels

Posted: Tue Dec 06, 2016 8:27 pm
by ESP_Angus
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.