Skip to content

Support for ESP32 - #474

Merged
focalintent merged 1 commit into
FastLED:masterfrom
samguyer:master
Aug 16, 2017
Merged

focalintent merged 1 commit into
FastLED:masterfrom
samguyer:master

Conversation

@samguyer

@samguyer samguyer commented Aug 5, 2017

Copy link
Copy Markdown
Contributor

Credit to Rina Shkrabova for the first cut. Overall, this code is almost identical to the 8266 support, except for the pin definitions and the handling of interrupts. I put in calls to ets_intr_lock and ets_intr_unlock.

Credit to Rina Shkrabova for the first cut.
@focalintent

Copy link
Copy Markdown
Contributor

Sam - real quickly - with this code checked in can you do a couple quick tests of compiling for esp8266, and arm based arduino, and one of the teensy 3.x platforms? (I don't have a good test compile setup going) -- but if your changes aren't interfering with those (and it looks like it shouldn't I'm just being slightly paranoid here) -- I'll take the pull request) -- thank you for this!

@samguyer

Copy link
Copy Markdown
Contributor Author

I don't think I have a Teensy to test on, but I can certainly double-check with an ESP8266. Any particular kind of test?

@focalintent

Copy link
Copy Markdown
Contributor

Actually just need compile tests done (and i'm installing software here finally so I may be able to do the compile tests myself in a few -- assuming i can checkout your repo for the test -- hmmm, I wonder if I can re-target this pull request to a different branch) -- your changes shouldn't be impacting any running code on other platforms, I just know that sometimes when I add a new platform, I miss an endif or some other kind of guard somewhere that breaks other platforms from building :/

@marmilicious

Copy link
Copy Markdown
Contributor

@focalintent I just tested DemoReel100 with this branch with a Teensy 3.0 and LPD8806 (32 pixels) and then also APA102 (38 pixels). Using Teensyduino 1.30. Looks to be running run fine. Let me know if you'd like any other specific tests.

@focalintent

Copy link
Copy Markdown
Contributor

@marmilicious with sam's changes merged in? (I haven't accepted the pull request yet) -- and thank you for checking!

@marmilicious

Copy link
Copy Markdown
Contributor

@focalintent

Copy link
Copy Markdown
Contributor

Perfect, thank you!

@focalintent
focalintent merged commit 8e691e1 into FastLED:master Aug 16, 2017
@samguyer

Copy link
Copy Markdown
Contributor Author

Oh OK. It definitely compiles for both ESP32 and ESP8266. The only thing I had to change that was kind of sketchy was the way NOP and NOP2 are defined. The currently ESP32 core defines them like this:

#define NOP() asm volatile ("nop")

Whereas FastLED defines them like this:

#define NOP asm volatile ("nop")

which then doesn't compile because of the conflicting definitions. So for ESP32, I first undef NOP and then let FastLED redefine it.

@samguyer

Copy link
Copy Markdown
Contributor Author

So, I've run into some weird behavior with libraries that make heavy use of interrupts (for example, motion sensors that generate interrupts when the orientation changes). I'm not sure what's going on, but I am able to reproduce it.

@focalintent

Copy link
Copy Markdown
Contributor

It’s possible that the timing thresholds are wrong for deciding when/how to re-transmit frames — try either disabling interrupts during WS28xx output entirely or dropping the retry count to 1 — i’m can’t easily lookup code right now but if you look in fastled_config.h you’ll see the defines you need to use (put them before you include FastLED.h) and see if either of those help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants