Add CRC8 calculation subsystem to quantum (#12641)
* Intended usage is data validation in split transport code. * Default space efficient algorithm. * Opt-in fast table based algorithmn with #define CRC8_USE_TABLE switch. * Define switches for size and speed optimized versions, the default is size optimized by using uint_least8_t as datatype for calculations. * #define CRC8_OPTIMIZE_SPEED uses uint_fast8_t as datatype for calculations, this only affects 32-bit Archs like ARM and RISC-V. * Placeholder crc_init() function for hardware backed crc calculation, not implemented yet.
This commit is contained in:
parent
67fa2568fe
commit
ef92c9ee2c
4 changed files with 115 additions and 0 deletions
|
@ -530,6 +530,7 @@ endif
|
|||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||
POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
|
||||
OPT_DEFS += -DSPLIT_KEYBOARD
|
||||
CRC_ENABLE := yes
|
||||
|
||||
# Include files used by all split keyboards
|
||||
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c
|
||||
|
@ -557,6 +558,11 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
|||
COMMON_VPATH += $(QUANTUM_PATH)/split_common
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CRC_ENABLE)), yes)
|
||||
OPT_DEFS += -DCRC_ENABLE
|
||||
QUANTUM_LIB_SRC += crc.c
|
||||
endif
|
||||
|
||||
HAPTIC_ENABLE ?= no
|
||||
ifneq ($(strip $(HAPTIC_ENABLE)),no)
|
||||
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue