Repository navigation
perf(sensors): publish coherent barometer snapshots - #126
Draft
zjwhitehead wants to merge 2 commits into
Draft
zjwhitehead wants to merge 2 commits into
zjwhitehead wants to merge 2 commits into
Conversation
PaulDWhite
added a commit
that referenced
this pull request
Oct 31, 2026
Keep #125's single-writer CPU temperature in ctrlSensorTask, and feed the climb-power estimator from the barometer snapshot (a stale or missing sample is a gap, as before).
Conflicts in altimeter.cpp and main.cpp were only master's millis() -> timeMillis() rename (5b64992). Keep this branch's barometer task, snapshots and delayUntilNextPeriod; its remaining millis() calls use timeMillis() like the rest of master. Verified: firmware builds, native-test 60/60. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Decision
Keep this draft until the live ESC/BMS acceptance matrix below passes. Merge #125 first, then rebase this branch and rerun the combined smoke test because both touch the controller-sensor task context.
What changes
Why
The prior P3 experiment wrote independent float globals. The writer-side I2C mutex did not make those fields coherent for readers. This version publishes all derived values, sample time, and validity together.
The previous missed-frame policy also reset lastWake to now. With a measured 37 ms render and a 33 ms period, that schedules the next frame at 70 ms. The phase-aligned policy advances the base to 33 ms and schedules the next frame at 66 ms. It prevents catch-up bursts without converting cadence into render time plus period. Getting render time below 33 ms remains the separate path to approximately 30 FPS.
Local validation
Live hardware acceptance matrix
Controller and barometer
Real ESC
Real BMS and battery
Soak and lifecycle
Not included