Repository navigation
Bump ArduinoLibs and HMTL: MPR121 anti-wedge fix, packed TIMESYNC - #37
Merged
Merged
Conversation
…SYNC ArduinoLibs 9194ddf -> 002f6d7 HMTL ab149d6 -> c65f1a3 WLED_dev#36 moved ArduinoLibs only as far as 9194ddf (the PixelUtil bounds fix). The change Adam actually approved at the bench -- ArduinoLibs#15, "MPR121: report read health, and stop a failed read from wedging the driver" -- is three commits further on, so it is still not in the firmware this repo builds. This bump delivers it. Why it matters, since MPR121 is on the ampworks build path (WLED/platformio.ini:535, -D USERMOD_MPR121): readTouchInputs() clears `triggered`, then early-returns when `Wire.available() < 2`. The chip holds its IRQ line asserted until a successful status read, so with an edge-triggered IRQ no further edge is delivered -- the driver wedges permanently and touchStates keeps its last good value forever. 002f6d7 restores the flag on that path and adds readOk() so a consumer can tell "no edge" from "data untrustworthy". Scope note: the wedge is only reachable when an IRQ pin is configured. usermod_mpr121.h:123 defaults irqPin to -1 (polling), and in polling mode line 48 re-arms `triggered` every loop, so a default-configured device cannot wedge. Devices with irqPin set in their JSON config can. Also in the ArduinoLibs range: a62c389 (RS485SocketTool testing guide, docs) and 3b6f393, which drops noInterrupts()/interrupts() from both ESP32 IRAM ISRs and makes `triggered` volatile. Those macros are task-context and not IRAM-safe; the ISR body is a null check plus a single bool store, so the critical section protected nothing and volatile is the correct fix. HMTL ab149d6 -> c65f1a3 is #14, the serial connect path against a non-resetting ESP32. Verified on this exact tree, not on the parts separately: - make test STRICT=1 -> exit 0 - rs485_bridge host tests -> ALL PASSED, host and -fpack-struct=1 AVR layout - pio run -e ampworks -> SUCCESS (flash 83.7%, RAM 25.5%) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ
aphelps
approved these changes
Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two gitlinks, no source changes:
ArduinoLibs9194ddf002f6d7HMTLab149d6c65f1a3Why this exists
#36 did not deliver the fix Adam approved at the bench. It moved
ArduinoLibsonly as far as9194ddf(the PixelUtil bounds fix). ArduinoLibs#15 — "MPR121: report read health, and stop a failed read from wedging the driver", which he approved 2026-08-21 — is three commits further on, so it is still not in the firmware this repo builds.The bug it carries in
MPR121is on the ampworks build path (WLED/platformio.ini:535,-D USERMOD_MPR121), so this is not confined to host tests.readTouchInputs()clearstriggered, then early-returns whenWire.available() < 2. The chip holds its IRQ line asserted until a successful status read — so with an edge-triggered IRQ no further edge is ever delivered, the driver wedges permanently, andtouchStateskeeps its last good value forever.002f6d7restores the flag on that path and addsreadOk()so a consumer can distinguish "no edge" from "data untrustworthy".Its choice to restore the flag rather than move the clear below the read is the right one: clearing before the transaction preserves an edge arriving mid-read, including a release edge — the event whose loss would leave a poof stuck on.
Scope, stated so it is not over-read: the wedge is only reachable when an IRQ pin is configured.
usermod_mpr121.h:123defaultsirqPinto-1(polling), and in polling mode line 48 re-armstriggeredevery loop, so a default-configured device cannot wedge. Devices withirqPinset in their JSON config can.Also in the range
a62c389— RS485SocketTool ESP32 testing guide (docs only).3b6f393— dropsnoInterrupts()/interrupts()from both ESP32IRAM_ATTRISRs and makestriggeredvolatile. Those macros are task-context and not IRAM-safe; the ISR body is a null check plus a single bool store, so the critical section protected nothing andvolatileis the correct fix for the cross-context handoff.ab149d6 -> c65f1a3is Touch Pond effect: MPR121 capacitive touch with audio reactivity #14, the serial connect path against a non-resetting ESP32.Verification
Run against this exact tree, not the parts separately:
make test STRICT=1— exit 0rs485_bridgehost tests — ALL PASSED, under both host and-fpack-struct=1AVR layoutpio run -e ampworks— SUCCESS (flash 83.7%, RAM 25.5%)Needs a human review — this description is bot review input, not an approval.
🤖 Generated with Claude Code
https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ