bbulkow / FastLED-idf

FastLED port to the ESP-IDF 4.0 development environment
https://fastled.io/
MIT License
162 stars 41 forks source link

More than one channel doesn't work with mem_blocks_num #16

Closed bbulkow closed 4 years ago

bbulkow commented 4 years ago

If you use the default code which uses mem_blocks_num of 2 ( or increase it further ), ESP-IDF demands that you skip channels. For example, if you use channel 0 with 2 memblocks, then you must skip channel 1 because its memory is already in use.

Until this issue is resolved, you can use one LED strip with greater mem_blocks, or you can use a mem_blocks_num of 1 and multiple strips. Looking at a fix over the next few days, pull requests welcome.

Thanks @samguyer for bringing this up.

samguyer commented 4 years ago

@bbulkow I just add add the number of mem blocks to the channel as I'm assigning them:

    int channel = 0;
    while (channel < FASTLED_RMT_MAX_CHANNELS && gNext < gNumControllers) {
        ESP32RMTController::startNext(channel);
        // -- Important: when we use more than one memory block, we need to
        //    skip the channels that would otherwise overlap in memory.
        channel += FASTLED_RMT_MEM_BLOCKS;
    }
bbulkow commented 4 years ago

Sweet and thanks. It's probably time for me to test gNumControllers > RMT_MAX_CHANNELS, which will happen more frequently when RMT_MEM_BLOCKS > 1, want to make sure all that works even with this extra complication.

samguyer commented 4 years ago

I was thinking the same thing.I think it will work, since the next controller just takes the channel number that was freed up.

bbulkow commented 4 years ago

Checked in, will test this afternoon.... couldn't get any worse.... :-0

bbulkow commented 4 years ago

Resolved, hopefully.

samguyer commented 4 years ago

I just tell people that if they're not happy, I'll give them a full refund. ;-)

bbulkow commented 4 years ago

Multiple channels crashes immediately. Need to fix.

samguyer commented 4 years ago

Ok, I'll take a look tomorrow.

On Mon, Sep 14, 2020 at 10:21 PM Brian Bulkowski notifications@github.com wrote:

Multiple channels crashes immediately. Need to fix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bbulkow/FastLED-idf/issues/16#issuecomment-692421462, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATSHK3T5OCBU2ULZTR6US3SF3FSPANCNFSM4RL3L2HQ .

bbulkow commented 4 years ago

Not in your version. I wrote it a different way. My problem.

bbulkow commented 4 years ago

Resolved with ba32cc3