Skip to content

Commit fd74287

Browse files
authored
Merge pull request #424 from brentru/master
Fix: ESP32 espShow() doesn't de-init RMT
2 parents 30413c2 + d1eebc2 commit fd74287

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Adafruit_NeoPixel.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ Adafruit_NeoPixel::Adafruit_NeoPixel()
122122
@brief Deallocate Adafruit_NeoPixel object, set data pin back to INPUT.
123123
*/
124124
Adafruit_NeoPixel::~Adafruit_NeoPixel() {
125+
#ifdef ARDUINO_ARCH_ESP32
126+
// Release RMT resources (RMT channels and led_data)
127+
// by indirectly calling into espShow()
128+
memset(pixels, 0, numBytes);
129+
numLEDs = numBytes = 0;
130+
show();
131+
#endif
125132
free(pixels);
126133
if (pin >= 0)
127134
pinMode(pin, INPUT);

0 commit comments

Comments
 (0)