Skip to content

Fix/embedded defaults#11

Merged
odudex merged 4 commits into
mainfrom
fix/embedded-defaults
Jul 12, 2026
Merged

Fix/embedded defaults#11
odudex merged 4 commits into
mainfrom
fix/embedded-defaults

Conversation

@odudex

@odudex odudex commented Jul 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

odudex added 4 commits July 12, 2026 08:15
cUR's primary audience is embedded integrators, where 8 KB of flash for a CRC lookup table is a real cost while the CRC itself runs over individual fragments (a few hundred bytes per QR frame) and is never the bottleneck. Flip UR_CRC32_SLICE_BY_8 to default-off in all three build paths (Kconfig, host CMake, Makefile). CI keeps building both variants: the PC job's explicit run now covers slice-by-8, and the ESP-IDF smoke component force-enables it unconditionally.
ur_xor/ur_xor_inplace are now defined twice, one is a complete PIE vector version, other a complete portable version, selected by one top-level ifdef, mirroring crc32.c; no conditional compilation remains inside function bodies. The portable loop chunks by pointer width (uint32_t on 32-bit targets, uint64_t on 64-bit) instead of always uint64_t, so 32-bit CPUs don't emulate 64-bit arithmetic with register pairs. The memcpy word-access idiom stays: it is the aliasing- and alignment-safe form and compiles to the same plain loads/stores a pointer cast would give, without the undefined behavior. Behavior is unchanged; the P4 branch compile-checked with riscv32-esp-elf-gcc 14.2 (-march=..._xesppie) and the vector body verified present in the disassembly.
The option is gated by the CPU (depends on IDF_TARGET_ESP32P4, which ESP-IDF sets automatically), falls back transparently on unaligned data, and costs no RAM, so builders on P4 get it without hunting for platform defines, and menuconfig remains the opt-out. Addresses the review ask that fast paths be selected by CPU defines rather than discovered flag-by-flag.
…at note

README gains one table listing every UR_* knob with its default and cost, so integrators see the whole configuration surface in one place instead of hunting through source files. The legacy K210 port is reduced to a minimal compatibility note, the link-error flag is the one thing an integrator must know.
@odudex odudex merged commit e2dca6a into main Jul 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant