|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Feature-driven sizing resolution - the per-variant sizing layer's final pass. More...
Go to the source code of this file.
Feature-driven sizing resolution - the per-variant sizing layer's final pass.
Some buffer sizes have a hard lower bound set by which features are compiled in, not by the board. A ring smaller than that bound does not just waste a little RAM - it breaks the feature (a handshake resets, a streamed upload deadlocks). That coupling is sizing logic, so it lives here in the board-profile layer rather than inline in protocore_config.h, and it runs LAST: after the chip/PSRAM/flash profiles, the base #ifndef defaults, and every PC_ENABLE_* feature flag are resolved, so it can see the final values.
The floor is enforced against whatever set the value - a chip profile, a -D build flag, or the base default - by raising it to the feature minimum when it falls short (a monotone max, never a lower). This is deliberately NOT gated on "was it a default?": a profile that pins RX_BUF_SIZE to fit its DRAM must still be lifted to the streaming floor when streaming is built, or the pin silently deadlocks large uploads. A value already at or above the floor is left untouched, so an intentionally roomy ring is preserved.
Definition in file derived_sizing.h.