Fix/embedded defaults#11
Merged
Merged
Conversation
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.
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.
No description provided.