diff --git a/.github/labeler.yml b/.github/labeler.yml index 270cd1a81369..82f9672bb7a4 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -54,3 +54,7 @@ dd: - data/constants/** - data/mappings/** - data/schemas/** +community_module: + - changed-files: + - any-glob-to-any-file: + - modules/** diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 74c518fe0512..b4e32f981bbe 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -10,6 +10,7 @@ on: - 'lib/arm_atsam/**' - 'lib/lib8tion/**' - 'lib/python/**' + - 'modules/**' - 'platforms/**' - 'quantum/**' - 'tests/**' diff --git a/Makefile b/Makefile index 5fcd6bbf0f38..c68ee7418a4a 100644 --- a/Makefile +++ b/Makefile @@ -113,6 +113,29 @@ endef # Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND) +# As TRY_TO_MATCH_RULE_FROM_LIST_HELPER, but with additional +# resolution of DEFAULT_FOLDER and keyboard_aliases.hjson for provided rule +define TRY_TO_MATCH_RULE_FROM_LIST_HELPER_KB + # Split on ":", padding with empty strings to avoid indexing issues + TOKEN1:=$$(shell python3 -c "import sys; print((sys.argv[1].split(':',1)+[''])[0])" $$(RULE)) + TOKENr:=$$(shell python3 -c "import sys; print((sys.argv[1].split(':',1)+[''])[1])" $$(RULE)) + + TOKEN1:=$$(shell $(QMK_BIN) resolve-alias --allow-unknown $$(TOKEN1)) + + FOUNDx:=$$(shell echo $1 | tr " " "\n" | grep -Fx $$(TOKEN1)) + ifneq ($$(FOUNDx),) + RULE := $$(TOKENr) + RULE_FOUND := true + MATCHED_ITEM := $$(TOKEN1) + else + RULE_FOUND := false + MATCHED_ITEM := + endif +endef + +# Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST_KB +TRY_TO_MATCH_RULE_FROM_LIST_KB = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER_KB,$1))$(RULE_FOUND) + define ALL_IN_LIST_LOOP OLD_RULE$1 := $$(RULE) $$(eval $$(call $1,$$(ITEM$1))) @@ -138,7 +161,7 @@ define PARSE_RULE $$(eval $$(call PARSE_TEST)) # If the rule starts with the name of a known keyboard, then continue # the parsing from PARSE_KEYBOARD - else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell $(QMK_BIN) list-keyboards --no-resolve-defaults)),true) + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST_KB,$$(shell $(QMK_BIN) list-keyboards)),true) KEYBOARD_RULE=$$(MATCHED_ITEM) $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) else @@ -170,17 +193,6 @@ define PARSE_KEYBOARD # include the correct makefile to determine the actual name of it CURRENT_KB := $1 - # KEYBOARD_FOLDERS := $$(subst /, , $(CURRENT_KB)) - - DEFAULT_FOLDER := $$(CURRENT_KB) - - # We assume that every rules.mk will contain the full default value - $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/rules.mk) - ifneq ($$(DEFAULT_FOLDER),$$(CURRENT_KB)) - $$(eval include $(ROOT_DIR)/keyboards/$$(DEFAULT_FOLDER)/rules.mk) - endif - CURRENT_KB := $$(DEFAULT_FOLDER) - # 5/4/3/2/1 KEYBOARD_FOLDER_PATH_1 := $$(CURRENT_KB) KEYBOARD_FOLDER_PATH_2 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_1))) diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk index 7d58c29462ac..c5fc9cd25d02 100644 --- a/builddefs/build_keyboard.mk +++ b/builddefs/build_keyboard.mk @@ -112,6 +112,39 @@ endif ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","") include $(KEYBOARD_PATH_1)/rules.mk endif +# Create dependencies on DD keyboard config - structure validated elsewhere +DD_CONFIG_FILES := +ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_1)/info.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_2)/info.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_3)/info.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_4)/info.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_5)/info.json +endif + +ifneq ("$(wildcard $(KEYBOARD_PATH_1)/keyboard.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_1)/keyboard.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_2)/keyboard.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_2)/keyboard.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_3)/keyboard.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_3)/keyboard.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_4)/keyboard.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_4)/keyboard.json +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/keyboard.json)","") + DD_CONFIG_FILES += $(KEYBOARD_PATH_5)/keyboard.json +endif MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP) MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP) @@ -207,17 +240,17 @@ ifneq ("$(wildcard $(KEYMAP_JSON))", "") include $(INFO_RULES_MK) # Add rules to generate the keymap files - indentation here is important -$(INTERMEDIATE_OUTPUT)/src/keymap.c: $(KEYMAP_JSON) +$(INTERMEDIATE_OUTPUT)/src/keymap.c: $(KEYMAP_JSON) $(DD_CONFIG_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) $(eval CMD=$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)) @$(BUILD_CMD) -$(INTERMEDIATE_OUTPUT)/src/config.h: $(KEYMAP_JSON) +$(INTERMEDIATE_OUTPUT)/src/config.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) $(eval CMD=$(QMK_BIN) generate-config-h --quiet --output $(KEYMAP_H) $(KEYMAP_JSON)) @$(BUILD_CMD) -$(INTERMEDIATE_OUTPUT)/src/keymap.h: $(KEYMAP_JSON) +$(INTERMEDIATE_OUTPUT)/src/keymap.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) $(eval CMD=$(QMK_BIN) generate-keymap-h --quiet --output $(INTERMEDIATE_OUTPUT)/src/keymap.h $(KEYMAP_JSON)) @$(BUILD_CMD) @@ -226,6 +259,32 @@ generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/ endif +# Community modules +$(INTERMEDIATE_OUTPUT)/src/community_modules.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-community-modules-h -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(KEYMAP_JSON)) + @$(BUILD_CMD) + +$(INTERMEDIATE_OUTPUT)/src/community_modules.c: $(KEYMAP_JSON) $(DD_CONFIG_FILES) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-community-modules-c -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_modules.c $(KEYMAP_JSON)) + @$(BUILD_CMD) + +$(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c: $(KEYMAP_JSON) $(DD_CONFIG_FILES) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-community-modules-introspection-c -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c $(KEYMAP_JSON)) + @$(BUILD_CMD) + +$(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-community-modules-introspection-h -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h $(KEYMAP_JSON)) + @$(BUILD_CMD) + +SRC += $(INTERMEDIATE_OUTPUT)/src/community_modules.c + +generated-files: $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(INTERMEDIATE_OUTPUT)/src/community_modules.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h + + include $(BUILDDEFS_PATH)/converters.mk # Generate the board's version.h file. @@ -315,6 +374,14 @@ endif # Find all of the config.h files and add them to our CONFIG_H define. CONFIG_H := + +define config_h_community_module_appender + ifneq ("$(wildcard $(1)/config.h)","") + CONFIG_H += $(1)/config.h + endif +endef +$(foreach module,$(COMMUNITY_MODULE_PATHS),$(eval $(call config_h_community_module_appender,$(module)))) + ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","") CONFIG_H += $(KEYBOARD_PATH_5)/config.h endif @@ -332,6 +399,14 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","") endif POST_CONFIG_H := + +define post_config_h_community_module_appender + ifneq ("$(wildcard $(1)/post_config.h)","") + POST_CONFIG_H += $(1)/post_config.h + endif +endef +$(foreach module,$(COMMUNITY_MODULE_PATHS),$(eval $(call post_config_h_community_module_appender,$(module)))) + ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_config.h)","") POST_CONFIG_H += $(KEYBOARD_PATH_1)/post_config.h endif @@ -348,40 +423,6 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","") POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h endif -# Create dependencies on DD keyboard config - structure validated elsewhere -DD_CONFIG_FILES := -ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_1)/info.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_2)/info.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_3)/info.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_4)/info.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_5)/info.json -endif - -ifneq ("$(wildcard $(KEYBOARD_PATH_1)/keyboard.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_1)/keyboard.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_2)/keyboard.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_2)/keyboard.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_3)/keyboard.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_3)/keyboard.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_4)/keyboard.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_4)/keyboard.json -endif -ifneq ("$(wildcard $(KEYBOARD_PATH_5)/keyboard.json)","") - DD_CONFIG_FILES += $(KEYBOARD_PATH_5)/keyboard.json -endif - CONFIG_H += $(INTERMEDIATE_OUTPUT)/src/info_config.h KEYBOARD_SRC += $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c @@ -462,6 +503,13 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_rules.mk)","") include $(KEYBOARD_PATH_5)/post_rules.mk endif +define post_rules_mk_community_module_includer + ifneq ("$(wildcard $(1)/post_rules.mk)","") + include $(1)/post_rules.mk + endif +endef +$(foreach module,$(COMMUNITY_MODULE_PATHS),$(eval $(call post_rules_mk_community_module_includer,$(module)))) + ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") CONFIG_H += $(KEYMAP_PATH)/config.h endif diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index bb272099a67e..c88ce36011c8 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -635,6 +635,10 @@ ifeq ($(strip $(VIA_ENABLE)), yes) TRI_LAYER_ENABLE := yes endif +ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes) + SEND_STRING_ENABLE := yes +endif + VALID_CUSTOM_MATRIX_TYPES:= yes lite no CUSTOM_MATRIX ?= no @@ -940,6 +944,8 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) OPT_DEFS += -DWS2812_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(DRIVER_PATH)/led + SRC += ws2812.c ws2812_$(strip $(WS2812_DRIVER)).c ifeq ($(strip $(PLATFORM)), CHIBIOS) diff --git a/data/constants/keycodes/extras/keycodes_eurkey_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_eurkey_0.0.1.hjson new file mode 100644 index 000000000000..9ff217cff263 --- /dev/null +++ b/data/constants/keycodes/extras/keycodes_eurkey_0.0.1.hjson @@ -0,0 +1,596 @@ +{ + "aliases": { +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "KC_GRV": { + "key": "EU_GRV", + "label": "`", + } + "KC_1": { + "key": "EU_1", + "label": "1", + } + "KC_2": { + "key": "EU_2", + "label": "2", + } + "KC_3": { + "key": "EU_3", + "label": "3", + } + "KC_4": { + "key": "EU_4", + "label": "4", + } + "KC_5": { + "key": "EU_5", + "label": "5", + } + "KC_6": { + "key": "EU_6", + "label": "6", + } + "KC_7": { + "key": "EU_7", + "label": "7", + } + "KC_8": { + "key": "EU_8", + "label": "8", + } + "KC_9": { + "key": "EU_9", + "label": "9", + } + "KC_0": { + "key": "EU_0", + "label": "0", + } + "KC_MINS": { + "key": "EU_MINS", + "label": "-", + } + "KC_EQL": { + "key": "EU_EQL", + "label": "=", + } + "KC_Q": { + "key": "EU_Q", + "label": "Q", + } + "KC_W": { + "key": "EU_W", + "label": "W", + } + "KC_E": { + "key": "EU_E", + "label": "E", + } + "KC_R": { + "key": "EU_R", + "label": "R", + } + "KC_T": { + "key": "EU_T", + "label": "T", + } + "KC_Y": { + "key": "EU_Y", + "label": "Y", + } + "KC_U": { + "key": "EU_U", + "label": "U", + } + "KC_I": { + "key": "EU_I", + "label": "I", + } + "KC_O": { + "key": "EU_O", + "label": "O", + } + "KC_P": { + "key": "EU_P", + "label": "P", + } + "KC_LBRC": { + "key": "EU_LBRC", + "label": "[", + } + "KC_RBRC": { + "key": "EU_RBRC", + "label": "]", + } + "KC_BSLS": { + "key": "EU_BSLS", + "label": "\\", + } + "KC_A": { + "key": "EU_A", + "label": "A", + } + "KC_S": { + "key": "EU_S", + "label": "S", + } + "KC_D": { + "key": "EU_D", + "label": "D", + } + "KC_F": { + "key": "EU_F", + "label": "F", + } + "KC_G": { + "key": "EU_G", + "label": "G", + } + "KC_H": { + "key": "EU_H", + "label": "H", + } + "KC_J": { + "key": "EU_J", + "label": "J", + } + "KC_K": { + "key": "EU_K", + "label": "K", + } + "KC_L": { + "key": "EU_L", + "label": "L", + } + "KC_SCLN": { + "key": "EU_SCLN", + "label": ";", + } + "KC_QUOT": { + "key": "EU_QUOT", + "label": "'", + } + "KC_Z": { + "key": "EU_Z", + "label": "Z", + } + "KC_X": { + "key": "EU_X", + "label": "X", + } + "KC_C": { + "key": "EU_C", + "label": "C", + } + "KC_V": { + "key": "EU_V", + "label": "V", + } + "KC_B": { + "key": "EU_B", + "label": "B", + } + "KC_N": { + "key": "EU_N", + "label": "N", + } + "KC_M": { + "key": "EU_M", + "label": "M", + } + "KC_COMM": { + "key": "EU_COMM", + "label": ",", + } + "KC_DOT": { + "key": "EU_DOT", + "label": ".", + } + "KC_SLSH": { + "key": "EU_SLSH", + "label": "/", + } +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ | │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ : │ " │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ < │ > │ ? │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "S(EU_GRV)": { + "key": "EU_TILD", + "label": "~", + } + "S(EU_1)": { + "key": "EU_EXLM", + "label": "!", + } + "S(EU_2)": { + "key": "EU_AT", + "label": "@", + } + "S(EU_3)": { + "key": "EU_HASH", + "label": "#", + } + "S(EU_4)": { + "key": "EU_DLR", + "label": "$", + } + "S(EU_5)": { + "key": "EU_PERC", + "label": "%", + } + "S(EU_6)": { + "key": "EU_CIRC", + "label": "^", + } + "S(EU_7)": { + "key": "EU_AMPR", + "label": "&", + } + "S(EU_8)": { + "key": "EU_ASTR", + "label": "*", + } + "S(EU_9)": { + "key": "EU_LPRN", + "label": "(", + } + "S(EU_0)": { + "key": "EU_RPRN", + "label": ")", + } + "S(EU_MINS)": { + "key": "EU_UNDS", + "label": "_", + } + "S(EU_EQL)": { + "key": "EU_PLUS", + "label": "+", + } + "S(EU_LBRC)": { + "key": "EU_LCBR", + "label": "{", + } + "S(EU_RBRC)": { + "key": "EU_RCBR", + "label": "}", + } + "S(EU_BSLS)": { + "key": "EU_PIPE", + "label": "|", + } + "S(EU_SCLN)": { + "key": "EU_COLN", + "label": ":", + } + "S(EU_QUOT)": { + "key": "EU_DQUO", + "label": "\"", + } + "S(EU_COMM)": { + "key": "EU_LABK", + "label": "<", + } + "S(EU_DOT)": { + "key": "EU_RABK", + "label": ">", + } + "S(EU_SLSH)": { + "key": "EU_QUES", + "label": "?", + } +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ ¡ │ ª │ º │ £ │ € │ ^ │ ˚ │ „ │ “ │ ” │ – │ × │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ æ │ å │ ë │ ý │ þ │ ÿ │ ü │ ï │ ö │ œ │ « │ » │ ¬ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ ä │ ß │ ð │ è │ é │ ù │ ú │ ij │ ø │ ° │ ´ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ à │ á │ ç │ ì │ í │ ñ │ μ │ ò │ ó │ ¿ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(EU_GRV)": { + "key": "EU_DGRV", + "label": "` (dead)", + } + "ALGR(EU_1)": { + "key": "EU_IEXL", + "label": "¡", + } + "ALGR(EU_2)": { + "key": "EU_FORD", + "label": "ª", + } + "ALGR(EU_3)": { + "key": "EU_MORD", + "label": "º", + } + "ALGR(EU_4)": { + "key": "EU_PND", + "label": "£", + } + "ALGR(EU_5)": { + "key": "EU_EURO", + "label": "€", + } + "ALGR(EU_6)": { + "key": "EU_DCIR", + "label": "^ (dead)", + } + "ALGR(EU_7)": { + "key": "EU_RNGA", + "label": "˚ (dead)", + } + "ALGR(EU_8)": { + "key": "EU_DLQU", + "label": "„", + } + "ALGR(EU_9)": { + "key": "EU_LDQU", + "label": "“", + } + "ALGR(EU_0)": { + "key": "EU_RDQU", + "label": "”", + } + "ALGR(EU_MINS)": { + "key": "EU_NDSH", + "label": "–", + } + "ALGR(EU_EQL)": { + "key": "EU_MUL", + "label": "×", + } + "ALGR(EU_Q)": { + "key": "EU_AE", + "label": "æ", + } + "ALGR(EU_W)": { + "key": "EU_ARNG", + "label": "Å", + } + "ALGR(EU_E)": { + "key": "EU_EDIA", + "label": "Ë", + } + "ALGR(EU_R)": { + "key": "EU_YACU", + "label": "Ý", + } + "ALGR(EU_T)": { + "key": "EU_THRN", + "label": "Þ", + } + "ALGR(EU_Y)": { + "key": "EU_YDIA", + "label": "Ÿ", + } + "ALGR(EU_U)": { + "key": "EU_UDIA", + "label": "Ü", + } + "ALGR(EU_I)": { + "key": "EU_IDIA", + "label": "Ï", + } + "ALGR(EU_O)": { + "key": "EU_ODIA", + "label": "Ö", + } + "ALGR(EU_P)": { + "key": "EU_OE", + "label": "Œ", + } + "ALGR(EU_LBRC)": { + "key": "EU_LDAQ", + "label": "«", + } + "ALGR(EU_RBRC)": { + "key": "EU_RDAQ", + "label": "»", + } + "ALGR(EU_BSLS)": { + "key": "EU_NOT", + "label": "¬", + } + "ALGR(EU_A)": { + "key": "EU_ADIA", + "label": "Ä", + } + "ALGR(EU_S)": { + "key": "EU_SS", + "label": "ß", + } + "ALGR(EU_D)": { + "key": "EU_ETH", + "label": "Ð", + } + "ALGR(EU_F)": { + "key": "EU_EGRV", + "label": "È", + } + "ALGR(EU_G)": { + "key": "EU_EACU", + "label": "É", + } + "ALGR(EU_H)": { + "key": "EU_UGRV", + "label": "Ù", + } + "ALGR(EU_J)": { + "key": "EU_UACU", + "label": "Ú", + } + "ALGR(EU_K)": { + "key": "EU_IJ", + "label": "IJ", + } + "ALGR(EU_L)": { + "key": "EU_OSTR", + "label": "Ø", + } + "ALGR(EU_SCLN)": { + "key": "EU_DEG", + "label": "°", + } + "ALGR(EU_QUOT)": { + "key": "EU_ACUT", + "label": "´ (dead)", + } + "ALGR(EU_Z)": { + "key": "EU_AGRV", + "label": "À", + } + "ALGR(EU_X)": { + "key": "EU_AACU", + "label": "Á", + } + "ALGR(EU_C)": { + "key": "EU_CCED", + "label": "Ç", + } + "ALGR(EU_V)": { + "key": "EU_IGRV", + "label": "Ì", + } + "ALGR(EU_B)": { + "key": "EU_IACU", + "label": "Í", + } + "ALGR(EU_N)": { + "key": "EU_NTIL", + "label": "Ñ", + } + "ALGR(EU_M)": { + "key": "EU_DGRK", + "label": "μ (dead Greek key)", + } + "ALGR(EU_COMM)": { + "key": "EU_OGRV", + "label": "Ò", + } + "ALGR(EU_DOT)": { + "key": "EU_OACU", + "label": "Ó", + } + "ALGR(EU_SLSH)": { + "key": "EU_IQUE", + "label": "¿", + } +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ¹ │ ² │ ³ │ ¥ │ ¢ │ ˇ │ ¯ │ ‚ │ ‘ │ ’ │ — │ ÷ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ ‹ │ › │ ¦ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ § │ │ │ │ │ │ │ │ · │ ¨ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ … │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + "ALGR(EU_TILD)": { + "key": "EU_DTIL", + "label": "~ (dead)", + } + "S(ALGR(EU_1))": { + "key": "EU_SUP1", + "label": "¹", + } + "S(ALGR(EU_2))": { + "key": "EU_SUP2", + "label": "²", + } + "S(ALGR(EU_3))": { + "key": "EU_SUP3", + "label": "³", + } + "ALGR(EU_DLR)": { + "key": "EU_YEN", + "label": "¥", + } + "S(EU_EURO)": { + "key": "EU_CENT", + "label": "¢", + } + "S(EU_DCIR)": { + "key": "EU_CARN", + "label": "ˇ (dead)", + } + "S(ALGR(EU_7))": { + "key": "EU_MACR", + "label": "¯ (dead)", + } + "S(EU_DLQU)": { + "key": "EU_SLQU", + "label": "‚", + } + "S(EU_LDQU)": { + "key": "EU_LSQU", + "label": "‘", + } + "S(EU_RDQU)": { + "key": "EU_RSQU", + "label": "’", + } + "S(EU_NDSH)": { + "key": "EU_MDSH", + "label": "—", + } + "S(EU_MUL)": { + "key": "EU_DIV", + "label": "÷", + } + "S(EU_LDAQ)": { + "key": "EU_LSAQ", + "label": "‹", + } + "S(EU_RDAQ)": { + "key": "EU_RSAQ", + "label": "›", + } + "S(ALGR(EU_BSLS))": { + "key": "EU_BRKP", + "label": "¦", + } + "S(ALGR(EU_S))": { + "key": "EU_SECT", + "label": "§", + } + "S(ALGR(EU_SCLN))": { + "key": "EU_MDDT", + "label": "·", + } + "ALGR(EU_DQUO)": { + "key": "EU_DIAE", + "label": "¨ (dead)", + } + "ALGR(EU_QUES)": { + "key": "EU_ELLP", + "label": "…", + } + } +} \ No newline at end of file diff --git a/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson b/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson index d59b6fab2642..68d209a5f3bd 100644 --- a/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson +++ b/data/constants/keycodes/extras/keycodes_farsi_0.0.1.hjson @@ -527,7 +527,7 @@ "key": "FA_PIPE", "label": "|", } - "ALGR(FA_RA)": { + "ALGR(FA_RE)": { "key": "FA_SUBA", "label": "ٖ", } diff --git a/data/constants/keycodes/keycodes_0.0.7.hjson b/data/constants/keycodes/keycodes_0.0.7.hjson new file mode 100644 index 000000000000..52e1a504438c --- /dev/null +++ b/data/constants/keycodes/keycodes_0.0.7.hjson @@ -0,0 +1,7 @@ +{ + "ranges": { + "0x77C0/0x003F": { + "define": "QK_COMMUNITY_MODULE" + } + } +} diff --git a/data/constants/module_hooks/0.1.0.hjson b/data/constants/module_hooks/0.1.0.hjson new file mode 100644 index 000000000000..c77f4c297e29 --- /dev/null +++ b/data/constants/module_hooks/0.1.0.hjson @@ -0,0 +1,25 @@ +{ + keyboard_pre_init: { + ret_type: void + args: void + } + keyboard_post_init: { + ret_type: void + args: void + } + pre_process_record: { + ret_type: bool + args: uint16_t keycode, keyrecord_t *record + call_params: keycode, record + } + process_record: { + ret_type: bool + args: uint16_t keycode, keyrecord_t *record + call_params: keycode, record + } + post_process_record: { + ret_type: void + args: uint16_t keycode, keyrecord_t *record + call_params: keycode, record + } +} diff --git a/data/constants/module_hooks/1.0.0.hjson b/data/constants/module_hooks/1.0.0.hjson new file mode 100644 index 000000000000..4e7bf3041260 --- /dev/null +++ b/data/constants/module_hooks/1.0.0.hjson @@ -0,0 +1,26 @@ +{ + housekeeping_task: { + ret_type: void + args: void + } + suspend_power_down: { + ret_type: void + args: void + } + suspend_wakeup_init: { + ret_type: void + args: void + } + shutdown: { + ret_type: bool + args: bool jump_to_bootloader + call_params: jump_to_bootloader + } + process_detected_host_os: { + ret_type: bool + args: os_variant_t os + call_params: os + guard: defined(OS_DETECTION_ENABLE) + header: os_detection.h + } +} diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson index 8d3e3c7f0ee9..b643553b5268 100644 --- a/data/mappings/info_config.hjson +++ b/data/mappings/info_config.hjson @@ -200,6 +200,7 @@ "SPLIT_WPM_ENABLE": {"info_key": "split.transport.sync.wpm", "value_type": "flag"}, // Tapping + "CHORDAL_HOLD": {"info_key": "tapping.chordal_hold", "value_type": "flag"}, "HOLD_ON_OTHER_KEY_PRESS": {"info_key": "tapping.hold_on_other_key_press", "value_type": "flag"}, "HOLD_ON_OTHER_KEY_PRESS_PER_KEY": {"info_key": "tapping.hold_on_other_key_press_per_key", "value_type": "flag"}, "PERMISSIVE_HOLD": {"info_key": "tapping.permissive_hold", "value_type": "flag"}, diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson index 64972af63b0e..00685b5b5f5a 100644 --- a/data/mappings/info_rules.hjson +++ b/data/mappings/info_rules.hjson @@ -55,5 +55,6 @@ // Items we want flagged in lint "CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"}, "CONVERT_TO_PROTON_C": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"}, + "DEFAULT_FOLDER": {"info_key": "_deprecated.default_folder", "deprecated": true}, "VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true} } diff --git a/data/mappings/keyboard_aliases.hjson b/data/mappings/keyboard_aliases.hjson index 72f6994c096d..b601a427616f 100644 --- a/data/mappings/keyboard_aliases.hjson +++ b/data/mappings/keyboard_aliases.hjson @@ -140,6 +140,9 @@ "custommk/genesis": { "target": "custommk/genesis/rev1" }, + "cxt_studio":{ + "target":"cxt_studio/12e4" + }, "daisy": { "target": "ktec/daisy" }, @@ -194,6 +197,9 @@ "ergodone": { "target": "ktec/ergodone" }, + "ergodox_stm32": { + "target": "handwired/ergodox_stm32" + }, "ergoinu": { "target": "dm9records/ergoinu" }, @@ -1515,6 +1521,9 @@ "ymd96": { "target": "ymdk/ymd96" }, + "ymdk/id75": { + "target": "ymdk/id75/f103" + }, "ymdk_np21": { "target": "ymdk/np21" }, @@ -1552,5 +1561,687 @@ }, "dnworks/9973": { "target": "dnworks/tkl87" + }, + // DEFAULT_FOLDER removed during 2025 Q1 cycle + "0_sixty": { + "target": "0_sixty/base" + }, + "0xcb/splaytoraid": { + "target": "0xcb/splaytoraid/rp2040_ce" + }, + "1upkeyboards/pi40": { + "target": "1upkeyboards/pi40/mit_v1_0" + }, + "1upkeyboards/pi50": { + "target": "1upkeyboards/pi50/grid" + }, + "1upkeyboards/sweet16": { + "target": "1upkeyboards/sweet16/v1" + }, + "25keys/aleth42": { + "target": "25keys/aleth42/rev1" + }, + "25keys/zinc": { + "target": "25keys/zinc/rev1" + }, + "40percentclub/i75": { + "target": "40percentclub/i75/promicro" + }, + "40percentclub/polyandry": { + "target": "40percentclub/polyandry/promicro" + }, + "8pack": { + "target": "8pack/rev12" + }, + "adkb96": { + "target": "adkb96/rev1" + }, + "adm42": { + "target": "adm42/rev4" + }, + "aeboards/satellite": { + "target": "aeboards/satellite/rev1" + }, + "atreus": { + "target": "atreus/astar" + }, + "atreyu": { + "target": "atreyu/rev1" + }, + "biacco42/ergo42": { + "target": "biacco42/ergo42/rev1" + }, + "binepad/bn009": { + "target": "binepad/bn009/r2" + }, + "binepad/bnr1": { + "target": "binepad/bnr1/v2" + }, + "boston_meetup": { + "target": "boston_meetup/2019" + }, + "bpiphany/frosty_flake": { + "target": "bpiphany/frosty_flake/20140521" + }, + "buzzard": { + "target": "buzzard/rev1" + }, + "cannonkeys/db60": { + "target": "cannonkeys/db60/rev2" + }, + "clickety_split/leeloo": { + "target": "clickety_split/leeloo/rev3" + }, + "converter/palm_usb": { + "target": "converter/palm_usb/stowaway" + }, + "crkbd": { + "target": "crkbd/rev1" + }, + "dailycraft/bat43": { + "target": "dailycraft/bat43/rev2" + }, + "dailycraft/claw44": { + "target": "dailycraft/claw44/rev1" + }, + "dailycraft/sandbox": { + "target": "dailycraft/sandbox/rev2" + }, + "dailycraft/wings42": { + "target": "dailycraft/wings42/rev2" + }, + "delikeeb/vanana": { + "target": "delikeeb/vanana/rev2" + }, + "delikeeb/waaffle/rev3": { + "target": "delikeeb/waaffle/rev3/pro_micro" + }, + "deltasplit75": { + "target": "deltasplit75/v2" + }, + "drhigsby/ogurec": { + "target": "drhigsby/ogurec/left_pm" + }, + "duck/octagon": { + "target": "duck/octagon/v2" + }, + "duck/orion": { + "target": "duck/orion/v3" + }, + "ducky/one2mini": { + "target": "ducky/one2mini/1861st" + }, + "ducky/one2sf": { + "target": "ducky/one2sf/1967st" + }, + "dumbpad": { + "target": "dumbpad/v0x" + }, + "durgod/galaxy": { + "target": "durgod/dgk6x/galaxy" + }, + "durgod/venus": { + "target": "durgod/dgk6x/venus" + }, + "dztech/tofu/ii": { + "target": "dztech/tofu/ii/v1" + }, + "dztech/tofu/jr": { + "target": "dztech/tofu/jr/v1" + }, + "eco": { + "target": "eco/rev2" + }, + "ergoslab": { + "target": "ergoslab/rev1" + }, + "ergotravel": { + "target": "ergotravel/rev1" + }, + "evyd13/atom47": { + "target": "evyd13/atom47/rev4" + }, + "fortitude60": { + "target": "fortitude60/rev1" + }, + "fruitykeeb/fruitbar/r1": { + "target": "fruitykeeb/fruitbar/r1/promicro" + }, + "ghs/jem": { + "target": "ghs/jem/soldered" + }, + "hadron": { + "target": "hadron/ver2" + }, + "handwired/bento": { + "target": "handwired/bento/rev1" + }, + "handwired/dactyl_manuform/6x6": { + "target": "handwired/dactyl_manuform/6x6/promicro" + }, + "handwired/meck_tkl": { + "target": "handwired/meck_tkl/blackpill_f401" + }, + "handwired/ms_sculpt_mobile": { + "target": "handwired/ms_sculpt_mobile/teensy2pp" + }, + "handwired/onekey": { + "target": "handwired/onekey/promicro" + }, + "handwired/pill60": { + "target": "handwired/pill60/bluepill" + }, + "handwired/postageboard": { + "target": "handwired/postageboard/mini" + }, + "handwired/qc60": { + "target": "handwired/qc60/proto" + }, + "handwired/sono1": { + "target": "handwired/sono1/t2pp" + }, + "handwired/splittest": { + "target": "handwired/splittest/promicro" + }, + "handwired/stef9998/split_5x7": { + "target": "handwired/stef9998/split_5x7/rev1" + }, + "handwired/symmetric70_proto/promicro": { + "target": "handwired/symmetric70_proto/promicro/base" + }, + "handwired/symmetric70_proto/proton_c": { + "target": "handwired/symmetric70_proto/proton_c/base" + }, + "handwired/unk": { + "target": "handwired/unk/rev1" + }, + "handwired/xealous": { + "target": "handwired/xealous/rev1" + }, + "hillside/46": { + "target": "hillside/46/0_1" + }, + "hhkb/ansi": { + "target": "hhkb/ansi/32u4" + }, + "hillside/48": { + "target": "hillside/48/0_1" + }, + "hillside/52": { + "target": "hillside/52/0_1" + }, + "ibnuda/squiggle": { + "target": "ibnuda/squiggle/rev1" + }, + "idobao/id80/v1": { + "target": "idobao/id80/v2/ansi" + }, + "idobao/id80/v3": { + "target": "idobao/id80/v3/ansi" + }, + "inett_studio/sq80": { + "target": "inett_studio/sq80/hotswap_layout_i" + }, + "input_club/infinity60": { + "target": "input_club/infinity60/led" + }, + "jacky_studio/bear_65": { + "target": "jacky_studio/bear_65/rev1" + }, + "jacky_studio/piggy60/rev1": { + "target": "jacky_studio/piggy60/rev1/solder" + }, + "jadookb/jkb65": { + "target": "jadookb/jkb65/r1" + }, + "jian": { + "target": "jian/rev2" + }, + "jiran": { + "target": "jiran/rev1" + }, + "jorne": { + "target": "jorne/rev1" + }, + "junco": { + "target": "junco/rev1" + }, + "kakunpc/angel17": { + "target": "kakunpc/angel17/rev1" + }, + "kakunpc/angel64": { + "target": "kakunpc/angel64/rev1" + }, + "kakunpc/business_card": { + "target": "kakunpc/business_card/beta" + }, + "kakunpc/suihankey": { + "target": "kakunpc/suihankey/rev1" + }, + "kakunpc/suihankey/split": { + "target": "kakunpc/suihankey/split/rev1" + }, + "kapcave/paladinpad": { + "target": "kapcave/paladinpad/rev2" + }, + "kapl": { + "target": "kapl/rev1" + }, + "kbdfans/d45": { + "target": "kbdfans/d45/v2" + }, + "kbdfans/kbd75": { + "target": "kbdfans/kbd75/rev1" + }, + "keebio/bdn9": { + "target": "keebio/bdn9/rev1" + }, + "keebio/convolution": { + "target": "keebio/convolution/rev1" + }, + "keebio/foldkb": { + "target": "keebio/foldkb/rev1" + }, + "keebio/kbo5000": { + "target": "keebio/kbo5000/rev1" + }, + "keebio/levinson": { + "target": "keebio/levinson/rev2" + }, + "keebio/quefrency": { + "target": "keebio/quefrency/rev1" + }, + "keebio/rorschach": { + "target": "keebio/rorschach/rev1" + }, + "keebio/sinc": { + "target": "keebio/sinc/rev1" + }, + "keebio/viterbi": { + "target": "keebio/viterbi/rev2" + }, + "keycapsss/kimiko": { + "target": "keycapsss/kimiko/rev2" + }, + "keyhive/navi10": { + "target": "keyhive/navi10/rev3" + }, + "keyhive/uno": { + "target": "keyhive/uno/rev1" + }, + "kin80": { + "target": "kin80/blackpill401" + }, + "kumaokobo/kudox_full": { + "target": "kumaokobo/kudox_full/rev1" + }, + "kumaokobo/kudox_game": { + "target": "kumaokobo/kudox_game/rev2" + }, + "kumaokobo/kudox": { + "target": "kumaokobo/kudox/rev3" + }, + "kumaokobo/pico": { + "target": "kumaokobo/pico/65keys" + }, + "lazydesigners/dimple": { + "target": "lazydesigners/dimple/staggered/rev1" + }, + "lets_split": { + "target": "lets_split/rev2" + }, + "lfkeyboards/lfk87": { + "target": "lfkeyboards/lfk78/revc" + }, + "lily58": { + "target": "lily58/rev1" + }, + "lime": { + "target": "lime/rev1" + }, + "maple_computing/christmas_tree": { + "target": "maple_computing/christmas_tree/v2017" + }, + "maple_computing/ivy": { + "target": "maple_computing/ivy/rev1" + }, + "maple_computing/launchpad": { + "target": "maple_computing/launchpad/rev1" + }, + "maple_computing/minidox": { + "target": "maple_computing/minidox/rev1" + }, + "mariorion_v25": { + "target": "mariorion_v25/prod" + }, + "marksard/rhymestone": { + "target": "marksard/rhymestone/rev1" + }, + "marksard/treadstone32": { + "target": "marksard/treadstone32/rev1" + }, + "marksard/treadstone48": { + "target": "marksard/treadstone48/rev1" + }, + "maxipad": { + "target": "maxipad/promicro" + }, + "mechkeys/mechmini": { + "target": "mechkeys/mechmini/v2" + }, + "mechllama/g35": { + "target": "mechllama/g35/v2" + }, + "mechlovin/adelais": { + "target": "mechlovin/adelais/standard_led/arm/rev2" + }, + "mechlovin/adelais/standard_led/arm/rev4": { + "target": "mechlovin/adelais/standard_led/arm/rev4/stm32f303" + }, + "mechlovin/adelais/standard_led/arm": { + "target": "mechlovin/adelais/standard_led/arm/rev2" + }, + "mechlovin/adelais/standard_led/avr": { + "target": "mechlovin/adelais/standard_led/avr/rev1" + }, + "mechlovin/hannah65/rev1": { + "target": "mechlovin/hannah65/rev1/haus" + }, + "mechlovin/infinity87/rev1": { + "target": "mechlovin/infinity87/rev1/standard" + }, + "mechlovin/infinity87": { + "target": "mechlovin/infinity87/rgb_rev1" + }, + "mechlovin/mechlovin9": { + "target": "mechlovin/mechlovin9/rev1" + }, + "mechlovin/olly/jf": { + "target": "mechlovin/olly/jf/rev1" + }, + "mechlovin/zed1800": { + "target": "mechlovin/zed1800/saber" + }, + "mechlovin/zed65/no_backlight": { + "target": "mechlovin/zed65/no_backlight/wearhaus66" + }, + "mechlovin/zed65": { + "target": "mechlovin/zed65/no_backlight/wearhaus66" + }, + "mechwild/bde": { + "target": "mechwild/bde/rev2" + }, + "mechwild/mokulua": { + "target": "mechwild/mokulua/standard" + }, + "mechwild/obe/f401": { + "target": "mechwild/obe/f401/base" + }, + "mechwild/obe/f411": { + "target": "mechwild/obe/f411/base" + }, + "mechwild/obe": { + "target": "mechwild/obe/f401/base" + }, + "mechwild/waka60/f401": { + "target": "mechwild/waka60/f401/base" + }, + "mechwild/waka60/f411": { + "target": "mechwild/waka60/f411/base" + }, + "mechwild/waka60": { + "target": "mechwild/waka60/f401/base" + }, + "murcielago": { + "target": "murcielago/rev1" + }, + "nullbitsco/scramble": { + "target": "nullbitsco/scramble/v2" + }, + "omkbd/ergodash": { + "target": "omkbd/ergodash/rev1" + }, + "omkbd/runner3680": { + "target": "omkbd/runner3680/5x8" + }, + "orthodox": { + "target": "orthodox/rev3" + }, + "peej/rosaline": { + "target": "peej/rosaline/staggered" + }, + "peej/tripel": { + "target": "peej/tripel/left" + }, + "peranekofactory/tone": { + "target": "peranekofactory/tone/rev2" + }, + "phase_studio/titan65": { + "target": "phase_studio/titan65/hotswap" + }, + "pica40": { + "target": "pica40/rev2" + }, + "pinky": { + "target": "pinky/3" + }, + "ploopyco/madromys": { + "target": "ploopyco/madromys/rev1_001" + }, + "ploopyco/trackball_mini": { + "target": "ploopyco/trackball_mini/rev1_001" + }, + "ploopyco/trackball_nano": { + "target": "ploopyco/trackball_nano/rev1_001" + }, + "ploopyco/trackball_thumb": { + "target": "ploopyco/trackball_thumb/rev1_001" + }, + "primekb/meridian": { + "target": "primekb/meridian/ktr1010" + }, + "primekb/prime_e": { + "target": "primekb/prime_e/std" + }, + "program_yoink": { + "target": "program_yoink/staggered" + }, + "projectcain/vault35": { + "target": "projectcain/vault35/atmega32u4" + }, + "qpockets/space_space": { + "target": "qpockets/space_space/rev2" + }, + "qwertyydox": { + "target": "qwertyydox/rev1" + }, + "rate/pistachio": { + "target": "rate/pistachio/rev2" + }, + "recompile_keys/choco60": { + "target": "recompile_keys/choco60/rev1" + }, + "recompile_keys/nomu30": { + "target": "recompile_keys/nomu30/rev1" + }, + "redox/rev1": { + "target": "redox/rev1/base" + }, + "rgbkb/mun": { + "target": "rgbkb/mun/rev1" + }, + "rgbkb/sol3": { + "target": "rgbkb/sol3/rev1" + }, + "rgbkb/sol": { + "target": "rgbkb/sol/rev2" + }, + "rgbkb/zen": { + "target": "rgbkb/zen/rev2" + }, + "rgbkb/zygomorph": { + "target": "rgbkb/zygomorph/rev1" + }, + "rmi_kb/herringbone": { + "target": "rmi_kb/herringbone/v1" + }, + "rmi_kb/mona": { + "target": "rmi_kb/mona/v1_1" + }, + "rmi_kb/tkl_ff": { + "target": "rmi_kb/tkl_ff/v1" + }, + "rmi_kb/wete": { + "target": "rmi_kb/wete/v2" + }, + "rookiebwoy/late9": { + "target": "rookiebwoy/late9/rev1" + }, + "rookiebwoy/neopad": { + "target": "rookiebwoy/neopad/rev1" + }, + "rura66": { + "target": "rura66/rev1" + }, + "salicylic_acid3/7skb": { + "target": "salicylic_acid3/7skb/rev1" + }, + "salicylic_acid3/getta25": { + "target": "salicylic_acid3/getta25/rev1" + }, + "salicylic_acid3/jisplit89": { + "target": "salicylic_acid3/jisplit89/rev1" + }, + "salicylic_acid3/naked48": { + "target": "salicylic_acid3/naked48/rev1" + }, + "salicylic_acid3/naked60": { + "target": "salicylic_acid3/naked60/rev1" + }, + "salicylic_acid3/naked64": { + "target": "salicylic_acid3/naked64/rev1" + }, + "salicylic_acid3/setta21": { + "target": "salicylic_acid3/setta21/rev1" + }, + "sawnsprojects/okayu": { + "target": "sawnsprojects/okayu/stm32f072" + }, + "smoll/lefty": { + "target": "smoll/lefty/rev2" + }, + "sofle": { + "target": "sofle/rev1" + }, + "spaceholdings/nebula68b": { + "target": "spaceholdings/nebula68b/solder" + }, + "spacetime": { + "target": "spacetime/rev1" + }, + "splitkb/aurora/corne": { + "target": "splitkb/aurora/corne/rev1" + }, + "splitkb/aurora/helix": { + "target": "splitkb/aurora/helix/rev1" + }, + "splitkb/aurora/lily58": { + "target": "splitkb/aurora/lily58/rev1" + }, + "splitkb/aurora/sofle_v2": { + "target": "splitkb/aurora/sofle_v2/rev1" + }, + "splitkb/aurora/sweep": { + "target": "splitkb/aurora/sweep/rev1" + }, + "splitkb/kyria": { + "target": "splitkb/kyria/rev3" + }, + "splitkb/kyria/rev1": { + "target": "splitkb/kyria/rev1/base" + }, + "splitkb/kyria/rev2": { + "target": "splitkb/kyria/rev2/base" + }, + "splitty": { + "target": "splitty/rev1" + }, + "studiokestra/galatea": { + "target": "studiokestra/galatea/rev1" + }, + "takashiski/hecomi": { + "target": "takashiski/hecomi/alpha" + }, + "takashiski/namecard2x4": { + "target": "takashiski/namecard2x4/rev2" + }, + "teleport/native": { + "target": "teleport/native/iso" + }, + "themadnoodle/noodlepad": { + "target": "themadnoodle/noodlepad/v1" + }, + "tkw/grandiceps": { + "target": "tkw/grandiceps/rev1" + }, + "tominabox1/le_chiffre": { + "target": "tominabox1/le_chiffre/rev1" + }, + "tominabox1/littlefoot_lx": { + "target": "tominabox1/littlefoot_lx/rev1" + }, + "tominabox1/underscore33": { + "target": "tominabox1/underscore33/rev1" + }, + "trnthsn/e8ghty": { + "target": "trnthsn/e8ghty/stm32f103" + }, + "trnthsn/s6xty5neor2": { + "target": "trnthsn/s6xty5neor2/stm32f103" + }, + "tweetydabird/lotus58": { + "target": "tweetydabird/lotus58/promicro" + }, + "unison": { + "target": "unison/v04" + }, + "uzu42": { + "target": "uzu42/rev1" + }, + "vitamins_included": { + "target": "vitamins_included/rev2" + }, + "westm/westm68": { + "target": "westm/westm68/rev2" + }, + "westm/westm9": { + "target": "westm/westm9/rev2" + }, + "woodkeys/meira": { + "target": "woodkeys/meira/promicro" + }, + "work_louder/loop": { + "target": "work_louder/loop/rev3" + }, + "work_louder/work_board": { + "target": "work_louder/work_board/rev3" + }, + "yanghu/unicorne": { + "target": "yanghu/unicorne/f411" + }, + "yosino58": { + "target": "yosino58/rev1" + }, + "ymdk/yd60mq": { + "target": "ymdk/yd60mq/12led" + }, + "yushakobo/navpad/10": { + "target": "yushakobo/navpad/10/rev1" + }, + "yynmt/acperience12": { + "target": "yynmt/acperience12/rev1" + }, + "zsa/planck_ez": { + "target": "zsa/planck_ez/base" } } diff --git a/data/schemas/community_module.jsonschema b/data/schemas/community_module.jsonschema new file mode 100644 index 000000000000..a3474476dff7 --- /dev/null +++ b/data/schemas/community_module.jsonschema @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema#", + "$id": "qmk.community_module.v1", + "title": "Community Module Information", + "type": "object", + "required": ["module_name", "maintainer"] + "properties": { + "module_name": {"$ref": "qmk.definitions.v1#/text_identifier"}, + "maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"}, + "url": { + "type": "string", + "format": "uri" + }, + "keycodes": {"$ref": "qmk.definitions.v1#/keycode_decl_array"}, + "features": {"$ref": "qmk.keyboard.v1#/definitions/features_config"}, + } +} diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index ec87680fa059..9b63f62d451b 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -31,6 +31,11 @@ "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} } } + "features_config": { + "$ref": "qmk.definitions.v1#/boolean_array", + "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"}, + "not": {"required": ["lto"]} + }, }, "type": "object", "not": {"required": ["vendorId", "productId"]}, // reject via keys... @@ -328,11 +333,7 @@ "enabled": {"type": "boolean"} } }, - "features": { - "$ref": "qmk.definitions.v1#/boolean_array", - "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"}, - "not": {"required": ["lto"]} - }, + "features": { "$ref": "#/definitions/features_config" }, "indicators": { "type": "object", "properties": { @@ -422,7 +423,11 @@ "h": {"$ref": "qmk.definitions.v1#/key_unit"}, "w": {"$ref": "qmk.definitions.v1#/key_unit"}, "x": {"$ref": "qmk.definitions.v1#/key_unit"}, - "y": {"$ref": "qmk.definitions.v1#/key_unit"} + "y": {"$ref": "qmk.definitions.v1#/key_unit"}, + "hand": { + "type": "string", + "enum": ["L", "R", "*"] + } } } } @@ -463,6 +468,12 @@ "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} } }, + "modules": { + "type": "array", + "items": { + "type": "string" + } + }, "mouse_key": { "type": "object", "properties": { @@ -915,6 +926,7 @@ "tapping": { "type": "object", "properties": { + "chordal_hold": {"type": "boolean"}, "force_hold": {"type": "boolean"}, "force_hold_per_key": {"type": "boolean"}, "ignore_mod_tap_interrupt": {"type": "boolean"}, diff --git a/data/schemas/keymap.jsonschema b/data/schemas/keymap.jsonschema index e967e45c53e4..b92a536c2c81 100644 --- a/data/schemas/keymap.jsonschema +++ b/data/schemas/keymap.jsonschema @@ -71,6 +71,12 @@ "config": {"$ref": "qmk.keyboard.v1"}, "notes": { "type": "string" + }, + "modules": { + "type": "array", + "items": { + "type": "string" + } } } } diff --git a/docs/ChangeLog/20250223.md b/docs/ChangeLog/20250223.md new file mode 100644 index 000000000000..858848a60bca --- /dev/null +++ b/docs/ChangeLog/20250223.md @@ -0,0 +1,135 @@ +# QMK Breaking Changes - 2025 February 23 Changelog + +## Notable Features + +### Community Modules ([#24848](https://github.com/qmk/qmk_firmware/pull/24848)) + +Community Modules are a feature within QMK which allows code to be implemented by third parties, making it available for other people to import into their own builds. + +These modules can provide implementations which override or enhance normal QMK processing; initialization, key processing, suspend, and shutdown are some of the provided hooks which modules may currently implement. + +See the [Community Modules documentation](../features/community_modules) for more information, including the full list of available hooks. + +First-class support for [External Userspace](../newbs_external_userspace) is included out of the box, so there's even more reason to take the plunge and convert your keymap builds to a userspace repository! + +::: tip +An example with a new keycode and some debugging information in the QMK repository [lives here](https://github.com/qmk/qmk_firmware/tree/master/modules/qmk/hello_world), and a community module port of [getreuer's SOCD Cleaner](https://getreuer.info/posts/keyboards/socd-cleaner/) can be found in [tzarc's modules repo](https://github.com/tzarc/qmk_modules). +::: + +### Chordal Hold ([#24560](https://github.com/qmk/qmk_firmware/pull/24560)) + +Chordal Hold implements, by default, an "opposite hands" rule. Suppose a tap-hold key is pressed and then, before the tapping term, another key is pressed. With Chordal Hold, the tap-hold key is settled as tapped if the two keys are on the same hand. + +Chordal Hold may be useful to avoid accidental modifier activation with mod-taps, particularly in rolled keypresses when using home row mods. + +See the [Chordal Hold documentation](../tap_hold#chordal-hold) for more information. + +## Changes Requiring User Action + +### Updated Keyboard Codebases + +| Old Keyboard Name | New Keyboard Name | +|-------------------------|-----------------------------| +| cxt_studio | cxt_studio/12e4 | +| ergodox_stm32 | handwired/ergodox_stm32 | +| ploopyco/mouse | ploopyco/mouse/rev1_002 | +| ploopyco/trackball/rev1 | ploopyco/trackball/rev1_004 | +| ymdk/id75 | ymdk/id75/f103 | + +## Deprecation Notices + +In line with the [notice period](../support_deprecation_policy#how-much-advance-notice-will-be-given), deprecation notices for larger items are listed here. + +### DEFAULT_FOLDER removal ([#24836](https://github.com/qmk/qmk_firmware/pull/24836)) + +`DEFAULT_FOLDER` was originally introduced to work around limitations within the build system. +Parent folders containing common configuration would create invalid build targets. + +With the introduction of [`keyboard.json`](./20240526#keyboard-json) as a configuration file, the build system now has a consistent method to detect build targets. +The `DEFAULT_FOLDER` functionality is now redundant and the intent is for `rules.mk` to become pure configuration. + +Backwards compatibility of build targets has been maintained where possible. + +## Full changelist + +Core: +* Chaining OSL and MO ([#23065](https://github.com/qmk/qmk_firmware/pull/23065)) +* Add extra keymap for EurKEY layout ([#24241](https://github.com/qmk/qmk_firmware/pull/24241)) +* Add leader_add_user callback ([#24266](https://github.com/qmk/qmk_firmware/pull/24266)) +* always return audio pin to 0 on ARM ([#24503](https://github.com/qmk/qmk_firmware/pull/24503)) +* Update Starlight matrix effects ([#24521](https://github.com/qmk/qmk_firmware/pull/24521)) +* Refactor Hue Breathing matrix effect with runner ([#24525](https://github.com/qmk/qmk_firmware/pull/24525)) +* Ensure timer_read() is safe to call from interrupt handlers on ARM ([#24529](https://github.com/qmk/qmk_firmware/pull/24529)) +* Update Raindrops effect to respect LED range limits ([#24531](https://github.com/qmk/qmk_firmware/pull/24531)) +* Add Chordal Hold, an "opposite hands rule" tap-hold option similar to Achordion, Bilateral Combinations. ([#24560](https://github.com/qmk/qmk_firmware/pull/24560)) +* Azoteq - improve I2C behaviour while polling. ([#24611](https://github.com/qmk/qmk_firmware/pull/24611)) +* macOS install: remove bad ARM toolchains ([#24637](https://github.com/qmk/qmk_firmware/pull/24637)) +* small refactoring of TIMER_DIFF ([#24678](https://github.com/qmk/qmk_firmware/pull/24678)) +* Subscript alef correction ([#24707](https://github.com/qmk/qmk_firmware/pull/24707)) +* Created SH1107 driver for quantum painter ([#24724](https://github.com/qmk/qmk_firmware/pull/24724)) +* [CI] Regenerate Files ([#24772](https://github.com/qmk/qmk_firmware/pull/24772)) +* Patch up issue for inverted complementary output on Backlight ([#24794](https://github.com/qmk/qmk_firmware/pull/24794)) +* Patch up issue when compile with APA102 driver ([#24800](https://github.com/qmk/qmk_firmware/pull/24800)) +* Consolidate send_string implementations. ([#24817](https://github.com/qmk/qmk_firmware/pull/24817)) +* Consolidate timer_elapsed implementations ([#24830](https://github.com/qmk/qmk_firmware/pull/24830)) +* `i2c_master`: remove deprecated functions ([#24832](https://github.com/qmk/qmk_firmware/pull/24832)) +* Resolve keyboard_aliases when processing keyboard make targets ([#24834](https://github.com/qmk/qmk_firmware/pull/24834)) +* LED drivers: remove deprecated defines ([#24837](https://github.com/qmk/qmk_firmware/pull/24837)) +* `ferris/0_1`: update I2C API usage ([#24839](https://github.com/qmk/qmk_firmware/pull/24839)) +* Unify i2c_master headers ([#24846](https://github.com/qmk/qmk_firmware/pull/24846)) +* Community modules ([#24848](https://github.com/qmk/qmk_firmware/pull/24848)) +* Relocate base WS2812 code ([#24850](https://github.com/qmk/qmk_firmware/pull/24850)) +* Unify UART headers ([#24855](https://github.com/qmk/qmk_firmware/pull/24855)) +* Unify spi_master headers ([#24857](https://github.com/qmk/qmk_firmware/pull/24857)) +* Invoke `process_record_via` after `_user`/`_kb` have a chance to handle it. ([#24879](https://github.com/qmk/qmk_firmware/pull/24879)) + +CLI: +* Extend lint to reject 'blank' files ([#23994](https://github.com/qmk/qmk_firmware/pull/23994)) +* `qmk docs`: restore `--port` and `--browser` arguments ([#24623](https://github.com/qmk/qmk_firmware/pull/24623)) +* Update via2json layout macro searching ([#24640](https://github.com/qmk/qmk_firmware/pull/24640)) +* Change `new-keymap` keymap name prompt ([#24701](https://github.com/qmk/qmk_firmware/pull/24701)) +* default_keyboard.h generation tweaks ([#24715](https://github.com/qmk/qmk_firmware/pull/24715)) +* Ensure `qmk flash` rejects invalid files for uf2 compatible bootloaders ([#24802](https://github.com/qmk/qmk_firmware/pull/24802)) +* Reject readme dummy content ([#24913](https://github.com/qmk/qmk_firmware/pull/24913)) + +Submodule updates: +* chibios: usb_main: remove OTG sof workaround ([#24259](https://github.com/qmk/qmk_firmware/pull/24259)) +* Update ChibiOS to latest stable branch. ([#24651](https://github.com/qmk/qmk_firmware/pull/24651)) +* Update ChibiOS `stable_21.11.x`. ([#24714](https://github.com/qmk/qmk_firmware/pull/24714)) +* Update ChibiOS-Contrib. ([#24803](https://github.com/qmk/qmk_firmware/pull/24803)) + +Keyboards: +* refactor: move ymdk/id75 to revision ([#24590](https://github.com/qmk/qmk_firmware/pull/24590)) +* skyloong/gk61: Remove overriding of core keycode behaviour ([#24655](https://github.com/qmk/qmk_firmware/pull/24655)) +* moky/moky88: Remove use of deprecated defines ([#24656](https://github.com/qmk/qmk_firmware/pull/24656)) +* Updating Promenade keyboard (Missing keys in matrix, other minor changes to keymap) ([#24705](https://github.com/qmk/qmk_firmware/pull/24705)) +* Moving cxt_studio keyboard to own folder ([#24748](https://github.com/qmk/qmk_firmware/pull/24748)) +* Add CXT Studio 12E3 keyboard ([#24749](https://github.com/qmk/qmk_firmware/pull/24749)) +* Add Silakka54 keyboard ([#24757](https://github.com/qmk/qmk_firmware/pull/24757)) +* Add more layout for skiller_sgk50_s4 ([#24784](https://github.com/qmk/qmk_firmware/pull/24784)) +* Add watchdog service to RGBKB Sol 3 ([#24786](https://github.com/qmk/qmk_firmware/pull/24786)) +* Migrate some DEFAULT_FOLDER to keyboard_aliases.hjson ([#24835](https://github.com/qmk/qmk_firmware/pull/24835)) +* Remove DEFAULT_FOLDER where keyboard aliases already exists ([#24838](https://github.com/qmk/qmk_firmware/pull/24838)) +* Migrate some DEFAULT_FOLDER to keyboard_aliases.hjson ([#24845](https://github.com/qmk/qmk_firmware/pull/24845)) +* Update for 'A-JAZZ AKC084' ('A-JAZZ AKP846') ([#24868](https://github.com/qmk/qmk_firmware/pull/24868)) +* handwired/xealous - Remove DEFAULT_FOLDER ([#24877](https://github.com/qmk/qmk_firmware/pull/24877)) +* Updates to Ploopy Classic, Mouse, and Thumb for RP2040 hardware upgrade ([#24880](https://github.com/qmk/qmk_firmware/pull/24880)) +* Move Ergodox STM32 to handwired folder ([#24903](https://github.com/qmk/qmk_firmware/pull/24903)) +* Remove readme dummy content ([#24912](https://github.com/qmk/qmk_firmware/pull/24912)) +* Migrate some DEFAULT_FOLDER to keyboard_aliases.hjson ([#24915](https://github.com/qmk/qmk_firmware/pull/24915)) +* Migrate some DEFAULT_FOLDER to keyboard_aliases.hjson ([#24938](https://github.com/qmk/qmk_firmware/pull/24938)) + +Keyboard fixes: +* Fix up CI with `DEFAULT_FOLDER`. ([#24842](https://github.com/qmk/qmk_firmware/pull/24842)) +* rgbkb/pan - Remove invalid build target ([#24844](https://github.com/qmk/qmk_firmware/pull/24844)) + +Others: +* Formally deprecate DEFAULT_FOLDER ([#24836](https://github.com/qmk/qmk_firmware/pull/24836)) +* Correct I2C API reference ([#24840](https://github.com/qmk/qmk_firmware/pull/24840)) + +Bugs: +* Retro Tapping Re-Write; Key Roll Fix ([#23641](https://github.com/qmk/qmk_firmware/pull/23641)) +* Fix Quantum Painter compiliation issues with heavy optimization ([#24667](https://github.com/qmk/qmk_firmware/pull/24667)) +* Bugfix and update for AT32F415 ([#24807](https://github.com/qmk/qmk_firmware/pull/24807)) +* Fix for Chordal Hold: stuck mods when mod-taps are pressed in a stuttered sequence. ([#24878](https://github.com/qmk/qmk_firmware/pull/24878)) +* fix EEPROM driver for STM32L0/1 cat.1 devices ([#24928](https://github.com/qmk/qmk_firmware/pull/24928)) diff --git a/docs/_sidebar.json b/docs/_sidebar.json index 95601be7ded1..ae4d8fe4a9d1 100644 --- a/docs/_sidebar.json +++ b/docs/_sidebar.json @@ -60,6 +60,7 @@ "items": [ { "text": "Customizing Functionality", "link": "/custom_quantum_functions" }, { "text": "Driver Installation with Zadig", "link": "/driver_installation_zadig" }, + { "text": "Community Modules", "link": "/features/community_modules" }, { "text": "Keymap Overview", "link": "/keymap" }, { "text": "Development Environments", @@ -206,7 +207,7 @@ { "text": "My Pull Request Was Flagged", "link": "/breaking_changes_instructions" }, { "text": "Most Recent ChangeLog", - "link": "/ChangeLog/20241124" + "link": "/ChangeLog/20250223" }, { "text": "Past Breaking Changes", "link": "/breaking_changes_history" }, { "text": "Deprecation Policy", "link": "/support_deprecation_policy" } diff --git a/docs/breaking_changes.md b/docs/breaking_changes.md index 132c5943cc15..a5a57ccd12a3 100644 --- a/docs/breaking_changes.md +++ b/docs/breaking_changes.md @@ -10,25 +10,25 @@ Practically, this means QMK merges the `develop` branch into the `master` branch ## What has been included in past Breaking Changes? +* [2025 Feb 23](ChangeLog/20250223) * [2024 Nov 24](ChangeLog/20241124) * [2024 Aug 25](ChangeLog/20240825) -* [2024 May 26](ChangeLog/20240526) * [Older Breaking Changes](breaking_changes_history) ## When is the next Breaking Change? -The next Breaking Change is scheduled for February 23, 2025. +The next Breaking Change is scheduled for May 25, 2025. ### Important Dates -* 2024 Nov 24 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions. -* 2025 Jan 26 - `develop` closed to new PRs. -* 2025 Jan 26 - Call for testers. -* 2025 Feb 9 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes -* 2025 Feb 16 - `develop` is locked, only critical bugfix PRs merged. -* 2024 Nov 21 - `master` is locked, no PRs merged. -* 2025 Feb 23 - Merge `develop` to `master`. -* 2025 Feb 23 - `master` is unlocked. PRs can be merged again. +* 2025 Feb 23 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions. +* 2025 Apr 27 - `develop` closed to new PRs. +* 2025 Apr 27 - Call for testers. +* 2025 May 11 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes +* 2025 May 18 - `develop` is locked, only critical bugfix PRs merged. +* 2025 May 23 - `master` is locked, no PRs merged. +* 2025 May 25 - Merge `develop` to `master`. +* 2025 May 25 - `master` is unlocked. PRs can be merged again. ## What changes will be included? diff --git a/docs/breaking_changes_history.md b/docs/breaking_changes_history.md index f877f4263955..af8c1c04d5f1 100644 --- a/docs/breaking_changes_history.md +++ b/docs/breaking_changes_history.md @@ -2,6 +2,7 @@ This page links to all previous changelogs from the QMK Breaking Changes process. +* [2025 Feb 23](ChangeLog/20250223) - version 0.28.0 * [2024 Nov 24](ChangeLog/20241124) - version 0.27.0 * [2024 Aug 25](ChangeLog/20240825) - version 0.26.0 * [2024 May 26](ChangeLog/20240526) - version 0.25.0 diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 4cd5ae98c390..d17b0eda2372 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -723,23 +723,26 @@ Now open your dev environment and live a squiggly-free life. ## `qmk docs` -This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 5173. +This command starts a local HTTP server which you can use for browsing or improving the docs, and provides live reload capability whilst editing. Default port is 8936. +Use the `-b`/`--browser` flag to automatically open the local webserver in your default browser. -This command requires `node` and `yarn` to be installed as prerequisites, and provides live reload capability whilst editing. +Requires `node` and `yarn` to be installed as prerequisites. **Usage**: ``` -usage: qmk docs [-h] +usage: qmk docs [-h] [-b] [-p PORT] options: - -h, --help show this help message and exit + -h, --help show this help message and exit + -b, --browser Open the docs in the default browser. + -p, --port PORT Port number to use. ``` ## `qmk generate-docs` -This command allows you to generate QMK documentation locally. It can be uses for general browsing or improving the docs. -Use the `-s`/`--serve` flag to also serve the static site once built. Default port is 4173. +This command generates QMK documentation for production. +Use the `-s`/`--serve` flag to also serve the static site on port 4173 once built. Note that this does not provide live reloading; use `qmk docs` instead for development purposes. This command requires `node` and `yarn` to be installed as prerequisites, and requires the operating system to support symlinks. diff --git a/docs/contributing.md b/docs/contributing.md index bbb1997a6f64..70a00b706d77 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -106,10 +106,10 @@ enum my_keycodes { Before opening a pull request, you can preview your changes if you have set up the development environment by running this command from the `qmk_firmware/` folder: ``` -qmk docs +qmk docs -b ``` -and navigating to `http://localhost:5173/`. +Which should automatically open your browser; otherwise, navigate to `http://localhost:8936/`. ## Keyboards diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index 1479eb53f6c0..c69beb055e96 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -9,12 +9,19 @@ This page does not assume any special knowledge about QMK, but reading [Understa We have structured QMK as a hierarchy: * Core (`_quantum`) + * Community Module (`_`) + * Community Module -> Keyboard/Revision (`__kb`) + * Community Module -> Keymap (`__user`) * Keyboard/Revision (`_kb`) * Keymap (`_user`) Each of the functions described below can be defined with a `_kb()` suffix or a `_user()` suffix. We intend for you to use the `_kb()` suffix at the Keyboard/Revision level, while the `_user()` suffix should be used at the Keymap level. -When defining functions at the Keyboard/Revision level it is important that your `_kb()` implementation call `_user()` before executing anything else- otherwise the keymap level function will never be called. +When defining functions at the Keyboard/Revision level it is important that your `_kb()` implementation call `_user()` at an appropriate location, otherwise the keymap level function will never be called. + +Functions at the `__xxx()` level are intended to allow keyboards or keymaps to override or enhance the processing associated with a [community module](/features/community_modules). + +When defining module overrides such as `process_record_()`, the same pattern should be used; the module must invoke `process_record__kb()` as appropriate. # Custom Keycodes @@ -99,7 +106,7 @@ These are the three main initialization functions, listed in the order that they * `keyboard_post_init_*` - Happens at the end of the firmware's startup process. This is where you'd want to put "customization" code, for the most part. ::: warning -For most people, the `keyboard_post_init_user` function is what you want to call. For instance, this is where you want to set up things for RGB Underglow. +For most people, the `keyboard_post_init_user` function is what you want to implement. For instance, this is where you want to set up things for RGB Underglow. ::: ## Keyboard Pre Initialization code diff --git a/docs/drivers/i2c.md b/docs/drivers/i2c.md index c806a090c56e..ad74d0e481d1 100644 --- a/docs/drivers/i2c.md +++ b/docs/drivers/i2c.md @@ -16,17 +16,22 @@ You can then call the I2C API by including `i2c_master.h` in your code. ## I2C Addressing {#note-on-i2c-addresses} -All of the addresses expected by this driver should be pushed to the upper 7 bits of the address byte. Setting -the lower bit (indicating read/write) will be done by the respective functions. Almost all I2C addresses listed -on datasheets and the internet will be represented as 7 bits occupying the lower 7 bits and will need to be -shifted to the left (more significant) by one bit. This is easy to do via the bitwise shift operator `<< 1`. +I2C addresses listed on datasheets and the internet are usually represented as a 7-bit value. The eighth bit (the least significant bit) controls whether the operation is a read or a write. -You can either do this on each call to the functions below, or once in your definition of the address. For example, if your device has an address of `0x18`: +All of the address parameters expected by the driver API should therefore be pushed to the upper 7 bits of the address byte; the driver will take care of setting the read/write bit as appropriate. + +This is easy to do via the bitwise left shift operator. For example, if your device has an address of `0x18` you might create a define for convenience: ```c #define MY_I2C_ADDRESS (0x18 << 1) ``` +Or, you can shift the address ahead of time: + +```c +#define MY_I2C_ADDRESS 0x30 +``` + See https://www.robot-electronics.co.uk/i2c-tutorial for more information about I2C addressing and other technical details. ## AVR Configuration {#avr-configuration} @@ -39,12 +44,12 @@ The following defines can be used to configure the I2C master driver: No further setup is required - just connect the `SDA` and `SCL` pins of your I2C devices to the matching pins on the MCU: -|MCU |`SCL`|`SDA`| -|------------------|-----|-----| -|ATmega16/32U4 |`D0` |`D1` | -|AT90USB64/128 |`D0` |`D1` | -|ATmega32A |`C0` |`C1` | -|ATmega328/P |`C5` |`C4` | +|MCU |`SCL`|`SDA`| +|-------------|-----|-----| +|ATmega16/32U4|`D0` |`D1` | +|AT90USB64/128|`D0` |`D1` | +|ATmega32A |`C0` |`C1` | +|ATmega328/P |`C5` |`C4` | ::: tip The ATmega16/32U2 does not possess I2C functionality, and so cannot use this driver. @@ -52,7 +57,7 @@ The ATmega16/32U2 does not possess I2C functionality, and so cannot use this dri ## ChibiOS/ARM Configuration {#arm-configuration} -You'll need to determine which pins can be used for I2C -- a an example, STM32 parts generally have multiple I2C peripherals, labeled I2C1, I2C2, I2C3 etc. +You'll need to determine which pins can be used for I2C -- as an example, STM32 parts generally have multiple I2C peripherals, labeled I2C1, I2C2, I2C3 etc. To enable I2C, modify your board's `halconf.h` to enable I2C, then modify your board's `mcuconf.h` to enable the peripheral you've chosen: @@ -83,15 +88,19 @@ To enable I2C, modify your board's `halconf.h` to enable I2C, then modify your b Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303. -|`config.h` Overrride |Description |Default| -|------------------------|--------------------------------------------------------------|-------| -|`I2C_DRIVER` |I2C peripheral to use - I2C1 -> `I2CD1`, I2C2 -> `I2CD2` etc. |`I2CD1`| -|`I2C1_SCL_PIN` |The pin definition for SCL |`B6` | -|`I2C1_SCL_PAL_MODE` |The alternate function mode for SCL |`4` | -|`I2C1_SDA_PIN` |The pin definition for SDA |`B7` | -|`I2C1_SDA_PAL_MODE` |The alternate function mode for SDA |`4` | +|`config.h` Override|Description |Default| +|-------------------|-------------------------------------------------------------|-------| +|`I2C_DRIVER` |I2C peripheral to use - I2C1 -> `I2CD1`, I2C2 -> `I2CD2` etc.|`I2CD1`| +|`I2C1_SCL_PIN` |The pin to use for SCL |`B6` | +|`I2C1_SCL_PAL_MODE`|The alternate function mode for SCL |`4` | +|`I2C1_SDA_PIN` |The pin to use for SDA |`B7` | +|`I2C1_SDA_PAL_MODE`|The alternate function mode for SDA |`4` | -The following configuration values depend on the specific MCU in use. +::: tip +Currently only a single I2C peripheral is supported, therefore the `I2C1_*` defines are used for configuration regardless of the selected peripheral. +::: + +The following configuration values are dependent on the ChibiOS I2C LLD, which is dictated by the microcontroller. ### I2Cv1 {#arm-configuration-i2cv1} @@ -147,7 +156,7 @@ void i2c_init(void) { --- -### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)` {#api-i2c-transmit} +### `i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-transmit} Send multiple bytes to the selected I2C device. @@ -155,10 +164,10 @@ Send multiple bytes to the selected I2C device. - `uint8_t address` The 7-bit I2C address of the device. - - `uint8_t *data` + - `const uint8_t* data` A pointer to the data to transmit. - `uint16_t length` - The number of bytes to write. Take care not to overrun the length of `data`. + The number of bytes to write. Take care not to overrun the length of `data`. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. @@ -168,6 +177,29 @@ Send multiple bytes to the selected I2C device. --- +### `i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-transmit-p} + +Send multiple bytes from PROGMEM to the selected I2C device. + +On ARM devices, this function is simply an alias for `i2c_transmit(address, data, length, timeout)`. + +#### Arguments {#api-i2c-transmit-p-arguments} + + - `uint8_t address` + The 7-bit I2C address of the device. + - `const uint8_t* data` + A pointer to the data to transmit. + - `uint16_t length` + The number of bytes to write. Take care not to overrun the length of `data`. + - `uint16_t timeout` + The time in milliseconds to wait for a response from the target device. + +#### Return Value {#api-i2c-transmit-p-return} + +`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + +--- + ### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-receive} Receive multiple bytes from the selected I2C device. @@ -176,10 +208,10 @@ Receive multiple bytes from the selected I2C device. - `uint8_t address` The 7-bit I2C address of the device. - - `uint8_t *data` - A pointer to the buffer to read into. + - `uint8_t* data` + A pointer to a buffer to read into. - `uint16_t length` - The number of bytes to read. Take care not to overrun the length of `data`. + The number of bytes to read. Take care not to overrun the length of `data`. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. @@ -189,9 +221,9 @@ Receive multiple bytes from the selected I2C device. --- -### `i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-write-register} +### `i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-write-register} -Writes to a register with an 8-bit address on the I2C device. +Write to a register with an 8-bit address on the I2C device. #### Arguments {#api-i2c-write-register-arguments} @@ -199,10 +231,10 @@ Writes to a register with an 8-bit address on the I2C device. The 7-bit I2C address of the device. - `uint8_t regaddr` The register address to write to. - - `uint8_t *data` + - `const uint8_t* data` A pointer to the data to transmit. - `uint16_t length` - The number of bytes to write. Take care not to overrun the length of `data`. + The number of bytes to write. Take care not to overrun the length of `data`. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. @@ -212,9 +244,9 @@ Writes to a register with an 8-bit address on the I2C device. --- -### `i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-write-register16} +### `i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-write-register16} -Writes to a register with a 16-bit address (big endian) on the I2C device. +Write to a register with a 16-bit address (big endian) on the I2C device. #### Arguments {#api-i2c-write-register16-arguments} @@ -222,10 +254,10 @@ Writes to a register with a 16-bit address (big endian) on the I2C device. The 7-bit I2C address of the device. - `uint16_t regaddr` The register address to write to. - - `uint8_t *data` + - `const uint8_t* data` A pointer to the data to transmit. - `uint16_t length` - The number of bytes to write. Take care not to overrun the length of `data`. + The number of bytes to write. Take care not to overrun the length of `data`. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. @@ -237,7 +269,7 @@ Writes to a register with a 16-bit address (big endian) on the I2C device. ### `i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-read-register} -Reads from a register with an 8-bit address on the I2C device. +Read from a register with an 8-bit address on the I2C device. #### Arguments {#api-i2c-read-register-arguments} @@ -245,8 +277,10 @@ Reads from a register with an 8-bit address on the I2C device. The 7-bit I2C address of the device. - `uint8_t regaddr` The register address to read from. + - `uint8_t data` + A pointer to a buffer to read into. - `uint16_t length` - The number of bytes to read. Take care not to overrun the length of `data`. + The number of bytes to read. Take care not to overrun the length of `data`. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. @@ -258,7 +292,7 @@ Reads from a register with an 8-bit address on the I2C device. ### `i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` {#api-i2c-read-register16} -Reads from a register with a 16-bit address (big endian) on the I2C device. +Read from a register with a 16-bit address (big endian) on the I2C device. #### Arguments {#api-i2c-read-register16-arguments} @@ -266,8 +300,10 @@ Reads from a register with a 16-bit address (big endian) on the I2C device. The 7-bit I2C address of the device. - `uint16_t regaddr` The register address to read from. + - `uint8_t* data` + A pointer to a buffer to read into. - `uint16_t length` - The number of bytes to read. Take care not to overrun the length of `data`. + The number of bytes to read. Take care not to overrun the length of `data`. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. @@ -279,19 +315,19 @@ Reads from a register with a 16-bit address (big endian) on the I2C device. ### `i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout)` {#api-i2c-ping-address} -Pings the I2C bus for a specific address. +Ping the I2C bus for a specific address. -On ChibiOS a "best effort" attempt is made by reading a single byte from register 0 at the requested address. This should generally work except for I2C devices that do not not respond to a register 0 read request, which will result in a false negative result (unsucessful response to ping attempt). +On ChibiOS a "best effort" attempt is made by reading a single byte from register 0 at the given address. This should generally work except for I2C devices that do not not respond to a register 0 read request, which will result in a false negative result (unsuccessful response to ping attempt). -This function is weakly defined, meaning it can be overridden if necessary for your particular use case: +This function is weakly defined, meaning it can be overridden if necessary for your particular use case. -#### Arguments +#### Arguments {#api-i2c-ping-address-arguments} - `uint8_t address` - The 7-bit I2C address of the device (ie. without the read/write bit - this will be set automatically). + The 7-bit I2C address of the device. - `uint16_t timeout` The time in milliseconds to wait for a response from the target device. -#### Return Value +#### Return Value {#api-i2c-ping-address-return} `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. diff --git a/docs/drivers/spi.md b/docs/drivers/spi.md index 43d2a056d5db..140b204945fb 100644 --- a/docs/drivers/spi.md +++ b/docs/drivers/spi.md @@ -88,7 +88,7 @@ Start an SPI transaction. #### Arguments {#api-spi-start-arguments} - `pin_t slavePin` - The QMK pin to assert as the slave select pin, eg. `B4`. + The GPIO pin connected to the desired device's `SS` line. - `bool lsbFirst` Determines the endianness of the transmission. If `true`, the least significant bit of each byte is sent first. - `uint8_t mode` @@ -106,7 +106,7 @@ Start an SPI transaction. #### Return Value {#api-spi-start-return} -`false` if the supplied parameters are invalid or the SPI peripheral is already in use, or `true`. +`true` if the operation was successful, otherwise `false` if the supplied parameters are invalid or the SPI peripheral is already in use. --- @@ -131,7 +131,7 @@ Read a byte from the selected SPI device. #### Return Value {#api-spi-read-return} -`SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device. +`SPI_STATUS_TIMEOUT` if the timeout period elapses, otherwise the byte read from the device. --- @@ -159,7 +159,7 @@ Receive multiple bytes from the selected SPI device. #### Arguments {#api-spi-receive-arguments} - `uint8_t *data` - A pointer to the buffer to read into. + A pointer to a buffer to read into. - `uint16_t length` The number of bytes to read. Take care not to overrun the length of `data`. diff --git a/docs/drivers/uart.md b/docs/drivers/uart.md index 7cc68727eec1..b895266cab27 100644 --- a/docs/drivers/uart.md +++ b/docs/drivers/uart.md @@ -45,17 +45,17 @@ To enable UART, modify your board's `mcuconf.h` to enable the peripheral you've Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303. -| `config.h` override | Description | Default Value | -| --------------------------- | --------------------------------------------------------------- | ------------- | -| `#define UART_DRIVER` | USART peripheral to use - USART1 -> `SD1`, USART2 -> `SD2` etc. | `SD1` | -| `#define UART_TX_PIN` | The pin to use for TX | `A9` | -| `#define UART_TX_PAL_MODE` | The alternate function mode for TX | `7` | -| `#define UART_RX_PIN` | The pin to use for RX | `A10` | -| `#define UART_RX_PAL_MODE` | The alternate function mode for RX | `7` | -| `#define UART_CTS_PIN` | The pin to use for CTS | `A11` | -| `#define UART_CTS_PAL_MODE` | The alternate function mode for CTS | `7` | -| `#define UART_RTS_PIN` | The pin to use for RTS | `A12` | -| `#define UART_RTS_PAL_MODE` | The alternate function mode for RTS | `7` | +|`config.h` Override|Description |Default| +|-------------------|---------------------------------------------------------------|-------| +|`UART_DRIVER` |USART peripheral to use - USART1 -> `SD1`, USART2 -> `SD2` etc.|`SD1` | +|`UART_TX_PIN` |The pin to use for TX |`A9` | +|`UART_TX_PAL_MODE` |The alternate function mode for TX |`7` | +|`UART_RX_PIN` |The pin to use for RX |`A10` | +|`UART_RX_PAL_MODE` |The alternate function mode for RX |`7` | +|`UART_CTS_PIN` |The pin to use for CTS |`A11` | +|`UART_CTS_PAL_MODE`|The alternate function mode for CTS |`7` | +|`UART_RTS_PIN` |The pin to use for RTS |`A12` | +|`UART_RTS_PAL_MODE`|The alternate function mode for RTS |`7` | ## API {#api} @@ -111,7 +111,7 @@ Receive multiple bytes. #### Arguments {#api-uart-receive-arguments} - `uint8_t *data` - A pointer to the buffer to read into. + A pointer to a buffer to read into. - `uint16_t length` The number of bytes to read. Take care not to overrun the length of `data`. @@ -123,4 +123,4 @@ Return whether the receive buffer contains data. Call this function to determine #### Return Value {#api-uart-available-return} -`true` if the receive buffer length is non-zero. +`true` if there is data available to read. diff --git a/docs/features/community_modules.md b/docs/features/community_modules.md new file mode 100644 index 000000000000..3a1a82e7bc66 --- /dev/null +++ b/docs/features/community_modules.md @@ -0,0 +1,142 @@ +# Community Modules + +Community Modules are a feature within QMK which allows code to be implemented by third parties, making it available for other people to import into their own builds. + +These modules can provide implementations which override or enhance normal QMK processing; initialization, key processing, suspend, and shutdown are some of the provided hooks which modules may implement. + +## Adding a Community Module to your build + +Community Modules have first-class support for [External Userspace](/newbs_external_userspace), and QMK strongly recommends using External Userspace for hosting keymaps and Community Modules together. + +Modules must live in either of two locations: + +* `/modules/` +* `/modules/` + +A basic module is provided within QMK itself -- `qmk/hello_world` -- which prints out a notification over [HID console](/faq_debug) after 10 seconds, and adds a new keycode, `COMMUNITY_MODULE_HELLO` (aliased to `CM_HELO`) which types `Hello there.` to the active application when the corresponding key is pressed. + +To add this module to your build, in your keymap's directory create a `keymap.json` with the following content: + +```json +{ + "modules": [ + "qmk/hello_world" + ] +} +``` + +If you already have a `keymap.json`, you'll need to manually merge the `modules` section into your keymap. + +::: warning +Community Modules are not supported by QMK Configurator. If you wish to use Community Modules, you must build your own firmware. +::: + +## Adding a Community Module to your External Userspace + +Module authors are encouraged to provide a git repository on GitHub which may be imported into a user's external userspace. If a user wishes to import a module repository, they can do the following: + +```sh +cd /path/to/your/external/userspace +mkdir -p modules +# Replace the following {user} and {repo} with the author's community module repository +git submodule add https://github.com/{user}/{repo}.git modules/{user} +git submdule update --init --recursive +``` + +This will ensure the copy of the module is made in your userspace. + +Add a new entry into your `keymap.json` with the desired modules, replacing `{user}` and `{module_name}` as appropriate: + +```json +{ + "modules": [ + "qmk/hello_world", + "{user}/{module_name}" + ] +} +``` + +::: info +The module listed in `keymap.json` is the relative path within the `modules/` directory. So long as the module is present _somewhere_ under `modules/`, then the `keymap.json` can refer to that path. +::: + +## Writing a QMK Community Module + +As stated earlier, Community Module authors are strongly encouraged to provide their modules through git, allowing users to leverage submodules to import functionality. + +### `qmk_module.json` + +A Community Module is denoted by a `qmk_module.json` file such as the following: + +```json +{ + "module_name": "Hello World", + "maintainer": "QMK Maintainers", + "features": { + "deferred_exec": true + }, + "keycodes": [ + { + "key": "COMMUNITY_MODULE_HELLO", + "aliases": ["CM_HELO"] + } + ] +} +``` + +At minimum, the module must provide the `module_name` and `maintainer` fields. + +The use of `features` matches the definition normally provided within `keyboard.json` and `info.json`, allowing a module to signal to the build system that it has its own dependencies. In the example above, it enables the _deferred executor_ feature whenever the above module is used in a build. + +The `keycodes` array allows a module to provide new keycodes (as well as corresponding aliases) to a keymap. + +### `rules.mk` / `post_rules.mk` + +These two files follows standard QMK build system logic, allowing for `Makefile`-style customisation as if it were present in the keyboard or keymap. + +### `.c` + +This file will be automatically added to the build if the filename matches the directory name. For example, the `qmk/hello_world` module contains a `hello_world.c` file, which is automatically added to the build. + +::: info +Other files intended to be included must use the normal method of `SRC += my_file.c` inside `rules.mk`. +::: + +::: tip +This file should use `ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(1,0,0);` to enforce a minimum version of the API that it requires, ensuring the Community Module is built with a compatible version of QMK. The list of APIs and corresponding version is given at the bottom of this document. Note the use of commas instead of periods. +::: + +### `introspection.c` / `introspection.h` + +These two files hook into the keymap introspection logic -- the header is prepended before the user keymap, and the C source file is appended after the user keymap. + +The header may provide definitions which are useful to the user's `keymap.c`. + +The source file may provide functions which allow access to information specified in the user's `keymap.c`. + +::: warning +Introspection is a relatively advanced topic within QMK, and existing patterns should be followed. If you need help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) or [chat with us on Discord](https://discord.gg/qmk). +::: + +### Compatible APIs + +Community Modules may provide specializations for the following APIs: + +| Base API | API Format | Example (`hello_world` module) | API Version | +|----------------------------|-------------------------------------|----------------------------------------|-------------| +| `keyboard_pre_init` | `keyboard_pre_init_` | `keyboard_pre_init_hello_world` | `0.1.0` | +| `keyboard_post_init` | `keyboard_post_init_` | `keyboard_post_init_hello_world` | `0.1.0` | +| `pre_process_record` | `pre_process_record_` | `pre_process_record_hello_world` | `0.1.0` | +| `process_record` | `process_record_` | `process_record_hello_world` | `0.1.0` | +| `post_process_record` | `post_process_record_` | `post_process_record_hello_world` | `0.1.0` | +| `housekeeping_task` | `housekeeping_task_` | `housekeeping_task_hello_world` | `1.0.0` | +| `suspend_power_down` | `suspend_power_down_` | `suspend_power_down_hello_world` | `1.0.0` | +| `suspend_wakeup_init` | `suspend_wakeup_init_` | `suspend_wakeup_init_hello_world` | `1.0.0` | +| `shutdown` | `shutdown_` | `shutdown_hello_world` | `1.0.0` | +| `process_detected_host_os` | `process_detected_host_os_` | `process_detected_host_os_hello_world` | `1.0.0` | + +::: info +An unspecified API is disregarded if a Community Module does not provide a specialization for it. +::: + +Each API has an equivalent `__kb()` and `__user()` hook, as per the normal QMK [`_quantum`, `_kb`, and `_user` functions](/custom_quantum_functions#a-word-on-core-vs-keyboards-vs-keymap). diff --git a/docs/features/leader_key.md b/docs/features/leader_key.md index a36e630a3669..9f9086e1ae0a 100644 --- a/docs/features/leader_key.md +++ b/docs/features/leader_key.md @@ -154,6 +154,21 @@ User callback, invoked when the leader sequence ends. --- +### `bool leader_add_user(uint16_t keycode)` {#api-leader-add-user} + +User callback, invoked when a keycode is added to the leader sequence. + +#### Arguments {#api-leader-add-user-arguments} + + - `uint16_t keycode` + The keycode to added to the leader sequence. + +#### Return Value {#api-leader-add-user-return} + +`true` to finish the key sequence, `false` to continue. + +--- + ### `void leader_start(void)` {#api-leader-start} Begin the leader sequence, resetting the buffer and timer. diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index 99ff7b1f7a33..29b999c32e89 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -74,6 +74,8 @@ You can create `info.json` files at every level under `qmk_firmware/keyboards/Boolean + * Default: `false` * `hold_on_other_key_press` Boolean * Default: `false` * `hold_on_other_key_press_per_key` Boolean @@ -328,6 +330,8 @@ The ISO enter key is represented by a 1.25u×2uh key. Renderers which utilize in * `h` KeyUnit * The height of the key, in key units. * Default: `1` (1u) + * `hand` String + * The handedness of the key for Chordal Hold, either `"L"` (left hand), `"R"` (right hand), or `"*"` (either or exempted handedness). * `label` String * What to name the key. This is *not* a key assignment as in the keymap, but should usually correspond to the keycode for the first layer of the default keymap. * Example: `"Escape"` diff --git a/docs/reference_keymap_extras.md b/docs/reference_keymap_extras.md index f6b4b8faf688..c87177365137 100644 --- a/docs/reference_keymap_extras.md +++ b/docs/reference_keymap_extras.md @@ -55,6 +55,7 @@ These headers are located in [`quantum/keymap_extras/`](https://github.com/qmk/q |English (US International) |`keymap_us_international.h` |`sendstring_us_international.h` | |English (US International, Linux)|`keymap_us_international_linux.h`| | |Estonian |`keymap_estonian.h` |`sendstring_estonian.h` | +|EurKEY |`keymap_eurkey.h` | | |Farsi |`keymap_farsi.h` | | |Finnish |`keymap_finnish.h` |`sendstring_finnish.h` | |French |`keymap_french.h` |`sendstring_french.h` | diff --git a/docs/tap_hold.md b/docs/tap_hold.md index 9b7f6552cbf0..254d5de5ec1e 100644 --- a/docs/tap_hold.md +++ b/docs/tap_hold.md @@ -425,6 +425,169 @@ uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { If `QUICK_TAP_TERM` is set higher than `TAPPING_TERM`, it will default to `TAPPING_TERM`. ::: +## Chordal Hold + +Chordal Hold is intended to be used together with either Permissive Hold or Hold +On Other Key Press. Chordal Hold is enabled by adding to your `config.h`: + +```c +#define CHORDAL_HOLD +``` + +Chordal Hold implements, by default, an "opposite hands" rule. Suppose a +tap-hold key is pressed and then, before the tapping term, another key is +pressed. With Chordal Hold, the tap-hold key is settled as tapped if the two +keys are on the same hand. + +Otherwise, if the keys are on opposite hands, Chordal Hold introduces no new +behavior. Hold On Other Key Press or Permissive Hold may be used together with +Chordal Hold to configure the behavior in the opposite hands case. With Hold On +Other Key Press, an opposite hands chord is settled immediately as held. Or with +Permissive Hold, an opposite hands chord is settled as held provided the other +key is pressed and released (nested press) before releasing the tap-hold key. + +Chordal Hold may be useful to avoid accidental modifier activation with +mod-taps, particularly in rolled keypresses when using home row mods. + +Notes: + +* Chordal Hold has no effect after the tapping term. + +* Combos are exempt from the opposite hands rule, since "handedness" is + ill-defined in this case. Even so, Chordal Hold's behavior involving combos + may be customized through the `get_chordal_hold()` callback. + +An example of a sequence that is affected by “chordal hold”: + +- `SFT_T(KC_A)` Down +- `KC_C` Down +- `KC_C` Up +- `SFT_T(KC_A)` Up + +``` + TAPPING_TERM + +---------------------------|--------+ + | +----------------------+ | | + | | SFT_T(KC_A) | | | + | +----------------------+ | | + | +--------------+ | | + | | KC_C | | | + | +--------------+ | | + +---------------------------|--------+ +``` + +If the two keys are on the same hand, then this will produce `ac` with +`SFT_T(KC_A)` settled as tapped the moment that `KC_C` is pressed. + +If the two keys are on opposite hands and the `HOLD_ON_OTHER_KEY_PRESS` option +enabled, this will produce `C` with `SFT_T(KC_A)` settled as held when `KC_C` is +pressed. + +Or if the two keys are on opposite hands and the `PERMISSIVE_HOLD` option is +enabled, this will produce `C` with `SFT_T(KC_A)` settled as held when that +`KC_C` is released. + +### Chordal Hold Handedness + +Determining whether keys are on the same or opposite hands involves defining the +"handedness" of each key position. By default, if nothing is specified, +handedness is guessed based on keyboard geometry. + +Handedness may be specified with `chordal_hold_layout`. In keymap.c, define +`chordal_hold_layout` in the following form: + +```c +const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM = + LAYOUT( + 'L', 'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R', 'R', + 'L', 'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R', 'R', + 'L', 'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R', 'R', + 'L', 'L', 'L', 'R', 'R', 'R' + ); +``` + +Use the same `LAYOUT` macro as used to define your keymap layers. Each entry is +a character indicating the handedness of one key, either `'L'` for left, `'R'` +for right, or `'*'` to exempt keys from the "opposite hands rule." A key with +`'*'` handedness may settle as held in chords with any other key. This could be +used perhaps on thumb keys or other places where you want to allow same-hand +chords. + +Keyboard makers may specify handedness in keyboard.json. Under `"layouts"`, +specify the handedness of a key by adding a `"hand"` field with a value of +either `"L"`, `"R"`, or `"*"`. Note that if `"layouts"` contains multiple +layouts, only the first one is read. For example: + +```json +{"matrix": [5, 6], "x": 0, "y": 5.5, "w": 1.25, "hand", "*"}, +``` + +Alternatively, handedness may be defined functionally with +`chordal_hold_handedness()`. For example, in keymap.c define: + +```c +char chordal_hold_handedness(keypos_t key) { + if (key.col == 0 || key.col == MATRIX_COLS - 1) { + return '*'; // Exempt the outer columns. + } + // On split keyboards, typically, the first half of the rows are on the + // left, and the other half are on the right. + return key.row < MATRIX_ROWS / 2 ? 'L' : 'R'; +} +``` + +Given the matrix position of a key, the function should return `'L'`, `'R'`, or +`'*'`. Adapt the logic in this function according to the keyboard's matrix. + +::: warning +Note the matrix may have irregularities around larger keys, around the edges of +the board, and around thumb clusters. You may find it helpful to use [this +debugging example](faq_debug#which-matrix-position-is-this-keypress) to +correspond physical keys to matrix positions. +::: + +::: tip If you define both `chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS]` and +`chordal_hold_handedness(keypos_t key)` for handedness, the latter takes +precedence. +::: + + +### Per-chord customization + +Beyond the per-key configuration possible through handedness, Chordal Hold may +be configured at a *per-chord* granularity for detailed tuning. In keymap.c, +define `get_chordal_hold()`. Returning `true` allows the chord to be held, while +returning `false` settles as tapped. + +For example: + +```c +bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, + uint16_t other_keycode, keyrecord_t* other_record) { + // Exceptionally allow some one-handed chords for hotkeys. + switch (tap_hold_keycode) { + case LCTL_T(KC_Z): + if (other_keycode == KC_C || other_keycode == KC_V) { + return true; + } + break; + + case RCTL_T(KC_SLSH): + if (other_keycode == KC_N) { + return true; + } + break; + } + // Otherwise defer to the opposite hands rule. + return get_chordal_hold_default(tap_hold_record, other_record); +} +``` + +As shown in the last line above, you may use +`get_chordal_hold_default(tap_hold_record, other_record)` to get the default tap +vs. hold decision according to the opposite hands rule. + + ## Retro Tapping To enable `retro tapping`, add the following to your `config.h`: diff --git a/drivers/i2c_master.h b/drivers/i2c_master.h new file mode 100644 index 000000000000..dbe1cd42faa4 --- /dev/null +++ b/drivers/i2c_master.h @@ -0,0 +1,141 @@ +// Copyright 2025 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +/** + * \file + * + * \defgroup i2c_master I2C Master API + * + * \brief API to communicate with I2C devices. + * \{ + */ + +typedef int16_t i2c_status_t; + +#define I2C_STATUS_SUCCESS (0) +#define I2C_STATUS_ERROR (-1) +#define I2C_STATUS_TIMEOUT (-2) + +#define I2C_TIMEOUT_IMMEDIATE (0) +#define I2C_TIMEOUT_INFINITE (0xFFFF) + +/** + * \brief Initialize the I2C driver. This function must be called only once, before any of the below functions can be called. + * + * This function is weakly defined, meaning it can be overridden if necessary for your particular use case. + */ +void i2c_init(void); + +/** + * \brief Send multiple bytes to the selected I2C device. + * + * \param address The 7-bit I2C address of the device. + * \param data A pointer to the data to transmit. + * \param length The number of bytes to write. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); + +#if defined(__AVR__) || defined(__DOXYGEN__) +/** + * \brief Send multiple bytes from PROGMEM to the selected I2C device. + * + * On ARM devices, this function is simply an alias for i2c_transmit(address, data, length, timeout). + * + * \param address The 7-bit I2C address of the device. + * \param data A pointer to the data to transmit. + * \param length The number of bytes to write. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); +#else +# define i2c_transmit_P(address, data, length, timeout) i2c_transmit(address, data, length, timeout) +#endif + +/** + * \brief Receive multiple bytes from the selected I2C device. + * + * \param address The 7-bit I2C address of the device. + * \param data A pointer to a buffer to read into. + * \param length The number of bytes to read. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); + +/** + * \brief Write to a register with an 8-bit address on the I2C device. + * + * \param devaddr The 7-bit I2C address of the device. + * \param regaddr The register address to write to. + * \param data A pointer to the data to transmit. + * \param length The number of bytes to write. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); + +/** + * \brief Write to a register with a 16-bit address (big endian) on the I2C device. + * + * \param devaddr The 7-bit I2C address of the device. + * \param regaddr The register address to write to. + * \param data A pointer to the data to transmit. + * \param length The number of bytes to write. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); + +/** + * \brief Read from a register with an 8-bit address on the I2C device. + * + * \param devaddr The 7-bit I2C address of the device. + * \param regaddr The register address to read from. + * \param data A pointer to a buffer to read into. + * \param length The number of bytes to read. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); + +/** + * \brief Read from a register with a 16-bit address (big endian) on the I2C device. + * + * \param devaddr The 7-bit I2C address of the device. + * \param regaddr The register address to read from. + * \param data A pointer to a buffer to read into. + * \param length The number of bytes to read. Take care not to overrun the length of `data`. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); + +/** + * \brief Ping the I2C bus for a specific address. + * + * On ChibiOS a "best effort" attempt is made by reading a single byte from register 0 at the given address. This should generally work except for I2C devices that do not not respond to a register 0 read request, which will result in a false negative result (unsuccessful response to ping attempt). + * + * This function is weakly defined, meaning it can be overridden if necessary for your particular use case. + * + * \param address The 7-bit I2C address of the device. + * \param timeout The time in milliseconds to wait for a response from the target device. + * + * \return `I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`. + */ +i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout); + +/** \} */ diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c index 050609263d51..6a1315337432 100644 --- a/drivers/led/apa102.c +++ b/drivers/led/apa102.c @@ -24,7 +24,7 @@ # elif defined(PROTOCOL_CHIBIOS) # include "hal.h" # include "chibios_config.h" -# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103) || defined(MCU_RP) +# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(AT32F415) || defined(GD32VF103) || defined(MCU_RP) # define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns # else # error APA102_NOPS configuration required @@ -122,7 +122,7 @@ void apa102_init(void) { gpio_set_pin_output(APA102_CI_PIN); } -void apa102_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue) { +void apa102_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { apa102_leds[index].r = red; apa102_leds[index].g = green; apa102_leds[index].b = blue; diff --git a/drivers/led/apa102.h b/drivers/led/apa102.h index 42f1344f0c94..6fa3521a3a5a 100644 --- a/drivers/led/apa102.h +++ b/drivers/led/apa102.h @@ -32,7 +32,7 @@ #define APA102_MAX_BRIGHTNESS 31 void apa102_init(void); -void apa102_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue); +void apa102_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); void apa102_set_color_all(uint8_t red, uint8_t green, uint8_t blue); void apa102_flush(void); diff --git a/drivers/led/aw20216s.h b/drivers/led/aw20216s.h index b2c097125f98..79b980fcdb01 100644 --- a/drivers/led/aw20216s.h +++ b/drivers/led/aw20216s.h @@ -22,36 +22,6 @@ #include "gpio.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef AW_SCALING_MAX -# define AW20216S_SCALING_MAX AW_SCALING_MAX -#endif -#ifdef AW_GLOBAL_CURRENT_MAX -# define AW20216S_GLOBAL_CURRENT_MAX AW_GLOBAL_CURRENT_MAX -#endif -#ifdef AW_SPI_MODE -# define AW20216S_SPI_MODE AW_SPI_MODE -#endif -#ifdef AW_SPI_DIVISOR -# define AW20216S_SPI_DIVISOR AW_SPI_DIVISOR -#endif -#ifdef DRIVER_1_CS -# define AW20216S_CS_PIN_1 DRIVER_1_CS -#endif -#ifdef DRIVER_2_CS -# define AW20216S_CS_PIN_2 DRIVER_2_CS -#endif -#ifdef DRIVER_1_EN -# define AW20216S_EN_PIN DRIVER_1_EN -#endif -#ifdef AW20216S_EN_PIN_1 -# define AW20216S_EN_PIN AW20216S_EN_PIN_1 -#endif - -#define aw_led aw20216s_led_t -#define g_aw_leds g_aw20216s_leds -// ======== - #define AW20216S_ID (0b1010 << 4) #define AW20216S_WRITE 0 #define AW20216S_READ 1 @@ -328,233 +298,3 @@ void aw20216s_flush(void); #define SW12_CS16 0xD5 #define SW12_CS17 0xD6 #define SW12_CS18 0xD7 - -// DEPRECATED - DO NOT USE - -#define CS1_SW1 SW1_CS1 -#define CS2_SW1 SW1_CS2 -#define CS3_SW1 SW1_CS3 -#define CS4_SW1 SW1_CS4 -#define CS5_SW1 SW1_CS5 -#define CS6_SW1 SW1_CS6 -#define CS7_SW1 SW1_CS7 -#define CS8_SW1 SW1_CS8 -#define CS9_SW1 SW1_CS9 -#define CS10_SW1 SW1_CS10 -#define CS11_SW1 SW1_CS11 -#define CS12_SW1 SW1_CS12 -#define CS13_SW1 SW1_CS13 -#define CS14_SW1 SW1_CS14 -#define CS15_SW1 SW1_CS15 -#define CS16_SW1 SW1_CS16 -#define CS17_SW1 SW1_CS17 -#define CS18_SW1 SW1_CS18 - -#define CS1_SW2 SW2_CS1 -#define CS2_SW2 SW2_CS2 -#define CS3_SW2 SW2_CS3 -#define CS4_SW2 SW2_CS4 -#define CS5_SW2 SW2_CS5 -#define CS6_SW2 SW2_CS6 -#define CS7_SW2 SW2_CS7 -#define CS8_SW2 SW2_CS8 -#define CS9_SW2 SW2_CS9 -#define CS10_SW2 SW2_CS10 -#define CS11_SW2 SW2_CS11 -#define CS12_SW2 SW2_CS12 -#define CS13_SW2 SW2_CS13 -#define CS14_SW2 SW2_CS14 -#define CS15_SW2 SW2_CS15 -#define CS16_SW2 SW2_CS16 -#define CS17_SW2 SW2_CS17 -#define CS18_SW2 SW2_CS18 - -#define CS1_SW3 SW3_CS1 -#define CS2_SW3 SW3_CS2 -#define CS3_SW3 SW3_CS3 -#define CS4_SW3 SW3_CS4 -#define CS5_SW3 SW3_CS5 -#define CS6_SW3 SW3_CS6 -#define CS7_SW3 SW3_CS7 -#define CS8_SW3 SW3_CS8 -#define CS9_SW3 SW3_CS9 -#define CS10_SW3 SW3_CS10 -#define CS11_SW3 SW3_CS11 -#define CS12_SW3 SW3_CS12 -#define CS13_SW3 SW3_CS13 -#define CS14_SW3 SW3_CS14 -#define CS15_SW3 SW3_CS15 -#define CS16_SW3 SW3_CS16 -#define CS17_SW3 SW3_CS17 -#define CS18_SW3 SW3_CS18 - -#define CS1_SW4 SW4_CS1 -#define CS2_SW4 SW4_CS2 -#define CS3_SW4 SW4_CS3 -#define CS4_SW4 SW4_CS4 -#define CS5_SW4 SW4_CS5 -#define CS6_SW4 SW4_CS6 -#define CS7_SW4 SW4_CS7 -#define CS8_SW4 SW4_CS8 -#define CS9_SW4 SW4_CS9 -#define CS10_SW4 SW4_CS10 -#define CS11_SW4 SW4_CS11 -#define CS12_SW4 SW4_CS12 -#define CS13_SW4 SW4_CS13 -#define CS14_SW4 SW4_CS14 -#define CS15_SW4 SW4_CS15 -#define CS16_SW4 SW4_CS16 -#define CS17_SW4 SW4_CS17 -#define CS18_SW4 SW4_CS18 - -#define CS1_SW5 SW5_CS1 -#define CS2_SW5 SW5_CS2 -#define CS3_SW5 SW5_CS3 -#define CS4_SW5 SW5_CS4 -#define CS5_SW5 SW5_CS5 -#define CS6_SW5 SW5_CS6 -#define CS7_SW5 SW5_CS7 -#define CS8_SW5 SW5_CS8 -#define CS9_SW5 SW5_CS9 -#define CS10_SW5 SW5_CS10 -#define CS11_SW5 SW5_CS11 -#define CS12_SW5 SW5_CS12 -#define CS13_SW5 SW5_CS13 -#define CS14_SW5 SW5_CS14 -#define CS15_SW5 SW5_CS15 -#define CS16_SW5 SW5_CS16 -#define CS17_SW5 SW5_CS17 -#define CS18_SW5 SW5_CS18 - -#define CS1_SW6 SW6_CS1 -#define CS2_SW6 SW6_CS2 -#define CS3_SW6 SW6_CS3 -#define CS4_SW6 SW6_CS4 -#define CS5_SW6 SW6_CS5 -#define CS6_SW6 SW6_CS6 -#define CS7_SW6 SW6_CS7 -#define CS8_SW6 SW6_CS8 -#define CS9_SW6 SW6_CS9 -#define CS10_SW6 SW6_CS10 -#define CS11_SW6 SW6_CS11 -#define CS12_SW6 SW6_CS12 -#define CS13_SW6 SW6_CS13 -#define CS14_SW6 SW6_CS14 -#define CS15_SW6 SW6_CS15 -#define CS16_SW6 SW6_CS16 -#define CS17_SW6 SW6_CS17 -#define CS18_SW6 SW6_CS18 - -#define CS1_SW7 SW7_CS1 -#define CS2_SW7 SW7_CS2 -#define CS3_SW7 SW7_CS3 -#define CS4_SW7 SW7_CS4 -#define CS5_SW7 SW7_CS5 -#define CS6_SW7 SW7_CS6 -#define CS7_SW7 SW7_CS7 -#define CS8_SW7 SW7_CS8 -#define CS9_SW7 SW7_CS9 -#define CS10_SW7 SW7_CS10 -#define CS11_SW7 SW7_CS11 -#define CS12_SW7 SW7_CS12 -#define CS13_SW7 SW7_CS13 -#define CS14_SW7 SW7_CS14 -#define CS15_SW7 SW7_CS15 -#define CS16_SW7 SW7_CS16 -#define CS17_SW7 SW7_CS17 -#define CS18_SW7 SW7_CS18 - -#define CS1_SW8 SW8_CS1 -#define CS2_SW8 SW8_CS2 -#define CS3_SW8 SW8_CS3 -#define CS4_SW8 SW8_CS4 -#define CS5_SW8 SW8_CS5 -#define CS6_SW8 SW8_CS6 -#define CS7_SW8 SW8_CS7 -#define CS8_SW8 SW8_CS8 -#define CS9_SW8 SW8_CS9 -#define CS10_SW8 SW8_CS10 -#define CS11_SW8 SW8_CS11 -#define CS12_SW8 SW8_CS12 -#define CS13_SW8 SW8_CS13 -#define CS14_SW8 SW8_CS14 -#define CS15_SW8 SW8_CS15 -#define CS16_SW8 SW8_CS16 -#define CS17_SW8 SW8_CS17 -#define CS18_SW8 SW8_CS18 - -#define CS1_SW9 SW9_CS1 -#define CS2_SW9 SW9_CS2 -#define CS3_SW9 SW9_CS3 -#define CS4_SW9 SW9_CS4 -#define CS5_SW9 SW9_CS5 -#define CS6_SW9 SW9_CS6 -#define CS7_SW9 SW9_CS7 -#define CS8_SW9 SW9_CS8 -#define CS9_SW9 SW9_CS9 -#define CS10_SW9 SW9_CS10 -#define CS11_SW9 SW9_CS11 -#define CS12_SW9 SW9_CS12 -#define CS13_SW9 SW9_CS13 -#define CS14_SW9 SW9_CS14 -#define CS15_SW9 SW9_CS15 -#define CS16_SW9 SW9_CS16 -#define CS17_SW9 SW9_CS17 -#define CS18_SW9 SW9_CS18 - -#define CS1_SW10 SW10_CS1 -#define CS2_SW10 SW10_CS2 -#define CS3_SW10 SW10_CS3 -#define CS4_SW10 SW10_CS4 -#define CS5_SW10 SW10_CS5 -#define CS6_SW10 SW10_CS6 -#define CS7_SW10 SW10_CS7 -#define CS8_SW10 SW10_CS8 -#define CS9_SW10 SW10_CS9 -#define CS10_SW10 SW10_CS10 -#define CS11_SW10 SW10_CS11 -#define CS12_SW10 SW10_CS12 -#define CS13_SW10 SW10_CS13 -#define CS14_SW10 SW10_CS14 -#define CS15_SW10 SW10_CS15 -#define CS16_SW10 SW10_CS16 -#define CS17_SW10 SW10_CS17 -#define CS18_SW10 SW10_CS18 - -#define CS1_SW11 SW11_CS1 -#define CS2_SW11 SW11_CS2 -#define CS3_SW11 SW11_CS3 -#define CS4_SW11 SW11_CS4 -#define CS5_SW11 SW11_CS5 -#define CS6_SW11 SW11_CS6 -#define CS7_SW11 SW11_CS7 -#define CS8_SW11 SW11_CS8 -#define CS9_SW11 SW11_CS9 -#define CS10_SW11 SW11_CS10 -#define CS11_SW11 SW11_CS11 -#define CS12_SW11 SW11_CS12 -#define CS13_SW11 SW11_CS13 -#define CS14_SW11 SW11_CS14 -#define CS15_SW11 SW11_CS15 -#define CS16_SW11 SW11_CS16 -#define CS17_SW11 SW11_CS17 -#define CS18_SW11 SW11_CS18 - -#define CS1_SW12 SW12_CS1 -#define CS2_SW12 SW12_CS2 -#define CS3_SW12 SW12_CS3 -#define CS4_SW12 SW12_CS4 -#define CS5_SW12 SW12_CS5 -#define CS6_SW12 SW12_CS6 -#define CS7_SW12 SW12_CS7 -#define CS8_SW12 SW12_CS8 -#define CS9_SW12 SW12_CS9 -#define CS10_SW12 SW12_CS10 -#define CS11_SW12 SW12_CS11 -#define CS12_SW12 SW12_CS12 -#define CS13_SW12 SW12_CS13 -#define CS14_SW12 SW12_CS14 -#define CS15_SW12 SW12_CS15 -#define CS16_SW12 SW12_CS16 -#define CS17_SW12 SW12_CS17 -#define CS18_SW12 SW12_CS18 diff --git a/drivers/led/issi/is31fl3731-mono.h b/drivers/led/issi/is31fl3731-mono.h index e6e107d309b1..cc59b45cb32b 100644 --- a/drivers/led/issi/is31fl3731-mono.h +++ b/drivers/led/issi/is31fl3731-mono.h @@ -23,33 +23,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef LED_DRIVER_ADDR_1 -# define IS31FL3731_I2C_ADDRESS_1 LED_DRIVER_ADDR_1 -#endif -#ifdef LED_DRIVER_ADDR_2 -# define IS31FL3731_I2C_ADDRESS_2 LED_DRIVER_ADDR_2 -#endif -#ifdef LED_DRIVER_ADDR_3 -# define IS31FL3731_I2C_ADDRESS_3 LED_DRIVER_ADDR_3 -#endif -#ifdef LED_DRIVER_ADDR_4 -# define IS31FL3731_I2C_ADDRESS_4 LED_DRIVER_ADDR_4 -#endif -#ifdef ISSI_TIMEOUT -# define IS31FL3731_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3731_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_3731_DEGHOST -# define IS31FL3731_DEGHOST ISSI_3731_DEGHOST -#endif - -#define is31_led is31fl3731_led_t -#define g_is31_leds g_is31fl3731_leds -// ======== - #define IS31FL3731_REG_COMMAND 0xFD #define IS31FL3731_COMMAND_FRAME_1 0x00 #define IS31FL3731_COMMAND_FRAME_2 0x01 diff --git a/drivers/led/issi/is31fl3731.h b/drivers/led/issi/is31fl3731.h index dc229c876dc9..947b7dc8e9a7 100644 --- a/drivers/led/issi/is31fl3731.h +++ b/drivers/led/issi/is31fl3731.h @@ -22,33 +22,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef DRIVER_ADDR_1 -# define IS31FL3731_I2C_ADDRESS_1 DRIVER_ADDR_1 -#endif -#ifdef DRIVER_ADDR_2 -# define IS31FL3731_I2C_ADDRESS_2 DRIVER_ADDR_2 -#endif -#ifdef DRIVER_ADDR_3 -# define IS31FL3731_I2C_ADDRESS_3 DRIVER_ADDR_3 -#endif -#ifdef DRIVER_ADDR_4 -# define IS31FL3731_I2C_ADDRESS_4 DRIVER_ADDR_4 -#endif -#ifdef ISSI_TIMEOUT -# define IS31FL3731_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3731_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_3731_DEGHOST -# define IS31FL3731_DEGHOST ISSI_3731_DEGHOST -#endif - -#define is31_led is31fl3731_led_t -#define g_is31_leds g_is31fl3731_leds -// ======== - #define IS31FL3731_REG_COMMAND 0xFD #define IS31FL3731_COMMAND_FRAME_1 0x00 #define IS31FL3731_COMMAND_FRAME_2 0x01 diff --git a/drivers/led/issi/is31fl3733-mono.h b/drivers/led/issi/is31fl3733-mono.h index 3786b2ed712b..40d340a70d55 100644 --- a/drivers/led/issi/is31fl3733-mono.h +++ b/drivers/led/issi/is31fl3733-mono.h @@ -25,38 +25,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef ISSI_TIMEOUT -# define IS31FL3733_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3733_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_PWM_FREQUENCY -# define IS31FL3733_PWM_FREQUENCY ISSI_PWM_FREQUENCY -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3733_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3733_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3733_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define is31_led is31fl3733_led_t -#define g_is31_leds g_is31fl3733_leds - -#define PUR_0R IS31FL3733_PUR_0_OHM -#define PUR_05KR IS31FL3733_PUR_1K_OHM -#define PUR_3KR IS31FL3733_PUR_2K_OHM -#define PUR_4KR IS31FL3733_PUR_4K_OHM -#define PUR_8KR IS31FL3733_PUR_8K_OHM -#define PUR_16KR IS31FL3733_PUR_16K_OHM -#define PUR_32KR IS31FL3733_PUR_32K_OHM -// ======== - #define IS31FL3733_REG_INTERRUPT_MASK 0xF0 #define IS31FL3733_REG_INTERRUPT_STATUS 0xF1 diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index fb60c76c2dec..8757d5ab0747 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -24,62 +24,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef DRIVER_ADDR_1 -# define IS31FL3733_I2C_ADDRESS_1 DRIVER_ADDR_1 -#endif -#ifdef DRIVER_ADDR_2 -# define IS31FL3733_I2C_ADDRESS_2 DRIVER_ADDR_2 -#endif -#ifdef DRIVER_ADDR_3 -# define IS31FL3733_I2C_ADDRESS_3 DRIVER_ADDR_3 -#endif -#ifdef DRIVER_ADDR_4 -# define IS31FL3733_I2C_ADDRESS_4 DRIVER_ADDR_4 -#endif -#ifdef DRIVER_SYNC_1 -# define IS31FL3733_SYNC_1 DRIVER_SYNC_1 -#endif -#ifdef DRIVER_SYNC_2 -# define IS31FL3733_SYNC_2 DRIVER_SYNC_2 -#endif -#ifdef DRIVER_SYNC_3 -# define IS31FL3733_SYNC_3 DRIVER_SYNC_3 -#endif -#ifdef DRIVER_SYNC_4 -# define IS31FL3733_SYNC_4 DRIVER_SYNC_4 -#endif -#ifdef ISSI_TIMEOUT -# define IS31FL3733_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3733_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_PWM_FREQUENCY -# define IS31FL3733_PWM_FREQUENCY ISSI_PWM_FREQUENCY -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3733_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3733_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3733_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define is31_led is31fl3733_led_t -#define g_is31_leds g_is31fl3733_leds - -#define PUR_0R IS31FL3733_PUR_0_OHM -#define PUR_05KR IS31FL3733_PUR_1K_OHM -#define PUR_3KR IS31FL3733_PUR_2K_OHM -#define PUR_4KR IS31FL3733_PUR_4K_OHM -#define PUR_8KR IS31FL3733_PUR_8K_OHM -#define PUR_16KR IS31FL3733_PUR_16K_OHM -#define PUR_32KR IS31FL3733_PUR_32K_OHM -// ======== - #define IS31FL3733_REG_INTERRUPT_MASK 0xF0 #define IS31FL3733_REG_INTERRUPT_STATUS 0xF1 @@ -389,209 +333,3 @@ void is31fl3733_flush(void); #define SW12_CS14 0xBD #define SW12_CS15 0xBE #define SW12_CS16 0xBF - -// DEPRECATED - DO NOT USE - -#define A_1 SW1_CS1 -#define A_2 SW1_CS2 -#define A_3 SW1_CS3 -#define A_4 SW1_CS4 -#define A_5 SW1_CS5 -#define A_6 SW1_CS6 -#define A_7 SW1_CS7 -#define A_8 SW1_CS8 -#define A_9 SW1_CS9 -#define A_10 SW1_CS10 -#define A_11 SW1_CS11 -#define A_12 SW1_CS12 -#define A_13 SW1_CS13 -#define A_14 SW1_CS14 -#define A_15 SW1_CS15 -#define A_16 SW1_CS16 - -#define B_1 SW2_CS1 -#define B_2 SW2_CS2 -#define B_3 SW2_CS3 -#define B_4 SW2_CS4 -#define B_5 SW2_CS5 -#define B_6 SW2_CS6 -#define B_7 SW2_CS7 -#define B_8 SW2_CS8 -#define B_9 SW2_CS9 -#define B_10 SW2_CS10 -#define B_11 SW2_CS11 -#define B_12 SW2_CS12 -#define B_13 SW2_CS13 -#define B_14 SW2_CS14 -#define B_15 SW2_CS15 -#define B_16 SW2_CS16 - -#define C_1 SW3_CS1 -#define C_2 SW3_CS2 -#define C_3 SW3_CS3 -#define C_4 SW3_CS4 -#define C_5 SW3_CS5 -#define C_6 SW3_CS6 -#define C_7 SW3_CS7 -#define C_8 SW3_CS8 -#define C_9 SW3_CS9 -#define C_10 SW3_CS10 -#define C_11 SW3_CS11 -#define C_12 SW3_CS12 -#define C_13 SW3_CS13 -#define C_14 SW3_CS14 -#define C_15 SW3_CS15 -#define C_16 SW3_CS16 - -#define D_1 SW4_CS1 -#define D_2 SW4_CS2 -#define D_3 SW4_CS3 -#define D_4 SW4_CS4 -#define D_5 SW4_CS5 -#define D_6 SW4_CS6 -#define D_7 SW4_CS7 -#define D_8 SW4_CS8 -#define D_9 SW4_CS9 -#define D_10 SW4_CS10 -#define D_11 SW4_CS11 -#define D_12 SW4_CS12 -#define D_13 SW4_CS13 -#define D_14 SW4_CS14 -#define D_15 SW4_CS15 -#define D_16 SW4_CS16 - -#define E_1 SW5_CS1 -#define E_2 SW5_CS2 -#define E_3 SW5_CS3 -#define E_4 SW5_CS4 -#define E_5 SW5_CS5 -#define E_6 SW5_CS6 -#define E_7 SW5_CS7 -#define E_8 SW5_CS8 -#define E_9 SW5_CS9 -#define E_10 SW5_CS10 -#define E_11 SW5_CS11 -#define E_12 SW5_CS12 -#define E_13 SW5_CS13 -#define E_14 SW5_CS14 -#define E_15 SW5_CS15 -#define E_16 SW5_CS16 - -#define F_1 SW6_CS1 -#define F_2 SW6_CS2 -#define F_3 SW6_CS3 -#define F_4 SW6_CS4 -#define F_5 SW6_CS5 -#define F_6 SW6_CS6 -#define F_7 SW6_CS7 -#define F_8 SW6_CS8 -#define F_9 SW6_CS9 -#define F_10 SW6_CS10 -#define F_11 SW6_CS11 -#define F_12 SW6_CS12 -#define F_13 SW6_CS13 -#define F_14 SW6_CS14 -#define F_15 SW6_CS15 -#define F_16 SW6_CS16 - -#define G_1 SW7_CS1 -#define G_2 SW7_CS2 -#define G_3 SW7_CS3 -#define G_4 SW7_CS4 -#define G_5 SW7_CS5 -#define G_6 SW7_CS6 -#define G_7 SW7_CS7 -#define G_8 SW7_CS8 -#define G_9 SW7_CS9 -#define G_10 SW7_CS10 -#define G_11 SW7_CS11 -#define G_12 SW7_CS12 -#define G_13 SW7_CS13 -#define G_14 SW7_CS14 -#define G_15 SW7_CS15 -#define G_16 SW7_CS16 - -#define H_1 SW8_CS1 -#define H_2 SW8_CS2 -#define H_3 SW8_CS3 -#define H_4 SW8_CS4 -#define H_5 SW8_CS5 -#define H_6 SW8_CS6 -#define H_7 SW8_CS7 -#define H_8 SW8_CS8 -#define H_9 SW8_CS9 -#define H_10 SW8_CS10 -#define H_11 SW8_CS11 -#define H_12 SW8_CS12 -#define H_13 SW8_CS13 -#define H_14 SW8_CS14 -#define H_15 SW8_CS15 -#define H_16 SW8_CS16 - -#define I_1 SW9_CS1 -#define I_2 SW9_CS2 -#define I_3 SW9_CS3 -#define I_4 SW9_CS4 -#define I_5 SW9_CS5 -#define I_6 SW9_CS6 -#define I_7 SW9_CS7 -#define I_8 SW9_CS8 -#define I_9 SW9_CS9 -#define I_10 SW9_CS10 -#define I_11 SW9_CS11 -#define I_12 SW9_CS12 -#define I_13 SW9_CS13 -#define I_14 SW9_CS14 -#define I_15 SW9_CS15 -#define I_16 SW9_CS16 - -#define J_1 SW10_CS1 -#define J_2 SW10_CS2 -#define J_3 SW10_CS3 -#define J_4 SW10_CS4 -#define J_5 SW10_CS5 -#define J_6 SW10_CS6 -#define J_7 SW10_CS7 -#define J_8 SW10_CS8 -#define J_9 SW10_CS9 -#define J_10 SW10_CS10 -#define J_11 SW10_CS11 -#define J_12 SW10_CS12 -#define J_13 SW10_CS13 -#define J_14 SW10_CS14 -#define J_15 SW10_CS15 -#define J_16 SW10_CS16 - -#define K_1 SW11_CS1 -#define K_2 SW11_CS2 -#define K_3 SW11_CS3 -#define K_4 SW11_CS4 -#define K_5 SW11_CS5 -#define K_6 SW11_CS6 -#define K_7 SW11_CS7 -#define K_8 SW11_CS8 -#define K_9 SW11_CS9 -#define K_10 SW11_CS10 -#define K_11 SW11_CS11 -#define K_12 SW11_CS12 -#define K_13 SW11_CS13 -#define K_14 SW11_CS14 -#define K_15 SW11_CS15 -#define K_16 SW11_CS16 - -#define L_1 SW12_CS1 -#define L_2 SW12_CS2 -#define L_3 SW12_CS3 -#define L_4 SW12_CS4 -#define L_5 SW12_CS5 -#define L_6 SW12_CS6 -#define L_7 SW12_CS7 -#define L_8 SW12_CS8 -#define L_9 SW12_CS9 -#define L_10 SW12_CS10 -#define L_11 SW12_CS11 -#define L_12 SW12_CS12 -#define L_13 SW12_CS13 -#define L_14 SW12_CS14 -#define L_15 SW12_CS15 -#define L_16 SW12_CS16 diff --git a/drivers/led/issi/is31fl3736-mono.h b/drivers/led/issi/is31fl3736-mono.h index 91c2e0420b96..73441ea551f9 100644 --- a/drivers/led/issi/is31fl3736-mono.h +++ b/drivers/led/issi/is31fl3736-mono.h @@ -22,36 +22,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef ISSI_TIMEOUT -# define IS31FL3736_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3736_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3736_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3736_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3736_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define is31_led is31fl3736_led_t -#define g_is31_leds g_is31fl3736_leds - -#define PUR_0R IS31FL3736_PUR_0_OHM -#define PUR_05KR IS31FL3736_PUR_05K_OHM -#define PUR_1KR IS31FL3736_PUR_1K_OHM -#define PUR_2KR IS31FL3736_PUR_2K_OHM -#define PUR_4KR IS31FL3736_PUR_4K_OHM -#define PUR_8KR IS31FL3736_PUR_8K_OHM -#define PUR_16KR IS31FL3736_PUR_16K_OHM -#define PUR_32KR IS31FL3736_PUR_32K_OHM -// ======== - #define IS31FL3736_REG_INTERRUPT_MASK 0xF0 #define IS31FL3736_REG_INTERRUPT_STATUS 0xF1 @@ -259,113 +229,3 @@ void is31fl3736_flush(void); #define SW12_CS6 0xBA #define SW12_CS7 0xBC #define SW12_CS8 0xBE - -// DEPRECATED - DO NOT USE - -#define A_1 SW1_CS1 -#define A_2 SW1_CS2 -#define A_3 SW1_CS3 -#define A_4 SW1_CS4 -#define A_5 SW1_CS5 -#define A_6 SW1_CS6 -#define A_7 SW1_CS7 -#define A_8 SW1_CS8 - -#define B_1 SW2_CS1 -#define B_2 SW2_CS2 -#define B_3 SW2_CS3 -#define B_4 SW2_CS4 -#define B_5 SW2_CS5 -#define B_6 SW2_CS6 -#define B_7 SW2_CS7 -#define B_8 SW2_CS8 - -#define C_1 SW3_CS1 -#define C_2 SW3_CS2 -#define C_3 SW3_CS3 -#define C_4 SW3_CS4 -#define C_5 SW3_CS5 -#define C_6 SW3_CS6 -#define C_7 SW3_CS7 -#define C_8 SW3_CS8 - -#define D_1 SW4_CS1 -#define D_2 SW4_CS2 -#define D_3 SW4_CS3 -#define D_4 SW4_CS4 -#define D_5 SW4_CS5 -#define D_6 SW4_CS6 -#define D_7 SW4_CS7 -#define D_8 SW4_CS8 - -#define E_1 SW5_CS1 -#define E_2 SW5_CS2 -#define E_3 SW5_CS3 -#define E_4 SW5_CS4 -#define E_5 SW5_CS5 -#define E_6 SW5_CS6 -#define E_7 SW5_CS7 -#define E_8 SW5_CS8 - -#define F_1 SW6_CS1 -#define F_2 SW6_CS2 -#define F_3 SW6_CS3 -#define F_4 SW6_CS4 -#define F_5 SW6_CS5 -#define F_6 SW6_CS6 -#define F_7 SW6_CS7 -#define F_8 SW6_CS8 - -#define G_1 SW7_CS1 -#define G_2 SW7_CS2 -#define G_3 SW7_CS3 -#define G_4 SW7_CS4 -#define G_5 SW7_CS5 -#define G_6 SW7_CS6 -#define G_7 SW7_CS7 -#define G_8 SW7_CS8 - -#define H_1 SW8_CS1 -#define H_2 SW8_CS2 -#define H_3 SW8_CS3 -#define H_4 SW8_CS4 -#define H_5 SW8_CS5 -#define H_6 SW8_CS6 -#define H_7 SW8_CS7 -#define H_8 SW8_CS8 - -#define I_1 SW9_CS1 -#define I_2 SW9_CS2 -#define I_3 SW9_CS3 -#define I_4 SW9_CS4 -#define I_5 SW9_CS5 -#define I_6 SW9_CS6 -#define I_7 SW9_CS7 -#define I_8 SW9_CS8 - -#define J_1 SW10_CS1 -#define J_2 SW10_CS2 -#define J_3 SW10_CS3 -#define J_4 SW10_CS4 -#define J_5 SW10_CS5 -#define J_6 SW10_CS6 -#define J_7 SW10_CS7 -#define J_8 SW10_CS8 - -#define K_1 SW11_CS1 -#define K_2 SW11_CS2 -#define K_3 SW11_CS3 -#define K_4 SW11_CS4 -#define K_5 SW11_CS5 -#define K_6 SW11_CS6 -#define K_7 SW11_CS7 -#define K_8 SW11_CS8 - -#define L_1 SW12_CS1 -#define L_2 SW12_CS2 -#define L_3 SW12_CS3 -#define L_4 SW12_CS4 -#define L_5 SW12_CS5 -#define L_6 SW12_CS6 -#define L_7 SW12_CS7 -#define L_8 SW12_CS8 diff --git a/drivers/led/issi/is31fl3736.h b/drivers/led/issi/is31fl3736.h index dae7b3c81215..f0eabad819c3 100644 --- a/drivers/led/issi/is31fl3736.h +++ b/drivers/led/issi/is31fl3736.h @@ -22,48 +22,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef DRIVER_ADDR_1 -# define IS31FL3736_I2C_ADDRESS_1 DRIVER_ADDR_1 -#endif -#ifdef DRIVER_ADDR_2 -# define IS31FL3736_I2C_ADDRESS_2 DRIVER_ADDR_2 -#endif -#ifdef DRIVER_ADDR_3 -# define IS31FL3736_I2C_ADDRESS_3 DRIVER_ADDR_3 -#endif -#ifdef DRIVER_ADDR_4 -# define IS31FL3736_I2C_ADDRESS_4 DRIVER_ADDR_4 -#endif -#ifdef ISSI_TIMEOUT -# define IS31FL3736_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3736_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3736_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3736_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3736_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define is31_led is31fl3736_led_t -#define g_is31_leds g_is31fl3736_leds - -#define PUR_0R IS31FL3736_PUR_0_OHM -#define PUR_05KR IS31FL3736_PUR_0K5_OHM -#define PUR_1KR IS31FL3736_PUR_1K_OHM -#define PUR_2KR IS31FL3736_PUR_2K_OHM -#define PUR_4KR IS31FL3736_PUR_4K_OHM -#define PUR_8KR IS31FL3736_PUR_8K_OHM -#define PUR_16KR IS31FL3736_PUR_16K_OHM -#define PUR_32KR IS31FL3736_PUR_32K_OHM -// ======== - #define IS31FL3736_REG_INTERRUPT_MASK 0xF0 #define IS31FL3736_REG_INTERRUPT_STATUS 0xF1 diff --git a/drivers/led/issi/is31fl3737-mono.h b/drivers/led/issi/is31fl3737-mono.h index 99151c1e7a72..40380f900627 100644 --- a/drivers/led/issi/is31fl3737-mono.h +++ b/drivers/led/issi/is31fl3737-mono.h @@ -24,36 +24,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef ISSI_TIMEOUT -# define IS31FL3737_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3737_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_PWM_FREQUENCY -# define IS31FL3737_PWM_FREQUENCY ISSI_PWM_FREQUENCY -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3737_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3737_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3737_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define PUR_0R IS31FL3737_PUR_0_OHM -#define PUR_05KR IS31FL3737_PUR_0K5_OHM -#define PUR_1KR IS31FL3737_PUR_1K_OHM -#define PUR_2KR IS31FL3737_PUR_2K_OHM -#define PUR_4KR IS31FL3737_PUR_4K_OHM -#define PUR_8KR IS31FL3737_PUR_8K_OHM -#define PUR_16KR IS31FL3737_PUR_16K_OHM -#define PUR_32KR IS31FL3737_PUR_32K_OHM -// ======== - #define IS31FL3737_REG_INTERRUPT_MASK 0xF0 #define IS31FL3737_REG_INTERRUPT_STATUS 0xF1 diff --git a/drivers/led/issi/is31fl3737.h b/drivers/led/issi/is31fl3737.h index 735a3a1e308b..c1a9306a87ea 100644 --- a/drivers/led/issi/is31fl3737.h +++ b/drivers/led/issi/is31fl3737.h @@ -24,51 +24,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef DRIVER_ADDR_1 -# define IS31FL3737_I2C_ADDRESS_1 DRIVER_ADDR_1 -#endif -#ifdef DRIVER_ADDR_2 -# define IS31FL3737_I2C_ADDRESS_2 DRIVER_ADDR_2 -#endif -#ifdef DRIVER_ADDR_3 -# define IS31FL3737_I2C_ADDRESS_3 DRIVER_ADDR_3 -#endif -#ifdef DRIVER_ADDR_4 -# define IS31FL3737_I2C_ADDRESS_4 DRIVER_ADDR_4 -#endif -#ifdef ISSI_TIMEOUT -# define IS31FL3737_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3737_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_PWM_FREQUENCY -# define IS31FL3737_PWM_FREQUENCY ISSI_PWM_FREQUENCY -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3737_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3737_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3737_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define is31_led is31fl3737_led_t -#define g_is31_leds g_is31fl3737_leds - -#define PUR_0R IS31FL3737_PUR_0_OHM -#define PUR_05KR IS31FL3737_PUR_0K5_OHM -#define PUR_1KR IS31FL3737_PUR_1K_OHM -#define PUR_2KR IS31FL3737_PUR_2K_OHM -#define PUR_4KR IS31FL3737_PUR_4K_OHM -#define PUR_8KR IS31FL3737_PUR_8K_OHM -#define PUR_16KR IS31FL3737_PUR_16K_OHM -#define PUR_32KR IS31FL3737_PUR_32K_OHM -// ======== - #define IS31FL3737_REG_INTERRUPT_MASK 0xF0 #define IS31FL3737_REG_INTERRUPT_STATUS 0xF1 @@ -314,161 +269,3 @@ void is31fl3737_flush(void); #define SW12_CS10 0xBB #define SW12_CS11 0xBC #define SW12_CS12 0xBD - -// DEPRECATED - DO NOT USE - -#define A_1 SW1_CS1 -#define A_2 SW1_CS2 -#define A_3 SW1_CS3 -#define A_4 SW1_CS4 -#define A_5 SW1_CS5 -#define A_6 SW1_CS6 -#define A_7 SW1_CS7 -#define A_8 SW1_CS8 -#define A_9 SW1_CS9 -#define A_10 SW1_CS10 -#define A_11 SW1_CS11 -#define A_12 SW1_CS12 - -#define B_1 SW2_CS1 -#define B_2 SW2_CS2 -#define B_3 SW2_CS3 -#define B_4 SW2_CS4 -#define B_5 SW2_CS5 -#define B_6 SW2_CS6 -#define B_7 SW2_CS7 -#define B_8 SW2_CS8 -#define B_9 SW2_CS9 -#define B_10 SW2_CS10 -#define B_11 SW2_CS11 -#define B_12 SW2_CS12 - -#define C_1 SW3_CS1 -#define C_2 SW3_CS2 -#define C_3 SW3_CS3 -#define C_4 SW3_CS4 -#define C_5 SW3_CS5 -#define C_6 SW3_CS6 -#define C_7 SW3_CS7 -#define C_8 SW3_CS8 -#define C_9 SW3_CS9 -#define C_10 SW3_CS10 -#define C_11 SW3_CS11 -#define C_12 SW3_CS12 - -#define D_1 SW4_CS1 -#define D_2 SW4_CS2 -#define D_3 SW4_CS3 -#define D_4 SW4_CS4 -#define D_5 SW4_CS5 -#define D_6 SW4_CS6 -#define D_7 SW4_CS7 -#define D_8 SW4_CS8 -#define D_9 SW4_CS9 -#define D_10 SW4_CS10 -#define D_11 SW4_CS11 -#define D_12 SW4_CS12 - -#define E_1 SW5_CS1 -#define E_2 SW5_CS2 -#define E_3 SW5_CS3 -#define E_4 SW5_CS4 -#define E_5 SW5_CS5 -#define E_6 SW5_CS6 -#define E_7 SW5_CS7 -#define E_8 SW5_CS8 -#define E_9 SW5_CS9 -#define E_10 SW5_CS10 -#define E_11 SW5_CS11 -#define E_12 SW5_CS12 - -#define F_1 SW6_CS1 -#define F_2 SW6_CS2 -#define F_3 SW6_CS3 -#define F_4 SW6_CS4 -#define F_5 SW6_CS5 -#define F_6 SW6_CS6 -#define F_7 SW6_CS7 -#define F_8 SW6_CS8 -#define F_9 SW6_CS9 -#define F_10 SW6_CS10 -#define F_11 SW6_CS11 -#define F_12 SW6_CS12 - -#define G_1 SW7_CS1 -#define G_2 SW7_CS2 -#define G_3 SW7_CS3 -#define G_4 SW7_CS4 -#define G_5 SW7_CS5 -#define G_6 SW7_CS6 -#define G_7 SW7_CS7 -#define G_8 SW7_CS8 -#define G_9 SW7_CS9 -#define G_10 SW7_CS10 -#define G_11 SW7_CS11 -#define G_12 SW7_CS12 - -#define H_1 SW8_CS1 -#define H_2 SW8_CS2 -#define H_3 SW8_CS3 -#define H_4 SW8_CS4 -#define H_5 SW8_CS5 -#define H_6 SW8_CS6 -#define H_7 SW8_CS7 -#define H_8 SW8_CS8 -#define H_9 SW8_CS9 -#define H_10 SW8_CS10 -#define H_11 SW8_CS11 -#define H_12 SW8_CS12 - -#define I_1 SW9_CS1 -#define I_2 SW9_CS2 -#define I_3 SW9_CS3 -#define I_4 SW9_CS4 -#define I_5 SW9_CS5 -#define I_6 SW9_CS6 -#define I_7 SW9_CS7 -#define I_8 SW9_CS8 -#define I_9 SW9_CS9 -#define I_10 SW9_CS10 -#define I_11 SW9_CS11 -#define I_12 SW9_CS12 - -#define J_1 SW10_CS1 -#define J_2 SW10_CS2 -#define J_3 SW10_CS3 -#define J_4 SW10_CS4 -#define J_5 SW10_CS5 -#define J_6 SW10_CS6 -#define J_7 SW10_CS7 -#define J_8 SW10_CS8 -#define J_9 SW10_CS9 -#define J_10 SW10_CS10 -#define J_11 SW10_CS11 -#define J_12 SW10_CS12 - -#define K_1 SW11_CS1 -#define K_2 SW11_CS2 -#define K_3 SW11_CS3 -#define K_4 SW11_CS4 -#define K_5 SW11_CS5 -#define K_6 SW11_CS6 -#define K_7 SW11_CS7 -#define K_8 SW11_CS8 -#define K_9 SW11_CS9 -#define K_10 SW11_CS10 -#define K_11 SW11_CS11 -#define K_12 SW11_CS12 - -#define L_1 SW12_CS1 -#define L_2 SW12_CS2 -#define L_3 SW12_CS3 -#define L_4 SW12_CS4 -#define L_5 SW12_CS5 -#define L_6 SW12_CS6 -#define L_7 SW12_CS7 -#define L_8 SW12_CS8 -#define L_9 SW12_CS9 -#define L_10 SW12_CS10 -#define L_11 SW12_CS11 -#define L_12 SW12_CS12 diff --git a/drivers/led/issi/is31fl3741-mono.h b/drivers/led/issi/is31fl3741-mono.h index 6d4f70b1b354..d8797bda3281 100644 --- a/drivers/led/issi/is31fl3741-mono.h +++ b/drivers/led/issi/is31fl3741-mono.h @@ -24,36 +24,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef ISSI_TIMEOUT -# define IS31FL3741_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3741_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_CONFIGURATION -# define IS31FL3741_CONFIGURATION ISSI_CONFIGURATION -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3741_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3741_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3741_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define PUR_0R IS31FL3741_PUR_0_OHM -#define PUR_05KR IS31FL3741_PUR_0K5_OHM -#define PUR_1KR IS31FL3741_PUR_1K_OHM -#define PUR_2KR IS31FL3741_PUR_2K_OHM -#define PUR_4KR IS31FL3741_PUR_4K_OHM -#define PUR_8KR IS31FL3741_PUR_8K_OHM -#define PUR_16KR IS31FL3741_PUR_16K_OHM -#define PUR_32KR IS31FL3741_PUR_32K_OHM -// ======== - #define IS31FL3741_REG_INTERRUPT_MASK 0xF0 #define IS31FL3741_REG_INTERRUPT_STATUS 0xF1 #define IS31FL3741_REG_ID 0xFC @@ -514,374 +484,3 @@ void is31fl3741_flush(void); #define SW9_CS37 0x1A8 #define SW9_CS38 0x1A9 #define SW9_CS39 0x1AA - -// DEPRECATED - DO NOT USE - -#define CS1_SW1 SW1_CS1 -#define CS2_SW1 SW1_CS2 -#define CS3_SW1 SW1_CS3 -#define CS4_SW1 SW1_CS4 -#define CS5_SW1 SW1_CS5 -#define CS6_SW1 SW1_CS6 -#define CS7_SW1 SW1_CS7 -#define CS8_SW1 SW1_CS8 -#define CS9_SW1 SW1_CS9 -#define CS10_SW1 SW1_CS10 -#define CS11_SW1 SW1_CS11 -#define CS12_SW1 SW1_CS12 -#define CS13_SW1 SW1_CS13 -#define CS14_SW1 SW1_CS14 -#define CS15_SW1 SW1_CS15 -#define CS16_SW1 SW1_CS16 -#define CS17_SW1 SW1_CS17 -#define CS18_SW1 SW1_CS18 -#define CS19_SW1 SW1_CS19 -#define CS20_SW1 SW1_CS20 -#define CS21_SW1 SW1_CS21 -#define CS22_SW1 SW1_CS22 -#define CS23_SW1 SW1_CS23 -#define CS24_SW1 SW1_CS24 -#define CS25_SW1 SW1_CS25 -#define CS26_SW1 SW1_CS26 -#define CS27_SW1 SW1_CS27 -#define CS28_SW1 SW1_CS28 -#define CS29_SW1 SW1_CS29 -#define CS30_SW1 SW1_CS30 - -#define CS1_SW2 SW2_CS1 -#define CS2_SW2 SW2_CS2 -#define CS3_SW2 SW2_CS3 -#define CS4_SW2 SW2_CS4 -#define CS5_SW2 SW2_CS5 -#define CS6_SW2 SW2_CS6 -#define CS7_SW2 SW2_CS7 -#define CS8_SW2 SW2_CS8 -#define CS9_SW2 SW2_CS9 -#define CS10_SW2 SW2_CS10 -#define CS11_SW2 SW2_CS11 -#define CS12_SW2 SW2_CS12 -#define CS13_SW2 SW2_CS13 -#define CS14_SW2 SW2_CS14 -#define CS15_SW2 SW2_CS15 -#define CS16_SW2 SW2_CS16 -#define CS17_SW2 SW2_CS17 -#define CS18_SW2 SW2_CS18 -#define CS19_SW2 SW2_CS19 -#define CS20_SW2 SW2_CS20 -#define CS21_SW2 SW2_CS21 -#define CS22_SW2 SW2_CS22 -#define CS23_SW2 SW2_CS23 -#define CS24_SW2 SW2_CS24 -#define CS25_SW2 SW2_CS25 -#define CS26_SW2 SW2_CS26 -#define CS27_SW2 SW2_CS27 -#define CS28_SW2 SW2_CS28 -#define CS29_SW2 SW2_CS29 -#define CS30_SW2 SW2_CS30 - -#define CS1_SW3 SW3_CS1 -#define CS2_SW3 SW3_CS2 -#define CS3_SW3 SW3_CS3 -#define CS4_SW3 SW3_CS4 -#define CS5_SW3 SW3_CS5 -#define CS6_SW3 SW3_CS6 -#define CS7_SW3 SW3_CS7 -#define CS8_SW3 SW3_CS8 -#define CS9_SW3 SW3_CS9 -#define CS10_SW3 SW3_CS10 -#define CS11_SW3 SW3_CS11 -#define CS12_SW3 SW3_CS12 -#define CS13_SW3 SW3_CS13 -#define CS14_SW3 SW3_CS14 -#define CS15_SW3 SW3_CS15 -#define CS16_SW3 SW3_CS16 -#define CS17_SW3 SW3_CS17 -#define CS18_SW3 SW3_CS18 -#define CS19_SW3 SW3_CS19 -#define CS20_SW3 SW3_CS20 -#define CS21_SW3 SW3_CS21 -#define CS22_SW3 SW3_CS22 -#define CS23_SW3 SW3_CS23 -#define CS24_SW3 SW3_CS24 -#define CS25_SW3 SW3_CS25 -#define CS26_SW3 SW3_CS26 -#define CS27_SW3 SW3_CS27 -#define CS28_SW3 SW3_CS28 -#define CS29_SW3 SW3_CS29 -#define CS30_SW3 SW3_CS30 - -#define CS1_SW4 SW4_CS1 -#define CS2_SW4 SW4_CS2 -#define CS3_SW4 SW4_CS3 -#define CS4_SW4 SW4_CS4 -#define CS5_SW4 SW4_CS5 -#define CS6_SW4 SW4_CS6 -#define CS7_SW4 SW4_CS7 -#define CS8_SW4 SW4_CS8 -#define CS9_SW4 SW4_CS9 -#define CS10_SW4 SW4_CS10 -#define CS11_SW4 SW4_CS11 -#define CS12_SW4 SW4_CS12 -#define CS13_SW4 SW4_CS13 -#define CS14_SW4 SW4_CS14 -#define CS15_SW4 SW4_CS15 -#define CS16_SW4 SW4_CS16 -#define CS17_SW4 SW4_CS17 -#define CS18_SW4 SW4_CS18 -#define CS19_SW4 SW4_CS19 -#define CS20_SW4 SW4_CS20 -#define CS21_SW4 SW4_CS21 -#define CS22_SW4 SW4_CS22 -#define CS23_SW4 SW4_CS23 -#define CS24_SW4 SW4_CS24 -#define CS25_SW4 SW4_CS25 -#define CS26_SW4 SW4_CS26 -#define CS27_SW4 SW4_CS27 -#define CS28_SW4 SW4_CS28 -#define CS29_SW4 SW4_CS29 -#define CS30_SW4 SW4_CS30 - -#define CS1_SW5 SW5_CS1 -#define CS2_SW5 SW5_CS2 -#define CS3_SW5 SW5_CS3 -#define CS4_SW5 SW5_CS4 -#define CS5_SW5 SW5_CS5 -#define CS6_SW5 SW5_CS6 -#define CS7_SW5 SW5_CS7 -#define CS8_SW5 SW5_CS8 -#define CS9_SW5 SW5_CS9 -#define CS10_SW5 SW5_CS10 -#define CS11_SW5 SW5_CS11 -#define CS12_SW5 SW5_CS12 -#define CS13_SW5 SW5_CS13 -#define CS14_SW5 SW5_CS14 -#define CS15_SW5 SW5_CS15 -#define CS16_SW5 SW5_CS16 -#define CS17_SW5 SW5_CS17 -#define CS18_SW5 SW5_CS18 -#define CS19_SW5 SW5_CS19 -#define CS20_SW5 SW5_CS20 -#define CS21_SW5 SW5_CS21 -#define CS22_SW5 SW5_CS22 -#define CS23_SW5 SW5_CS23 -#define CS24_SW5 SW5_CS24 -#define CS25_SW5 SW5_CS25 -#define CS26_SW5 SW5_CS26 -#define CS27_SW5 SW5_CS27 -#define CS28_SW5 SW5_CS28 -#define CS29_SW5 SW5_CS29 -#define CS30_SW5 SW5_CS30 - -#define CS1_SW6 SW6_CS1 -#define CS2_SW6 SW6_CS2 -#define CS3_SW6 SW6_CS3 -#define CS4_SW6 SW6_CS4 -#define CS5_SW6 SW6_CS5 -#define CS6_SW6 SW6_CS6 -#define CS7_SW6 SW6_CS7 -#define CS8_SW6 SW6_CS8 -#define CS9_SW6 SW6_CS9 -#define CS10_SW6 SW6_CS10 -#define CS11_SW6 SW6_CS11 -#define CS12_SW6 SW6_CS12 -#define CS13_SW6 SW6_CS13 -#define CS14_SW6 SW6_CS14 -#define CS15_SW6 SW6_CS15 -#define CS16_SW6 SW6_CS16 -#define CS17_SW6 SW6_CS17 -#define CS18_SW6 SW6_CS18 -#define CS19_SW6 SW6_CS19 -#define CS20_SW6 SW6_CS20 -#define CS21_SW6 SW6_CS21 -#define CS22_SW6 SW6_CS22 -#define CS23_SW6 SW6_CS23 -#define CS24_SW6 SW6_CS24 -#define CS25_SW6 SW6_CS25 -#define CS26_SW6 SW6_CS26 -#define CS27_SW6 SW6_CS27 -#define CS28_SW6 SW6_CS28 -#define CS29_SW6 SW6_CS29 -#define CS30_SW6 SW6_CS30 - -#define CS1_SW7 SW7_CS1 -#define CS2_SW7 SW7_CS2 -#define CS3_SW7 SW7_CS3 -#define CS4_SW7 SW7_CS4 -#define CS5_SW7 SW7_CS5 -#define CS6_SW7 SW7_CS6 -#define CS7_SW7 SW7_CS7 -#define CS8_SW7 SW7_CS8 -#define CS9_SW7 SW7_CS9 -#define CS10_SW7 SW7_CS10 -#define CS11_SW7 SW7_CS11 -#define CS12_SW7 SW7_CS12 -#define CS13_SW7 SW7_CS13 -#define CS14_SW7 SW7_CS14 -#define CS15_SW7 SW7_CS15 -#define CS16_SW7 SW7_CS16 -#define CS17_SW7 SW7_CS17 -#define CS18_SW7 SW7_CS18 -#define CS19_SW7 SW7_CS19 -#define CS20_SW7 SW7_CS20 -#define CS21_SW7 SW7_CS21 -#define CS22_SW7 SW7_CS22 -#define CS23_SW7 SW7_CS23 -#define CS24_SW7 SW7_CS24 -#define CS25_SW7 SW7_CS25 -#define CS26_SW7 SW7_CS26 -#define CS27_SW7 SW7_CS27 -#define CS28_SW7 SW7_CS28 -#define CS29_SW7 SW7_CS29 -#define CS30_SW7 SW7_CS30 - -#define CS1_SW8 SW8_CS1 -#define CS2_SW8 SW8_CS2 -#define CS3_SW8 SW8_CS3 -#define CS4_SW8 SW8_CS4 -#define CS5_SW8 SW8_CS5 -#define CS6_SW8 SW8_CS6 -#define CS7_SW8 SW8_CS7 -#define CS8_SW8 SW8_CS8 -#define CS9_SW8 SW8_CS9 -#define CS10_SW8 SW8_CS10 -#define CS11_SW8 SW8_CS11 -#define CS12_SW8 SW8_CS12 -#define CS13_SW8 SW8_CS13 -#define CS14_SW8 SW8_CS14 -#define CS15_SW8 SW8_CS15 -#define CS16_SW8 SW8_CS16 -#define CS17_SW8 SW8_CS17 -#define CS18_SW8 SW8_CS18 -#define CS19_SW8 SW8_CS19 -#define CS20_SW8 SW8_CS20 -#define CS21_SW8 SW8_CS21 -#define CS22_SW8 SW8_CS22 -#define CS23_SW8 SW8_CS23 -#define CS24_SW8 SW8_CS24 -#define CS25_SW8 SW8_CS25 -#define CS26_SW8 SW8_CS26 -#define CS27_SW8 SW8_CS27 -#define CS28_SW8 SW8_CS28 -#define CS29_SW8 SW8_CS29 -#define CS30_SW8 SW8_CS30 - -#define CS1_SW9 SW9_CS1 -#define CS2_SW9 SW9_CS2 -#define CS3_SW9 SW9_CS3 -#define CS4_SW9 SW9_CS4 -#define CS5_SW9 SW9_CS5 -#define CS6_SW9 SW9_CS6 -#define CS7_SW9 SW9_CS7 -#define CS8_SW9 SW9_CS8 -#define CS9_SW9 SW9_CS9 -#define CS10_SW9 SW9_CS10 -#define CS11_SW9 SW9_CS11 -#define CS12_SW9 SW9_CS12 -#define CS13_SW9 SW9_CS13 -#define CS14_SW9 SW9_CS14 -#define CS15_SW9 SW9_CS15 -#define CS16_SW9 SW9_CS16 -#define CS17_SW9 SW9_CS17 -#define CS18_SW9 SW9_CS18 -#define CS19_SW9 SW9_CS19 -#define CS20_SW9 SW9_CS20 -#define CS21_SW9 SW9_CS21 -#define CS22_SW9 SW9_CS22 -#define CS23_SW9 SW9_CS23 -#define CS24_SW9 SW9_CS24 -#define CS25_SW9 SW9_CS25 -#define CS26_SW9 SW9_CS26 -#define CS27_SW9 SW9_CS27 -#define CS28_SW9 SW9_CS28 -#define CS29_SW9 SW9_CS29 -#define CS30_SW9 SW9_CS30 - -#define CS31_SW1 SW1_CS31 -#define CS32_SW1 SW1_CS32 -#define CS33_SW1 SW1_CS33 -#define CS34_SW1 SW1_CS34 -#define CS35_SW1 SW1_CS35 -#define CS36_SW1 SW1_CS36 -#define CS37_SW1 SW1_CS37 -#define CS38_SW1 SW1_CS38 -#define CS39_SW1 SW1_CS39 - -#define CS31_SW2 SW2_CS31 -#define CS32_SW2 SW2_CS32 -#define CS33_SW2 SW2_CS33 -#define CS34_SW2 SW2_CS34 -#define CS35_SW2 SW2_CS35 -#define CS36_SW2 SW2_CS36 -#define CS37_SW2 SW2_CS37 -#define CS38_SW2 SW2_CS38 -#define CS39_SW2 SW2_CS39 - -#define CS31_SW3 SW3_CS31 -#define CS32_SW3 SW3_CS32 -#define CS33_SW3 SW3_CS33 -#define CS34_SW3 SW3_CS34 -#define CS35_SW3 SW3_CS35 -#define CS36_SW3 SW3_CS36 -#define CS37_SW3 SW3_CS37 -#define CS38_SW3 SW3_CS38 -#define CS39_SW3 SW3_CS39 - -#define CS31_SW4 SW4_CS31 -#define CS32_SW4 SW4_CS32 -#define CS33_SW4 SW4_CS33 -#define CS34_SW4 SW4_CS34 -#define CS35_SW4 SW4_CS35 -#define CS36_SW4 SW4_CS36 -#define CS37_SW4 SW4_CS37 -#define CS38_SW4 SW4_CS38 -#define CS39_SW4 SW4_CS39 - -#define CS31_SW5 SW5_CS31 -#define CS32_SW5 SW5_CS32 -#define CS33_SW5 SW5_CS33 -#define CS34_SW5 SW5_CS34 -#define CS35_SW5 SW5_CS35 -#define CS36_SW5 SW5_CS36 -#define CS37_SW5 SW5_CS37 -#define CS38_SW5 SW5_CS38 -#define CS39_SW5 SW5_CS39 - -#define CS31_SW6 SW6_CS31 -#define CS32_SW6 SW6_CS32 -#define CS33_SW6 SW6_CS33 -#define CS34_SW6 SW6_CS34 -#define CS35_SW6 SW6_CS35 -#define CS36_SW6 SW6_CS36 -#define CS37_SW6 SW6_CS37 -#define CS38_SW6 SW6_CS38 -#define CS39_SW6 SW6_CS39 - -#define CS31_SW7 SW7_CS31 -#define CS32_SW7 SW7_CS32 -#define CS33_SW7 SW7_CS33 -#define CS34_SW7 SW7_CS34 -#define CS35_SW7 SW7_CS35 -#define CS36_SW7 SW7_CS36 -#define CS37_SW7 SW7_CS37 -#define CS38_SW7 SW7_CS38 -#define CS39_SW7 SW7_CS39 - -#define CS31_SW8 SW8_CS31 -#define CS32_SW8 SW8_CS32 -#define CS33_SW8 SW8_CS33 -#define CS34_SW8 SW8_CS34 -#define CS35_SW8 SW8_CS35 -#define CS36_SW8 SW8_CS36 -#define CS37_SW8 SW8_CS37 -#define CS38_SW8 SW8_CS38 -#define CS39_SW8 SW8_CS39 - -#define CS31_SW9 SW9_CS31 -#define CS32_SW9 SW9_CS32 -#define CS33_SW9 SW9_CS33 -#define CS34_SW9 SW9_CS34 -#define CS35_SW9 SW9_CS35 -#define CS36_SW9 SW9_CS36 -#define CS37_SW9 SW9_CS37 -#define CS38_SW9 SW9_CS38 -#define CS39_SW9 SW9_CS39 diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index cc9637a4e808..343dffe06890 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h @@ -24,51 +24,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef DRIVER_ADDR_1 -# define IS31FL3741_I2C_ADDRESS_1 DRIVER_ADDR_1 -#endif -#ifdef DRIVER_ADDR_2 -# define IS31FL3741_I2C_ADDRESS_2 DRIVER_ADDR_2 -#endif -#ifdef DRIVER_ADDR_3 -# define IS31FL3741_I2C_ADDRESS_3 DRIVER_ADDR_3 -#endif -#ifdef DRIVER_ADDR_4 -# define IS31FL3741_I2C_ADDRESS_4 DRIVER_ADDR_4 -#endif -#ifdef ISSI_TIMEOUT -# define IS31FL3741_I2C_TIMEOUT ISSI_TIMEOUT -#endif -#ifdef ISSI_PERSISTENCE -# define IS31FL3741_I2C_PERSISTENCE ISSI_PERSISTENCE -#endif -#ifdef ISSI_CONFIGURATION -# define IS31FL3741_CONFIGURATION ISSI_CONFIGURATION -#endif -#ifdef ISSI_SWPULLUP -# define IS31FL3741_SW_PULLUP ISSI_SWPULLUP -#endif -#ifdef ISSI_CSPULLUP -# define IS31FL3741_CS_PULLDOWN ISSI_CSPULLUP -#endif -#ifdef ISSI_GLOBALCURRENT -# define IS31FL3741_GLOBAL_CURRENT ISSI_GLOBALCURRENT -#endif - -#define is31_led is31fl3741_led_t -#define g_is31_leds g_is31fl3741_leds - -#define PUR_0R IS31FL3741_PUR_0_OHM -#define PUR_05KR IS31FL3741_PUR_0K5_OHM -#define PUR_1KR IS31FL3741_PUR_1K_OHM -#define PUR_2KR IS31FL3741_PUR_2K_OHM -#define PUR_4KR IS31FL3741_PUR_4K_OHM -#define PUR_8KR IS31FL3741_PUR_8K_OHM -#define PUR_16KR IS31FL3741_PUR_16K_OHM -#define PUR_32KR IS31FL3741_PUR_32K_OHM -// ======== - #define IS31FL3741_REG_INTERRUPT_MASK 0xF0 #define IS31FL3741_REG_INTERRUPT_STATUS 0xF1 #define IS31FL3741_REG_ID 0xFC @@ -531,374 +486,3 @@ void is31fl3741_flush(void); #define SW9_CS37 0x1A8 #define SW9_CS38 0x1A9 #define SW9_CS39 0x1AA - -// DEPRECATED - DO NOT USE - -#define CS1_SW1 SW1_CS1 -#define CS2_SW1 SW1_CS2 -#define CS3_SW1 SW1_CS3 -#define CS4_SW1 SW1_CS4 -#define CS5_SW1 SW1_CS5 -#define CS6_SW1 SW1_CS6 -#define CS7_SW1 SW1_CS7 -#define CS8_SW1 SW1_CS8 -#define CS9_SW1 SW1_CS9 -#define CS10_SW1 SW1_CS10 -#define CS11_SW1 SW1_CS11 -#define CS12_SW1 SW1_CS12 -#define CS13_SW1 SW1_CS13 -#define CS14_SW1 SW1_CS14 -#define CS15_SW1 SW1_CS15 -#define CS16_SW1 SW1_CS16 -#define CS17_SW1 SW1_CS17 -#define CS18_SW1 SW1_CS18 -#define CS19_SW1 SW1_CS19 -#define CS20_SW1 SW1_CS20 -#define CS21_SW1 SW1_CS21 -#define CS22_SW1 SW1_CS22 -#define CS23_SW1 SW1_CS23 -#define CS24_SW1 SW1_CS24 -#define CS25_SW1 SW1_CS25 -#define CS26_SW1 SW1_CS26 -#define CS27_SW1 SW1_CS27 -#define CS28_SW1 SW1_CS28 -#define CS29_SW1 SW1_CS29 -#define CS30_SW1 SW1_CS30 - -#define CS1_SW2 SW2_CS1 -#define CS2_SW2 SW2_CS2 -#define CS3_SW2 SW2_CS3 -#define CS4_SW2 SW2_CS4 -#define CS5_SW2 SW2_CS5 -#define CS6_SW2 SW2_CS6 -#define CS7_SW2 SW2_CS7 -#define CS8_SW2 SW2_CS8 -#define CS9_SW2 SW2_CS9 -#define CS10_SW2 SW2_CS10 -#define CS11_SW2 SW2_CS11 -#define CS12_SW2 SW2_CS12 -#define CS13_SW2 SW2_CS13 -#define CS14_SW2 SW2_CS14 -#define CS15_SW2 SW2_CS15 -#define CS16_SW2 SW2_CS16 -#define CS17_SW2 SW2_CS17 -#define CS18_SW2 SW2_CS18 -#define CS19_SW2 SW2_CS19 -#define CS20_SW2 SW2_CS20 -#define CS21_SW2 SW2_CS21 -#define CS22_SW2 SW2_CS22 -#define CS23_SW2 SW2_CS23 -#define CS24_SW2 SW2_CS24 -#define CS25_SW2 SW2_CS25 -#define CS26_SW2 SW2_CS26 -#define CS27_SW2 SW2_CS27 -#define CS28_SW2 SW2_CS28 -#define CS29_SW2 SW2_CS29 -#define CS30_SW2 SW2_CS30 - -#define CS1_SW3 SW3_CS1 -#define CS2_SW3 SW3_CS2 -#define CS3_SW3 SW3_CS3 -#define CS4_SW3 SW3_CS4 -#define CS5_SW3 SW3_CS5 -#define CS6_SW3 SW3_CS6 -#define CS7_SW3 SW3_CS7 -#define CS8_SW3 SW3_CS8 -#define CS9_SW3 SW3_CS9 -#define CS10_SW3 SW3_CS10 -#define CS11_SW3 SW3_CS11 -#define CS12_SW3 SW3_CS12 -#define CS13_SW3 SW3_CS13 -#define CS14_SW3 SW3_CS14 -#define CS15_SW3 SW3_CS15 -#define CS16_SW3 SW3_CS16 -#define CS17_SW3 SW3_CS17 -#define CS18_SW3 SW3_CS18 -#define CS19_SW3 SW3_CS19 -#define CS20_SW3 SW3_CS20 -#define CS21_SW3 SW3_CS21 -#define CS22_SW3 SW3_CS22 -#define CS23_SW3 SW3_CS23 -#define CS24_SW3 SW3_CS24 -#define CS25_SW3 SW3_CS25 -#define CS26_SW3 SW3_CS26 -#define CS27_SW3 SW3_CS27 -#define CS28_SW3 SW3_CS28 -#define CS29_SW3 SW3_CS29 -#define CS30_SW3 SW3_CS30 - -#define CS1_SW4 SW4_CS1 -#define CS2_SW4 SW4_CS2 -#define CS3_SW4 SW4_CS3 -#define CS4_SW4 SW4_CS4 -#define CS5_SW4 SW4_CS5 -#define CS6_SW4 SW4_CS6 -#define CS7_SW4 SW4_CS7 -#define CS8_SW4 SW4_CS8 -#define CS9_SW4 SW4_CS9 -#define CS10_SW4 SW4_CS10 -#define CS11_SW4 SW4_CS11 -#define CS12_SW4 SW4_CS12 -#define CS13_SW4 SW4_CS13 -#define CS14_SW4 SW4_CS14 -#define CS15_SW4 SW4_CS15 -#define CS16_SW4 SW4_CS16 -#define CS17_SW4 SW4_CS17 -#define CS18_SW4 SW4_CS18 -#define CS19_SW4 SW4_CS19 -#define CS20_SW4 SW4_CS20 -#define CS21_SW4 SW4_CS21 -#define CS22_SW4 SW4_CS22 -#define CS23_SW4 SW4_CS23 -#define CS24_SW4 SW4_CS24 -#define CS25_SW4 SW4_CS25 -#define CS26_SW4 SW4_CS26 -#define CS27_SW4 SW4_CS27 -#define CS28_SW4 SW4_CS28 -#define CS29_SW4 SW4_CS29 -#define CS30_SW4 SW4_CS30 - -#define CS1_SW5 SW5_CS1 -#define CS2_SW5 SW5_CS2 -#define CS3_SW5 SW5_CS3 -#define CS4_SW5 SW5_CS4 -#define CS5_SW5 SW5_CS5 -#define CS6_SW5 SW5_CS6 -#define CS7_SW5 SW5_CS7 -#define CS8_SW5 SW5_CS8 -#define CS9_SW5 SW5_CS9 -#define CS10_SW5 SW5_CS10 -#define CS11_SW5 SW5_CS11 -#define CS12_SW5 SW5_CS12 -#define CS13_SW5 SW5_CS13 -#define CS14_SW5 SW5_CS14 -#define CS15_SW5 SW5_CS15 -#define CS16_SW5 SW5_CS16 -#define CS17_SW5 SW5_CS17 -#define CS18_SW5 SW5_CS18 -#define CS19_SW5 SW5_CS19 -#define CS20_SW5 SW5_CS20 -#define CS21_SW5 SW5_CS21 -#define CS22_SW5 SW5_CS22 -#define CS23_SW5 SW5_CS23 -#define CS24_SW5 SW5_CS24 -#define CS25_SW5 SW5_CS25 -#define CS26_SW5 SW5_CS26 -#define CS27_SW5 SW5_CS27 -#define CS28_SW5 SW5_CS28 -#define CS29_SW5 SW5_CS29 -#define CS30_SW5 SW5_CS30 - -#define CS1_SW6 SW6_CS1 -#define CS2_SW6 SW6_CS2 -#define CS3_SW6 SW6_CS3 -#define CS4_SW6 SW6_CS4 -#define CS5_SW6 SW6_CS5 -#define CS6_SW6 SW6_CS6 -#define CS7_SW6 SW6_CS7 -#define CS8_SW6 SW6_CS8 -#define CS9_SW6 SW6_CS9 -#define CS10_SW6 SW6_CS10 -#define CS11_SW6 SW6_CS11 -#define CS12_SW6 SW6_CS12 -#define CS13_SW6 SW6_CS13 -#define CS14_SW6 SW6_CS14 -#define CS15_SW6 SW6_CS15 -#define CS16_SW6 SW6_CS16 -#define CS17_SW6 SW6_CS17 -#define CS18_SW6 SW6_CS18 -#define CS19_SW6 SW6_CS19 -#define CS20_SW6 SW6_CS20 -#define CS21_SW6 SW6_CS21 -#define CS22_SW6 SW6_CS22 -#define CS23_SW6 SW6_CS23 -#define CS24_SW6 SW6_CS24 -#define CS25_SW6 SW6_CS25 -#define CS26_SW6 SW6_CS26 -#define CS27_SW6 SW6_CS27 -#define CS28_SW6 SW6_CS28 -#define CS29_SW6 SW6_CS29 -#define CS30_SW6 SW6_CS30 - -#define CS1_SW7 SW7_CS1 -#define CS2_SW7 SW7_CS2 -#define CS3_SW7 SW7_CS3 -#define CS4_SW7 SW7_CS4 -#define CS5_SW7 SW7_CS5 -#define CS6_SW7 SW7_CS6 -#define CS7_SW7 SW7_CS7 -#define CS8_SW7 SW7_CS8 -#define CS9_SW7 SW7_CS9 -#define CS10_SW7 SW7_CS10 -#define CS11_SW7 SW7_CS11 -#define CS12_SW7 SW7_CS12 -#define CS13_SW7 SW7_CS13 -#define CS14_SW7 SW7_CS14 -#define CS15_SW7 SW7_CS15 -#define CS16_SW7 SW7_CS16 -#define CS17_SW7 SW7_CS17 -#define CS18_SW7 SW7_CS18 -#define CS19_SW7 SW7_CS19 -#define CS20_SW7 SW7_CS20 -#define CS21_SW7 SW7_CS21 -#define CS22_SW7 SW7_CS22 -#define CS23_SW7 SW7_CS23 -#define CS24_SW7 SW7_CS24 -#define CS25_SW7 SW7_CS25 -#define CS26_SW7 SW7_CS26 -#define CS27_SW7 SW7_CS27 -#define CS28_SW7 SW7_CS28 -#define CS29_SW7 SW7_CS29 -#define CS30_SW7 SW7_CS30 - -#define CS1_SW8 SW8_CS1 -#define CS2_SW8 SW8_CS2 -#define CS3_SW8 SW8_CS3 -#define CS4_SW8 SW8_CS4 -#define CS5_SW8 SW8_CS5 -#define CS6_SW8 SW8_CS6 -#define CS7_SW8 SW8_CS7 -#define CS8_SW8 SW8_CS8 -#define CS9_SW8 SW8_CS9 -#define CS10_SW8 SW8_CS10 -#define CS11_SW8 SW8_CS11 -#define CS12_SW8 SW8_CS12 -#define CS13_SW8 SW8_CS13 -#define CS14_SW8 SW8_CS14 -#define CS15_SW8 SW8_CS15 -#define CS16_SW8 SW8_CS16 -#define CS17_SW8 SW8_CS17 -#define CS18_SW8 SW8_CS18 -#define CS19_SW8 SW8_CS19 -#define CS20_SW8 SW8_CS20 -#define CS21_SW8 SW8_CS21 -#define CS22_SW8 SW8_CS22 -#define CS23_SW8 SW8_CS23 -#define CS24_SW8 SW8_CS24 -#define CS25_SW8 SW8_CS25 -#define CS26_SW8 SW8_CS26 -#define CS27_SW8 SW8_CS27 -#define CS28_SW8 SW8_CS28 -#define CS29_SW8 SW8_CS29 -#define CS30_SW8 SW8_CS30 - -#define CS1_SW9 SW9_CS1 -#define CS2_SW9 SW9_CS2 -#define CS3_SW9 SW9_CS3 -#define CS4_SW9 SW9_CS4 -#define CS5_SW9 SW9_CS5 -#define CS6_SW9 SW9_CS6 -#define CS7_SW9 SW9_CS7 -#define CS8_SW9 SW9_CS8 -#define CS9_SW9 SW9_CS9 -#define CS10_SW9 SW9_CS10 -#define CS11_SW9 SW9_CS11 -#define CS12_SW9 SW9_CS12 -#define CS13_SW9 SW9_CS13 -#define CS14_SW9 SW9_CS14 -#define CS15_SW9 SW9_CS15 -#define CS16_SW9 SW9_CS16 -#define CS17_SW9 SW9_CS17 -#define CS18_SW9 SW9_CS18 -#define CS19_SW9 SW9_CS19 -#define CS20_SW9 SW9_CS20 -#define CS21_SW9 SW9_CS21 -#define CS22_SW9 SW9_CS22 -#define CS23_SW9 SW9_CS23 -#define CS24_SW9 SW9_CS24 -#define CS25_SW9 SW9_CS25 -#define CS26_SW9 SW9_CS26 -#define CS27_SW9 SW9_CS27 -#define CS28_SW9 SW9_CS28 -#define CS29_SW9 SW9_CS29 -#define CS30_SW9 SW9_CS30 - -#define CS31_SW1 SW1_CS31 -#define CS32_SW1 SW1_CS32 -#define CS33_SW1 SW1_CS33 -#define CS34_SW1 SW1_CS34 -#define CS35_SW1 SW1_CS35 -#define CS36_SW1 SW1_CS36 -#define CS37_SW1 SW1_CS37 -#define CS38_SW1 SW1_CS38 -#define CS39_SW1 SW1_CS39 - -#define CS31_SW2 SW2_CS31 -#define CS32_SW2 SW2_CS32 -#define CS33_SW2 SW2_CS33 -#define CS34_SW2 SW2_CS34 -#define CS35_SW2 SW2_CS35 -#define CS36_SW2 SW2_CS36 -#define CS37_SW2 SW2_CS37 -#define CS38_SW2 SW2_CS38 -#define CS39_SW2 SW2_CS39 - -#define CS31_SW3 SW3_CS31 -#define CS32_SW3 SW3_CS32 -#define CS33_SW3 SW3_CS33 -#define CS34_SW3 SW3_CS34 -#define CS35_SW3 SW3_CS35 -#define CS36_SW3 SW3_CS36 -#define CS37_SW3 SW3_CS37 -#define CS38_SW3 SW3_CS38 -#define CS39_SW3 SW3_CS39 - -#define CS31_SW4 SW4_CS31 -#define CS32_SW4 SW4_CS32 -#define CS33_SW4 SW4_CS33 -#define CS34_SW4 SW4_CS34 -#define CS35_SW4 SW4_CS35 -#define CS36_SW4 SW4_CS36 -#define CS37_SW4 SW4_CS37 -#define CS38_SW4 SW4_CS38 -#define CS39_SW4 SW4_CS39 - -#define CS31_SW5 SW5_CS31 -#define CS32_SW5 SW5_CS32 -#define CS33_SW5 SW5_CS33 -#define CS34_SW5 SW5_CS34 -#define CS35_SW5 SW5_CS35 -#define CS36_SW5 SW5_CS36 -#define CS37_SW5 SW5_CS37 -#define CS38_SW5 SW5_CS38 -#define CS39_SW5 SW5_CS39 - -#define CS31_SW6 SW6_CS31 -#define CS32_SW6 SW6_CS32 -#define CS33_SW6 SW6_CS33 -#define CS34_SW6 SW6_CS34 -#define CS35_SW6 SW6_CS35 -#define CS36_SW6 SW6_CS36 -#define CS37_SW6 SW6_CS37 -#define CS38_SW6 SW6_CS38 -#define CS39_SW6 SW6_CS39 - -#define CS31_SW7 SW7_CS31 -#define CS32_SW7 SW7_CS32 -#define CS33_SW7 SW7_CS33 -#define CS34_SW7 SW7_CS34 -#define CS35_SW7 SW7_CS35 -#define CS36_SW7 SW7_CS36 -#define CS37_SW7 SW7_CS37 -#define CS38_SW7 SW7_CS38 -#define CS39_SW7 SW7_CS39 - -#define CS31_SW8 SW8_CS31 -#define CS32_SW8 SW8_CS32 -#define CS33_SW8 SW8_CS33 -#define CS34_SW8 SW8_CS34 -#define CS35_SW8 SW8_CS35 -#define CS36_SW8 SW8_CS36 -#define CS37_SW8 SW8_CS37 -#define CS38_SW8 SW8_CS38 -#define CS39_SW8 SW8_CS39 - -#define CS31_SW9 SW9_CS31 -#define CS32_SW9 SW9_CS32 -#define CS33_SW9 SW9_CS33 -#define CS34_SW9 SW9_CS34 -#define CS35_SW9 SW9_CS35 -#define CS36_SW9 SW9_CS36 -#define CS37_SW9 SW9_CS37 -#define CS38_SW9 SW9_CS38 -#define CS39_SW9 SW9_CS39 diff --git a/drivers/led/issi/is31fl3743a.h b/drivers/led/issi/is31fl3743a.h index 48aeab46abd1..bfff9040477b 100644 --- a/drivers/led/issi/is31fl3743a.h +++ b/drivers/led/issi/is31fl3743a.h @@ -328,214 +328,3 @@ void is31fl3743a_flush(void); #define SW11_CS16 0xC3 #define SW11_CS17 0xC4 #define SW11_CS18 0xC5 - -// DEPRECATED - DO NOT USE - -#define CS1_SW1 SW1_CS1 -#define CS2_SW1 SW1_CS2 -#define CS3_SW1 SW1_CS3 -#define CS4_SW1 SW1_CS4 -#define CS5_SW1 SW1_CS5 -#define CS6_SW1 SW1_CS6 -#define CS7_SW1 SW1_CS7 -#define CS8_SW1 SW1_CS8 -#define CS9_SW1 SW1_CS9 -#define CS10_SW1 SW1_CS10 -#define CS11_SW1 SW1_CS11 -#define CS12_SW1 SW1_CS12 -#define CS13_SW1 SW1_CS13 -#define CS14_SW1 SW1_CS14 -#define CS15_SW1 SW1_CS15 -#define CS16_SW1 SW1_CS16 -#define CS17_SW1 SW1_CS17 -#define CS18_SW1 SW1_CS18 - -#define CS1_SW2 SW2_CS1 -#define CS2_SW2 SW2_CS2 -#define CS3_SW2 SW2_CS3 -#define CS4_SW2 SW2_CS4 -#define CS5_SW2 SW2_CS5 -#define CS6_SW2 SW2_CS6 -#define CS7_SW2 SW2_CS7 -#define CS8_SW2 SW2_CS8 -#define CS9_SW2 SW2_CS9 -#define CS10_SW2 SW2_CS10 -#define CS11_SW2 SW2_CS11 -#define CS12_SW2 SW2_CS12 -#define CS13_SW2 SW2_CS13 -#define CS14_SW2 SW2_CS14 -#define CS15_SW2 SW2_CS15 -#define CS16_SW2 SW2_CS16 -#define CS17_SW2 SW2_CS17 -#define CS18_SW2 SW2_CS18 - -#define CS1_SW3 SW3_CS1 -#define CS2_SW3 SW3_CS2 -#define CS3_SW3 SW3_CS3 -#define CS4_SW3 SW3_CS4 -#define CS5_SW3 SW3_CS5 -#define CS6_SW3 SW3_CS6 -#define CS7_SW3 SW3_CS7 -#define CS8_SW3 SW3_CS8 -#define CS9_SW3 SW3_CS9 -#define CS10_SW3 SW3_CS10 -#define CS11_SW3 SW3_CS11 -#define CS12_SW3 SW3_CS12 -#define CS13_SW3 SW3_CS13 -#define CS14_SW3 SW3_CS14 -#define CS15_SW3 SW3_CS15 -#define CS16_SW3 SW3_CS16 -#define CS17_SW3 SW3_CS17 -#define CS18_SW3 SW3_CS18 - -#define CS1_SW4 SW4_CS1 -#define CS2_SW4 SW4_CS2 -#define CS3_SW4 SW4_CS3 -#define CS4_SW4 SW4_CS4 -#define CS5_SW4 SW4_CS5 -#define CS6_SW4 SW4_CS6 -#define CS7_SW4 SW4_CS7 -#define CS8_SW4 SW4_CS8 -#define CS9_SW4 SW4_CS9 -#define CS10_SW4 SW4_CS10 -#define CS11_SW4 SW4_CS11 -#define CS12_SW4 SW4_CS12 -#define CS13_SW4 SW4_CS13 -#define CS14_SW4 SW4_CS14 -#define CS15_SW4 SW4_CS15 -#define CS16_SW4 SW4_CS16 -#define CS17_SW4 SW4_CS17 -#define CS18_SW4 SW4_CS18 - -#define CS1_SW5 SW5_CS1 -#define CS2_SW5 SW5_CS2 -#define CS3_SW5 SW5_CS3 -#define CS4_SW5 SW5_CS4 -#define CS5_SW5 SW5_CS5 -#define CS6_SW5 SW5_CS6 -#define CS7_SW5 SW5_CS7 -#define CS8_SW5 SW5_CS8 -#define CS9_SW5 SW5_CS9 -#define CS10_SW5 SW5_CS10 -#define CS11_SW5 SW5_CS11 -#define CS12_SW5 SW5_CS12 -#define CS13_SW5 SW5_CS13 -#define CS14_SW5 SW5_CS14 -#define CS15_SW5 SW5_CS15 -#define CS16_SW5 SW5_CS16 -#define CS17_SW5 SW5_CS17 -#define CS18_SW5 SW5_CS18 - -#define CS1_SW6 SW6_CS1 -#define CS2_SW6 SW6_CS2 -#define CS3_SW6 SW6_CS3 -#define CS4_SW6 SW6_CS4 -#define CS5_SW6 SW6_CS5 -#define CS6_SW6 SW6_CS6 -#define CS7_SW6 SW6_CS7 -#define CS8_SW6 SW6_CS8 -#define CS9_SW6 SW6_CS9 -#define CS10_SW6 SW6_CS10 -#define CS11_SW6 SW6_CS11 -#define CS12_SW6 SW6_CS12 -#define CS13_SW6 SW6_CS13 -#define CS14_SW6 SW6_CS14 -#define CS15_SW6 SW6_CS15 -#define CS16_SW6 SW6_CS16 -#define CS17_SW6 SW6_CS17 -#define CS18_SW6 SW6_CS18 - -#define CS1_SW7 SW7_CS1 -#define CS2_SW7 SW7_CS2 -#define CS3_SW7 SW7_CS3 -#define CS4_SW7 SW7_CS4 -#define CS5_SW7 SW7_CS5 -#define CS6_SW7 SW7_CS6 -#define CS7_SW7 SW7_CS7 -#define CS8_SW7 SW7_CS8 -#define CS9_SW7 SW7_CS9 -#define CS10_SW7 SW7_CS10 -#define CS11_SW7 SW7_CS11 -#define CS12_SW7 SW7_CS12 -#define CS13_SW7 SW7_CS13 -#define CS14_SW7 SW7_CS14 -#define CS15_SW7 SW7_CS15 -#define CS16_SW7 SW7_CS16 -#define CS17_SW7 SW7_CS17 -#define CS18_SW7 SW7_CS18 - -#define CS1_SW8 SW8_CS1 -#define CS2_SW8 SW8_CS2 -#define CS3_SW8 SW8_CS3 -#define CS4_SW8 SW8_CS4 -#define CS5_SW8 SW8_CS5 -#define CS6_SW8 SW8_CS6 -#define CS7_SW8 SW8_CS7 -#define CS8_SW8 SW8_CS8 -#define CS9_SW8 SW8_CS9 -#define CS10_SW8 SW8_CS10 -#define CS11_SW8 SW8_CS11 -#define CS12_SW8 SW8_CS12 -#define CS13_SW8 SW8_CS13 -#define CS14_SW8 SW8_CS14 -#define CS15_SW8 SW8_CS15 -#define CS16_SW8 SW8_CS16 -#define CS17_SW8 SW8_CS17 -#define CS18_SW8 SW8_CS18 - -#define CS1_SW9 SW9_CS1 -#define CS2_SW9 SW9_CS2 -#define CS3_SW9 SW9_CS3 -#define CS4_SW9 SW9_CS4 -#define CS5_SW9 SW9_CS5 -#define CS6_SW9 SW9_CS6 -#define CS7_SW9 SW9_CS7 -#define CS8_SW9 SW9_CS8 -#define CS9_SW9 SW9_CS9 -#define CS10_SW9 SW9_CS10 -#define CS11_SW9 SW9_CS11 -#define CS12_SW9 SW9_CS12 -#define CS13_SW9 SW9_CS13 -#define CS14_SW9 SW9_CS14 -#define CS15_SW9 SW9_CS15 -#define CS16_SW9 SW9_CS16 -#define CS17_SW9 SW9_CS17 -#define CS18_SW9 SW9_CS18 - -#define CS1_SW10 SW10_CS1 -#define CS2_SW10 SW10_CS2 -#define CS3_SW10 SW10_CS3 -#define CS4_SW10 SW10_CS4 -#define CS5_SW10 SW10_CS5 -#define CS6_SW10 SW10_CS6 -#define CS7_SW10 SW10_CS7 -#define CS8_SW10 SW10_CS8 -#define CS9_SW10 SW10_CS9 -#define CS10_SW10 SW10_CS10 -#define CS11_SW10 SW10_CS11 -#define CS12_SW10 SW10_CS12 -#define CS13_SW10 SW10_CS13 -#define CS14_SW10 SW10_CS14 -#define CS15_SW10 SW10_CS15 -#define CS16_SW10 SW10_CS16 -#define CS17_SW10 SW10_CS17 -#define CS18_SW10 SW10_CS18 - -#define CS1_SW11 SW11_CS1 -#define CS2_SW11 SW11_CS2 -#define CS3_SW11 SW11_CS3 -#define CS4_SW11 SW11_CS4 -#define CS5_SW11 SW11_CS5 -#define CS6_SW11 SW11_CS6 -#define CS7_SW11 SW11_CS7 -#define CS8_SW11 SW11_CS8 -#define CS9_SW11 SW11_CS9 -#define CS10_SW11 SW11_CS10 -#define CS11_SW11 SW11_CS11 -#define CS12_SW11 SW11_CS12 -#define CS13_SW11 SW11_CS13 -#define CS14_SW11 SW11_CS14 -#define CS15_SW11 SW11_CS15 -#define CS16_SW11 SW11_CS16 -#define CS17_SW11 SW11_CS17 -#define CS18_SW11 SW11_CS18 diff --git a/drivers/led/snled27351-mono.h b/drivers/led/snled27351-mono.h index 43d39934cb3b..b88ef25f7643 100644 --- a/drivers/led/snled27351-mono.h +++ b/drivers/led/snled27351-mono.h @@ -21,37 +21,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef CKLED2001_TIMEOUT -# define SNLED27351_I2C_TIMEOUT CKLED2001_TIMEOUT -#endif -#ifdef CKLED2001_PERSISTENCE -# define SNLED27351_I2C_PERSISTENCE CKLED2001_PERSISTENCE -#endif -#ifdef PHASE_CHANNEL -# define SNLED27351_PHASE_CHANNEL PHASE_CHANNEL -#endif -#ifdef CKLED2001_CURRENT_TUNE -# define SNLED27351_CURRENT_TUNE CKLED2001_CURRENT_TUNE -#endif - -#define MSKPHASE_12CHANNEL SNLED27351_SCAN_PHASE_12_CHANNEL -#define MSKPHASE_11CHANNEL SNLED27351_SCAN_PHASE_11_CHANNEL -#define MSKPHASE_10CHANNEL SNLED27351_SCAN_PHASE_10_CHANNEL -#define MSKPHASE_9CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL -#define MSKPHASE_8CHANNEL SNLED27351_SCAN_PHASE_8_CHANNEL -#define MSKPHASE_7CHANNEL SNLED27351_SCAN_PHASE_7_CHANNEL -#define MSKPHASE_6CHANNEL SNLED27351_SCAN_PHASE_6_CHANNEL -#define MSKPHASE_5CHANNEL SNLED27351_SCAN_PHASE_5_CHANNEL -#define MSKPHASE_4CHANNEL SNLED27351_SCAN_PHASE_4_CHANNEL -#define MSKPHASE_3CHANNEL SNLED27351_SCAN_PHASE_3_CHANNEL -#define MSKPHASE_2CHANNEL SNLED27351_SCAN_PHASE_2_CHANNEL -#define MSKPHASE_1CHANNEL SNLED27351_SCAN_PHASE_1_CHANNEL - -#define ckled2001_led snled27351_led_t -#define g_ckled2001_leds g_snled27351_leds -// ======== - #define SNLED27351_REG_COMMAND 0xFD #define SNLED27351_COMMAND_LED_CONTROL 0x00 #define SNLED27351_COMMAND_PWM 0x01 @@ -378,209 +347,3 @@ void snled27351_sw_shutdown(uint8_t index); #define CB12_CA14 0xBD #define CB12_CA15 0xBE #define CB12_CA16 0xBF - -// DEPRECATED - DO NOT USE - -#define A_1 CB1_CA1 -#define A_2 CB1_CA2 -#define A_3 CB1_CA3 -#define A_4 CB1_CA4 -#define A_5 CB1_CA5 -#define A_6 CB1_CA6 -#define A_7 CB1_CA7 -#define A_8 CB1_CA8 -#define A_9 CB1_CA9 -#define A_10 CB1_CA10 -#define A_11 CB1_CA11 -#define A_12 CB1_CA12 -#define A_13 CB1_CA13 -#define A_14 CB1_CA14 -#define A_15 CB1_CA15 -#define A_16 CB1_CA16 - -#define B_1 CB2_CA1 -#define B_2 CB2_CA2 -#define B_3 CB2_CA3 -#define B_4 CB2_CA4 -#define B_5 CB2_CA5 -#define B_6 CB2_CA6 -#define B_7 CB2_CA7 -#define B_8 CB2_CA8 -#define B_9 CB2_CA9 -#define B_10 CB2_CA10 -#define B_11 CB2_CA11 -#define B_12 CB2_CA12 -#define B_13 CB2_CA13 -#define B_14 CB2_CA14 -#define B_15 CB2_CA15 -#define B_16 CB2_CA16 - -#define C_1 CB3_CA1 -#define C_2 CB3_CA2 -#define C_3 CB3_CA3 -#define C_4 CB3_CA4 -#define C_5 CB3_CA5 -#define C_6 CB3_CA6 -#define C_7 CB3_CA7 -#define C_8 CB3_CA8 -#define C_9 CB3_CA9 -#define C_10 CB3_CA10 -#define C_11 CB3_CA11 -#define C_12 CB3_CA12 -#define C_13 CB3_CA13 -#define C_14 CB3_CA14 -#define C_15 CB3_CA15 -#define C_16 CB3_CA16 - -#define D_1 CB4_CA1 -#define D_2 CB4_CA2 -#define D_3 CB4_CA3 -#define D_4 CB4_CA4 -#define D_5 CB4_CA5 -#define D_6 CB4_CA6 -#define D_7 CB4_CA7 -#define D_8 CB4_CA8 -#define D_9 CB4_CA9 -#define D_10 CB4_CA10 -#define D_11 CB4_CA11 -#define D_12 CB4_CA12 -#define D_13 CB4_CA13 -#define D_14 CB4_CA14 -#define D_15 CB4_CA15 -#define D_16 CB4_CA16 - -#define E_1 CB5_CA1 -#define E_2 CB5_CA2 -#define E_3 CB5_CA3 -#define E_4 CB5_CA4 -#define E_5 CB5_CA5 -#define E_6 CB5_CA6 -#define E_7 CB5_CA7 -#define E_8 CB5_CA8 -#define E_9 CB5_CA9 -#define E_10 CB5_CA10 -#define E_11 CB5_CA11 -#define E_12 CB5_CA12 -#define E_13 CB5_CA13 -#define E_14 CB5_CA14 -#define E_15 CB5_CA15 -#define E_16 CB5_CA16 - -#define F_1 CB6_CA1 -#define F_2 CB6_CA2 -#define F_3 CB6_CA3 -#define F_4 CB6_CA4 -#define F_5 CB6_CA5 -#define F_6 CB6_CA6 -#define F_7 CB6_CA7 -#define F_8 CB6_CA8 -#define F_9 CB6_CA9 -#define F_10 CB6_CA10 -#define F_11 CB6_CA11 -#define F_12 CB6_CA12 -#define F_13 CB6_CA13 -#define F_14 CB6_CA14 -#define F_15 CB6_CA15 -#define F_16 CB6_CA16 - -#define G_1 CB7_CA1 -#define G_2 CB7_CA2 -#define G_3 CB7_CA3 -#define G_4 CB7_CA4 -#define G_5 CB7_CA5 -#define G_6 CB7_CA6 -#define G_7 CB7_CA7 -#define G_8 CB7_CA8 -#define G_9 CB7_CA9 -#define G_10 CB7_CA10 -#define G_11 CB7_CA11 -#define G_12 CB7_CA12 -#define G_13 CB7_CA13 -#define G_14 CB7_CA14 -#define G_15 CB7_CA15 -#define G_16 CB7_CA16 - -#define H_1 CB8_CA1 -#define H_2 CB8_CA2 -#define H_3 CB8_CA3 -#define H_4 CB8_CA4 -#define H_5 CB8_CA5 -#define H_6 CB8_CA6 -#define H_7 CB8_CA7 -#define H_8 CB8_CA8 -#define H_9 CB8_CA9 -#define H_10 CB8_CA10 -#define H_11 CB8_CA11 -#define H_12 CB8_CA12 -#define H_13 CB8_CA13 -#define H_14 CB8_CA14 -#define H_15 CB8_CA15 -#define H_16 CB8_CA16 - -#define I_1 CB9_CA1 -#define I_2 CB9_CA2 -#define I_3 CB9_CA3 -#define I_4 CB9_CA4 -#define I_5 CB9_CA5 -#define I_6 CB9_CA6 -#define I_7 CB9_CA7 -#define I_8 CB9_CA8 -#define I_9 CB9_CA9 -#define I_10 CB9_CA10 -#define I_11 CB9_CA11 -#define I_12 CB9_CA12 -#define I_13 CB9_CA13 -#define I_14 CB9_CA14 -#define I_15 CB9_CA15 -#define I_16 CB9_CA16 - -#define J_1 CB10_CA1 -#define J_2 CB10_CA2 -#define J_3 CB10_CA3 -#define J_4 CB10_CA4 -#define J_5 CB10_CA5 -#define J_6 CB10_CA6 -#define J_7 CB10_CA7 -#define J_8 CB10_CA8 -#define J_9 CB10_CA9 -#define J_10 CB10_CA10 -#define J_11 CB10_CA11 -#define J_12 CB10_CA12 -#define J_13 CB10_CA13 -#define J_14 CB10_CA14 -#define J_15 CB10_CA15 -#define J_16 CB10_CA16 - -#define K_1 CB11_CA1 -#define K_2 CB11_CA2 -#define K_3 CB11_CA3 -#define K_4 CB11_CA4 -#define K_5 CB11_CA5 -#define K_6 CB11_CA6 -#define K_7 CB11_CA7 -#define K_8 CB11_CA8 -#define K_9 CB11_CA9 -#define K_10 CB11_CA10 -#define K_11 CB11_CA11 -#define K_12 CB11_CA12 -#define K_13 CB11_CA13 -#define K_14 CB11_CA14 -#define K_15 CB11_CA15 -#define K_16 CB11_CA16 - -#define L_1 CB12_CA1 -#define L_2 CB12_CA2 -#define L_3 CB12_CA3 -#define L_4 CB12_CA4 -#define L_5 CB12_CA5 -#define L_6 CB12_CA6 -#define L_7 CB12_CA7 -#define L_8 CB12_CA8 -#define L_9 CB12_CA9 -#define L_10 CB12_CA10 -#define L_11 CB12_CA11 -#define L_12 CB12_CA12 -#define L_13 CB12_CA13 -#define L_14 CB12_CA14 -#define L_15 CB12_CA15 -#define L_16 CB12_CA16 diff --git a/drivers/led/snled27351.h b/drivers/led/snled27351.h index d902744d148a..1b7f05c285f7 100644 --- a/drivers/led/snled27351.h +++ b/drivers/led/snled27351.h @@ -21,49 +21,6 @@ #include "progmem.h" #include "util.h" -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef DRIVER_ADDR_1 -# define SNLED27351_I2C_ADDRESS_1 DRIVER_ADDR_1 -#endif -#ifdef DRIVER_ADDR_2 -# define SNLED27351_I2C_ADDRESS_2 DRIVER_ADDR_2 -#endif -#ifdef DRIVER_ADDR_3 -# define SNLED27351_I2C_ADDRESS_3 DRIVER_ADDR_3 -#endif -#ifdef DRIVER_ADDR_4 -# define SNLED27351_I2C_ADDRESS_4 DRIVER_ADDR_4 -#endif -#ifdef CKLED2001_TIMEOUT -# define SNLED27351_I2C_TIMEOUT CKLED2001_TIMEOUT -#endif -#ifdef CKLED2001_PERSISTENCE -# define SNLED27351_I2C_PERSISTENCE CKLED2001_PERSISTENCE -#endif -#ifdef PHASE_CHANNEL -# define SNLED27351_PHASE_CHANNEL PHASE_CHANNEL -#endif -#ifdef CKLED2001_CURRENT_TUNE -# define SNLED27351_CURRENT_TUNE CKLED2001_CURRENT_TUNE -#endif - -#define MSKPHASE_12CHANNEL SNLED27351_SCAN_PHASE_12_CHANNEL -#define MSKPHASE_11CHANNEL SNLED27351_SCAN_PHASE_11_CHANNEL -#define MSKPHASE_10CHANNEL SNLED27351_SCAN_PHASE_10_CHANNEL -#define MSKPHASE_9CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL -#define MSKPHASE_8CHANNEL SNLED27351_SCAN_PHASE_8_CHANNEL -#define MSKPHASE_7CHANNEL SNLED27351_SCAN_PHASE_7_CHANNEL -#define MSKPHASE_6CHANNEL SNLED27351_SCAN_PHASE_6_CHANNEL -#define MSKPHASE_5CHANNEL SNLED27351_SCAN_PHASE_5_CHANNEL -#define MSKPHASE_4CHANNEL SNLED27351_SCAN_PHASE_4_CHANNEL -#define MSKPHASE_3CHANNEL SNLED27351_SCAN_PHASE_3_CHANNEL -#define MSKPHASE_2CHANNEL SNLED27351_SCAN_PHASE_2_CHANNEL -#define MSKPHASE_1CHANNEL SNLED27351_SCAN_PHASE_1_CHANNEL - -#define ckled2001_led snled27351_led_t -#define g_ckled2001_leds g_snled27351_leds -// ======== - #define SNLED27351_REG_COMMAND 0xFD #define SNLED27351_COMMAND_LED_CONTROL 0x00 #define SNLED27351_COMMAND_PWM 0x01 @@ -392,209 +349,3 @@ void snled27351_sw_shutdown(uint8_t index); #define CB12_CA14 0xBD #define CB12_CA15 0xBE #define CB12_CA16 0xBF - -// DEPRECATED - DO NOT USE - -#define A_1 CB1_CA1 -#define A_2 CB1_CA2 -#define A_3 CB1_CA3 -#define A_4 CB1_CA4 -#define A_5 CB1_CA5 -#define A_6 CB1_CA6 -#define A_7 CB1_CA7 -#define A_8 CB1_CA8 -#define A_9 CB1_CA9 -#define A_10 CB1_CA10 -#define A_11 CB1_CA11 -#define A_12 CB1_CA12 -#define A_13 CB1_CA13 -#define A_14 CB1_CA14 -#define A_15 CB1_CA15 -#define A_16 CB1_CA16 - -#define B_1 CB2_CA1 -#define B_2 CB2_CA2 -#define B_3 CB2_CA3 -#define B_4 CB2_CA4 -#define B_5 CB2_CA5 -#define B_6 CB2_CA6 -#define B_7 CB2_CA7 -#define B_8 CB2_CA8 -#define B_9 CB2_CA9 -#define B_10 CB2_CA10 -#define B_11 CB2_CA11 -#define B_12 CB2_CA12 -#define B_13 CB2_CA13 -#define B_14 CB2_CA14 -#define B_15 CB2_CA15 -#define B_16 CB2_CA16 - -#define C_1 CB3_CA1 -#define C_2 CB3_CA2 -#define C_3 CB3_CA3 -#define C_4 CB3_CA4 -#define C_5 CB3_CA5 -#define C_6 CB3_CA6 -#define C_7 CB3_CA7 -#define C_8 CB3_CA8 -#define C_9 CB3_CA9 -#define C_10 CB3_CA10 -#define C_11 CB3_CA11 -#define C_12 CB3_CA12 -#define C_13 CB3_CA13 -#define C_14 CB3_CA14 -#define C_15 CB3_CA15 -#define C_16 CB3_CA16 - -#define D_1 CB4_CA1 -#define D_2 CB4_CA2 -#define D_3 CB4_CA3 -#define D_4 CB4_CA4 -#define D_5 CB4_CA5 -#define D_6 CB4_CA6 -#define D_7 CB4_CA7 -#define D_8 CB4_CA8 -#define D_9 CB4_CA9 -#define D_10 CB4_CA10 -#define D_11 CB4_CA11 -#define D_12 CB4_CA12 -#define D_13 CB4_CA13 -#define D_14 CB4_CA14 -#define D_15 CB4_CA15 -#define D_16 CB4_CA16 - -#define E_1 CB5_CA1 -#define E_2 CB5_CA2 -#define E_3 CB5_CA3 -#define E_4 CB5_CA4 -#define E_5 CB5_CA5 -#define E_6 CB5_CA6 -#define E_7 CB5_CA7 -#define E_8 CB5_CA8 -#define E_9 CB5_CA9 -#define E_10 CB5_CA10 -#define E_11 CB5_CA11 -#define E_12 CB5_CA12 -#define E_13 CB5_CA13 -#define E_14 CB5_CA14 -#define E_15 CB5_CA15 -#define E_16 CB5_CA16 - -#define F_1 CB6_CA1 -#define F_2 CB6_CA2 -#define F_3 CB6_CA3 -#define F_4 CB6_CA4 -#define F_5 CB6_CA5 -#define F_6 CB6_CA6 -#define F_7 CB6_CA7 -#define F_8 CB6_CA8 -#define F_9 CB6_CA9 -#define F_10 CB6_CA10 -#define F_11 CB6_CA11 -#define F_12 CB6_CA12 -#define F_13 CB6_CA13 -#define F_14 CB6_CA14 -#define F_15 CB6_CA15 -#define F_16 CB6_CA16 - -#define G_1 CB7_CA1 -#define G_2 CB7_CA2 -#define G_3 CB7_CA3 -#define G_4 CB7_CA4 -#define G_5 CB7_CA5 -#define G_6 CB7_CA6 -#define G_7 CB7_CA7 -#define G_8 CB7_CA8 -#define G_9 CB7_CA9 -#define G_10 CB7_CA10 -#define G_11 CB7_CA11 -#define G_12 CB7_CA12 -#define G_13 CB7_CA13 -#define G_14 CB7_CA14 -#define G_15 CB7_CA15 -#define G_16 CB7_CA16 - -#define H_1 CB8_CA1 -#define H_2 CB8_CA2 -#define H_3 CB8_CA3 -#define H_4 CB8_CA4 -#define H_5 CB8_CA5 -#define H_6 CB8_CA6 -#define H_7 CB8_CA7 -#define H_8 CB8_CA8 -#define H_9 CB8_CA9 -#define H_10 CB8_CA10 -#define H_11 CB8_CA11 -#define H_12 CB8_CA12 -#define H_13 CB8_CA13 -#define H_14 CB8_CA14 -#define H_15 CB8_CA15 -#define H_16 CB8_CA16 - -#define I_1 CB9_CA1 -#define I_2 CB9_CA2 -#define I_3 CB9_CA3 -#define I_4 CB9_CA4 -#define I_5 CB9_CA5 -#define I_6 CB9_CA6 -#define I_7 CB9_CA7 -#define I_8 CB9_CA8 -#define I_9 CB9_CA9 -#define I_10 CB9_CA10 -#define I_11 CB9_CA11 -#define I_12 CB9_CA12 -#define I_13 CB9_CA13 -#define I_14 CB9_CA14 -#define I_15 CB9_CA15 -#define I_16 CB9_CA16 - -#define J_1 CB10_CA1 -#define J_2 CB10_CA2 -#define J_3 CB10_CA3 -#define J_4 CB10_CA4 -#define J_5 CB10_CA5 -#define J_6 CB10_CA6 -#define J_7 CB10_CA7 -#define J_8 CB10_CA8 -#define J_9 CB10_CA9 -#define J_10 CB10_CA10 -#define J_11 CB10_CA11 -#define J_12 CB10_CA12 -#define J_13 CB10_CA13 -#define J_14 CB10_CA14 -#define J_15 CB10_CA15 -#define J_16 CB10_CA16 - -#define K_1 CB11_CA1 -#define K_2 CB11_CA2 -#define K_3 CB11_CA3 -#define K_4 CB11_CA4 -#define K_5 CB11_CA5 -#define K_6 CB11_CA6 -#define K_7 CB11_CA7 -#define K_8 CB11_CA8 -#define K_9 CB11_CA9 -#define K_10 CB11_CA10 -#define K_11 CB11_CA11 -#define K_12 CB11_CA12 -#define K_13 CB11_CA13 -#define K_14 CB11_CA14 -#define K_15 CB11_CA15 -#define K_16 CB11_CA16 - -#define L_1 CB12_CA1 -#define L_2 CB12_CA2 -#define L_3 CB12_CA3 -#define L_4 CB12_CA4 -#define L_5 CB12_CA5 -#define L_6 CB12_CA6 -#define L_7 CB12_CA7 -#define L_8 CB12_CA8 -#define L_9 CB12_CA9 -#define L_10 CB12_CA10 -#define L_11 CB12_CA11 -#define L_12 CB12_CA12 -#define L_13 CB12_CA13 -#define L_14 CB12_CA14 -#define L_15 CB12_CA15 -#define L_16 CB12_CA16 diff --git a/drivers/ws2812.c b/drivers/led/ws2812.c similarity index 100% rename from drivers/ws2812.c rename to drivers/led/ws2812.c diff --git a/drivers/ws2812.h b/drivers/led/ws2812.h similarity index 100% rename from drivers/ws2812.h rename to drivers/led/ws2812.h diff --git a/drivers/painter/sh1107/qp_sh1107.c b/drivers/painter/sh1107/qp_sh1107.c new file mode 100644 index 000000000000..f4cbd49e402a --- /dev/null +++ b/drivers/painter/sh1107/qp_sh1107.c @@ -0,0 +1,218 @@ +#include "qp_internal.h" +#include "qp_comms.h" +#include "qp_surface_internal.h" +#include "qp_oled_panel.h" +#include "qp_sh1107.h" +#include "qp_sh1107_opcodes.h" +#include "qp_surface.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver storage +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +typedef struct sh1107_device_t { + oled_panel_painter_device_t oled; + + uint8_t framebuffer[SURFACE_REQUIRED_BUFFER_BYTE_SIZE(128, 128, 1)]; +} sh1107_device_t; + +static sh1107_device_t sh1107_drivers[SH1107_NUM_DEVICES] = {0}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter API implementations + +// Initialisation +__attribute__((weak)) bool qp_sh1107_init(painter_device_t device, painter_rotation_t rotation) { + sh1107_device_t *driver = (sh1107_device_t *)device; + + // Change the surface geometry based on the panel rotation + if (rotation == QP_ROTATION_90 || rotation == QP_ROTATION_270) { + driver->oled.surface.base.panel_width = driver->oled.base.panel_height; + driver->oled.surface.base.panel_height = driver->oled.base.panel_width; + } else { + driver->oled.surface.base.panel_width = driver->oled.base.panel_width; + driver->oled.surface.base.panel_height = driver->oled.base.panel_height; + } + + // Init the internal surface + if (!qp_init(&driver->oled.surface.base, QP_ROTATION_0)) { + qp_dprintf("Failed to init internal surface in qp_sh1107_init\n"); + return false; + } + + // clang-format off + uint8_t sh1107_init_sequence[] = { + // Command, Delay, N, Data[N] + SH1107_SET_MUX_RATIO, 0, 1, 0x7F, // 1/128 duty + SH1107_DISPLAY_OFFSET, 0, 1, 0x00, + SH1107_SET_START_LINE, 0, 1, 0x00, // Different from SH1106 + SH1107_SET_SEGMENT_REMAP_INV, 0, 0, + SH1107_COM_SCAN_DIR_DEC, 0, 0, + SH1107_COM_PADS_HW_CFG, 0, 1, 0x12, + SH1107_SET_CONTRAST, 0, 1, 0x7F, + SH1107_ALL_ON_RESUME, 0, 0, + SH1107_NON_INVERTING_DISPLAY, 0, 0, + SH1107_SET_OSC_DIVFREQ, 0, 1, 0x80, + SH1107_SET_CHARGE_PUMP, 0, 1, 0x14, + SH1107_DISPLAY_ON, 0, 0, + }; + // clang-format on + + // If the display width is anything other than the default 128 pixels, change SH1107_SET_MUX_RATIO data byte to the correct value. + if (driver->oled.base.panel_width != 128) { + sh1107_init_sequence[3] = driver->oled.base.panel_width - 1; + } + + // If the display width is less than the default 128 pixels, change SH1107_DISPLAY_OFFSET to use the center columns. + if (driver->oled.base.panel_width < 128) { + sh1107_init_sequence[7] = (128U - driver->oled.base.panel_width) / 2; + } + + // For smaller displays, change SH1107_COM_PADS_HW_CFG data byte from alternative (0x12) to sequential (0x02) configuration + if (driver->oled.base.panel_height <= 64) { + sh1107_init_sequence[20] = 0x02; + } + + qp_comms_bulk_command_sequence(device, sh1107_init_sequence, sizeof(sh1107_init_sequence)); + return true; +} + +// Screen flush +bool qp_sh1107_flush(painter_device_t device) { + sh1107_device_t *driver = (sh1107_device_t *)device; + + if (!driver->oled.surface.dirty.is_dirty) { + return true; + } + + switch (driver->oled.base.rotation) { + default: + case QP_ROTATION_0: + qp_oled_panel_page_column_flush_rot0(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + case QP_ROTATION_90: + qp_oled_panel_page_column_flush_rot90(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + case QP_ROTATION_180: + qp_oled_panel_page_column_flush_rot180(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + case QP_ROTATION_270: + qp_oled_panel_page_column_flush_rot270(device, &driver->oled.surface.dirty, driver->framebuffer); + break; + } + + // Clear the dirty area + qp_flush(&driver->oled.surface); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Driver vtable +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const oled_panel_painter_driver_vtable_t sh1107_driver_vtable = { + .base = + { + .init = qp_sh1107_init, + .power = qp_oled_panel_power, + .clear = qp_oled_panel_clear, + .flush = qp_sh1107_flush, + .pixdata = qp_oled_panel_passthru_pixdata, + .viewport = qp_oled_panel_passthru_viewport, + .palette_convert = qp_oled_panel_passthru_palette_convert, + .append_pixels = qp_oled_panel_passthru_append_pixels, + .append_pixdata = qp_oled_panel_passthru_append_pixdata, + }, + .opcodes = + { + .display_on = SH1107_DISPLAY_ON, + .display_off = SH1107_DISPLAY_OFF, + .set_page = SH1107_PAGE_ADDR, + .set_column_lsb = SH1107_SETCOLUMN_LSB, + .set_column_msb = SH1107_SETCOLUMN_MSB, + }, +}; + +#ifdef QUANTUM_PAINTER_SH1107_SPI_ENABLE +// Factory function for creating a handle to the SH1107 device +painter_device_t qp_sh1107_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode) { + for (uint32_t i = 0; i < SH1107_NUM_DEVICES; ++i) { + sh1107_device_t *driver = &sh1107_drivers[i]; + if (!driver->oled.base.driver_vtable) { + painter_device_t surface = qp_make_mono1bpp_surface_advanced(&driver->oled.surface, 1, panel_width, panel_height, driver->framebuffer); + if (!surface) { + return NULL; + } + + // Setup the OLED device + driver->oled.base.driver_vtable = (const painter_driver_vtable_t *)&sh1107_driver_vtable; + driver->oled.base.comms_vtable = (const painter_comms_vtable_t *)&spi_comms_with_dc_vtable; + driver->oled.base.native_bits_per_pixel = 1; // 1bpp mono + driver->oled.base.panel_width = panel_width; + driver->oled.base.panel_height = panel_height; + driver->oled.base.rotation = QP_ROTATION_0; + driver->oled.base.offset_x = 0; + driver->oled.base.offset_y = 0; + + // SPI and other pin configuration + driver->oled.base.comms_config = &driver->oled.spi_dc_reset_config; + driver->oled.spi_dc_reset_config.spi_config.chip_select_pin = chip_select_pin; + driver->oled.spi_dc_reset_config.spi_config.divisor = spi_divisor; + driver->oled.spi_dc_reset_config.spi_config.lsb_first = false; + driver->oled.spi_dc_reset_config.spi_config.mode = spi_mode; + driver->oled.spi_dc_reset_config.dc_pin = dc_pin; + driver->oled.spi_dc_reset_config.reset_pin = reset_pin; + driver->oled.spi_dc_reset_config.command_params_uses_command_pin = true; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(sh1107_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_SH1107_SPI_ENABLE + +#ifdef QUANTUM_PAINTER_SH1107_I2C_ENABLE +// Factory function for creating a handle to the SH1107 device +painter_device_t qp_sh1107_make_i2c_device(uint16_t panel_width, uint16_t panel_height, uint8_t i2c_address) { + for (uint32_t i = 0; i < SH1107_NUM_DEVICES; ++i) { + sh1107_device_t *driver = &sh1107_drivers[i]; + if (!driver->oled.base.driver_vtable) { + // Instantiate the surface + painter_device_t surface = qp_make_mono1bpp_surface_advanced(&driver->oled.surface, 1, panel_width, panel_height, driver->framebuffer); + if (!surface) { + return NULL; + } + + // Setup the OLED device + driver->oled.base.driver_vtable = (const painter_driver_vtable_t *)&sh1107_driver_vtable; + driver->oled.base.comms_vtable = (const painter_comms_vtable_t *)&i2c_comms_cmddata_vtable; + driver->oled.base.native_bits_per_pixel = 1; // 1bpp mono + driver->oled.base.panel_width = panel_width; + driver->oled.base.panel_height = panel_height; + driver->oled.base.rotation = QP_ROTATION_0; + driver->oled.base.offset_x = 0; + driver->oled.base.offset_y = 0; + + // I2C configuration + driver->oled.base.comms_config = &driver->oled.i2c_config; + driver->oled.i2c_config.chip_address = i2c_address; + + if (!qp_internal_register_device((painter_device_t)driver)) { + memset(driver, 0, sizeof(sh1107_device_t)); + return NULL; + } + + return (painter_device_t)driver; + } + } + return NULL; +} + +#endif // QUANTUM_PAINTER_SH1107_I2C_ENABLE diff --git a/drivers/painter/sh1107/qp_sh1107.h b/drivers/painter/sh1107/qp_sh1107.h new file mode 100644 index 000000000000..2b866d7dc851 --- /dev/null +++ b/drivers/painter/sh1107/qp_sh1107.h @@ -0,0 +1,64 @@ +#pragma once + +#include "gpio.h" +#include "qp_internal.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter SH1107 configurables (add to your keyboard's config.h) + +#if defined(QUANTUM_PAINTER_SH1107_SPI_ENABLE) && !defined(SH1107_NUM_SPI_DEVICES) +/** + * @def This controls the maximum number of SPI SH1107 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define SH1107_NUM_SPI_DEVICES 1 +#else +# define SH1107_NUM_SPI_DEVICES 0 +#endif + +#if defined(QUANTUM_PAINTER_SH1107_I2C_ENABLE) && !defined(SH1107_NUM_I2C_DEVICES) +/** + * @def This controls the maximum number of I2C SH1107 devices that Quantum Painter can communicate with at any one time. + * Increasing this number allows for multiple displays to be used. + */ +# define SH1107_NUM_I2C_DEVICES 1 +#else +# define SH1107_NUM_I2C_DEVICES 0 +#endif + +#define SH1107_NUM_DEVICES ((SH1107_NUM_SPI_DEVICES) + (SH1107_NUM_I2C_DEVICES)) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Quantum Painter SH1107 device factories + +#ifdef QUANTUM_PAINTER_SH1107_SPI_ENABLE + +/** + * Factory method for an SH1107 SPI LCD device. + * + * @param panel_width[in] the width of the display in pixels (usually 64) + * @param panel_height[in] the height of the display in pixels (usually 128) + * @param chip_select_pin[in] the GPIO pin used for SPI chip select + * @param dc_pin[in] the GPIO pin used for D/C control + * @param reset_pin[in] the GPIO pin used for RST + * @param spi_divisor[in] the SPI divisor to use when communicating with the display + * @param spi_mode[in] the SPI mode to use when communicating with the display + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_sh1107_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); + +#endif // QUANTUM_PAINTER_SH1107_SPI_ENABLE + +#ifdef QUANTUM_PAINTER_SH1107_I2C_ENABLE + +/** + * Factory method for an SH1107 I2C LCD device. + * + * @param panel_width[in] the width of the display in pixels (usually 64) + * @param panel_height[in] the height of the display in pixels (usually 128) + * @param i2c_address[in] the I2C address to use + * @return the device handle used with all drawing routines in Quantum Painter + */ +painter_device_t qp_sh1107_make_i2c_device(uint16_t panel_width, uint16_t panel_height, uint8_t i2c_address); + +#endif // QUANTUM_PAINTER_SH1107_I2C_ENABLE diff --git a/drivers/painter/sh1107/qp_sh1107_opcodes.h b/drivers/painter/sh1107/qp_sh1107_opcodes.h new file mode 100644 index 000000000000..818bf409289a --- /dev/null +++ b/drivers/painter/sh1107/qp_sh1107_opcodes.h @@ -0,0 +1,25 @@ +// Copyright 2024 Steve Branam (@smbranam) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define SH1107_DISPLAY_ON 0xAF +#define SH1107_DISPLAY_OFF 0xAE +#define SH1107_SET_OSC_DIVFREQ 0xD5 +#define SH1107_SET_MUX_RATIO 0xA8 +#define SH1107_DISPLAY_OFFSET 0xD3 +#define SH1107_SET_START_LINE 0xDC // Key/sole difference from SH1106 (which uses 0x40) +#define SH1107_SET_CHARGE_PUMP 0x8D +#define SH1107_SET_SEGMENT_REMAP_NORMAL 0xA0 +#define SH1107_SET_SEGMENT_REMAP_INV 0xA1 +#define SH1107_COM_SCAN_DIR_INC 0xC0 +#define SH1107_COM_SCAN_DIR_DEC 0xC8 +#define SH1107_COM_PADS_HW_CFG 0xDA +#define SH1107_SET_CONTRAST 0x81 +#define SH1107_SET_PRECHARGE_PERIOD 0xD9 +#define SH1107_VCOM_DESELECT_LEVEL 0xDB +#define SH1107_ALL_ON_RESUME 0xA4 +#define SH1107_NON_INVERTING_DISPLAY 0xA6 +#define SH1107_DEACTIVATE_SCROLL 0x2E +#define SH1107_SETCOLUMN_LSB 0x00 +#define SH1107_SETCOLUMN_MSB 0x10 +#define SH1107_PAGE_ADDR 0xB0 diff --git a/drivers/sensors/azoteq_iqs5xx.c b/drivers/sensors/azoteq_iqs5xx.c index 1bb64f198446..ae26ee60cfd9 100644 --- a/drivers/sensors/azoteq_iqs5xx.c +++ b/drivers/sensors/azoteq_iqs5xx.c @@ -17,6 +17,7 @@ #define AZOTEQ_IQS5XX_REG_PREVIOUS_CYCLE_TIME 0x000C #define AZOTEQ_IQS5XX_REG_SYSTEM_CONTROL_1 0x0432 #define AZOTEQ_IQS5XX_REG_REPORT_RATE_ACTIVE 0x057A +#define AZOTEQ_IQS5XX_REG_IDLE_MODE_TIMEOUT 0x0586 #define AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_0 0x058E #define AZOTEQ_IQS5XX_REG_SYSTEM_CONFIG_1 0x058F #define AZOTEQ_IQS5XX_REG_X_RESOLUTION 0x066E @@ -77,6 +78,10 @@ #ifndef AZOTEQ_IQS5XX_ZOOM_CONSECUTIVE_DISTANCE # define AZOTEQ_IQS5XX_ZOOM_CONSECUTIVE_DISTANCE 0x19 #endif +#ifndef AZOTEQ_IQS5XX_EVENT_MODE +// Event mode can't be used until the pointing code has changed (stuck buttons) +# define AZOTEQ_IQS5XX_EVENT_MODE false +#endif #if defined(AZOTEQ_IQS5XX_TPS43) # define AZOTEQ_IQS5XX_WIDTH_MM 43 @@ -112,12 +117,6 @@ static struct { uint16_t resolution_y; } azoteq_iqs5xx_device_resolution_t; -i2c_status_t azoteq_iqs5xx_wake(void) { - uint8_t data = 0; - i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_PREVIOUS_CYCLE_TIME, (uint8_t *)&data, sizeof(data), 1); - wait_us(150); - return status; -} i2c_status_t azoteq_iqs5xx_end_session(void) { const uint8_t END_BYTE = 1; // any data return i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_END_COMMS, &END_BYTE, 1, AZOTEQ_IQS5XX_TIMEOUT_MS); @@ -324,14 +323,19 @@ static i2c_status_t azoteq_iqs5xx_init_status = 1; void azoteq_iqs5xx_init(void) { i2c_init(); - azoteq_iqs5xx_wake(); + i2c_ping_address(AZOTEQ_IQS5XX_ADDRESS, 1); // wake azoteq_iqs5xx_reset_suspend(true, false, true); wait_ms(100); - azoteq_iqs5xx_wake(); + i2c_ping_address(AZOTEQ_IQS5XX_ADDRESS, 1); // wake if (azoteq_iqs5xx_get_product() != AZOTEQ_IQS5XX_UNKNOWN) { azoteq_iqs5xx_setup_resolution(); azoteq_iqs5xx_init_status = azoteq_iqs5xx_set_report_rate(AZOTEQ_IQS5XX_REPORT_RATE, AZOTEQ_IQS5XX_ACTIVE, false); - azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_event_mode(false, false); + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_report_rate(AZOTEQ_IQS5XX_REPORT_RATE, AZOTEQ_IQS5XX_IDLE, false); + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_report_rate(AZOTEQ_IQS5XX_REPORT_RATE, AZOTEQ_IQS5XX_IDLE_TOUCH, false); + + uint8_t no_timeout = 255; + azoteq_iqs5xx_init_status |= i2c_write_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_IDLE_MODE_TIMEOUT, &no_timeout, 1, AZOTEQ_IQS5XX_TIMEOUT_MS); // Don't enter LP1, LP2 states + azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_event_mode(AZOTEQ_IQS5XX_EVENT_MODE, false); azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_reati(true, false); #if defined(AZOTEQ_IQS5XX_ROTATION_90) azoteq_iqs5xx_init_status |= azoteq_iqs5xx_set_xy_config(false, true, true, true, false); @@ -348,21 +352,19 @@ void azoteq_iqs5xx_init(void) { }; report_mouse_t azoteq_iqs5xx_get_report(report_mouse_t mouse_report) { - report_mouse_t temp_report = {0}; - static uint8_t previous_button_state = 0; - static uint8_t read_error_count = 0; + report_mouse_t temp_report = {0}; if (azoteq_iqs5xx_init_status == I2C_STATUS_SUCCESS) { - azoteq_iqs5xx_base_data_t base_data = {0}; -#if !defined(POINTING_DEVICE_MOTION_PIN) - azoteq_iqs5xx_wake(); -#endif - i2c_status_t status = azoteq_iqs5xx_get_base_data(&base_data); - bool ignore_movement = false; + azoteq_iqs5xx_base_data_t base_data = {0}; + i2c_status_t status = azoteq_iqs5xx_get_base_data(&base_data); + bool ignore_movement = false; if (status == I2C_STATUS_SUCCESS) { - // pd_dprintf("IQS5XX - previous cycle time: %d \n", base_data.previous_cycle_time); - read_error_count = 0; +#ifdef POINTING_DEVICE_DEBUG + if (base_data.previous_cycle_time > AZOTEQ_IQS5XX_REPORT_RATE) { + pd_dprintf("IQS5XX - previous cycle time missed, took: %dms\n", base_data.previous_cycle_time); + } +#endif if (base_data.gesture_events_0.single_tap || base_data.gesture_events_0.press_and_hold) { pd_dprintf("IQS5XX - Single tap/hold.\n"); temp_report.buttons = pointing_device_handle_buttons(temp_report.buttons, true, POINTING_DEVICE_BUTTON1); @@ -403,20 +405,11 @@ report_mouse_t azoteq_iqs5xx_get_report(report_mouse_t mouse_report) { temp_report.y = CONSTRAIN_HID_XY(AZOTEQ_IQS5XX_COMBINE_H_L_BYTES(base_data.y.h, base_data.y.l)); } - previous_button_state = temp_report.buttons; - } else { - if (read_error_count > 10) { - read_error_count = 0; - previous_button_state = 0; - } else { - read_error_count++; - } - temp_report.buttons = previous_button_state; - pd_dprintf("IQS5XX - get report failed: %d \n", status); + pd_dprintf("IQS5XX - get report failed, i2c status: %d \n", status); } } else { - pd_dprintf("IQS5XX - Init failed: %d \n", azoteq_iqs5xx_init_status); + pd_dprintf("IQS5XX - Init failed, i2c status: %d \n", azoteq_iqs5xx_init_status); } return temp_report; diff --git a/drivers/sensors/azoteq_iqs5xx.h b/drivers/sensors/azoteq_iqs5xx.h index 4190fe470c77..e1e8b67b3122 100644 --- a/drivers/sensors/azoteq_iqs5xx.h +++ b/drivers/sensors/azoteq_iqs5xx.h @@ -173,7 +173,8 @@ typedef struct { # define AZOTEQ_IQS5XX_REPORT_RATE 10 #endif #if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) && !defined(POINTING_DEVICE_MOTION_PIN) -# define POINTING_DEVICE_TASK_THROTTLE_MS AZOTEQ_IQS5XX_REPORT_RATE +// Polling the Azoteq isn't recommended, ensuring we only poll after the report is ready stops any unexpected NACKs +# define POINTING_DEVICE_TASK_THROTTLE_MS AZOTEQ_IQS5XX_REPORT_RATE + 1 #endif const pointing_device_driver_t azoteq_iqs5xx_pointing_device_driver; diff --git a/drivers/spi_master.h b/drivers/spi_master.h new file mode 100644 index 000000000000..d206b812bfd3 --- /dev/null +++ b/drivers/spi_master.h @@ -0,0 +1,116 @@ +// Copyright 2025 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include +#include "gpio.h" + +/** + * \file + * + * \defgroup spi_master SPI Master API + * + * \brief API to communicate with SPI devices. + * \{ + */ + +// Hardware SS pin is defined in the header so that user code can refer to it +#ifdef __AVR__ +# if defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) +# define SPI_SS_PIN B0 +# elif defined(__AVR_ATmega32A__) +# define SPI_SS_PIN B4 +# elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) +# define SPI_SS_PIN B2 +# endif +#endif + +typedef int16_t spi_status_t; + +#define SPI_STATUS_SUCCESS (0) +#define SPI_STATUS_ERROR (-1) +#define SPI_STATUS_TIMEOUT (-2) + +#define SPI_TIMEOUT_IMMEDIATE (0) +#define SPI_TIMEOUT_INFINITE (0xFFFF) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct spi_start_config_t { + pin_t slave_pin; + bool lsb_first; + uint8_t mode; + uint16_t divisor; + bool cs_active_low; +} spi_start_config_t; + +/** + * \brief Initialize the SPI driver. This function must be called only once, before any of the below functions can be called. + */ +void spi_init(void); + +/** + * \brief Start an SPI transaction. + * + * \param slavePin The GPIO pin connected to the desired device's `SS` line. + * \param lsbFirst Determines the endianness of the transmission. If `true`, the least significant bit of each byte is sent first. + * \param mode The SPI mode to use. + * \param divisor The SPI clock divisor. + * + * \return `true` if the operation was successful, otherwise `false` if the supplied parameters are invalid or the SPI peripheral is already in use. + */ +bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); + +bool spi_start_extended(spi_start_config_t *start_config); + +/** + * \brief Write a byte to the selected SPI device. + * + * \param data The byte to write. + * + * \return `SPI_STATUS_TIMEOUT` if the timeout period elapses, or `SPI_STATUS_SUCCESS`. + */ +spi_status_t spi_write(uint8_t data); + +/** + * \brief Read a byte from the selected SPI device. + * + * \return `SPI_STATUS_TIMEOUT` if the timeout period elapses, otherwise the byte read from the device. + */ +spi_status_t spi_read(void); + +/** + * \brief Send multiple bytes to the selected SPI device. + * + * \param data A pointer to the data to write from. + * \param length The number of bytes to write. Take care not to overrun the length of `data`. + * + * \return `SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`. + */ +spi_status_t spi_transmit(const uint8_t *data, uint16_t length); + +/** + * \brief Receive multiple bytes from the selected SPI device. + * + * \param data A pointer to a buffer to read into. + * \param length The number of bytes to read. Take care not to overrun the length of `data`. + * + * \return `SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`. + */ +spi_status_t spi_receive(uint8_t *data, uint16_t length); + +/** + * \brief End the current SPI transaction. This will deassert the slave select pin and reset the endianness, mode and divisor configured by `spi_start()`. + * + */ +void spi_stop(void); + +#ifdef __cplusplus +} +#endif + +/** \} */ diff --git a/drivers/uart.h b/drivers/uart.h new file mode 100644 index 000000000000..c5068c86e1c4 --- /dev/null +++ b/drivers/uart.h @@ -0,0 +1,62 @@ +// Copyright 2025 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +/** + * \file + * + * \defgroup uart UART API + * + * \brief API to communicate with UART devices. + * \{ + */ + +/** + * \brief Initialize the UART driver. This function must be called only once, before any of the below functions can be called. + * + * \param baud The baud rate to transmit and receive at. This may depend on the device you are communicating with. Common values are 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. + */ +void uart_init(uint32_t baud); + +/** + * \brief Transmit a single byte. + * + * \param data The byte to write. + */ +void uart_write(uint8_t data); + +/** + * \brief Receive a single byte. + * + * \return The byte read from the receive buffer. This function will block if the buffer is empty (ie. no data to read). + */ +uint8_t uart_read(void); + +/** + * \brief Transmit multiple bytes. + * + * \param data A pointer to the data to write from. + * \param length The number of bytes to write. Take care not to overrun the length of `data`. + */ +void uart_transmit(const uint8_t *data, uint16_t length); + +/** + * \brief Receive multiple bytes. + * + * \param data A pointer to a buffer to read into. + * \param length The number of bytes to read. Take care not to overrun the length of `data`. + */ +void uart_receive(uint8_t *data, uint16_t length); + +/** + * \brief Return whether the receive buffer contains data. Call this function to determine if `uart_read()` will return data immediately. + * + * \return true if there is data available to read. + */ +bool uart_available(void); + +/** \} */ diff --git a/keyboards/0_sixty/rules.mk b/keyboards/0_sixty/rules.mk deleted file mode 100644 index a0d06a89dd78..000000000000 --- a/keyboards/0_sixty/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 0_sixty/base diff --git a/keyboards/0xcb/splaytoraid/rules.mk b/keyboards/0xcb/splaytoraid/rules.mk deleted file mode 100644 index 65884dec4f94..000000000000 --- a/keyboards/0xcb/splaytoraid/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 0xcb/splaytoraid/rp2040_ce diff --git a/keyboards/1upkeyboards/pi40/rules.mk b/keyboards/1upkeyboards/pi40/rules.mk deleted file mode 100644 index 48aea570e019..000000000000 --- a/keyboards/1upkeyboards/pi40/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 1upkeyboards/pi40/mit_v1_0 diff --git a/keyboards/1upkeyboards/pi50/rules.mk b/keyboards/1upkeyboards/pi50/rules.mk deleted file mode 100644 index a9660074af57..000000000000 --- a/keyboards/1upkeyboards/pi50/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 1upkeyboards/pi50/grid diff --git a/keyboards/1upkeyboards/sweet16/rules.mk b/keyboards/1upkeyboards/sweet16/rules.mk deleted file mode 100644 index 7d269ac93f55..000000000000 --- a/keyboards/1upkeyboards/sweet16/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 1upkeyboards/sweet16/v1 diff --git a/keyboards/25keys/aleth42/rules.mk b/keyboards/25keys/aleth42/rules.mk deleted file mode 100644 index 8034ad544072..000000000000 --- a/keyboards/25keys/aleth42/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 25keys/aleth42/rev1 diff --git a/keyboards/25keys/zinc/rules.mk b/keyboards/25keys/zinc/rules.mk deleted file mode 100644 index 1edcb0a3455b..000000000000 --- a/keyboards/25keys/zinc/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 25keys/zinc/rev1 diff --git a/keyboards/40percentclub/i75/rules.mk b/keyboards/40percentclub/i75/rules.mk deleted file mode 100644 index 48b04275501f..000000000000 --- a/keyboards/40percentclub/i75/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 40percentclub/i75/promicro diff --git a/keyboards/40percentclub/polyandry/rules.mk b/keyboards/40percentclub/polyandry/rules.mk deleted file mode 100644 index 3064c8202cb3..000000000000 --- a/keyboards/40percentclub/polyandry/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 40percentclub/polyandry/promicro diff --git a/keyboards/8pack/rules.mk b/keyboards/8pack/rules.mk deleted file mode 100644 index 81024a71199b..000000000000 --- a/keyboards/8pack/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = 8pack/rev12 diff --git a/keyboards/a_jazz/akc084/keyboard.json b/keyboards/a_jazz/akc084/keyboard.json index a489a5ade501..a8290ea75f49 100644 --- a/keyboards/a_jazz/akc084/keyboard.json +++ b/keyboards/a_jazz/akc084/keyboard.json @@ -20,7 +20,7 @@ }, "indicators": { "caps_lock": "A9", - "num_lock": "A10" + "scroll_lock": "A10" }, "matrix_pins": { "cols": ["B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "B10", "B11", "B12", "B13"], diff --git a/keyboards/a_jazz/akc084/keymaps/default/keymap.c b/keyboards/a_jazz/akc084/keymaps/default/keymap.c index 0ea7355fecbb..2bd7992707fb 100644 --- a/keyboards/a_jazz/akc084/keymaps/default/keymap.c +++ b/keyboards/a_jazz/akc084/keymaps/default/keymap.c @@ -25,19 +25,19 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_MUTE, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, KC_MUTE, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), [1] = LAYOUT( - _______, KC_MSEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MAIL, KC_WHOM, KC_MYCM, KC_CALC, _______, _______, _______, _______, + _______, KC_MSEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MAIL, KC_WHOM, KC_MYCM, KC_CALC, _______, _______, KC_SCRL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCRL, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, _______, _______ ) }; \ No newline at end of file diff --git a/keyboards/a_jazz/akc084/readme.md b/keyboards/a_jazz/akc084/readme.md index d93c8a687d4b..4be104f58176 100644 --- a/keyboards/a_jazz/akc084/readme.md +++ b/keyboards/a_jazz/akc084/readme.md @@ -1,8 +1,8 @@ -# A-JAZZ AKC084 +# A-JAZZ AKC084 (AKP846) A customizable 84keys keyboard -![akc084](https://i.imgur.com/381vaD7.png) +![akc084](https://i.imgur.com/6D0jBco.png) * Keyboard Maintainer: [Feng](https://github.com/fenggx-a-jazz) * Hardware Supported: [a-jazz](https://www.a-jazz.com) * Hardware Availability: [a-jazz](https://ajazzstore.com/collections/all/products/ajazz-akp846) @@ -18,6 +18,6 @@ Flashing example for this keyboard: See the build environment setup and the make instructions for more information. Brand new to QMK? Start with our Complete Newbs Guide. ## Bootloader ESC the bootloader in 3 ways: -* **Bootmagic reset: Hold down Enter in the keyboard then replug +* **Bootmagic reset: Hold down Esc in the keyboard then replug * **Physical reset button: Briefly press the button on the back of the PCB * **Keycode in layout: Press the key mapped to QK_BOOT diff --git a/keyboards/adkb96/rules.mk b/keyboards/adkb96/rules.mk deleted file mode 100644 index ac7561b21dde..000000000000 --- a/keyboards/adkb96/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = adkb96/rev1 diff --git a/keyboards/adm42/rules.mk b/keyboards/adm42/rules.mk deleted file mode 100644 index 06fc88e9f6c6..000000000000 --- a/keyboards/adm42/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = adm42/rev4 \ No newline at end of file diff --git a/keyboards/aeboards/constellation/rules.mk b/keyboards/aeboards/constellation/rules.mk deleted file mode 100755 index bd2af5d22bf7..000000000000 --- a/keyboards/aeboards/constellation/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = aeboards/constellation/rev1 diff --git a/keyboards/aeboards/ext65/rules.mk b/keyboards/aeboards/ext65/rules.mk deleted file mode 100644 index d8b0595a5d30..000000000000 --- a/keyboards/aeboards/ext65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = aeboards/ext65/rev2 \ No newline at end of file diff --git a/keyboards/aeboards/satellite/rules.mk b/keyboards/aeboards/satellite/rules.mk deleted file mode 100644 index bc32615d2b97..000000000000 --- a/keyboards/aeboards/satellite/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = aeboards/satellite/rev1 diff --git a/keyboards/al1/readme.md b/keyboards/al1/readme.md index 3531e2fdc6b8..4dcf83f05f1e 100644 --- a/keyboards/al1/readme.md +++ b/keyboards/al1/readme.md @@ -1,7 +1,5 @@ # TriangleLabs AL1 -![AL1](imgur.com image replace me!) - * Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Olivia](https://github.com/olivia) * Hardware Supported: AL1 PCB * Hardware Availability: [GroupBuy](https://geekhack.org/index.php?topic=93258.0) diff --git a/keyboards/alf/dc60/readme.md b/keyboards/alf/dc60/readme.md index d8e20a8f4f7f..628878e8de36 100644 --- a/keyboards/alf/dc60/readme.md +++ b/keyboards/alf/dc60/readme.md @@ -1,7 +1,5 @@ # dc60 -![dc60](imgur.com image replace me!) - A 60% PCB sold with the Alf DC60. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk deleted file mode 100644 index d933cb327d6d..000000000000 --- a/keyboards/atreus/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = atreus/astar diff --git a/keyboards/atreyu/rules.mk b/keyboards/atreyu/rules.mk deleted file mode 100644 index 4daffe6b9d4b..000000000000 --- a/keyboards/atreyu/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = atreyu/rev1 diff --git a/keyboards/biacco42/ergo42/rules.mk b/keyboards/biacco42/ergo42/rules.mk deleted file mode 100644 index 18059c0a3bc3..000000000000 --- a/keyboards/biacco42/ergo42/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = biacco42/ergo42/rev1 diff --git a/keyboards/biacco42/meishi2/readme.md b/keyboards/biacco42/meishi2/readme.md index 97c5465f8660..b190ff38ce4a 100644 --- a/keyboards/biacco42/meishi2/readme.md +++ b/keyboards/biacco42/meishi2/readme.md @@ -5,8 +5,7 @@ meishi2 - The better micro macro keyboard Keyboard Maintainer: [Biacco42](https://github.com/Biacco42) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: [links to where you can find this hardware](https://github.com/Biacco42/meishi2) +Hardware Availability: https://github.com/Biacco42/meishi2 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/binepad/bn009/rules.mk b/keyboards/binepad/bn009/rules.mk deleted file mode 100644 index 74214d60ed03..000000000000 --- a/keyboards/binepad/bn009/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -# This file is mostly left blank - -DEFAULT_FOLDER = binepad/bn009/r2 diff --git a/keyboards/binepad/bnr1/rules.mk b/keyboards/binepad/bnr1/rules.mk deleted file mode 100755 index ce85c5740460..000000000000 --- a/keyboards/binepad/bnr1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = binepad/bnr1/v2 diff --git a/keyboards/boston_meetup/rules.mk b/keyboards/boston_meetup/rules.mk deleted file mode 100644 index 6d6745a0e579..000000000000 --- a/keyboards/boston_meetup/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = boston_meetup/2019 diff --git a/keyboards/bpiphany/frosty_flake/rules.mk b/keyboards/bpiphany/frosty_flake/rules.mk deleted file mode 100644 index e5402b32f7b7..000000000000 --- a/keyboards/bpiphany/frosty_flake/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER=bpiphany/frosty_flake/20140521 diff --git a/keyboards/bpiphany/pegasushoof/rules.mk b/keyboards/bpiphany/pegasushoof/rules.mk deleted file mode 100644 index 20adecaa08ac..000000000000 --- a/keyboards/bpiphany/pegasushoof/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER=bpiphany/pegasushoof/2013 diff --git a/keyboards/bpiphany/unloved_bastard/readme.md b/keyboards/bpiphany/unloved_bastard/readme.md index 9909d5af3fc6..b11a9bfa7735 100644 --- a/keyboards/bpiphany/unloved_bastard/readme.md +++ b/keyboards/bpiphany/unloved_bastard/readme.md @@ -1,9 +1,5 @@ # unloved_bastard -![unloved_bastard](imgur.com image replace me!) - -A short description of the keyboard/project - Keyboard Maintainer: [Alexander Fougner](https://github.com/fougner) Hardware Supported: CoolerMaster Masterkeys S PBT (Not the Pro versions with backlighting etc) Hardware Availability: Pretty much anywhere diff --git a/keyboards/buzzard/rules.mk b/keyboards/buzzard/rules.mk deleted file mode 100644 index 2f66720b774d..000000000000 --- a/keyboards/buzzard/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = buzzard/rev1 diff --git a/keyboards/westm/westm9/rules.mk b/keyboards/cannonkeys/db60/hotswap/rules.mk similarity index 64% rename from keyboards/westm/westm9/rules.mk rename to keyboards/cannonkeys/db60/hotswap/rules.mk index 3ff78857b354..0ab54aaaf718 100644 --- a/keyboards/westm/westm9/rules.mk +++ b/keyboards/cannonkeys/db60/hotswap/rules.mk @@ -1,4 +1,2 @@ # Wildcard to allow APM32 MCU DFU_SUFFIX_ARGS = -v FFFF -p FFFF - -DEFAULT_FOLDER = westm/westm9/rev2 diff --git a/keyboards/westm/westm68/rules.mk b/keyboards/cannonkeys/db60/j02/rules.mk similarity index 63% rename from keyboards/westm/westm68/rules.mk rename to keyboards/cannonkeys/db60/j02/rules.mk index 2a716f41c4a9..0ab54aaaf718 100644 --- a/keyboards/westm/westm68/rules.mk +++ b/keyboards/cannonkeys/db60/j02/rules.mk @@ -1,4 +1,2 @@ # Wildcard to allow APM32 MCU DFU_SUFFIX_ARGS = -v FFFF -p FFFF - -DEFAULT_FOLDER = westm/westm68/rev2 diff --git a/keyboards/cannonkeys/db60/rules.mk b/keyboards/cannonkeys/db60/rev2/rules.mk similarity index 62% rename from keyboards/cannonkeys/db60/rules.mk rename to keyboards/cannonkeys/db60/rev2/rules.mk index 60addd7fe726..0ab54aaaf718 100644 --- a/keyboards/cannonkeys/db60/rules.mk +++ b/keyboards/cannonkeys/db60/rev2/rules.mk @@ -1,4 +1,2 @@ # Wildcard to allow APM32 MCU DFU_SUFFIX_ARGS = -v FFFF -p FFFF - -DEFAULT_FOLDER = cannonkeys/db60/rev2 diff --git a/keyboards/clickety_split/leeloo/rules.mk b/keyboards/clickety_split/leeloo/rules.mk deleted file mode 100644 index 9d35960f7cf6..000000000000 --- a/keyboards/clickety_split/leeloo/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Default Folder -DEFAULT_FOLDER = clickety_split/leeloo/rev3 diff --git a/keyboards/converter/palm_usb/info.json b/keyboards/converter/palm_usb/info.json deleted file mode 100644 index c5b893d75768..000000000000 --- a/keyboards/converter/palm_usb/info.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "keyboard_name": "Stowaway Converter", - "manufacturer": "QMK", - "url": "", - "maintainer": "qmk", - "usb": { - "vid": "0xFEED", - "pid": "0x0001", - "device_version": "1.0.0" - }, - "processor": "atmega32u4", - "bootloader": "caterina", - "features": { - "bootmagic": false, - "mousekey": false, - "extrakey": false, - "console": true, - "command": true - } -} diff --git a/keyboards/converter/palm_usb/config.h b/keyboards/converter/palm_usb/stowaway/config.h similarity index 100% rename from keyboards/converter/palm_usb/config.h rename to keyboards/converter/palm_usb/stowaway/config.h diff --git a/keyboards/converter/palm_usb/stowaway/keyboard.json b/keyboards/converter/palm_usb/stowaway/keyboard.json index 9a263327adf8..c93957b7d836 100644 --- a/keyboards/converter/palm_usb/stowaway/keyboard.json +++ b/keyboards/converter/palm_usb/stowaway/keyboard.json @@ -1,4 +1,22 @@ { + "keyboard_name": "Stowaway Converter", + "manufacturer": "QMK", + "url": "", + "maintainer": "qmk", + "usb": { + "vid": "0xFEED", + "pid": "0x0001", + "device_version": "1.0.0" + }, + "processor": "atmega32u4", + "bootloader": "caterina", + "features": { + "bootmagic": false, + "mousekey": false, + "extrakey": false, + "console": true, + "command": true + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/converter/palm_usb/matrix.c b/keyboards/converter/palm_usb/stowaway/matrix.c similarity index 100% rename from keyboards/converter/palm_usb/matrix.c rename to keyboards/converter/palm_usb/stowaway/matrix.c diff --git a/keyboards/converter/palm_usb/readme.md b/keyboards/converter/palm_usb/stowaway/readme.md similarity index 100% rename from keyboards/converter/palm_usb/readme.md rename to keyboards/converter/palm_usb/stowaway/readme.md diff --git a/keyboards/converter/palm_usb/rules.mk b/keyboards/converter/palm_usb/stowaway/rules.mk similarity index 65% rename from keyboards/converter/palm_usb/rules.mk rename to keyboards/converter/palm_usb/stowaway/rules.mk index bdb3bb0d6bb2..ccb8eb9ecc39 100644 --- a/keyboards/converter/palm_usb/rules.mk +++ b/keyboards/converter/palm_usb/stowaway/rules.mk @@ -3,5 +3,3 @@ CUSTOM_MATRIX = yes SRC += matrix.c UART_DRIVER_REQUIRED = yes - -DEFAULT_FOLDER = converter/palm_usb/stowaway diff --git a/keyboards/cool836a/readme.md b/keyboards/cool836a/readme.md index dd3ace3cbc34..9473b7136ac3 100644 --- a/keyboards/cool836a/readme.md +++ b/keyboards/cool836a/readme.md @@ -28,7 +28,7 @@ git clone のあと、 ----------------- ## English -- [Here](https://github.com/telzo2000/cool836A) are a full description of this project and build guide by the great Designer: [m.ki](imgur.com image replace me!) +- [Here](https://github.com/telzo2000/cool836A) are a full description of this project and build guide by the great Designer: m.ki - Each virsions(A, B+, C+) of cool836A has the same circuit and that means you can install this firmware on any of them. - However, this repository is currently(Jan 7, 2021) tested on ver.B+ (RED version) only. Feel free to contact [ME](https://github.com/ketcha-k) for any problems. diff --git a/keyboards/crkbd/rules.mk b/keyboards/crkbd/rules.mk deleted file mode 100644 index 836587e45e68..000000000000 --- a/keyboards/crkbd/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = crkbd/rev1 diff --git a/keyboards/custommk/genesis/rules.mk b/keyboards/custommk/genesis/rules.mk deleted file mode 100644 index 3d64c0af2b9c..000000000000 --- a/keyboards/custommk/genesis/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = custommk/genesis/rev2 diff --git a/keyboards/cxt_studio/12e3/keyboard.json b/keyboards/cxt_studio/12e3/keyboard.json new file mode 100644 index 000000000000..763f6bd5b94d --- /dev/null +++ b/keyboards/cxt_studio/12e3/keyboard.json @@ -0,0 +1,99 @@ +{ + "manufacturer": "cxt_studio", + "keyboard_name": "cxt_studio 12E3", + "maintainer": "muge", + "bootloader": "atmel-dfu", + "diode_direction": "ROW2COL", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true, + "rgb_matrix": true + }, + "ws2812": { + "pin": "F7" + }, + "matrix_pins": { + "cols": ["D4", "D7", "B4", "B5"], + "rows": ["C7", "C6", "D6", "F4"] + }, + "encoder": { + "rotary": [ + {"pin_a": "F5", "pin_b": "F6"}, + {"pin_a": "E6", "pin_b": "F0"}, + {"pin_a": "B3", "pin_b": "B2", "resolution": 2} + ] + }, + "processor": "atmega32u4", + "rgb_matrix": { + "animations": { + "breathing": true, + "typing_heatmap": true, + "digital_rain": true, + "solid_reactive_simple": true, + "solid_reactive": true, + "solid_reactive_wide": true, + "solid_reactive_multiwide": true, + "solid_reactive_cross": true, + "solid_reactive_multicross": true, + "solid_reactive_nexus": true, + "solid_reactive_multinexus": true, + "splash": true, + "multisplash": true, + "solid_splash": true, + "solid_multisplash": true + }, + "default": { + "animation": "solid_reactive_simple" + }, + "driver": "ws2812", + "layout": [ + {"flags": 4, "matrix": [0, 3], "x": 3, "y": 0}, + {"flags": 4, "matrix": [0, 2], "x": 2, "y": 0}, + {"flags": 4, "matrix": [0, 1], "x": 1, "y": 0}, + {"flags": 4, "matrix": [0, 0], "x": 0, "y": 0}, + {"flags": 4, "matrix": [1, 0], "x": 0, "y": 1}, + {"flags": 4, "matrix": [1, 1], "x": 1, "y": 1}, + {"flags": 4, "matrix": [1, 2], "x": 2, "y": 1}, + {"flags": 4, "matrix": [1, 3], "x": 3, "y": 1}, + {"flags": 4, "matrix": [2, 3], "x": 3, "y": 2}, + {"flags": 4, "matrix": [2, 2], "x": 2, "y": 2}, + {"flags": 4, "matrix": [2, 1], "x": 1, "y": 2}, + {"flags": 4, "matrix": [2, 0], "x": 0, "y": 2} + ] + }, + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x12E3", + "vid": "0x0215" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + + {"matrix": [3, 2], "x": 4, "y": 0}, + {"matrix": [3, 3], "x": 5, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + + {"matrix": [3, 1], "x": 4, "y": 1, "w": 2, "h": 2}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2} + ] + } + } +} + diff --git a/keyboards/cxt_studio/12e3/keymaps/default/keymap.c b/keyboards/cxt_studio/12e3/keymaps/default/keymap.c new file mode 100644 index 000000000000..78375680d4f2 --- /dev/null +++ b/keyboards/cxt_studio/12e3/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum my_layers { + _BASE, + _RGBL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_PSCR, KC_CUT, KC_COPY, KC_PSTE, MS_BTN3, RM_TOGG, + KC_CALC, KC_UNDO, KC_MPLY, KC_MNXT, KC_MUTE, + MO(1), KC_LGUI, KC_DEL, KC_APP + ), + + [_RGBL] = LAYOUT( + RM_NEXT, RM_SATU, KC_INS, KC_DEL, _______, _______, + RM_PREV, RM_SATD, KC_PGUP, KC_HOME, _______, + _______, QK_BOOT, KC_PGDN, KC_END + ), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + // Encoders: Left, Right, Big + [_BASE] = { + ENCODER_CCW_CW(MS_WHLD, MS_WHLU), + ENCODER_CCW_CW(KC_PGDN, KC_PGUP), + ENCODER_CCW_CW(KC_VOLD, KC_VOLU) + }, + [_RGBL] = { + ENCODER_CCW_CW(RM_HUED, RM_HUEU), + ENCODER_CCW_CW(RM_SPDD, RM_SPDU), + ENCODER_CCW_CW(RM_VALD, RM_VALU) + }, +}; +#endif diff --git a/keyboards/cxt_studio/12e3/keymaps/default/rules.mk b/keyboards/cxt_studio/12e3/keymaps/default/rules.mk new file mode 100644 index 000000000000..ee325681483f --- /dev/null +++ b/keyboards/cxt_studio/12e3/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/cxt_studio/12e3/readme.md b/keyboards/cxt_studio/12e3/readme.md new file mode 100644 index 000000000000..8ea527f47346 --- /dev/null +++ b/keyboards/cxt_studio/12e3/readme.md @@ -0,0 +1,27 @@ +# cxt_studio/12e3 + +![cxt_studio/12e3](https://i.postimg.cc/NFK8rY8N/M5rtTSP.png) + +3x4 ortho layout, with 3 encoders. + +* Keyboard Maintainer: [muge](https://github.com/muge) +* Hardware Supported: CXT Studio 12E3 +* Hardware Availability: AliExpress, Taobao + +Make example for this keyboard (after setting up your build environment): + + make cxt_studio/12e3:default + +Flashing example for this keyboard: + + make cxt_studio/12e3:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB, located under the large encoder, on the right side +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available. It is included in the default layout diff --git a/keyboards/cxt_studio/12e4/config.h b/keyboards/cxt_studio/12e4/config.h new file mode 100644 index 000000000000..de0fbad7ec47 --- /dev/null +++ b/keyboards/cxt_studio/12e4/config.h @@ -0,0 +1,6 @@ +// Copyright 2023 Colin Kinloch (@ColinKinloch) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define RGB_MATRIX_TYPING_HEATMAP_SPREAD 9 diff --git a/keyboards/cxt_studio/cxt_studio.c b/keyboards/cxt_studio/12e4/cxt_studio.c similarity index 68% rename from keyboards/cxt_studio/cxt_studio.c rename to keyboards/cxt_studio/12e4/cxt_studio.c index 2b36905340b5..03a15e4d48df 100644 --- a/keyboards/cxt_studio/cxt_studio.c +++ b/keyboards/cxt_studio/12e4/cxt_studio.c @@ -3,8 +3,6 @@ #include "quantum.h" -static uint8_t anim = 0; - #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { @@ -21,32 +19,26 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { break; case 1: { if (clockwise) { - rgblight_increase_hue(); + rgb_matrix_increase_hue(); } else { - rgblight_decrease_hue(); + rgb_matrix_decrease_hue(); } } break; case 2: { if (clockwise) { - rgblight_increase_val(); + rgb_matrix_increase_val(); } else { - rgblight_decrease_val(); + rgb_matrix_decrease_val(); } } break; case 3: { if (clockwise) { - anim++; + rgb_matrix_step(); } else { - anim--; + rgb_matrix_step_reverse(); } - if (anim >= RGB_MATRIX_EFFECT_MAX) { - anim = 0; - } else if (anim < 0) { - anim = RGB_MATRIX_EFFECT_MAX - 1; - } - rgblight_mode(anim); } break; } diff --git a/keyboards/cxt_studio/keyboard.json b/keyboards/cxt_studio/12e4/keyboard.json similarity index 98% rename from keyboards/cxt_studio/keyboard.json rename to keyboards/cxt_studio/12e4/keyboard.json index 7ee7b52d50ce..b48e75f4caa5 100644 --- a/keyboards/cxt_studio/keyboard.json +++ b/keyboards/cxt_studio/12e4/keyboard.json @@ -1,6 +1,6 @@ { "manufacturer": "CXT", - "keyboard_name": "cxt_studio", + "keyboard_name": "cxt_studio 12E4", "maintainer": "ColinKinloch", "bootloader": "atmel-dfu", "diode_direction": "ROW2COL", diff --git a/keyboards/cxt_studio/keymaps/default/keymap.json b/keyboards/cxt_studio/12e4/keymaps/default/keymap.json similarity index 90% rename from keyboards/cxt_studio/keymaps/default/keymap.json rename to keyboards/cxt_studio/12e4/keymaps/default/keymap.json index 9e31833520e1..b05d3ba1793b 100644 --- a/keyboards/cxt_studio/keymaps/default/keymap.json +++ b/keyboards/cxt_studio/12e4/keymaps/default/keymap.json @@ -1,5 +1,5 @@ { - "keyboard": "cxt_studio", + "keyboard": "cxt_studio/12e4", "keymap": "default", "layout": "LAYOUT", "layers": [ diff --git a/keyboards/cxt_studio/readme.md b/keyboards/cxt_studio/12e4/readme.md similarity index 83% rename from keyboards/cxt_studio/readme.md rename to keyboards/cxt_studio/12e4/readme.md index 6397a3fdfd5d..760c3544b41a 100644 --- a/keyboards/cxt_studio/readme.md +++ b/keyboards/cxt_studio/12e4/readme.md @@ -1,20 +1,20 @@ -# cxt_studio +# cxt_studio/12e4 -![cxt_studio](https://i.imgur.com/AMCTioSh.jpeg) +![cxt_studio/12e4](https://i.imgur.com/AMCTioSh.jpeg) 3x4 ortho rgb lighting 4 knobs. * Keyboard Maintainer: [Colin Kinloch](https://github.com/ColinKinloch) -* Hardware Supported: CXT-Studio +* Hardware Supported: CXT-Studio/12E4 * Hardware Availability: AliExpress. I think the manufacturer is on Taobao. Make example for this keyboard (after setting up your build environment): - make cxt_studio:default + make cxt_studio/12e4:default Flashing example for this keyboard: - make cxt_studio:default:flash + make cxt_studio/12e4:default:flash See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/cxt_studio/config.h b/keyboards/cxt_studio/config.h deleted file mode 100644 index e56e07a25450..000000000000 --- a/keyboards/cxt_studio/config.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 Colin Kinloch (@ColinKinloch) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#define RGB_MATRIX_TYPING_HEATMAP_SPREAD 9 - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT diff --git a/keyboards/dailycraft/bat43/rules.mk b/keyboards/dailycraft/bat43/rules.mk deleted file mode 100644 index b15285194829..000000000000 --- a/keyboards/dailycraft/bat43/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dailycraft/bat43/rev2 diff --git a/keyboards/dailycraft/claw44/rules.mk b/keyboards/dailycraft/claw44/rules.mk deleted file mode 100644 index 0344b3ee2856..000000000000 --- a/keyboards/dailycraft/claw44/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dailycraft/claw44/rev1 diff --git a/keyboards/dailycraft/sandbox/rules.mk b/keyboards/dailycraft/sandbox/rules.mk deleted file mode 100644 index c62f01e18f5e..000000000000 --- a/keyboards/dailycraft/sandbox/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dailycraft/sandbox/rev2 diff --git a/keyboards/dailycraft/wings42/rules.mk b/keyboards/dailycraft/wings42/rules.mk deleted file mode 100644 index b027fec9b975..000000000000 --- a/keyboards/dailycraft/wings42/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dailycraft/wings42/rev2 diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 880aabd5d718..fce00d29aba4 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_CS_PIN_2 B15 diff --git a/keyboards/darkproject/kd87a_bfg_edition/config.h b/keyboards/darkproject/kd87a_bfg_edition/config.h index a32f7122311e..9e68844dafda 100644 --- a/keyboards/darkproject/kd87a_bfg_edition/config.h +++ b/keyboards/darkproject/kd87a_bfg_edition/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_CS_PIN_2 B15 diff --git a/keyboards/delikeeb/vanana/rules.mk b/keyboards/delikeeb/vanana/rules.mk deleted file mode 100644 index ff3dc1df6154..000000000000 --- a/keyboards/delikeeb/vanana/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = delikeeb/vanana/rev2 diff --git a/keyboards/delikeeb/waaffle/rev3/rules.mk b/keyboards/delikeeb/waaffle/rev3/rules.mk deleted file mode 100644 index dbd58ca5bfa4..000000000000 --- a/keyboards/delikeeb/waaffle/rev3/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = delikeeb/waaffle/rev3/pro_micro diff --git a/keyboards/deltapad/readme.md b/keyboards/deltapad/readme.md index 858f99b43652..f5dae4d9b0ab 100644 --- a/keyboards/deltapad/readme.md +++ b/keyboards/deltapad/readme.md @@ -1,15 +1,10 @@ # deltapad - - -*A short description of the keyboard/project* - A 4x4 keypad * Keyboard Maintainer: [Richard Snijder](https://github.com/rich239) * Hardware Supported: Atmel 32u4 based keypads - Make example for this keyboard (after setting up your build environment): make deltapad:default diff --git a/keyboards/deltasplit75/rules.mk b/keyboards/deltasplit75/rules.mk deleted file mode 100644 index ee888337e5ed..000000000000 --- a/keyboards/deltasplit75/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = deltasplit75/v2 diff --git a/keyboards/dp3000/rules.mk b/keyboards/dp3000/rules.mk deleted file mode 100644 index 0f44aefd4458..000000000000 --- a/keyboards/dp3000/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dp3000/rev1 diff --git a/keyboards/drhigsby/ogurec/rules.mk b/keyboards/drhigsby/ogurec/rules.mk deleted file mode 100644 index ed83fb638686..000000000000 --- a/keyboards/drhigsby/ogurec/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = drhigsby/ogurec/left_pm diff --git a/keyboards/duck/jetfire/readme.md b/keyboards/duck/jetfire/readme.md index 8de2f5ced6fa..2e12315d6b8e 100644 --- a/keyboards/duck/jetfire/readme.md +++ b/keyboards/duck/jetfire/readme.md @@ -1,7 +1,5 @@ # Jetfire -![jetfire](imgur.com image replace me!) - The Duck Jetfire is a hybrid full size and 1800 layout keyboard that went on Group Buy in November 2017. diff --git a/keyboards/duck/octagon/rules.mk b/keyboards/duck/octagon/rules.mk deleted file mode 100644 index 46bd457bb70d..000000000000 --- a/keyboards/duck/octagon/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = duck/octagon/v2 \ No newline at end of file diff --git a/keyboards/duck/orion/rules.mk b/keyboards/duck/orion/rules.mk deleted file mode 100644 index 3788e0fbfb76..000000000000 --- a/keyboards/duck/orion/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = duck/orion/v3 diff --git a/keyboards/ducky/one2mini/rules.mk b/keyboards/ducky/one2mini/rules.mk deleted file mode 100644 index 628be832eeb6..000000000000 --- a/keyboards/ducky/one2mini/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ducky/one2mini/1861st diff --git a/keyboards/ducky/one2sf/rules.mk b/keyboards/ducky/one2sf/rules.mk deleted file mode 100644 index 0c9ddb957f88..000000000000 --- a/keyboards/ducky/one2sf/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ducky/one2sf/1967st diff --git a/keyboards/dumbpad/rules.mk b/keyboards/dumbpad/rules.mk deleted file mode 100644 index 87ec1ab01b4e..000000000000 --- a/keyboards/dumbpad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dumbpad/v0x diff --git a/keyboards/durgod/galaxy/rules.mk b/keyboards/durgod/galaxy/rules.mk deleted file mode 100644 index ff1e1ff2050c..000000000000 --- a/keyboards/durgod/galaxy/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER=durgod/dgk6x/galaxy diff --git a/keyboards/durgod/venus/rules.mk b/keyboards/durgod/venus/rules.mk deleted file mode 100644 index 57acf2a48cfe..000000000000 --- a/keyboards/durgod/venus/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER=durgod/dgk6x/venus diff --git a/keyboards/dztech/tofu/ii/rules.mk b/keyboards/dztech/tofu/ii/rules.mk deleted file mode 100644 index c08cfdaae907..000000000000 --- a/keyboards/dztech/tofu/ii/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dztech/tofu/ii/v1 diff --git a/keyboards/dztech/tofu/jr/rules.mk b/keyboards/dztech/tofu/jr/rules.mk deleted file mode 100644 index 7333c613fd2d..000000000000 --- a/keyboards/dztech/tofu/jr/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = dztech/tofu/jr/v1 diff --git a/keyboards/eco/rules.mk b/keyboards/eco/rules.mk deleted file mode 100644 index a3d419658b89..000000000000 --- a/keyboards/eco/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = eco/rev2 diff --git a/keyboards/eek/rules.mk b/keyboards/eek/rules.mk deleted file mode 100644 index 65b8265b5305..000000000000 --- a/keyboards/eek/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = eek/silk_down diff --git a/keyboards/ergoslab/rules.mk b/keyboards/ergoslab/rules.mk deleted file mode 100644 index 8eb40c77d5ab..000000000000 --- a/keyboards/ergoslab/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ergoslab/rev1 diff --git a/keyboards/ergotravel/rules.mk b/keyboards/ergotravel/rules.mk deleted file mode 100644 index 3f30277bb56a..000000000000 --- a/keyboards/ergotravel/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ergotravel/rev1 diff --git a/keyboards/ericrlau/numdiscipline/readme.md b/keyboards/ericrlau/numdiscipline/readme.md index bd040df2a51e..9770432e56c4 100644 --- a/keyboards/ericrlau/numdiscipline/readme.md +++ b/keyboards/ericrlau/numdiscipline/readme.md @@ -13,7 +13,6 @@ A modified version of the through hole 65% Discipline keyboard by cftkb. Other Information: * Keyboard Maintainer: [ELau](https://github.com/ericrlau) -* Hardware Supported: The PCBs, controllers supported * Hardware Availability: https://github.com/ericrlau/NumDiscipline Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/evyd13/atom47/rules.mk b/keyboards/evyd13/atom47/rules.mk deleted file mode 100644 index 9d5b75307775..000000000000 --- a/keyboards/evyd13/atom47/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = evyd13/atom47/rev4 diff --git a/keyboards/exclusive/e85/rules.mk b/keyboards/exclusive/e85/rules.mk deleted file mode 100644 index 8eef46d0ab44..000000000000 --- a/keyboards/exclusive/e85/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = exclusive/e85/hotswap diff --git a/keyboards/ferris/0_1/matrix.c b/keyboards/ferris/0_1/matrix.c index a3e2bebba6c4..c05b193c1a0b 100644 --- a/keyboards/ferris/0_1/matrix.c +++ b/keyboards/ferris/0_1/matrix.c @@ -29,7 +29,7 @@ along with this program. If not, see . #include "i2c_master.h" extern i2c_status_t mcp23017_status; -#define I2C_TIMEOUT 1000 +#define MCP23017_I2C_TIMEOUT 1000 // For a better understanding of the i2c protocol, this is a good read: // https://www.robot-electronics.co.uk/i2c-tutorial @@ -41,9 +41,7 @@ extern i2c_status_t mcp23017_status; // All address pins of the mcp23017 are connected to the ground on the ferris // | 0 | 1 | 0 | 0 | A2 | A1 | A0 | // | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -#define I2C_ADDR 0b0100000 -#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) -#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) +#define I2C_ADDR (0b0100000 << 1) // Register addresses // See https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/blob/master/Adafruit_MCP23017.h @@ -51,8 +49,8 @@ extern i2c_status_t mcp23017_status; #define IODIRB 0x01 #define GPPUA 0x0C // GPIO pull-up resistor register #define GPPUB 0x0D -#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) -#define GPIOB 0x13 +#define MCP23017_GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define MCP23017_GPIOB 0x13 #define OLATA 0x14 // output latch register #define OLATB 0x15 @@ -60,14 +58,14 @@ bool i2c_initialized = 0; i2c_status_t mcp23017_status = I2C_ADDR; uint8_t init_mcp23017(void) { - print("starting init"); + print("init mcp23017\n"); mcp23017_status = I2C_ADDR; // I2C subsystem if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) i2c_initialized = true; - wait_ms(I2C_TIMEOUT); + wait_ms(MCP23017_I2C_TIMEOUT); } // set pin direction @@ -76,8 +74,10 @@ uint8_t init_mcp23017(void) { // - driving : output : 0 // This means: we will read all the bits on GPIOA // This means: we will write to the pins 0-4 on GPIOB (in select_rows) - uint8_t buf[] = {IODIRA, 0b11111111, 0b11110000}; - mcp23017_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); + uint8_t buf[] = {0b11111111, 0b11110000}; + print("before transmit\n"); + mcp23017_status = i2c_write_register(I2C_ADDR, IODIRA, buf, sizeof(buf), MCP23017_I2C_TIMEOUT); + uprintf("after transmit %i\n", mcp23017_status); if (!mcp23017_status) { // set pull-up // - unused : on : 1 @@ -85,8 +85,8 @@ uint8_t init_mcp23017(void) { // - driving : off : 0 // This means: we will read all the bits on GPIOA // This means: we will write to the pins 0-4 on GPIOB (in select_rows) - uint8_t pullup_buf[] = {GPPUA, 0b11111111, 0b11110000}; - mcp23017_status = i2c_transmit(I2C_ADDR_WRITE, pullup_buf, sizeof(pullup_buf), I2C_TIMEOUT); + mcp23017_status = i2c_write_register(I2C_ADDR, GPPUA, buf, sizeof(buf), MCP23017_I2C_TIMEOUT); + uprintf("after transmit2 %i\n", mcp23017_status); } return mcp23017_status; } @@ -144,12 +144,12 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { // if (++mcp23017_reset_loop >= 1300) { // since mcp23017_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans // this will be approx bit more frequent than once per second - dprint("trying to reset mcp23017\n"); + print("trying to reset mcp23017\n"); mcp23017_status = init_mcp23017(); if (mcp23017_status) { - dprint("right side not responding\n"); + print("right side not responding\n"); } else { - dprint("right side attached\n"); + print("right side attached\n"); } } } @@ -204,18 +204,13 @@ static matrix_row_t read_cols(uint8_t row) { if (mcp23017_status) { // if there was an error return 0; } else { - uint8_t buf[] = {GPIOA}; - mcp23017_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); // We read all the pins on GPIOA. // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. // Since the pins connected to eact columns are sequential, and counting from zero up (col 5 -> GPIOA0, col 6 -> GPIOA1 and so on), the only transformation needed is a bitwise not to swap all zeroes and ones. uint8_t data[] = {0}; - if (!mcp23017_status) { - mcp23017_status = i2c_receive(I2C_ADDR_READ, data, sizeof(data), I2C_TIMEOUT); - data[0] = ~(data[0]); - } - return data[0]; + mcp23017_status = i2c_read_register(I2C_ADDR, MCP23017_GPIOA, data, sizeof(data), MCP23017_I2C_TIMEOUT); + return ~data[0]; } } } @@ -236,7 +231,7 @@ static void unselect_rows(void) { static void select_row(uint8_t row) { if (row < MATRIX_ROWS_PER_SIDE) { - // select on atmega32u4 + // select on MCU pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; pin_t pin = matrix_row_pins_mcu[row]; gpio_set_pin_output(pin); @@ -248,8 +243,8 @@ static void select_row(uint8_t row) { } else { // Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. // Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus. - uint8_t buf[] = {GPIOB, 0xFF & ~(1 << (row - MATRIX_ROWS_PER_SIDE))}; - mcp23017_status = i2c_transmit(I2C_ADDR_WRITE, buf, sizeof(buf), I2C_TIMEOUT); + uint8_t buf[] = {0xFF & ~(1 << (row - MATRIX_ROWS_PER_SIDE))}; + mcp23017_status = i2c_write_register(I2C_ADDR, MCP23017_GPIOB, buf, sizeof(buf), MCP23017_I2C_TIMEOUT); } } } diff --git a/keyboards/ferris/0_2/matrix.c b/keyboards/ferris/0_2/matrix.c index 74fab717a1a1..76bbcaf7b5ff 100644 --- a/keyboards/ferris/0_2/matrix.c +++ b/keyboards/ferris/0_2/matrix.c @@ -30,8 +30,7 @@ along with this program. If not, see . extern i2c_status_t mcp23017_status; #define MCP23017_I2C_TIMEOUT 1000 -#define I2C_WRITE 0x00 -#define I2C_READ 0x01 + // For a better understanding of the i2c protocol, this is a good read: // https://www.robot-electronics.co.uk/i2c-tutorial diff --git a/keyboards/fortitude60/rules.mk b/keyboards/fortitude60/rules.mk deleted file mode 100644 index ef158b8cf08a..000000000000 --- a/keyboards/fortitude60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = fortitude60/rev1 diff --git a/keyboards/fruitykeeb/fruitbar/r1/rules.mk b/keyboards/fruitykeeb/fruitbar/r1/rules.mk deleted file mode 100644 index 3328de6095a6..000000000000 --- a/keyboards/fruitykeeb/fruitbar/r1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = fruitykeeb/fruitbar/r1/promicro diff --git a/keyboards/ghs/jem/rules.mk b/keyboards/ghs/jem/rules.mk deleted file mode 100644 index e96c00e5c0ab..000000000000 --- a/keyboards/ghs/jem/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ghs/jem/soldered diff --git a/keyboards/gmmk/gmmk2/p96/config.h b/keyboards/gmmk/gmmk2/p96/config.h index 1b246e4f3fad..852d29df653b 100644 --- a/keyboards/gmmk/gmmk2/p96/config.h +++ b/keyboards/gmmk/gmmk2/p96/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_CS_PIN_2 B15 diff --git a/keyboards/hadron/rules.mk b/keyboards/hadron/rules.mk deleted file mode 100644 index 8498675750e4..000000000000 --- a/keyboards/hadron/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = hadron/ver2 diff --git a/keyboards/handwired/bento/rules.mk b/keyboards/handwired/bento/rules.mk deleted file mode 100644 index e160faab83c4..000000000000 --- a/keyboards/handwired/bento/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/bento/rev1 diff --git a/keyboards/handwired/dactyl_manuform/6x6/rules.mk b/keyboards/handwired/dactyl_manuform/6x6/rules.mk deleted file mode 100644 index 29194b429efd..000000000000 --- a/keyboards/handwired/dactyl_manuform/6x6/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/dactyl_manuform/6x6/promicro diff --git a/keyboards/ergodox_stm32/board.h b/keyboards/handwired/ergodox_stm32/board.h similarity index 100% rename from keyboards/ergodox_stm32/board.h rename to keyboards/handwired/ergodox_stm32/board.h diff --git a/keyboards/ergodox_stm32/chconf.h b/keyboards/handwired/ergodox_stm32/chconf.h similarity index 100% rename from keyboards/ergodox_stm32/chconf.h rename to keyboards/handwired/ergodox_stm32/chconf.h diff --git a/keyboards/ergodox_stm32/config.h b/keyboards/handwired/ergodox_stm32/config.h similarity index 100% rename from keyboards/ergodox_stm32/config.h rename to keyboards/handwired/ergodox_stm32/config.h diff --git a/keyboards/ergodox_stm32/ergodox_stm32.c b/keyboards/handwired/ergodox_stm32/ergodox_stm32.c similarity index 100% rename from keyboards/ergodox_stm32/ergodox_stm32.c rename to keyboards/handwired/ergodox_stm32/ergodox_stm32.c diff --git a/keyboards/ergodox_stm32/ergodox_stm32.h b/keyboards/handwired/ergodox_stm32/ergodox_stm32.h similarity index 100% rename from keyboards/ergodox_stm32/ergodox_stm32.h rename to keyboards/handwired/ergodox_stm32/ergodox_stm32.h diff --git a/keyboards/ergodox_stm32/halconf.h b/keyboards/handwired/ergodox_stm32/halconf.h similarity index 100% rename from keyboards/ergodox_stm32/halconf.h rename to keyboards/handwired/ergodox_stm32/halconf.h diff --git a/keyboards/ergodox_stm32/keyboard.json b/keyboards/handwired/ergodox_stm32/keyboard.json similarity index 100% rename from keyboards/ergodox_stm32/keyboard.json rename to keyboards/handwired/ergodox_stm32/keyboard.json diff --git a/keyboards/ergodox_stm32/keymaps/default/keymap.c b/keyboards/handwired/ergodox_stm32/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergodox_stm32/keymaps/default/keymap.c rename to keyboards/handwired/ergodox_stm32/keymaps/default/keymap.c diff --git a/keyboards/ergodox_stm32/ld/stm32f103_bootloader.ld b/keyboards/handwired/ergodox_stm32/ld/stm32f103_bootloader.ld similarity index 100% rename from keyboards/ergodox_stm32/ld/stm32f103_bootloader.ld rename to keyboards/handwired/ergodox_stm32/ld/stm32f103_bootloader.ld diff --git a/keyboards/ergodox_stm32/matrix.c b/keyboards/handwired/ergodox_stm32/matrix.c similarity index 100% rename from keyboards/ergodox_stm32/matrix.c rename to keyboards/handwired/ergodox_stm32/matrix.c diff --git a/keyboards/ergodox_stm32/mcuconf.h b/keyboards/handwired/ergodox_stm32/mcuconf.h similarity index 100% rename from keyboards/ergodox_stm32/mcuconf.h rename to keyboards/handwired/ergodox_stm32/mcuconf.h diff --git a/keyboards/ergodox_stm32/readme.md b/keyboards/handwired/ergodox_stm32/readme.md similarity index 91% rename from keyboards/ergodox_stm32/readme.md rename to keyboards/handwired/ergodox_stm32/readme.md index f8b9c4c553ec..84accbb5fe65 100644 --- a/keyboards/ergodox_stm32/readme.md +++ b/keyboards/handwired/ergodox_stm32/readme.md @@ -4,6 +4,6 @@ Make example for this keyboard (after setting up your build environment): - make ergodox_stm32:default + make handwired/ergodox_stm32:default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ergodox_stm32/rules.mk b/keyboards/handwired/ergodox_stm32/rules.mk similarity index 100% rename from keyboards/ergodox_stm32/rules.mk rename to keyboards/handwired/ergodox_stm32/rules.mk diff --git a/keyboards/handwired/fc200rt_qmk/readme.md b/keyboards/handwired/fc200rt_qmk/readme.md index 6490227806a0..2b7a0dd1ecc5 100644 --- a/keyboards/handwired/fc200rt_qmk/readme.md +++ b/keyboards/handwired/fc200rt_qmk/readme.md @@ -25,7 +25,6 @@ Choose any key from the corrosponding row and column and solder it to the pin on _NOTE: Some of the keys had mislabled columns and rows, so make sure the columns are all connected without diodes to one another, and that the rows are soldered after the diode_ * Keyboard Maintainer: [NaCly](https://github.com/Na-Cly) -* Hardware Supported: The PCBs, controllers supported * Hardware Availability: Leopold FC200RT + Teensy 2.0 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/handwired/meck_tkl/blackpill_f401/rules.mk b/keyboards/handwired/meck_tkl/blackpill_f401/rules.mk new file mode 100644 index 000000000000..6e47ffcd6701 --- /dev/null +++ b/keyboards/handwired/meck_tkl/blackpill_f401/rules.mk @@ -0,0 +1,2 @@ +AUDIO_SUPPORTED = no +BACKLIGHT_SUPPORTED = no diff --git a/keyboards/handwired/meck_tkl/rules.mk b/keyboards/handwired/meck_tkl/rules.mk deleted file mode 100644 index cdf3900ff0db..000000000000 --- a/keyboards/handwired/meck_tkl/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -AUDIO_SUPPORTED = no -BACKLIGHT_SUPPORTED = no - -DEFAULT_FOLDER = handwired/meck_tkl/blackpill_f401 diff --git a/keyboards/handwired/ms_sculpt_mobile/rules.mk b/keyboards/handwired/ms_sculpt_mobile/rules.mk deleted file mode 100644 index 8a3cc6858c2d..000000000000 --- a/keyboards/handwired/ms_sculpt_mobile/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/ms_sculpt_mobile/teensy2pp diff --git a/keyboards/handwired/novem/readme.md b/keyboards/handwired/novem/readme.md index c259c2cb8285..4ccf81523618 100644 --- a/keyboards/handwired/novem/readme.md +++ b/keyboards/handwired/novem/readme.md @@ -2,8 +2,6 @@ ![novem](https://i.imgur.com/nPjBE9b.jpg) -A short description of the keyboard/project - * Keyboard Maintainer: [Jose I. Martinez](https://github.com/mechanicalguy21) * Hardware Supported: This is a handwired keyboard created over a 3d printed case. STL will be shared soon. diff --git a/keyboards/handwired/onekey/at_start_f415/board.h b/keyboards/handwired/onekey/at_start_f415/board.h index f4adc2d4183a..a31d8f8e37dc 100644 --- a/keyboards/handwired/onekey/at_start_f415/board.h +++ b/keyboards/handwired/onekey/at_start_f415/board.h @@ -1,5 +1,5 @@ -// Copyright 2023-2024 HorrorTroll -// Copyright 2023-2024 Zhaqian +// Copyright 2023-2025 HorrorTroll +// Copyright 2023-2025 Zhaqian // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/handwired/onekey/at_start_f415/config.h b/keyboards/handwired/onekey/at_start_f415/config.h index 0e47e813c575..41aece900cf6 100644 --- a/keyboards/handwired/onekey/at_start_f415/config.h +++ b/keyboards/handwired/onekey/at_start_f415/config.h @@ -1,5 +1,5 @@ -// Copyright 2023-2024 HorrorTroll -// Copyright 2023-2024 Zhaqian +// Copyright 2023-2025 HorrorTroll +// Copyright 2023-2025 Zhaqian // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/handwired/onekey/at_start_f415/halconf.h b/keyboards/handwired/onekey/at_start_f415/halconf.h index 1423633d15fc..e3c075936dc1 100644 --- a/keyboards/handwired/onekey/at_start_f415/halconf.h +++ b/keyboards/handwired/onekey/at_start_f415/halconf.h @@ -1,5 +1,5 @@ -// Copyright 2023-2024 HorrorTroll -// Copyright 2023-2024 Zhaqian +// Copyright 2023-2025 HorrorTroll +// Copyright 2023-2025 Zhaqian // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/handwired/onekey/at_start_f415/keyboard.json b/keyboards/handwired/onekey/at_start_f415/keyboard.json index f598923a6a55..6e5683a4742b 100644 --- a/keyboards/handwired/onekey/at_start_f415/keyboard.json +++ b/keyboards/handwired/onekey/at_start_f415/keyboard.json @@ -17,4 +17,8 @@ "ws2812": { "pin": "B0" } + "apa102": { + "data_pin": "B0", + "clock_pin": "B1" + } } diff --git a/keyboards/handwired/onekey/at_start_f415/mcuconf.h b/keyboards/handwired/onekey/at_start_f415/mcuconf.h index 9bc11d507cce..246f6762d32a 100644 --- a/keyboards/handwired/onekey/at_start_f415/mcuconf.h +++ b/keyboards/handwired/onekey/at_start_f415/mcuconf.h @@ -1,5 +1,5 @@ -// Copyright 2023-2024 HorrorTroll -// Copyright 2023-2024 Zhaqian +// Copyright 2023-2025 HorrorTroll +// Copyright 2023-2025 Zhaqian // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/keyboards/handwired/onekey/keymaps/community_module/keymap.c b/keyboards/handwired/onekey/keymaps/community_module/keymap.c new file mode 100644 index 000000000000..5115a9fea0b8 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/community_module/keymap.c @@ -0,0 +1,7 @@ +// Copyright 2025 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_1x1(CM_HELO) +}; diff --git a/keyboards/handwired/onekey/keymaps/community_module/keymap.json b/keyboards/handwired/onekey/keymaps/community_module/keymap.json new file mode 100644 index 000000000000..e3b4051b9ed9 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/community_module/keymap.json @@ -0,0 +1,3 @@ +{ + "modules": ["qmk/hello_world"] +} diff --git a/keyboards/handwired/onekey/rules.mk b/keyboards/handwired/onekey/rules.mk deleted file mode 100644 index 2094801ed913..000000000000 --- a/keyboards/handwired/onekey/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/onekey/promicro diff --git a/keyboards/handwired/pill60/rules.mk b/keyboards/handwired/pill60/rules.mk deleted file mode 100644 index 9299a64d612c..000000000000 --- a/keyboards/handwired/pill60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/pill60/bluepill diff --git a/keyboards/handwired/postageboard/rules.mk b/keyboards/handwired/postageboard/rules.mk deleted file mode 100644 index a7fcf6bea67b..000000000000 --- a/keyboards/handwired/postageboard/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER=handwired/postageboard/mini diff --git a/keyboards/handwired/qc60/rules.mk b/keyboards/handwired/qc60/rules.mk deleted file mode 100644 index 4905848cf91c..000000000000 --- a/keyboards/handwired/qc60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/qc60/proto diff --git a/keyboards/handwired/sono1/rules.mk b/keyboards/handwired/sono1/rules.mk deleted file mode 100644 index 9b472f28f2b5..000000000000 --- a/keyboards/handwired/sono1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/sono1/t2pp diff --git a/keyboards/handwired/splittest/rules.mk b/keyboards/handwired/splittest/rules.mk deleted file mode 100644 index ae4d823b53ef..000000000000 --- a/keyboards/handwired/splittest/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/splittest/promicro diff --git a/keyboards/handwired/stef9998/split_5x7/rules.mk b/keyboards/handwired/stef9998/split_5x7/rules.mk deleted file mode 100644 index f06c490f000b..000000000000 --- a/keyboards/handwired/stef9998/split_5x7/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/stef9998/split_5x7/rev1 diff --git a/keyboards/handwired/symmetric70_proto/promicro/rules.mk b/keyboards/handwired/symmetric70_proto/promicro/rules.mk deleted file mode 100644 index 7aa985b3f1d4..000000000000 --- a/keyboards/handwired/symmetric70_proto/promicro/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/symmetric70_proto/promicro/base diff --git a/keyboards/handwired/symmetric70_proto/proton_c/rules.mk b/keyboards/handwired/symmetric70_proto/proton_c/rules.mk deleted file mode 100644 index 28c4536e4bf3..000000000000 --- a/keyboards/handwired/symmetric70_proto/proton_c/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/symmetric70_proto/proton_c/base diff --git a/keyboards/handwired/unk/rules.mk b/keyboards/handwired/unk/rules.mk deleted file mode 100644 index d4536e0cbb68..000000000000 --- a/keyboards/handwired/unk/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = handwired/unk/rev1 diff --git a/keyboards/handwired/xealous/config.h b/keyboards/handwired/xealous/config.h deleted file mode 100644 index 6cc6b4d1de49..000000000000 --- a/keyboards/handwired/xealous/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define USE_I2C -#define SCL_CLOCK 800000UL - -//#define DEBUG_MATRIX_SCAN_RATE //Use this to determine scan-rate. - -#ifdef AUDIO_ENABLE - #define AUDIO_PIN C6 - #define STARTUP_SONG SONG(STARTUP_SOUND) - #define NO_MUSIC_MODE - #define TONE_QWERTY SONG(Q__NOTE(_E4)); - #define TONE_NUMPAD SONG(Q__NOTE(_D4)); -#endif diff --git a/keyboards/handwired/xealous/matrix.c b/keyboards/handwired/xealous/matrix.c deleted file mode 100644 index b8ae9fd73854..000000000000 --- a/keyboards/handwired/xealous/matrix.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "timer.h" - -// Copy this code to split_common/matrix.c, -// and call it instead of the unoptimized col_reader. Scan-rate jumps from 1200->1920 -// Also remove the sleep_us(30), not necessary for this keyboard. -// In usb_descriptor.c, set .PollingIntervalMS = 0x01 -#define ROW_SHIFTER ((uint8_t)1) -inline static matrix_row_t optimized_col_reader(void) { - //MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } - return (PINB & (1 << 6) ? 0 : (ROW_SHIFTER << 0)) | - (PINB & (1 << 2) ? 0 : (ROW_SHIFTER << 1)) | - (PINB & (1 << 3) ? 0 : (ROW_SHIFTER << 2)) | - (PINB & (1 << 1) ? 0 : (ROW_SHIFTER << 3)) | - (PINF & (1 << 7) ? 0 : (ROW_SHIFTER << 4)) | - (PINF & (1 << 6) ? 0 : (ROW_SHIFTER << 5)) | - (PINF & (1 << 5) ? 0 : (ROW_SHIFTER << 6)) | - (PINF & (1 << 4) ? 0 : (ROW_SHIFTER << 7)); -} - - diff --git a/keyboards/handwired/xealous/rev1/config.h b/keyboards/handwired/xealous/rev1/config.h index 49be10cce4ed..2ea66a692cfd 100644 --- a/keyboards/handwired/xealous/rev1/config.h +++ b/keyboards/handwired/xealous/rev1/config.h @@ -18,6 +18,19 @@ along with this program. If not, see . #pragma once +#define USE_I2C +#define SCL_CLOCK 800000UL + +//#define DEBUG_MATRIX_SCAN_RATE //Use this to determine scan-rate. + +#ifdef AUDIO_ENABLE + #define AUDIO_PIN C6 + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define NO_MUSIC_MODE + #define TONE_QWERTY SONG(Q__NOTE(_E4)); + #define TONE_NUMPAD SONG(Q__NOTE(_D4)); +#endif + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/handwired/xealous/rules.mk b/keyboards/handwired/xealous/rules.mk deleted file mode 100644 index 4a97d066df7f..000000000000 --- a/keyboards/handwired/xealous/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC += matrix.c - -DEFAULT_FOLDER = handwired/xealous/rev1 diff --git a/keyboards/hhkb/ansi/rules.mk b/keyboards/hhkb/ansi/32u2/rules.mk similarity index 64% rename from keyboards/hhkb/ansi/rules.mk rename to keyboards/hhkb/ansi/32u2/rules.mk index 841565b84655..94eaaab9c062 100644 --- a/keyboards/hhkb/ansi/rules.mk +++ b/keyboards/hhkb/ansi/32u2/rules.mk @@ -2,5 +2,3 @@ CUSTOM_MATRIX = yes # project specific files SRC = matrix.c - -DEFAULT_FOLDER = hhkb/ansi/32u4 diff --git a/keyboards/hhkb/ansi/32u4/rules.mk b/keyboards/hhkb/ansi/32u4/rules.mk new file mode 100644 index 000000000000..94eaaab9c062 --- /dev/null +++ b/keyboards/hhkb/ansi/32u4/rules.mk @@ -0,0 +1,4 @@ +CUSTOM_MATRIX = yes + +# project specific files +SRC = matrix.c diff --git a/keyboards/hillside/46/rules.mk b/keyboards/hillside/46/rules.mk deleted file mode 100644 index f3e926a8dc0b..000000000000 --- a/keyboards/hillside/46/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = hillside/46/0_1 \ No newline at end of file diff --git a/keyboards/hillside/48/rules.mk b/keyboards/hillside/48/rules.mk deleted file mode 100644 index d8d69d9ec1d3..000000000000 --- a/keyboards/hillside/48/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = hillside/48/0_1 diff --git a/keyboards/hillside/52/rules.mk b/keyboards/hillside/52/rules.mk deleted file mode 100644 index 402bc6bb9595..000000000000 --- a/keyboards/hillside/52/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = hillside/52/0_1 diff --git a/keyboards/hineybush/h75_singa/readme.md b/keyboards/hineybush/h75_singa/readme.md index 815785834cb8..b110fd5b14bf 100644 --- a/keyboards/hineybush/h75_singa/readme.md +++ b/keyboards/hineybush/h75_singa/readme.md @@ -1,7 +1,5 @@ # h75_singa -![h75_singa](imgur.com image replace me!) - TBD - New 75% PCB for Singa Keyboards * Keyboard Maintainer: [hineybush](https://github.com/hineybush) diff --git a/keyboards/ibm/model_m/mschwingen/mschwingen.c b/keyboards/ibm/model_m/mschwingen/mschwingen.c index cb4854d8d1a3..34a878c76998 100644 --- a/keyboards/ibm/model_m/mschwingen/mschwingen.c +++ b/keyboards/ibm/model_m/mschwingen/mschwingen.c @@ -19,9 +19,12 @@ #include "uart.h" #include "print.h" #include "sendchar.h" -#include "ws2812.h" #include "sleep_led.h" +#ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812 +#include "ws2812.h" +#endif + #ifdef UART_DEBUG # undef sendchar static int8_t capture_sendchar(uint8_t c) { diff --git a/keyboards/ibnuda/squiggle/rules.mk b/keyboards/ibnuda/squiggle/rules.mk deleted file mode 100644 index 0214333999bd..000000000000 --- a/keyboards/ibnuda/squiggle/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ibnuda/squiggle/rev1 diff --git a/keyboards/idobao/id80/v1/rules.mk b/keyboards/idobao/id80/v1/rules.mk deleted file mode 100644 index 20283f04be5f..000000000000 --- a/keyboards/idobao/id80/v1/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Defalt to the ansi version -DEFAULT_FOLDER = idobao/id80/v2/ansi diff --git a/keyboards/idobao/id80/v3/rules.mk b/keyboards/idobao/id80/v3/rules.mk deleted file mode 100644 index 218fc0553998..000000000000 --- a/keyboards/idobao/id80/v3/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Defalt to the ansi version -DEFAULT_FOLDER = idobao/id80/v3/ansi diff --git a/keyboards/inett_studio/sq80/rules.mk b/keyboards/inett_studio/sq80/rules.mk deleted file mode 100644 index d4f8260d939a..000000000000 --- a/keyboards/inett_studio/sq80/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = inett_studio/sq80/hotswap_layout_i diff --git a/keyboards/input_club/infinity60/rules.mk b/keyboards/input_club/infinity60/rules.mk deleted file mode 100644 index 9c4b1e74c2e1..000000000000 --- a/keyboards/input_club/infinity60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = input_club/infinity60/led diff --git a/keyboards/jacky_studio/bear_65/rules.mk b/keyboards/jacky_studio/bear_65/rules.mk deleted file mode 100644 index 91bb6f74b98d..000000000000 --- a/keyboards/jacky_studio/bear_65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jacky_studio/bear_65/rev1 diff --git a/keyboards/jacky_studio/piggy60/rev1/rules.mk b/keyboards/jacky_studio/piggy60/rev1/rules.mk deleted file mode 100644 index 873e9334ed7a..000000000000 --- a/keyboards/jacky_studio/piggy60/rev1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jacky_studio/piggy60/rev1/solder diff --git a/keyboards/jacky_studio/piggy60/rules.mk b/keyboards/jacky_studio/piggy60/rules.mk deleted file mode 100644 index 873e9334ed7a..000000000000 --- a/keyboards/jacky_studio/piggy60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jacky_studio/piggy60/rev1/solder diff --git a/keyboards/jadookb/jkb65/rules.mk b/keyboards/jadookb/jkb65/rules.mk deleted file mode 100644 index 2bbb2a41cea3..000000000000 --- a/keyboards/jadookb/jkb65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jadookb/jkb65/r1 diff --git a/keyboards/jian/rules.mk b/keyboards/jian/rules.mk deleted file mode 100644 index c19fa00b5cb9..000000000000 --- a/keyboards/jian/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jian/rev2 diff --git a/keyboards/jiran/rules.mk b/keyboards/jiran/rules.mk deleted file mode 100644 index 3ffe13302d35..000000000000 --- a/keyboards/jiran/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jiran/rev1 diff --git a/keyboards/jones/rules.mk b/keyboards/jones/rules.mk deleted file mode 100644 index 9f0da2abecc0..000000000000 --- a/keyboards/jones/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jones/v1 diff --git a/keyboards/jorne/rules.mk b/keyboards/jorne/rules.mk deleted file mode 100644 index c43649b3486e..000000000000 --- a/keyboards/jorne/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = jorne/rev1 diff --git a/keyboards/jukaie/jk01/config.h b/keyboards/jukaie/jk01/config.h index d8dfb9f53545..41534ce6c466 100644 --- a/keyboards/jukaie/jk01/config.h +++ b/keyboards/jukaie/jk01/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_CS_PIN_2 B15 diff --git a/keyboards/junco/rules.mk b/keyboards/junco/rules.mk deleted file mode 100644 index bb94741e5ad8..000000000000 --- a/keyboards/junco/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = junco/rev1 diff --git a/keyboards/kakunpc/angel17/rules.mk b/keyboards/kakunpc/angel17/rules.mk deleted file mode 100644 index 48095d37e61c..000000000000 --- a/keyboards/kakunpc/angel17/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kakunpc/angel17/rev1 diff --git a/keyboards/kakunpc/angel64/alpha/rules.mk b/keyboards/kakunpc/angel64/alpha/rules.mk new file mode 100644 index 000000000000..09c02c88b0da --- /dev/null +++ b/keyboards/kakunpc/angel64/alpha/rules.mk @@ -0,0 +1,3 @@ +CUSTOM_MATRIX = yes + +SRC += matrix.c diff --git a/keyboards/kakunpc/angel64/rev1/rules.mk b/keyboards/kakunpc/angel64/rev1/rules.mk new file mode 100644 index 000000000000..09c02c88b0da --- /dev/null +++ b/keyboards/kakunpc/angel64/rev1/rules.mk @@ -0,0 +1,3 @@ +CUSTOM_MATRIX = yes + +SRC += matrix.c diff --git a/keyboards/kakunpc/angel64/rules.mk b/keyboards/kakunpc/angel64/rules.mk deleted file mode 100644 index c95d5297bd72..000000000000 --- a/keyboards/kakunpc/angel64/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -CUSTOM_MATRIX = yes - -SRC += matrix.c - -DEFAULT_FOLDER = kakunpc/angel64/rev1 diff --git a/keyboards/kakunpc/business_card/readme.md b/keyboards/kakunpc/business_card/readme.md index cbd05af4108f..98fdf1be907b 100644 --- a/keyboards/kakunpc/business_card/readme.md +++ b/keyboards/kakunpc/business_card/readme.md @@ -1,12 +1,6 @@ # business_card -![business_card](imgur.com image replace me!) - -A short description of the keyboard/project - -Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: links to where you can find this hardware +* Keyboard Maintainer: [kakunpc](https://github.com/kakunpc) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/kakunpc/business_card/rules.mk b/keyboards/kakunpc/business_card/rules.mk deleted file mode 100644 index 4525d52332a0..000000000000 --- a/keyboards/kakunpc/business_card/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kakunpc/business_card/beta diff --git a/keyboards/kakunpc/suihankey/rules.mk b/keyboards/kakunpc/suihankey/rules.mk deleted file mode 100644 index 46a0114bd576..000000000000 --- a/keyboards/kakunpc/suihankey/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kakunpc/suihankey/rev1 diff --git a/keyboards/kakunpc/suihankey/split/rules.mk b/keyboards/kakunpc/suihankey/split/rules.mk deleted file mode 100644 index 1dc7b014f022..000000000000 --- a/keyboards/kakunpc/suihankey/split/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kakunpc/suihankey/split/rev1 diff --git a/keyboards/kapcave/paladinpad/rules.mk b/keyboards/kapcave/paladinpad/rules.mk deleted file mode 100644 index 02685414e3bd..000000000000 --- a/keyboards/kapcave/paladinpad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kapcave/paladinpad/rev2 diff --git a/keyboards/kapl/rules.mk b/keyboards/kapl/rules.mk deleted file mode 100644 index a5dd22ce1c8e..000000000000 --- a/keyboards/kapl/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kapl/rev1 diff --git a/keyboards/kbdfans/d45/rules.mk b/keyboards/kbdfans/d45/rules.mk deleted file mode 100644 index 041e632f65ee..000000000000 --- a/keyboards/kbdfans/d45/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kbdfans/d45/v2 diff --git a/keyboards/kbdfans/kbd75/rules.mk b/keyboards/kbdfans/kbd75/rules.mk deleted file mode 100644 index 5c4617131612..000000000000 --- a/keyboards/kbdfans/kbd75/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kbdfans/kbd75/rev1 diff --git a/keyboards/keebio/bdn9/rules.mk b/keyboards/keebio/bdn9/rules.mk deleted file mode 100644 index 431a8ad02751..000000000000 --- a/keyboards/keebio/bdn9/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/bdn9/rev1 diff --git a/keyboards/keebio/convolution/rules.mk b/keyboards/keebio/convolution/rules.mk deleted file mode 100644 index 9df8bd1c4735..000000000000 --- a/keyboards/keebio/convolution/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/convolution/rev1 diff --git a/keyboards/keebio/dsp40/rules.mk b/keyboards/keebio/dsp40/rules.mk deleted file mode 100644 index 3e8e9be18c3b..000000000000 --- a/keyboards/keebio/dsp40/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/dsp40/rev1 diff --git a/keyboards/keebio/ergodicity/readme.md b/keyboards/keebio/ergodicity/readme.md index 0f841d6e3eb3..61f4ee658c40 100644 --- a/keyboards/keebio/ergodicity/readme.md +++ b/keyboards/keebio/ergodicity/readme.md @@ -1,9 +1,5 @@ # Ergodicity -![ergodicity](imgur.com image replace me!) - -A short description of the keyboard/project - Keyboard Maintainer: [nooges/bakingpy](https://github.com/nooges) Hardware Supported: Ergodicity PCB w/ATmega32u4 Hardware Availability: [Keebio](https://keeb.io) diff --git a/keyboards/keebio/foldkb/rules.mk b/keyboards/keebio/foldkb/rules.mk deleted file mode 100644 index 6a0522a902b1..000000000000 --- a/keyboards/keebio/foldkb/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/foldkb/rev1 diff --git a/keyboards/keebio/kbo5000/rules.mk b/keyboards/keebio/kbo5000/rules.mk deleted file mode 100644 index 06d2f2f41238..000000000000 --- a/keyboards/keebio/kbo5000/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/kbo5000/rev1 diff --git a/keyboards/keebio/levinson/rules.mk b/keyboards/keebio/levinson/rules.mk deleted file mode 100644 index 44cdce9d12d2..000000000000 --- a/keyboards/keebio/levinson/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/levinson/rev2 diff --git a/keyboards/keebio/quefrency/rules.mk b/keyboards/keebio/quefrency/rules.mk deleted file mode 100644 index fb40fc8a56fd..000000000000 --- a/keyboards/keebio/quefrency/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/quefrency/rev1 diff --git a/keyboards/keebio/rorschach/rules.mk b/keyboards/keebio/rorschach/rules.mk deleted file mode 100644 index 6cdac68a4e0e..000000000000 --- a/keyboards/keebio/rorschach/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/rorschach/rev1 diff --git a/keyboards/keebio/sinc/rules.mk b/keyboards/keebio/sinc/rules.mk deleted file mode 100644 index 141995747985..000000000000 --- a/keyboards/keebio/sinc/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/sinc/rev1 diff --git a/keyboards/keebio/viterbi/rules.mk b/keyboards/keebio/viterbi/rules.mk deleted file mode 100644 index ecf6a3fa8755..000000000000 --- a/keyboards/keebio/viterbi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keebio/viterbi/rev2 diff --git a/keyboards/keycapsss/kimiko/rules.mk b/keyboards/keycapsss/kimiko/rules.mk deleted file mode 100644 index cb9f69d6bbed..000000000000 --- a/keyboards/keycapsss/kimiko/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keycapsss/kimiko/rev2 diff --git a/keyboards/keycapsss/plaid_pad/rules.mk b/keyboards/keycapsss/plaid_pad/rules.mk deleted file mode 100644 index 0ab7cc3141a1..000000000000 --- a/keyboards/keycapsss/plaid_pad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keycapsss/plaid_pad/rev1 diff --git a/keyboards/keyhive/navi10/rules.mk b/keyboards/keyhive/navi10/rules.mk deleted file mode 100644 index 6ebb2d0cebf2..000000000000 --- a/keyboards/keyhive/navi10/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keyhive/navi10/rev3 diff --git a/keyboards/keyhive/uno/rules.mk b/keyboards/keyhive/uno/rules.mk deleted file mode 100644 index 322099459370..000000000000 --- a/keyboards/keyhive/uno/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = keyhive/uno/rev1 diff --git a/keyboards/kin80/rules.mk b/keyboards/kin80/rules.mk deleted file mode 100644 index b264c9cfc5c7..000000000000 --- a/keyboards/kin80/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kin80/blackpill401 diff --git a/keyboards/kira/kira75/readme.md b/keyboards/kira/kira75/readme.md index a30b60d179dd..237e81d06b07 100644 --- a/keyboards/kira/kira75/readme.md +++ b/keyboards/kira/kira75/readme.md @@ -1,7 +1,5 @@ # Kira 75 -![kira75](imgur.com image replace me!) - 75% keyboard designed by thesiscamper Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) diff --git a/keyboards/kprepublic/bm16a/v1/readme.md b/keyboards/kprepublic/bm16a/v1/readme.md index d24a87950557..6ad3773371c4 100644 --- a/keyboards/kprepublic/bm16a/v1/readme.md +++ b/keyboards/kprepublic/bm16a/v1/readme.md @@ -5,7 +5,6 @@ A 16 key macropad, with USB C, RGB underglow and backlight. * Keyboard Maintainer: QMK Community -* Hardware Supported: The PCBs, controllers supported * Hardware Availability: [KPrepublic](https://kprepublic.com/products/bm16a-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom-underglow-alps-mx); [AliExpress](https://www.aliexpress.com/store/product/bm16a-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom/3034003_32970629907.html) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/kprepublic/bm16s/readme.md b/keyboards/kprepublic/bm16s/readme.md index 6a887e553ae1..5b121cdaeae6 100644 --- a/keyboards/kprepublic/bm16s/readme.md +++ b/keyboards/kprepublic/bm16s/readme.md @@ -3,7 +3,6 @@ A 16-key macropad, with USB C and per-key RGB backlighting. This is a variant of the BM16A, but with low profile Choc switches. * Keyboard Maintainer: QMK Community -* Hardware Supported: The PCBs, controllers supported * Hardware Availability: [KPrepublic](https://kprepublic.com/collections/pcb/products/bm16s-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch-leds-choc-switch); [AliExpress](https://www.aliexpress.com/item/bm16s-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch/32999247908.html); [Massdrop](https://www.massdrop.com/buy/78169) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/kprepublic/jj40/rules.mk b/keyboards/kprepublic/jj40/rules.mk deleted file mode 100644 index fa09523958c8..000000000000 --- a/keyboards/kprepublic/jj40/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kprepublic/jj40/rev1 diff --git a/keyboards/kprepublic/jj50/rules.mk b/keyboards/kprepublic/jj50/rules.mk deleted file mode 100644 index 8f77c68db25d..000000000000 --- a/keyboards/kprepublic/jj50/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kprepublic/jj50/rev1 diff --git a/keyboards/kradoindustries/promenade/keyboard.json b/keyboards/kradoindustries/promenade/keyboard.json index 86330dbc2ee1..028ba1b24df6 100644 --- a/keyboards/kradoindustries/promenade/keyboard.json +++ b/keyboards/kradoindustries/promenade/keyboard.json @@ -73,8 +73,8 @@ {"matrix": [1, 3], "x":3.5, "y":1}, {"matrix": [1, 4], "x":4.5, "y":1}, {"matrix": [1, 5], "x":5.5, "y":1}, - {"matrix": [1, 6], "x":6.5, "y":1, "h":1.5}, - {"matrix": [1, 7], "x":7.5, "y":1, "h":1.5}, + {"matrix": [1, 6], "x":6.5, "y":1}, + {"matrix": [1, 7], "x":7.5, "y":1}, {"matrix": [1, 8], "x":8.5, "y":1}, {"matrix": [1, 9], "x":9.5, "y":1}, {"matrix": [1, 10], "x":10.5, "y":1}, @@ -88,6 +88,8 @@ {"matrix": [2, 3], "x":3.5, "y":2}, {"matrix": [2, 4], "x":4.5, "y":2}, {"matrix": [2, 5], "x":5.5, "y":2}, + {"matrix": [2, 6], "x":6.5, "y":2}, + {"matrix": [2, 7], "x":7.5, "y":2}, {"matrix": [2, 8], "x":8.5, "y":2}, {"matrix": [2, 9], "x":9.5, "y":2}, {"matrix": [2, 10], "x":10.5, "y":2}, @@ -101,8 +103,8 @@ {"matrix": [3, 3], "x":3.5, "y":3}, {"matrix": [3, 4], "x":4.5, "y":3}, {"matrix": [3, 5], "x":5.5, "y":3}, - {"matrix": [3, 6], "x":6.5, "y":2.5, "h":1.5}, - {"matrix": [3, 7], "x":7.5, "y":2.5, "h":1.5}, + {"matrix": [3, 6], "x":6.5, "y":3}, + {"matrix": [3, 7], "x":7.5, "y":3}, {"matrix": [3, 8], "x":8.5, "y":3}, {"matrix": [3, 9], "x":9.5, "y":3}, {"matrix": [3, 10], "x":10.5, "y":3}, diff --git a/keyboards/kradoindustries/promenade/keymaps/default/keymap.c b/keyboards/kradoindustries/promenade/keymaps/default/keymap.c index aef0f2816136..be8401e6083c 100644 --- a/keyboards/kradoindustries/promenade/keymaps/default/keymap.c +++ b/keyboards/kradoindustries/promenade/keymaps/default/keymap.c @@ -26,19 +26,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * .-----------------------------------------------------------------------------------------------------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' | + * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | \ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| - * | CAP LK | A | S | D | F | G | | | H | J | K | L | ; | ENTER | + * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| - * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | RCTRL | + * | LCTRL | LGUI | LALT | FN | SPACE | SPACE | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | RCTRL | * '-----------------------------------------------------------------------------------------------------------------------------' */ [_BASE] = LAYOUT_all( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL ), @@ -47,20 +47,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * .-----------------------------------------------------------------------------------------------------------------------------. * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| - * | | Home | Up | End | PgUp | | | | | | | | PRT SC | | + * | | HOME | UP | END | PG UP | | | | | | | | PRT SC | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| - * | | Left | Down | Right | PgDn | | | | | | | | | Reset | + * | | LEFT | DOWN | RIGHT | PG DN | | | | | | | | ' | RGB Off| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| * | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------| - * | | | | | | | | | | | | | | Reset | + * | | | | | | ENTER | ENTER | BACKSP | | | | | Reset | * '-----------------------------------------------------------------------------------------------------------------------------' */ [_FN] = LAYOUT_all( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, _______, QK_BOOT, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, UG_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT + _______, _______, _______, _______, _______, KC_ENT, KC_ENT, KC_BSPC, _______, _______, _______, _______, QK_BOOT ) }; diff --git a/keyboards/kradoindustries/promenade/matrix_diagram.md b/keyboards/kradoindustries/promenade/matrix_diagram.md index 086471b8b9ab..3c205c9a9933 100644 --- a/keyboards/kradoindustries/promenade/matrix_diagram.md +++ b/keyboards/kradoindustries/promenade/matrix_diagram.md @@ -5,10 +5,10 @@ │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0A │0B │0C │0D │ ├─────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼─────┤ │10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1A │1B │1C │1D │ -├─────┼───┼───┼───┼───┼───┤ │ ├───┼───┼───┼───┼───┼─────┤ -│20 │21 │22 │23 │24 │25 ├───┼───┤28 │29 │2A │2B │2C │2D │ -├─────┼───┼───┼───┼───┼───┤36 │37 ├───┼───┼───┼───┼───┼─────┤ -│30 │31 │32 │33 │34 │35 │ │ │38 │39 │3A │3B │3C │3D │ +├─────┼───┼───┼───┼───┼───├───┼───┼───┼───┼───┼───┼───┼─────┤ +│20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2A │2B │2C │2D │ +├─────┼───┼───┼───┼───┼───├───┼───┼───┼───┼───┼───┼───┼─────┤ +│30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3A │3B │3C │3D │ ├─────┼───┼───┼───┼───┼───┼───┴───┼───┼───┼───┼───┼───┼─────┤ │40 │41 │42 │43 │44 │45 │46 │48 │49 │4A │4B │4C │4D │ └─────┴───┴───┴───┴───┴───┴───────┴───┴───┴───┴───┴───┴─────┘ diff --git a/keyboards/kumaokobo/kudox/rules.mk b/keyboards/kumaokobo/kudox/rules.mk deleted file mode 100644 index 16c27e7c3b24..000000000000 --- a/keyboards/kumaokobo/kudox/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kumaokobo/kudox/rev3 diff --git a/keyboards/kumaokobo/kudox_full/rules.mk b/keyboards/kumaokobo/kudox_full/rules.mk deleted file mode 100644 index c912dcd2e5c8..000000000000 --- a/keyboards/kumaokobo/kudox_full/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kumaokobo/kudox_full/rev1 diff --git a/keyboards/kumaokobo/kudox_game/rules.mk b/keyboards/kumaokobo/kudox_game/rules.mk deleted file mode 100644 index 28918ca489f5..000000000000 --- a/keyboards/kumaokobo/kudox_game/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kumaokobo/kudox_game/rev2 diff --git a/keyboards/kumaokobo/pico/rules.mk b/keyboards/kumaokobo/pico/rules.mk deleted file mode 100644 index df859afa0fa6..000000000000 --- a/keyboards/kumaokobo/pico/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = kumaokobo/pico/65keys diff --git a/keyboards/lazydesigners/dimple/rules.mk b/keyboards/lazydesigners/dimple/rules.mk deleted file mode 100644 index cd05623d8417..000000000000 --- a/keyboards/lazydesigners/dimple/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lazydesigners/dimple/staggered/rev1 diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk deleted file mode 100644 index 0fb6d362043e..000000000000 --- a/keyboards/lets_split/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lets_split/rev2 diff --git a/keyboards/lfkeyboards/lfk78/rules.mk b/keyboards/lfkeyboards/lfk78/rules.mk deleted file mode 100644 index 5ebd387c834d..000000000000 --- a/keyboards/lfkeyboards/lfk78/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lfkeyboards/lfk78/revj diff --git a/keyboards/lfkeyboards/lfk87/rules.mk b/keyboards/lfkeyboards/lfk87/rules.mk deleted file mode 100644 index 05b80ac74add..000000000000 --- a/keyboards/lfkeyboards/lfk87/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lfkeyboards/lfk78/revc diff --git a/keyboards/lfkeyboards/smk65/rules.mk b/keyboards/lfkeyboards/smk65/rules.mk deleted file mode 100644 index b2d749766322..000000000000 --- a/keyboards/lfkeyboards/smk65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lfkeyboards/smk65/revb diff --git a/keyboards/lily58/rules.mk b/keyboards/lily58/rules.mk deleted file mode 100644 index a63bd42ad37d..000000000000 --- a/keyboards/lily58/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lily58/rev1 diff --git a/keyboards/lime/rules.mk b/keyboards/lime/rules.mk deleted file mode 100644 index 4643abab9371..000000000000 --- a/keyboards/lime/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = lime/rev1 diff --git a/keyboards/maple_computing/christmas_tree/rules.mk b/keyboards/maple_computing/christmas_tree/rules.mk deleted file mode 100644 index 3a6633cf5681..000000000000 --- a/keyboards/maple_computing/christmas_tree/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = maple_computing/christmas_tree/v2017 diff --git a/keyboards/maple_computing/ivy/rules.mk b/keyboards/maple_computing/ivy/rules.mk deleted file mode 100644 index 2665d44abd70..000000000000 --- a/keyboards/maple_computing/ivy/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = maple_computing/ivy/rev1 diff --git a/keyboards/maple_computing/launchpad/rules.mk b/keyboards/maple_computing/launchpad/rules.mk deleted file mode 100644 index 8c35a608a6a8..000000000000 --- a/keyboards/maple_computing/launchpad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = maple_computing/launchpad/rev1 diff --git a/keyboards/maple_computing/minidox/rules.mk b/keyboards/maple_computing/minidox/rules.mk deleted file mode 100644 index d5a7f49e4022..000000000000 --- a/keyboards/maple_computing/minidox/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = maple_computing/minidox/rev1 diff --git a/keyboards/mariorion_v25/rules.mk b/keyboards/mariorion_v25/rules.mk deleted file mode 100644 index f0bfa47284c0..000000000000 --- a/keyboards/mariorion_v25/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mariorion_v25/prod diff --git a/keyboards/marksard/rhymestone/rules.mk b/keyboards/marksard/rhymestone/rules.mk deleted file mode 100644 index 183388870810..000000000000 --- a/keyboards/marksard/rhymestone/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = marksard/rhymestone/rev1 diff --git a/keyboards/marksard/treadstone32/readme.md b/keyboards/marksard/treadstone32/readme.md index 170c6bc76184..4e3d5446989c 100644 --- a/keyboards/marksard/treadstone32/readme.md +++ b/keyboards/marksard/treadstone32/readme.md @@ -4,9 +4,7 @@ A 32-key Symmetric staggered keyboard. -Keyboard Maintainer: [marksard](https://github.com/marksard) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: links to where you can find this hardware +* Keyboard Maintainer: [marksard](https://github.com/marksard) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/marksard/treadstone32/rules.mk b/keyboards/marksard/treadstone32/rules.mk deleted file mode 100644 index 2d7ca16d86cb..000000000000 --- a/keyboards/marksard/treadstone32/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = marksard/treadstone32/rev1 diff --git a/keyboards/marksard/treadstone48/readme.md b/keyboards/marksard/treadstone48/readme.md index c5f6f8f73fec..692891447c50 100644 --- a/keyboards/marksard/treadstone48/readme.md +++ b/keyboards/marksard/treadstone48/readme.md @@ -4,9 +4,7 @@ A 47 (or 48) keys Symmetric Staggered keyboard. -Keyboard Maintainer: [marksard](https://github.com/marksard) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: links to where you can find this hardware +* Keyboard Maintainer: [marksard](https://github.com/marksard) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/marksard/treadstone48/rules.mk b/keyboards/marksard/treadstone48/rules.mk deleted file mode 100644 index 23865d27e63e..000000000000 --- a/keyboards/marksard/treadstone48/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = marksard/treadstone48/rev1 diff --git a/keyboards/masterworks/classy_tkl/readme.md b/keyboards/masterworks/classy_tkl/readme.md index 0557ed7f4c4c..1e5903483cf9 100644 --- a/keyboards/masterworks/classy_tkl/readme.md +++ b/keyboards/masterworks/classy_tkl/readme.md @@ -2,8 +2,6 @@ ![Classy TKL](https://i.imgur.com/p1dxfYKl.jpg) -A short description of the keyboard/project - * Keyboard Maintainer: [Mathias Andersson](https://github.com/wraul) * Hardware Supported: [Classy TKL PCB](https://github.com/4pplet/classyTKL) * Hardware Availability: https://geekhack.org/index.php?topic=105933 diff --git a/keyboards/maxipad/rules.mk b/keyboards/maxipad/rules.mk deleted file mode 100644 index 98a712a7b888..000000000000 --- a/keyboards/maxipad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = maxipad/promicro diff --git a/keyboards/mb44/readme.md b/keyboards/mb44/readme.md index 3cd59ecdb136..3029c69f9e28 100644 --- a/keyboards/mb44/readme.md +++ b/keyboards/mb44/readme.md @@ -5,8 +5,6 @@ To reset and put into bootloader mode, please use the hardware reset button on the botton of the PCB. If the PCB is on the default firmware, software reset is available by holding the bottom left corner key and pressing `B` in the standard qwerty layout. * Keyboard Maintainer: [melonbred](https://github.com/melonbred) -* Hardware Supported: The PCBs, controllers supported -* Hardware Availability: Links to where you can find this hardware Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/mechkeys/mechmini/rules.mk b/keyboards/mechkeys/mechmini/rules.mk deleted file mode 100644 index 9d63d875ebe8..000000000000 --- a/keyboards/mechkeys/mechmini/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechkeys/mechmini/v2 diff --git a/keyboards/mechllama/g35/rules.mk b/keyboards/mechllama/g35/rules.mk deleted file mode 100644 index 36acf8d17f80..000000000000 --- a/keyboards/mechllama/g35/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechllama/g35/v2 diff --git a/keyboards/mechlovin/adelais/rgb_led/rules.mk b/keyboards/mechlovin/adelais/rgb_led/rules.mk deleted file mode 100644 index 18047f12c7e6..000000000000 --- a/keyboards/mechlovin/adelais/rgb_led/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/adelais/rgb_led/rev1 diff --git a/keyboards/mechlovin/adelais/rules.mk b/keyboards/mechlovin/adelais/rules.mk deleted file mode 100644 index a1d2ba038de2..000000000000 --- a/keyboards/mechlovin/adelais/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/adelais/standard_led/arm/rev2 diff --git a/keyboards/mechlovin/adelais/standard_led/arm/rev4/rules.mk b/keyboards/mechlovin/adelais/standard_led/arm/rev4/rules.mk deleted file mode 100644 index d348ae660f71..000000000000 --- a/keyboards/mechlovin/adelais/standard_led/arm/rev4/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/adelais/standard_led/arm/rev4/stm32f303 diff --git a/keyboards/mechlovin/adelais/standard_led/arm/rules.mk b/keyboards/mechlovin/adelais/standard_led/arm/rules.mk deleted file mode 100644 index 16a636a342ba..000000000000 --- a/keyboards/mechlovin/adelais/standard_led/arm/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/adelais/standard_led/arm/rev2 \ No newline at end of file diff --git a/keyboards/mechlovin/adelais/standard_led/avr/rules.mk b/keyboards/mechlovin/adelais/standard_led/avr/rules.mk deleted file mode 100644 index f33198890dde..000000000000 --- a/keyboards/mechlovin/adelais/standard_led/avr/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ - -DEFAULT_FOLDER = mechlovin/adelais/standard_led/avr/rev1 \ No newline at end of file diff --git a/keyboards/mechlovin/adelais/standard_led/rules.mk b/keyboards/mechlovin/adelais/standard_led/rules.mk deleted file mode 100644 index a1d2ba038de2..000000000000 --- a/keyboards/mechlovin/adelais/standard_led/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/adelais/standard_led/arm/rev2 diff --git a/keyboards/mechlovin/delphine/readme.md b/keyboards/mechlovin/delphine/readme.md index 9a5389a5f331..397a0ada407d 100644 --- a/keyboards/mechlovin/delphine/readme.md +++ b/keyboards/mechlovin/delphine/readme.md @@ -1,7 +1,5 @@ # delphine -![delphine](imgur.com image replace me!) - A Number-Pad PCB, Mono backlight and RGB backlight version, Dolpad compatible. * Keyboard Maintainer: [Mechlovin'](https://github.com/mechlovin) diff --git a/keyboards/mechlovin/delphine/rules.mk b/keyboards/mechlovin/delphine/rules.mk deleted file mode 100644 index 819bce1cd3d5..000000000000 --- a/keyboards/mechlovin/delphine/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/delphine/mono_led diff --git a/keyboards/mechlovin/hannah60rgb/rules.mk b/keyboards/mechlovin/hannah60rgb/rules.mk deleted file mode 100644 index e876a56afb5e..000000000000 --- a/keyboards/mechlovin/hannah60rgb/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/hannah60rgb/rev1 diff --git a/keyboards/mechlovin/hannah65/rev1/rules.mk b/keyboards/mechlovin/hannah65/rev1/rules.mk deleted file mode 100644 index ae9bc176a4c9..000000000000 --- a/keyboards/mechlovin/hannah65/rev1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/hannah65/rev1/haus diff --git a/keyboards/mechlovin/hannah65/rules.mk b/keyboards/mechlovin/hannah65/rules.mk deleted file mode 100644 index ae9bc176a4c9..000000000000 --- a/keyboards/mechlovin/hannah65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/hannah65/rev1/haus diff --git a/keyboards/mechlovin/hannah910/rules.mk b/keyboards/mechlovin/hannah910/rules.mk deleted file mode 100644 index a35686719722..000000000000 --- a/keyboards/mechlovin/hannah910/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/hannah910/rev1 diff --git a/keyboards/mechlovin/hex4b/rules.mk b/keyboards/mechlovin/hex4b/rules.mk deleted file mode 100644 index e3d9ab46b44f..000000000000 --- a/keyboards/mechlovin/hex4b/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/hex4b/rev1 diff --git a/keyboards/mechlovin/infinity87/rev1/rules.mk b/keyboards/mechlovin/infinity87/rev1/rules.mk deleted file mode 100644 index 101153f240d0..000000000000 --- a/keyboards/mechlovin/infinity87/rev1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/infinity87/rev1/standard diff --git a/keyboards/mechlovin/infinity87/rules.mk b/keyboards/mechlovin/infinity87/rules.mk deleted file mode 100644 index 4aa072cae752..000000000000 --- a/keyboards/mechlovin/infinity87/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/infinity87/rgb_rev1 diff --git a/keyboards/mechlovin/mechlovin9/rules.mk b/keyboards/mechlovin/mechlovin9/rules.mk deleted file mode 100644 index 79de7c7d316a..000000000000 --- a/keyboards/mechlovin/mechlovin9/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/mechlovin9/rev1 diff --git a/keyboards/mechlovin/olly/jf/rules.mk b/keyboards/mechlovin/olly/jf/rules.mk deleted file mode 100644 index fa0eceeb8a7d..000000000000 --- a/keyboards/mechlovin/olly/jf/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/olly/jf/rev1 diff --git a/keyboards/mechlovin/zed1800/rules.mk b/keyboards/mechlovin/zed1800/rules.mk deleted file mode 100644 index e0088c95c39e..000000000000 --- a/keyboards/mechlovin/zed1800/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/zed1800/saber diff --git a/keyboards/mechlovin/zed65/no_backlight/rules.mk b/keyboards/mechlovin/zed65/no_backlight/rules.mk deleted file mode 100644 index a699765498bb..000000000000 --- a/keyboards/mechlovin/zed65/no_backlight/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/zed65/no_backlight/wearhaus66 diff --git a/keyboards/mechlovin/zed65/rules.mk b/keyboards/mechlovin/zed65/rules.mk deleted file mode 100644 index a699765498bb..000000000000 --- a/keyboards/mechlovin/zed65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechlovin/zed65/no_backlight/wearhaus66 diff --git a/keyboards/mechwild/bde/rules.mk b/keyboards/mechwild/bde/rules.mk deleted file mode 100644 index 138a2919162a..000000000000 --- a/keyboards/mechwild/bde/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/bde/rev2 diff --git a/keyboards/mechwild/mokulua/readme.md b/keyboards/mechwild/mokulua/readme.md index 24f01b10d46d..5a6b69e66e26 100644 --- a/keyboards/mechwild/mokulua/readme.md +++ b/keyboards/mechwild/mokulua/readme.md @@ -2,8 +2,6 @@ ![Mokulua](https://i.imgur.com/7fifiQch.jpg) -*A short description of the keyboard/project* - * Keyboard Maintainer: [Kyle McCreery](https://github.com/kylemccreery) * Hardware Supported: Mokulua v1.3 * Hardware Availability: https://mechwild.com/product/mokulua/ diff --git a/keyboards/mechwild/mokulua/rules.mk b/keyboards/mechwild/mokulua/rules.mk deleted file mode 100644 index 3a87a143e51f..000000000000 --- a/keyboards/mechwild/mokulua/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/mokulua/standard \ No newline at end of file diff --git a/keyboards/mechwild/obe/f401/rules.mk b/keyboards/mechwild/obe/f401/rules.mk deleted file mode 100644 index 8709dbb4de30..000000000000 --- a/keyboards/mechwild/obe/f401/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/obe/f401/base diff --git a/keyboards/mechwild/obe/f411/rules.mk b/keyboards/mechwild/obe/f411/rules.mk deleted file mode 100644 index e24fe6050948..000000000000 --- a/keyboards/mechwild/obe/f411/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/obe/f411/base diff --git a/keyboards/mechwild/obe/rules.mk b/keyboards/mechwild/obe/rules.mk deleted file mode 100644 index 8709dbb4de30..000000000000 --- a/keyboards/mechwild/obe/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/obe/f401/base diff --git a/keyboards/mechwild/waka60/f401/rules.mk b/keyboards/mechwild/waka60/f401/rules.mk deleted file mode 100644 index a0d74c14eb1c..000000000000 --- a/keyboards/mechwild/waka60/f401/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/waka60/f401/base diff --git a/keyboards/mechwild/waka60/f411/rules.mk b/keyboards/mechwild/waka60/f411/rules.mk deleted file mode 100644 index 0dd69ff65f7b..000000000000 --- a/keyboards/mechwild/waka60/f411/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/waka60/f411/base diff --git a/keyboards/mechwild/waka60/rules.mk b/keyboards/mechwild/waka60/rules.mk deleted file mode 100644 index a0d74c14eb1c..000000000000 --- a/keyboards/mechwild/waka60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechwild/waka60/f401/base diff --git a/keyboards/melgeek/z70ultra/rules.mk b/keyboards/melgeek/z70ultra/rules.mk deleted file mode 100644 index 8cc384b91f76..000000000000 --- a/keyboards/melgeek/z70ultra/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = melgeek/z70ultra/rev1 diff --git a/keyboards/meme/readme.md b/keyboards/meme/readme.md index 94b55d746ef3..7b09a5e18fbe 100644 --- a/keyboards/meme/readme.md +++ b/keyboards/meme/readme.md @@ -1,7 +1,5 @@ # Meme -![meme](imgur.com image replace me!) - 65% gasket mount keyboard. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) diff --git a/keyboards/mint60/readme.md b/keyboards/mint60/readme.md index 1824c682f862..3a28f56181b6 100644 --- a/keyboards/mint60/readme.md +++ b/keyboards/mint60/readme.md @@ -2,11 +2,8 @@ ![Mint60](https://i.imgur.com/suOE8HN.jpg) -A short description of the keyboard/project - Keyboard Maintainer: [Eucalyn](https://github.com/eucalyn) [@eucalyn_](https://twitter.com/eucalyn_) Hardware Supported: The Mint60 PCBs, ProMicro supported -Hardware Availability: links to where you can find this hardware Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/moky/moky88/config.h b/keyboards/moky/moky88/config.h index a673a38069c2..7c102e1a9769 100644 --- a/keyboards/moky/moky88/config.h +++ b/keyboards/moky/moky88/config.h @@ -15,5 +15,4 @@ /* RGB Driver */ #define AW20216S_CS_PIN_1 D2 #define AW20216S_CS_PIN_2 B8 -#define AW20216S_EN_PIN_1 B9 -#define AW20216S_EN_PIN_2 B9 +#define AW20216S_EN_PIN B9 diff --git a/keyboards/moky/moky88/moky88.c b/keyboards/moky/moky88/moky88.c index 3cbd6e146812..2de672f94f32 100644 --- a/keyboards/moky/moky88/moky88.c +++ b/keyboards/moky/moky88/moky88.c @@ -23,97 +23,97 @@ const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT] = { * | | G location * | | | B location * | | | | */ - {0, CS18_SW2, CS17_SW2, CS16_SW2 }, // 0 Esc - {0, CS18_SW3, CS17_SW3, CS16_SW3 }, // 1 F1 - {0, CS18_SW4, CS17_SW4, CS16_SW4 }, // 2 F2 - {0, CS18_SW5, CS17_SW5, CS16_SW5 }, // 3 F3 - {0, CS18_SW6, CS17_SW6, CS16_SW6 }, // 4 F4 - {0, CS18_SW7, CS17_SW7, CS16_SW7 }, // 5 F5 - {0, CS18_SW8, CS17_SW8, CS16_SW8 }, // 6 F6 - {0, CS18_SW9, CS17_SW9, CS16_SW9 }, // 7 F7 - {0, CS18_SW10, CS17_SW10, CS16_SW10 }, // 8 F8 - {0, CS18_SW11, CS17_SW11, CS16_SW11 }, // 9 F9 - {0, CS18_SW12, CS17_SW12, CS16_SW12 }, // 10 F10 - {1, CS18_SW1, CS17_SW1, CS16_SW1 }, // 11 F11 - {1, CS18_SW2, CS17_SW2, CS16_SW2 }, // 12 F12 - {1, CS18_SW3, CS17_SW3, CS16_SW3 }, // 13 MUTE - {1, CS18_SW4, CS17_SW4, CS16_SW4 }, // 14 PSCR - {1, CS18_SW5, CS17_SW5, CS16_SW5 }, // 15 SCRL - {1, CS18_SW6, CS17_SW6, CS16_SW6 }, // 16 PAUSE + {0, SW2_CS18, SW2_CS17, SW2_CS16 }, // 0 Esc + {0, SW3_CS18, SW3_CS17, SW3_CS16 }, // 1 F1 + {0, SW4_CS18, SW4_CS17, SW4_CS16 }, // 2 F2 + {0, SW5_CS18, SW5_CS17, SW5_CS16 }, // 3 F3 + {0, SW6_CS18, SW6_CS17, SW6_CS16 }, // 4 F4 + {0, SW7_CS18, SW7_CS17, SW7_CS16 }, // 5 F5 + {0, SW8_CS18, SW8_CS17, SW8_CS16 }, // 6 F6 + {0, SW9_CS18, SW9_CS17, SW9_CS16 }, // 7 F7 + {0, SW10_CS18, SW10_CS17, SW10_CS16 }, // 8 F8 + {0, SW11_CS18, SW11_CS17, SW11_CS16 }, // 9 F9 + {0, SW12_CS18, SW12_CS17, SW12_CS16 }, // 10 F10 + {1, SW1_CS18, SW1_CS17, SW1_CS16 }, // 11 F11 + {1, SW2_CS18, SW2_CS17, SW2_CS16 }, // 12 F12 + {1, SW3_CS18, SW3_CS17, SW3_CS16 }, // 13 MUTE + {1, SW4_CS18, SW4_CS17, SW4_CS16 }, // 14 PSCR + {1, SW5_CS18, SW5_CS17, SW5_CS16 }, // 15 SCRL + {1, SW6_CS18, SW6_CS17, SW6_CS16 }, // 16 PAUSE - {0, CS15_SW2, CS14_SW2, CS13_SW2 }, // 17 `~ - {0, CS15_SW3, CS14_SW3, CS13_SW3 }, // 18 1 - {0, CS15_SW4, CS14_SW4, CS13_SW4 }, // 19 2 - {0, CS15_SW5, CS14_SW5, CS13_SW5 }, // 20 3 - {0, CS15_SW6, CS14_SW6, CS13_SW6 }, // 21 4 - {0, CS15_SW7, CS14_SW7, CS13_SW7 }, // 22 5 - {0, CS15_SW8, CS14_SW8, CS13_SW8 }, // 23 6 - {0, CS15_SW9, CS14_SW9, CS13_SW9 }, // 24 7 - {0, CS15_SW10, CS14_SW10, CS13_SW10 }, // 25 8 - {0, CS15_SW11, CS14_SW11, CS13_SW11 }, // 26 9 - {0, CS15_SW12, CS14_SW12, CS13_SW12 }, // 27 0 - {1, CS15_SW1, CS14_SW1, CS13_SW1 }, // 28 -_ - {1, CS15_SW2, CS14_SW2, CS13_SW2 }, // 29 =+ - {1, CS15_SW3, CS14_SW3, CS13_SW3 }, // 30 BSPC - {1, CS15_SW4, CS14_SW4, CS13_SW4 }, // 31 INS - {1, CS15_SW5, CS14_SW5, CS13_SW5 }, // 32 HOME - {1, CS15_SW6, CS14_SW6, CS13_SW6 }, // 33 PGUP + {0, SW2_CS15, SW2_CS14, SW2_CS13 }, // 17 `~ + {0, SW3_CS15, SW3_CS14, SW3_CS13 }, // 18 1 + {0, SW4_CS15, SW4_CS14, SW4_CS13 }, // 19 2 + {0, SW5_CS15, SW5_CS14, SW5_CS13 }, // 20 3 + {0, SW6_CS15, SW6_CS14, SW6_CS13 }, // 21 4 + {0, SW7_CS15, SW7_CS14, SW7_CS13 }, // 22 5 + {0, SW8_CS15, SW8_CS14, SW8_CS13 }, // 23 6 + {0, SW9_CS15, SW9_CS14, SW9_CS13 }, // 24 7 + {0, SW10_CS15, SW10_CS14, SW10_CS13 }, // 25 8 + {0, SW11_CS15, SW11_CS14, SW11_CS13 }, // 26 9 + {0, SW12_CS15, SW12_CS14, SW12_CS13 }, // 27 0 + {1, SW1_CS15, SW1_CS14, SW1_CS13 }, // 28 -_ + {1, SW2_CS15, SW2_CS14, SW2_CS13 }, // 29 =+ + {1, SW3_CS15, SW3_CS14, SW3_CS13 }, // 30 BSPC + {1, SW4_CS15, SW4_CS14, SW4_CS13 }, // 31 INS + {1, SW5_CS15, SW5_CS14, SW5_CS13 }, // 32 HOME + {1, SW6_CS15, SW6_CS14, SW6_CS13 }, // 33 PGUP - {0, CS12_SW2, CS11_SW2, CS10_SW2 }, // 34 Tab - {0, CS12_SW3, CS11_SW3, CS10_SW3 }, // 35 Q - {0, CS12_SW4, CS11_SW4, CS10_SW4 }, // 36 W - {0, CS12_SW5, CS11_SW5, CS10_SW5 }, // 37 E - {0, CS12_SW6, CS11_SW6, CS10_SW6 }, // 38 R - {0, CS12_SW7, CS11_SW7, CS10_SW7 }, // 39 T - {0, CS12_SW8, CS11_SW8, CS10_SW8 }, // 40 Y - {0, CS12_SW9, CS11_SW9, CS10_SW9 }, // 41 U - {0, CS12_SW10, CS11_SW10, CS10_SW10 }, // 42 I - {0, CS12_SW11, CS11_SW11, CS10_SW11 }, // 43 O - {0, CS12_SW12, CS11_SW12, CS10_SW12 }, // 44 P - {1, CS12_SW1, CS11_SW1, CS10_SW1 }, // 45 [{ - {1, CS12_SW2, CS11_SW2, CS10_SW2 }, // 48 ]} - {1, CS12_SW3, CS11_SW3, CS10_SW3 }, // 47 \| - {1, CS12_SW4, CS11_SW4, CS10_SW4 }, // 48 Del - {1, CS12_SW5, CS11_SW5, CS10_SW5 }, // 49 End - {1, CS12_SW6, CS11_SW6, CS10_SW6 }, // 50 PGDN + {0, SW2_CS12, SW2_CS11, SW2_CS10 }, // 34 Tab + {0, SW3_CS12, SW3_CS11, SW3_CS10 }, // 35 Q + {0, SW4_CS12, SW4_CS11, SW4_CS10 }, // 36 W + {0, SW5_CS12, SW5_CS11, SW5_CS10 }, // 37 E + {0, SW6_CS12, SW6_CS11, SW6_CS10 }, // 38 R + {0, SW7_CS12, SW7_CS11, SW7_CS10 }, // 39 T + {0, SW8_CS12, SW8_CS11, SW8_CS10 }, // 40 Y + {0, SW9_CS12, SW9_CS11, SW9_CS10 }, // 41 U + {0, SW10_CS12, SW10_CS11, SW10_CS10 }, // 42 I + {0, SW11_CS12, SW11_CS11, SW11_CS10 }, // 43 O + {0, SW12_CS12, SW12_CS11, SW12_CS10 }, // 44 P + {1, SW1_CS12, SW1_CS11, SW1_CS10 }, // 45 [{ + {1, SW2_CS12, SW2_CS11, SW2_CS10 }, // 48 ]} + {1, SW3_CS12, SW3_CS11, SW3_CS10 }, // 47 \| + {1, SW4_CS12, SW4_CS11, SW4_CS10 }, // 48 Del + {1, SW5_CS12, SW5_CS11, SW5_CS10 }, // 49 End + {1, SW6_CS12, SW6_CS11, SW6_CS10 }, // 50 PGDN - {0, CS1_SW2, CS2_SW2, CS3_SW2 }, // 51 Caps - {0, CS1_SW3, CS2_SW3, CS3_SW3 }, // 52 A - {0, CS1_SW4, CS2_SW4, CS3_SW4 }, // 33 S - {0, CS1_SW5, CS2_SW5, CS3_SW5 }, // 54 D - {0, CS1_SW6, CS2_SW6, CS3_SW6 }, // 55 F - {0, CS1_SW7, CS2_SW7, CS3_SW7 }, // 56 G - {0, CS1_SW8, CS2_SW8, CS3_SW8 }, // 57 H - {0, CS1_SW9, CS2_SW9, CS3_SW9 }, // 58 J - {0, CS1_SW10, CS2_SW10, CS3_SW10 }, // 59 K - {0, CS1_SW11, CS2_SW11, CS3_SW11 }, // 60 L - {0, CS1_SW12, CS2_SW12, CS3_SW12 }, // 61 ;: - {1, CS1_SW1, CS2_SW1, CS3_SW1 }, // 62 ' - {1, CS1_SW3, CS2_SW3, CS3_SW3 }, // 63 Enter + {0, SW2_CS1, SW2_CS2, SW2_CS3 }, // 51 Caps + {0, SW3_CS1, SW3_CS2, SW3_CS3 }, // 52 A + {0, SW4_CS1, SW4_CS2, SW4_CS3 }, // 33 S + {0, SW5_CS1, SW5_CS2, SW5_CS3 }, // 54 D + {0, SW6_CS1, SW6_CS2, SW6_CS3 }, // 55 F + {0, SW7_CS1, SW7_CS2, SW7_CS3 }, // 56 G + {0, SW8_CS1, SW8_CS2, SW8_CS3 }, // 57 H + {0, SW9_CS1, SW9_CS2, SW9_CS3 }, // 58 J + {0, SW10_CS1, SW10_CS2, SW10_CS3 }, // 59 K + {0, SW11_CS1, SW11_CS2, SW11_CS3 }, // 60 L + {0, SW12_CS1, SW12_CS2, SW12_CS3 }, // 61 ;: + {1, SW1_CS1, SW1_CS2, SW1_CS3 }, // 62 ' + {1, SW3_CS1, SW3_CS2, SW3_CS3 }, // 63 Enter - {0, CS4_SW2, CS5_SW2, CS6_SW2 }, // 64 Shift - {0, CS4_SW4, CS5_SW4, CS6_SW4 }, // 65 Z - {0, CS4_SW5, CS5_SW5, CS6_SW5 }, // 66 X - {0, CS4_SW6, CS5_SW6, CS6_SW6 }, // 67 C - {0, CS4_SW7, CS5_SW7, CS6_SW7 }, // 68 V - {0, CS4_SW8, CS5_SW8, CS6_SW8 }, // 69 B - {0, CS4_SW9, CS5_SW9, CS6_SW9 }, // 70 N - {0, CS4_SW10, CS5_SW10, CS6_SW10 }, // 71 M - {0, CS4_SW11, CS5_SW11, CS6_SW11 }, // 72 ,< - {0, CS4_SW12, CS5_SW12, CS6_SW12 }, // 73 .> - {1, CS4_SW1, CS5_SW1, CS6_SW1 }, // 74 ? - {1, CS4_SW3, CS5_SW3, CS6_SW3 }, // 75 Shift - {1, CS4_SW5, CS5_SW5, CS6_SW5 }, // 76 Up + {0, SW2_CS4, SW2_CS5, SW2_CS6 }, // 64 Shift + {0, SW4_CS4, SW4_CS5, SW4_CS6 }, // 65 Z + {0, SW5_CS4, SW5_CS5, SW5_CS6 }, // 66 X + {0, SW6_CS4, SW6_CS5, SW6_CS6 }, // 67 C + {0, SW7_CS4, SW7_CS5, SW7_CS6 }, // 68 V + {0, SW8_CS4, SW8_CS5, SW8_CS6 }, // 69 B + {0, SW9_CS4, SW9_CS5, SW9_CS6 }, // 70 N + {0, SW10_CS4, SW10_CS5, SW10_CS6 }, // 71 M + {0, SW11_CS4, SW11_CS5, SW11_CS6 }, // 72 ,< + {0, SW12_CS4, SW12_CS5, SW12_CS6 }, // 73 .> + {1, SW1_CS4, SW1_CS5, SW1_CS6 }, // 74 ? + {1, SW3_CS4, SW3_CS5, SW3_CS6 }, // 75 Shift + {1, SW5_CS4, SW5_CS5, SW5_CS6 }, // 76 Up - {0, CS7_SW2, CS8_SW2, CS9_SW2 }, // 77 Ctrl_L - {0, CS7_SW3, CS8_SW3, CS9_SW3 }, // 78 Win_L - {0, CS7_SW4, CS8_SW4, CS9_SW4 }, // 79 ALT_L - {0, CS7_SW8, CS8_SW8, CS9_SW8 }, // 80 SPACE - {0, CS7_SW12, CS8_SW12, CS9_SW12 }, // 81 ALT_L - {1, CS7_SW1, CS8_SW1, CS9_SW1 }, // 82 Win_L - {1, CS7_SW2, CS8_SW2, CS9_SW2 }, // 83 Fn - {1, CS7_SW3, CS8_SW3, CS9_SW3 }, // 84 Ctrl_L - {1, CS7_SW4, CS8_SW4, CS9_SW4 }, // 85 Left - {1, CS7_SW5, CS8_SW5, CS9_SW5 }, // 86 Down - {1, CS7_SW6, CS8_SW6, CS9_SW6 }, // 87 Right + {0, SW2_CS7, SW2_CS8, SW2_CS9 }, // 77 Ctrl_L + {0, SW3_CS7, SW3_CS8, SW3_CS9 }, // 78 Win_L + {0, SW4_CS7, SW4_CS8, SW4_CS9 }, // 79 ALT_L + {0, SW8_CS7, SW8_CS8, SW8_CS9 }, // 80 SPACE + {0, SW12_CS7, SW12_CS8, SW12_CS9 }, // 81 ALT_L + {1, SW1_CS7, SW1_CS8, SW1_CS9 }, // 82 Win_L + {1, SW2_CS7, SW2_CS8, SW2_CS9 }, // 83 Fn + {1, SW3_CS7, SW3_CS8, SW3_CS9 }, // 84 Ctrl_L + {1, SW4_CS7, SW4_CS8, SW4_CS9 }, // 85 Left + {1, SW5_CS7, SW5_CS8, SW5_CS9 }, // 86 Down + {1, SW6_CS7, SW6_CS8, SW6_CS9 }, // 87 Right }; diff --git a/keyboards/montsinger/rebound/rules.mk b/keyboards/montsinger/rebound/rules.mk deleted file mode 100644 index d277d184e189..000000000000 --- a/keyboards/montsinger/rebound/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = montsinger/rebound/rev1 diff --git a/keyboards/murcielago/rules.mk b/keyboards/murcielago/rules.mk deleted file mode 100644 index 661563697a64..000000000000 --- a/keyboards/murcielago/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = murcielago/rev1 \ No newline at end of file diff --git a/keyboards/nullbitsco/scramble/rules.mk b/keyboards/nullbitsco/scramble/rules.mk deleted file mode 100644 index 5753f7786dbd..000000000000 --- a/keyboards/nullbitsco/scramble/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = nullbitsco/scramble/v2 diff --git a/keyboards/oddball/rules.mk b/keyboards/oddball/v1/rules.mk similarity index 53% rename from keyboards/oddball/rules.mk rename to keyboards/oddball/v1/rules.mk index 2fc8995acbe7..84de35aeb142 100644 --- a/keyboards/oddball/rules.mk +++ b/keyboards/oddball/v1/rules.mk @@ -1,3 +1 @@ POINTING_DEVICE_DRIVER = adns9800 - -DEFAULT_FOLDER = oddball/v1 diff --git a/keyboards/oddball/v2/rules.mk b/keyboards/oddball/v2/rules.mk new file mode 100644 index 000000000000..84de35aeb142 --- /dev/null +++ b/keyboards/oddball/v2/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = adns9800 diff --git a/keyboards/oddball/v2_1/rules.mk b/keyboards/oddball/v2_1/rules.mk new file mode 100644 index 000000000000..84de35aeb142 --- /dev/null +++ b/keyboards/oddball/v2_1/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = adns9800 diff --git a/keyboards/omkbd/ergodash/rules.mk b/keyboards/omkbd/ergodash/rules.mk deleted file mode 100644 index 492cdde65d78..000000000000 --- a/keyboards/omkbd/ergodash/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = omkbd/ergodash/rev1 diff --git a/keyboards/omkbd/runner3680/rules.mk b/keyboards/omkbd/runner3680/rules.mk deleted file mode 100644 index 3460ad89640b..000000000000 --- a/keyboards/omkbd/runner3680/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = omkbd/runner3680/5x8 diff --git a/keyboards/orthodox/rules.mk b/keyboards/orthodox/rules.mk deleted file mode 100644 index fd71b6c8fb11..000000000000 --- a/keyboards/orthodox/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = orthodox/rev3 diff --git a/keyboards/peej/rosaline/rules.mk b/keyboards/peej/rosaline/rules.mk deleted file mode 100644 index 928164362a39..000000000000 --- a/keyboards/peej/rosaline/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = peej/rosaline/staggered diff --git a/keyboards/peej/tripel/rules.mk b/keyboards/peej/tripel/rules.mk deleted file mode 100644 index 8d8970045655..000000000000 --- a/keyboards/peej/tripel/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = peej/tripel/left diff --git a/keyboards/pegasus/readme.md b/keyboards/pegasus/readme.md index c523c035404f..9c6d575e923a 100644 --- a/keyboards/pegasus/readme.md +++ b/keyboards/pegasus/readme.md @@ -5,8 +5,6 @@ Pegasus is a 40% keyboard with a 12.75u "WKL" layout with 0.75u blockers. * Keyboard Maintainer: [melonbred](https://github.com/melonbred) -* Hardware Supported: The PCBs, controllers supported -* Hardware Availability: Links to where you can find this hardware Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/peranekofactory/tone/rules.mk b/keyboards/peranekofactory/tone/rules.mk deleted file mode 100644 index e87862a9f6e7..000000000000 --- a/keyboards/peranekofactory/tone/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = peranekofactory/tone/rev2 diff --git a/keyboards/phase_studio/titan65/rules.mk b/keyboards/phase_studio/titan65/rules.mk deleted file mode 100644 index d55ca35d7a1b..000000000000 --- a/keyboards/phase_studio/titan65/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = phase_studio/titan65/hotswap diff --git a/keyboards/pica40/rules.mk b/keyboards/pica40/rules.mk deleted file mode 100644 index 967088971285..000000000000 --- a/keyboards/pica40/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = pica40/rev2 diff --git a/keyboards/pinky/rules.mk b/keyboards/pinky/rules.mk deleted file mode 100644 index 89b708f68f7e..000000000000 --- a/keyboards/pinky/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = pinky/3 diff --git a/keyboards/ploopyco/madromys/post_rules.mk b/keyboards/ploopyco/madromys/post_rules.mk new file mode 100644 index 000000000000..fab9162dc64d --- /dev/null +++ b/keyboards/ploopyco/madromys/post_rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 diff --git a/keyboards/ploopyco/madromys/rules.mk b/keyboards/ploopyco/madromys/rules.mk deleted file mode 100644 index b7e33d92f92c..000000000000 --- a/keyboards/ploopyco/madromys/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -POINTING_DEVICE_DRIVER = pmw3360 - -DEFAULT_FOLDER = ploopyco/madromys/rev1_001 diff --git a/keyboards/ploopyco/mouse/config.h b/keyboards/ploopyco/mouse/config.h index 0f8774dcd7fd..0645283880d6 100644 --- a/keyboards/ploopyco/mouse/config.h +++ b/keyboards/ploopyco/mouse/config.h @@ -18,11 +18,6 @@ #pragma once -// These pins are not broken out, and cannot be used normally. -// They are set as output and pulled high, by default -#define UNUSABLE_PINS \ - { B4, D6, F1, F5, F6, F7 } - /* disable action features */ //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING @@ -30,13 +25,7 @@ // #define DEBUG_LED_PIN F7 -/* PMW33XX Settings */ -#define PMW33XX_CS_PIN B0 - #define ENCODER_BUTTON_COL 1 #define ENCODER_BUTTON_ROW 0 /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 - -#define ENCODER_A_PINS { F0 } -#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/mouse/keyboard.json b/keyboards/ploopyco/mouse/info.json similarity index 69% rename from keyboards/ploopyco/mouse/keyboard.json rename to keyboards/ploopyco/mouse/info.json index 4c81ee73383b..1a70989f2562 100644 --- a/keyboards/ploopyco/mouse/keyboard.json +++ b/keyboards/ploopyco/mouse/info.json @@ -1,6 +1,6 @@ { "keyboard_name": "Mouse", - "manufacturer": "PloopyCo", + "manufacturer": "Ploopy", "url": "www.ploopy.co", "maintainer": "drashna", "usb": { @@ -9,6 +9,9 @@ "device_version": "0.0.1", "max_power": 100 }, + "bootmagic": { + "matrix": [0, 3] + }, "features": { "bootmagic": true, "extrakey": true, @@ -17,28 +20,6 @@ "pointing_device": true, "encoder": true }, - "bootmagic": { - "matrix": [0, 3] - }, - "ws2812": { - "pin": "B5" - }, - "rgblight": { - "led_count": 4, - "max_brightness": 40, - "animations": { - "breathing": true, - "rainbow_mood": true, - "rainbow_swirl": true - } - }, - "processor": "atmega32u4", - "bootloader": "atmel-dfu", - "matrix_pins": { - "direct": [ - ["D4", "D2", "E6", "B6", "D7", "C6", "C7", "B7"] - ] - }, "encoder": { "driver": "custom" }, diff --git a/keyboards/ploopyco/mouse/post_rules.mk b/keyboards/ploopyco/mouse/post_rules.mk new file mode 100644 index 000000000000..0d1a00b89e06 --- /dev/null +++ b/keyboards/ploopyco/mouse/post_rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 \ No newline at end of file diff --git a/keyboards/ploopyco/mouse/readme.md b/keyboards/ploopyco/mouse/readme.md index 060448c2bf2d..c5c6bb7dcefe 100644 --- a/keyboards/ploopyco/mouse/readme.md +++ b/keyboards/ploopyco/mouse/readme.md @@ -6,14 +6,14 @@ It's a DIY, QMK Powered Mouse!!!! * Keyboard Maintainer: [PloopyCo](https://github.com/ploopyco), [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/) -* Hardware Supported: ATMega32u4 8MHz(3.3v) +* Hardware Supported: ATMega32u4 8MHz(3.3v), Raspberry RP2040 * Hardware Availability: [Store](https://ploopy.co), [GitHub](https://github.com/ploopyco) Make example for this keyboard (after setting up your build environment): make ploopyco/mouse:default:flash - -To jump to the bootloader, hold down "Button 4" (the "forward" button on the left side) + +To jump to the bootloader, hold down "Button 4" (the "forward" button on the left side) See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ploopyco/mouse/rev1_002/config.h b/keyboards/ploopyco/mouse/rev1_002/config.h new file mode 100644 index 000000000000..49b53bc8dd96 --- /dev/null +++ b/keyboards/ploopyco/mouse/rev1_002/config.h @@ -0,0 +1,33 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2019 Sunjun Kim + * Copyright 2020 Ploopy Corporation + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// These pins are not broken out, and cannot be used normally. +// They are set as output and pulled high, by default +#define UNUSABLE_PINS \ + { B4, D6, F1, F5, F6, F7 } + +// If board has a debug LED, you can enable it by defining this +// #define DEBUG_LED_PIN F7 + +/* PMW33XX Settings */ +#define PMW33XX_CS_PIN B0 + +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/mouse/rev1_002/keyboard.json b/keyboards/ploopyco/mouse/rev1_002/keyboard.json new file mode 100644 index 000000000000..bfed3232f066 --- /dev/null +++ b/keyboards/ploopyco/mouse/rev1_002/keyboard.json @@ -0,0 +1,21 @@ +{ + "processor": "atmega32u4", + "bootloader": "atmel-dfu", + "matrix_pins": { + "direct": [ + ["D4", "D2", "E6", "B6", "D7", "C6", "C7", "B7"] + ] + }, + "ws2812": { + "pin": "B5" + }, + "rgblight": { + "led_count": 3, + "max_brightness": 40, + "animations": { + "breathing": true, + "rainbow_mood": true, + "rainbow_swirl": true + } + } +} diff --git a/keyboards/ploopyco/mouse/rev1_002/readme.md b/keyboards/ploopyco/mouse/rev1_002/readme.md new file mode 100644 index 000000000000..a9400ea10083 --- /dev/null +++ b/keyboards/ploopyco/mouse/rev1_002/readme.md @@ -0,0 +1,3 @@ +See the [main readme](../readme.md) for more details. + +This is for the R1.002 version of the Mouse. It's easily distinguishable from the R1.003+ versions of the Mouse because it has an ATmega32u4 on the board. diff --git a/keyboards/ploopyco/mouse/rules.mk b/keyboards/ploopyco/mouse/rev1_002/rules.mk similarity index 52% rename from keyboards/ploopyco/mouse/rules.mk rename to keyboards/ploopyco/mouse/rev1_002/rules.mk index 3d1d3fc961b6..3437a35bdf1d 100644 --- a/keyboards/ploopyco/mouse/rules.mk +++ b/keyboards/ploopyco/mouse/rev1_002/rules.mk @@ -1,4 +1,2 @@ # Processor frequency F_CPU = 8000000 - -POINTING_DEVICE_DRIVER = pmw3360 diff --git a/keyboards/ploopyco/mouse/rev1_003/config.h b/keyboards/ploopyco/mouse/rev1_003/config.h new file mode 100644 index 000000000000..b4291e307b0d --- /dev/null +++ b/keyboards/ploopyco/mouse/rev1_003/config.h @@ -0,0 +1,32 @@ +/* Copyright 2024 Colin Lam (Ploopy Corporation) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2019 Sunjun Kim + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define UNUSABLE_PINS \ + { GP1, GP3, GP4, GP6, GP8, GP10, GP11, GP16, GP18, GP20, GP25, GP27, GP29 } + +/* PMW3360 Settings */ +#define PMW33XX_LIFTOFF_DISTANCE 0x00 +#define PMW33XX_CS_PIN GP5 +#define SPI_SCK_PIN GP2 +#define SPI_MISO_PIN GP0 +#define SPI_MOSI_PIN GP7 + +#define ENCODER_A_PINS { GP26 } +#define ENCODER_B_PINS { GP28 } diff --git a/keyboards/ploopyco/mouse/rev1_003/keyboard.json b/keyboards/ploopyco/mouse/rev1_003/keyboard.json new file mode 100644 index 000000000000..46eca8012f5a --- /dev/null +++ b/keyboards/ploopyco/mouse/rev1_003/keyboard.json @@ -0,0 +1,25 @@ +{ + "processor": "RP2040", + "bootloader": "rp2040", + "usb": { + "device_version": "1.0.0" + }, + "diode_direction": "COL2ROW", + "matrix_pins": { + "direct": [ + ["GP15", "GP21", "GP23", "GP17", "GP19", "GP22", "GP14", "GP24"] + ] + }, + "rgblight": { + "led_count": 1, + "max_brightness": 40, + "animations": { + "breathing": true, + "rainbow_mood": true, + "rainbow_swirl": true + } + }, + "ws2812": { + "pin": "GP12" + } +} diff --git a/keyboards/ploopyco/mouse/rev1_003/readme.md b/keyboards/ploopyco/mouse/rev1_003/readme.md new file mode 100644 index 000000000000..3e402f428099 --- /dev/null +++ b/keyboards/ploopyco/mouse/rev1_003/readme.md @@ -0,0 +1,3 @@ +See the [main readme](../readme.md) for more details. + +This is for the R1.003+ version of the Mouse. It's easily distinguishable from the previous versions of the Mouse because it has an RP2040 on the board. diff --git a/keyboards/ploopyco/trackball/config.h b/keyboards/ploopyco/trackball/config.h index 2aac27437ab6..1a9b4ad2256b 100644 --- a/keyboards/ploopyco/trackball/config.h +++ b/keyboards/ploopyco/trackball/config.h @@ -23,20 +23,11 @@ //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT +/* PMW3360 settings */ #define ROTATIONAL_TRANSFORM_ANGLE 20 - -// If board has a debug LED, you can enable it by defining this -// #define DEBUG_LED_PIN F7 - -/* PMW33XX Settings */ -#define PMW33XX_CS_PIN B0 #define POINTING_DEVICE_INVERT_Y - #define ENCODER_BUTTON_COL 1 #define ENCODER_BUTTON_ROW 0 /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 - -#define ENCODER_A_PINS { F0 } -#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball/info.json b/keyboards/ploopyco/trackball/info.json index 8014db1d638b..9e3312d4bc76 100644 --- a/keyboards/ploopyco/trackball/info.json +++ b/keyboards/ploopyco/trackball/info.json @@ -1,6 +1,6 @@ { - "keyboard_name": "Trackball", - "manufacturer": "PloopyCo", + "keyboard_name": "Classic Trackball", + "manufacturer": "Ploopy", "url": "www.ploopy.co", "maintainer": "drashna", "usb": { @@ -12,7 +12,6 @@ "bootmagic": { "matrix": [0, 3] }, - "features": { "bootmagic": true, "extrakey": true, diff --git a/keyboards/ploopyco/trackball/post_rules.mk b/keyboards/ploopyco/trackball/post_rules.mk new file mode 100644 index 000000000000..0d1a00b89e06 --- /dev/null +++ b/keyboards/ploopyco/trackball/post_rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 \ No newline at end of file diff --git a/keyboards/ploopyco/trackball/readme.md b/keyboards/ploopyco/trackball/readme.md index c668c5dd031d..cca2c1511464 100644 --- a/keyboards/ploopyco/trackball/readme.md +++ b/keyboards/ploopyco/trackball/readme.md @@ -1,27 +1,34 @@ -# Ploopyco Trackball +# Ploopy Classic Trackball -![Ploopyco Trackball](https://i.redd.it/j7z0y83txps31.jpg) +![Ploopy Trackball](https://i.redd.it/j7z0y83txps31.jpg) It's a DIY, QMK Powered Trackball!!!! -* Keyboard Maintainer: [PloopyCo](https://github.com/ploopyco), [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/) -* Hardware Supported: ATMega32u4 8MHz(3.3v) +* Keyboard Maintainer: [Ploopy](https://github.com/ploopyco), [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/) +* Hardware Supported: ATMega32u4 8MHz(3.3v), Raspberry RP2040 * Hardware Availability: [Store](https://ploopy.co), [GitHub](https://github.com/ploopyco) Make example for this keyboard (after setting up your build environment): - make ploopyco/trackball/rev1:default:flash + make ploopyco/trackball/rev1_004:default:flash make ploopyco/trackball/rev1_005:default:flash - -To jump to the bootloader, hold down "Button 4" (immediate right of the trackball) + make ploopyco/trackball/rev1_007:default:flash + +To jump to the bootloader, hold down "Button 4" (immediate right of the trackball) See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). ## Revisions -There are two main revisions for the PloopyCo Trackball, everything up to 1.004, and 1.005-1.006. +There are three main revisions for the Ploopy Classic Trackball: + +- Everything up to 1.004 (very rare) +- Revision 1.005 and 1.006 (commonly sold between 2020 and 2024) +- Revision 1.007 (first available in 2025) + +In the 1.005 revision, button four was changed from pin B5 to B6, and the debug LED pin was changed from F7 to B5. -In the 1.005 revision, button for was changed from pin B5 to B6, and the debug LED pin was changed from F7 to B5. +In the 1.007 revision, the board was switched from an ATMega32u4 architecture to the Raspberry RP2040 architecture. The PCB should indicate which revision this is. diff --git a/keyboards/ploopyco/trackball/rev1/config.h b/keyboards/ploopyco/trackball/rev1_004/config.h similarity index 90% rename from keyboards/ploopyco/trackball/rev1/config.h rename to keyboards/ploopyco/trackball/rev1_004/config.h index 35ab21534182..25bcf86391c5 100644 --- a/keyboards/ploopyco/trackball/rev1/config.h +++ b/keyboards/ploopyco/trackball/rev1_004/config.h @@ -25,3 +25,9 @@ // If board has a debug LED, you can enable it by defining this #define DEBUG_LED_PIN F7 + +/* PMW33XX Settings */ +#define PMW33XX_CS_PIN B0 + +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball/rev1/keyboard.json b/keyboards/ploopyco/trackball/rev1_004/keyboard.json similarity index 100% rename from keyboards/ploopyco/trackball/rev1/keyboard.json rename to keyboards/ploopyco/trackball/rev1_004/keyboard.json diff --git a/keyboards/ploopyco/trackball/rev1/readme.md b/keyboards/ploopyco/trackball/rev1_004/readme.md similarity index 100% rename from keyboards/ploopyco/trackball/rev1/readme.md rename to keyboards/ploopyco/trackball/rev1_004/readme.md diff --git a/keyboards/ploopyco/trackball/rev1_004/rules.mk b/keyboards/ploopyco/trackball/rev1_004/rules.mk new file mode 100644 index 000000000000..3437a35bdf1d --- /dev/null +++ b/keyboards/ploopyco/trackball/rev1_004/rules.mk @@ -0,0 +1,2 @@ +# Processor frequency +F_CPU = 8000000 diff --git a/keyboards/ploopyco/trackball/rev1_005/config.h b/keyboards/ploopyco/trackball/rev1_005/config.h index 014d67f9c1f3..404caca093a2 100644 --- a/keyboards/ploopyco/trackball/rev1_005/config.h +++ b/keyboards/ploopyco/trackball/rev1_005/config.h @@ -22,3 +22,12 @@ // They are set as output and pulled high, by default #define UNUSABLE_PINS \ { D1, D3, B4, B7, D6, C7, F6, F5, F3, F7 } + +// If board has a debug LED, you can enable it by defining this +// #define DEBUG_LED_PIN F7 + +/* PMW33XX Settings */ +#define PMW33XX_CS_PIN B0 + +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball/rev1_005/readme.md b/keyboards/ploopyco/trackball/rev1_005/readme.md index a923d165911b..980f118a100e 100644 --- a/keyboards/ploopyco/trackball/rev1_005/readme.md +++ b/keyboards/ploopyco/trackball/rev1_005/readme.md @@ -1,3 +1,3 @@ -See the [main readme](../readme.md) for more details. +See the [main readme](../readme.md) for more details. -This is just the rev 1.005+ trackball +This is for the R1.005-R1.006 version of the Classic. It's easily distinguishable from the R1.007+ versions of the Classic because it has an ATmega32u4 on the board. \ No newline at end of file diff --git a/keyboards/ploopyco/trackball/rev1_005/rules.mk b/keyboards/ploopyco/trackball/rev1_005/rules.mk new file mode 100644 index 000000000000..3437a35bdf1d --- /dev/null +++ b/keyboards/ploopyco/trackball/rev1_005/rules.mk @@ -0,0 +1,2 @@ +# Processor frequency +F_CPU = 8000000 diff --git a/keyboards/ploopyco/trackball/rev1_007/config.h b/keyboards/ploopyco/trackball/rev1_007/config.h new file mode 100644 index 000000000000..97f2e46b5c58 --- /dev/null +++ b/keyboards/ploopyco/trackball/rev1_007/config.h @@ -0,0 +1,32 @@ +/* Copyright 2024 Colin Lam (Ploopy Corporation) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2019 Sunjun Kim + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define UNUSABLE_PINS \ + { GP1, GP3, GP4, GP6, GP8, GP10, GP11, GP14, GP16, GP18, GP20, GP22, GP24, GP25, GP27, GP29 } + +/* PMW3360 Settings */ +#define PMW33XX_LIFTOFF_DISTANCE 0x00 +#define PMW33XX_CS_PIN GP5 +#define SPI_SCK_PIN GP2 +#define SPI_MISO_PIN GP0 +#define SPI_MOSI_PIN GP7 + +#define ENCODER_A_PINS { GP26 } +#define ENCODER_B_PINS { GP28 } diff --git a/keyboards/ploopyco/trackball/rev1_007/keyboard.json b/keyboards/ploopyco/trackball/rev1_007/keyboard.json new file mode 100644 index 000000000000..4098c86fdaf5 --- /dev/null +++ b/keyboards/ploopyco/trackball/rev1_007/keyboard.json @@ -0,0 +1,25 @@ +{ + "processor": "RP2040", + "bootloader": "rp2040", + "usb": { + "device_version": "1.0.0" + }, + "diode_direction": "COL2ROW", + "matrix_pins": { + "direct": [ + ["GP15", "GP21", "GP23", "GP17", "GP19"] + ] + }, + "rgblight": { + "led_count": 1, + "max_brightness": 40, + "animations": { + "breathing": true, + "rainbow_mood": true, + "rainbow_swirl": true + } + }, + "ws2812": { + "pin": "GP12" + } +} diff --git a/keyboards/ploopyco/trackball/rev1_007/readme.md b/keyboards/ploopyco/trackball/rev1_007/readme.md new file mode 100644 index 000000000000..6b8da3a959a3 --- /dev/null +++ b/keyboards/ploopyco/trackball/rev1_007/readme.md @@ -0,0 +1,3 @@ +See the [main readme](../readme.md) for more details. + +This is for the R1.007+ version of the Classic. It's easily distinguishable from the previous versions of the Classic because it has an RP2040 on the board. diff --git a/keyboards/ploopyco/trackball/rules.mk b/keyboards/ploopyco/trackball/rules.mk deleted file mode 100644 index 9ea10ba6e8fb..000000000000 --- a/keyboards/ploopyco/trackball/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Processor frequency -F_CPU = 8000000 - -POINTING_DEVICE_DRIVER = pmw3360 - -DEFAULT_FOLDER = ploopyco/trackball/rev1_005 diff --git a/keyboards/ploopyco/trackball_mini/post_rules.mk b/keyboards/ploopyco/trackball_mini/post_rules.mk new file mode 100644 index 000000000000..99fca15fc13a --- /dev/null +++ b/keyboards/ploopyco/trackball_mini/post_rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = adns5050 diff --git a/keyboards/ploopyco/trackball_mini/rules.mk b/keyboards/ploopyco/trackball_mini/rules.mk deleted file mode 100644 index 2705ac6855c4..000000000000 --- a/keyboards/ploopyco/trackball_mini/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -POINTING_DEVICE_DRIVER = adns5050 - -DEFAULT_FOLDER = ploopyco/trackball_mini/rev1_001 diff --git a/keyboards/ploopyco/trackball_nano/post_rules.mk b/keyboards/ploopyco/trackball_nano/post_rules.mk new file mode 100644 index 000000000000..99fca15fc13a --- /dev/null +++ b/keyboards/ploopyco/trackball_nano/post_rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = adns5050 diff --git a/keyboards/ploopyco/trackball_nano/rules.mk b/keyboards/ploopyco/trackball_nano/rules.mk deleted file mode 100644 index df29dfbc07fa..000000000000 --- a/keyboards/ploopyco/trackball_nano/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -POINTING_DEVICE_DRIVER = adns5050 - -DEFAULT_FOLDER = ploopyco/trackball_nano/rev1_001 diff --git a/keyboards/ploopyco/trackball_thumb/config.h b/keyboards/ploopyco/trackball_thumb/config.h index f03ffc769903..0f269bd21ad4 100644 --- a/keyboards/ploopyco/trackball_thumb/config.h +++ b/keyboards/ploopyco/trackball_thumb/config.h @@ -29,9 +29,6 @@ // If board has a debug LED, you can enable it by defining this // #define DEBUG_LED_PIN F7 -/* PMW3360 Settings */ -#define POINTING_DEVICE_CS_PIN B0 - #define ENCODER_BUTTON_COL 1 #define ENCODER_BUTTON_ROW 0 @@ -41,6 +38,3 @@ #define ENCODER_HIGH_THRES_B 90 /* Custom encoder needs to specify just how many encoders we have */ #define NUM_ENCODERS 1 - -#define ENCODER_A_PINS { F4 } -#define ENCODER_B_PINS { F0 } diff --git a/keyboards/ploopyco/trackball_thumb/info.json b/keyboards/ploopyco/trackball_thumb/info.json index e27bf472521f..7e93296d24ba 100644 --- a/keyboards/ploopyco/trackball_thumb/info.json +++ b/keyboards/ploopyco/trackball_thumb/info.json @@ -1,22 +1,22 @@ { - "keyboard_name": "PloopyCo Thumb Trackball", + "keyboard_name": "Thumb Trackball", + "manufacturer": "Ploopy", "url": "www.ploopy.co", "maintainer": "ploopyco", - "manufacturer": "Ploopy Corporation", - "processor": "atmega32u4", - "bootloader": "atmel-dfu", "usb": { "vid": "0x5043", "pid": "0x5C46", + "device_version": "0.0.1", "max_power": 100 }, + "bootmagic": { + "matrix": [0, 3] + }, "features": { "bootmagic": true, - "command": false, - "console": false, "extrakey": true, "mousekey": true, - "nkro": true, + "nkro": false, "pointing_device": true, "encoder": true }, diff --git a/keyboards/ploopyco/trackball_thumb/post_rules.mk b/keyboards/ploopyco/trackball_thumb/post_rules.mk new file mode 100644 index 000000000000..0d1a00b89e06 --- /dev/null +++ b/keyboards/ploopyco/trackball_thumb/post_rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 \ No newline at end of file diff --git a/keyboards/ploopyco/trackball_thumb/readme.md b/keyboards/ploopyco/trackball_thumb/readme.md index 8299c0880946..bb870d2003c3 100644 --- a/keyboards/ploopyco/trackball_thumb/readme.md +++ b/keyboards/ploopyco/trackball_thumb/readme.md @@ -3,13 +3,13 @@ It's a DIY, QMK Powered Trackball...for thumb ballers! * Keyboard Maintainer: [PloopyCo](https://github.com/ploopyco), [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/) -* Hardware Supported: ATMega32u4 8MHz(3.3v) +* Hardware Supported: ATMega32u4 8MHz(3.3v), Raspberry RP2040 * Hardware Availability: [Store](https://ploopy.co), [GitHub](https://github.com/ploopyco) Make example for this keyboard (after setting up your build environment): make ploopyco/trackball_thumb/rev1_001:default:flash - + To jump to the bootloader, hold down "Button 4" (button closest to the USB port). See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/ploopyco/trackball_thumb/rev1_001/config.h b/keyboards/ploopyco/trackball_thumb/rev1_001/config.h index a648e8e8e4cb..108a104cdc15 100644 --- a/keyboards/ploopyco/trackball_thumb/rev1_001/config.h +++ b/keyboards/ploopyco/trackball_thumb/rev1_001/config.h @@ -22,3 +22,9 @@ // They are set as output and pulled high, by default #define UNUSABLE_PINS \ { D1, D3, B4, B7, D6, C7, F6, F5, F3, F7 } + +/* PMW33XX Settings */ +#define PMW33XX_CS_PIN B0 + +#define ENCODER_A_PINS { F0 } +#define ENCODER_B_PINS { F4 } diff --git a/keyboards/ploopyco/trackball_thumb/rev1_001/keyboard.json b/keyboards/ploopyco/trackball_thumb/rev1_001/keyboard.json index db12ee6217f4..04457f19b9f2 100644 --- a/keyboards/ploopyco/trackball_thumb/rev1_001/keyboard.json +++ b/keyboards/ploopyco/trackball_thumb/rev1_001/keyboard.json @@ -1,13 +1,14 @@ { - "usb": { - "device_version": "1.0.0" - }, - "diode_direction": "COL2ROW", + "processor": "atmega32u4", + "bootloader": "atmel-dfu", "matrix_pins": { "direct": [ ["D5", "B6", "D4", "D2", "E6", "D7"] ] }, + "ws2812": { + "pin": "B5" + }, "rgblight": { "led_count": 3, "max_brightness": 40, @@ -16,8 +17,5 @@ "rainbow_mood": true, "rainbow_swirl": true } - }, - "ws2812": { - "pin": "B5" } } diff --git a/keyboards/ploopyco/trackball_thumb/rev1_001/readme.md b/keyboards/ploopyco/trackball_thumb/rev1_001/readme.md index 5a5f0563e76a..658a71df0aa3 100644 --- a/keyboards/ploopyco/trackball_thumb/rev1_001/readme.md +++ b/keyboards/ploopyco/trackball_thumb/rev1_001/readme.md @@ -1,3 +1,3 @@ -This is the R1.001+ version of the Thumb. Future versions may have other features. +See the [main readme](../readme.md) for more details. -See the [main readme](../readme.md) for more details. +This is for the R1.001 version of the Thumb. It's easily distinguishable from the R1.002+ versions of the Thumb because it has an ATmega32u4 on the board. \ No newline at end of file diff --git a/keyboards/ploopyco/trackball_thumb/rev1_001/rules.mk b/keyboards/ploopyco/trackball_thumb/rev1_001/rules.mk new file mode 100644 index 000000000000..3437a35bdf1d --- /dev/null +++ b/keyboards/ploopyco/trackball_thumb/rev1_001/rules.mk @@ -0,0 +1,2 @@ +# Processor frequency +F_CPU = 8000000 diff --git a/keyboards/ploopyco/trackball_thumb/rev1_002/config.h b/keyboards/ploopyco/trackball_thumb/rev1_002/config.h new file mode 100644 index 000000000000..e25f50604e7c --- /dev/null +++ b/keyboards/ploopyco/trackball_thumb/rev1_002/config.h @@ -0,0 +1,32 @@ +/* Copyright 2024 Colin Lam (Ploopy Corporation) + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * Copyright 2019 Sunjun Kim + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define UNUSABLE_PINS \ + { GP1, GP3, GP4, GP6, GP8, GP10, GP11, GP14, GP18, GP20, GP22, GP24, GP25, GP27, GP29 } + +/* PMW3360 Settings */ +#define PMW33XX_LIFTOFF_DISTANCE 0x00 +#define PMW33XX_CS_PIN GP5 +#define SPI_SCK_PIN GP2 +#define SPI_MISO_PIN GP0 +#define SPI_MOSI_PIN GP7 + +#define ENCODER_A_PINS { GP28 } +#define ENCODER_B_PINS { GP26 } diff --git a/keyboards/ploopyco/trackball_thumb/rev1_002/keyboard.json b/keyboards/ploopyco/trackball_thumb/rev1_002/keyboard.json new file mode 100644 index 000000000000..a3a50a536e51 --- /dev/null +++ b/keyboards/ploopyco/trackball_thumb/rev1_002/keyboard.json @@ -0,0 +1,25 @@ +{ + "processor": "RP2040", + "bootloader": "rp2040", + "usb": { + "device_version": "1.0.0" + }, + "diode_direction": "COL2ROW", + "matrix_pins": { + "direct": [ + ["GP17", "GP16", "GP15", "GP21", "GP23", "GP19"] + ] + }, + "rgblight": { + "led_count": 1, + "max_brightness": 40, + "animations": { + "breathing": true, + "rainbow_mood": true, + "rainbow_swirl": true + } + }, + "ws2812": { + "pin": "GP12" + } +} diff --git a/keyboards/ploopyco/trackball_thumb/rev1_002/readme.md b/keyboards/ploopyco/trackball_thumb/rev1_002/readme.md new file mode 100644 index 000000000000..c1e95d9a8e76 --- /dev/null +++ b/keyboards/ploopyco/trackball_thumb/rev1_002/readme.md @@ -0,0 +1,3 @@ +See the [main readme](../readme.md) for more details. + +This is for the R1.002+ version of the Thumb. It's easily distinguishable from the previous versions of the Thumb because it has an RP2040 on the board. diff --git a/keyboards/ploopyco/trackball_thumb/rules.mk b/keyboards/ploopyco/trackball_thumb/rules.mk deleted file mode 100644 index 0bd44d316a38..000000000000 --- a/keyboards/ploopyco/trackball_thumb/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Processor frequency -F_CPU = 8000000 - -POINTING_DEVICE_DRIVER = pmw3360 - -DEFAULT_FOLDER = ploopyco/trackball_thumb/rev1_001 diff --git a/keyboards/polilla/rules.mk b/keyboards/polilla/rules.mk deleted file mode 100644 index 0d72c40bb6a3..000000000000 --- a/keyboards/polilla/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = polilla/rev1 \ No newline at end of file diff --git a/keyboards/primekb/meridian/rules.mk b/keyboards/primekb/meridian/rules.mk deleted file mode 100644 index 585a04ad2873..000000000000 --- a/keyboards/primekb/meridian/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = primekb/meridian/ktr1010 diff --git a/keyboards/primekb/prime_e/rules.mk b/keyboards/primekb/prime_e/rules.mk deleted file mode 100644 index debb966e0d10..000000000000 --- a/keyboards/primekb/prime_e/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = primekb/prime_e/std diff --git a/keyboards/primekb/prime_l/rules.mk b/keyboards/primekb/prime_l/rules.mk deleted file mode 100644 index 235bfea92592..000000000000 --- a/keyboards/primekb/prime_l/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = primekb/prime_l/v1 diff --git a/keyboards/program_yoink/rules.mk b/keyboards/program_yoink/rules.mk deleted file mode 100644 index a7cc1a2dbf25..000000000000 --- a/keyboards/program_yoink/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = program_yoink/staggered diff --git a/keyboards/projectcain/vault35/rules.mk b/keyboards/projectcain/vault35/rules.mk deleted file mode 100644 index 3cf3a331d8d4..000000000000 --- a/keyboards/projectcain/vault35/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = projectcain/vault35/atmega32u4 diff --git a/keyboards/projectd/65/projectd_65_ansi/config.h b/keyboards/projectd/65/projectd_65_ansi/config.h index c8da5c42a7cc..6e23afc90201 100644 --- a/keyboards/projectd/65/projectd_65_ansi/config.h +++ b/keyboards/projectd/65/projectd_65_ansi/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_EN_PIN C13 diff --git a/keyboards/projectd/75/ansi/config.h b/keyboards/projectd/75/ansi/config.h index 282e20a8e2bf..acbe853949c9 100644 --- a/keyboards/projectd/75/ansi/config.h +++ b/keyboards/projectd/75/ansi/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_CS_PIN_2 B15 diff --git a/keyboards/projectd/75/iso/config.h b/keyboards/projectd/75/iso/config.h index 282e20a8e2bf..acbe853949c9 100644 --- a/keyboards/projectd/75/iso/config.h +++ b/keyboards/projectd/75/iso/config.h @@ -22,8 +22,11 @@ /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 +#define SPI_SCK_PAL_MODE 5 #define SPI_MOSI_PIN A7 +#define SPI_MOSI_PAL_MODE 5 #define SPI_MISO_PIN A6 +#define SPI_MISO_PAL_MODE 5 #define AW20216S_CS_PIN_1 A15 #define AW20216S_CS_PIN_2 B15 diff --git a/keyboards/projectkb/alice/rules.mk b/keyboards/projectkb/alice/rules.mk deleted file mode 100644 index d6725769928b..000000000000 --- a/keyboards/projectkb/alice/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = projectkb/alice/rev1 diff --git a/keyboards/qpockets/space_space/rules.mk b/keyboards/qpockets/space_space/rules.mk deleted file mode 100644 index 0ffe2efbf25e..000000000000 --- a/keyboards/qpockets/space_space/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = qpockets/space_space/rev2 diff --git a/keyboards/qwertyydox/rules.mk b/keyboards/qwertyydox/rules.mk deleted file mode 100644 index 688444b56638..000000000000 --- a/keyboards/qwertyydox/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = qwertyydox/rev1 diff --git a/keyboards/rate/pistachio/rules.mk b/keyboards/rate/pistachio/rules.mk deleted file mode 100644 index a5f44853163a..000000000000 --- a/keyboards/rate/pistachio/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rate/pistachio/rev2 diff --git a/keyboards/recompile_keys/choco60/rules.mk b/keyboards/recompile_keys/choco60/rules.mk deleted file mode 100644 index 6abfd34d4730..000000000000 --- a/keyboards/recompile_keys/choco60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = recompile_keys/choco60/rev1 diff --git a/keyboards/recompile_keys/nomu30/rules.mk b/keyboards/recompile_keys/nomu30/rules.mk deleted file mode 100644 index 431b619249b4..000000000000 --- a/keyboards/recompile_keys/nomu30/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = recompile_keys/nomu30/rev1 diff --git a/keyboards/redox/rev1/rules.mk b/keyboards/redox/rev1/rules.mk deleted file mode 100644 index c971da1680bc..000000000000 --- a/keyboards/redox/rev1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = redox/rev1/base diff --git a/keyboards/rgbkb/mun/rules.mk b/keyboards/rgbkb/mun/rules.mk deleted file mode 100644 index 317c4d5a870a..000000000000 --- a/keyboards/rgbkb/mun/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rgbkb/mun/rev1 diff --git a/keyboards/rgbkb/pan/rev1/32a/rules.mk b/keyboards/rgbkb/pan/rev1/32a/rules.mk index c2ee0bc86f97..f54ef3e9878a 100644 --- a/keyboards/rgbkb/pan/rev1/32a/rules.mk +++ b/keyboards/rgbkb/pan/rev1/32a/rules.mk @@ -1,2 +1,4 @@ # Processor frequency F_CPU = 16000000 + +WS2812_DRIVER_REQUIRED = yes diff --git a/keyboards/rgbkb/pan/rev1/proton_c/rules.mk b/keyboards/rgbkb/pan/rev1/proton_c/rules.mk new file mode 100644 index 000000000000..9a696492896d --- /dev/null +++ b/keyboards/rgbkb/pan/rev1/proton_c/rules.mk @@ -0,0 +1 @@ +WS2812_DRIVER_REQUIRED = yes diff --git a/keyboards/rgbkb/pan/rev1/rules.mk b/keyboards/rgbkb/pan/rev1/rules.mk deleted file mode 100644 index 4d3c0f6679a0..000000000000 --- a/keyboards/rgbkb/pan/rev1/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# The default configuration is a atmega32a -DEFAULT_FOLDER = rgbkb/pan/rev1/32a diff --git a/keyboards/rgbkb/pan/rules.mk b/keyboards/rgbkb/pan/rules.mk deleted file mode 100644 index b6f1d46a6535..000000000000 --- a/keyboards/rgbkb/pan/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -WS2812_DRIVER_REQUIRED = yes - -DEFAULT_FOLDER = rgbkb/pan/rev1 diff --git a/keyboards/rgbkb/sol/rules.mk b/keyboards/rgbkb/sol/rules.mk deleted file mode 100644 index f8325017f98b..000000000000 --- a/keyboards/rgbkb/sol/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rgbkb/sol/rev2 diff --git a/keyboards/rgbkb/sol3/rev1/keyboard.json b/keyboards/rgbkb/sol3/rev1/keyboard.json index a81ea7bc2123..775e3f86297c 100644 --- a/keyboards/rgbkb/sol3/rev1/keyboard.json +++ b/keyboards/rgbkb/sol3/rev1/keyboard.json @@ -153,6 +153,8 @@ "pin": "A9" }, "transport": { + "watchdog": true, + "watchdog_timeout": 20000, "sync": { "indicators": true, "layer_state": true, diff --git a/keyboards/rgbkb/sol3/rules.mk b/keyboards/rgbkb/sol3/rules.mk deleted file mode 100644 index 74804682a260..000000000000 --- a/keyboards/rgbkb/sol3/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rgbkb/sol3/rev1 diff --git a/keyboards/rgbkb/zen/rules.mk b/keyboards/rgbkb/zen/rules.mk deleted file mode 100644 index ee94832d4d25..000000000000 --- a/keyboards/rgbkb/zen/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rgbkb/zen/rev2 diff --git a/keyboards/rgbkb/zygomorph/rules.mk b/keyboards/rgbkb/zygomorph/rules.mk deleted file mode 100644 index 8544e8767d50..000000000000 --- a/keyboards/rgbkb/zygomorph/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rgbkb/zygomorph/rev1 diff --git a/keyboards/rmi_kb/herringbone/rules.mk b/keyboards/rmi_kb/herringbone/rules.mk deleted file mode 100644 index 1efe9fa4f5eb..000000000000 --- a/keyboards/rmi_kb/herringbone/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rmi_kb/herringbone/v1 diff --git a/keyboards/rmi_kb/mona/rules.mk b/keyboards/rmi_kb/mona/rules.mk deleted file mode 100644 index 54aa705d96d5..000000000000 --- a/keyboards/rmi_kb/mona/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rmi_kb/mona/v1_1 diff --git a/keyboards/rmi_kb/tkl_ff/rules.mk b/keyboards/rmi_kb/tkl_ff/rules.mk deleted file mode 100644 index c8847cc266c1..000000000000 --- a/keyboards/rmi_kb/tkl_ff/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rmi_kb/tkl_ff/v1 diff --git a/keyboards/rmi_kb/wete/rules.mk b/keyboards/rmi_kb/wete/rules.mk deleted file mode 100644 index cda6fbfbe496..000000000000 --- a/keyboards/rmi_kb/wete/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rmi_kb/wete/v2 diff --git a/keyboards/rookiebwoy/late9/rules.mk b/keyboards/rookiebwoy/late9/rules.mk deleted file mode 100755 index 358facb3caad..000000000000 --- a/keyboards/rookiebwoy/late9/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rookiebwoy/late9/rev1 diff --git a/keyboards/rookiebwoy/neopad/rules.mk b/keyboards/rookiebwoy/neopad/rules.mk deleted file mode 100755 index c34c04435e37..000000000000 --- a/keyboards/rookiebwoy/neopad/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rookiebwoy/neopad/rev1 diff --git a/keyboards/rura66/rules.mk b/keyboards/rura66/rules.mk deleted file mode 100644 index 556ec1765591..000000000000 --- a/keyboards/rura66/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = rura66/rev1 diff --git a/keyboards/salicylic_acid3/7skb/rules.mk b/keyboards/salicylic_acid3/7skb/rules.mk deleted file mode 100644 index 15364c29a511..000000000000 --- a/keyboards/salicylic_acid3/7skb/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/7skb/rev1 diff --git a/keyboards/salicylic_acid3/getta25/rules.mk b/keyboards/salicylic_acid3/getta25/rules.mk deleted file mode 100644 index 069fe74b1424..000000000000 --- a/keyboards/salicylic_acid3/getta25/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/getta25/rev1 diff --git a/keyboards/salicylic_acid3/jisplit89/rules.mk b/keyboards/salicylic_acid3/jisplit89/rules.mk deleted file mode 100644 index d54d2ccef4d3..000000000000 --- a/keyboards/salicylic_acid3/jisplit89/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/jisplit89/rev1 diff --git a/keyboards/salicylic_acid3/naked48/rules.mk b/keyboards/salicylic_acid3/naked48/rules.mk deleted file mode 100644 index dadfa7a2579b..000000000000 --- a/keyboards/salicylic_acid3/naked48/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/naked48/rev1 diff --git a/keyboards/salicylic_acid3/naked60/rules.mk b/keyboards/salicylic_acid3/naked60/rules.mk deleted file mode 100644 index 904309ea3568..000000000000 --- a/keyboards/salicylic_acid3/naked60/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/naked60/rev1 diff --git a/keyboards/salicylic_acid3/naked64/rules.mk b/keyboards/salicylic_acid3/naked64/rules.mk deleted file mode 100644 index 0ac8d83bfcc2..000000000000 --- a/keyboards/salicylic_acid3/naked64/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/naked64/rev1 diff --git a/keyboards/salicylic_acid3/setta21/rules.mk b/keyboards/salicylic_acid3/setta21/rules.mk deleted file mode 100644 index 02e68b574873..000000000000 --- a/keyboards/salicylic_acid3/setta21/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = salicylic_acid3/setta21/rev1 diff --git a/keyboards/sawnsprojects/okayu/rules.mk b/keyboards/sawnsprojects/okayu/rules.mk deleted file mode 100644 index 59655554eb2c..000000000000 --- a/keyboards/sawnsprojects/okayu/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = sawnsprojects/okayu/stm32f072 \ No newline at end of file diff --git a/keyboards/sharkoon/skiller_sgk50_s4/keyboard.json b/keyboards/sharkoon/skiller_sgk50_s4/keyboard.json index 7d36616e52b9..b7a628fd7856 100644 --- a/keyboards/sharkoon/skiller_sgk50_s4/keyboard.json +++ b/keyboards/sharkoon/skiller_sgk50_s4/keyboard.json @@ -21,7 +21,7 @@ "rgb_matrix": true }, "matrix_pins": { - "cols": ["C0", "C1", "C2", "C3", "A6", "B1", "B10", "B11", "B12", "B13", "B14", "B15", "C6", "C7"], + "cols": ["C0", "C1", "C2", "C3", "A6", "B1", "B10", "B11", "B12", "B13", "B14", "C6", "C7", "C8", "C9", "A8"], "rows": ["A0", "A1", "A2", "A3", "C13"] }, "processor": "WB32FQ95", @@ -77,11 +77,15 @@ "driver": "ws2812", "layout": [ {"matrix": [4, 6], "x": 103, "y": 64, "flags": 4}, + {"matrix": [4, 9], "x": 154, "y": 64, "flags": 4}, {"matrix": [4, 10], "x": 172, "y": 64, "flags": 4}, {"matrix": [4, 11], "x": 190, "y": 64, "flags": 4}, {"matrix": [4, 12], "x": 207, "y": 64, "flags": 4}, - {"matrix": [4, 13], "x": 224, "y": 64, "flags": 4}, - {"matrix": [3, 13], "x": 224, "y": 48, "flags": 4}, + {"matrix": [4, 15], "x": 224, "y": 64, "flags": 4}, + {"matrix": [3, 15], "x": 224, "y": 48, "flags": 4}, + {"matrix": [3, 14], "x": 224, "y": 48, "flags": 4}, + {"matrix": [3, 13], "x": 210, "y": 48, "flags": 4}, + {"matrix": [3, 12], "x": 200, "y": 48, "flags": 4}, {"matrix": [3, 11], "x": 190, "y": 48, "flags": 4}, {"matrix": [3, 10], "x": 172, "y": 48, "flags": 4}, {"matrix": [3, 9], "x": 155, "y": 48, "flags": 4}, @@ -93,6 +97,7 @@ {"matrix": [3, 3], "x": 52, "y": 48, "flags": 4}, {"matrix": [3, 2], "x": 34, "y": 48, "flags": 4}, {"matrix": [3, 1], "x": 17, "y": 48, "flags": 4}, + {"matrix": [4, 3], "x": 52, "y": 64, "flags": 4}, {"matrix": [4, 2], "x": 34, "y": 64, "flags": 4}, {"matrix": [4, 1], "x": 17, "y": 64, "flags": 4}, {"matrix": [4, 0], "x": 0, "y": 64, "flags": 4}, @@ -109,8 +114,10 @@ {"matrix": [2, 9], "x": 155, "y": 32, "flags": 4}, {"matrix": [2, 10], "x": 172, "y": 32, "flags": 4}, {"matrix": [2, 11], "x": 190, "y": 32, "flags": 4}, - {"matrix": [2, 13], "x": 207, "y": 32, "flags": 4}, - {"matrix": [2, 12], "x": 224, "y": 16, "flags": 4}, + {"matrix": [2, 12], "x": 200, "y": 32, "flags": 4}, + {"matrix": [2, 13], "x": 224, "y": 32, "flags": 4}, + {"matrix": [1, 14], "x": 224, "y": 16, "flags": 4}, + {"matrix": [1, 13], "x": 224, "y": 16, "flags": 4}, {"matrix": [1, 12], "x": 207, "y": 16, "flags": 4}, {"matrix": [1, 11], "x": 190, "y": 16, "flags": 4}, {"matrix": [1, 10], "x": 172, "y": 16, "flags": 4}, @@ -137,7 +144,9 @@ {"matrix": [0, 10], "x": 172, "y": 0, "flags": 4}, {"matrix": [0, 11], "x": 190, "y": 0, "flags": 4}, {"matrix": [0, 12], "x": 207, "y": 0, "flags": 4}, - {"matrix": [0, 13], "x": 224, "y": 0, "flags": 4} + {"matrix": [0, 13], "x": 210, "y": 0, "flags": 4}, + {"matrix": [0, 14], "x": 210, "y": 0, "flags": 4}, + {"matrix": [0, 15], "x": 224, "y": 0, "flags": 4} ], "max_brightness": 110, "sleep": true, @@ -145,13 +154,13 @@ }, "url": "", "usb": { - "device_version": "1.0.0", + "device_version": "1.1.0", "pid": "0x1020", "suspend_wakeup_delay": 1000, "vid": "0x6332" }, "ws2812": { - "pin": "A8" + "pin": "B15" }, "community_layouts": ["60_ansi", "60_iso"], "layouts": { @@ -170,7 +179,9 @@ {"matrix": [0, 10], "x": 10, "y": 0}, {"matrix": [0, 11], "x": 11, "y": 0}, {"matrix": [0, 12], "x": 12, "y": 0}, - {"matrix": [0, 13], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 13], "x": 13, "y": 0, "w": 0.5}, + {"matrix": [0, 14], "x": 13.5, "y": 0}, + {"matrix": [0, 15], "x": 14.5, "y": 0, "w": 0.5}, {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, {"matrix": [1, 1], "x": 1.5, "y": 1}, {"matrix": [1, 2], "x": 2.5, "y": 1}, @@ -184,7 +195,8 @@ {"matrix": [1, 10], "x": 10.5, "y": 1}, {"matrix": [1, 11], "x": 11.5, "y": 1}, {"matrix": [1, 12], "x": 12.5, "y": 1}, - {"matrix": [2, 12], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 13], "x": 13.5, "y": 1}, + {"matrix": [1, 14], "x": 14.5, "y": 1, "w": 0.5}, {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, {"matrix": [2, 1], "x": 1.75, "y": 2}, {"matrix": [2, 2], "x": 2.75, "y": 2}, @@ -197,28 +209,34 @@ {"matrix": [2, 9], "x": 9.75, "y": 2}, {"matrix": [2, 10], "x": 10.75, "y": 2}, {"matrix": [2, 11], "x": 11.75, "y": 2}, - {"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25}, - {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, - {"matrix": [3, 1], "x": 1.25, "y": 3}, - {"matrix": [3, 2], "x": 2.25, "y": 3}, - {"matrix": [3, 3], "x": 3.25, "y": 3}, - {"matrix": [3, 4], "x": 4.25, "y": 3}, - {"matrix": [3, 5], "x": 5.25, "y": 3}, - {"matrix": [3, 6], "x": 6.25, "y": 3}, - {"matrix": [3, 7], "x": 7.25, "y": 3}, - {"matrix": [3, 8], "x": 8.25, "y": 3}, - {"matrix": [3, 9], "x": 9.25, "y": 3}, - {"matrix": [3, 10], "x": 10.25, "y": 3}, - {"matrix": [3, 11], "x": 11.25, "y": 3}, - {"matrix": [3, 13], "x": 12.25, "y": 3, "w": 2.75}, + {"matrix": [2, 12], "x": 12.75, "y": 2}, + {"matrix": [2, 13], "x": 13.75, "y": 2, "w": 1.25}, + {"matrix": [3, 0], "x": 0, "y": 3, "w": 0.75}, + {"matrix": [3, 1], "x": 0.75, "y": 3, "w": 0.5}, + {"matrix": [3, 2], "x": 1.25, "y": 3}, + {"matrix": [3, 3], "x": 2.25, "y": 3}, + {"matrix": [3, 4], "x": 3.25, "y": 3}, + {"matrix": [3, 5], "x": 4.25, "y": 3}, + {"matrix": [3, 6], "x": 5.25, "y": 3}, + {"matrix": [3, 7], "x": 6.25, "y": 3}, + {"matrix": [3, 8], "x": 7.25, "y": 3}, + {"matrix": [3, 9], "x": 8.25, "y": 3}, + {"matrix": [3, 10], "x": 9.25, "y": 3}, + {"matrix": [3, 11], "x": 10.25, "y": 3}, + {"matrix": [3, 12], "x": 11.25, "y": 3}, + {"matrix": [3, 13], "x": 12.25, "y": 3}, + {"matrix": [3, 14], "x": 13.25, "y": 3, "w": 0.75}, + {"matrix": [3, 15], "x": 14, "y": 3}, {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, - {"matrix": [4, 6], "x": 3.75, "y": 4, "w": 6.25}, + {"matrix": [4, 3], "x": 3.75, "y": 4}, + {"matrix": [4, 6], "x": 4.75, "y": 4, "w": 4.25}, + {"matrix": [4, 9], "x": 9, "y": 4}, {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, {"matrix": [4, 12], "x": 12.5, "y": 4, "w": 1.25}, - {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25} + {"matrix": [4, 15], "x": 13.75, "y": 4, "w": 1.25} ] }, "LAYOUT_60_ansi": { @@ -236,7 +254,7 @@ {"matrix": [0, 10], "x": 10, "y": 0}, {"matrix": [0, 11], "x": 11, "y": 0}, {"matrix": [0, 12], "x": 12, "y": 0}, - {"matrix": [0, 13], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 14], "x": 13, "y": 0, "w": 2}, {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, {"matrix": [1, 1], "x": 1.5, "y": 1}, {"matrix": [1, 2], "x": 2.5, "y": 1}, @@ -250,7 +268,7 @@ {"matrix": [1, 10], "x": 10.5, "y": 1}, {"matrix": [1, 11], "x": 11.5, "y": 1}, {"matrix": [1, 12], "x": 12.5, "y": 1}, - {"matrix": [2, 12], "x": 13.5, "y": 1, "w": 1.5}, + {"matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5}, {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, {"matrix": [2, 1], "x": 1.75, "y": 2}, {"matrix": [2, 2], "x": 2.75, "y": 2}, @@ -264,18 +282,18 @@ {"matrix": [2, 10], "x": 10.75, "y": 2}, {"matrix": [2, 11], "x": 11.75, "y": 2}, {"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25}, - {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, - {"matrix": [3, 2], "x": 2.25, "y": 3}, - {"matrix": [3, 3], "x": 3.25, "y": 3}, - {"matrix": [3, 4], "x": 4.25, "y": 3}, - {"matrix": [3, 5], "x": 5.25, "y": 3}, - {"matrix": [3, 6], "x": 6.25, "y": 3}, - {"matrix": [3, 7], "x": 7.25, "y": 3}, - {"matrix": [3, 8], "x": 8.25, "y": 3}, - {"matrix": [3, 9], "x": 9.25, "y": 3}, - {"matrix": [3, 10], "x": 10.25, "y": 3}, - {"matrix": [3, 11], "x": 11.25, "y": 3}, - {"matrix": [3, 13], "x": 12.25, "y": 3, "w": 2.75}, + {"matrix": [3, 1], "x": 0, "y": 3, "w": 2.25}, + {"matrix": [3, 3], "x": 2.25, "y": 3}, + {"matrix": [3, 4], "x": 3.25, "y": 3}, + {"matrix": [3, 5], "x": 4.25, "y": 3}, + {"matrix": [3, 6], "x": 5.25, "y": 3}, + {"matrix": [3, 7], "x": 6.25, "y": 3}, + {"matrix": [3, 8], "x": 7.25, "y": 3}, + {"matrix": [3, 9], "x": 8.25, "y": 3}, + {"matrix": [3, 10], "x": 9.25, "y": 3}, + {"matrix": [3, 11], "x": 10.25, "y": 3}, + {"matrix": [3, 12], "x": 11.25, "y": 3}, + {"matrix": [3, 14], "x": 12.25, "y": 3, "w": 2.75}, {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, @@ -283,7 +301,7 @@ {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, {"matrix": [4, 12], "x": 12.5, "y": 4, "w": 1.25}, - {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25} + {"matrix": [4, 15], "x": 13.75, "y": 4, "w": 1.25} ] }, "LAYOUT_60_iso": { @@ -301,7 +319,7 @@ {"matrix": [0, 10], "x": 10, "y": 0}, {"matrix": [0, 11], "x": 11, "y": 0}, {"matrix": [0, 12], "x": 12, "y": 0}, - {"matrix": [0, 13], "x": 13, "y": 0, "w": 2}, + {"matrix": [0, 14], "x": 13, "y": 0, "w": 2}, {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, {"matrix": [1, 1], "x": 1.5, "y": 1}, {"matrix": [1, 2], "x": 2.5, "y": 1}, @@ -328,20 +346,20 @@ {"matrix": [2, 10], "x": 10.75, "y": 2}, {"matrix": [2, 11], "x": 11.75, "y": 2}, {"matrix": [2, 12], "x": 12.75, "y": 2}, - {"matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, + {"matrix": [1, 14], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, - {"matrix": [3, 1], "x": 1.25, "y": 3}, - {"matrix": [3, 2], "x": 2.25, "y": 3}, - {"matrix": [3, 3], "x": 3.25, "y": 3}, - {"matrix": [3, 4], "x": 4.25, "y": 3}, - {"matrix": [3, 5], "x": 5.25, "y": 3}, - {"matrix": [3, 6], "x": 6.25, "y": 3}, - {"matrix": [3, 7], "x": 7.25, "y": 3}, - {"matrix": [3, 8], "x": 8.25, "y": 3}, - {"matrix": [3, 9], "x": 9.25, "y": 3}, - {"matrix": [3, 10], "x": 10.25, "y": 3}, - {"matrix": [3, 11], "x": 11.25, "y": 3}, - {"matrix": [3, 13], "x": 12.25, "y": 3, "w": 2.75}, + {"matrix": [3, 2], "x": 1.25, "y": 3}, + {"matrix": [3, 3], "x": 2.25, "y": 3}, + {"matrix": [3, 4], "x": 3.25, "y": 3}, + {"matrix": [3, 5], "x": 4.25, "y": 3}, + {"matrix": [3, 6], "x": 5.25, "y": 3}, + {"matrix": [3, 7], "x": 6.25, "y": 3}, + {"matrix": [3, 8], "x": 7.25, "y": 3}, + {"matrix": [3, 9], "x": 8.25, "y": 3}, + {"matrix": [3, 10], "x": 9.25, "y": 3}, + {"matrix": [3, 11], "x": 10.25, "y": 3}, + {"matrix": [3, 12], "x": 11.25, "y": 3}, + {"matrix": [3, 14], "x": 12.25, "y": 3, "w": 2.75}, {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, @@ -349,7 +367,7 @@ {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, {"matrix": [4, 12], "x": 12.5, "y": 4, "w": 1.25}, - {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25} + {"matrix": [4, 15], "x": 13.75, "y": 4, "w": 1.25} ] } } diff --git a/keyboards/sharkoon/skiller_sgk50_s4/keymaps/default/keymap.c b/keyboards/sharkoon/skiller_sgk50_s4/keymaps/default/keymap.c index a8a64d1f2dc3..9a9e20711380 100644 --- a/keyboards/sharkoon/skiller_sgk50_s4/keymaps/default/keymap.c +++ b/keyboards/sharkoon/skiller_sgk50_s4/keymaps/default/keymap.c @@ -4,18 +4,18 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_all( + [0] = LAYOUT_60_iso( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL ), - [1] = LAYOUT_all( + [1] = LAYOUT_60_iso( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - _______, _______, _______, _______, _______, _______, KC_INS, _______, KC_UP, KC_PAUS, KC_PGUP, KC_HOME, KC_PSCR, RM_VALU, - _______, _______, _______, _______, _______, _______, KC_SCRL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, _______, + _______, _______, _______, _______, _______, _______, KC_INS, _______, KC_UP, KC_PAUS, KC_PGUP, KC_HOME, KC_PSCR, + _______, _______, _______, _______, _______, _______, KC_SCRL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, RM_VALU, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, RM_VALD, _______, _______, GU_TOGG, _______, _______, _______, _______, RM_HUEU, RM_NEXT ) diff --git a/keyboards/silakka54/config.h b/keyboards/silakka54/config.h new file mode 100644 index 000000000000..220b85cd08fa --- /dev/null +++ b/keyboards/silakka54/config.h @@ -0,0 +1,25 @@ +/* Copyright 2024 Juho T. (@Squalius-cephalus) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define SERIAL_USART_FULL_DUPLEX +#define SERIAL_USART_TX_PIN GP0 +#define SERIAL_USART_RX_PIN GP1 + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 diff --git a/keyboards/silakka54/keyboard.json b/keyboards/silakka54/keyboard.json new file mode 100644 index 000000000000..e1ad9aac9ed4 --- /dev/null +++ b/keyboards/silakka54/keyboard.json @@ -0,0 +1,102 @@ +{ + "manufacturer": "Squalius-cephalus", + "keyboard_name": "silakka54", + "maintainer": "Squalius-cephalus", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "split": { + "enabled": true, + "serial": { + "driver": "vendor" + } + }, + "matrix_pins": { + "cols": ["GP7", "GP8", "GP9", "GP10", "GP11", "GP12"], + "rows": ["GP2", "GP3", "GP4", "GP5","GP6"] + }, + "processor": "RP2040", + "url": "https://github.com/Squalius-cephalus/silakka54", + "usb": { + "device_version": "1.0.0", + "pid": "0x1212", + "vid": "0xFEED" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + + {"matrix": [5, 5], "x": 0, "y": 5}, + {"matrix": [5, 4], "x": 1, "y": 5}, + {"matrix": [5, 3], "x": 2, "y": 5}, + {"matrix": [5, 2], "x": 3, "y": 5}, + {"matrix": [5, 1], "x": 4, "y": 5}, + {"matrix": [5, 0], "x": 5, "y": 5}, + + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + + {"matrix": [6, 5], "x": 0, "y": 6}, + {"matrix": [6, 4], "x": 1, "y": 6}, + {"matrix": [6, 3], "x": 2, "y": 6}, + {"matrix": [6, 2], "x": 3, "y": 6}, + {"matrix": [6, 1], "x": 4, "y": 6}, + {"matrix": [6, 0], "x": 5, "y": 6}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + + {"matrix": [7, 5], "x": 0, "y": 7}, + {"matrix": [7, 4], "x": 1, "y": 7}, + {"matrix": [7, 3], "x": 2, "y": 7}, + {"matrix": [7, 2], "x": 3, "y": 7}, + {"matrix": [7, 1], "x": 4, "y": 7}, + {"matrix": [7, 0], "x": 5, "y": 7}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + + {"matrix": [8, 5], "x": 0, "y": 9}, + {"matrix": [8, 4], "x": 1, "y": 9}, + {"matrix": [8, 3], "x": 2, "y": 9}, + {"matrix": [8, 2], "x": 3, "y": 9}, + {"matrix": [8, 1], "x": 4, "y": 9}, + {"matrix": [8, 0], "x": 5, "y": 9}, + + {"matrix": [4, 3], "x": 3, "y": 4}, + {"matrix": [4, 4], "x": 4, "y": 4}, + {"matrix": [4, 5], "x": 5, "y": 4}, + + {"matrix": [9, 5], "x": 3, "y": 9}, + {"matrix": [9, 4], "x": 4, "y": 9}, + {"matrix": [9, 3], "x": 5, "y": 9} + + + ] + } + } +} diff --git a/keyboards/silakka54/keymaps/default/keymap.c b/keyboards/silakka54/keymaps/default/keymap.c new file mode 100644 index 000000000000..aa5e64efa32b --- /dev/null +++ b/keyboards/silakka54/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, MO(1), KC_SPC, KC_ENT, KC_RCTL, KC_RALT + ), + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_HOME, KC_END, KC_DEL, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LBRC, KC_RBRC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/silakka54/readme.md b/keyboards/silakka54/readme.md new file mode 100644 index 000000000000..08a38aa4737a --- /dev/null +++ b/keyboards/silakka54/readme.md @@ -0,0 +1,26 @@ +# Silakka54 + +![Silakka54](https://i.imgur.com/JrsS0kY.png) + +Silakka54 is a RP2040 Zero based 54-key column staggered split keyboard. PCB uses hotswap sockets. Design is inspired from REVIUNG41 and Corne keyboards. + +* Keyboard Maintainer: [Squalius-cephalus](https://github.com/Squalius-cephalus) +* Hardware Supported: Silakka54 PCB +* Hardware Availability: https://github.com/Squalius-cephalus/silakka54 + +Make example for this keyboard (after setting up your build environment): + + make silakka54:default + +Flashing example for this keyboard: + + make silakka54:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Physical boot button**: Hold BOOT button down and connect MCU to the PC +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/skyloong/gk61/pro/config.h b/keyboards/skyloong/gk61/pro/config.h index db02496f8b4f..aeea36e0bccf 100644 --- a/keyboards/skyloong/gk61/pro/config.h +++ b/keyboards/skyloong/gk61/pro/config.h @@ -7,6 +7,3 @@ #define IS31FL3743A_SDB_PIN C1 #define CAPS_LOCK_INDEX 28 -#define WIN_MOD_INDEX 16 -#define MAC_MOD_INDEX 17 -#define WIN_LOCK_INDEX 54 diff --git a/keyboards/skyloong/gk61/pro/pro.c b/keyboards/skyloong/gk61/pro/pro.c index 2299977e0ef8..11411ba2b19e 100644 --- a/keyboards/skyloong/gk61/pro/pro.c +++ b/keyboards/skyloong/gk61/pro/pro.c @@ -1,11 +1,8 @@ // Copyright 2023 linlin012 (@linlin012) // SPDX-License-Identifier: GPL-2.0-or-later #include "quantum.h" -int FN_WIN = 0; -int FN_MAC = 0; -int L_WIN = 0; -int L_MAC = 0; +#if defined(RGB_MATRIX_ENABLE) const is31fl3743a_led_t PROGMEM g_is31fl3743a_leds[IS31FL3743A_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver @@ -83,7 +80,32 @@ const is31fl3743a_led_t PROGMEM g_is31fl3743a_leds[IS31FL3743A_LED_COUNT] = { {0, SW10_CS13, SW10_CS14, SW10_CS15} }; -#if defined(RGB_MATRIX_ENABLE) /*&& defined(CAPS_LOCK_INDEX)*/ +bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { + if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { + return false; + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_INDEX, 255, 255, 255); + } else { + if (!rgb_matrix_get_flags()) { + RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_INDEX, 0, 0, 0); + } + } + + return false; +} + +void suspend_power_down_kb(void) { + gpio_write_pin_low(IS31FL3743A_SDB_PIN); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) { + gpio_write_pin_high(IS31FL3743A_SDB_PIN); + suspend_wakeup_init_user(); +} +#endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { if (!process_record_user(keycode, record)) { @@ -105,124 +127,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { } return false; # endif - case TO(0): - if (record->event.pressed) { - L_WIN = 1; - set_single_persistent_default_layer(0); // Save default layer 0 to eeprom - } else { - L_WIN = 0; - } - return true; // continue all further processing of this key - - case MO(2): - if (record->event.pressed) { - FN_WIN = 1; - } else { - FN_WIN = 0; - } - return true; // continue all further processing of this key - - case TO(1): - if (record->event.pressed) { - L_MAC = 1; - set_single_persistent_default_layer(1); //Save default layer 1 to eeprom - } else { - L_MAC = 0; - } - return true; // continue all further processing of this key - - case MO(3): - if (record->event.pressed) { - FN_MAC = 1; - } else { - FN_MAC = 0; - } - return true; // continue all further processing of this key - default: - return true; - } - -} - -bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { - if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { - return false; - } - - if (host_keyboard_led_state().caps_lock) { - RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_INDEX, 255, 255, 255); - } else { - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_INDEX, 0, 0, 0); - } - } - - switch (get_highest_layer(layer_state)) { - case 0:{ - if (L_WIN) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - }else{ - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - } - } - } break; - - case 1:{ - if (L_MAC) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - } - }else{ - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - } - } break; - - - case 2:{ - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - } break; - - case 3:{ - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - } - } break; - - default:{ - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - } } - return false; -} - -#endif -void suspend_power_down_kb() { -# ifdef RGB_MATRIX_ENABLE - gpio_write_pin_low(IS31FL3743A_SDB_PIN); -# endif - suspend_power_down_user(); -} - -void suspend_wakeup_init_kb() { -# ifdef RGB_MATRIX_ENABLE - gpio_write_pin_high(IS31FL3743A_SDB_PIN); -# endif - suspend_wakeup_init_user(); + return true; } void board_init(void) { diff --git a/keyboards/skyloong/gk61/pro_48/config.h b/keyboards/skyloong/gk61/pro_48/config.h index 5b4976e2dadc..7e45ac83543c 100644 --- a/keyboards/skyloong/gk61/pro_48/config.h +++ b/keyboards/skyloong/gk61/pro_48/config.h @@ -7,7 +7,3 @@ #define IS31FL3743A_SDB_PIN A4 #define CAPS_LOCK_INDEX 28 -#define WIN_MOD_INDEX 16 -#define MAC_MOD_INDEX 17 - -#define g_suspend_state rgb_matrix_get_suspend_state() diff --git a/keyboards/skyloong/gk61/pro_48/pro_48.c b/keyboards/skyloong/gk61/pro_48/pro_48.c index 6da76a176701..11411ba2b19e 100644 --- a/keyboards/skyloong/gk61/pro_48/pro_48.c +++ b/keyboards/skyloong/gk61/pro_48/pro_48.c @@ -1,12 +1,8 @@ // Copyright 2023 linlin012 (@linlin012) // SPDX-License-Identifier: GPL-2.0-or-later #include "quantum.h" -_Bool FN_WIN = 0; -_Bool FN_MAC = 0; -_Bool L_WIN = 0; -_Bool L_MAC = 0; -#if defined(RGB_MATRIX_ENABLE) /*&& defined(CAPS_LOCK_INDEX)*/ +#if defined(RGB_MATRIX_ENABLE) const is31fl3743a_led_t PROGMEM g_is31fl3743a_leds[IS31FL3743A_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver @@ -97,57 +93,9 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { } } - switch (get_highest_layer(layer_state)) { - case 2:{ - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - } break; - case 3:{ - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - } - } break; - - case 0:{ - if (L_WIN) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - }else{ - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - } - } - } break; - - case 1:{ - if (L_MAC) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255); - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - } - }else{ - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - } - } break; - - default:{ - if (!rgb_matrix_get_flags()) { - RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0); - RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0); - } - } - } return false; } - void suspend_power_down_kb(void) { gpio_write_pin_low(IS31FL3743A_SDB_PIN); suspend_power_down_user(); @@ -177,44 +125,11 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { } break; } } - return false; + return false; # endif - case TO(0): - if (record->event.pressed) { - L_WIN = 1; - set_single_persistent_default_layer(0); // Save default layer 0 to eeprom - } else { - L_WIN = 0; - } - return true; // continue all further processing of this key - - case MO(2): - if (record->event.pressed) { - FN_WIN = 1; - } else { - FN_WIN = 0; - } - return true; // continue all further processing of this key - - case TO(1): - if (record->event.pressed) { - L_MAC = 1; - set_single_persistent_default_layer(1); //Save default layer 1 to eeprom - } else { - L_MAC = 0; - } - return true; // continue all further processing of this key - - case MO(3): - if (record->event.pressed) { - FN_MAC = 1; - } else { - FN_MAC = 0; - } - return true; // continue all further processing of this key - default: - return true; } + + return true; } void board_init(void) { diff --git a/keyboards/smoll/lefty/rules.mk b/keyboards/smoll/lefty/rules.mk deleted file mode 100644 index 6bc5abbdc556..000000000000 --- a/keyboards/smoll/lefty/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = smoll/lefty/rev2 diff --git a/keyboards/sofle/rules.mk b/keyboards/sofle/rules.mk deleted file mode 100644 index a7307c3499e3..000000000000 --- a/keyboards/sofle/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = sofle/rev1 diff --git a/keyboards/spaceholdings/nebula68b/rules.mk b/keyboards/spaceholdings/nebula68b/rules.mk deleted file mode 100644 index 8fe37f83b328..000000000000 --- a/keyboards/spaceholdings/nebula68b/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = spaceholdings/nebula68b/solder diff --git a/keyboards/spacetime/rules.mk b/keyboards/spacetime/rules.mk deleted file mode 100644 index ac339c2cefb0..000000000000 --- a/keyboards/spacetime/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = spacetime/rev1 diff --git a/keyboards/splitkb/aurora/helix/rules.mk b/keyboards/splitkb/aurora/helix/rules.mk deleted file mode 100644 index 8130273c1f9c..000000000000 --- a/keyboards/splitkb/aurora/helix/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = splitkb/aurora/helix/rev1 \ No newline at end of file diff --git a/keyboards/splitkb/aurora/sofle_v2/rules.mk b/keyboards/splitkb/aurora/sofle_v2/rules.mk deleted file mode 100644 index 4a50c4dbb13d..000000000000 --- a/keyboards/splitkb/aurora/sofle_v2/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = splitkb/aurora/sofle_v2/rev1 \ No newline at end of file diff --git a/keyboards/splitkb/kyria/rev1/rules.mk b/keyboards/splitkb/kyria/rev1/rules.mk deleted file mode 100644 index 3a8bfbe08963..000000000000 --- a/keyboards/splitkb/kyria/rev1/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = splitkb/kyria/rev1/base diff --git a/keyboards/splitkb/kyria/rev2/rules.mk b/keyboards/splitkb/kyria/rev2/rules.mk deleted file mode 100644 index fb808070bf89..000000000000 --- a/keyboards/splitkb/kyria/rev2/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = splitkb/kyria/rev2/base diff --git a/keyboards/splitkb/kyria/rules.mk b/keyboards/splitkb/kyria/rules.mk deleted file mode 100644 index 1342089f56d0..000000000000 --- a/keyboards/splitkb/kyria/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = splitkb/kyria/rev3 diff --git a/keyboards/splitty/rules.mk b/keyboards/splitty/rules.mk deleted file mode 100644 index 68b3198bfba0..000000000000 --- a/keyboards/splitty/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = splitty/rev1 diff --git a/keyboards/studiokestra/galatea/rules.mk b/keyboards/studiokestra/galatea/rules.mk deleted file mode 100644 index b5b1db42388c..000000000000 --- a/keyboards/studiokestra/galatea/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = studiokestra/galatea/rev1 \ No newline at end of file diff --git a/keyboards/takashiski/hecomi/rules.mk b/keyboards/takashiski/hecomi/rules.mk deleted file mode 100644 index 41002fe272f1..000000000000 --- a/keyboards/takashiski/hecomi/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = takashiski/hecomi/alpha diff --git a/keyboards/takashiski/namecard2x4/rules.mk b/keyboards/takashiski/namecard2x4/rules.mk deleted file mode 100644 index f93cfc823d9b..000000000000 --- a/keyboards/takashiski/namecard2x4/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = takashiski/namecard2x4/rev2 diff --git a/keyboards/teleport/native/ansi/rules.mk b/keyboards/teleport/native/ansi/rules.mk new file mode 100644 index 000000000000..942ef4c5dbde --- /dev/null +++ b/keyboards/teleport/native/ansi/rules.mk @@ -0,0 +1 @@ +RGB_MATRIX_CUSTOM_KB = yes diff --git a/keyboards/teleport/native/iso/rules.mk b/keyboards/teleport/native/iso/rules.mk new file mode 100644 index 000000000000..942ef4c5dbde --- /dev/null +++ b/keyboards/teleport/native/iso/rules.mk @@ -0,0 +1 @@ +RGB_MATRIX_CUSTOM_KB = yes diff --git a/keyboards/teleport/native/rules.mk b/keyboards/teleport/native/rules.mk deleted file mode 100644 index 53dc2b174759..000000000000 --- a/keyboards/teleport/native/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -RGB_MATRIX_CUSTOM_KB = yes - -DEFAULT_FOLDER = teleport/native/iso diff --git a/keyboards/tgr/tris/readme.md b/keyboards/tgr/tris/readme.md index c9cc19906964..e01e7decaadd 100644 --- a/keyboards/tgr/tris/readme.md +++ b/keyboards/tgr/tris/readme.md @@ -1,7 +1,5 @@ # TGR Tris/Tris CE -A short description of the keyboard/project - * Keyboard Maintainer: [poisonking](https://github.com/halfenergized) * Hardware Supported: Tris PCB * Hardware Availability: https://geekhack.org/index.php?topic=86221.0 diff --git a/keyboards/themadnoodle/noodlepad/rules.mk b/keyboards/themadnoodle/noodlepad/rules.mk deleted file mode 100644 index 318832e12190..000000000000 --- a/keyboards/themadnoodle/noodlepad/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Default folder for noodlepad -DEFAULT_FOLDER = themadnoodle/noodlepad/v1 - diff --git a/keyboards/tkw/grandiceps/rules.mk b/keyboards/tkw/grandiceps/rules.mk deleted file mode 100644 index ab8aeff26884..000000000000 --- a/keyboards/tkw/grandiceps/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = tkw/grandiceps/rev1 diff --git a/keyboards/tkw/stoutgat/v2/rules.mk b/keyboards/tkw/stoutgat/v2/rules.mk deleted file mode 100644 index 1a660af26c98..000000000000 --- a/keyboards/tkw/stoutgat/v2/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = tkw/stoutgat/v2/f411 diff --git a/keyboards/tominabox1/le_chiffre/rules.mk b/keyboards/tominabox1/le_chiffre/rules.mk deleted file mode 100644 index 57b3d94eabd5..000000000000 --- a/keyboards/tominabox1/le_chiffre/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = tominabox1/le_chiffre/rev1 diff --git a/keyboards/tominabox1/littlefoot_lx/rules.mk b/keyboards/tominabox1/littlefoot_lx/rules.mk deleted file mode 100644 index 4756f7600ff0..000000000000 --- a/keyboards/tominabox1/littlefoot_lx/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = tominabox1/littlefoot_lx/rev1 diff --git a/keyboards/tominabox1/underscore33/rules.mk b/keyboards/tominabox1/underscore33/rules.mk deleted file mode 100644 index b5e13fd4208d..000000000000 --- a/keyboards/tominabox1/underscore33/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = tominabox1/underscore33/rev1 diff --git a/keyboards/trnthsn/e8ghty/rules.mk b/keyboards/trnthsn/e8ghty/rules.mk deleted file mode 100644 index e06e8fe182d0..000000000000 --- a/keyboards/trnthsn/e8ghty/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = trnthsn/e8ghty/stm32f103 diff --git a/keyboards/trnthsn/s6xty5neor2/rules.mk b/keyboards/trnthsn/s6xty5neor2/rules.mk deleted file mode 100644 index 1fc77fba7289..000000000000 --- a/keyboards/trnthsn/s6xty5neor2/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = trnthsn/s6xty5neor2/stm32f103 diff --git a/keyboards/tweetydabird/lotus58/rules.mk b/keyboards/tweetydabird/lotus58/rules.mk deleted file mode 100644 index 4cd2262cc775..000000000000 --- a/keyboards/tweetydabird/lotus58/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = tweetydabird/lotus58/promicro \ No newline at end of file diff --git a/keyboards/unison/rules.mk b/keyboards/unison/rules.mk deleted file mode 100644 index 69c33d71a281..000000000000 --- a/keyboards/unison/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = unison/v04 diff --git a/keyboards/uzu42/rules.mk b/keyboards/uzu42/rules.mk deleted file mode 100644 index 277e74b7153d..000000000000 --- a/keyboards/uzu42/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = uzu42/rev1 diff --git a/keyboards/vitamins_included/rules.mk b/keyboards/vitamins_included/rules.mk deleted file mode 100644 index e3452d41db93..000000000000 --- a/keyboards/vitamins_included/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = vitamins_included/rev2 diff --git a/keyboards/westm/westm68/rev1/rules.mk b/keyboards/westm/westm68/rev1/rules.mk new file mode 100644 index 000000000000..0ab54aaaf718 --- /dev/null +++ b/keyboards/westm/westm68/rev1/rules.mk @@ -0,0 +1,2 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -v FFFF -p FFFF diff --git a/keyboards/westm/westm68/rev2/rules.mk b/keyboards/westm/westm68/rev2/rules.mk new file mode 100644 index 000000000000..0ab54aaaf718 --- /dev/null +++ b/keyboards/westm/westm68/rev2/rules.mk @@ -0,0 +1,2 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -v FFFF -p FFFF diff --git a/keyboards/westm/westm9/rev1/rules.mk b/keyboards/westm/westm9/rev1/rules.mk new file mode 100644 index 000000000000..0ab54aaaf718 --- /dev/null +++ b/keyboards/westm/westm9/rev1/rules.mk @@ -0,0 +1,2 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -v FFFF -p FFFF diff --git a/keyboards/westm/westm9/rev2/rules.mk b/keyboards/westm/westm9/rev2/rules.mk new file mode 100644 index 000000000000..0ab54aaaf718 --- /dev/null +++ b/keyboards/westm/westm9/rev2/rules.mk @@ -0,0 +1,2 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -v FFFF -p FFFF diff --git a/keyboards/whale/sk/rules.mk b/keyboards/whale/sk/rules.mk deleted file mode 100644 index 1a4ddedfa733..000000000000 --- a/keyboards/whale/sk/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = whale/sk/v3 diff --git a/keyboards/woodkeys/meira/featherble/rules.mk b/keyboards/woodkeys/meira/featherble/rules.mk index 3437a35bdf1d..44ebb2c1fe28 100644 --- a/keyboards/woodkeys/meira/featherble/rules.mk +++ b/keyboards/woodkeys/meira/featherble/rules.mk @@ -1,2 +1,5 @@ # Processor frequency F_CPU = 8000000 + +CUSTOM_MATRIX = yes +SRC += matrix.c diff --git a/keyboards/woodkeys/meira/promicro/rules.mk b/keyboards/woodkeys/meira/promicro/rules.mk index 09057bea54bc..32a05accc571 100644 --- a/keyboards/woodkeys/meira/promicro/rules.mk +++ b/keyboards/woodkeys/meira/promicro/rules.mk @@ -1,3 +1,6 @@ +CUSTOM_MATRIX = yes +SRC += matrix.c + # Disable unsupported hardware RGBLIGHT_SUPPORTED = no AUDIO_SUPPORTED = no diff --git a/keyboards/woodkeys/meira/rules.mk b/keyboards/woodkeys/meira/rules.mk deleted file mode 100644 index 423c14cfb73c..000000000000 --- a/keyboards/woodkeys/meira/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -CUSTOM_MATRIX = yes -SRC += matrix.c - -DEFAULT_FOLDER = woodkeys/meira/promicro diff --git a/keyboards/work_louder/loop/post_rules.mk b/keyboards/work_louder/loop/post_rules.mk new file mode 100644 index 000000000000..e0822c009b24 --- /dev/null +++ b/keyboards/work_louder/loop/post_rules.mk @@ -0,0 +1 @@ +SRC += rgb_functions.c diff --git a/keyboards/work_louder/loop/rules.mk b/keyboards/work_louder/loop/rules.mk deleted file mode 100644 index 53c3227972de..000000000000 --- a/keyboards/work_louder/loop/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC += rgb_functions.c - -DEFAULT_FOLDER = work_louder/loop/rev3 diff --git a/keyboards/work_louder/work_board/post_rules.mk b/keyboards/work_louder/work_board/post_rules.mk new file mode 100644 index 000000000000..e0822c009b24 --- /dev/null +++ b/keyboards/work_louder/work_board/post_rules.mk @@ -0,0 +1 @@ +SRC += rgb_functions.c diff --git a/keyboards/work_louder/work_board/rules.mk b/keyboards/work_louder/work_board/rules.mk deleted file mode 100644 index a4c45393c011..000000000000 --- a/keyboards/work_louder/work_board/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC += rgb_functions.c - -DEFAULT_FOLDER = work_louder/work_board/rev3 diff --git a/keyboards/x16/readme.md b/keyboards/x16/readme.md index 6434af99c7b9..cfe83905d73d 100644 --- a/keyboards/x16/readme.md +++ b/keyboards/x16/readme.md @@ -3,7 +3,6 @@ A 16 key macropad, with USB C * Keyboard Maintainer: QMK Community -* Hardware Supported: The PCBs, controllers supported * Hardware Availability: The x16 was discontinued by [x16](https://yinxianwei.github.io/x16/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/yanghu/unicorne/rules.mk b/keyboards/yanghu/unicorne/rules.mk deleted file mode 100644 index 96852c8abfe2..000000000000 --- a/keyboards/yanghu/unicorne/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = yanghu/unicorne/f411 diff --git a/keyboards/ymdk/id75/board.h b/keyboards/ymdk/id75/f103/board.h similarity index 100% rename from keyboards/ymdk/id75/board.h rename to keyboards/ymdk/id75/f103/board.h diff --git a/keyboards/ymdk/id75/config.h b/keyboards/ymdk/id75/f103/config.h similarity index 100% rename from keyboards/ymdk/id75/config.h rename to keyboards/ymdk/id75/f103/config.h diff --git a/keyboards/ymdk/id75/halconf.h b/keyboards/ymdk/id75/f103/halconf.h similarity index 100% rename from keyboards/ymdk/id75/halconf.h rename to keyboards/ymdk/id75/f103/halconf.h diff --git a/keyboards/ymdk/id75/f103/keyboard.json b/keyboards/ymdk/id75/f103/keyboard.json new file mode 100644 index 000000000000..5b1974b3f227 --- /dev/null +++ b/keyboards/ymdk/id75/f103/keyboard.json @@ -0,0 +1,13 @@ +{ + "manufacturer": "YMDK", + "bootloader": "uf2boot", + "matrix_pins": { + "cols": ["A10", "A9", "A8", "B15", "B14", "B13", "B12", "A5", "A6", "A4", "A3", "A2", "A1", "A0", "A15"], + "rows": ["B2", "B1", "B0", "A7", "B10"] + }, + "processor": "STM32F103", + "ws2812": { + "driver": "pwm", + "pin": "B9" + } +} diff --git a/keyboards/ymdk/id75/mcuconf.h b/keyboards/ymdk/id75/f103/mcuconf.h similarity index 100% rename from keyboards/ymdk/id75/mcuconf.h rename to keyboards/ymdk/id75/f103/mcuconf.h diff --git a/keyboards/ymdk/id75/rules.mk b/keyboards/ymdk/id75/f103/rules.mk similarity index 100% rename from keyboards/ymdk/id75/rules.mk rename to keyboards/ymdk/id75/f103/rules.mk diff --git a/keyboards/ymdk/id75/keyboard.json b/keyboards/ymdk/id75/info.json similarity index 56% rename from keyboards/ymdk/id75/keyboard.json rename to keyboards/ymdk/id75/info.json index db0c10854282..bbe4d1c73ee7 100644 --- a/keyboards/ymdk/id75/keyboard.json +++ b/keyboards/ymdk/id75/info.json @@ -1,8 +1,6 @@ { - "manufacturer": "YMDK", "keyboard_name": "Idobao x YMDK ID75", "maintainer": "qmk", - "bootloader": "uf2boot", "diode_direction": "ROW2COL", "features": { "bootmagic": true, @@ -11,152 +9,143 @@ "nkro": true, "rgb_matrix": true }, - "matrix_pins": { - "cols": ["A10", "A9", "A8", "B15", "B14", "B13", "B12", "A5", "A6", "A4", "A3", "A2", "A1", "A0", "A15"], - "rows": ["B2", "B1", "B0", "A7", "B10"] - }, - "processor": "STM32F103", - "ws2812": { - "driver": "pwm", - "pin": "B9" - }, "rgb_matrix": { "animations": { "alphas_mods": true, - "gradient_up_down": true, - "gradient_left_right": true, - "breathing": true, - "band_sat": true, - "band_val": true, "band_pinwheel_sat": true, "band_pinwheel_val": true, + "band_sat": true, "band_spiral_sat": true, "band_spiral_val": true, + "band_val": true, + "breathing": true, "cycle_all": true, "cycle_left_right": true, - "cycle_up_down": true, - "rainbow_moving_chevron": true, "cycle_out_in": true, "cycle_out_in_dual": true, "cycle_pinwheel": true, "cycle_spiral": true, + "cycle_up_down": true, + "digital_rain": true, "dual_beacon": true, - "rainbow_beacon": true, - "rainbow_pinwheels": true, - "raindrops": true, - "jellybean_raindrops": true, + "gradient_left_right": true, + "gradient_up_down": true, "hue_breathing": true, "hue_pendulum": true, "hue_wave": true, - "pixel_rain": true, + "jellybean_raindrops": true, + "multisplash": true, "pixel_flow": true, "pixel_fractal": true, - "typing_heatmap": true, - "digital_rain": true, - "solid_reactive_simple": true, + "pixel_rain": true, + "rainbow_beacon": true, + "rainbow_moving_chevron": true, + "rainbow_pinwheels": true, + "raindrops": true, + "solid_multisplash": true, "solid_reactive": true, - "solid_reactive_wide": true, - "solid_reactive_multiwide": true, "solid_reactive_cross": true, "solid_reactive_multicross": true, - "solid_reactive_nexus": true, "solid_reactive_multinexus": true, - "splash": true, - "multisplash": true, + "solid_reactive_multiwide": true, + "solid_reactive_nexus": true, + "solid_reactive_simple": true, + "solid_reactive_wide": true, "solid_splash": true, - "solid_multisplash": true + "splash": true, + "typing_heatmap": true }, "driver": "ws2812", "layout": [ - {"flags": 4, "matrix": [4, 14], "x": 224, "y": 64}, - {"flags": 4, "matrix": [4, 13], "x": 208, "y": 64}, - {"flags": 4, "matrix": [4, 12], "x": 192, "y": 64}, - {"flags": 4, "matrix": [4, 11], "x": 176, "y": 64}, - {"flags": 4, "matrix": [4, 10], "x": 160, "y": 64}, - {"flags": 4, "matrix": [4, 9], "x": 144, "y": 64}, - {"flags": 4, "matrix": [4, 8], "x": 128, "y": 64}, - {"flags": 4, "matrix": [4, 7], "x": 112, "y": 64}, - {"flags": 4, "matrix": [4, 6], "x": 96, "y": 64}, - {"flags": 4, "matrix": [4, 5], "x": 80, "y": 64}, - {"flags": 4, "matrix": [4, 4], "x": 64, "y": 64}, - {"flags": 4, "matrix": [4, 3], "x": 48, "y": 64}, - {"flags": 4, "matrix": [4, 2], "x": 32, "y": 64}, - {"flags": 4, "matrix": [4, 1], "x": 16, "y": 64}, - {"flags": 4, "matrix": [4, 0], "x": 0, "y": 64}, - {"flags": 4, "matrix": [3, 14], "x": 224, "y": 48}, - {"flags": 4, "matrix": [3, 13], "x": 208, "y": 48}, - {"flags": 4, "matrix": [3, 12], "x": 192, "y": 48}, - {"flags": 4, "matrix": [3, 11], "x": 176, "y": 48}, - {"flags": 4, "matrix": [3, 10], "x": 160, "y": 48}, - {"flags": 4, "matrix": [3, 9], "x": 144, "y": 48}, - {"flags": 4, "matrix": [3, 8], "x": 128, "y": 48}, - {"flags": 4, "matrix": [3, 7], "x": 112, "y": 48}, - {"flags": 4, "matrix": [3, 6], "x": 96, "y": 48}, - {"flags": 4, "matrix": [3, 5], "x": 80, "y": 48}, - {"flags": 4, "matrix": [3, 4], "x": 64, "y": 48}, - {"flags": 4, "matrix": [3, 3], "x": 48, "y": 48}, - {"flags": 4, "matrix": [3, 2], "x": 32, "y": 48}, - {"flags": 4, "matrix": [3, 1], "x": 16, "y": 48}, - {"flags": 4, "matrix": [3, 0], "x": 0, "y": 48}, - {"flags": 4, "matrix": [2, 14], "x": 224, "y": 32}, - {"flags": 4, "matrix": [2, 13], "x": 208, "y": 32}, - {"flags": 4, "matrix": [2, 12], "x": 192, "y": 32}, - {"flags": 4, "matrix": [2, 11], "x": 176, "y": 32}, - {"flags": 4, "matrix": [2, 10], "x": 160, "y": 32}, - {"flags": 4, "matrix": [2, 9], "x": 144, "y": 32}, - {"flags": 4, "matrix": [2, 8], "x": 128, "y": 32}, - {"flags": 4, "matrix": [2, 7], "x": 112, "y": 32}, - {"flags": 4, "matrix": [2, 6], "x": 96, "y": 32}, - {"flags": 4, "matrix": [2, 5], "x": 80, "y": 32}, - {"flags": 4, "matrix": [2, 4], "x": 64, "y": 32}, - {"flags": 4, "matrix": [2, 3], "x": 48, "y": 32}, - {"flags": 4, "matrix": [2, 2], "x": 32, "y": 32}, - {"flags": 4, "matrix": [2, 1], "x": 16, "y": 32}, - {"flags": 4, "matrix": [2, 0], "x": 0, "y": 32}, - {"flags": 4, "matrix": [1, 14], "x": 224, "y": 16}, - {"flags": 4, "matrix": [1, 13], "x": 208, "y": 16}, - {"flags": 4, "matrix": [1, 12], "x": 192, "y": 16}, - {"flags": 4, "matrix": [1, 11], "x": 176, "y": 16}, - {"flags": 4, "matrix": [1, 10], "x": 160, "y": 16}, - {"flags": 4, "matrix": [1, 9], "x": 144, "y": 16}, - {"flags": 4, "matrix": [1, 8], "x": 128, "y": 16}, - {"flags": 4, "matrix": [1, 7], "x": 112, "y": 16}, - {"flags": 4, "matrix": [1, 6], "x": 96, "y": 16}, - {"flags": 4, "matrix": [1, 5], "x": 80, "y": 16}, - {"flags": 4, "matrix": [1, 4], "x": 64, "y": 16}, - {"flags": 4, "matrix": [1, 3], "x": 48, "y": 16}, - {"flags": 4, "matrix": [1, 2], "x": 32, "y": 16}, - {"flags": 4, "matrix": [1, 1], "x": 16, "y": 16}, - {"flags": 4, "matrix": [1, 0], "x": 0, "y": 16}, - {"flags": 4, "matrix": [0, 14], "x": 224, "y": 0}, - {"flags": 4, "matrix": [0, 13], "x": 208, "y": 0}, - {"flags": 4, "matrix": [0, 12], "x": 192, "y": 0}, - {"flags": 4, "matrix": [0, 11], "x": 176, "y": 0}, - {"flags": 4, "matrix": [0, 10], "x": 160, "y": 0}, - {"flags": 4, "matrix": [0, 9], "x": 144, "y": 0}, - {"flags": 4, "matrix": [0, 8], "x": 128, "y": 0}, - {"flags": 4, "matrix": [0, 7], "x": 112, "y": 0}, - {"flags": 4, "matrix": [0, 6], "x": 96, "y": 0}, - {"flags": 4, "matrix": [0, 5], "x": 80, "y": 0}, - {"flags": 4, "matrix": [0, 4], "x": 64, "y": 0}, - {"flags": 4, "matrix": [0, 3], "x": 48, "y": 0}, - {"flags": 4, "matrix": [0, 2], "x": 32, "y": 0}, - {"flags": 4, "matrix": [0, 1], "x": 16, "y": 0}, - {"flags": 4, "matrix": [0, 0], "x": 0, "y": 0}, - {"flags": 2, "x": 0, "y": 64}, - {"flags": 2, "x": 38, "y": 64}, - {"flags": 2, "x": 76, "y": 64}, - {"flags": 2, "x": 114, "y": 64}, - {"flags": 2, "x": 152, "y": 64}, - {"flags": 2, "x": 190, "y": 64}, - {"flags": 2, "x": 224, "y": 64}, - {"flags": 2, "x": 0, "y": 0}, - {"flags": 2, "x": 38, "y": 0}, - {"flags": 2, "x": 76, "y": 0}, - {"flags": 2, "x": 114, "y": 0}, - {"flags": 2, "x": 152, "y": 0}, - {"flags": 2, "x": 190, "y": 0}, - {"flags": 2, "x": 224, "y": 0} + {"matrix": [4, 14], "x": 224, "y": 64, "flags": 4}, + {"matrix": [4, 13], "x": 208, "y": 64, "flags": 4}, + {"matrix": [4, 12], "x": 192, "y": 64, "flags": 4}, + {"matrix": [4, 11], "x": 176, "y": 64, "flags": 4}, + {"matrix": [4, 10], "x": 160, "y": 64, "flags": 4}, + {"matrix": [4, 9], "x": 144, "y": 64, "flags": 4}, + {"matrix": [4, 8], "x": 128, "y": 64, "flags": 4}, + {"matrix": [4, 7], "x": 112, "y": 64, "flags": 4}, + {"matrix": [4, 6], "x": 96, "y": 64, "flags": 4}, + {"matrix": [4, 5], "x": 80, "y": 64, "flags": 4}, + {"matrix": [4, 4], "x": 64, "y": 64, "flags": 4}, + {"matrix": [4, 3], "x": 48, "y": 64, "flags": 4}, + {"matrix": [4, 2], "x": 32, "y": 64, "flags": 4}, + {"matrix": [4, 1], "x": 16, "y": 64, "flags": 4}, + {"matrix": [4, 0], "x": 0, "y": 64, "flags": 4}, + {"matrix": [3, 14], "x": 224, "y": 48, "flags": 4}, + {"matrix": [3, 13], "x": 208, "y": 48, "flags": 4}, + {"matrix": [3, 12], "x": 192, "y": 48, "flags": 4}, + {"matrix": [3, 11], "x": 176, "y": 48, "flags": 4}, + {"matrix": [3, 10], "x": 160, "y": 48, "flags": 4}, + {"matrix": [3, 9], "x": 144, "y": 48, "flags": 4}, + {"matrix": [3, 8], "x": 128, "y": 48, "flags": 4}, + {"matrix": [3, 7], "x": 112, "y": 48, "flags": 4}, + {"matrix": [3, 6], "x": 96, "y": 48, "flags": 4}, + {"matrix": [3, 5], "x": 80, "y": 48, "flags": 4}, + {"matrix": [3, 4], "x": 64, "y": 48, "flags": 4}, + {"matrix": [3, 3], "x": 48, "y": 48, "flags": 4}, + {"matrix": [3, 2], "x": 32, "y": 48, "flags": 4}, + {"matrix": [3, 1], "x": 16, "y": 48, "flags": 4}, + {"matrix": [3, 0], "x": 0, "y": 48, "flags": 4}, + {"matrix": [2, 14], "x": 224, "y": 32, "flags": 4}, + {"matrix": [2, 13], "x": 208, "y": 32, "flags": 4}, + {"matrix": [2, 12], "x": 192, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 176, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 160, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 144, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 128, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 112, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 96, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 80, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 64, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 48, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 32, "y": 32, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 32, "flags": 4}, + {"matrix": [2, 0], "x": 0, "y": 32, "flags": 4}, + {"matrix": [1, 14], "x": 224, "y": 16, "flags": 4}, + {"matrix": [1, 13], "x": 208, "y": 16, "flags": 4}, + {"matrix": [1, 12], "x": 192, "y": 16, "flags": 4}, + {"matrix": [1, 11], "x": 176, "y": 16, "flags": 4}, + {"matrix": [1, 10], "x": 160, "y": 16, "flags": 4}, + {"matrix": [1, 9], "x": 144, "y": 16, "flags": 4}, + {"matrix": [1, 8], "x": 128, "y": 16, "flags": 4}, + {"matrix": [1, 7], "x": 112, "y": 16, "flags": 4}, + {"matrix": [1, 6], "x": 96, "y": 16, "flags": 4}, + {"matrix": [1, 5], "x": 80, "y": 16, "flags": 4}, + {"matrix": [1, 4], "x": 64, "y": 16, "flags": 4}, + {"matrix": [1, 3], "x": 48, "y": 16, "flags": 4}, + {"matrix": [1, 2], "x": 32, "y": 16, "flags": 4}, + {"matrix": [1, 1], "x": 16, "y": 16, "flags": 4}, + {"matrix": [1, 0], "x": 0, "y": 16, "flags": 4}, + {"matrix": [0, 14], "x": 224, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 208, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 192, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 176, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 160, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 144, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 128, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 112, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 96, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 80, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 64, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 48, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 32, "y": 0, "flags": 4}, + {"matrix": [0, 1], "x": 16, "y": 0, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, + {"x": 0, "y": 64, "flags": 2}, + {"x": 38, "y": 64, "flags": 2}, + {"x": 76, "y": 64, "flags": 2}, + {"x": 114, "y": 64, "flags": 2}, + {"x": 152, "y": 64, "flags": 2}, + {"x": 190, "y": 64, "flags": 2}, + {"x": 224, "y": 64, "flags": 2}, + {"x": 0, "y": 0, "flags": 2}, + {"x": 38, "y": 0, "flags": 2}, + {"x": 76, "y": 0, "flags": 2}, + {"x": 114, "y": 0, "flags": 2}, + {"x": 152, "y": 0, "flags": 2}, + {"x": 190, "y": 0, "flags": 2}, + {"x": 224, "y": 0, "flags": 2} ], "max_brightness": 128, "sleep": true diff --git a/keyboards/ymdk/id75/readme.md b/keyboards/ymdk/id75/readme.md index 9315745f71dd..4f7e779458bd 100644 --- a/keyboards/ymdk/id75/readme.md +++ b/keyboards/ymdk/id75/readme.md @@ -5,17 +5,18 @@ A 75-key, 5-row ortholinear keyboard with per-key and underglow RGB LEDs. * Keyboard Maintainer: [The QMK Community](https://github.com/qmk) -* Hardware Supported: [Idobao x YMDK ID75 PCB (APM32F103CBT6)](https://www.aliexpress.com/item/3256804537842097.html) - * This PCB uses an ARM Cortex-M3 MCU with 128kb flash. **It is not the same as `idobao/id75` or `ymdk/ymd75`.** +* Hardware Supported: [Idobao x YMDK ID75](https://www.aliexpress.com/item/3256804537842097.html). **This is not the same PCB as `idobao/id75` or `ymdk/ymd75`.** + This keyboard has had multiple PCB revisions, some of which may not work with the firmware in this repository. **Check your PCB before flashing.** + * `f103`: (Geehy APM32F103CBT6, uf2boot) * Hardware Availability: [YMDK](https://ymdkey.com/products/id75-75-keys-ortholinear-layout-qmk-anodized-aluminum-case-plate-hot-swappable-hot-swap-type-c-pcb-mechanical-keyboard-kit), [AliExpress (YMDK Store)](https://www.aliexpress.com/item/2255800125183974.html), [Amazon](https://www.amazon.com/Ortholinear-Anodized-Aluminum-hot-swappable-Mechanical/dp/B07ZQ8CD88) Make example for this keyboard (after setting up your build environment): - make ymdk/id75:default + make ymdk/id75/f103:default Flashing example for this keyboard: - make ymdk/id75:default:flash + make ymdk/id75/f103:default:flash See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). @@ -27,4 +28,5 @@ Enter the bootloader in 3 ways: * **Physical reset button**: Press the button on the back of the PCB twice in quick succession. * **Keycode in layout**: Press the key mapped to `QK_BOOT`. In the pre-supplied keymaps it is on the second layer, in the bottom-right corner. -After entering the bootloader through one of the three methods above, the keyboard will appear as a USB mass storage device named `MT.KEY`. If the CLI is unable to find this device, the compiled `.uf2` file can be manually copied to it. The keyboard will reboot on completion with the new firmware loaded. +After entering the bootloader through one of the three methods above, the keyboard will appear as a USB mass storage device. If the CLI is unable to find this device, the compiled `.uf2` file can be manually copied to it. The keyboard will reboot on completion with the new firmware loaded. +- `f103`: The volume name is `MT.KEY`. diff --git a/keyboards/ymdk/melody96/rules.mk b/keyboards/ymdk/melody96/rules.mk deleted file mode 100644 index 806543977bf0..000000000000 --- a/keyboards/ymdk/melody96/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ymdk/melody96/soldered diff --git a/keyboards/ymdk/yd60mq/rules.mk b/keyboards/ymdk/yd60mq/rules.mk deleted file mode 100644 index c37722c8bb8b..000000000000 --- a/keyboards/ymdk/yd60mq/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ymdk/yd60mq/12led diff --git a/keyboards/yosino58/rules.mk b/keyboards/yosino58/rules.mk deleted file mode 100644 index c700b6f5b519..000000000000 --- a/keyboards/yosino58/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = yosino58/rev1 diff --git a/keyboards/yushakobo/navpad/10/rules.mk b/keyboards/yushakobo/navpad/10/rules.mk deleted file mode 100644 index 32daeef814d7..000000000000 --- a/keyboards/yushakobo/navpad/10/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = yushakobo/navpad/10/rev1 diff --git a/keyboards/yynmt/acperience12/rules.mk b/keyboards/yynmt/acperience12/rules.mk deleted file mode 100644 index cfe8b8ac18f0..000000000000 --- a/keyboards/yynmt/acperience12/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = yynmt/acperience12/rev1 diff --git a/keyboards/zsa/planck_ez/base/rules.mk b/keyboards/zsa/planck_ez/base/rules.mk new file mode 100644 index 000000000000..c0b951fba9d5 --- /dev/null +++ b/keyboards/zsa/planck_ez/base/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_SUPPORTED = no +BACKLIGHT_SUPPORTED = no diff --git a/keyboards/zsa/planck_ez/glow/rules.mk b/keyboards/zsa/planck_ez/glow/rules.mk new file mode 100644 index 000000000000..c0b951fba9d5 --- /dev/null +++ b/keyboards/zsa/planck_ez/glow/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_SUPPORTED = no +BACKLIGHT_SUPPORTED = no diff --git a/keyboards/zsa/planck_ez/rules.mk b/keyboards/zsa/planck_ez/rules.mk deleted file mode 100644 index 67921c96ed87..000000000000 --- a/keyboards/zsa/planck_ez/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -RGBLIGHT_SUPPORTED = no -BAKCLIGHT_SUPPORTED = no - -DEFAULT_FOLDER = zsa/planck_ez/base diff --git a/keyboards/zsa/voyager/voyager.c b/keyboards/zsa/voyager/voyager.c index 6d4f6c5f26a3..b7ca8f748fd0 100644 --- a/keyboards/zsa/voyager/voyager.c +++ b/keyboards/zsa/voyager/voyager.c @@ -121,7 +121,7 @@ layer_state_t layer_state_set_kb(layer_state_t state) { #ifdef RGB_MATRIX_ENABLE // clang-format off -const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { +const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/lib/chibios b/lib/chibios index be44b3305f9a..2365f8442925 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit be44b3305f9a9fe5f2f49a4e7b978db322dc463e +Subproject commit 2365f844292513ea0ee9eea6ab778d56f9ccd3b9 diff --git a/lib/chibios-contrib b/lib/chibios-contrib index 77cb0a4f7589..3ac181e4ca5c 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit 77cb0a4f7589f89e724f5e6ecb1d76d514dd1212 +Subproject commit 3ac181e4ca5cafddaf8b472baa1d09c2b24c77b6 diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py index 08d23cf5ba9f..785b94045627 100644 --- a/lib/python/qmk/c_parse.py +++ b/lib/python/qmk/c_parse.py @@ -24,7 +24,7 @@ def _get_chunks(it, size): return iter(lambda: tuple(islice(it, size)), ()) -def _preprocess_c_file(file): +def preprocess_c_file(file): """Load file and strip comments """ file_contents = file.read_text(encoding='utf-8') @@ -66,7 +66,7 @@ def find_layouts(file): parsed_layouts = {} # Search the file for LAYOUT macros and aliases - file_contents = _preprocess_c_file(file) + file_contents = preprocess_c_file(file) for line in file_contents.split('\n'): if layout_macro_define_regex.match(line.lstrip()) and '(' in line and 'LAYOUT' in line: @@ -248,7 +248,7 @@ def _parse_led_config(file, matrix_cols, matrix_rows): current_row_index = 0 current_row = [] - for _type, value in lex(_preprocess_c_file(file), CLexer()): + for _type, value in lex(preprocess_c_file(file), CLexer()): if not found_g_led_config: # Check for type if value == 'led_config_t': diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 2d63dfb4477b..3f2ba9ce3cca 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -49,6 +49,7 @@ 'qmk.cli.generate.api', 'qmk.cli.generate.autocorrect_data', 'qmk.cli.generate.compilation_database', + 'qmk.cli.generate.community_modules', 'qmk.cli.generate.config_h', 'qmk.cli.generate.develop_pr_list', 'qmk.cli.generate.dfu_header', @@ -82,6 +83,7 @@ 'qmk.cli.new.keymap', 'qmk.cli.painter', 'qmk.cli.pytest', + 'qmk.cli.resolve_alias', 'qmk.cli.test.c', 'qmk.cli.userspace.add', 'qmk.cli.userspace.compile', diff --git a/lib/python/qmk/cli/docs.py b/lib/python/qmk/cli/docs.py index d28dddf194e1..da02ebf95e30 100644 --- a/lib/python/qmk/cli/docs.py +++ b/lib/python/qmk/cli/docs.py @@ -6,6 +6,8 @@ from milc import cli +@cli.argument('-p', '--port', default=8936, type=int, help='Port number to use.') +@cli.argument('-b', '--browser', action='store_true', help='Open the docs in the default browser.') @cli.subcommand('Run a local webserver for QMK documentation.', hidden=False if cli.config.user.developer else True) def docs(cli): """Spin up a local HTTP server for the QMK docs. @@ -22,6 +24,7 @@ def docs(cli): if not prepare_docs_build_area(is_production=False): return False - if not cli.config.general.verbose: - cli.log.info('Serving docs at http://localhost:5173/ (Ctrl+C to stop)') - run_docs_command('run', 'docs:dev') + cmd = ['docs:dev', '--port', f'{cli.args.port}'] + if cli.args.browser: + cmd.append('--open') + run_docs_command('run', cmd) diff --git a/lib/python/qmk/cli/format/c.py b/lib/python/qmk/cli/format/c.py index a58aef3fbc16..65818155b0fb 100644 --- a/lib/python/qmk/cli/format/c.py +++ b/lib/python/qmk/cli/format/c.py @@ -10,7 +10,7 @@ from qmk.c_parse import c_source_files c_file_suffixes = ('c', 'h', 'cpp', 'hpp') -core_dirs = ('drivers', 'quantum', 'tests', 'tmk_core', 'platforms') +core_dirs = ('drivers', 'quantum', 'tests', 'tmk_core', 'platforms', 'modules') ignored = ('tmk_core/protocol/usb_hid', 'platforms/chibios/boards') diff --git a/lib/python/qmk/cli/format/json.py b/lib/python/qmk/cli/format/json.py index 367029443450..61f525418450 100755 --- a/lib/python/qmk/cli/format/json.py +++ b/lib/python/qmk/cli/format/json.py @@ -9,7 +9,7 @@ from qmk.info import info_json from qmk.json_schema import json_load, validate -from qmk.json_encoders import InfoJSONEncoder, KeymapJSONEncoder, UserspaceJSONEncoder +from qmk.json_encoders import InfoJSONEncoder, KeymapJSONEncoder, UserspaceJSONEncoder, CommunityModuleJSONEncoder from qmk.path import normpath @@ -30,6 +30,13 @@ def _detect_json_format(file, json_data): except ValidationError: pass + if json_encoder is None: + try: + validate(json_data, 'qmk.community_module.v1') + json_encoder = CommunityModuleJSONEncoder + except ValidationError: + pass + if json_encoder is None: try: validate(json_data, 'qmk.keyboard.v1') @@ -54,6 +61,8 @@ def _get_json_encoder(file, json_data): json_encoder = KeymapJSONEncoder elif cli.args.format == 'userspace': json_encoder = UserspaceJSONEncoder + elif cli.args.format == 'community_module': + json_encoder = CommunityModuleJSONEncoder else: # This should be impossible cli.log.error('Unknown format: %s', cli.args.format) @@ -61,7 +70,7 @@ def _get_json_encoder(file, json_data): @cli.argument('json_file', arg_only=True, type=normpath, help='JSON file to format') -@cli.argument('-f', '--format', choices=['auto', 'keyboard', 'keymap', 'userspace'], default='auto', arg_only=True, help='JSON formatter to use (Default: autodetect)') +@cli.argument('-f', '--format', choices=['auto', 'keyboard', 'keymap', 'userspace', 'community_module'], default='auto', arg_only=True, help='JSON formatter to use (Default: autodetect)') @cli.argument('-i', '--inplace', action='store_true', arg_only=True, help='If set, will operate in-place on the input file') @cli.argument('-p', '--print', action='store_true', arg_only=True, help='If set, will print the formatted json to stdout ') @cli.subcommand('Generate an info.json file for a keyboard.', hidden=False if cli.config.user.developer else True) diff --git a/lib/python/qmk/cli/generate/community_modules.py b/lib/python/qmk/cli/generate/community_modules.py new file mode 100644 index 000000000000..23678a2fb548 --- /dev/null +++ b/lib/python/qmk/cli/generate/community_modules.py @@ -0,0 +1,263 @@ +import contextlib +from argcomplete.completers import FilesCompleter +from pathlib import Path + +from milc import cli + +import qmk.path +from qmk.info import get_modules +from qmk.keyboard import keyboard_completer, keyboard_folder +from qmk.commands import dump_lines +from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE +from qmk.community_modules import module_api_list, load_module_jsons, find_module_path + + +@contextlib.contextmanager +def _render_api_guard(lines, api): + if api.guard: + lines.append(f'#if {api.guard}') + yield + if api.guard: + lines.append(f'#endif // {api.guard}') + + +def _render_api_header(api): + lines = [] + if api.header: + lines.append('') + with _render_api_guard(lines, api): + lines.append(f'#include <{api.header}>') + return lines + + +def _render_keycodes(module_jsons): + lines = [] + lines.append('') + lines.append('enum {') + first = True + for module_json in module_jsons: + module_name = Path(module_json['module']).name + keycodes = module_json.get('keycodes', []) + if len(keycodes) > 0: + lines.append(f' // From module: {module_name}') + for keycode in keycodes: + key = keycode.get('key', None) + if first: + lines.append(f' {key} = QK_COMMUNITY_MODULE,') + first = False + else: + lines.append(f' {key},') + for alias in keycode.get('aliases', []): + lines.append(f' {alias} = {key},') + lines.append('') + lines.append(' LAST_COMMUNITY_MODULE_KEY') + lines.append('};') + lines.append('_Static_assert((int)LAST_COMMUNITY_MODULE_KEY <= (int)(QK_COMMUNITY_MODULE_MAX+1), "Too many community module keycodes");') + return lines + + +def _render_api_declarations(api, module, user_kb=True): + lines = [] + lines.append('') + with _render_api_guard(lines, api): + if user_kb: + lines.append(f'{api.ret_type} {api.name}_{module}_user({api.args});') + lines.append(f'{api.ret_type} {api.name}_{module}_kb({api.args});') + lines.append(f'{api.ret_type} {api.name}_{module}({api.args});') + return lines + + +def _render_api_implementations(api, module): + module_name = Path(module).name + lines = [] + lines.append('') + with _render_api_guard(lines, api): + # _user + lines.append(f'__attribute__((weak)) {api.ret_type} {api.name}_{module_name}_user({api.args}) {{') + if api.ret_type == 'bool': + lines.append(' return true;') + else: + pass + lines.append('}') + lines.append('') + + # _kb + lines.append(f'__attribute__((weak)) {api.ret_type} {api.name}_{module_name}_kb({api.args}) {{') + if api.ret_type == 'bool': + lines.append(f' if(!{api.name}_{module_name}_user({api.call_params})) {{ return false; }}') + lines.append(' return true;') + else: + lines.append(f' {api.name}_{module_name}_user({api.call_params});') + lines.append('}') + lines.append('') + + # module (non-suffixed) + lines.append(f'__attribute__((weak)) {api.ret_type} {api.name}_{module_name}({api.args}) {{') + if api.ret_type == 'bool': + lines.append(f' if(!{api.name}_{module_name}_kb({api.call_params})) {{ return false; }}') + lines.append(' return true;') + else: + lines.append(f' {api.name}_{module_name}_kb({api.call_params});') + lines.append('}') + return lines + + +def _render_core_implementation(api, modules): + lines = [] + lines.append('') + with _render_api_guard(lines, api): + lines.append(f'{api.ret_type} {api.name}_modules({api.args}) {{') + if api.ret_type == 'bool': + lines.append(' return true') + for module in modules: + module_name = Path(module).name + if api.ret_type == 'bool': + lines.append(f' && {api.name}_{module_name}({api.call_params})') + else: + lines.append(f' {api.name}_{module_name}({api.call_params});') + if api.ret_type == 'bool': + lines.append(' ;') + lines.append('}') + return lines + + +@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.h for.') +@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file') +@cli.subcommand('Creates a community_modules.h from a keymap.json file.') +def generate_community_modules_h(cli): + """Creates a community_modules.h from a keymap.json file + """ + if cli.args.output and cli.args.output.name == '-': + cli.args.output = None + + api_list, api_version, ver_major, ver_minor, ver_patch = module_api_list() + + lines = [ + GPL2_HEADER_C_LIKE, + GENERATED_HEADER_C_LIKE, + '#pragma once', + '#include ', + '#include ', + '#include ', + '', + '#define COMMUNITY_MODULES_API_VERSION_BUILDER(ver_major,ver_minor,ver_patch) (((((uint32_t)(ver_major))&0xFF) << 24) | ((((uint32_t)(ver_minor))&0xFF) << 16) | (((uint32_t)(ver_patch))&0xFF))', + f'#define COMMUNITY_MODULES_API_VERSION COMMUNITY_MODULES_API_VERSION_BUILDER({ver_major},{ver_minor},{ver_patch})', + f'#define ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(ver_major,ver_minor,ver_patch) _Static_assert(COMMUNITY_MODULES_API_VERSION_BUILDER(ver_major,ver_minor,ver_patch) <= COMMUNITY_MODULES_API_VERSION, "Community module requires a newer version of QMK modules API -- needs: " #ver_major "." #ver_minor "." #ver_patch ", current: {api_version}.")', + '', + 'typedef struct keyrecord_t keyrecord_t; // forward declaration so we don\'t need to include quantum.h', + '', + ] + + modules = get_modules(cli.args.keyboard, cli.args.filename) + module_jsons = load_module_jsons(modules) + if len(modules) > 0: + lines.extend(_render_keycodes(module_jsons)) + + for api in api_list: + lines.extend(_render_api_header(api)) + + for module in modules: + lines.append('') + lines.append(f'// From module: {module}') + for api in api_list: + lines.extend(_render_api_declarations(api, Path(module).name)) + lines.append('') + + lines.append('// Core wrapper') + for api in api_list: + lines.extend(_render_api_declarations(api, 'modules', user_kb=False)) + + dump_lines(cli.args.output, lines, cli.args.quiet, remove_repeated_newlines=True) + + +@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.') +@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file') +@cli.subcommand('Creates a community_modules.c from a keymap.json file.') +def generate_community_modules_c(cli): + """Creates a community_modules.c from a keymap.json file + """ + if cli.args.output and cli.args.output.name == '-': + cli.args.output = None + + api_list, _, _, _, _ = module_api_list() + + lines = [ + GPL2_HEADER_C_LIKE, + GENERATED_HEADER_C_LIKE, + '', + '#include "community_modules.h"', + ] + + modules = get_modules(cli.args.keyboard, cli.args.filename) + if len(modules) > 0: + + for module in modules: + for api in api_list: + lines.extend(_render_api_implementations(api, Path(module).name)) + + for api in api_list: + lines.extend(_render_core_implementation(api, modules)) + + dump_lines(cli.args.output, lines, cli.args.quiet, remove_repeated_newlines=True) + + +@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.') +@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file') +@cli.subcommand('Creates a community_modules_introspection.h from a keymap.json file.') +def generate_community_modules_introspection_h(cli): + """Creates a community_modules_introspection.h from a keymap.json file + """ + if cli.args.output and cli.args.output.name == '-': + cli.args.output = None + + lines = [ + GPL2_HEADER_C_LIKE, + GENERATED_HEADER_C_LIKE, + '', + ] + + modules = get_modules(cli.args.keyboard, cli.args.filename) + if len(modules) > 0: + for module in modules: + module_path = find_module_path(module) + lines.append(f'#if __has_include("{module_path}/introspection.h")') + lines.append(f'#include "{module_path}/introspection.h"') + lines.append(f'#endif // __has_include("{module_path}/introspection.h")') + lines.append('') + + dump_lines(cli.args.output, lines, cli.args.quiet, remove_repeated_newlines=True) + + +@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.') +@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file') +@cli.subcommand('Creates a community_modules_introspection.c from a keymap.json file.') +def generate_community_modules_introspection_c(cli): + """Creates a community_modules_introspection.c from a keymap.json file + """ + if cli.args.output and cli.args.output.name == '-': + cli.args.output = None + + lines = [ + GPL2_HEADER_C_LIKE, + GENERATED_HEADER_C_LIKE, + '', + ] + + modules = get_modules(cli.args.keyboard, cli.args.filename) + if len(modules) > 0: + for module in modules: + module_path = find_module_path(module) + lines.append(f'#if __has_include("{module_path}/introspection.c")') + lines.append(f'#include "{module_path}/introspection.c"') + lines.append(f'#endif // __has_include("{module_path}/introspection.c")') + lines.append('') + + dump_lines(cli.args.output, lines, cli.args.quiet, remove_repeated_newlines=True) diff --git a/lib/python/qmk/cli/generate/docs.py b/lib/python/qmk/cli/generate/docs.py index 5821d43b8691..7abeca9d2abd 100644 --- a/lib/python/qmk/cli/generate/docs.py +++ b/lib/python/qmk/cli/generate/docs.py @@ -27,10 +27,8 @@ def generate_docs(cli): return False cli.log.info('Building vitepress docs') - run_docs_command('run', 'docs:build') + run_docs_command('run', ['docs:build']) cli.log.info('Successfully generated docs to %s.', BUILD_DOCS_PATH) if cli.args.serve: - if not cli.config.general.verbose: - cli.log.info('Serving docs at http://localhost:4173/ (Ctrl+C to stop)') - run_docs_command('run', 'docs:preview') + run_docs_command('run', ['docs:preview']) diff --git a/lib/python/qmk/cli/generate/keyboard_c.py b/lib/python/qmk/cli/generate/keyboard_c.py index 228b320942a0..1978de4a22c7 100755 --- a/lib/python/qmk/cli/generate/keyboard_c.py +++ b/lib/python/qmk/cli/generate/keyboard_c.py @@ -1,5 +1,9 @@ """Used by the make system to generate keyboard.c from info.json. """ +import bisect +import dataclasses +from typing import Optional + from milc import cli from qmk.info import info_json @@ -87,6 +91,7 @@ def _gen_matrix_mask(info_data): lines.append(f' 0b{"".join(reversed(mask[i]))},') lines.append('};') lines.append('#endif') + lines.append('') return lines @@ -122,6 +127,128 @@ def _gen_joystick_axes(info_data): lines.append('};') lines.append('#endif') + lines.append('') + + return lines + + +@dataclasses.dataclass +class LayoutKey: + """Geometric info for one key in a layout.""" + row: int + col: int + x: float + y: float + w: float = 1.0 + h: float = 1.0 + hand: Optional[str] = None + + @staticmethod + def from_json(key_json): + row, col = key_json['matrix'] + return LayoutKey( + row=row, + col=col, + x=key_json['x'], + y=key_json['y'], + w=key_json.get('w', 1.0), + h=key_json.get('h', 1.0), + hand=key_json.get('hand', None), + ) + + @property + def cx(self): + """Center x coordinate of the key.""" + return self.x + self.w / 2.0 + + @property + def cy(self): + """Center y coordinate of the key.""" + return self.y + self.h / 2.0 + + +class Layout: + """Geometric info of a layout.""" + def __init__(self, layout_json): + self.keys = [LayoutKey.from_json(key_json) for key_json in layout_json['layout']] + self.x_min = min(key.cx for key in self.keys) + self.x_max = max(key.cx for key in self.keys) + self.x_mid = (self.x_min + self.x_max) / 2 + # If there is one key with width >= 6u, it is probably the spacebar. + i = [i for i, key in enumerate(self.keys) if key.w >= 6.0] + self.spacebar = self.keys[i[0]] if len(i) == 1 else None + + def is_symmetric(self, tol: float = 0.02): + """Whether the key positions are symmetric about x_mid.""" + x = sorted([key.cx for key in self.keys]) + for i in range(len(x)): + x_i_mirrored = 2.0 * self.x_mid - x[i] + # Find leftmost x element greater than or equal to (x_i_mirrored - tol). + j = bisect.bisect_left(x, x_i_mirrored - tol) + if j == len(x) or abs(x[j] - x_i_mirrored) > tol: + return False + + return True + + def widest_horizontal_gap(self): + """Finds the x midpoint of the widest horizontal gap between keys.""" + x = sorted([key.cx for key in self.keys]) + x_mid = self.x_mid + max_sep = 0 + for i in range(len(x) - 1): + sep = x[i + 1] - x[i] + if sep > max_sep: + max_sep = sep + x_mid = (x[i + 1] + x[i]) / 2 + + return x_mid + + +def _gen_chordal_hold_layout(info_data): + """Convert info.json content to chordal_hold_layout + """ + # NOTE: If there are multiple layouts, only the first is read. + for layout_name, layout_json in info_data['layouts'].items(): + layout = Layout(layout_json) + break + + if layout.is_symmetric(): + # If the layout is symmetric (e.g. most split keyboards), guess the + # handedness based on the sign of (x - layout.x_mid). + hand_signs = [key.x - layout.x_mid for key in layout.keys] + elif layout.spacebar is not None: + # If the layout has a spacebar, form a dividing line through the spacebar, + # nearly vertical but with a slight angle to follow typical row stagger. + x0 = layout.spacebar.cx - 0.05 + y0 = layout.spacebar.cy - 1.0 + hand_signs = [(key.x - x0) - (key.y - y0) / 3.0 for key in layout.keys] + else: + # Fallback: assume handedness based on the widest horizontal separation. + x_mid = layout.widest_horizontal_gap() + hand_signs = [key.x - x_mid for key in layout.keys] + + for key, hand_sign in zip(layout.keys, hand_signs): + if key.hand is None: + if key == layout.spacebar or abs(hand_sign) <= 0.02: + key.hand = '*' + else: + key.hand = 'L' if hand_sign < 0.0 else 'R' + + lines = [] + lines.append('#ifdef CHORDAL_HOLD') + line = ('__attribute__((weak)) const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM = ' + layout_name + '(') + + x_prev = None + for key in layout.keys: + if x_prev is None or key.x < x_prev: + lines.append(line) + line = ' ' + line += f"'{key.hand}', " + x_prev = key.x + + lines.append(line[:-2]) + lines.append(');') + lines.append('#endif') return lines @@ -136,11 +263,12 @@ def generate_keyboard_c(cli): kb_info_json = info_json(cli.args.keyboard) # Build the layouts.h file. - keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#include QMK_KEYBOARD_H', ''] + keyboard_c_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#include QMK_KEYBOARD_H', ''] - keyboard_h_lines.extend(_gen_led_configs(kb_info_json)) - keyboard_h_lines.extend(_gen_matrix_mask(kb_info_json)) - keyboard_h_lines.extend(_gen_joystick_axes(kb_info_json)) + keyboard_c_lines.extend(_gen_led_configs(kb_info_json)) + keyboard_c_lines.extend(_gen_matrix_mask(kb_info_json)) + keyboard_c_lines.extend(_gen_joystick_axes(kb_info_json)) + keyboard_c_lines.extend(_gen_chordal_hold_layout(kb_info_json)) # Show the results - dump_lines(cli.args.output, keyboard_h_lines, cli.args.quiet) + dump_lines(cli.args.output, keyboard_c_lines, cli.args.quiet) diff --git a/lib/python/qmk/cli/generate/keyboard_h.py b/lib/python/qmk/cli/generate/keyboard_h.py index 5863a0983ad3..cb9528d96bbc 100755 --- a/lib/python/qmk/cli/generate/keyboard_h.py +++ b/lib/python/qmk/cli/generate/keyboard_h.py @@ -22,6 +22,11 @@ def _generate_layouts(keyboard, kb_info_json): row_num = kb_info_json['matrix_size']['rows'] lines = [] + lines.append('') + lines.append('// Layout content') + lines.append('') + lines.append('#define XXX KC_NO') + for layout_name, layout_data in kb_info_json['layouts'].items(): if layout_data['c_macro']: continue @@ -31,7 +36,7 @@ def _generate_layouts(keyboard, kb_info_json): continue layout_keys = [] - layout_matrix = [['KC_NO'] * col_num for _ in range(row_num)] + layout_matrix = [['XXX'] * col_num for _ in range(row_num)] for key_data in layout_data['layout']: row, col = key_data['matrix'] @@ -46,7 +51,7 @@ def _generate_layouts(keyboard, kb_info_json): lines.append('') lines.append(f'#define {layout_name}({", ".join(layout_keys)}) {{ \\') - rows = ', \\\n'.join(['\t {' + ', '.join(row) + '}' for row in layout_matrix]) + rows = ', \\\n'.join([' { ' + ', '.join(row) + ' }' for row in layout_matrix]) rows += ' \\' lines.append(rows) lines.append('}') @@ -67,6 +72,9 @@ def _generate_keycodes(kb_info_json): return [] lines = [] + lines.append('') + lines.append('// Keycode content') + lines.append('') lines.append('enum keyboard_keycodes {') for index, item in enumerate(kb_info_json.get('keycodes')): @@ -103,17 +111,14 @@ def generate_keyboard_h(cli): valid_config = dd_layouts or keyboard_h # Build the layouts.h file. - keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '#include "quantum.h"'] + keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once', '', '#include "quantum.h"'] - keyboard_h_lines.append('') - keyboard_h_lines.append('// Layout content') if dd_layouts: keyboard_h_lines.extend(dd_layouts) + if keyboard_h: keyboard_h_lines.append(f'#include "{Path(keyboard_h).name}"') - keyboard_h_lines.append('') - keyboard_h_lines.append('// Keycode content') if dd_keycodes: keyboard_h_lines.extend(dd_keycodes) diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py index 52915561095d..cae9b07c3e84 100755 --- a/lib/python/qmk/cli/generate/rules_mk.py +++ b/lib/python/qmk/cli/generate/rules_mk.py @@ -6,12 +6,13 @@ from argcomplete.completers import FilesCompleter from milc import cli -from qmk.info import info_json +from qmk.info import info_json, get_modules from qmk.json_schema import json_load from qmk.keyboard import keyboard_completer, keyboard_folder from qmk.commands import dump_lines, parse_configurator_json from qmk.path import normpath, FileType from qmk.constants import GPL2_HEADER_SH_LIKE, GENERATED_HEADER_SH_LIKE +from qmk.community_modules import find_module_path, load_module_jsons def generate_rule(rules_key, rules_value): @@ -46,6 +47,42 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict): return generate_rule(rules_key, rules_value) +def generate_features_rules(features_dict): + lines = [] + for feature, enabled in features_dict.items(): + feature = feature.upper() + enabled = 'yes' if enabled else 'no' + lines.append(generate_rule(f'{feature}_ENABLE', enabled)) + return lines + + +def generate_modules_rules(keyboard, filename): + lines = [] + modules = get_modules(keyboard, filename) + if len(modules) > 0: + lines.append('') + lines.append('OPT_DEFS += -DCOMMUNITY_MODULES_ENABLE=TRUE') + for module in modules: + module_path = find_module_path(module) + if not module_path: + raise FileNotFoundError(f"Module '{module}' not found.") + lines.append('') + lines.append(f'COMMUNITY_MODULES += {module_path.name}') # use module_path here instead of module as it may be a subdirectory + lines.append(f'OPT_DEFS += -DCOMMUNITY_MODULE_{module_path.name.upper()}_ENABLE=TRUE') + lines.append(f'COMMUNITY_MODULE_PATHS += {module_path}') + lines.append(f'VPATH += {module_path}') + lines.append(f'SRC += $(wildcard {module_path}/{module_path.name}.c)') + lines.append(f'-include {module_path}/rules.mk') + + module_jsons = load_module_jsons(modules) + for module_json in module_jsons: + if 'features' in module_json: + lines.append('') + lines.append(f'# Module: {module_json["module_name"]}') + lines.extend(generate_features_rules(module_json['features'])) + return lines + + @cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.') @cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @@ -80,10 +117,7 @@ def generate_rules_mk(cli): # Iterate through features to enable/disable them if 'features' in kb_info_json: - for feature, enabled in kb_info_json['features'].items(): - feature = feature.upper() - enabled = 'yes' if enabled else 'no' - rules_mk_lines.append(generate_rule(f'{feature}_ENABLE', enabled)) + rules_mk_lines.extend(generate_features_rules(kb_info_json['features'])) # Set SPLIT_TRANSPORT, if needed if kb_info_json.get('split', {}).get('transport', {}).get('protocol') == 'custom': @@ -99,6 +133,8 @@ def generate_rules_mk(cli): if converter: rules_mk_lines.append(generate_rule('CONVERT_TO', converter)) + rules_mk_lines.extend(generate_modules_rules(cli.args.keyboard, cli.args.filename)) + # Show the results dump_lines(cli.args.output, rules_mk_lines) diff --git a/lib/python/qmk/cli/info.py b/lib/python/qmk/cli/info.py index e662407474e9..5925b5725898 100755 --- a/lib/python/qmk/cli/info.py +++ b/lib/python/qmk/cli/info.py @@ -52,6 +52,11 @@ def show_keymap(kb_info_json, title_caps=True): if keymap_path and keymap_path.suffix == '.json': keymap_data = json.load(keymap_path.open(encoding='utf-8')) + + # cater for layout-less keymap.json + if 'layout' not in keymap_data: + return + layout_name = keymap_data['layout'] layout_name = kb_info_json.get('layout_aliases', {}).get(layout_name, layout_name) # Resolve alias names diff --git a/lib/python/qmk/cli/lint.py b/lib/python/qmk/cli/lint.py index efb29704ae39..c09e377ad679 100644 --- a/lib/python/qmk/cli/lint.py +++ b/lib/python/qmk/cli/lint.py @@ -10,7 +10,7 @@ from qmk.keymap import locate_keymap, list_keymaps from qmk.path import keyboard from qmk.git import git_get_ignored_files -from qmk.c_parse import c_source_files +from qmk.c_parse import c_source_files, preprocess_c_file CHIBIOS_CONF_CHECKS = ['chconf.h', 'halconf.h', 'mcuconf.h', 'board.h'] INVALID_KB_FEATURES = set(['encoder_map', 'dip_switch_map', 'combo', 'tap_dance', 'via']) @@ -33,12 +33,64 @@ def _list_defaultish_keymaps(kb): return keymaps +def _get_readme_files(kb, km=None): + """Return potential keyboard/keymap readme files + """ + search_path = locate_keymap(kb, km).parent if km else keyboard(kb) + + readme_files = [] + + if not km: + current_path = Path(search_path.parts[0]) + for path_part in search_path.parts[1:]: + current_path = current_path / path_part + readme_files.extend(current_path.glob('*readme.md')) + + for file in search_path.glob("**/*readme.md"): + # Ignore keymaps when only globing keyboard files + if not km and 'keymaps' in file.parts: + continue + readme_files.append(file) + + return set(readme_files) + + +def _get_build_files(kb, km=None): + """Return potential keyboard/keymap build files + """ + search_path = locate_keymap(kb, km).parent if km else keyboard(kb) + + build_files = [] + + if not km: + current_path = Path() + for path_part in search_path.parts: + current_path = current_path / path_part + build_files.extend(current_path.glob('*rules.mk')) + + for file in search_path.glob("**/*rules.mk"): + # Ignore keymaps when only globing keyboard files + if not km and 'keymaps' in file.parts: + continue + build_files.append(file) + + return set(build_files) + + def _get_code_files(kb, km=None): """Return potential keyboard/keymap code files """ search_path = locate_keymap(kb, km).parent if km else keyboard(kb) code_files = [] + + if not km: + current_path = Path() + for path_part in search_path.parts: + current_path = current_path / path_part + code_files.extend(current_path.glob('*.h')) + code_files.extend(current_path.glob('*.c')) + for file in c_source_files([search_path]): # Ignore keymaps when only globing keyboard files if not km and 'keymaps' in file.parts: @@ -48,6 +100,43 @@ def _get_code_files(kb, km=None): return code_files +def _is_invalid_readme(file): + """Check if file contains any unfilled content + """ + tokens = [ + '%KEYBOARD%', + '%REAL_NAME%', + '%USER_NAME%', + 'image replace me!', + 'A short description of the keyboard/project', + 'The PCBs, controllers supported', + 'Links to where you can find this hardware', + ] + + for line in file.read_text(encoding='utf-8').split("\n"): + if any(token in line for token in tokens): + return True + return False + + +def _is_empty_rules(file): + """Check if file contains any useful content + """ + for line in file.read_text(encoding='utf-8').split("\n"): + if len(line) > 0 and not line.isspace() and not line.startswith('#'): + return False + return True + + +def _is_empty_include(file): + """Check if file contains any useful content + """ + for line in preprocess_c_file(file).split("\n"): + if len(line) > 0 and not line.isspace() and not line.startswith('#pragma once'): + return False + return True + + def _has_license(file): """Check file has a license header """ @@ -91,37 +180,28 @@ def _chibios_conf_includenext_check(target): return None -def _rules_mk_assignment_only(kb): +def _rules_mk_assignment_only(rules_mk): """Check the keyboard-level rules.mk to ensure it only has assignments. """ - keyboard_path = keyboard(kb) - current_path = Path() errors = [] + continuation = None + for i, line in enumerate(rules_mk.open()): + line = line.strip() - for path_part in keyboard_path.parts: - current_path = current_path / path_part - rules_mk = current_path / 'rules.mk' + if '#' in line: + line = line[:line.index('#')] - if rules_mk.exists(): + if continuation: + line = continuation + line continuation = None - for i, line in enumerate(rules_mk.open()): - line = line.strip() - - if '#' in line: - line = line[:line.index('#')] - - if continuation: - line = continuation + line - continuation = None + if line: + if line[-1] == '\\': + continuation = line[:-1] + continue - if line: - if line[-1] == '\\': - continuation = line[:-1] - continue - - if line and '=' not in line: - errors.append(f'Non-assignment code on line +{i} {rules_mk}: {line}') + if line and '=' not in line: + errors.append(f'Non-assignment code on line +{i} {rules_mk}: {line}') return errors @@ -162,7 +242,7 @@ def keymap_check(kb, km): return ok -def keyboard_check(kb): +def keyboard_check(kb): # noqa C901 """Perform the keyboard level checks. """ ok = True @@ -175,13 +255,6 @@ def keyboard_check(kb): if not _handle_invalid_features(kb, kb_info): ok = False - rules_mk_assignment_errors = _rules_mk_assignment_only(kb) - if rules_mk_assignment_errors: - ok = False - cli.log.error('%s: Non-assignment code found in rules.mk. Move it to post_rules.mk instead.', kb) - for assignment_error in rules_mk_assignment_errors: - cli.log.error(assignment_error) - invalid_files = git_get_ignored_files(f'keyboards/{kb}/') for file in invalid_files: if 'keymap' in file: @@ -189,11 +262,34 @@ def keyboard_check(kb): cli.log.error(f'{kb}: The file "{file}" should not exist!') ok = False + for file in _get_readme_files(kb): + if _is_invalid_readme(file): + cli.log.error(f'{kb}: The file "{file}" still contains template tokens!') + ok = False + + for file in _get_build_files(kb): + if _is_empty_rules(file): + cli.log.error(f'{kb}: The file "{file}" is effectively empty and should be removed!') + ok = False + + if file.suffix in ['rules.mk']: + rules_mk_assignment_errors = _rules_mk_assignment_only(file) + if rules_mk_assignment_errors: + ok = False + cli.log.error('%s: Non-assignment code found in rules.mk. Move it to post_rules.mk instead.', kb) + for assignment_error in rules_mk_assignment_errors: + cli.log.error(assignment_error) + for file in _get_code_files(kb): if not _has_license(file): cli.log.error(f'{kb}: The file "{file}" does not have a license header!') ok = False + if file.name in ['config.h']: + if _is_empty_include(file): + cli.log.error(f'{kb}: The file "{file}" is effectively empty and should be removed!') + ok = False + if file.name in CHIBIOS_CONF_CHECKS: check_error = _chibios_conf_includenext_check(file) if check_error is not None: diff --git a/lib/python/qmk/cli/new/keymap.py b/lib/python/qmk/cli/new/keymap.py index f1df05636ce3..8b7160f5f2c2 100755 --- a/lib/python/qmk/cli/new/keymap.py +++ b/lib/python/qmk/cli/new/keymap.py @@ -23,19 +23,17 @@ def validate_keymap_name(name): def prompt_keyboard(): prompt = """{fg_yellow}Select Keyboard{style_reset_all} -If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}. +If you're unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}. Keyboard Name? """ - return question(prompt) def prompt_user(): prompt = """ {fg_yellow}Name Your Keymap{style_reset_all} -Used for maintainer, copyright, etc -Your GitHub Username? """ +Keymap name? """ return question(prompt, default=git_get_username()) diff --git a/lib/python/qmk/cli/resolve_alias.py b/lib/python/qmk/cli/resolve_alias.py new file mode 100644 index 000000000000..b9ffb4661811 --- /dev/null +++ b/lib/python/qmk/cli/resolve_alias.py @@ -0,0 +1,16 @@ +from qmk.keyboard import keyboard_folder + +from milc import cli + + +@cli.argument('--allow-unknown', arg_only=True, action='store_true', help="Return original if rule is not a valid keyboard.") +@cli.argument('keyboard', arg_only=True, help='The keyboard\'s name') +@cli.subcommand('Resolve DEFAULT_FOLDER and any keyboard_aliases for provided rule') +def resolve_alias(cli): + try: + print(keyboard_folder(cli.args.keyboard)) + except ValueError: + if cli.args.allow_unknown: + print(cli.args.keyboard) + else: + raise diff --git a/lib/python/qmk/cli/via2json.py b/lib/python/qmk/cli/via2json.py index 537e1026406d..0997e9ca9f8e 100755 --- a/lib/python/qmk/cli/via2json.py +++ b/lib/python/qmk/cli/via2json.py @@ -9,19 +9,15 @@ import qmk.path from qmk.info import info_json from qmk.json_encoders import KeymapJSONEncoder -from qmk.commands import parse_configurator_json, dump_lines -from qmk.keymap import generate_json, list_keymaps, locate_keymap, parse_keymap_c +from qmk.commands import dump_lines +from qmk.keymap import generate_json -def _find_via_layout_macro(keyboard): - keymap_layout = None - if 'via' in list_keymaps(keyboard): - keymap_path = locate_keymap(keyboard, 'via') - if keymap_path.suffix == '.json': - keymap_layout = parse_configurator_json(keymap_path)['layout'] - else: - keymap_layout = parse_keymap_c(keymap_path)['layers'][0]['layout'] - return keymap_layout +def _find_via_layout_macro(keyboard_data): + """Assume layout macro when only 1 is available + """ + layouts = list(keyboard_data['layouts'].keys()) + return layouts[0] if len(layouts) == 1 else None def _convert_macros(via_macros): @@ -130,20 +126,16 @@ def via2json(cli): This command uses the `qmk.keymap` module to generate a keymap.json from a VIA backup json. The generated keymap is written to stdout, or to a file if -o is provided. """ - # Find appropriate layout macro - keymap_layout = cli.args.layout if cli.args.layout else _find_via_layout_macro(cli.args.keyboard) - if not keymap_layout: - cli.log.error(f"Couldn't find LAYOUT macro for keyboard {cli.args.keyboard}. Please specify it with the '-l' argument.") - return False - # Load the VIA backup json with cli.args.filename.open('r') as fd: via_backup = json.load(fd) - # Generate keyboard metadata keyboard_data = info_json(cli.args.keyboard) - if not keyboard_data: - cli.log.error(f'LAYOUT macro {keymap_layout} is not a valid one for keyboard {cli.args.keyboard}!') + + # Find appropriate layout macro + keymap_layout = cli.args.layout if cli.args.layout else _find_via_layout_macro(keyboard_data) + if not keymap_layout: + cli.log.error(f"Couldn't find LAYOUT macro for keyboard {cli.args.keyboard}. Please specify it with the '-l' argument.") return False # Get keycode array diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index a05b3641b5ca..0e1876ca7ae5 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -98,11 +98,14 @@ def in_virtualenv(): return active_prefix != sys.prefix -def dump_lines(output_file, lines, quiet=True): +def dump_lines(output_file, lines, quiet=True, remove_repeated_newlines=False): """Handle dumping to stdout or file Creates parent folders if required """ generated = '\n'.join(lines) + '\n' + if remove_repeated_newlines: + while '\n\n\n' in generated: + generated = generated.replace('\n\n\n', '\n\n') if output_file and output_file.name != '-': output_file.parent.mkdir(parents=True, exist_ok=True) if output_file.exists(): diff --git a/lib/python/qmk/community_modules.py b/lib/python/qmk/community_modules.py new file mode 100644 index 000000000000..f7e96a6b93ea --- /dev/null +++ b/lib/python/qmk/community_modules.py @@ -0,0 +1,100 @@ +import os + +from pathlib import Path +from functools import lru_cache + +from milc.attrdict import AttrDict + +from qmk.json_schema import json_load, validate, merge_ordered_dicts +from qmk.util import truthy +from qmk.constants import QMK_FIRMWARE, QMK_USERSPACE, HAS_QMK_USERSPACE +from qmk.path import under_qmk_firmware, under_qmk_userspace + +COMMUNITY_MODULE_JSON_FILENAME = 'qmk_module.json' + + +class ModuleAPI(AttrDict): + def __init__(self, **kwargs): + super().__init__() + for key, value in kwargs.items(): + self[key] = value + + +@lru_cache(maxsize=1) +def module_api_list(): + module_definition_files = sorted(set(QMK_FIRMWARE.glob('data/constants/module_hooks/*.hjson'))) + module_definition_jsons = [json_load(f) for f in module_definition_files] + module_definitions = merge_ordered_dicts(module_definition_jsons) + latest_module_version = module_definition_files[-1].stem + latest_module_version_parts = latest_module_version.split('.') + + api_list = [] + for name, mod in module_definitions.items(): + api_list.append(ModuleAPI( + ret_type=mod['ret_type'], + name=name, + args=mod['args'], + call_params=mod.get('call_params', ''), + guard=mod.get('guard', None), + header=mod.get('header', None), + )) + + return api_list, latest_module_version, latest_module_version_parts[0], latest_module_version_parts[1], latest_module_version_parts[2] + + +def find_available_module_paths(): + """Find all available modules. + """ + search_dirs = [] + if HAS_QMK_USERSPACE: + search_dirs.append(QMK_USERSPACE / 'modules') + search_dirs.append(QMK_FIRMWARE / 'modules') + + modules = [] + for search_dir in search_dirs: + for module_json_path in search_dir.rglob(COMMUNITY_MODULE_JSON_FILENAME): + modules.append(module_json_path.parent) + return modules + + +def find_module_path(module): + """Find a module by name. + """ + for module_path in find_available_module_paths(): + # Ensure the module directory is under QMK Firmware or QMK Userspace + relative_path = under_qmk_firmware(module_path) + if not relative_path: + relative_path = under_qmk_userspace(module_path) + if not relative_path: + continue + + lhs = str(relative_path.as_posix())[len('modules/'):] + rhs = str(Path(module).as_posix()) + + if relative_path and lhs == rhs: + return module_path + return None + + +def load_module_json(module): + """Load a module JSON file. + """ + module_path = find_module_path(module) + if not module_path: + raise FileNotFoundError(f'Module not found: {module}') + + module_json = json_load(module_path / COMMUNITY_MODULE_JSON_FILENAME) + + if not truthy(os.environ.get('SKIP_SCHEMA_VALIDATION'), False): + validate(module_json, 'qmk.community_module.v1') + + module_json['module'] = module + module_json['module_path'] = module_path + + return module_json + + +def load_module_jsons(modules): + """Load the module JSON files, matching the specified order. + """ + return list(map(load_module_json, modules)) diff --git a/lib/python/qmk/docs.py b/lib/python/qmk/docs.py index 56694cf6aeb0..75d2d60bda1a 100644 --- a/lib/python/qmk/docs.py +++ b/lib/python/qmk/docs.py @@ -17,18 +17,18 @@ DOXYGEN_PATH = BUILD_DOCS_PATH / 'static' / 'doxygen' -def run_docs_command(verb, cmd=None): +def run_docs_command(verb, cmd_args=None): environ['PATH'] += pathsep + str(NODE_MODULES_PATH / '.bin') - args = {'capture_output': False if cli.config.general.verbose else True, 'check': True, 'stdin': DEVNULL} + args = {'capture_output': False, 'check': True} docs_env = environ.copy() if cli.config.general.verbose: docs_env['DEBUG'] = 'vitepress:*,vite:*' args['env'] = docs_env arg_list = ['yarn', verb] - if cmd: - arg_list.append(cmd) + if cmd_args: + arg_list.extend(cmd_args) chdir(BUILDDEFS_PATH) cli.run(arg_list, **args) diff --git a/lib/python/qmk/flashers.py b/lib/python/qmk/flashers.py index 7ee1bc8de73e..2cca4941d33d 100644 --- a/lib/python/qmk/flashers.py +++ b/lib/python/qmk/flashers.py @@ -202,6 +202,10 @@ def _flash_mdloader(file): def _flash_uf2(file): + output = cli.run(['util/uf2conv.py', '--info', file]).stdout + if 'UF2 File' not in output: + return True + cli.run(['util/uf2conv.py', '--deploy', file], capture_output=False) @@ -235,7 +239,8 @@ def flasher(mcu, file): elif bl == 'md-boot': _flash_mdloader(file) elif bl == '_uf2_compatible_': - _flash_uf2(file) + if _flash_uf2(file): + return (True, "Flashing only supports uf2 format files.") else: return (True, "Known bootloader found but flashing not currently supported!") diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index d70e7ee1b37d..93eba7376aef 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -1059,3 +1059,30 @@ def keymap_json(keyboard, keymap, force_layout=None): _extract_config_h(kb_info_json, parse_config_h_file(keymap_config)) return kb_info_json + + +def get_modules(keyboard, keymap_filename): + """Get the modules for a keyboard/keymap. + """ + modules = [] + + if keymap_filename: + keymap_json = parse_configurator_json(keymap_filename) + + if keymap_json: + kb = keymap_json.get('keyboard', None) + if not kb: + kb = keyboard + + if kb: + kb_info_json = info_json(kb) + if kb_info_json: + modules.extend(kb_info_json.get('modules', [])) + + modules.extend(keymap_json.get('modules', [])) + + elif keyboard: + kb_info_json = info_json(keyboard) + modules.extend(kb_info_json.get('modules', [])) + + return list(dict.fromkeys(modules)) # remove dupes diff --git a/lib/python/qmk/json_encoders.py b/lib/python/qmk/json_encoders.py index 0e4ad1d22028..e83a381d5200 100755 --- a/lib/python/qmk/json_encoders.py +++ b/lib/python/qmk/json_encoders.py @@ -235,3 +235,31 @@ def sort_dict(self, item): return '01build_targets' return key + + +class CommunityModuleJSONEncoder(QMKJSONEncoder): + """Custom encoder to make qmk_module.json's a little nicer to work with. + """ + def sort_dict(self, item): + """Sorts the hashes in a nice way. + """ + key = item[0] + + if self.indentation_level == 1: + if key == 'module_name': + return '00module_name' + if key == 'maintainer': + return '01maintainer' + if key == 'url': + return '02url' + if key == 'features': + return '03features' + if key == 'keycodes': + return '04keycodes' + elif self.indentation_level == 3: # keycodes + if key == 'key': + return '00key' + if key == 'aliases': + return '01aliases' + + return key diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py index 9dd043c4a898..8e36461722be 100644 --- a/lib/python/qmk/keymap.py +++ b/lib/python/qmk/keymap.py @@ -334,33 +334,6 @@ def write_json(keyboard, keymap, layout, layers, macros=None): return write_file(keymap_file, keymap_content) -def write(keymap_json): - """Generate the `keymap.c` and write it to disk. - - Returns the filename written to. - - `keymap_json` should be a dict with the following keys: - keyboard - The name of the keyboard - - keymap - The name of the keymap - - layout - The LAYOUT macro this keymap uses. - - layers - An array of arrays describing the keymap. Each item in the inner array should be a string that is a valid QMK keycode. - - macros - A list of macros for this keymap. - """ - keymap_content = generate_c(keymap_json) - keymap_file = qmk.path.keymaps(keymap_json['keyboard'])[0] / keymap_json['keymap'] / 'keymap.c' - - return write_file(keymap_file, keymap_content) - - def locate_keymap(keyboard, keymap, force_layout=None): """Returns the path to a keymap for a specific keyboard. """ diff --git a/modules/qmk/hello_world/hello_world.c b/modules/qmk/hello_world/hello_world.c new file mode 100644 index 000000000000..d9dd3661007f --- /dev/null +++ b/modules/qmk/hello_world/hello_world.c @@ -0,0 +1,33 @@ +// Copyright 2025 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +#include "introspection.h" + +ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(1, 0, 0); + +uint32_t delayed_hello_world(uint32_t trigger_time, void *cb_arg) { + printf("Hello, world! I'm a QMK based keyboard! The keymap array size is %d bytes.\n", (int)hello_world_introspection().total_size); + return 0; +} + +void keyboard_post_init_hello_world(void) { + keyboard_post_init_hello_world_kb(); + defer_exec(10000, delayed_hello_world, NULL); +} + +bool process_record_hello_world(uint16_t keycode, keyrecord_t *record) { + if (!process_record_hello_world_kb(keycode, record)) { + return false; + } + + switch (keycode) { + case COMMUNITY_MODULE_HELLO: + if (record->event.pressed) { + SEND_STRING("Hello there."); + break; + } + } + + return true; +} diff --git a/modules/qmk/hello_world/introspection.c b/modules/qmk/hello_world/introspection.c new file mode 100644 index 000000000000..2c32a074f518 --- /dev/null +++ b/modules/qmk/hello_world/introspection.c @@ -0,0 +1,10 @@ +// Copyright 2025 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +hello_world_introspection_t hello_world_introspection(void) { + hello_world_introspection_t introspection = { + .total_size = sizeof(keymaps), + .layer_count = sizeof(keymaps) / sizeof(keymaps[0]), + }; + return introspection; +} diff --git a/modules/qmk/hello_world/introspection.h b/modules/qmk/hello_world/introspection.h new file mode 100644 index 000000000000..fd3d7f24a054 --- /dev/null +++ b/modules/qmk/hello_world/introspection.h @@ -0,0 +1,10 @@ +// Copyright 2025 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +typedef struct hello_world_introspection_t { + int16_t total_size; + int16_t layer_count; +} hello_world_introspection_t; + +hello_world_introspection_t hello_world_introspection(void); diff --git a/modules/qmk/hello_world/qmk_module.json b/modules/qmk/hello_world/qmk_module.json new file mode 100644 index 000000000000..fd855a6e2370 --- /dev/null +++ b/modules/qmk/hello_world/qmk_module.json @@ -0,0 +1,14 @@ +{ + "module_name": "Hello World", + "maintainer": "QMK Maintainers", + "features": { + "console": true, + "deferred_exec": true + }, + "keycodes": [ + { + "key": "COMMUNITY_MODULE_HELLO", + "aliases": ["CM_HELO"] + } + ] +} diff --git a/modules/qmk/hello_world/rules.mk b/modules/qmk/hello_world/rules.mk new file mode 100644 index 000000000000..91806fb1e3c1 --- /dev/null +++ b/modules/qmk/hello_world/rules.mk @@ -0,0 +1,2 @@ +# Just a simple rules.mk which tests that they work from a community module. +$(shell $(QMK_BIN) hello -n "from QMK's hello world community module") diff --git a/platforms/avr/drivers/i2c_master.h b/platforms/avr/drivers/i2c_master.h deleted file mode 100644 index b797997619e2..000000000000 --- a/platforms/avr/drivers/i2c_master.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 2019 Elia Ritterbusch - + - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -/* Library made by: g4lvanix - * GitHub repository: https://github.com/g4lvanix/I2C-master-lib - */ - -#pragma once - -#include - -// ### DEPRECATED - DO NOT USE ### -#define i2c_writeReg(devaddr, regaddr, data, length, timeout) i2c_write_register(devaddr, regaddr, data, length, timeout) -#define i2c_writeReg16(devaddr, regaddr, data, length, timeout) i2c_write_register16(devaddr, regaddr, data, length, timeout) -#define i2c_readReg(devaddr, regaddr, data, length, timeout) i2c_read_register(devaddr, regaddr, data, length, timeout) -#define i2c_readReg16(devaddr, regaddr, data, length, timeout) i2c_read_register16(devaddr, regaddr, data, length, timeout) -// ############################### - -#define I2C_READ 0x01 -#define I2C_WRITE 0x00 - -typedef int16_t i2c_status_t; - -#define I2C_STATUS_SUCCESS (0) -#define I2C_STATUS_ERROR (-1) -#define I2C_STATUS_TIMEOUT (-2) - -#define I2C_TIMEOUT_IMMEDIATE (0) -#define I2C_TIMEOUT_INFINITE (0xFFFF) - -void i2c_init(void); -i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout); diff --git a/platforms/avr/drivers/spi_master.h b/platforms/avr/drivers/spi_master.h deleted file mode 100644 index ebbf7ddeab93..000000000000 --- a/platforms/avr/drivers/spi_master.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright 2020 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include - -#include "gpio.h" - -typedef int16_t spi_status_t; - -// Hardware SS pin is defined in the header so that user code can refer to it -#if defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) -# define SPI_SS_PIN B0 -#elif defined(__AVR_ATmega32A__) -# define SPI_SS_PIN B4 -#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) -# define SPI_SS_PIN B2 -#endif - -#define SPI_STATUS_SUCCESS (0) -#define SPI_STATUS_ERROR (-1) -#define SPI_STATUS_TIMEOUT (-2) - -#define SPI_TIMEOUT_IMMEDIATE (0) -#define SPI_TIMEOUT_INFINITE (0xFFFF) - -#ifdef __cplusplus -extern "C" { -#endif -typedef struct spi_start_config_t { - pin_t slave_pin; - bool lsb_first; - uint8_t mode; - uint16_t divisor; - bool cs_active_low; -} spi_start_config_t; - -void spi_init(void); - -bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); -bool spi_start_extended(spi_start_config_t *start_config); - -spi_status_t spi_write(uint8_t data); - -spi_status_t spi_read(void); - -spi_status_t spi_transmit(const uint8_t *data, uint16_t length); - -spi_status_t spi_receive(uint8_t *data, uint16_t length); - -void spi_stop(void); -#ifdef __cplusplus -} -#endif diff --git a/platforms/avr/drivers/uart.h b/platforms/avr/drivers/uart.h deleted file mode 100644 index e2dc664eda57..000000000000 --- a/platforms/avr/drivers/uart.h +++ /dev/null @@ -1,39 +0,0 @@ -/* UART Example for Teensy USB Development Board - * http://www.pjrc.com/teensy/ - * Copyright (c) 2009 PJRC.COM, LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#pragma once - -#include -#include - -void uart_init(uint32_t baud); - -void uart_write(uint8_t data); - -uint8_t uart_read(void); - -void uart_transmit(const uint8_t *data, uint16_t length); - -void uart_receive(uint8_t *data, uint16_t length); - -bool uart_available(void); diff --git a/platforms/avr/timer.c b/platforms/avr/timer.c index 26ba0e29fa2d..b2230ad84b91 100644 --- a/platforms/avr/timer.c +++ b/platforms/avr/timer.c @@ -125,34 +125,6 @@ inline uint32_t timer_read32(void) { return t; } -/** \brief timer elapsed - * - * FIXME: needs doc - */ -inline uint16_t timer_elapsed(uint16_t last) { - uint32_t t; - - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { - t = timer_count; - } - - return TIMER_DIFF_16((t & 0xFFFF), last); -} - -/** \brief timer elapsed32 - * - * FIXME: needs doc - */ -inline uint32_t timer_elapsed32(uint32_t last) { - uint32_t t; - - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { - t = timer_count; - } - - return TIMER_DIFF_32(t, last); -} - // excecuted once per 1ms.(excess for just timer count?) #ifndef __AVR_ATmega32A__ # define TIMER_INTERRUPT_VECTOR TIMER0_COMPA_vect diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c index 28cf7c18e016..26b1974e4a2b 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c @@ -1,7 +1,7 @@ /* ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio - ChibiOS - Copyright (C) 2023..2024 HorrorTroll - ChibiOS - Copyright (C) 2023..2024 Zhaqian + ChibiOS - Copyright (C) 2023..2025 HorrorTroll + ChibiOS - Copyright (C) 2023..2025 Zhaqian Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h index c3ade198bae5..b4909b0a29e7 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h @@ -1,7 +1,7 @@ /* ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio - ChibiOS - Copyright (C) 2023..2024 HorrorTroll - ChibiOS - Copyright (C) 2023..2024 Zhaqian + ChibiOS - Copyright (C) 2023..2025 HorrorTroll + ChibiOS - Copyright (C) 2023..2025 Zhaqian Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,6 +49,14 @@ */ #define AT32F415KB +/* + * GPIO settings, allow unused GPIO for smaller chip packages. + */ +#if defined(AT32F415KB) || defined(AT32F415KC) +#define AT32_HAS_GPIOC TRUE +#define AT32_HAS_GPIOF TRUE +#endif + /* * IO pins assignments. */ @@ -142,21 +150,21 @@ * 6 - Open Drain output 2MHz. * 7 - Open Drain output 50MHz. * 8 - Digital input with Pull-Up or Pull-Down resistor depending on ODT. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. + * 9 - Multiplexing Push Pull output 10MHz. + * A - Multiplexing Push Pull output 2MHz. + * B - Multiplexing Push Pull output 50MHz. * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. + * D - Multiplexing Open Drain output 10MHz. + * E - Multiplexing Open Drain output 2MHz. + * F - Multiplexing Open Drain output 50MHz. * Please refer to the AT32 Reference Manual for details. */ /* * Port A setup. */ -#define VAL_GPIOACFGLR 0x88888B88 /* PA7...PA0 */ -#define VAL_GPIOACFGHR 0x888888B8 /* PA15...PA8 */ +#define VAL_GPIOACFGLR 0x88888888 /* PA7...PA0 */ +#define VAL_GPIOACFGHR 0x88888888 /* PA15...PA8 */ #define VAL_GPIOAODT 0xFFFFFFFF /* diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h index da60447a0af0..01d9a47aac79 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h @@ -1,5 +1,5 @@ -// Copyright 2023-2024 HorrorTroll -// Copyright 2023-2024 Zhaqian +// Copyright 2023-2025 HorrorTroll +// Copyright 2023-2025 Zhaqian // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h index d148379fe1db..e218e4791aac 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h @@ -1,7 +1,7 @@ /* ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio - ChibiOS - Copyright (C) 2023..2024 HorrorTroll - ChibiOS - Copyright (C) 2023..2024 Zhaqian + ChibiOS - Copyright (C) 2023..2025 HorrorTroll + ChibiOS - Copyright (C) 2023..2025 Zhaqian Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ #define AT32_USBDIV AT32_USBDIV_DIV3 #define AT32_CLKOUT_SEL AT32_CLKOUT_SEL_NOCLOCK #define AT32_CLKOUTDIV AT32_CLKOUTDIV_DIV1 -#define AT32_ERTCSEL AT32_ERTCSEL_HEXTDIV +#define AT32_ERTCSEL AT32_ERTCSEL_NOCLOCK #define AT32_PVM_ENABLE FALSE #define AT32_PVMSEL AT32_PVMSEL_LEV1 @@ -136,10 +136,10 @@ #define AT32_I2C_USE_I2C1 FALSE #define AT32_I2C_USE_I2C2 FALSE #define AT32_I2C_BUSY_TIMEOUT 50 -#define AT32_I2C_I2C1_IRQ_PRIORITY 5 -#define AT32_I2C_I2C2_IRQ_PRIORITY 5 #define AT32_I2C_I2C1_DMA_PRIORITY 3 #define AT32_I2C_I2C2_DMA_PRIORITY 3 +#define AT32_I2C_I2C1_IRQ_PRIORITY 5 +#define AT32_I2C_I2C2_IRQ_PRIORITY 5 #define AT32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* @@ -151,8 +151,6 @@ #define AT32_ICU_USE_TMR4 FALSE #define AT32_ICU_USE_TMR5 FALSE #define AT32_ICU_USE_TMR9 FALSE -#define AT32_ICU_USE_TMR10 FALSE -#define AT32_ICU_USE_TMR11 FALSE /* * PWM driver system settings. @@ -216,9 +214,13 @@ #define AT32_UART_USE_USART1 FALSE #define AT32_UART_USE_USART2 FALSE #define AT32_UART_USE_USART3 FALSE +#define AT32_UART_USE_UART4 FALSE +#define AT32_UART_USE_UART5 FALSE #define AT32_UART_USART1_DMA_PRIORITY 0 #define AT32_UART_USART2_DMA_PRIORITY 0 #define AT32_UART_USART3_DMA_PRIORITY 0 +#define AT32_UART_UART4_DMA_PRIORITY 0 +#define AT32_UART_UART5_DMA_PRIORITY 0 #define AT32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") /* diff --git a/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h index 0239ec5273b5..09096c397789 100644 --- a/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h +++ b/platforms/chibios/boards/GENERIC_STM32_H723XG/configs/mcuconf.h @@ -182,6 +182,7 @@ #define STM32_IRQ_FDCAN1_PRIORITY 10 #define STM32_IRQ_FDCAN2_PRIORITY 10 +#define STM32_IRQ_FDCAN3_PRIORITY 10 #define STM32_IRQ_MDMA_PRIORITY 9 @@ -235,6 +236,7 @@ */ #define STM32_CAN_USE_FDCAN1 FALSE #define STM32_CAN_USE_FDCAN2 FALSE +#define STM32_CAN_USE_FDCAN3 FALSE /* * DAC driver system settings. diff --git a/platforms/chibios/boards/QMK_PROTON_C/configs/chconf.h b/platforms/chibios/boards/QMK_PROTON_C/configs/chconf.h index cc10304a3fb6..e92b7aeb9847 100644 --- a/platforms/chibios/boards/QMK_PROTON_C/configs/chconf.h +++ b/platforms/chibios/boards/QMK_PROTON_C/configs/chconf.h @@ -49,6 +49,19 @@ #define CH_CFG_SMP_MODE FALSE #endif +/** + * @brief Kernel hardening level. + * @details This option is the level of functional-safety checks enabled + * in the kerkel. The meaning is: + * - 0: No checks, maximum performance. + * - 1: Reasonable checks. + * - 2: All checks. + * . + */ +#if !defined(CH_CFG_HARDENING_LEVEL) +#define CH_CFG_HARDENING_LEVEL 0 +#endif + /** @} */ /*===========================================================================*/ @@ -360,6 +373,16 @@ #define CH_CFG_USE_MAILBOXES TRUE #endif +/** + * @brief Memory checks APIs. + * @details If enabled then the memory checks APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_CFG_USE_MEMCHECKS) +#define CH_CFG_USE_MEMCHECKS TRUE +#endif + /** * @brief Core Memory Manager APIs. * @details If enabled then the core memory manager APIs are included diff --git a/platforms/chibios/boards/common/configs/chconf.h b/platforms/chibios/boards/common/configs/chconf.h index 5db836e37c2b..6381298ef7b1 100644 --- a/platforms/chibios/boards/common/configs/chconf.h +++ b/platforms/chibios/boards/common/configs/chconf.h @@ -49,6 +49,19 @@ #define CH_CFG_SMP_MODE FALSE #endif +/** + * @brief Kernel hardening level. + * @details This option is the level of functional-safety checks enabled + * in the kerkel. The meaning is: + * - 0: No checks, maximum performance. + * - 1: Reasonable checks. + * - 2: All checks. + * . + */ +#if !defined(CH_CFG_HARDENING_LEVEL) +#define CH_CFG_HARDENING_LEVEL 0 +#endif + /** @} */ /*===========================================================================*/ @@ -360,6 +373,16 @@ #define CH_CFG_USE_MAILBOXES FALSE #endif +/** + * @brief Memory checks APIs. + * @details If enabled then the memory checks APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_CFG_USE_MEMCHECKS) +#define CH_CFG_USE_MEMCHECKS TRUE +#endif + /** * @brief Core Memory Manager APIs. * @details If enabled then the core memory manager APIs are included diff --git a/platforms/chibios/chibios_config.h b/platforms/chibios/chibios_config.h index 95136baf3032..9ef8e9b4fef0 100644 --- a/platforms/chibios/chibios_config.h +++ b/platforms/chibios/chibios_config.h @@ -149,8 +149,8 @@ # if defined(AT32F415) # define USE_GPIOV1 # define USE_I2CV1 -# define PAL_MODE_ALTERNATE_OPENDRAIN PAL_MODE_AT32_ALTERNATE_OPENDRAIN -# define PAL_MODE_ALTERNATE_PUSHPULL PAL_MODE_AT32_ALTERNATE_PUSHPULL +# define PAL_MODE_ALTERNATE_OPENDRAIN PAL_MODE_AT32_MUX_OPENDRAIN +# define PAL_MODE_ALTERNATE_PUSHPULL PAL_MODE_AT32_MUX_PUSHPULL # define AUDIO_PWM_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL # endif #endif diff --git a/platforms/chibios/drivers/audio_pwm_hardware.c b/platforms/chibios/drivers/audio_pwm_hardware.c index 1ba7ec13bcfd..afa341abb603 100644 --- a/platforms/chibios/drivers/audio_pwm_hardware.c +++ b/platforms/chibios/drivers/audio_pwm_hardware.c @@ -41,18 +41,19 @@ static float channel_1_frequency = 0.0f; void channel_1_set_frequency(float freq) { channel_1_frequency = freq; + pwmcnt_t period; + pwmcnt_t width; if (freq <= 0.0) { - // a pause/rest has freq=0 - return; + period = 2; + width = 0; + } else { + period = (pwmCFG.frequency / freq); + width = (pwmcnt_t)(((period) * (pwmcnt_t)((100 - note_timbre) * 100)) / (pwmcnt_t)(10000)); } - - pwmcnt_t period = (pwmCFG.frequency / freq); chSysLockFromISR(); pwmChangePeriodI(&AUDIO_PWM_DRIVER, period); - pwmEnableChannelI(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, - // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH - PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); + pwmEnableChannelI(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, width); chSysUnlockFromISR(); } @@ -67,6 +68,9 @@ void channel_1_start(void) { void channel_1_stop(void) { pwmStop(&AUDIO_PWM_DRIVER); + pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG); + pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, 0); + pwmStop(&AUDIO_PWM_DRIVER); } static virtual_timer_t audio_vt; diff --git a/platforms/chibios/drivers/backlight_pwm.c b/platforms/chibios/drivers/backlight_pwm.c index 25fe7962b024..47ad0084156b 100644 --- a/platforms/chibios/drivers/backlight_pwm.c +++ b/platforms/chibios/drivers/backlight_pwm.c @@ -28,9 +28,9 @@ // Support for pins which are on TIM1_CH1N #ifdef BACKLIGHT_PWM_COMPLEMENTARY_OUTPUT # if BACKLIGHT_ON_STATE == 1 -# define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW; -# else # define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH; +# else +# define PWM_OUTPUT_MODE PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW; # endif #else # if BACKLIGHT_ON_STATE == 1 diff --git a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c index 628137a0b357..31062a481672 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c +++ b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c @@ -25,6 +25,7 @@ #define EEPROM_ADDR(offset) (EEPROM_BASE_ADDR + (offset)) #define EEPROM_PTR(offset) ((__IO uint8_t *)EEPROM_ADDR(offset)) #define EEPROM_BYTE(location, offset) (*(EEPROM_PTR(((uint32_t)location) + ((uint32_t)offset)))) +#define EEPROM_WORD(location) (*(__IO uint32_t *)EEPROM_PTR(location)) #define BUFFER_BYTE(buffer, offset) (*(((uint8_t *)buffer) + offset)) @@ -62,12 +63,16 @@ void eeprom_driver_erase(void) { STM32_L0_L1_EEPROM_Unlock(); for (size_t offset = 0; offset < STM32_ONBOARD_EEPROM_SIZE; offset += sizeof(uint32_t)) { +#ifdef QMK_MCU_SERIES_STM32L0XX FLASH->PECR |= FLASH_PECR_ERASE | FLASH_PECR_DATA; +#endif - *(__IO uint32_t *)EEPROM_ADDR(offset) = (uint32_t)0; + EEPROM_WORD(offset) = (uint32_t)0; STM32_L0_L1_EEPROM_WaitNotBusy(); +#ifdef QMK_MCU_SERIES_STM32L0XX FLASH->PECR &= ~(FLASH_PECR_ERASE | FLASH_PECR_DATA); +#endif } STM32_L0_L1_EEPROM_Lock(); @@ -86,17 +91,39 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) { } void eeprom_write_block(const void *buf, void *addr, size_t len) { - STM32_L0_L1_EEPROM_Unlock(); + // use word-aligned write to overcome issues with writing null bytes + uint32_t start_addr = (uint32_t)addr; + if (start_addr >= (STM32_ONBOARD_EEPROM_SIZE)) { + return; + } + uint32_t max_len = (STM32_ONBOARD_EEPROM_SIZE)-start_addr; + if (len > max_len) { + len = max_len; + } + uint32_t end_addr = start_addr + len; - for (size_t offset = 0; offset < len; ++offset) { - // Drop out if we've hit the limit of the EEPROM - if ((((uint32_t)addr) + offset) >= STM32_ONBOARD_EEPROM_SIZE) { - break; + uint32_t aligned_start = start_addr & ~0x3; + uint32_t aligned_end = (end_addr + 3) & ~0x3; + + STM32_L0_L1_EEPROM_Unlock(); + for (uint32_t word_addr = aligned_start; word_addr < aligned_end; word_addr += 4) { + uint32_t existing_word = EEPROM_WORD(word_addr); + uint32_t new_word = existing_word; + + // Update the relevant bytes in the word + for (int i = 0; i < 4; i++) { + uint32_t byte_addr = word_addr + i; + if (byte_addr >= start_addr && byte_addr < end_addr) { + uint8_t new_byte = BUFFER_BYTE(buf, byte_addr - start_addr); + new_word = (new_word & ~(0xFFU << (i * 8))) | ((uint32_t)new_byte << (i * 8)); + } } - STM32_L0_L1_EEPROM_WaitNotBusy(); - EEPROM_BYTE(addr, offset) = BUFFER_BYTE(buf, offset); + // Only write if the word has changed + if (new_word != existing_word) { + STM32_L0_L1_EEPROM_WaitNotBusy(); + EEPROM_WORD(word_addr) = new_word; + } } - STM32_L0_L1_EEPROM_Lock(); } diff --git a/platforms/chibios/drivers/i2c_master.c b/platforms/chibios/drivers/i2c_master.c index 0d5fb1e9853a..1d7fe276334b 100644 --- a/platforms/chibios/drivers/i2c_master.c +++ b/platforms/chibios/drivers/i2c_master.c @@ -29,17 +29,37 @@ #include "i2c_master.h" #include "gpio.h" #include "chibios_config.h" -#include #include #include +#ifndef I2C_DRIVER +# define I2C_DRIVER I2CD1 +#endif + #ifndef I2C1_SCL_PIN # define I2C1_SCL_PIN B6 #endif + +#ifndef I2C1_SCL_PAL_MODE +# ifdef USE_GPIOV1 +# define I2C1_SCL_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN +# else +# define I2C1_SCL_PAL_MODE 4 +# endif +#endif + #ifndef I2C1_SDA_PIN # define I2C1_SDA_PIN B7 #endif +#ifndef I2C1_SDA_PAL_MODE +# ifdef USE_GPIOV1 +# define I2C1_SDA_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN +# else +# define I2C1_SDA_PAL_MODE 4 +# endif +#endif + #ifdef USE_I2CV1 # ifndef I2C1_OPMODE # define I2C1_OPMODE OPMODE_I2C @@ -70,27 +90,6 @@ # endif #endif -#ifndef I2C_DRIVER -# define I2C_DRIVER I2CD1 -#endif - -#ifdef USE_GPIOV1 -# ifndef I2C1_SCL_PAL_MODE -# define I2C1_SCL_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN -# endif -# ifndef I2C1_SDA_PAL_MODE -# define I2C1_SDA_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN -# endif -#else -// The default PAL alternate modes are used to signal that the pins are used for I2C -# ifndef I2C1_SCL_PAL_MODE -# define I2C1_SCL_PAL_MODE 4 -# endif -# ifndef I2C1_SDA_PAL_MODE -# define I2C1_SDA_PAL_MODE 4 -# endif -#endif - static const I2CConfig i2cconfig = { #if defined(USE_I2CV1_CONTRIB) I2C1_CLOCK_SPEED, diff --git a/platforms/chibios/drivers/i2c_master.h b/platforms/chibios/drivers/i2c_master.h deleted file mode 100644 index 132ffd14c071..000000000000 --- a/platforms/chibios/drivers/i2c_master.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2018 Jack Humbert - * Copyright 2018 Yiancar - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* This library follows the convention of the AVR i2c_master library. - * As a result addresses are expected to be already shifted (addr << 1). - * I2CD1 is the default driver which corresponds to pins B6 and B7. This - * can be changed. - * Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that - * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. - */ -#pragma once - -#include - -// ### DEPRECATED - DO NOT USE ### -#define i2c_writeReg(devaddr, regaddr, data, length, timeout) i2c_write_register(devaddr, regaddr, data, length, timeout) -#define i2c_writeReg16(devaddr, regaddr, data, length, timeout) i2c_write_register16(devaddr, regaddr, data, length, timeout) -#define i2c_readReg(devaddr, regaddr, data, length, timeout) i2c_read_register(devaddr, regaddr, data, length, timeout) -#define i2c_readReg16(devaddr, regaddr, data, length, timeout) i2c_read_register16(devaddr, regaddr, data, length, timeout) -// ############################### - -typedef int16_t i2c_status_t; - -#define I2C_STATUS_SUCCESS (0) -#define I2C_STATUS_ERROR (-1) -#define I2C_STATUS_TIMEOUT (-2) - -void i2c_init(void); -i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_write_register(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_read_register(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout); diff --git a/platforms/chibios/drivers/spi_master.c b/platforms/chibios/drivers/spi_master.c index 414e5b10a31a..f5e48edfda54 100644 --- a/platforms/chibios/drivers/spi_master.c +++ b/platforms/chibios/drivers/spi_master.c @@ -15,8 +15,49 @@ */ #include "spi_master.h" +#include "chibios_config.h" +#include +#include -#include "timer.h" +#ifndef SPI_DRIVER +# define SPI_DRIVER SPID2 +#endif + +#ifndef SPI_SCK_PIN +# define SPI_SCK_PIN B13 +#endif + +#ifndef SPI_SCK_PAL_MODE +# ifdef USE_GPIOV1 +# define SPI_SCK_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define SPI_SCK_PAL_MODE 5 +# endif +#endif + +#ifndef SPI_MOSI_PIN +# define SPI_MOSI_PIN B15 +#endif + +#ifndef SPI_MOSI_PAL_MODE +# ifdef USE_GPIOV1 +# define SPI_MOSI_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define SPI_MOSI_PAL_MODE 5 +# endif +#endif + +#ifndef SPI_MISO_PIN +# define SPI_MISO_PIN B14 +#endif + +#ifndef SPI_MISO_PAL_MODE +# ifdef USE_GPIOV1 +# define SPI_MISO_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define SPI_MISO_PAL_MODE 5 +# endif +#endif static bool spiStarted = false; #if SPI_SELECT_MODE == SPI_SELECT_MODE_NONE diff --git a/platforms/chibios/drivers/spi_master.h b/platforms/chibios/drivers/spi_master.h deleted file mode 100644 index 4ad6144091e0..000000000000 --- a/platforms/chibios/drivers/spi_master.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright 2020 Nick Brassel (tzarc) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include -#include - -#include "gpio.h" -#include "chibios_config.h" - -#ifndef SPI_DRIVER -# define SPI_DRIVER SPID2 -#endif - -#ifndef SPI_SCK_PIN -# define SPI_SCK_PIN B13 -#endif - -#ifndef SPI_SCK_PAL_MODE -# if defined(USE_GPIOV1) -# define SPI_SCK_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL -# else -# define SPI_SCK_PAL_MODE 5 -# endif -#endif - -#ifndef SPI_MOSI_PIN -# define SPI_MOSI_PIN B15 -#endif - -#ifndef SPI_MOSI_PAL_MODE -# if defined(USE_GPIOV1) -# define SPI_MOSI_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL -# else -# define SPI_MOSI_PAL_MODE 5 -# endif -#endif - -#ifndef SPI_MISO_PIN -# define SPI_MISO_PIN B14 -#endif - -#ifndef SPI_MISO_PAL_MODE -# if defined(USE_GPIOV1) -# define SPI_MISO_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL -# else -# define SPI_MISO_PAL_MODE 5 -# endif -#endif - -typedef int16_t spi_status_t; - -#define SPI_STATUS_SUCCESS (0) -#define SPI_STATUS_ERROR (-1) -#define SPI_STATUS_TIMEOUT (-2) - -#define SPI_TIMEOUT_IMMEDIATE (0) -#define SPI_TIMEOUT_INFINITE (0xFFFF) - -#ifdef __cplusplus -extern "C" { -#endif -typedef struct spi_start_config_t { - pin_t slave_pin; - bool lsb_first; - uint8_t mode; - uint16_t divisor; - bool cs_active_low; -} spi_start_config_t; - -void spi_init(void); - -bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); -bool spi_start_extended(spi_start_config_t *start_config); - -spi_status_t spi_write(uint8_t data); - -spi_status_t spi_read(void); - -spi_status_t spi_transmit(const uint8_t *data, uint16_t length); - -spi_status_t spi_receive(uint8_t *data, uint16_t length); - -void spi_stop(void); -#ifdef __cplusplus -} -#endif diff --git a/platforms/chibios/drivers/uart.h b/platforms/chibios/drivers/uart.h deleted file mode 100644 index c1945575f133..000000000000 --- a/platforms/chibios/drivers/uart.h +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2024 Stefan Kerkmann -// Copyright 2021 QMK -// Copyright 2024 Stefan Kerkmann -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include - -#include - -#include "gpio.h" -#include "chibios_config.h" - -// ======== DEPRECATED DEFINES - DO NOT USE ======== -#ifdef SERIAL_DRIVER -# define UART_DRIVER SERIAL_DRIVER -#endif -#ifdef SD1_TX_PIN -# define UART_TX_PIN SD1_TX_PIN -#endif -#ifdef SD1_RX_PIN -# define UART_RX_PIN SD1_RX_PIN -#endif -#ifdef SD1_CTS_PIN -# define UART_CTS_PIN SD1_CTS_PIN -#endif -#ifdef SD1_RTS_PIN -# define UART_RTS_PIN SD1_RTS_PIN -#endif -#ifdef SD1_TX_PAL_MODE -# define UART_TX_PAL_MODE SD1_TX_PAL_MODE -#endif -#ifdef SD1_RX_PAL_MODE -# define UART_RX_PAL_MODE SD1_RX_PAL_MODE -#endif -#ifdef SD1_CTS_PAL_MODE -# define UART_RTS_PAL_MODE SD1_CTS_PAL_MODE -#endif -#ifdef SD1_RTS_PAL_MODE -# define UART_TX_PAL_MODE SD1_RTS_PAL_MODE -#endif -#ifdef SD1_CR1 -# define UART_CR1 SD1_CR1 -#endif -#ifdef SD1_CR2 -# define UART_CR2 SD1_CR2 -#endif -#ifdef SD1_CR3 -# define UART_CR3 SD1_CR3 -#endif -#ifdef SD1_WRDLEN -# define UART_WRDLEN SD1_WRDLEN -#endif -#ifdef SD1_STPBIT -# define UART_STPBIT SD1_STPBIT -#endif -#ifdef SD1_PARITY -# define UART_PARITY SD1_PARITY -#endif -#ifdef SD1_ATFLCT -# define UART_ATFLCT SD1_ATFLCT -#endif -// ======== - -#ifndef UART_DRIVER -# if (HAL_USE_SERIAL == TRUE) -# define UART_DRIVER SD1 -# elif (HAL_USE_SIO == TRUE) -# define UART_DRIVER SIOD1 -# endif -#endif - -#ifndef UART_TX_PIN -# define UART_TX_PIN A9 -#endif - -#ifndef UART_RX_PIN -# define UART_RX_PIN A10 -#endif - -#ifndef UART_CTS_PIN -# define UART_CTS_PIN A11 -#endif - -#ifndef UART_RTS_PIN -# define UART_RTS_PIN A12 -#endif - -#ifdef USE_GPIOV1 -# ifndef UART_TX_PAL_MODE -# define UART_TX_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL -# endif -# ifndef UART_RX_PAL_MODE -# define UART_RX_PAL_MODE PAL_MODE_INPUT -# endif -# ifndef UART_CTS_PAL_MODE -# define UART_CTS_PAL_MODE PAL_MODE_INPUT -# endif -# ifndef UART_RTS_PAL_MODE -# define UART_RTS_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL -# endif -#else -# ifndef UART_TX_PAL_MODE -# define UART_TX_PAL_MODE 7 -# endif - -# ifndef UART_RX_PAL_MODE -# define UART_RX_PAL_MODE 7 -# endif - -# ifndef UART_CTS_PAL_MODE -# define UART_CTS_PAL_MODE 7 -# endif - -# ifndef UART_RTS_PAL_MODE -# define UART_RTS_PAL_MODE 7 -# endif -#endif - -#ifndef UART_CR1 -# define UART_CR1 0 -#endif - -#ifndef UART_CR2 -# define UART_CR2 0 -#endif - -#ifndef UART_CR3 -# define UART_CR3 0 -#endif - -#ifndef UART_WRDLEN -# define UART_WRDLEN 3 -#endif - -#ifndef UART_STPBIT -# define UART_STPBIT 0 -#endif - -#ifndef UART_PARITY -# define UART_PARITY 0 -#endif - -#ifndef UART_ATFLCT -# define UART_ATFLCT 0 -#endif - -/** - * @brief Initialize the UART driver. This function must be called only once, - * before any of the below functions can be called. - * - * @param baud The baud rate to transmit and receive at. This may depend on the - * device you are communicating with. Common values are 1200, 2400, 4800, 9600, - * 19200, 38400, 57600, and 115200. - */ -void uart_init(uint32_t baud); - -/** - * @brief Transmit a single byte. - * - * @param data The byte to transmit. - */ -void uart_write(uint8_t data); - -/** - * @brief Receive a single byte. - * - * @return uint8_t The byte read from the receive buffer. This function will - * block if the buffer is empty (ie. no data to read). - */ -uint8_t uart_read(void); - -/** - * @brief Transmit multiple bytes. - * - * @param data A pointer to the data to write from. - * @param length The number of bytes to write. Take care not to overrun the - * length of `data`. - */ -void uart_transmit(const uint8_t *data, uint16_t length); - -/** - * @brief Receive multiple bytes. - * - * @param data A pointer to the buffer to read into. - * @param length The number of bytes to read. Take care not to overrun the - * length of `data`. - */ -void uart_receive(uint8_t *data, uint16_t length); - -/** - * @brief Return whether the receive buffer contains data. Call this function - * to determine if `uart_read()` will return data immediately. - * - * @return true If there is data available to read. - * @return false If there is no data available to read. - */ -bool uart_available(void); diff --git a/platforms/chibios/drivers/uart_serial.c b/platforms/chibios/drivers/uart_serial.c index 6aff4eae47a2..e0afb9768a1d 100644 --- a/platforms/chibios/drivers/uart_serial.c +++ b/platforms/chibios/drivers/uart_serial.c @@ -3,6 +3,89 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "uart.h" +#include "gpio.h" +#include "chibios_config.h" +#include + +#ifndef UART_DRIVER +# define UART_DRIVER SD1 +#endif + +#ifndef UART_TX_PIN +# define UART_TX_PIN A9 +#endif + +#ifndef UART_TX_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_TX_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define UART_TX_PAL_MODE 7 +# endif +#endif + +#ifndef UART_RX_PIN +# define UART_RX_PIN A10 +#endif + +#ifndef UART_RX_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_RX_PAL_MODE PAL_MODE_INPUT +# else +# define UART_RX_PAL_MODE 7 +# endif +#endif + +#ifndef UART_CTS_PIN +# define UART_CTS_PIN A11 +#endif + +#ifndef UART_CTS_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_CTS_PAL_MODE PAL_MODE_INPUT +# else +# define UART_CTS_PAL_MODE 7 +# endif +#endif + +#ifndef UART_RTS_PIN +# define UART_RTS_PIN A12 +#endif + +#ifndef UART_RTS_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_RTS_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define UART_RTS_PAL_MODE 7 +# endif +#endif + +#ifndef UART_CR1 +# define UART_CR1 0 +#endif + +#ifndef UART_CR2 +# define UART_CR2 0 +#endif + +#ifndef UART_CR3 +# define UART_CR3 0 +#endif + +#ifndef UART_WRDLEN +# define UART_WRDLEN 3 +#endif + +#ifndef UART_STPBIT +# define UART_STPBIT 0 +#endif + +#ifndef UART_PARITY +# define UART_PARITY 0 +#endif + +#ifndef UART_ATFLCT +# define UART_ATFLCT 0 +#endif #if defined(MCU_KINETIS) static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE}; diff --git a/platforms/chibios/drivers/uart_sio.c b/platforms/chibios/drivers/uart_sio.c index 442df1c54d82..fc12f0abed98 100644 --- a/platforms/chibios/drivers/uart_sio.c +++ b/platforms/chibios/drivers/uart_sio.c @@ -3,6 +3,73 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "uart.h" +#include "gpio.h" +#include "chibios_config.h" +#include + +#ifndef UART_DRIVER +# define UART_DRIVER SIOD1 +#endif + +#ifndef UART_TX_PIN +# define UART_TX_PIN A9 +#endif + +#ifndef UART_TX_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_TX_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define UART_TX_PAL_MODE 7 +# endif +#endif + +#ifndef UART_RX_PIN +# define UART_RX_PIN A10 +#endif + +#ifndef UART_RX_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_RX_PAL_MODE PAL_MODE_INPUT +# else +# define UART_RX_PAL_MODE 7 +# endif +#endif + +#ifndef UART_CTS_PIN +# define UART_CTS_PIN A11 +#endif + +#ifndef UART_CTS_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_CTS_PAL_MODE PAL_MODE_INPUT +# else +# define UART_CTS_PAL_MODE 7 +# endif +#endif + +#ifndef UART_RTS_PIN +# define UART_RTS_PIN A12 +#endif + +#ifndef UART_RTS_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_RTS_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define UART_RTS_PAL_MODE 7 +# endif +#endif + +#ifndef UART_CR1 +# define UART_CR1 0 +#endif + +#ifndef UART_CR2 +# define UART_CR2 0 +#endif + +#ifndef UART_CR3 +# define UART_CR3 0 +#endif #if defined(MCU_RP) // 38400 baud, 8 data bits, 1 stop bit, no parity, no flow control diff --git a/platforms/chibios/timer.c b/platforms/chibios/timer.c index 4a347b445d83..9f7eade83f03 100644 --- a/platforms/chibios/timer.c +++ b/platforms/chibios/timer.c @@ -99,7 +99,7 @@ uint16_t timer_read(void) { } uint32_t timer_read32(void) { - chSysLock(); + syssts_t sts = chSysGetStatusAndLockX(); uint32_t ticks = get_system_time_ticks() - ticks_offset; if (ticks < last_ticks) { // The 32-bit tick counter overflowed and wrapped around. We cannot just extend the counter to 64 bits here, @@ -114,15 +114,7 @@ uint32_t timer_read32(void) { } last_ticks = ticks; uint32_t ms_offset_copy = ms_offset; // read while still holding the lock to ensure a consistent value - chSysUnlock(); + chSysRestoreStatusX(sts); return (uint32_t)TIME_I2MS(ticks) + ms_offset_copy; } - -uint16_t timer_elapsed(uint16_t last) { - return TIMER_DIFF_16(timer_read(), last); -} - -uint32_t timer_elapsed32(uint32_t last) { - return TIMER_DIFF_32(timer_read32(), last); -} diff --git a/platforms/test/timer.c b/platforms/test/timer.c index eb929d7dac6c..f5ee07fd57f1 100644 --- a/platforms/test/timer.c +++ b/platforms/test/timer.c @@ -60,14 +60,6 @@ uint32_t timer_read32(void) { return current_time; } -uint16_t timer_elapsed(uint16_t last) { - return TIMER_DIFF_16(timer_read(), last); -} - -uint32_t timer_elapsed32(uint32_t last) { - return TIMER_DIFF_32(timer_read32(), last); -} - void set_time(uint32_t t) { current_time = t; access_counter = 0; diff --git a/platforms/timer.c b/platforms/timer.c index 26038dcda329..ba2cf94d2bf8 100644 --- a/platforms/timer.c +++ b/platforms/timer.c @@ -6,3 +6,11 @@ // Generate out-of-line copies for inline functions defined in timer.h. extern inline fast_timer_t timer_read_fast(void); extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last); + +uint16_t timer_elapsed(uint16_t last) { + return TIMER_DIFF_16(timer_read(), last); +} + +uint32_t timer_elapsed32(uint32_t last) { + return TIMER_DIFF_32(timer_read32(), last); +} diff --git a/platforms/timer.h b/platforms/timer.h index fb8ff6bc5454..8a2ffd476b1c 100644 --- a/platforms/timer.h +++ b/platforms/timer.h @@ -24,10 +24,9 @@ along with this program. If not, see . #include -#define TIMER_DIFF(a, b, max) ((max == UINT8_MAX) ? ((uint8_t)((a) - (b))) : ((max == UINT16_MAX) ? ((uint16_t)((a) - (b))) : ((max == UINT32_MAX) ? ((uint32_t)((a) - (b))) : ((a) >= (b) ? (a) - (b) : (max) + 1 - (b) + (a))))) -#define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX) -#define TIMER_DIFF_16(a, b) TIMER_DIFF(a, b, UINT16_MAX) -#define TIMER_DIFF_32(a, b) TIMER_DIFF(a, b, UINT32_MAX) +#define TIMER_DIFF_8(a, b) (uint8_t)((a) - (b)) +#define TIMER_DIFF_16(a, b) (uint16_t)((a) - (b)) +#define TIMER_DIFF_32(a, b) (uint32_t)((a) - (b)) #define TIMER_DIFF_RAW(a, b) TIMER_DIFF_8(a, b) #ifdef __cplusplus diff --git a/quantum/action.c b/quantum/action.c index a39631ba3e9b..be85192d25ab 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -47,7 +47,12 @@ along with this program. If not, see . int tp_buttons; #if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) -int retro_tapping_counter = 0; +bool retro_tap_primed = false; +uint16_t retro_tap_curr_key = 0; +# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) +uint8_t retro_tap_curr_mods = 0; +uint8_t retro_tap_next_mods = 0; +# endif #endif #if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) @@ -77,7 +82,13 @@ void action_exec(keyevent_t event) { debug_event(event); ac_dprintf("\n"); #if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) - retro_tapping_counter++; + uint16_t event_keycode = get_event_keycode(event, false); + if (event.pressed) { + retro_tap_primed = false; + retro_tap_curr_key = event_keycode; + } else if (retro_tap_curr_key == event_keycode) { + retro_tap_primed = true; + } #endif } @@ -531,7 +542,8 @@ void process_action(keyrecord_t *record, action_t action) { # if defined(RETRO_TAPPING) && defined(DUMMY_MOD_NEUTRALIZER_KEYCODE) // Send a dummy keycode to neutralize flashing modifiers // if the key was held and then released with no interruptions. - if (retro_tapping_counter == 2) { + uint16_t ev_kc = get_event_keycode(event, false); + if (retro_tap_primed && retro_tap_curr_key == ev_kc) { neutralize_flashing_modifiers(get_mods()); } # endif @@ -817,6 +829,10 @@ void process_action(keyrecord_t *record, action_t action) { case ACT_LAYER_TAP_EXT: # endif led_set(host_keyboard_leds()); +# ifndef NO_ACTION_ONESHOT + // don't release the key + do_release_oneshot = false; +# endif break; default: break; @@ -825,30 +841,44 @@ void process_action(keyrecord_t *record, action_t action) { #ifndef NO_ACTION_TAPPING # if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) - if (!is_tap_action(action)) { - retro_tapping_counter = 0; - } else { + if (is_tap_action(action)) { if (event.pressed) { if (tap_count > 0) { - retro_tapping_counter = 0; + retro_tap_primed = false; + } else { +# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) + retro_tap_curr_mods = retro_tap_next_mods; + retro_tap_next_mods = get_mods(); +# endif } } else { + uint16_t event_keycode = get_event_keycode(event, false); +# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) + uint8_t curr_mods = get_mods(); +# endif if (tap_count > 0) { - retro_tapping_counter = 0; - } else { + retro_tap_primed = false; + } else if (retro_tap_curr_key == event_keycode) { if ( # ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(get_event_keycode(record->event, false), record) && + get_retro_tapping(event_keycode, record) && # endif - retro_tapping_counter == 2) { + retro_tap_primed) { # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) process_auto_shift(action.layer_tap.code, record); # else + register_mods(retro_tap_curr_mods); + wait_ms(TAP_CODE_DELAY); tap_code(action.layer_tap.code); + wait_ms(TAP_CODE_DELAY); + unregister_mods(retro_tap_curr_mods); # endif } - retro_tapping_counter = 0; + retro_tap_primed = false; } +# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) + retro_tap_next_mods = curr_mods; +# endif } } # endif diff --git a/quantum/action.h b/quantum/action.h index d5b15c6f1732..7596688f31da 100644 --- a/quantum/action.h +++ b/quantum/action.h @@ -45,7 +45,7 @@ typedef struct { } tap_t; /* Key event container for recording */ -typedef struct { +typedef struct keyrecord_t { keyevent_t event; #ifndef NO_ACTION_TAPPING tap_t tap; diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c index 8f238490f2a8..e42a98554d3c 100644 --- a/quantum/action_tapping.c +++ b/quantum/action_tapping.c @@ -49,6 +49,45 @@ __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *re } # endif +# if defined(CHORDAL_HOLD) +extern const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM; + +# define REGISTERED_TAPS_SIZE 8 +// Array of tap-hold keys that have been settled as tapped but not yet released. +static keypos_t registered_taps[REGISTERED_TAPS_SIZE] = {}; +static uint8_t num_registered_taps = 0; + +/** Adds `key` to the registered_taps array. */ +static void registered_taps_add(keypos_t key); +/** Returns the index of `key` in registered_taps, or -1 if not found. */ +static int8_t registered_tap_find(keypos_t key); +/** Removes index `i` from the registered_taps array. */ +static void registered_taps_del_index(uint8_t i); +/** Logs the registered_taps array for debugging. */ +static void debug_registered_taps(void); + +/** \brief Finds which queued events should be held according to Chordal Hold. + * + * In a situation with multiple unsettled tap-hold key presses, scan the queue + * up until the first release, non-tap-hold, or one-shot event and find the + * latest event in the queue that settles as held according to + * get_chordal_hold(). + * + * \return Index of the first tap, or equivalently, one past the latest hold. + */ +static uint8_t waiting_buffer_find_chordal_hold_tap(void); + +/** Processes queued events up to and including `key` as tapped. */ +static void waiting_buffer_chordal_hold_taps_until(keypos_t key); + +/** \brief Processes and pops buffered events until the first tap-hold event. */ +static void waiting_buffer_process_regular(void); + +static bool is_mt_or_lt(uint16_t keycode) { + return IS_QK_MOD_TAP(keycode) || IS_QK_LAYER_TAP(keycode); +} +# endif // CHORDAL_HOLD + # ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { return false; @@ -166,6 +205,20 @@ void action_tapping_process(keyrecord_t record) { bool process_tapping(keyrecord_t *keyp) { const keyevent_t event = keyp->event; +# if defined(CHORDAL_HOLD) + if (!event.pressed) { + const int8_t i = registered_tap_find(event.key); + if (i != -1) { + // If a tap-hold key was previously settled as tapped, set its + // tap.count correspondingly on release. + keyp->tap.count = 1; + registered_taps_del_index(i); + ac_dprintf("Found tap release for [%d]\n", i); + debug_registered_taps(); + } + } +# endif // CHORDAL_HOLD + // state machine is in the "reset" state, no tapping key is to be // processed if (IS_NOEVENT(tapping_key.event)) { @@ -188,7 +241,7 @@ bool process_tapping(keyrecord_t *keyp) { return true; } -# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) +# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(CHORDAL_HOLD) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) TAP_DEFINE_KEYCODE; # endif @@ -199,6 +252,7 @@ bool process_tapping(keyrecord_t *keyp) { // early return for tick events return true; } + if (tapping_key.tap.count == 0) { if (IS_TAPPING_RECORD(keyp) && !event.pressed) { // first tap! @@ -212,6 +266,25 @@ bool process_tapping(keyrecord_t *keyp) { // enqueue return false; } +# if defined(CHORDAL_HOLD) + else if (is_mt_or_lt(tapping_keycode) && !event.pressed && waiting_buffer_typed(event) && !get_chordal_hold(tapping_keycode, &tapping_key, get_record_keycode(keyp, false), keyp)) { + // Key release that is not a chord with the tapping key. + // Settle the tapping key and any other pending tap-hold + // keys preceding the press of this key as tapped. + + ac_dprintf("Tapping: End. Chord considered a tap\n"); + tapping_key.tap.count = 1; + registered_taps_add(tapping_key.event.key); + process_record(&tapping_key); + tapping_key = (keyrecord_t){0}; + + waiting_buffer_chordal_hold_taps_until(event.key); + debug_registered_taps(); + debug_waiting_buffer(); + // enqueue + return false; + } +# endif // CHORDAL_HOLD /* Process a key typed within TAPPING_TERM * This can register the key before settlement of tapping, * useful for long TAPPING_TERM but may prevent fast typing. @@ -229,6 +302,22 @@ bool process_tapping(keyrecord_t *keyp) { // clang-format on ac_dprintf("Tapping: End. No tap. Interfered by typing key\n"); process_record(&tapping_key); + +# if defined(CHORDAL_HOLD) + uint8_t first_tap = waiting_buffer_find_chordal_hold_tap(); + ac_dprintf("first_tap = %u\n", first_tap); + if (first_tap < WAITING_BUFFER_SIZE) { + for (; waiting_buffer_tail != first_tap; waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE) { + ac_dprintf("Processing [%u]\n", waiting_buffer_tail); + process_record(&waiting_buffer[waiting_buffer_tail]); + } + } + + waiting_buffer_chordal_hold_taps_until(event.key); + debug_registered_taps(); + debug_waiting_buffer(); +# endif // CHORDAL_HOLD + tapping_key = (keyrecord_t){0}; debug_tapping_key(); // enqueue @@ -237,6 +326,19 @@ bool process_tapping(keyrecord_t *keyp) { /* Process release event of a key pressed before tapping starts * Without this unexpected repeating will occur with having fast repeating setting * https://github.com/tmk/tmk_keyboard/issues/60 + * + * NOTE: This workaround causes events to process out of order, + * e.g. in a rolled press of three tap-hold keys like + * + * "A down, B down, C down, A up, B up, C up" + * + * events are processed as + * + * "A down, B down, A up, B up, C down, C up" + * + * It seems incorrect to process keyp before the tapping key. + * This workaround is old, from 2013. This might no longer + * be needed for the original problem it was meant to address. */ else if (!event.pressed && !waiting_buffer_typed(event)) { // Modifier/Layer should be retained till end of this tapping. @@ -271,19 +373,52 @@ bool process_tapping(keyrecord_t *keyp) { // set interrupted flag when other key pressed during tapping if (event.pressed) { tapping_key.tap.interrupted = true; - if (TAP_GET_HOLD_ON_OTHER_KEY_PRESS + +# if defined(CHORDAL_HOLD) + if (is_mt_or_lt(tapping_keycode) && !get_chordal_hold(tapping_keycode, &tapping_key, get_record_keycode(keyp, false), keyp)) { + // In process_action(), HOLD_ON_OTHER_KEY_PRESS + // will revert interrupted events to holds, so + // this needs to be set false. + tapping_key.tap.interrupted = false; + + if (!is_tap_record(keyp)) { + ac_dprintf("Tapping: End. Chord considered a tap\n"); + tapping_key.tap.count = 1; + registered_taps_add(tapping_key.event.key); + debug_registered_taps(); + process_record(&tapping_key); + tapping_key = (keyrecord_t){0}; + } + } else +# endif // CHORDAL_HOLD + if (TAP_GET_HOLD_ON_OTHER_KEY_PRESS # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) - // Auto Shift cannot evaluate this early - // Retro Shift uses the hold action for all nested taps even without HOLD_ON_OTHER_KEY_PRESS, so this is fine to skip - && !(MAYBE_RETRO_SHIFTING(event, keyp) && get_auto_shifted_key(get_record_keycode(keyp, false), keyp)) + // Auto Shift cannot evaluate this early + // Retro Shift uses the hold action for all nested taps even without HOLD_ON_OTHER_KEY_PRESS, so this is fine to skip + && !(MAYBE_RETRO_SHIFTING(event, keyp) && get_auto_shifted_key(get_record_keycode(keyp, false), keyp)) # endif - ) { + ) { + // Settle the tapping key as *held*, since + // HOLD_ON_OTHER_KEY_PRESS is enabled for this key. ac_dprintf("Tapping: End. No tap. Interfered by pressed key\n"); process_record(&tapping_key); - tapping_key = (keyrecord_t){0}; + +# if defined(CHORDAL_HOLD) + if (waiting_buffer_tail != waiting_buffer_head && is_tap_record(&waiting_buffer[waiting_buffer_tail])) { + tapping_key = waiting_buffer[waiting_buffer_tail]; + // Pop tail from the queue. + waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE; + debug_waiting_buffer(); + } else +# endif // CHORDAL_HOLD + { + tapping_key = (keyrecord_t){0}; + } debug_tapping_key(); - // enqueue - return false; + +# if defined(CHORDAL_HOLD) + waiting_buffer_process_regular(); +# endif // CHORDAL_HOLD } } // enqueue @@ -520,26 +655,125 @@ void waiting_buffer_scan_tap(void) { } } -/** \brief Tapping key debug print - * - * FIXME: Needs docs - */ +# ifdef CHORDAL_HOLD +__attribute__((weak)) bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t *tap_hold_record, uint16_t other_keycode, keyrecord_t *other_record) { + return get_chordal_hold_default(tap_hold_record, other_record); +} + +bool get_chordal_hold_default(keyrecord_t *tap_hold_record, keyrecord_t *other_record) { + if (tap_hold_record->event.type != KEY_EVENT || other_record->event.type != KEY_EVENT) { + return true; // Return true on combos or other non-key events. + } + + char tap_hold_hand = chordal_hold_handedness(tap_hold_record->event.key); + if (tap_hold_hand == '*') { + return true; + } + char other_hand = chordal_hold_handedness(other_record->event.key); + return other_hand == '*' || tap_hold_hand != other_hand; +} + +__attribute__((weak)) char chordal_hold_handedness(keypos_t key) { + return (char)pgm_read_byte(&chordal_hold_layout[key.row][key.col]); +} + +static void registered_taps_add(keypos_t key) { + if (num_registered_taps >= REGISTERED_TAPS_SIZE) { + ac_dprintf("TAPS OVERFLOW: CLEAR ALL STATES\n"); + clear_keyboard(); + num_registered_taps = 0; + } + + registered_taps[num_registered_taps] = key; + ++num_registered_taps; +} + +static int8_t registered_tap_find(keypos_t key) { + for (int8_t i = 0; i < num_registered_taps; ++i) { + if (KEYEQ(registered_taps[i], key)) { + return i; + } + } + return -1; +} + +static void registered_taps_del_index(uint8_t i) { + if (i < num_registered_taps) { + --num_registered_taps; + if (i < num_registered_taps) { + registered_taps[i] = registered_taps[num_registered_taps]; + } + } +} + +static void debug_registered_taps(void) { + ac_dprintf("registered_taps = { "); + for (int8_t i = 0; i < num_registered_taps; ++i) { + ac_dprintf("%02X%02X ", registered_taps[i].row, registered_taps[i].col); + } + ac_dprintf("}\n"); +} + +static uint8_t waiting_buffer_find_chordal_hold_tap(void) { + keyrecord_t *prev = &tapping_key; + uint16_t prev_keycode = get_record_keycode(&tapping_key, false); + uint8_t first_tap = WAITING_BUFFER_SIZE; + for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { + keyrecord_t * cur = &waiting_buffer[i]; + const uint16_t cur_keycode = get_record_keycode(cur, false); + if (!cur->event.pressed || !is_mt_or_lt(prev_keycode)) { + break; + } else if (get_chordal_hold(prev_keycode, prev, cur_keycode, cur)) { + first_tap = i; // Track one index past the latest hold. + } + prev = cur; + prev_keycode = cur_keycode; + } + return first_tap; +} + +static void waiting_buffer_chordal_hold_taps_until(keypos_t key) { + while (waiting_buffer_tail != waiting_buffer_head) { + keyrecord_t *record = &waiting_buffer[waiting_buffer_tail]; + ac_dprintf("waiting_buffer_chordal_hold_taps_until: processing [%u]\n", waiting_buffer_tail); + if (record->event.pressed && is_tap_record(record)) { + record->tap.count = 1; + registered_taps_add(record->event.key); + } + process_record(record); + waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE; + + if (KEYEQ(key, record->event.key) && record->event.pressed) { + break; + } + } +} + +static void waiting_buffer_process_regular(void) { + for (; waiting_buffer_tail != waiting_buffer_head; waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE) { + if (is_tap_record(&waiting_buffer[waiting_buffer_tail])) { + break; // Stop once a tap-hold key event is reached. + } + ac_dprintf("waiting_buffer_process_regular: processing [%u]\n", waiting_buffer_tail); + process_record(&waiting_buffer[waiting_buffer_tail]); + } + debug_waiting_buffer(); +} +# endif // CHORDAL_HOLD + +/** \brief Logs tapping key if ACTION_DEBUG is enabled. */ static void debug_tapping_key(void) { ac_dprintf("TAPPING_KEY="); debug_record(tapping_key); ac_dprintf("\n"); } -/** \brief Waiting buffer debug print - * - * FIXME: Needs docs - */ +/** \brief Logs waiting buffer if ACTION_DEBUG is enabled. */ static void debug_waiting_buffer(void) { - ac_dprintf("{ "); + ac_dprintf("{"); for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { - ac_dprintf("[%u]=", i); + ac_dprintf(" [%u]=", i); debug_record(waiting_buffer[i]); - ac_dprintf(" "); } ac_dprintf("}\n"); } diff --git a/quantum/action_tapping.h b/quantum/action_tapping.h index 6b518b829880..c3c7b999ec9d 100644 --- a/quantum/action_tapping.h +++ b/quantum/action_tapping.h @@ -46,6 +46,71 @@ bool get_permissive_hold(uint16_t keycode, keyrecord_t *record); bool get_retro_tapping(uint16_t keycode, keyrecord_t *record); bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record); +#ifdef CHORDAL_HOLD +/** + * Callback to say when a key chord before the tapping term may be held. + * + * In keymap.c, define the callback + * + * bool get_chordal_hold(uint16_t tap_hold_keycode, + * keyrecord_t* tap_hold_record, + * uint16_t other_keycode, + * keyrecord_t* other_record) { + * // Conditions... + * } + * + * This callback is called when: + * + * 1. `tap_hold_keycode` is pressed. + * 2. `other_keycode` is pressed while `tap_hold_keycode` is still held, + * provided `other_keycode` is *not* also a tap-hold key and it is pressed + * before the tapping term. + * + * If false is returned, this has the effect of immediately settling the + * tap-hold key as tapped. If true is returned, the tap-hold key is still + * unsettled, and may be settled as held depending on configuration and + * subsequent events. + * + * @param tap_hold_keycode Keycode of the tap-hold key. + * @param tap_hold_record Record from the tap-hold press event. + * @param other_keycode Keycode of the other key. + * @param other_record Record from the other key's press event. + * @return True if the tap-hold key may be considered held; false if tapped. + */ +bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t *tap_hold_record, uint16_t other_keycode, keyrecord_t *other_record); + +/** + * Default "opposite hands rule" for whether a key chord may settle as held. + * + * This function returns true when the tap-hold key and other key are on + * "opposite hands." In detail, handedness of the two keys are compared. If + * handedness values differ, or if either handedness is '*', the function + * returns true, indicating that it may be held. Otherwise, it returns false, + * in which case the tap-hold key is immediately settled at tapped. + * + * @param tap_hold_record Record of the active tap-hold key press. + * @param other_record Record of the other, interrupting key press. + * @return True if the tap-hold key may be considered held; false if tapped. + */ +bool get_chordal_hold_default(keyrecord_t *tap_hold_record, keyrecord_t *other_record); + +/** + * Gets the handedness of a key. + * + * This function returns: + * 'L' for keys pressed by the left hand, + * 'R' for keys on the right hand, + * '*' for keys exempt from the "opposite hands rule." This could be used + * perhaps on thumb keys or keys that might be pressed by either hand. + * + * @param key A key matrix position. + * @return Handedness value. + */ +char chordal_hold_handedness(keypos_t key); + +extern const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM; +#endif + #ifdef DYNAMIC_TAPPING_TERM_ENABLE extern uint16_t g_tapping_term; #endif diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index b2611c5f0996..2cc3c2d6613f 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -258,11 +258,10 @@ void audio_stop_tone(float pitch) { for (int i = AUDIO_TONE_STACKSIZE - 1; i >= 0; i--) { found = (tones[i].pitch == pitch); if (found) { - tones[i] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0}; for (int j = i; (j < AUDIO_TONE_STACKSIZE - 1); j++) { - tones[j] = tones[j + 1]; - tones[j + 1] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0}; + tones[j] = tones[j + 1]; } + tones[AUDIO_TONE_STACKSIZE - 1] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0}; break; } } diff --git a/quantum/debounce/tests/rules.mk b/quantum/debounce/tests/rules.mk index bbc362d4c7e4..d38b1cd3421d 100644 --- a/quantum/debounce/tests/rules.mk +++ b/quantum/debounce/tests/rules.mk @@ -16,6 +16,7 @@ DEBOUNCE_COMMON_DEFS := -DMATRIX_ROWS=4 -DMATRIX_COLS=10 -DDEBOUNCE=5 DEBOUNCE_COMMON_SRC := $(QUANTUM_PATH)/debounce/tests/debounce_test_common.cpp \ + $(PLATFORM_PATH)/timer.c \ $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c debounce_none_DEFS := $(DEBOUNCE_COMMON_DEFS) diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index 3c22bbd4457f..beb7f9d18f2c 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -245,6 +245,17 @@ void dynamic_keymap_macro_set_buffer(uint16_t offset, uint16_t size, uint8_t *da } } +typedef struct send_string_eeprom_state_t { + const uint8_t *ptr; +} send_string_eeprom_state_t; + +char send_string_get_next_eeprom(void *arg) { + send_string_eeprom_state_t *state = (send_string_eeprom_state_t *)arg; + char ret = eeprom_read_byte(state->ptr); + state->ptr++; + return ret; +} + void dynamic_keymap_macro_reset(void) { void *p = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); void *end = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE); @@ -284,57 +295,6 @@ void dynamic_keymap_macro_send(uint8_t id) { ++p; } - // Send the macro string by making a temporary string. - char data[8] = {0}; - // We already checked there was a null at the end of - // the buffer, so this cannot go past the end - while (1) { - data[0] = eeprom_read_byte(p++); - data[1] = 0; - // Stop at the null terminator of this macro string - if (data[0] == 0) { - break; - } - if (data[0] == SS_QMK_PREFIX) { - // Get the code - data[1] = eeprom_read_byte(p++); - // Unexpected null, abort. - if (data[1] == 0) { - return; - } - if (data[1] == SS_TAP_CODE || data[1] == SS_DOWN_CODE || data[1] == SS_UP_CODE) { - // Get the keycode - data[2] = eeprom_read_byte(p++); - // Unexpected null, abort. - if (data[2] == 0) { - return; - } - // Null terminate - data[3] = 0; - } else if (data[1] == SS_DELAY_CODE) { - // Get the number and '|' - // At most this is 4 digits plus '|' - uint8_t i = 2; - while (1) { - data[i] = eeprom_read_byte(p++); - // Unexpected null, abort - if (data[i] == 0) { - return; - } - // Found '|', send it - if (data[i] == '|') { - data[i + 1] = 0; - break; - } - // If haven't found '|' by i==6 then - // number too big, abort - if (i == 6) { - return; - } - ++i; - } - } - } - send_string_with_delay(data, DYNAMIC_KEYMAP_MACRO_DELAY); - } + send_string_eeprom_state_t state = {p}; + send_string_with_delay_impl(send_string_get_next_eeprom, &state, DYNAMIC_KEYMAP_MACRO_DELAY); } diff --git a/quantum/keyboard.c b/quantum/keyboard.c index d7836cf36e00..ad740de4b3fd 100644 --- a/quantum/keyboard.c +++ b/quantum/keyboard.c @@ -289,6 +289,21 @@ __attribute__((weak)) void keyboard_pre_init_kb(void) { keyboard_pre_init_user(); } +/** \brief keyboard_pre_init_modules + * + * FIXME: needs doc + */ +__attribute__((weak)) void keyboard_pre_init_modules(void) {} + +/** \brief keyboard_pre_init_quantum + * + * FIXME: needs doc + */ +void keyboard_pre_init_quantum(void) { + keyboard_pre_init_modules(); + keyboard_pre_init_kb(); +} + /** \brief keyboard_post_init_user * * FIXME: needs doc @@ -305,6 +320,23 @@ __attribute__((weak)) void keyboard_post_init_kb(void) { keyboard_post_init_user(); } +/** \brief keyboard_post_init_modules + * + * FIXME: needs doc + */ + +__attribute__((weak)) void keyboard_post_init_modules(void) {} + +/** \brief keyboard_post_init_quantum + * + * FIXME: needs doc + */ + +void keyboard_post_init_quantum(void) { + keyboard_post_init_modules(); + keyboard_post_init_kb(); +} + /** \brief matrix_can_read * * Allows overriding when matrix scanning operations should be executed. @@ -323,7 +355,7 @@ void keyboard_setup(void) { eeprom_driver_init(); #endif matrix_setup(); - keyboard_pre_init_kb(); + keyboard_pre_init_quantum(); } #ifndef SPLIT_KEYBOARD @@ -355,6 +387,13 @@ __attribute__((weak)) bool should_process_keypress(void) { return is_keyboard_master(); } +/** \brief housekeeping_task_modules + * + * Codegen will override this if community modules are enabled. + * This is specific to keyboard-level functionality. + */ +__attribute__((weak)) void housekeeping_task_modules(void) {} + /** \brief housekeeping_task_kb * * Override this function if you have a need to execute code for every keyboard main loop iteration. @@ -374,6 +413,7 @@ __attribute__((weak)) void housekeeping_task_user(void) {} * Invokes hooks for executing code after QMK is done after each loop iteration. */ void housekeeping_task(void) { + housekeeping_task_modules(); housekeeping_task_kb(); housekeeping_task_user(); } @@ -493,7 +533,7 @@ void keyboard_init(void) { debug_enable = true; #endif - keyboard_post_init_kb(); /* Always keep this last */ + keyboard_post_init_quantum(); /* Always keep this last */ } /** \brief key_event_task diff --git a/quantum/keycodes.h b/quantum/keycodes.h index 5929e3568739..b4fc38f5ff40 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -76,6 +76,8 @@ enum qk_keycode_ranges { QK_MACRO_MAX = 0x777F, QK_CONNECTION = 0x7780, QK_CONNECTION_MAX = 0x77BF, + QK_COMMUNITY_MODULE = 0x77C0, + QK_COMMUNITY_MODULE_MAX = 0x77FF, QK_LIGHTING = 0x7800, QK_LIGHTING_MAX = 0x78FF, QK_QUANTUM = 0x7C00, @@ -1476,6 +1478,7 @@ enum qk_keycode_defines { #define IS_QK_STENO(code) ((code) >= QK_STENO && (code) <= QK_STENO_MAX) #define IS_QK_MACRO(code) ((code) >= QK_MACRO && (code) <= QK_MACRO_MAX) #define IS_QK_CONNECTION(code) ((code) >= QK_CONNECTION && (code) <= QK_CONNECTION_MAX) +#define IS_QK_COMMUNITY_MODULE(code) ((code) >= QK_COMMUNITY_MODULE && (code) <= QK_COMMUNITY_MODULE_MAX) #define IS_QK_LIGHTING(code) ((code) >= QK_LIGHTING && (code) <= QK_LIGHTING_MAX) #define IS_QK_QUANTUM(code) ((code) >= QK_QUANTUM && (code) <= QK_QUANTUM_MAX) #define IS_QK_KB(code) ((code) >= QK_KB && (code) <= QK_KB_MAX) diff --git a/quantum/keymap_extras/keymap_eurkey.h b/quantum/keymap_extras/keymap_eurkey.h new file mode 100644 index 000000000000..20f7f58683e7 --- /dev/null +++ b/quantum/keymap_extras/keymap_eurkey.h @@ -0,0 +1,166 @@ +// Copyright 2025 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once +#include "keycodes.h" +// clang-format off + +// Aliases +#define EU_GRV KC_GRV // ` +#define EU_1 KC_1 // 1 +#define EU_2 KC_2 // 2 +#define EU_3 KC_3 // 3 +#define EU_4 KC_4 // 4 +#define EU_5 KC_5 // 5 +#define EU_6 KC_6 // 6 +#define EU_7 KC_7 // 7 +#define EU_8 KC_8 // 8 +#define EU_9 KC_9 // 9 +#define EU_0 KC_0 // 0 +#define EU_MINS KC_MINS // - +#define EU_EQL KC_EQL // = +#define EU_Q KC_Q // Q +#define EU_W KC_W // W +#define EU_E KC_E // E +#define EU_R KC_R // R +#define EU_T KC_T // T +#define EU_Y KC_Y // Y +#define EU_U KC_U // U +#define EU_I KC_I // I +#define EU_O KC_O // O +#define EU_P KC_P // P +#define EU_LBRC KC_LBRC // [ +#define EU_RBRC KC_RBRC // ] +#define EU_BSLS KC_BSLS // (backslash) +#define EU_A KC_A // A +#define EU_S KC_S // S +#define EU_D KC_D // D +#define EU_F KC_F // F +#define EU_G KC_G // G +#define EU_H KC_H // H +#define EU_J KC_J // J +#define EU_K KC_K // K +#define EU_L KC_L // L +#define EU_SCLN KC_SCLN // ; +#define EU_QUOT KC_QUOT // ' +#define EU_Z KC_Z // Z +#define EU_X KC_X // X +#define EU_C KC_C // C +#define EU_V KC_V // V +#define EU_B KC_B // B +#define EU_N KC_N // N +#define EU_M KC_M // M +#define EU_COMM KC_COMM // , +#define EU_DOT KC_DOT // . +#define EU_SLSH KC_SLSH // / +#define EU_TILD S(EU_GRV) // ~ +#define EU_EXLM S(EU_1) // ! +#define EU_AT S(EU_2) // @ +#define EU_HASH S(EU_3) // # +#define EU_DLR S(EU_4) // $ +#define EU_PERC S(EU_5) // % +#define EU_CIRC S(EU_6) // ^ +#define EU_AMPR S(EU_7) // & +#define EU_ASTR S(EU_8) // * +#define EU_LPRN S(EU_9) // ( +#define EU_RPRN S(EU_0) // ) +#define EU_UNDS S(EU_MINS) // _ +#define EU_PLUS S(EU_EQL) // + +#define EU_LCBR S(EU_LBRC) // { +#define EU_RCBR S(EU_RBRC) // } +#define EU_PIPE S(EU_BSLS) // | +#define EU_COLN S(EU_SCLN) // : +#define EU_DQUO S(EU_QUOT) // " +#define EU_LABK S(EU_COMM) // < +#define EU_RABK S(EU_DOT) // > +#define EU_QUES S(EU_SLSH) // ? +#define EU_DGRV ALGR(EU_GRV) // ` (dead) +#define EU_IEXL ALGR(EU_1) // ¡ +#define EU_FORD ALGR(EU_2) // ª +#define EU_MORD ALGR(EU_3) // º +#define EU_PND ALGR(EU_4) // £ +#define EU_EURO ALGR(EU_5) // € +#define EU_DCIR ALGR(EU_6) // ^ (dead) +#define EU_RNGA ALGR(EU_7) // ˚ (dead) +#define EU_DLQU ALGR(EU_8) // „ +#define EU_LDQU ALGR(EU_9) // “ +#define EU_RDQU ALGR(EU_0) // ” +#define EU_NDSH ALGR(EU_MINS) // – +#define EU_MUL ALGR(EU_EQL) // × +#define EU_AE ALGR(EU_Q) // æ +#define EU_ARNG ALGR(EU_W) // Å +#define EU_EDIA ALGR(EU_E) // Ë +#define EU_YACU ALGR(EU_R) // Ý +#define EU_THRN ALGR(EU_T) // Þ +#define EU_YDIA ALGR(EU_Y) // Ÿ +#define EU_UDIA ALGR(EU_U) // Ü +#define EU_IDIA ALGR(EU_I) // Ï +#define EU_ODIA ALGR(EU_O) // Ö +#define EU_OE ALGR(EU_P) // Œ +#define EU_LDAQ ALGR(EU_LBRC) // « +#define EU_RDAQ ALGR(EU_RBRC) // » +#define EU_NOT ALGR(EU_BSLS) // ¬ +#define EU_ADIA ALGR(EU_A) // Ä +#define EU_SS ALGR(EU_S) // ß +#define EU_ETH ALGR(EU_D) // Ð +#define EU_EGRV ALGR(EU_F) // È +#define EU_EACU ALGR(EU_G) // É +#define EU_UGRV ALGR(EU_H) // Ù +#define EU_UACU ALGR(EU_J) // Ú +#define EU_IJ ALGR(EU_K) // IJ +#define EU_OSTR ALGR(EU_L) // Ø +#define EU_DEG ALGR(EU_SCLN) // ° +#define EU_ACUT ALGR(EU_QUOT) // ´ (dead) +#define EU_AGRV ALGR(EU_Z) // À +#define EU_AACU ALGR(EU_X) // Á +#define EU_CCED ALGR(EU_C) // Ç +#define EU_IGRV ALGR(EU_V) // Ì +#define EU_IACU ALGR(EU_B) // Í +#define EU_NTIL ALGR(EU_N) // Ñ +#define EU_DGRK ALGR(EU_M) // μ (dead Greek key) +#define EU_OGRV ALGR(EU_COMM) // Ò +#define EU_OACU ALGR(EU_DOT) // Ó +#define EU_IQUE ALGR(EU_SLSH) // ¿ +#define EU_DTIL ALGR(EU_TILD) // ~ (dead) +#define EU_SUP1 S(ALGR(EU_1)) // ¹ +#define EU_SUP2 S(ALGR(EU_2)) // ² +#define EU_SUP3 S(ALGR(EU_3)) // ³ +#define EU_YEN ALGR(EU_DLR) // ¥ +#define EU_CENT S(EU_EURO) // ¢ +#define EU_CARN S(EU_DCIR) // ˇ (dead) +#define EU_MACR S(ALGR(EU_7)) // ¯ (dead) +#define EU_SLQU S(EU_DLQU) // ‚ +#define EU_LSQU S(EU_LDQU) // ‘ +#define EU_RSQU S(EU_RDQU) // ’ +#define EU_MDSH S(EU_NDSH) // — +#define EU_DIV S(EU_MUL) // ÷ +#define EU_LSAQ S(EU_LDAQ) // ‹ +#define EU_RSAQ S(EU_RDAQ) // › +#define EU_BRKP S(ALGR(EU_BSLS)) // ¦ +#define EU_SECT S(ALGR(EU_S)) // § +#define EU_MDDT S(ALGR(EU_SCLN)) // · +#define EU_DIAE ALGR(EU_DQUO) // ¨ (dead) +#define EU_ELLP ALGR(EU_QUES) // … + diff --git a/quantum/keymap_extras/keymap_farsi.h b/quantum/keymap_extras/keymap_farsi.h index 8e16188a8f22..4f34b08d929b 100644 --- a/quantum/keymap_extras/keymap_farsi.h +++ b/quantum/keymap_extras/keymap_farsi.h @@ -150,7 +150,7 @@ #define FA_DQT ALGR(FA_GAF) // " #define FA_MINA ALGR(FA_BSLS) // - #define FA_PIPE ALGR(FA_ZA) // | -#define FA_SUBA ALGR(FA_RA) // ٖ +#define FA_SUBA ALGR(FA_RE) // ٖ #define FA_HMZB ALGR(FA_DAL) // ء #define FA_ELLP ALGR(FA_PE) // … #define FA_COMM ALGR(FA_WAW) // , diff --git a/quantum/keymap_introspection.c b/quantum/keymap_introspection.c index 236b54ce9801..23e842353a37 100644 --- a/quantum/keymap_introspection.c +++ b/quantum/keymap_introspection.c @@ -1,6 +1,10 @@ // Copyright 2022 Nick Brassel (@tzarc) // SPDX-License-Identifier: GPL-2.0-or-later +#if defined(COMMUNITY_MODULES_ENABLE) +# include "community_modules_introspection.h" +#endif // defined(COMMUNITY_MODULES_ENABLE) + // Pull the actual keymap code so that we can inspect stuff from it #include KEYMAP_C @@ -171,3 +175,10 @@ __attribute__((weak)) const key_override_t* key_override_get(uint16_t key_overri } #endif // defined(KEY_OVERRIDE_ENABLE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Community modules (must be last in this file!) + +#if defined(COMMUNITY_MODULES_ENABLE) +# include "community_modules_introspection.c" +#endif // defined(COMMUNITY_MODULES_ENABLE) diff --git a/quantum/leader.c b/quantum/leader.c index 272609ad0cfa..23e5e8cd6d31 100644 --- a/quantum/leader.c +++ b/quantum/leader.c @@ -21,6 +21,10 @@ __attribute__((weak)) void leader_start_user(void) {} __attribute__((weak)) void leader_end_user(void) {} +__attribute__((weak)) bool leader_add_user(uint16_t keycode) { + return false; +} + void leader_start(void) { if (leading) { return; @@ -61,6 +65,9 @@ bool leader_sequence_add(uint16_t keycode) { leader_sequence[leader_sequence_size] = keycode; leader_sequence_size++; + if (leader_add_user(keycode)) { + leader_end(); + } return true; } diff --git a/quantum/leader.h b/quantum/leader.h index 3177fcd1962c..fba6b287ba3f 100644 --- a/quantum/leader.h +++ b/quantum/leader.h @@ -21,6 +21,15 @@ void leader_start_user(void); */ void leader_end_user(void); +/** + * \brief User callback, invoked when a keycode is added to the leader sequence. + * + * \param keycode The keycode added to the leader sequence. + * + * \return `true` to finish the key sequence, `false` to continue. + */ +bool leader_add_user(uint16_t keycode); + /** * Begin the leader sequence, resetting the buffer and timer. */ diff --git a/quantum/os_detection.c b/quantum/os_detection.c index 84bbeeed5448..9a9f9052f244 100644 --- a/quantum/os_detection.c +++ b/quantum/os_detection.c @@ -72,6 +72,8 @@ static volatile struct usb_device_state maxprev_usb_device_state = {.configure_s static volatile bool debouncing = false; static volatile fast_timer_t last_time = 0; +bool process_detected_host_os_modules(os_variant_t os); + void os_detection_task(void) { #ifdef OS_DETECTION_KEYBOARD_RESET // resetting the keyboard on the USB device state change callback results in instability, so delegate that to this task @@ -96,12 +98,17 @@ void os_detection_task(void) { if (detected_os != reported_os || first_report) { first_report = false; reported_os = detected_os; + process_detected_host_os_modules(detected_os); process_detected_host_os_kb(detected_os); } } } } +__attribute__((weak)) bool process_detected_host_os_modules(os_variant_t os) { + return true; +} + __attribute__((weak)) bool process_detected_host_os_kb(os_variant_t detected_os) { return process_detected_host_os_user(detected_os); } diff --git a/quantum/os_detection/tests/rules.mk b/quantum/os_detection/tests/rules.mk index 1b69b71ba9fa..2f31f5e39167 100644 --- a/quantum/os_detection/tests/rules.mk +++ b/quantum/os_detection/tests/rules.mk @@ -4,4 +4,5 @@ os_detection_DEFS += -DOS_DETECTION_DEBOUNCE=50 os_detection_SRC := \ $(QUANTUM_PATH)/os_detection/tests/os_detection.cpp \ $(QUANTUM_PATH)/os_detection.c \ + $(PLATFORM_PATH)/timer.c \ $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c diff --git a/quantum/painter/qgf.c b/quantum/painter/qgf.c index bc2df949334a..07c3f80314c5 100644 --- a/quantum/painter/qgf.c +++ b/quantum/painter/qgf.c @@ -255,10 +255,10 @@ bool qgf_validate_stream(qp_stream_t *stream) { // Read and validate all the frames (automatically validates the frame offset descriptor in the process) for (uint16_t i = 0; i < frame_count; ++i) { // Validate the frame descriptor block - uint8_t bpp; - bool has_palette; - bool is_panel_native; - bool has_delta; + uint8_t bpp = 0; + bool has_palette = false; + bool is_panel_native = false; + bool has_delta = false; if (!qgf_validate_frame_descriptor(stream, i, &bpp, &has_palette, &is_panel_native, &has_delta)) { return false; } diff --git a/quantum/painter/qp.h b/quantum/painter/qp.h index 3dc77b42cfb5..f7fdb027893c 100644 --- a/quantum/painter/qp.h +++ b/quantum/painter/qp.h @@ -557,6 +557,12 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai # define SH1106_NUM_DEVICES 0 #endif // QUANTUM_PAINTER_SH1106_ENABLE +#ifdef QUANTUM_PAINTER_SH1107_ENABLE +# include "qp_sh1107.h" +#else // QUANTUM_PAINTER_SH1107_ENABLE +# define SH1107_NUM_DEVICES 0 +#endif // QUANTUM_PAINTER_SH1107_ENABLE + #ifdef QUANTUM_PAINTER_LD7032_ENABLE # include "qp_ld7032.h" #else // QUANTUM_PAINTER_LD7032_ENABLE diff --git a/quantum/painter/qp_draw_image.c b/quantum/painter/qp_draw_image.c index 18fa38cb19ff..a225039af4cc 100644 --- a/quantum/painter/qp_draw_image.c +++ b/quantum/painter/qp_draw_image.c @@ -318,9 +318,9 @@ static deferred_token qp_render_animation_state(animation_state_t *state, uint16 } static uint32_t animation_callback(uint32_t trigger_time, void *cb_arg) { - animation_state_t *state = (animation_state_t *)cb_arg; - uint16_t delay_ms; - bool ret = qp_render_animation_state(state, &delay_ms); + animation_state_t *state = (animation_state_t *)cb_arg; + uint16_t delay_ms = 0; + bool ret = qp_render_animation_state(state, &delay_ms); if (!ret) { // Setting the device to NULL clears the animation slot state->device = NULL; diff --git a/quantum/painter/qp_internal.c b/quantum/painter/qp_internal.c index 5097edfa0747..24b881bd0900 100644 --- a/quantum/painter/qp_internal.c +++ b/quantum/painter/qp_internal.c @@ -19,6 +19,7 @@ enum { + (GC9107_NUM_DEVICES) // GC9107 + (SSD1351_NUM_DEVICES) // SSD1351 + (SH1106_NUM_DEVICES) // SH1106 + + (SH1107_NUM_DEVICES) // SH1107 + (LD7032_NUM_DEVICES) // LD7032 }; diff --git a/quantum/painter/rules.mk b/quantum/painter/rules.mk index b773dd091c30..10c2698092b6 100644 --- a/quantum/painter/rules.mk +++ b/quantum/painter/rules.mk @@ -18,6 +18,8 @@ VALID_QUANTUM_PAINTER_DRIVERS := \ ssd1351_spi \ sh1106_i2c \ sh1106_spi \ + sh1107_i2c \ + sh1107_spi \ ld7032_i2c \ ld7032_spi @@ -184,6 +186,29 @@ define handle_quantum_painter_driver $(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \ $(DRIVER_PATH)/painter/sh1106/qp_sh1106.c + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1107_spi) + QUANTUM_PAINTER_NEEDS_SURFACE := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes + QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes + OPT_DEFS += -DQUANTUM_PAINTER_SH1107_ENABLE -DQUANTUM_PAINTER_SH1107_SPI_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/oled_panel \ + $(DRIVER_PATH)/painter/sh1107 + SRC += \ + $(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \ + $(DRIVER_PATH)/painter/sh1107/qp_sh1107.c + + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1107_i2c) + QUANTUM_PAINTER_NEEDS_SURFACE := yes + QUANTUM_PAINTER_NEEDS_COMMS_I2C := yes + OPT_DEFS += -DQUANTUM_PAINTER_SH1107_ENABLE -DQUANTUM_PAINTER_SH1107_I2C_ENABLE + COMMON_VPATH += \ + $(DRIVER_PATH)/painter/oled_panel \ + $(DRIVER_PATH)/painter/sh1107 + SRC += \ + $(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \ + $(DRIVER_PATH)/painter/sh1107/qp_sh1107.c + else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ld7032_spi) QUANTUM_PAINTER_NEEDS_SURFACE := yes QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes diff --git a/quantum/quantum.c b/quantum/quantum.c index d4ebd58e7fca..adb14d64b610 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,6 +162,10 @@ __attribute__((weak)) void tap_code16(uint16_t code) { tap_code16_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); } +__attribute__((weak)) bool pre_process_record_modules(uint16_t keycode, keyrecord_t *record) { + return true; +} + __attribute__((weak)) bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record) { return pre_process_record_user(keycode, record); } @@ -174,6 +178,10 @@ __attribute__((weak)) bool process_action_kb(keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_record_modules(uint16_t keycode, keyrecord_t *record) { + return true; +} + __attribute__((weak)) bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } @@ -182,12 +190,22 @@ __attribute__((weak)) bool process_record_user(uint16_t keycode, keyrecord_t *re return true; } +__attribute__((weak)) void post_process_record_modules(uint16_t keycode, keyrecord_t *record) {} + __attribute__((weak)) void post_process_record_kb(uint16_t keycode, keyrecord_t *record) { post_process_record_user(keycode, record); } __attribute__((weak)) void post_process_record_user(uint16_t keycode, keyrecord_t *record) {} +__attribute__((weak)) bool shutdown_modules(bool jump_to_bootloader) { + return true; +} + +__attribute__((weak)) void suspend_power_down_modules(void) {} + +__attribute__((weak)) void suspend_wakeup_init_modules(void) {} + void shutdown_quantum(bool jump_to_bootloader) { clear_keyboard(); #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) @@ -199,11 +217,13 @@ void shutdown_quantum(bool jump_to_bootloader) { # endif uint16_t timer_start = timer_read(); PLAY_SONG(goodbye_song); + shutdown_modules(jump_to_bootloader); shutdown_kb(jump_to_bootloader); while (timer_elapsed(timer_start) < 250) wait_ms(1); stop_all_notes(); #else + shutdown_modules(jump_to_bootloader); shutdown_kb(jump_to_bootloader); wait_ms(250); #endif @@ -258,7 +278,7 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) { /* Get keycode, and then process pre tapping functionality */ bool pre_process_record_quantum(keyrecord_t *record) { - return pre_process_record_kb(get_record_keycode(record, true), record) && + return pre_process_record_modules(get_record_keycode(record, true), record) && pre_process_record_kb(get_record_keycode(record, true), record) && #ifdef COMBO_ENABLE process_combo(get_record_keycode(record, true), record) && #endif @@ -268,6 +288,7 @@ bool pre_process_record_quantum(keyrecord_t *record) { /* Get keycode, and then call keyboard function */ void post_process_record_quantum(keyrecord_t *record) { uint16_t keycode = get_record_keycode(record, false); + post_process_record_modules(keycode, record); post_process_record_kb(keycode, record); } @@ -329,13 +350,14 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef HAPTIC_ENABLE process_haptic(keycode, record) && #endif -#if defined(VIA_ENABLE) - process_record_via(keycode, record) && -#endif #if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) process_auto_mouse(keycode, record) && #endif + process_record_modules(keycode, record) && // modules must run before kb process_record_kb(keycode, record) && +#if defined(VIA_ENABLE) + process_record_via(keycode, record) && +#endif #if defined(SECURE_ENABLE) process_secure(keycode, record) && #endif @@ -526,6 +548,7 @@ __attribute__((weak)) bool shutdown_kb(bool jump_to_bootloader) { } void suspend_power_down_quantum(void) { + suspend_power_down_modules(); suspend_power_down_kb(); #ifndef NO_SUSPEND_POWER_DOWN // Turn off backlight @@ -593,6 +616,7 @@ __attribute__((weak)) void suspend_wakeup_init_quantum(void) { #if defined(RGB_MATRIX_ENABLE) rgb_matrix_set_suspend_state(false); #endif + suspend_wakeup_init_modules(); suspend_wakeup_init_kb(); } diff --git a/quantum/quantum.h b/quantum/quantum.h index 9db88a54d4ba..59a415ead4ea 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -244,6 +244,10 @@ extern layer_state_t layer_state; # include "layer_lock.h" #endif +#ifdef COMMUNITY_MODULES_ENABLE +# include "community_modules.h" +#endif + void set_single_default_layer(uint8_t default_layer); void set_single_persistent_default_layer(uint8_t default_layer); diff --git a/quantum/rgb_matrix/animations/hue_breathing_anim.h b/quantum/rgb_matrix/animations/hue_breathing_anim.h index 5316e92dbdc5..60d7426cfc5c 100644 --- a/quantum/rgb_matrix/animations/hue_breathing_anim.h +++ b/quantum/rgb_matrix/animations/hue_breathing_anim.h @@ -2,21 +2,17 @@ RGB_MATRIX_EFFECT(HUE_BREATHING) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -// Change huedelta to adjust range of hue change. 0-255. // Hue Breathing - All LED's light up +hsv_t HUE_BREATHING_math(hsv_t hsv, uint8_t i, uint8_t time) { + // Adjust delta between 0-255 to change hue range + uint8_t delta = 12; + hsv.h = hsv.h + scale8(abs8(sin8(time / 2) - 128) * 2, delta); + return hsv; +} + bool HUE_BREATHING(effect_params_t* params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); - uint8_t huedelta = 12; - hsv_t hsv = rgb_matrix_config.hsv; - uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - hsv.h = hsv.h + scale8(abs8(sin8(time) - 128) * 2, huedelta); - rgb_t rgb = hsv_to_rgb(hsv); - for (uint8_t i = led_min; i < led_max; i++) { - RGB_MATRIX_TEST_LED_FLAGS(); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - return rgb_matrix_check_finished_leds(led_max); + return effect_runner_i(params, &HUE_BREATHING_math); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // DISABLE_RGB_HUE_BREATHING +#endif // ENABLE_RGB_MATRIX_HUE_BREATHING diff --git a/quantum/rgb_matrix/animations/raindrops_anim.h b/quantum/rgb_matrix/animations/raindrops_anim.h index a682156da241..d4f79adb560d 100644 --- a/quantum/rgb_matrix/animations/raindrops_anim.h +++ b/quantum/rgb_matrix/animations/raindrops_anim.h @@ -2,35 +2,42 @@ RGB_MATRIX_EFFECT(RAINDROPS) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -static void raindrops_set_color(int i, effect_params_t* params) { +static void raindrops_set_color(uint8_t i, effect_params_t* params) { if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; - hsv_t hsv = {0, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v}; + hsv_t hsv = rgb_matrix_config.hsv; // Take the shortest path between hues - int16_t deltaH = ((rgb_matrix_config.hsv.h + 180) % 360 - rgb_matrix_config.hsv.h) / 4; + int16_t deltaH = ((hsv.h + 180) % 360 - hsv.h) / 4; if (deltaH > 127) { deltaH -= 256; } else if (deltaH < -127) { deltaH += 256; } - hsv.h = rgb_matrix_config.hsv.h + (deltaH * (random8() & 0x03)); + hsv.h += (deltaH * random8_max(3)); rgb_t rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } bool RAINDROPS(effect_params_t* params) { + static uint16_t index = RGB_MATRIX_LED_COUNT + 1; + + // Periodic trigger for LED change + if ((params->iter == 0) && (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0)) { + index = random8_max(RGB_MATRIX_LED_COUNT); + } + RGB_MATRIX_USE_LIMITS(led_min, led_max); - if (!params->init) { - // Change one LED every tick, make sure speed is not 0 - if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { - raindrops_set_color(random8_max(RGB_MATRIX_LED_COUNT), params); - } - } else { - for (int i = led_min; i < led_max; i++) { + if (params->init) { + for (uint8_t i = led_min; i < led_max; i++) { raindrops_set_color(i, params); } } + // Change LED once and set index out of range till next trigger + else if (led_min <= index && index < led_max) { + raindrops_set_color(index, params); + index = RGB_MATRIX_LED_COUNT + 1; + } return rgb_matrix_check_finished_leds(led_max); } diff --git a/quantum/rgb_matrix/animations/starlight_anim.h b/quantum/rgb_matrix/animations/starlight_anim.h index 742e843b575c..c4f943c5cef7 100644 --- a/quantum/rgb_matrix/animations/starlight_anim.h +++ b/quantum/rgb_matrix/animations/starlight_anim.h @@ -2,7 +2,9 @@ RGB_MATRIX_EFFECT(STARLIGHT) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -void set_starlight_color(uint8_t i, effect_params_t* params) { +static void set_starlight_color(uint8_t i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); hsv_t hsv = rgb_matrix_config.hsv; hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); @@ -11,21 +13,26 @@ void set_starlight_color(uint8_t i, effect_params_t* params) { } bool STARLIGHT(effect_params_t* params) { - if (!params->init) { - if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { - uint8_t rand_led = random8_max(RGB_MATRIX_LED_COUNT); - set_starlight_color(rand_led, params); - } - return false; + static uint16_t index = RGB_MATRIX_LED_COUNT + 1; + + // Periodic trigger for LED change + if ((params->iter == 0) && (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0)) { + index = random8_max(RGB_MATRIX_LED_COUNT); } RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (uint8_t i = led_min; i < led_max; i++) { - RGB_MATRIX_TEST_LED_FLAGS(); - set_starlight_color(i, params); + if (params->init) { + for (uint8_t i = led_min; i < led_max; i++) { + set_starlight_color(i, params); + } + } + // Change LED once and set index out of range till next trigger + else if (led_min <= index && index < led_max) { + set_starlight_color(index, params); + index = RGB_MATRIX_LED_COUNT + 1; } return rgb_matrix_check_finished_leds(led_max); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT \ No newline at end of file +#endif // ENABLE_RGB_MATRIX_STARLIGHT diff --git a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h index 50ce5d6ab478..276b8c3fdfc6 100644 --- a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h +++ b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h @@ -2,31 +2,38 @@ RGB_MATRIX_EFFECT(STARLIGHT_DUAL_HUE) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -void set_starlight_dual_hue_color(uint8_t i, effect_params_t* params) { +static void set_starlight_dual_hue_color(uint8_t i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); hsv_t hsv = rgb_matrix_config.hsv; hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - hsv.h = hsv.h + random8_max((30 + 1 - -30) + -30); + hsv.h = hsv.h + random8_max(31); rgb_t rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } bool STARLIGHT_DUAL_HUE(effect_params_t* params) { - if (!params->init) { - if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { - uint8_t rand_led = random8_max(RGB_MATRIX_LED_COUNT); - set_starlight_dual_hue_color(rand_led, params); - } - return false; + static uint16_t index = RGB_MATRIX_LED_COUNT + 1; + + // Periodic trigger for LED change + if ((params->iter == 0) && (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0)) { + index = random8_max(RGB_MATRIX_LED_COUNT); } RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (uint8_t i = led_min; i < led_max; i++) { - RGB_MATRIX_TEST_LED_FLAGS(); - set_starlight_dual_hue_color(i, params); + if (params->init) { + for (uint8_t i = led_min; i < led_max; i++) { + set_starlight_dual_hue_color(i, params); + } + } + // Change LED once and set index out of range till next trigger + else if (led_min <= index && index < led_max) { + set_starlight_dual_hue_color(index, params); + index = RGB_MATRIX_LED_COUNT + 1; } return rgb_matrix_check_finished_leds(led_max); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE \ No newline at end of file +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE diff --git a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h index 6def4eea098b..e063658982a5 100644 --- a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h +++ b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h @@ -2,31 +2,38 @@ RGB_MATRIX_EFFECT(STARLIGHT_DUAL_SAT) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -void set_starlight_dual_sat_color(uint8_t i, effect_params_t* params) { +static void set_starlight_dual_sat_color(uint8_t i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); hsv_t hsv = rgb_matrix_config.hsv; hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - hsv.s = hsv.s + random8_max((30 + 1 - -30) + -30); + hsv.s = hsv.s + random8_max(31); rgb_t rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } bool STARLIGHT_DUAL_SAT(effect_params_t* params) { - if (!params->init) { - if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { - uint8_t rand_led = random8_max(RGB_MATRIX_LED_COUNT); - set_starlight_dual_sat_color(rand_led, params); - } - return false; + static uint16_t index = RGB_MATRIX_LED_COUNT + 1; + + // Periodic trigger for LED change + if ((params->iter == 0) && (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0)) { + index = random8_max(RGB_MATRIX_LED_COUNT); } RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (uint8_t i = led_min; i < led_max; i++) { - RGB_MATRIX_TEST_LED_FLAGS(); - set_starlight_dual_sat_color(i, params); + if (params->init) { + for (uint8_t i = led_min; i < led_max; i++) { + set_starlight_dual_sat_color(i, params); + } + } + // Change LED once and set index out of range till next trigger + else if (led_min <= index && index < led_max) { + set_starlight_dual_sat_color(index, params); + index = RGB_MATRIX_LED_COUNT + 1; } return rgb_matrix_check_finished_leds(led_max); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT \ No newline at end of file +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT diff --git a/quantum/send_string/send_string.c b/quantum/send_string/send_string.c index 44c5ec5ab994..602f24dabe38 100644 --- a/quantum/send_string/send_string.c +++ b/quantum/send_string/send_string.c @@ -150,48 +150,65 @@ void send_string(const char *string) { send_string_with_delay(string, TAP_CODE_DELAY); } -void send_string_with_delay(const char *string, uint8_t interval) { +void send_string_with_delay_impl(char (*getter)(void *), void *arg, uint8_t interval) { while (1) { - char ascii_code = *string; + char ascii_code = getter(arg); if (!ascii_code) break; if (ascii_code == SS_QMK_PREFIX) { - ascii_code = *(++string); + ascii_code = getter(arg); if (ascii_code == SS_TAP_CODE) { // tap - uint8_t keycode = *(++string); + uint8_t keycode = getter(arg); tap_code(keycode); } else if (ascii_code == SS_DOWN_CODE) { // down - uint8_t keycode = *(++string); + uint8_t keycode = getter(arg); register_code(keycode); } else if (ascii_code == SS_UP_CODE) { // up - uint8_t keycode = *(++string); + uint8_t keycode = getter(arg); unregister_code(keycode); } else if (ascii_code == SS_DELAY_CODE) { // delay - int ms = 0; - uint8_t keycode = *(++string); + int ms = 0; + ascii_code = getter(arg); - while (isdigit(keycode)) { + while (isdigit(ascii_code)) { ms *= 10; - ms += keycode - '0'; - keycode = *(++string); + ms += ascii_code - '0'; + ascii_code = getter(arg); } wait_ms(ms); } wait_ms(interval); + + // if we had a delay that terminated with a null, we're done + if (ascii_code == 0) break; } else { send_char_with_delay(ascii_code, interval); } - - ++string; } } +typedef struct send_string_memory_state_t { + const char *string; +} send_string_memory_state_t; + +char send_string_get_next_ram(void *arg) { + send_string_memory_state_t *state = (send_string_memory_state_t *)arg; + char ret = *state->string; + state->string++; + return ret; +} + +void send_string_with_delay(const char *string, uint8_t interval) { + send_string_memory_state_t state = {string}; + send_string_with_delay_impl(send_string_get_next_ram, &state, interval); +} + void send_char(char ascii_code) { send_char_with_delay(ascii_code, TAP_CODE_DELAY); } @@ -297,42 +314,15 @@ void send_string_P(const char *string) { send_string_with_delay_P(string, TAP_CODE_DELAY); } -void send_string_with_delay_P(const char *string, uint8_t interval) { - while (1) { - char ascii_code = pgm_read_byte(string); - if (!ascii_code) break; - if (ascii_code == SS_QMK_PREFIX) { - ascii_code = pgm_read_byte(++string); - - if (ascii_code == SS_TAP_CODE) { - // tap - uint8_t keycode = pgm_read_byte(++string); - tap_code(keycode); - } else if (ascii_code == SS_DOWN_CODE) { - // down - uint8_t keycode = pgm_read_byte(++string); - register_code(keycode); - } else if (ascii_code == SS_UP_CODE) { - // up - uint8_t keycode = pgm_read_byte(++string); - unregister_code(keycode); - } else if (ascii_code == SS_DELAY_CODE) { - // delay - int ms = 0; - uint8_t keycode = pgm_read_byte(++string); - - while (isdigit(keycode)) { - ms *= 10; - ms += keycode - '0'; - keycode = pgm_read_byte(++string); - } - wait_ms(ms); - } - } else { - send_char_with_delay(ascii_code, interval); - } +char send_string_get_next_progmem(void *arg) { + send_string_memory_state_t *state = (send_string_memory_state_t *)arg; + char ret = pgm_read_byte(state->string); + state->string++; + return ret; +} - ++string; - } +void send_string_with_delay_P(const char *string, uint8_t interval) { + send_string_memory_state_t state = {string}; + send_string_with_delay_impl(send_string_get_next_progmem, &state, interval); } #endif diff --git a/quantum/send_string/send_string.h b/quantum/send_string/send_string.h index f727ec507da1..4f91252075d2 100644 --- a/quantum/send_string/send_string.h +++ b/quantum/send_string/send_string.h @@ -161,4 +161,12 @@ void send_string_with_delay_P(const char *string, uint8_t interval); */ #define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) +/** + * \brief Actual implementation function that iterates and sends the string returned by the getter function. + * + * The getter assumes that the next byte is available to be read, and returns it. `arg` is passed in and can be whatever + * makes most sense for the getter -- each invocation of `getter` must advance its position in the source. + */ +void send_string_with_delay_impl(char (*getter)(void *), void *arg, uint8_t interval); + /** \} */ diff --git a/quantum/sequencer/tests/rules.mk b/quantum/sequencer/tests/rules.mk index 611459e060e3..74b680ae31fd 100644 --- a/quantum/sequencer/tests/rules.mk +++ b/quantum/sequencer/tests/rules.mk @@ -8,4 +8,5 @@ sequencer_SRC := \ $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ $(QUANTUM_PATH)/sequencer/tests/sequencer_tests.cpp \ $(QUANTUM_PATH)/sequencer/sequencer.c \ + $(PLATFORM_PATH)/timer.c \ $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c diff --git a/tests/basic/test_one_shot_keys.cpp b/tests/basic/test_one_shot_keys.cpp index 64a8673a5cdb..92db52f811ed 100644 --- a/tests/basic/test_one_shot_keys.cpp +++ b/tests/basic/test_one_shot_keys.cpp @@ -168,7 +168,7 @@ TEST_F(OneShot, OSMChainingTwoOSMs) { tap_key(osm_key1); VERIFY_AND_CLEAR(driver); - /* Press and relesea OSM2 */ + /* Press and release OSM2 */ EXPECT_NO_REPORT(driver); tap_key(osm_key2); VERIFY_AND_CLEAR(driver); @@ -353,3 +353,337 @@ TEST_F(OneShot, OSLWithOsmAndAdditionalKeypress) { run_one_scan_loop(); VERIFY_AND_CLEAR(driver); } + +TEST_F(OneShot, OSLWithMoAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey mo_key = KeymapKey{1, 1, 0, MO(2)}; + KeymapKey regular_key = KeymapKey{2, 1, 1, KC_A}; + + set_keymap({osl_key, mo_key, regular_key}); + + /* Press OSL key */ + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release OSL key */ + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press MO */ + EXPECT_NO_REPORT(driver); + mo_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(2)); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(2)); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release MO */ + EXPECT_NO_REPORT(driver); + mo_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(0)); + VERIFY_AND_CLEAR(driver); +} + +class OneShotLayerParametrizedTestFixture : public ::testing::WithParamInterface, public OneShot {}; + +TEST_P(OneShotLayerParametrizedTestFixture, OSLWithActionAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey action_key = KeymapKey{1, 1, 0, GetParam()}; + KeymapKey regular_key = KeymapKey{2, 1, 1, KC_A}; + + set_keymap({osl_key, action_key, regular_key}); + + /* Tap OSL key */ + EXPECT_NO_REPORT(driver); + tap_key(osl_key); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Tag Action key */ + EXPECT_NO_REPORT(driver); + tap_key(action_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(2)); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(2)); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +INSTANTIATE_TEST_CASE_P(OneShotLayerTests, OneShotLayerParametrizedTestFixture, ::testing::Values(TG(2), TO(2))); + +TEST_F(OneShot, OSLWithDFAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey df_key = KeymapKey{1, 1, 0, DF(2)}; + KeymapKey regular_key = KeymapKey{2, 1, 1, KC_A}; + + set_keymap({osl_key, df_key, regular_key}); + + layer_state_t default_layer_state_bak = default_layer_state; + + /* Tap OSL key */ + EXPECT_NO_REPORT(driver); + tap_key(osl_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press DF key */ + EXPECT_NO_REPORT(driver); + df_key.press(); + run_one_scan_loop(); + EXPECT_EQ(default_layer_state, 0b001); + + VERIFY_AND_CLEAR(driver); + + /* Release DF key */ + EXPECT_NO_REPORT(driver); + df_key.release(); + run_one_scan_loop(); + EXPECT_EQ(default_layer_state, 0b100); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + default_layer_state = default_layer_state_bak; +} + +TEST_F(OneShot, OSLChainingTwoOSLsAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl1_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey osl2_key = KeymapKey{1, 1, 0, OSL(2)}; + KeymapKey regular_key = KeymapKey{2, 1, 1, KC_A}; + + set_keymap({osl1_key, osl2_key, regular_key}); + + /* Press and release first OSL key */ + EXPECT_NO_REPORT(driver); + osl1_key.press(); + run_one_scan_loop(); + osl1_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press and release second OSL */ + EXPECT_NO_REPORT(driver); + osl2_key.press(); + run_one_scan_loop(); + osl2_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(2)); + VERIFY_AND_CLEAR(driver); + + /* Press regular key */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + EXPECT_EMPTY_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(0)); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithShortLT) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey lt_key = KeymapKey(1, 1, 0, LT(2, KC_A)); + + set_keymap({osl_key, lt_key}); + + /* Tap OSL key */ + EXPECT_NO_REPORT(driver); + tap_key(osl_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Tap LT key. */ + EXPECT_REPORT(driver, (lt_key.report_code)).Times(1); + EXPECT_EMPTY_REPORT(driver); + tap_key(lt_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(0)); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithLongLTAndRegularKey) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey lt_key = KeymapKey(1, 1, 0, LT(2, KC_A)); + KeymapKey regular_key = KeymapKey(2, 1, 1, KC_B); + + set_keymap({osl_key, lt_key, regular_key}); + + /* Tap OSL key */ + EXPECT_NO_REPORT(driver); + tap_key(osl_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press LT key. */ + EXPECT_NO_REPORT(driver); + lt_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of mod tap hold key. */ + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + EXPECT_TRUE(layer_state_is(2)); + + /* Press regular key. */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithShortModTapKeyAndRegularKey) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_P)); + KeymapKey regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({osl_key, mod_tap_hold_key, regular_key}); + + /* Tap OSL key */ + EXPECT_NO_REPORT(driver); + tap_key(osl_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (regular_key.report_code)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithLongModTapKeyAndRegularKey) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey mod_tap_hold_key = KeymapKey(1, 1, 0, SFT_T(KC_P)); + KeymapKey regular_key = KeymapKey(1, 2, 0, KC_A); + + set_keymap({osl_key, mod_tap_hold_key, regular_key}); + + /* Tap OSL key */ + EXPECT_NO_REPORT(driver); + tap_key(osl_key); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Idle for tapping term of mod tap hold key. */ + EXPECT_REPORT(driver, (KC_LSFT)); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Press regular key. */ + EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); + EXPECT_EMPTY_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} \ No newline at end of file diff --git a/tests/tap_hold_configurations/chordal_hold/default/config.h b/tests/tap_hold_configurations/chordal_hold/default/config.h new file mode 100644 index 000000000000..2ba155df7301 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/default/config.h @@ -0,0 +1,21 @@ +/* Copyright 2022 Vladislav Kucheriavykh + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" +#define CHORDAL_HOLD diff --git a/keyboards/splitkb/aurora/sweep/rules.mk b/tests/tap_hold_configurations/chordal_hold/default/test.mk similarity index 85% rename from keyboards/splitkb/aurora/sweep/rules.mk rename to tests/tap_hold_configurations/chordal_hold/default/test.mk index ec1e102039d5..2b049cea3b4b 100644 --- a/keyboards/splitkb/aurora/sweep/rules.mk +++ b/tests/tap_hold_configurations/chordal_hold/default/test.mk @@ -1,4 +1,5 @@ -# Copyright 2022 splitkb.com +# Copyright 2022 Vladislav Kucheriavykh +# Copyright 2024 Google LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,4 +14,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -DEFAULT_FOLDER = splitkb/aurora/sweep/rev1 +INTROSPECTION_KEYMAP_C = test_keymap.c diff --git a/tests/tap_hold_configurations/chordal_hold/default/test_keymap.c b/tests/tap_hold_configurations/chordal_hold/default/test_keymap.c new file mode 100644 index 000000000000..8a6a2c59b0ae --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/default/test_keymap.c @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "quantum.h" + +const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'*', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, +}; diff --git a/tests/tap_hold_configurations/chordal_hold/default/test_one_shot_keys.cpp b/tests/tap_hold_configurations/chordal_hold/default/test_one_shot_keys.cpp new file mode 100644 index 000000000000..ac4edd08b237 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/default/test_one_shot_keys.cpp @@ -0,0 +1,168 @@ +/* Copyright 2021 Stefan Kerkmann + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "action_util.h" +#include "keyboard_report_util.hpp" +#include "test_common.hpp" + +using testing::_; +using testing::InSequence; + +class OneShot : public TestFixture {}; +class OneShotParametrizedTestFixture : public ::testing::WithParamInterface>, public OneShot {}; + +TEST_P(OneShotParametrizedTestFixture, OSMWithAdditionalKeypress) { + TestDriver driver; + KeymapKey osm_key = GetParam().first; + KeymapKey regular_key = GetParam().second; + + set_keymap({osm_key, regular_key}); + + // Press and release OSM. + EXPECT_NO_REPORT(driver); + tap_key(osm_key); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypress) { + TestDriver driver; + KeymapKey osm_key = GetParam().first; + KeymapKey regular_key = GetParam().second; + + set_keymap({osm_key, regular_key}); + + // Press OSM. + EXPECT_NO_REPORT(driver); + osm_key.press(); + run_one_scan_loop(); + // Press regular key. + regular_key.press(); + run_one_scan_loop(); + // Release regular key. + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release OSM. + EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)); + EXPECT_EMPTY_REPORT(driver); + osm_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +// clang-format off + +INSTANTIATE_TEST_CASE_P( + OneShotModifierTests, + OneShotParametrizedTestFixture, + ::testing::Values( + // First is osm key, second is regular key. + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LSFT), KC_LSFT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LCTL), KC_LCTL}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LALT), KC_LALT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LGUI), KC_LGUI}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RCTL), KC_RCTL}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RSFT), KC_RSFT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RALT), KC_RALT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RGUI), KC_RGUI}, KeymapKey{0, 1, 1, KC_A}) + )); +// clang-format on + +TEST_F(OneShot, OSLWithAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey osl_key1 = KeymapKey{1, 0, 0, KC_X}; + KeymapKey regular_key0 = KeymapKey{0, 1, 0, KC_Y}; + KeymapKey regular_key1 = KeymapKey{1, 1, 0, KC_A}; + + set_keymap({osl_key, osl_key1, regular_key0, regular_key1}); + + // Press OSL key. + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release OSL key. + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (regular_key1.report_code)); + EXPECT_EMPTY_REPORT(driver); + regular_key1.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_NO_REPORT(driver); + regular_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithOsmAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey osm_key = KeymapKey{1, 1, 0, OSM(MOD_LSFT), KC_LSFT}; + KeymapKey regular_key = KeymapKey{1, 1, 1, KC_A}; + KeymapKey blank_key = KeymapKey{1, 0, 0, KC_NO}; + + set_keymap({osl_key, osm_key, regular_key, blank_key}); + + // Press OSL key. + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release OSL key. + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + // Press and release OSM. + EXPECT_NO_REPORT(driver); + tap_key(osm_key); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + // Tap regular key. + EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)); + EXPECT_EMPTY_REPORT(driver); + tap_key(regular_key); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/chordal_hold/default/test_tap_hold.cpp b/tests/tap_hold_configurations/chordal_hold/default/test_tap_hold.cpp new file mode 100644 index 000000000000..70949e218c9c --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/default/test_tap_hold.cpp @@ -0,0 +1,264 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class ChordalHoldDefault : public TestFixture {}; + +TEST_F(ChordalHoldDefault, chord_nested_press_settled_as_tap) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + // Tap regular key. + tap_key(regular_key); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, chord_rolled_press_settled_as_tap) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap key and regular key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, non_chord_with_mod_tap_settled_as_tap) { + TestDriver driver; + InSequence s; + // Mod-tap key and regular key both on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap-hold key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_REPORT(driver, (KC_P)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap-hold key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, tap_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + idle_for(TAPPING_TERM - 1); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, hold_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key.press(); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, two_mod_taps_same_hand_hold_til_timeout) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, MATRIX_COLS - 2, 0, RCTL_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Continue holding til the tapping term. + EXPECT_REPORT(driver, (KC_RIGHT_CTRL)); + EXPECT_REPORT(driver, (KC_RIGHT_CTRL, KC_RIGHT_SHIFT)); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap keys. + EXPECT_REPORT(driver, (KC_RIGHT_SHIFT)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, three_mod_taps_same_hand_streak_roll) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, 3, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 1, 2, 3. + // + // NOTE: The correct order of events should be + // EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_C)); + // EXPECT_EMPTY_REPORT(driver); + // + // However, due to a workaround for https://github.com/tmk/tmk_keyboard/issues/60, + // the events are processed out of order, with the first two keys released + // before pressing KC_C. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_C)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldDefault, tap_regular_key_while_layer_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + auto layer_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, layer_key}); + + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); // Press layer-tap-hold key. + run_one_scan_loop(); + regular_key.press(); // Press regular key. + run_one_scan_loop(); + regular_key.release(); // Release regular key. + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + layer_tap_hold_key.release(); // Release layer-tap-hold key. + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/config.h b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/config.h new file mode 100644 index 000000000000..87094b2faca9 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/config.h @@ -0,0 +1,22 @@ +/* Copyright 2022 Vladislav Kucheriavykh + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" +#define CHORDAL_HOLD +#define HOLD_ON_OTHER_KEY_PRESS diff --git a/keyboards/splitkb/aurora/lily58/rules.mk b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test.mk similarity index 85% rename from keyboards/splitkb/aurora/lily58/rules.mk rename to tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test.mk index 1f5b922836fa..2b049cea3b4b 100644 --- a/keyboards/splitkb/aurora/lily58/rules.mk +++ b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test.mk @@ -1,4 +1,5 @@ -# Copyright 2022 splitkb.com +# Copyright 2022 Vladislav Kucheriavykh +# Copyright 2024 Google LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,4 +14,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -DEFAULT_FOLDER = splitkb/aurora/lily58/rev1 +INTROSPECTION_KEYMAP_C = test_keymap.c diff --git a/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test_keymap.c b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test_keymap.c new file mode 100644 index 000000000000..8a6a2c59b0ae --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test_keymap.c @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "quantum.h" + +const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'*', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, +}; diff --git a/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test_tap_hold.cpp b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test_tap_hold.cpp new file mode 100644 index 000000000000..7691f226af6f --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/hold_on_other_key_press/test_tap_hold.cpp @@ -0,0 +1,850 @@ +// Copyright 2024-2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class ChordalHoldHoldOnOtherKeyPress : public TestFixture {}; + +TEST_F(ChordalHoldHoldOnOtherKeyPress, chord_with_mod_tap_settled_as_hold) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap-hold key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap-hold key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, chord_nested_press_settled_as_hold) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap-hold key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Tap regular key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_A)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + tap_key(regular_key); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap-hold key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, chord_rolled_press_settled_as_hold) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap key. + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, non_chord_with_mod_tap_settled_as_tap) { + TestDriver driver; + InSequence s; + // Mod-tap key and regular key both on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap-hold key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_REPORT(driver, (KC_P)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap-hold key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, tap_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + idle_for(TAPPING_TERM - 1); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, hold_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key.press(); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_taps_same_hand_hold_til_timeout) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, MATRIX_COLS - 2, 0, RCTL_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Continue holding til the tapping term. + EXPECT_REPORT(driver, (KC_RIGHT_CTRL)); + EXPECT_REPORT(driver, (KC_RIGHT_CTRL, KC_RIGHT_SHIFT)); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap keys. + EXPECT_REPORT(driver, (KC_RIGHT_SHIFT)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_taps_nested_press_opposite_hands) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press first mod-tap key. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press second mod-tap key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release second mod-tap key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release first mod-tap key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_taps_nested_press_same_hand) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap keys. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, three_mod_taps_same_hand_streak_roll) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, 3, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 1, 2, 3. + // + // NOTE: The correct order of events should be + // EXPECT_REPORT(driver, (KC_A)); + // EXPECT_REPORT(driver, (KC_A, KC_B)); + // EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_C)); + // EXPECT_EMPTY_REPORT(driver); + // + // However, due to a workaround for https://github.com/tmk/tmk_keyboard/issues/60, + // the events are processed out of order, with the first two keys released + // before pressing KC_C. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_C)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, three_mod_taps_same_hand_streak_orders) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, 3, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + // Press mod-tap keys. + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + // Release keys 3, 2, 1. + mod_tap_key3.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + // Press mod-tap keys. + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + // Release keys 3, 1, 2. + mod_tap_key3.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // NOTE: The correct order of events should be + // EXPECT_REPORT(driver, (KC_A)); + // EXPECT_REPORT(driver, (KC_A, KC_B)); + // EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_A, KC_C)); + // EXPECT_REPORT(driver, (KC_A)); + // EXPECT_EMPTY_REPORT(driver); + // + // However, due to a workaround for https://github.com/tmk/tmk_keyboard/issues/60, + // the events are processed out of order, with the first two keys released + // before pressing KC_C. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_C)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + // Press mod-tap keys. + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + // Release keys 2, 3, 1. + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, three_mod_taps_two_left_one_right) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 3. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 2, then key 1. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 3. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 1, then key 2. + EXPECT_REPORT(driver, (KC_LEFT_CTRL)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, three_mod_taps_one_held_two_tapped) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 3, 2, 1. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key3.press(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_key1.press(); + run_one_scan_loop(); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 3, 1, 2. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key3.press(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, tap_regular_key_while_layer_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + auto no_key = KeymapKey(1, 1, 0, XXXXXXX); + auto layer_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, no_key, layer_key}); + + // Press layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, long_distinct_taps_of_layer_tap_key_and_regular_key) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + auto layer_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key}); + + // Press layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Idle for tapping term of layer tap hold key. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM + 1); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, nested_tap_of_layer_0_layer_tap_keys) { + TestDriver driver; + InSequence s; + // The keys are layer-taps on layer 0 but regular keys on layer 1. + auto first_layer_tap_key = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto second_layer_tap_key = KeymapKey(0, MATRIX_COLS - 1, 0, LT(1, KC_P)); + auto first_key_on_layer = KeymapKey(1, 1, 0, KC_B); + auto second_key_on_layer = KeymapKey(1, MATRIX_COLS - 1, 0, KC_Q); + + set_keymap({first_layer_tap_key, second_layer_tap_key, first_key_on_layer, second_key_on_layer}); + + // Press first layer-tap key. + EXPECT_NO_REPORT(driver); + first_layer_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press second layer-tap key. + EXPECT_REPORT(driver, (KC_Q)); + second_layer_tap_key.press(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release second layer-tap key. + EXPECT_EMPTY_REPORT(driver); + second_layer_tap_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release first layer-tap key. + EXPECT_NO_REPORT(driver); + first_layer_tap_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, lt_mt_one_regular_key) { + TestDriver driver; + InSequence s; + auto lt_key = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto mt_key0 = KeymapKey(0, 2, 0, SFT_T(KC_B)); + auto mt_key1 = KeymapKey(1, 2, 0, CTL_T(KC_C)); + auto regular_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_X); + auto no_key0 = KeymapKey(0, MATRIX_COLS - 1, 0, XXXXXXX); + auto no_key1 = KeymapKey(1, 1, 0, XXXXXXX); + + set_keymap({lt_key, mt_key0, mt_key1, regular_key, no_key0, no_key1}); + + // Press LT, MT. + EXPECT_NO_REPORT(driver); + lt_key.press(); + run_one_scan_loop(); + mt_key1.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_LCTL)); + EXPECT_REPORT(driver, (KC_LCTL, KC_X)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release the regular key. + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release MT key. + EXPECT_EMPTY_REPORT(driver); + mt_key1.release(); + run_one_scan_loop(); + EXPECT_EQ(get_mods(), 0); + VERIFY_AND_CLEAR(driver); + + // Release LT key. + lt_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { + TestDriver driver; + InSequence s; + // The keys are layer-taps on all layers. + auto first_key_layer_0 = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto second_key_layer_0 = KeymapKey(0, MATRIX_COLS - 1, 0, LT(1, KC_P)); + auto first_key_layer_1 = KeymapKey(1, 1, 0, LT(2, KC_B)); + auto second_key_layer_1 = KeymapKey(1, MATRIX_COLS - 1, 0, LT(2, KC_Q)); + auto first_key_layer_2 = KeymapKey(2, 1, 0, KC_TRNS); + auto second_key_layer_2 = KeymapKey(2, MATRIX_COLS - 1, 0, KC_TRNS); + + set_keymap({first_key_layer_0, second_key_layer_0, first_key_layer_1, second_key_layer_1, first_key_layer_2, second_key_layer_2}); + + // Press first layer-tap key. + EXPECT_NO_REPORT(driver); + first_key_layer_0.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press second layer-tap key. + EXPECT_NO_REPORT(driver); + second_key_layer_0.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release second layer-tap key. + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + second_key_layer_0.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release first layer-tap key. + EXPECT_NO_REPORT(driver); + first_key_layer_0.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { + TestDriver driver; + InSequence s; + + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + auto layer_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, layer_key}); + + // Press layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_tap_keys_stuttered_press) { + TestDriver driver; + InSequence s; + + auto mod_tap_key1 = KeymapKey(0, 1, 0, LSFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, LCTL_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Hold first mod-tap key until the tapping term. + EXPECT_REPORT(driver, (KC_LSFT)); + mod_tap_key1.press(); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + // Press the second mod-tap key, then quickly release and press the first. + EXPECT_NO_REPORT(driver); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_REPORT(driver, (KC_B, KC_A)); + mod_tap_key1.press(); + run_one_scan_loop(); + EXPECT_EQ(get_mods(), 0); // Verify that Shift was released. + VERIFY_AND_CLEAR(driver); + + // Release both keys. + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/chordal_hold/permissive_hold/config.h b/tests/tap_hold_configurations/chordal_hold/permissive_hold/config.h new file mode 100644 index 000000000000..f7bb7ab0ec4c --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/permissive_hold/config.h @@ -0,0 +1,22 @@ +/* Copyright 2022 Vladislav Kucheriavykh + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" +#define CHORDAL_HOLD +#define PERMISSIVE_HOLD diff --git a/keyboards/splitkb/aurora/corne/rules.mk b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test.mk similarity index 85% rename from keyboards/splitkb/aurora/corne/rules.mk rename to tests/tap_hold_configurations/chordal_hold/permissive_hold/test.mk index 9b4b90e97244..2b049cea3b4b 100644 --- a/keyboards/splitkb/aurora/corne/rules.mk +++ b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test.mk @@ -1,4 +1,5 @@ -# Copyright 2022 splitkb.com +# Copyright 2022 Vladislav Kucheriavykh +# Copyright 2024 Google LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,4 +14,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -DEFAULT_FOLDER = splitkb/aurora/corne/rev1 +INTROSPECTION_KEYMAP_C = test_keymap.c diff --git a/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_keymap.c b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_keymap.c new file mode 100644 index 000000000000..8a6a2c59b0ae --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_keymap.c @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "quantum.h" + +const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'*', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, +}; diff --git a/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_one_shot_keys.cpp b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_one_shot_keys.cpp new file mode 100644 index 000000000000..e48cba73e241 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_one_shot_keys.cpp @@ -0,0 +1,174 @@ +/* Copyright 2021 Stefan Kerkmann + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "action_util.h" +#include "keyboard_report_util.hpp" +#include "test_common.hpp" + +using testing::_; +using testing::InSequence; + +class OneShot : public TestFixture {}; +class OneShotParametrizedTestFixture : public ::testing::WithParamInterface>, public OneShot {}; + +TEST_P(OneShotParametrizedTestFixture, OSMWithAdditionalKeypress) { + TestDriver driver; + KeymapKey osm_key = GetParam().first; + KeymapKey regular_key = GetParam().second; + + set_keymap({osm_key, regular_key}); + + // Press and release OSM. + EXPECT_NO_REPORT(driver); + tap_key(osm_key); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypress) { + TestDriver driver; + KeymapKey osm_key = GetParam().first; + KeymapKey regular_key = GetParam().second; + + set_keymap({osm_key, regular_key}); + + // Press OSM. + EXPECT_NO_REPORT(driver); + osm_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_REPORT(driver, (osm_key.report_code)).Times(2); + EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release OSM. + EXPECT_EMPTY_REPORT(driver); + osm_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +// clang-format off + +INSTANTIATE_TEST_CASE_P( + OneShotModifierTests, + OneShotParametrizedTestFixture, + ::testing::Values( + // First is osm key, second is regular key. + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LSFT), KC_LSFT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LCTL), KC_LCTL}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LALT), KC_LALT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_LGUI), KC_LGUI}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RCTL), KC_RCTL}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RSFT), KC_RSFT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RALT), KC_RALT}, KeymapKey{0, 1, 1, KC_A}), + std::make_pair(KeymapKey{0, 0, 0, OSM(MOD_RGUI), KC_RGUI}, KeymapKey{0, 1, 1, KC_A}) + )); +// clang-format on + +TEST_F(OneShot, OSLWithAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey osl_key1 = KeymapKey{1, 0, 0, KC_X}; + KeymapKey regular_key0 = KeymapKey{0, 1, 0, KC_Y}; + KeymapKey regular_key1 = KeymapKey{1, 1, 0, KC_A}; + + set_keymap({osl_key, osl_key1, regular_key0, regular_key1}); + + // Press OSL key. + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release OSL key. + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (regular_key1.report_code)); + EXPECT_EMPTY_REPORT(driver); + regular_key1.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_NO_REPORT(driver); + regular_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(OneShot, OSLWithOsmAndAdditionalKeypress) { + TestDriver driver; + InSequence s; + KeymapKey osl_key = KeymapKey{0, 0, 0, OSL(1)}; + KeymapKey osm_key = KeymapKey{1, 1, 0, OSM(MOD_LSFT), KC_LSFT}; + KeymapKey regular_key = KeymapKey{1, 1, 1, KC_A}; + KeymapKey blank_key = KeymapKey{1, 0, 0, KC_NO}; + + set_keymap({osl_key, osm_key, regular_key, blank_key}); + + // Press OSL key. + EXPECT_NO_REPORT(driver); + osl_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release OSL key. + EXPECT_NO_REPORT(driver); + osl_key.release(); + run_one_scan_loop(); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + // Press and release OSM. + EXPECT_NO_REPORT(driver); + tap_key(osm_key); + EXPECT_TRUE(layer_state_is(1)); + VERIFY_AND_CLEAR(driver); + + // Tap regular key. + EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)); + EXPECT_EMPTY_REPORT(driver); + tap_key(regular_key); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_tap_hold.cpp b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_tap_hold.cpp new file mode 100644 index 000000000000..19e73edb0274 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/permissive_hold/test_tap_hold.cpp @@ -0,0 +1,941 @@ +// Copyright 2024-2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class ChordalHoldPermissiveHold : public TestFixture {}; + +TEST_F(ChordalHoldPermissiveHold, chordal_hold_handedness) { + EXPECT_EQ(chordal_hold_handedness({.col = 0, .row = 0}), 'L'); + EXPECT_EQ(chordal_hold_handedness({.col = MATRIX_COLS - 1, .row = 0}), 'R'); + EXPECT_EQ(chordal_hold_handedness({.col = 0, .row = 2}), '*'); +} + +TEST_F(ChordalHoldPermissiveHold, get_chordal_hold_default) { + auto make_record = [](uint8_t row, uint8_t col, keyevent_type_t type = KEY_EVENT) { + return keyrecord_t{ + .event = + { + .key = {.col = col, .row = row}, + .type = type, + .pressed = true, + }, + }; + }; + // Create two records on the left hand. + keyrecord_t record_l0 = make_record(0, 0); + keyrecord_t record_l1 = make_record(1, 0); + // Create a record on the right hand. + keyrecord_t record_r = make_record(0, MATRIX_COLS - 1); + + // Function should return true when records are on opposite hands. + EXPECT_TRUE(get_chordal_hold_default(&record_l0, &record_r)); + EXPECT_TRUE(get_chordal_hold_default(&record_r, &record_l0)); + // ... and false when on the same hand. + EXPECT_FALSE(get_chordal_hold_default(&record_l0, &record_l1)); + EXPECT_FALSE(get_chordal_hold_default(&record_l1, &record_l0)); + // But (2, 0) has handedness '*', for which true is returned for chords + // with either hand. + keyrecord_t record_l2 = make_record(2, 0); + EXPECT_TRUE(get_chordal_hold_default(&record_l2, &record_l0)); + EXPECT_TRUE(get_chordal_hold_default(&record_l2, &record_r)); + + // Create a record resulting from a combo. + keyrecord_t record_combo = make_record(0, 0, COMBO_EVENT); + // Function returns true in all cases. + EXPECT_TRUE(get_chordal_hold_default(&record_l0, &record_combo)); + EXPECT_TRUE(get_chordal_hold_default(&record_r, &record_combo)); + EXPECT_TRUE(get_chordal_hold_default(&record_combo, &record_l0)); + EXPECT_TRUE(get_chordal_hold_default(&record_combo, &record_r)); +} + +TEST_F(ChordalHoldPermissiveHold, chord_nested_press_settled_as_hold) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Tap regular key. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_A)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + tap_key(regular_key); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, chord_rolled_press_settled_as_tap) { + TestDriver driver; + InSequence s; + // Mod-tap key on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + // Regular key on the right hand. + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap key and regular key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, non_chord_with_mod_tap_settled_as_tap) { + TestDriver driver; + InSequence s; + // Mod-tap key and regular key both on the left hand. + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_A); + + set_keymap({mod_tap_key, regular_key}); + + // Press mod-tap-hold key. + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_REPORT(driver, (KC_P)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap-hold key. + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, tap_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_key.press(); + idle_for(TAPPING_TERM - 1); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, hold_mod_tap_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key = KeymapKey(0, 1, 0, SFT_T(KC_P)); + + set_keymap({mod_tap_key}); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key.press(); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, two_mod_taps_same_hand_hold_til_timeout) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, MATRIX_COLS - 2, 0, RCTL_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Continue holding til the tapping term. + EXPECT_REPORT(driver, (KC_RIGHT_CTRL)); + EXPECT_REPORT(driver, (KC_RIGHT_CTRL, KC_RIGHT_SHIFT)); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap keys. + EXPECT_REPORT(driver, (KC_RIGHT_SHIFT)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, two_mod_taps_nested_press_opposite_hands) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap keys. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, two_mod_taps_nested_press_same_hand) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, RSFT_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release mod-tap keys. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key2.release(); + run_one_scan_loop(); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, three_mod_taps_same_hand_streak_roll) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, 3, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 1, 2, 3. + // + // NOTE: The correct order of events should be + // EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_C)); + // EXPECT_EMPTY_REPORT(driver); + // + // However, due to a workaround for https://github.com/tmk/tmk_keyboard/issues/60, + // the events are processed out of order, with the first two keys released + // before pressing KC_C. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_C)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, three_mod_taps_same_hand_streak_orders) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, 3, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 3, 2, 1. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 3, 1, 2. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_B)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 2, 3, 1. + // + // NOTE: The correct order of events should be + // EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_A, KC_C)); + // EXPECT_REPORT(driver, (KC_A)); + // EXPECT_EMPTY_REPORT(driver); + // + // However, due to a workaround for https://github.com/tmk/tmk_keyboard/issues/60, + // the events are processed out of order. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_C)); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, three_mod_taps_opposite_hands_roll) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 1, 2, 3. + // + // NOTE: The correct order of events should be + // EXPECT_REPORT(driver, (KC_A, KC_B)); + // EXPECT_REPORT(driver, (KC_A, KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_B, KC_C)); + // EXPECT_REPORT(driver, (KC_C)); + // EXPECT_EMPTY_REPORT(driver); + // + // However, due to a workaround for https://github.com/tmk/tmk_keyboard/issues/60, + // the events are processed out of order, with the first two keys released + // before pressing KC_C. + EXPECT_REPORT(driver, (KC_A)); + EXPECT_REPORT(driver, (KC_A, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_C)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + mod_tap_key2.release(); + run_one_scan_loop(); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, three_mod_taps_two_left_one_right) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 3. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 2, then key 1. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 3. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_CTRL)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release key 1, then key 2. + EXPECT_REPORT(driver, (KC_LEFT_CTRL)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, three_mod_taps_one_held_two_tapped) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 2, 0, CTL_T(KC_B)); + auto mod_tap_key3 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_C)); + + set_keymap({mod_tap_key1, mod_tap_key2, mod_tap_key3}); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 3, 2, 1. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key3.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys 3, 1, 2. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + mod_tap_key3.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_B)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, two_mod_taps_one_regular_key) { + TestDriver driver; + InSequence s; + auto mod_tap_key1 = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 2, 0, CTL_T(KC_B)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_C); + + set_keymap({mod_tap_key1, mod_tap_key2, regular_key}); + + // Press keys. + EXPECT_NO_REPORT(driver); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_C)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press mod-tap keys. + EXPECT_NO_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_key1.press(); + run_one_scan_loop(); + mod_tap_key2.press(); + run_one_scan_loop(); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release keys. + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B, KC_C)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_B)); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { + TestDriver driver; + InSequence s; + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + auto no_key = KeymapKey(1, 1, 0, XXXXXXX); + auto layer_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, no_key, layer_key}); + + // Press layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + // Press regular key. + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_REPORT(driver, (KC_B)); + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, nested_tap_of_layer_0_layer_tap_keys) { + TestDriver driver; + InSequence s; + // The keys are layer-taps on layer 2 but regular keys on layer 1. + auto first_layer_tap_key = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto second_layer_tap_key = KeymapKey(0, MATRIX_COLS - 1, 0, LT(1, KC_P)); + auto first_key_on_layer = KeymapKey(1, 1, 0, KC_B); + auto second_key_on_layer = KeymapKey(1, MATRIX_COLS - 1, 0, KC_Q); + + set_keymap({first_layer_tap_key, second_layer_tap_key, first_key_on_layer, second_key_on_layer}); + + // Press first layer-tap key. + EXPECT_NO_REPORT(driver); + first_layer_tap_key.press(); + run_one_scan_loop(); + // Press second layer-tap key. + second_layer_tap_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release second layer-tap key. + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + second_layer_tap_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release first layer-tap key. + EXPECT_NO_REPORT(driver); + first_layer_tap_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, lt_mt_one_regular_key) { + TestDriver driver; + InSequence s; + auto lt_key = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto mt_key0 = KeymapKey(0, 2, 0, SFT_T(KC_B)); + auto mt_key1 = KeymapKey(1, 2, 0, CTL_T(KC_C)); + auto regular_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_X); + auto no_key0 = KeymapKey(0, MATRIX_COLS - 1, 0, XXXXXXX); + auto no_key1 = KeymapKey(1, 1, 0, XXXXXXX); + + set_keymap({lt_key, mt_key0, mt_key1, regular_key, no_key0, no_key1}); + + // Press LT, MT, and regular key. + EXPECT_NO_REPORT(driver); + lt_key.press(); + run_one_scan_loop(); + mt_key1.press(); + run_one_scan_loop(); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release the regular key. + EXPECT_REPORT(driver, (KC_LCTL)); + EXPECT_REPORT(driver, (KC_LCTL, KC_X)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + EXPECT_EQ(get_mods(), MOD_BIT_LCTRL); + EXPECT_EQ(layer_state, 2); + VERIFY_AND_CLEAR(driver); + + // Release MT key. + EXPECT_EMPTY_REPORT(driver); + mt_key1.release(); + run_one_scan_loop(); + EXPECT_EQ(get_mods(), 0); + VERIFY_AND_CLEAR(driver); + + // Release LT key. + EXPECT_NO_REPORT(driver); + lt_key.release(); + run_one_scan_loop(); + EXPECT_EQ(layer_state, 0); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, nested_tap_of_layer_tap_keys) { + TestDriver driver; + InSequence s; + // The keys are layer-taps on all layers. + auto first_key_layer_0 = KeymapKey(0, 1, 0, LT(1, KC_A)); + auto second_key_layer_0 = KeymapKey(0, MATRIX_COLS - 1, 0, LT(1, KC_P)); + auto first_key_layer_1 = KeymapKey(1, 1, 0, LT(2, KC_B)); + auto second_key_layer_1 = KeymapKey(1, MATRIX_COLS - 1, 0, LT(2, KC_Q)); + auto first_key_layer_2 = KeymapKey(2, 1, 0, KC_TRNS); + auto second_key_layer_2 = KeymapKey(2, MATRIX_COLS - 1, 0, KC_TRNS); + + set_keymap({first_key_layer_0, second_key_layer_0, first_key_layer_1, second_key_layer_1, first_key_layer_2, second_key_layer_2}); + + // Press first layer-tap key. + EXPECT_NO_REPORT(driver); + first_key_layer_0.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press second layer-tap key. + EXPECT_NO_REPORT(driver); + second_key_layer_0.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release second layer-tap key. + EXPECT_REPORT(driver, (KC_Q)); + EXPECT_EMPTY_REPORT(driver); + second_key_layer_0.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release first layer-tap key. + EXPECT_NO_REPORT(driver); + first_key_layer_0.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, roll_layer_tap_key_with_regular_key) { + TestDriver driver; + InSequence s; + + auto layer_tap_hold_key = KeymapKey(0, 1, 0, LT(1, KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + auto layer_key = KeymapKey(1, MATRIX_COLS - 1, 0, KC_B); + + set_keymap({layer_tap_hold_key, regular_key, layer_key}); + + // Press layer-tap-hold key. + EXPECT_NO_REPORT(driver); + layer_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Press regular key. + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release layer-tap-hold key. + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_P, KC_A)); + EXPECT_REPORT(driver, (KC_A)); + layer_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + // Release regular key. + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(ChordalHoldPermissiveHold, two_mod_tap_keys_stuttered_press) { + TestDriver driver; + InSequence s; + + auto mod_tap_key1 = KeymapKey(0, 1, 0, LSFT_T(KC_A)); + auto mod_tap_key2 = KeymapKey(0, 2, 0, LCTL_T(KC_B)); + + set_keymap({mod_tap_key1, mod_tap_key2}); + + // Hold first mod-tap key until the tapping term. + EXPECT_REPORT(driver, (KC_LSFT)); + mod_tap_key1.press(); + idle_for(TAPPING_TERM + 1); + VERIFY_AND_CLEAR(driver); + + // Press the second mod-tap key, then quickly release and press the first. + EXPECT_NO_REPORT(driver); + mod_tap_key2.press(); + run_one_scan_loop(); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LSFT, KC_B)); + EXPECT_REPORT(driver, (KC_B)); + EXPECT_REPORT(driver, (KC_B, KC_A)); + mod_tap_key1.press(); + run_one_scan_loop(); + EXPECT_EQ(get_mods(), 0); // Verify that Shift was released. + VERIFY_AND_CLEAR(driver); + + // Release both keys. + EXPECT_REPORT(driver, (KC_A)); + mod_tap_key2.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + mod_tap_key1.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/config.h b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/config.h new file mode 100644 index 000000000000..4d704c597888 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/config.h @@ -0,0 +1,28 @@ +/* Copyright 2022 Isaac Elenbaas + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "test_common.h" + +#define CHORDAL_HOLD +#define PERMISSIVE_HOLD + +#define RETRO_SHIFT 2 * TAPPING_TERM +// releases between AUTO_SHIFT_TIMEOUT and TAPPING_TERM are not tested +#define AUTO_SHIFT_TIMEOUT TAPPING_TERM +#define AUTO_SHIFT_MODIFIERS diff --git a/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test.mk b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test.mk new file mode 100644 index 000000000000..c39dfa9cb17b --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test.mk @@ -0,0 +1,18 @@ +# Copyright 2022 Isaac Elenbaas +# Copyright 2024 Google LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AUTO_SHIFT_ENABLE = yes +INTROSPECTION_KEYMAP_C = test_keymap.c diff --git a/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test_keymap.c b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test_keymap.c new file mode 100644 index 000000000000..8a6a2c59b0ae --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test_keymap.c @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "quantum.h" + +const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'*', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, + {'L', 'L', 'L', 'L', 'L', 'R', 'R', 'R', 'R', 'R'}, +}; diff --git a/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test_retro_shift.cpp b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test_retro_shift.cpp new file mode 100644 index 000000000000..16fbabbd8ac9 --- /dev/null +++ b/tests/tap_hold_configurations/chordal_hold/retro_shift_permissive_hold/test_retro_shift.cpp @@ -0,0 +1,420 @@ +/* Copyright 2022 Isaac Elenbaas + * Copyright 2024 Google LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_fixture.hpp" +#include "test_keymap_key.hpp" + +bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return true; +} + +using testing::_; +using testing::AnyNumber; +using testing::AnyOf; +using testing::InSequence; + +class RetroShiftPermissiveHold : public TestFixture {}; + +TEST_F(RetroShiftPermissiveHold, tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, tap_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, tap_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LCTL))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LCTL, KC_A)); + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, hold_regular_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, hold_mod_tap_key_while_mod_tap_key_is_held_over_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT), + KeyboardReport(KC_LCTL)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL, KC_LSFT, KC_A)); + // clang-format off + EXPECT_CALL(driver, send_keyboard_mock(AnyOf( + KeyboardReport(KC_LCTL, KC_LSFT), + KeyboardReport(KC_LSFT)))) + .Times(AnyNumber()); + // clang-format on + EXPECT_REPORT(driver, (KC_LCTL)); + mod_tap_regular_key.release(); + run_one_scan_loop(); + idle_for(TAPPING_TERM); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_tap_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_tap_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_hold_regular_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, KC_A); + + set_keymap({mod_tap_hold_key, regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + idle_for(AUTO_SHIFT_TIMEOUT); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release regular key. */ + EXPECT_NO_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} + +TEST_F(RetroShiftPermissiveHold, roll_hold_mod_tap_key_while_mod_tap_key_is_held_under_tapping_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 0, 0, CTL_T(KC_P)); + auto mod_tap_regular_key = KeymapKey(0, MATRIX_COLS - 1, 0, ALT_T(KC_A)); + + set_keymap({mod_tap_hold_key, mod_tap_regular_key}); + + /* Press mod-tap-hold key. */ + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Press mod-tap-regular key. */ + EXPECT_NO_REPORT(driver); + mod_tap_regular_key.press(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-hold key. */ + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); + + /* Release mod-tap-regular key. */ + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))).Times(AnyNumber()); + EXPECT_EMPTY_REPORT(driver); + idle_for(AUTO_SHIFT_TIMEOUT); + mod_tap_regular_key.release(); + run_one_scan_loop(); + testing::Mock::VerifyAndClearExpectations(&driver); +} diff --git a/tests/tap_hold_configurations/retro_tapping/test_key_roll.cpp b/tests/tap_hold_configurations/retro_tapping/test_key_roll.cpp new file mode 100644 index 000000000000..afcbde993795 --- /dev/null +++ b/tests/tap_hold_configurations/retro_tapping/test_key_roll.cpp @@ -0,0 +1,408 @@ +/* Copyright 2024 John Rigoni + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "keyboard_report_util.hpp" +#include "keycode.h" +#include "keycodes.h" +#include "test_common.hpp" +#include "action_tapping.h" +#include "test_keymap_key.hpp" + +using testing::_; +using testing::InSequence; + +class RetroTapKeyRoll : public TestFixture {}; + +TEST_F(RetroTapKeyRoll, regular_to_left_gui_mod_over_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({mod_tap_hold_key, regular_key}); + + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_B, KC_LEFT_GUI)); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI, DUMMY_MOD_NEUTRALIZER_KEYCODE)); + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, regular_to_mod_over_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto regular_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({mod_tap_hold_key, regular_key}); + + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_B, KC_LEFT_SHIFT)); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, regular_to_mod_under_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto regular_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({mod_tap_hold_key, regular_key}); + + EXPECT_REPORT(driver, (KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_under_tap_term_to_regular) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto regular_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({mod_tap_hold_key, regular_key}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_P)); + EXPECT_REPORT(driver, (KC_B, KC_P)); + EXPECT_REPORT(driver, (KC_B)); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_over_tap_term_to_regular) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_A)); + auto regular_key = KeymapKey(0, 2, 0, KC_B); + + set_keymap({mod_tap_hold_key, regular_key}); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_hold_key.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_B)); + regular_key.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_B)); + mod_tap_hold_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + regular_key.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_under_tap_term_to_mod_under_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_gui = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto mod_tap_hold_lshft = KeymapKey(0, 2, 0, SFT_T(KC_A)); + + set_keymap({mod_tap_hold_gui, mod_tap_hold_lshft}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_lshft.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_gui.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_lshft.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_gui.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_over_tap_term_to_mod_under_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_gui = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto mod_tap_hold_lshft = KeymapKey(0, 2, 0, SFT_T(KC_A)); + + set_keymap({mod_tap_hold_gui, mod_tap_hold_lshft}); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_hold_lshft.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_gui.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_lshft.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_P)); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_gui.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_under_tap_term_to_mod_over_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_gui = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto mod_tap_hold_lshft = KeymapKey(0, 2, 0, SFT_T(KC_A)); + + set_keymap({mod_tap_hold_gui, mod_tap_hold_lshft}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_lshft.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_GUI)); + mod_tap_hold_gui.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + mod_tap_hold_lshft.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI, DUMMY_MOD_NEUTRALIZER_KEYCODE)); + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_P, KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_gui.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_under_tap_term_to_mod_over_tap_term_offset) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_gui = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto mod_tap_hold_lshft = KeymapKey(0, 2, 0, SFT_T(KC_A)); + + set_keymap({mod_tap_hold_gui, mod_tap_hold_lshft}); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_lshft.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_NO_REPORT(driver); + mod_tap_hold_gui.press(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_A)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_lshft.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + EXPECT_REPORT(driver, (KC_LEFT_GUI, DUMMY_MOD_NEUTRALIZER_KEYCODE)); + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_P)); + EXPECT_EMPTY_REPORT(driver); + idle_for(TAPPING_TERM); + mod_tap_hold_gui.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_over_tap_term_to_mod_over_tap_term) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_gui = KeymapKey(0, 1, 0, LGUI_T(KC_P)); + auto mod_tap_hold_lshft = KeymapKey(0, 2, 0, SFT_T(KC_A)); + + set_keymap({mod_tap_hold_gui, mod_tap_hold_lshft}); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_hold_lshft.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_GUI)); + mod_tap_hold_gui.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + mod_tap_hold_lshft.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_GUI, DUMMY_MOD_NEUTRALIZER_KEYCODE)); + EXPECT_REPORT(driver, (KC_LEFT_GUI)); + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_P, KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_gui.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} + +TEST_F(RetroTapKeyRoll, mod_to_mod_to_mod) { + TestDriver driver; + InSequence s; + auto mod_tap_hold_lalt = KeymapKey(0, 1, 0, LALT_T(KC_R)); + auto mod_tap_hold_lshft = KeymapKey(0, 2, 0, SFT_T(KC_A)); + auto mod_tap_hold_lctrl = KeymapKey(0, 3, 0, LCTL_T(KC_C)); + + set_keymap({mod_tap_hold_lalt, mod_tap_hold_lshft, mod_tap_hold_lctrl}); + + EXPECT_REPORT(driver, (KC_LEFT_ALT)); + mod_tap_hold_lalt.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_LEFT_ALT)); + mod_tap_hold_lshft.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + mod_tap_hold_lalt.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_CTRL, KC_LEFT_SHIFT)); + EXPECT_NO_REPORT(driver); + mod_tap_hold_lctrl.press(); + idle_for(TAPPING_TERM); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_REPORT(driver, (KC_LEFT_CTRL)); + mod_tap_hold_lshft.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); + + EXPECT_EMPTY_REPORT(driver); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_C, KC_LEFT_SHIFT)); + EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); + EXPECT_EMPTY_REPORT(driver); + mod_tap_hold_lctrl.release(); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 2a287e0d9890..5a5354416f48 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -325,18 +325,10 @@ static bool usb_requests_hook_cb(USBDriver *usbp) { return false; } -static __attribute__((unused)) void dummy_cb(USBDriver *usbp) { - (void)usbp; -} - static const USBConfig usbcfg = { usb_event_cb, /* USB events callback */ usb_get_descriptor_cb, /* Device GET_DESCRIPTOR request callback */ usb_requests_hook_cb, /* Requests hook callback */ -#if STM32_USB_USE_OTG1 == TRUE || STM32_USB_USE_OTG2 == TRUE - dummy_cb, /* Workaround for OTG Peripherals not servicing new interrupts - after resuming from suspend. */ -#endif }; void init_usb_driver(USBDriver *usbp) { diff --git a/util/install/macos.sh b/util/install/macos.sh index a1b79fe86839..4db2f9be6b4a 100755 --- a/util/install/macos.sh +++ b/util/install/macos.sh @@ -9,23 +9,24 @@ _qmk_install_prepare() { return 1 fi + # Conflicts with arm-none-eabi toolchain from osx-cross + brew uninstall --ignore-dependencies --cask gcc-arm-embedded >/dev/null 2>&1 + brew uninstall --ignore-dependencies homebrew/core/arm-none-eabi-gcc >/dev/null 2>&1 + brew uninstall --ignore-dependencies homebrew/core/arm-none-eabi-binutils >/dev/null 2>&1 + brew uninstall --ignore-dependencies osx-cross/arm/arm-gcc-bin@8 >/dev/null 2>&1 + brew update && brew upgrade --formulae } _qmk_install() { echo "Installing dependencies" - # All macOS dependencies are managed in the Homebrew package: - # https://github.com/qmk/homebrew-qmk + # All macOS & Python dependencies are managed in the Homebrew package: + # https://github.com/qmk/homebrew-qmk brew install qmk/qmk/qmk - # Conflicts with new toolchain formulae - brew uninstall --ignore-dependencies arm-gcc-bin@8 >/dev/null 2>&1 - # Keg-only, so need to be manually linked brew link --force avr-gcc@8 brew link --force arm-none-eabi-binutils brew link --force arm-none-eabi-gcc@8 - - python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt }