Repository navigation
test(esp8266): prove the I2S TX->RX capture loopback in software (#4945) - #4959
Merged
Merged
Conversation
Software proof of the #4945 RX capture: the I2S WS2812 codec's encode (what the #4943 engine emits) -> samplesToEdges (the shared RX reconstruction Esp8266I2sRxDevice uses) -> decodeWs2812Edges round-trips full frames, no hardware. - samplesToEdges moves into i2s_ws2812_codec.h as a free, host-testable function; the RX device delegates to it (no duplication). - FIX the bug the test caught: samplesToEdges walked sampleCount * kI2sBitsPerSample slots (4/sample) instead of 16 slots/sample, reading only the top nibble -- the loopback only round-tripped once corrected. - Extend tests/platforms/esp/8266/i2s_ws2812_codec.cpp (its matching source) with boundary-byte and 9-byte multi-LED round-trips plus a run-length case. Verified: bash test i2s_ws2812_codec -> all pass; bash compile esp8266 --examples Blink succeeds; ci/lint.py --strict clean. Refs #4945, #4943, #4949.
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Memory usage (this PR vs. its merge base)Change in
|
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.
Follow-up to #4958 (#4945): proves the new ESP8266 RX capture end-to-end, and fixes a bug doing so.
What this adds
A host test that takes the I2S output engine's encode (what #4943 emits) → the RX reconstruction
samplesToEdges(the shared functionEsp8266I2sRxDeviceuses) → the shareddecodeWs2812Edges, and checks full frames round-trip — single bytes, boundary bytes (0x00/0xFF/0xAA/0x55/0x0F/0xF0/0x01/0x80) and a 9-byte multi-LED frame. That is the TX→RX loopback, verified without hardware.Bug this caught (now fixed)
samplesToEdgeswalkedsampleCount * kI2sBitsPerSampleslots (4/sample) instead of 16 slots/sample, so it only read the top nibble — the loopback failed until corrected. It's the kind of off-by-N the hardware path would have hidden.Refactor
samplesToEdgesmoves intoi2s_ws2812_codec.has a free, host-testable function;Esp8266I2sRxDevicedelegates to it (no duplication).Test plan / evidence
bash test i2s_ws2812_codec→ all pass (codec + TX→RX loopback cases).bash compile esp8266 --examples Blink→ succeeds.ci/lint.py --strictclean (test folded into its matching source per TestPathStructureChecker).