feat(gust): adc-thin caller-supplied CR2-extra mask — unblock F1 internal channels (gale#216) - #218
Merged
Merged
Conversation
…rnal channels (gale#216) The dissolved ADC driver wrote CR2 absolutely (ADON, ADON|SWSTART), dropping CR2.TSVREFE (bit 23) at the SWSTART instant. TSVREFE must stay set during the conversion to read an F1 internal channel (Vrefint ch17 / temp ch16). Thread a caller-supplied cr2_extra: u32 through adc_configure/adc_enable/adc_start, OR'd into each content-bearing CR2 write; adc_disable's teardown write (CR2=0) is unchanged. Regenerate adc-thin-cm3.o (synth 0.49.0/loom 1.2.0) and update both callers (gust_adc.rs, gust_adc_probe.rs) to the new ABI, passing 0 to preserve prior behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
Closes the driver half of gale#216. The dissolved thin-seam ADC driver wrote
ADC_CR2absolutely (ADON,ADON|SWSTART), droppingCR2.TSVREFE(bit 23) at the SWSTART instant — so it could not read an STM32F1 internal channel (Vrefint ch17 / temperature ch16), which need TSVREFE set during the conversion.Fix: thread a caller-supplied
cr2_extra: u32into the three content-bearing CR2 writes, OR'd on top of the managed bits (which stay authoritative). Generic — also covers ALIGN / EXTTRIG / DMA. This unblocks the v0.5.0 D.2 silicon Vrefint anchor (firmware + flash follow in a separate hardware PR).Changes
adc-thin/src/lib.rs:cr2_extraadded as the last param ofadc_configure/adc_enable/adc_start;wr(CR2, CR2_ADON [| SWSTART] | cr2_extra).adc_disable'sCR2 = 0teardown left untouched. Pure FSM (enable/begin/complete/read/disable, types, pack/unpack, config helpers) unchanged.adc-thin-cm3.o: regenerated (synth 0.49.0 / loom 1.2.0),.text740 → 772 B.gust_adc_probe.rs+gust_adc.rs: extern decls + call sites updated to the new arity, passing0(behavior identical:ADON|0 == ADON).Oracles (all re-verified by the coordinator)
nm: all 8adc_*exports present asT; onlymmio_read32/mmio_write32undefined (no new TCB).gust_adc_proberunsadc-probe ALL OK— proves the regenerated.ostill drives the register sequence byte-identically atcr2_extra=0(CR2=ADON|SWSTART=0x400001).cargo buildof both gated bins clean.Kill-criterion
If
cr2_extra=0changed any register write vs. the prior.o, the probe's exact-value asserts would fail. They pass → behavior preserved; the new capability is purely additive.🤖 Generated with Claude Code