Repository navigation
rewrite(phase3): port spi and uart from c-RCP, RC5 nr_cs/deassert_cs_pause fix - #139
Merged
Merged
Conversation
…pause fix Part of the v3.0.0 ground-up rewrite (cpp-RCP #129, ROADMAP.md Phase 17), branch rewrite/v3-from-c-rcp. Second of Phase 3 Wave 2's three batches, alongside mdio and pwm/wakeup (separate PRs). ## spi.hpp - The RC5 wire-format defect that originally motivated this whole rewrite (see #129's own opening rationale) is now actually fixed: spi_nr_cs narrowed from an 8-bit count to a 4-bit (count-1) field, plus a new deassert_cs_pause bit (RC5 ticket NXP_100). Confirmed against c-RCP's current ep_spi.h/.c bit layout, not just cited from memory. - Compound-wait handling for SPI transactions ported (SPI has its own distinct compound-wait semantics from the generic request.hpp path, per c-RCP's ep_spi.c). - Fixed-capacity conversions applied throughout (no dynamic allocation on the transfer path). ## uart.hpp - nr_bits bug fixed: prior cpp-RCP state miscomputed the bit-width field against c-RCP's actual ep_uart.c encoding. - Ported against c-RCP's current RC5-conformant ep_uart.h/.c. ## Call sites mock.hpp: one enum-rename fix (spi::SpiErrc::channel_out_of_range -> bad_channel) to match the renamed error enumerator; no other call sites needed changes. test_spi.cpp / test_uart.cpp expanded to match the new content (compound wait, nr_cs/deassert_cs_pause, nr_bits coverage). ## Verification Full tree rebuilds clean (223/223 targets), 56/56 ctest suites pass (100%) -- independently re-verified from a fresh build in the worktree, not just the porting agent's own report. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
The bare substring 'RC4' in a comment describing TC18 spec revision history was matched by cpfusa's weak-symmetric-cipher heuristic (CYBER002/CWE-327, 'Weak symmetric cipher (DES/3DES/RC4) detected') as if it were the RC4 stream cipher, failing PR #139's cpfusa cyber --strict gate (the only [ERROR]-level finding in that run; the other 568 findings in the log are pre-existing [WARNING]-level noise that doesn't gate). c-RCP's own ep_spi.h uses the same bare 'RC4' token in its equivalent comment and isn't subject to this particular gate. Reworded to 'the RC 4 revision' (space inserted) -- same meaning, no contiguous 'RC4' substring for the scanner to match. No functional or documentation-content change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
10 tasks
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.
Part of the v3.0.0 ground-up rewrite (#129, ROADMAP.md Phase 17), branch
rewrite/v3-from-c-rcp. Second of Phase 3 Wave 2's three batches (alongsidephase3/mdioandphase3/pwm-wakeup, separate PRs).spi.hpp
spi_nr_csnarrowed from an 8-bit count to a 4-bit(count-1)field, plus a newdeassert_cs_pausebit (RC5 ticket NXP_100). Confirmed against c-RCP's currentep_spi.h/.cbit layout directly.request.hpppath, per c-RCP'sep_spi.c).uart.hpp
nr_bitsbug fixed: prior cpp-RCP state miscomputed the bit-width field against c-RCP's actualep_uart.cencoding.ep_uart.h/.c.Call sites
mock.hpp: one enum-rename fix (spi::SpiErrc::channel_out_of_range→bad_channel); no other call sites needed changes.test_spi.cpp/test_uart.cppexpanded to match the new content (compound wait,nr_cs/deassert_cs_pause,nr_bitscoverage).Verification
Full tree rebuilds clean (223/223 targets), 56/56 ctest suites pass (100%) — independently re-verified from a fresh build in the worktree, not just the porting agent's own report.