@@ -51,6 +51,7 @@ void initStatusLED() {
51
51
statusPixel = new Adafruit_NeoPixel (
52
52
STATUS_NEOPIXEL_NUM, STATUS_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);
53
53
statusPixel->begin ();
54
+ statusPixel->clear ();
54
55
statusPixel->show (); // turn OFF all pixels
55
56
WS.lockStatusNeoPixel = true ;
56
57
}
@@ -69,6 +70,7 @@ void initStatusLED() {
69
70
STATUS_DOTSTAR_PIN_CLK, STATUS_DOTSTAR_COLOR_ORDER)
70
71
#endif
71
72
statusPixelDotStar->begin ();
73
+ statusPixelDotStar->clear ();
72
74
statusPixelDotStar->show (); // turn OFF all pixels
73
75
WS.lockStatusDotStar = true ;
74
76
}
@@ -99,16 +101,15 @@ void initStatusLED() {
99
101
*/
100
102
/* ***************************************************************************/
101
103
void releaseStatusLED () {
102
- WS_DEBUG_PRINTLN (" Releasing status LED" );
104
+ WS_DEBUG_PRINTLN (" Releasing status LED" );
103
105
#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
106
108
statusPixel->updateLength (0 );
107
109
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;
112
113
WS.lockStatusNeoPixel = false ; // unlock
113
114
#endif
114
115
0 commit comments