@@ -51,6 +51,7 @@ void initStatusLED() {
5151 statusPixel = new Adafruit_NeoPixel (
5252 STATUS_NEOPIXEL_NUM, STATUS_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);
5353 statusPixel->begin ();
54+ statusPixel->clear ();
5455 statusPixel->show (); // turn OFF all pixels
5556 WS.lockStatusNeoPixel = true ;
5657 }
@@ -69,6 +70,7 @@ void initStatusLED() {
6970 STATUS_DOTSTAR_PIN_CLK, STATUS_DOTSTAR_COLOR_ORDER)
7071#endif
7172 statusPixelDotStar->begin ();
73+ statusPixelDotStar->clear ();
7274 statusPixelDotStar->show (); // turn OFF all pixels
7375 WS.lockStatusDotStar = true ;
7476 }
@@ -99,16 +101,15 @@ void initStatusLED() {
99101*/
100102/* ***************************************************************************/
101103void releaseStatusLED () {
102- WS_DEBUG_PRINTLN (" Releasing status LED" );
104+ WS_DEBUG_PRINTLN (" Releasing status LED" );
103105#ifdef USE_STATUS_NEOPIXEL
104- WS_DEBUG_PRINTLN ( " Deinit the RMT... " );
105- // Deinit the RMT
106+ # ifdef ARDUINO_ARCH_ESP32
107+ // Release the rmtPin for use by other peripherals
106108 statusPixel->updateLength (0 );
107109 statusPixel->show ();
108- WS_DEBUG_PRINTLN (" Deleting the statusPixel" );
109- delete statusPixel; // Deallocate Adafruit_NeoPixel object, set data pin back
110- // to INPUT.
111- statusPixel = nullptr ;
110+ #endif
111+ // Dealloc. NeoPixel object
112+ delete statusPixel;
112113 WS.lockStatusNeoPixel = false ; // unlock
113114#endif
114115
0 commit comments