Repository navigation
P3-A1.1: add live deterministic SV signal control - #44
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe7e24eaf2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continue; | ||
| } | ||
|
|
||
| if (take_start_request()) { |
There was a problem hiding this comment.
Consume START and running state atomically
If START arrives after this exchange but before the following live_tx_running() check, the publisher observes running == true and transmits one frame using the old phase and sample counter; it consumes the pending reset only on the next tick. This can produce a stale frame followed by a counter reset or duplicate during every initial/restart transition, violating the defined clean START boundary. Represent the request/running transition as one atomic state or recheck the request after observing the running transition.
Useful? React with 👍 / 👎.
| const auto copy = banks_[index]; | ||
| reader_index_.store(kNoReader, std::memory_order_release); |
There was a problem hiding this comment.
Track every concurrent snapshot reader
When the publisher snapshots on CPU1 while the control task snapshots for SHOW or an update on CPU0, either reader can clear this single shared reader_index_ while the other is still copying. A subsequent publish may then reuse that reader's bank and write the non-atomic SvLiveSignalState concurrently with its copy, yielding undefined behavior or a mixed generation. The application does not serialize these readers, so the bank needs per-reader tracking or another protocol that cannot erase another reader's reservation.
Useful? React with 👍 / 👎.
Summary
Add the first vendor-neutral live control plane for the deterministic ESP32-P4 Sampled Values publisher. This implements the runtime half of the target workflow: configure signal values, START publication, change signal values while RUNNING, and STOP without rebuilding firmware or changing canonical stream identity.
Implemented
SvLiveSignalStatewith per-channel RMS raw counts, phase, quality and enable state plus signal frequency;smpCntrestart;Realtime boundary
The realtime publisher does not parse XML/text, rebuild BER, allocate per sample, log per sample, or take a host-facing mutex. It copies one coherent signal generation at a sample boundary, synthesizes values, patches the prebuilt template and transmits.
Profile identity/layout changes remain immutable while running and require STOP/re-arm. The SCL-driven compiled-profile bridge is delivered by the subsequent stacked integration PR.
Acceptance
This PR is the runtime foundation for the completed GUI + SCL-driven injector flow in the subsequent stacked PRs.