F3 port + F4 OC3PE knob with 35-run frequency bench - #38
Merged
Merged
Conversation
Step A of the port-layer review: kill the treble duplication of family
selection (onewire.h token chain + ow_port.h re-pick + per-family block).
- inc/onewire.h: one OW_PORT_FAMILY chain and one #include branch that
pulls the selected backend directly, with #error on no family; the
HSE/F4_MAX/SYSCLK/IRQn facts block and ow_pulse_t typedef are gone.
- port/ow_port_fX.h: own their facts (ow_pulse_t, OW_PORT_SYSCLK_MHZ,
OW_HSE_MHZ where the family has one, OW_PORT_F4_MAX_SYSCLK_MHZ on F4,
OW_PORT_TIM1_UPD_IRQn under OW_PORT_LOW_POWER), so backend and defaults
cannot drift; includes ow_port.h after the facts.
- inc/ow_port.h: no backend selection (onewire.h did it), optional
OW_PORT_MARKER_TOGGLE() hook defaulting to empty, capture-width comment
covering both the basic-DMA (PSIZE=16+MSIZE=8) and F4 direct
(PSIZE=MSIZE=8) semantics; IC4F ladder moved out (see below).
- port/common/ow_port_tim_dma.h: IC4F ladder lives here next to the
prescaler that reads it, so it is in scope before any TIM_CCMR2(...,OW_PORT_IC4F_ARGS)
in every include order - fixing the standalone-ow_port.h TU failure
('TIM_CCMR2_OW_PORT_IC4F_ARGS' undeclared) that the old ow_port.h-first
placement caused; the five required backend macros and both DMA channel
defines now get checked with #error after the include guard.
- port/stm32f4/ow_port_f4.h: identical IC4F ladder (it does not include
the core), assert(0) reject paths -> clean returns, <assert.h> dropped,
and the three CCR3 preloads plus the trailing-feed entry spelled as
ONEWIRE_RELEASE_PULSE instead of a bare 0.
- examples/app, tests, CMakeLists comments follow the refactor; ci.yml
cppcheck now passes -Iport/* exactly as the build tree exports them, so
the static-analysis include contract matches the headers that own the
facts.
Verified: host tests + ndebug/lowpower/active variants for all five
families, test-mocks, clang-format --dry-run, cppcheck x6 all green, and
the ds18b20_1_basic .bin for f0/f1/g0/f3/f4 rebuilds byte-identical to
the pre-refactor baseline.
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
Key notes
Docs
docs/bench/f3-2026-09-29/, docs/bench/f4-2026-09-30/ (logs + LA captures).