Skip to content

Commit

Permalink
Merge pull request #424 from brentru/master
Browse files Browse the repository at this point in the history
Fix: ESP32 espShow() doesn't de-init RMT
  • Loading branch information
tyeth authored Mar 6, 2025
2 parents 30413c2 + d1eebc2 commit fd74287
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Adafruit_NeoPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ Adafruit_NeoPixel::Adafruit_NeoPixel()
@brief Deallocate Adafruit_NeoPixel object, set data pin back to INPUT.
*/
Adafruit_NeoPixel::~Adafruit_NeoPixel() {
#ifdef ARDUINO_ARCH_ESP32
// Release RMT resources (RMT channels and led_data)
// by indirectly calling into espShow()
memset(pixels, 0, numBytes);
numLEDs = numBytes = 0;
show();
#endif
free(pixels);
if (pin >= 0)
pinMode(pin, INPUT);
Expand Down

0 comments on commit fd74287

Please sign in to comment.