Skip to main content

Flash Optimization

Eight switch combinations cover the full range from ultra-minimal to fully-featured.

Profile Matrix (ATmega328P, avr-gcc -Os)

ProfileOSRX_NO_PARSEROSRX_NO_TIMESTAMPOSRX_VALIDATE_CRC8OSRX_VALIDATE_CRC16FlashRAM
Full defaults0011~616 B102 B
No timestamp0111~596 B98 B
No CRC80001~536 B102 B
No CRC8 + no TS0101~516 B98 B
No parser1011~442 B0 B
No parser + no TS1111~422 B0 B
No parser + no CRC81001~362 B0 B
Ultra (all off)1100~280 B0 B

Per-Switch Guidance

OSRX_NO_PARSER=1 — Biggest win. Disables OSRXParser; saves 316 B Flash + 102 B RAM. Required for ATtiny85 / ATmega48.

OSRX_NO_TIMESTAMP=1 — Low risk. Removes s_sec from meta struct; saves 20 B Flash + 4 B RAM. Safe if you don't need timestamp.

OSRX_VALIDATE_CRC8=0 — Medium risk. Skips body CRC-8 check; accepts corrupt body. Use only on noise-free links.

OSRX_VALIDATE_CRC16=0 — High risk. Skips full-frame CRC-16. Not recommended in any production setting.

CRC Trade-offs

The bit-loop CRC implementation costs ~80 B Flash and 0 B RAM per CRC algorithm. Lookup-table implementations would be faster but cost 256 B RAM for CRC-8 or 512 B for CRC-16 — unacceptable on devices with 512 B–1 KB total RAM.