Skip to content

Commit

Permalink
Reflect using dtor instead
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Mar 6, 2025
1 parent c6f15b5 commit 393fffa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/components/pixels/ws_pixels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ void ws_pixels::deallocateStrand(int16_t strandIdx) {
// Fill with "off"
strands[strandIdx].neoPixelPtr->clear();
strands[strandIdx].neoPixelPtr->show();
#ifdef ARDUINO_ARCH_ESP32
// Clear the pin used for RMT
strands[strandIdx].neoPixelPtr->updateLength(0);
strands[strandIdx].neoPixelPtr->show();
#endif
// Delete the NeoPixel object
delete strands[strandIdx].neoPixelPtr;
} else if ((strands[strandIdx].dotStarPtr != nullptr)) {
Expand Down
10 changes: 3 additions & 7 deletions src/components/statusLED/Wippersnapper_StatusLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,10 @@ void initStatusLED() {
void releaseStatusLED() {
WS_DEBUG_PRINTLN("Releasing status LED");
#ifdef USE_STATUS_NEOPIXEL
#ifdef ARDUINO_ARCH_ESP32
// Release the rmtPin for use by other peripherals
statusPixel->updateLength(0);
statusPixel->show();
#endif
// Dealloc. NeoPixel object
// Deallocate Adafruit_NeoPixel object, set data pin back to INPUT,
// and unlock pixel for use by pixels component
delete statusPixel;
WS.lockStatusNeoPixel = false; // unlock
WS.lockStatusNeoPixel = false;
#endif

#ifdef USE_STATUS_DOTSTAR
Expand Down

0 comments on commit 393fffa

Please sign in to comment.