Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Wippersnapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Wippersnapper_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void setup() {
wipper.provision();

Serial.begin(115200);
// while (!Serial) delay(10);
while (!Serial) delay(10);

wipper.connect();

Expand Down
19 changes: 16 additions & 3 deletions src/components/pixels/ws_pixels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,24 @@ 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();
#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;
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() ||
Expand Down Expand Up @@ -243,6 +255,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));
Expand Down
12 changes: 10 additions & 2 deletions src/components/statusLED/Wippersnapper_StatusLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -99,9 +101,15 @@ 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.
#ifdef ARDUINO_ARCH_ESP32
// Release the rmtPin for use by other peripherals
statusPixel->updateLength(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this works on all platforms [updateLength 0 then show], and the docs mention it is deprecated but left for old projects that may be calling it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This access to the RMT is only for ESP32 and is guarded, am I missing something?

Copy link
Member

@tyeth tyeth Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I guess my brain was still coming from the perspective of the neopixel repo when making those comments.
I'm happy (actually extremely grateful) for this fix, but also wonder if the docs comments in neopixel repo suggest not using updateLength and using new NeoPixel(length, instead then is this the right move. Let's merge it and keep the neopixel repo issue to that repo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't merge til neopixel repo is merged fwiw

statusPixel->show();
#endif
// Dealloc. NeoPixel object
delete statusPixel;
WS.lockStatusNeoPixel = false; // unlock
#endif

Expand Down
Loading