aboutsummaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2021-06-18 01:09:43 +0200
committerGitHub <noreply@github.com>2021-06-18 00:09:43 +0100
commitef92c9ee2cf4745637635ec1895399e4f013914c (patch)
tree25184a0ad78399826ee585571e69b5df4beaa34b /common_features.mk
parent67fa2568fe1f17942bf61462754e0be5a6bc3223 (diff)
downloadqmk_firmware-ef92c9ee2cf4745637635ec1895399e4f013914c.tar.gz
qmk_firmware-ef92c9ee2cf4745637635ec1895399e4f013914c.zip
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.
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/common_features.mk b/common_features.mk
index b259af46c..1a079a8df 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -530,6 +530,7 @@ endif
530ifeq ($(strip $(SPLIT_KEYBOARD)), yes) 530ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
531 POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h 531 POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
532 OPT_DEFS += -DSPLIT_KEYBOARD 532 OPT_DEFS += -DSPLIT_KEYBOARD
533 CRC_ENABLE := yes
533 534
534 # Include files used by all split keyboards 535 # Include files used by all split keyboards
535 QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c 536 QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c
@@ -557,6 +558,11 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
557 COMMON_VPATH += $(QUANTUM_PATH)/split_common 558 COMMON_VPATH += $(QUANTUM_PATH)/split_common
558endif 559endif
559 560
561ifeq ($(strip $(CRC_ENABLE)), yes)
562 OPT_DEFS += -DCRC_ENABLE
563 QUANTUM_LIB_SRC += crc.c
564endif
565
560HAPTIC_ENABLE ?= no 566HAPTIC_ENABLE ?= no
561ifneq ($(strip $(HAPTIC_ENABLE)),no) 567ifneq ($(strip $(HAPTIC_ENABLE)),no)
562 COMMON_VPATH += $(DRIVER_PATH)/haptic 568 COMMON_VPATH += $(DRIVER_PATH)/haptic