diff --git a/platformio.ini b/platformio.ini index a9bc5e7e0..7fc92150f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -94,7 +94,7 @@ lib_deps = ; Common build environment for ESP32 platform [common:esp32] -platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip ; This is needed for occasional new features and bug fixes ; platform = https://github.com/pioarduino/platform-espressif32#develop lib_ignore = WiFiNINA, WiFi101, OneWire @@ -166,7 +166,7 @@ board = adafruit_feather_esp32c6 build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32C6 -DARDUINO_USB_CDC_ON_BOOT=1 - -DCORE_DEBUG_LEVEL=3 + -DCORE_DEBUG_LEVEL=5 board_build.filesystem = littlefs board_build.partitions = min_spiffs.csv diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index 7ffe02320..bf640c6f8 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -142,7 +142,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.97" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-beta.98" ///< WipperSnapper app. version (semver-formatted) // Reserved Adafruit IO MQTT topics #define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic diff --git a/src/components/pixels/ws_pixels.cpp b/src/components/pixels/ws_pixels.cpp index a35eb6e42..2d3b52237 100644 --- a/src/components/pixels/ws_pixels.cpp +++ b/src/components/pixels/ws_pixels.cpp @@ -64,12 +64,19 @@ int16_t ws_pixels::allocateStrand() { */ /**************************************************************************/ void ws_pixels::deallocateStrand(int16_t strandIdx) { - // delete the pixel object - if (strands[strandIdx].neoPixelPtr != nullptr) + if (strands[strandIdx].neoPixelPtr != nullptr) { + // Fill with "off" + strands[strandIdx].neoPixelPtr->clear(); + strands[strandIdx].neoPixelPtr->show(); + // Delete the NeoPixel object delete strands[strandIdx].neoPixelPtr; - if ((strands[strandIdx].dotStarPtr != nullptr)) + } else if ((strands[strandIdx].dotStarPtr != nullptr)) { + // Fill with "off" + strands[strandIdx].dotStarPtr->clear(); + strands[strandIdx].dotStarPtr->show(); delete strands[strandIdx].dotStarPtr; + } // re-initialize status pixel (if pixel was prvsly used) if (strands[strandIdx].pinNeoPixel == getStatusNeoPixelPin() || @@ -243,6 +250,7 @@ bool ws_pixels::addStrand( releaseStatusLED(); // release it! // Create a new strand of NeoPixels + WS_DEBUG_PRINTLN("Setting up new NeoPixel Strand..."); strands[strandIdx].neoPixelPtr = new Adafruit_NeoPixel( pixelsCreateReqMsg->pixels_num, strands[strandIdx].pinNeoPixel, getNeoPixelStrandOrder(pixelsCreateReqMsg->pixels_ordering)); diff --git a/src/components/statusLED/Wippersnapper_StatusLED.cpp b/src/components/statusLED/Wippersnapper_StatusLED.cpp index 464e0b8ba..4cbdd4c85 100644 --- a/src/components/statusLED/Wippersnapper_StatusLED.cpp +++ b/src/components/statusLED/Wippersnapper_StatusLED.cpp @@ -51,6 +51,7 @@ void initStatusLED() { statusPixel = new Adafruit_NeoPixel( STATUS_NEOPIXEL_NUM, STATUS_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800); statusPixel->begin(); + statusPixel->clear(); statusPixel->show(); // turn OFF all pixels WS.lockStatusNeoPixel = true; } @@ -69,6 +70,7 @@ void initStatusLED() { STATUS_DOTSTAR_PIN_CLK, STATUS_DOTSTAR_COLOR_ORDER) #endif statusPixelDotStar->begin(); + statusPixelDotStar->clear(); statusPixelDotStar->show(); // turn OFF all pixels WS.lockStatusDotStar = true; } @@ -99,10 +101,12 @@ void initStatusLED() { */ /****************************************************************************/ void releaseStatusLED() { + WS_DEBUG_PRINTLN("Releasing status LED"); #ifdef USE_STATUS_NEOPIXEL - delete statusPixel; // Deallocate Adafruit_NeoPixel object, set data pin back - // to INPUT. - WS.lockStatusNeoPixel = false; // unlock + // Deallocate Adafruit_NeoPixel object, set data pin back to INPUT, + // and unlock pixel for use by pixels component + delete statusPixel; + WS.lockStatusNeoPixel = false; #endif #ifdef USE_STATUS_DOTSTAR