Repository navigation
fix(lint): add FL_NO_EXCEPT to TypeToJson<u32> / <u16> converters - #3532
Conversation
…e 2b prep) Extends the II2sPeripheralEsp32Dev peripheral interface with the streaming buffer-refill callback surface that #3526 Phase 2b needs when it wires the real DMA-EOF ISR into I2sPeripheralEsp32DevEsp. Ships the API surface + mock impl + host tests now so: 1. Phase 2b (bench work) can be written against a stable, host-tested interface — no design churn when someone with bench access starts. 2. The engine can be structurally exercised end-to-end on host (transmit → refill → refill → ... → done) via the mock's simulateBufferRefill(), matching how simulateTransmitDone() lets the engine test the done-signal path. ## API additions ### `ii2s_peripheral_esp32dev.h` - New callback signature `I2sEsp32DevBufferRefillCallback`: `void(*)(int buffer_index, bool *done, void *user_ctx)`. Fired per DMA-EOF interrupt. Caller sets `*done = true` to stop the refill cadence. - New virtual `registerBufferRefillCallback(cb, user_ctx)`. Default implementation returns false — impls that don't support streaming refill (Stage-4 stub, pure done-only impls) can leave it alone. ### `i2s_peripheral_esp32dev_mock.{h,cpp.hpp}` - Real implementation of `registerBufferRefillCallback` — stores callback + user_ctx. - New mock-only test hook `simulateBufferRefill(buffer_index)` fires the stored callback synchronously and records the `done` return. - New introspection accessors: `bufferRefillInvocationCount()`, `lastRefillBufferIndex()`, `lastRefillDone()`. - `reset()` clears all new state. ### `channel_engine_i2s_esp32dev.cpp` (host tests) Six new FL_TEST_CASE covering the refill surface: - Register + single fire, verify buffer_index + done reporting. - Cadence across a full buffer ring, verify caller-driven stop. - nullptr callback + fire is no-op. - Register nullptr clears the callback. - setRegisterCallbackFailure knob respected. - Coexistence with the transmit-done callback (both fire independently). ## What this does NOT do - Does NOT implement the real DMA-EOF ISR wiring in `I2sPeripheralEsp32DevEsp` — that's Phase 2b proper (needs WROOM bench). The real impl inherits the default `return false` from the interface until it's implemented. - Does NOT touch the Yves classic driver — that's untouched pending Phase 2e deletion. ## Verification - `bash test --cpp`: 345/345 pass (6 new test cases inside the existing `channel_engine_i2s_esp32dev.cpp` test file). - `bash lint --cpp`: clean modulo 2 pre-existing NoexceptAstChecker violations in `src/fl/remote/rpc/type_to_json.h` (unrelated to this PR). Part of #3516 meta / #3526 Phase 2b prep. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Closes the two `NoexceptAstChecker` violations in `src/fl/remote/rpc/type_to_json.h:37,46` — the `convert(...)` overrides on `TypeToJson<fl::u32>` and `TypeToJson<fl::u16>` were missing `FL_NO_EXCEPT`. Every other `convert(...)` specialization in the file that goes through primitive-type paths is trivially noexcept, so these two just needed the annotation. Also adds the `fl/stl/noexcept.h` include since the macro wasn't transitively available through the existing includes. Discovered while landing #3531 (I2S refill callback interface) — the pre-existing violations surfaced in the lint pass and were noted as unrelated. This fixes them so the classic-ESP32 I2S umbrella (#3516) rollup CI is fully clean. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR adds a streaming buffer-refill ISR callback interface ( ChangesESP32 I2S Buffer Refill Callback
JSON Conversion Noexcept Annotation
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Test as Test Code
participant Mock as I2sPeripheralEsp32DevMock
participant Callback as refillCb
Test->>Mock: registerBufferRefillCallback(refillCb, ctx)
Mock-->>Test: true/false (per mFailRegisterCallback)
Test->>Mock: simulateBufferRefill(buffer_index)
Mock->>Callback: invoke(buffer_index, &done, ctx)
Callback-->>Mock: sets done flag
Mock-->>Mock: increment invocation count, store last index/done
Test->>Mock: bufferRefillInvocationCount()
Mock-->>Test: count
Test->>Mock: lastRefillBufferIndex() / lastRefillDone()
Mock-->>Test: last recorded values
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Closes 2 pre-existing NoexceptAstChecker violations in
src/fl/remote/rpc/type_to_json.h:37,46. Discovered during #3531 lint pass. Test plan: bash test --cpp = 345/345, bash lint --cpp = clean.Summary by CodeRabbit
New Features
Tests