Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.2k stars 3.03k forks source link

Fix PWM crashes on ESP8266 #4035

Open willmmiles opened 3 days ago

willmmiles commented 3 days ago

Vendor in the ESP8266 Arduino core PWM library, with a fix for a nasty NMI crash bug. Sometimes the NMI return instruction seems to fail, resulting in an infinite loop as the PC gets stuck "returning" to the NMI handler itself. Work around this by backing up and restoring the PC (and PS) from the last known good target values if needed.

I've opted to place the code in the platformio "libs" folder, which makes it easy to conditionally include for ESP8266 builds via platformio.ini.

Fixes PWM crash issues issues described in #3962.