mirror of
https://github.com/espressif/openthread.git
synced 2026-07-05 20:00:23 +00:00
fcf7b4cef5
This commit replaces the implicit sizing of `escaped_frame_buffer` with an explicit macro `HDLC_MAX_FRAME_SIZE` in the standalone `spi-hdlc-adapter` tool. Previously, `escaped_frame_buffer` was sized statically to `MAX_FRAME_SIZE * 2` (4096 bytes). While this size is mathematically sufficient to hold a worst-case escaped payload (4091 bytes for a 2043-byte max payload, 4 escaped CRC bytes, and 1 flag byte), it was not self-documenting and relied on implicit math. This commit defines `HDLC_MAX_FRAME_SIZE` explicitly as: `((MAX_FRAME_SIZE - HEADER_LEN) * 2 + 5)` making the worst-case framing overhead bounds clear and robust to any future changes to the constants.