diff --git a/.clang-format b/.clang-format index b4f7967831ab..ce145e299c86 100644 --- a/.clang-format +++ b/.clang-format @@ -5,6 +5,9 @@ AlignConsecutiveAssignments: 'true' AlignConsecutiveDeclarations: 'true' AlignOperands: 'true' AllowAllParametersOfDeclarationOnNextLine: 'false' +AllowShortCaseLabelsOnASingleLine: 'false' +AllowShortFunctionsOnASingleLine: Empty +AllowShortLoopsOnASingleLine: 'false' AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: 'false' @@ -20,6 +23,7 @@ SortIncludes: 'false' SpaceBeforeAssignmentOperators: 'true' SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: 'false' +SpacesBeforeTrailingComments: 1 TabWidth: '4' UseTab: Never diff --git a/.gitignore b/.gitignore index 3cc40dc2ad52..3f646c6b010b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.swp *~ .DS_Store +._* # Build artifacts .clang_complete diff --git a/Makefile b/Makefile index 88f430619e39..4c2e6a04dc05 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,10 @@ endif # Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly override SILENT := false +ifdef SKIP_VERSION + SKIP_GIT := yes +endif + ifndef SUB_IS_SILENT ifndef SKIP_GIT QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null) @@ -50,47 +54,11 @@ ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE)) ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE)) ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE)) STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) -BUILD_DIR := $(ROOT_DIR)/.build -TEST_DIR := $(BUILD_DIR)/test -ERROR_FILE := $(BUILD_DIR)/error_occurred - -# Helper function to process the newt element of a space separated path -# It works a bit like the traditional functional head tail -# so the CURRENT_PATH_ELEMENT will become the new head -# and the PATH_ELEMENTS are the rest that are still unprocessed -define NEXT_PATH_ELEMENT - $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS))) - $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS))) -endef - -# We change the / to spaces so that we more easily can work with the elements -# separately -PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR)) -# Initialize the path elements list for further processing -$(eval $(call NEXT_PATH_ELEMENT)) - - -# Phony targets to enable a few simple make commands outside the main processing below. -.PHONY: list-keyboards -list-keyboards: - util/list_keyboards.sh | sort -u | tr '\n' ' ' - -.PHONY: generate-keyboards-file -generate-keyboards-file: - util/list_keyboards.sh | sort -u - -.PHONY: clean -clean: - echo -n 'Deleting .build/ ... ' - rm -rf $(BUILD_DIR) - echo 'done.' -.PHONY: distclean -distclean: clean - echo -n 'Deleting *.bin, *.hex, and *.uf2 ... ' - rm -f *.bin *.hex *.uf2 - echo 'done.' +include paths.mk +TEST_OUTPUT_DIR := $(BUILD_DIR)/test +ERROR_FILE := $(BUILD_DIR)/error_occurred .DEFAULT_GOAL := all:all @@ -119,53 +87,20 @@ endef # a function that returns the value COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND) - -# Recursively try to find a match for the start of the rule to be checked -# $1 The list to be checked -# If a match is found, then RULE_FOUND is set to true -# and MATCHED_ITEM to the item that was matched -define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3 - ifneq ($1,) - ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true) - MATCHED_ITEM := $$(firstword $1) - else - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1))) - endif - endif -endef - -# A recursive helper function for finding the longest match -# $1 The list to be checked -# It works by always removing the currently matched item from the list -define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2 - # Stop the recursion when the list is empty - ifneq ($1,) - RULE_BEFORE := $$(RULE) - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1)) - # If a match is found in the current list, otherwise just return what we had before - ifeq ($$(RULE_FOUND),true) - # Save the best match so far and call itself recursively - BEST_MATCH := $$(MATCHED_ITEM) - BEST_MATCH_RULE := $$(RULE) - RULE_FOUND := false - RULE := $$(RULE_BEFORE) - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$$(filter-out $$(MATCHED_ITEM),$1))) - endif - endif -endef - - -# Recursively try to find the longest match for the start of the rule to be checked +# Try to find a match for the start of the rule to be checked # $1 The list to be checked # If a match is found, then RULE_FOUND is set to true # and MATCHED_ITEM to the item that was matched define TRY_TO_MATCH_RULE_FROM_LIST_HELPER - BEST_MATCH := - $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$1)) - ifneq ($$(BEST_MATCH),) + # 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)) + + FOUNDx:=$$(shell echo $1 | tr " " "\n" | grep -Fx $$(TOKEN1)) + ifneq ($$(FOUNDx),) + RULE := $$(TOKENr) RULE_FOUND := true - RULE := $$(BEST_MATCH_RULE) - MATCHED_ITEM := $$(BEST_MATCH) + MATCHED_ITEM := $$(TOKEN1) else RULE_FOUND := false MATCHED_ITEM := @@ -340,7 +275,7 @@ define PARSE_KEYMAP # Specify the variables that we are passing forward to submake MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) QMK_BIN=$$(QMK_BIN) # And the first part of the make command - MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET) + MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_keyboard.mk $$(MAKE_TARGET) # The message to display MAKE_MSG := $$(MSG_MAKE_KB) # We run the command differently, depending on if we want more output or not @@ -382,12 +317,12 @@ define BUILD_TEST TEST_NAME := $$(notdir $$(TEST_PATH)) MAKE_TARGET := $2 COMMAND := $1 - MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET) + MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_test.mk $$(MAKE_TARGET) MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)" MAKE_MSG := $$(MSG_MAKE_TEST) $$(eval $$(call BUILD)) ifneq ($$(MAKE_TARGET),clean) - TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf + TEST_EXECUTABLE := $$(TEST_OUTPUT_DIR)/$$(TEST_NAME).elf TESTS += $$(TEST_NAME) TEST_MSG := $$(MSG_TEST) $$(TEST_NAME)_COMMAND := \ @@ -404,6 +339,7 @@ define PARSE_TEST TESTS := TEST_NAME := $$(firstword $$(subst :, ,$$(RULE))) TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME):,,$$(RULE))) + include $(BUILDDEFS_PATH)/testlist.mk ifeq ($$(TEST_NAME),all) MATCHED_TESTS := $$(TEST_LIST) else @@ -426,7 +362,6 @@ define SET_SILENT_MODE endif endef -include paths.mk include $(BUILDDEFS_PATH)/message.mk ifeq ($(strip $(BREAK_ON_ERRORS)), yes) @@ -496,14 +431,22 @@ git-submodule: git submodule sync --recursive git submodule update --init --recursive --progress -# Generate the version.h file -ifdef SKIP_GIT -VERSION_H_FLAGS := --skip-git -endif -ifdef SKIP_VERSION -VERSION_H_FLAGS := --skip-all -SKIP_GIT := yes -endif -$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o quantum/version.h) +.PHONY: list-keyboards +list-keyboards: + util/list_keyboards.sh | sort -u | tr '\n' ' ' + +.PHONY: generate-keyboards-file +generate-keyboards-file: + util/list_keyboards.sh | sort -u + +.PHONY: clean +clean: + echo -n 'Deleting .build/ ... ' + rm -rf $(BUILD_DIR) + echo 'done.' -include $(ROOT_DIR)/testlist.mk +.PHONY: distclean +distclean: clean + echo -n 'Deleting *.bin, *.hex, and *.uf2 ... ' + rm -f *.bin *.hex *.uf2 + echo 'done.' diff --git a/builddefs/bootloader.mk b/builddefs/bootloader.mk index ccb92392d903..226213297e7c 100644 --- a/builddefs/bootloader.mk +++ b/builddefs/bootloader.mk @@ -30,6 +30,7 @@ # bootloadhid HIDBootFlash compatible (ATmega32A) # usbasploader USBaspLoader (ATmega328P) # ARM: +# halfkay PJRC Teensy # kiibohd Input:Club Kiibohd bootloader (only used on their boards) # stm32duino STM32Duino (STM32F103x8) # stm32-dfu STM32 USB DFU in ROM @@ -37,12 +38,23 @@ # RISC-V: # gd32v-dfu GD32V USB DFU in ROM # +# If you need to provide your own implementation, you can set inside `rules.mk` +# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See +# the respective file under `platforms//bootloaders/custom.c` to see +# which functions may be overridden. +# # BOOTLOADER_SIZE can still be defined manually, but it's recommended # you add any possible configuration to this list +ifeq ($(strip $(BOOTLOADER)), custom) + OPT_DEFS += -DBOOTLOADER_CUSTOM + BOOTLOADER_TYPE = custom +endif ifeq ($(strip $(BOOTLOADER)), atmel-dfu) OPT_DEFS += -DBOOTLOADER_ATMEL_DFU OPT_DEFS += -DBOOTLOADER_DFU + BOOTLOADER_TYPE = dfu + ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) BOOTLOADER_SIZE = 4096 endif @@ -53,6 +65,8 @@ endif ifeq ($(strip $(BOOTLOADER)), lufa-dfu) OPT_DEFS += -DBOOTLOADER_LUFA_DFU OPT_DEFS += -DBOOTLOADER_DFU + BOOTLOADER_TYPE = dfu + ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) BOOTLOADER_SIZE ?= 4096 endif @@ -63,6 +77,8 @@ endif ifeq ($(strip $(BOOTLOADER)), qmk-dfu) OPT_DEFS += -DBOOTLOADER_QMK_DFU OPT_DEFS += -DBOOTLOADER_DFU + BOOTLOADER_TYPE = dfu + ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647)) BOOTLOADER_SIZE ?= 4096 endif @@ -73,10 +89,14 @@ endif ifeq ($(strip $(BOOTLOADER)), qmk-hid) OPT_DEFS += -DBOOTLOADER_QMK_HID OPT_DEFS += -DBOOTLOADER_HID + BOOTLOADER_TYPE = dfu + BOOTLOADER_SIZE ?= 4096 endif ifeq ($(strip $(BOOTLOADER)), halfkay) OPT_DEFS += -DBOOTLOADER_HALFKAY + BOOTLOADER_TYPE = halfkay + ifeq ($(strip $(MCU)), atmega32u4) BOOTLOADER_SIZE = 512 endif @@ -86,18 +106,26 @@ ifeq ($(strip $(BOOTLOADER)), halfkay) endif ifeq ($(strip $(BOOTLOADER)), caterina) OPT_DEFS += -DBOOTLOADER_CATERINA + BOOTLOADER_TYPE = caterina + BOOTLOADER_SIZE = 4096 endif ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID)) OPT_DEFS += -DBOOTLOADER_BOOTLOADHID + BOOTLOADER_TYPE = bootloadhid + BOOTLOADER_SIZE = 4096 endif ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp)) OPT_DEFS += -DBOOTLOADER_USBASP + BOOTLOADER_TYPE = usbasploader + BOOTLOADER_SIZE = 4096 endif ifeq ($(strip $(BOOTLOADER)), lufa-ms) OPT_DEFS += -DBOOTLOADER_MS + BOOTLOADER_TYPE = dfu + BOOTLOADER_SIZE ?= 8192 FIRMWARE_FORMAT = bin cpfirmware: lufa_warning @@ -115,6 +143,7 @@ endif ifeq ($(strip $(BOOTLOADER)), stm32-dfu) OPT_DEFS += -DBOOTLOADER_STM32_DFU + BOOTLOADER_TYPE = stm32_dfu # Options to pass to dfu-util when flashing DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave @@ -122,6 +151,7 @@ ifeq ($(strip $(BOOTLOADER)), stm32-dfu) endif ifeq ($(strip $(BOOTLOADER)), apm32-dfu) OPT_DEFS += -DBOOTLOADER_APM32_DFU + BOOTLOADER_TYPE = stm32_dfu # Options to pass to dfu-util when flashing DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave @@ -129,6 +159,7 @@ ifeq ($(strip $(BOOTLOADER)), apm32-dfu) endif ifeq ($(strip $(BOOTLOADER)), gd32v-dfu) OPT_DEFS += -DBOOTLOADER_GD32V_DFU + BOOTLOADER_TYPE = gd32v_dfu # Options to pass to dfu-util when flashing DFU_ARGS ?= -d 28E9:0189 -a 0 -s 0x08000000:leave @@ -136,6 +167,8 @@ ifeq ($(strip $(BOOTLOADER)), gd32v-dfu) endif ifeq ($(strip $(BOOTLOADER)), kiibohd) OPT_DEFS += -DBOOTLOADER_KIIBOHD + BOOTLOADER_TYPE = kiibohd + ifeq ($(strip $(MCU_ORIG)), MK20DX128) MCU_LDSCRIPT = MK20DX128BLDR4 endif @@ -151,8 +184,7 @@ ifeq ($(strip $(BOOTLOADER)), stm32duino) OPT_DEFS += -DBOOTLOADER_STM32DUINO MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader BOARD = STM32_F103_STM32DUINO - # STM32F103 does NOT have an USB bootloader in ROM (only serial), so setting anything here does not make much sense - STM32_BOOTLOADER_ADDRESS = 0x80000000 + BOOTLOADER_TYPE = stm32duino # Options to pass to dfu-util when flashing DFU_ARGS = -d 1EAF:0003 -a 2 -R @@ -160,4 +192,17 @@ ifeq ($(strip $(BOOTLOADER)), stm32duino) endif ifeq ($(strip $(BOOTLOADER)), tinyuf2) OPT_DEFS += -DBOOTLOADER_TINYUF2 + BOOTLOADER_TYPE = tinyuf2 +endif +ifeq ($(strip $(BOOTLOADER)), halfkay) + OPT_DEFS += -DBOOTLOADER_HALFKAY + BOOTLOADER_TYPE = halfkay +endif +ifeq ($(strip $(BOOTLOADER)), md-boot) + OPT_DEFS += -DBOOTLOADER_MD_BOOT + BOOTLOADER_TYPE = md_boot +endif + +ifeq ($(strip $(BOOTLOADER_TYPE)),) + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate 'BOOTLOADER' in your keyboard's 'rules.mk' file.) endif diff --git a/build_full_test.mk b/builddefs/build_full_test.mk similarity index 94% rename from build_full_test.mk rename to builddefs/build_full_test.mk index 4cd1ac61b53f..4e4b4e4bfd62 100644 --- a/build_full_test.mk +++ b/builddefs/build_full_test.mk @@ -14,7 +14,7 @@ # along with this program. If not, see . $(TEST)_INC := \ - tests\test_common\common_config.h + tests/test_common/common_config.h $(TEST)_SRC := \ $(TMK_COMMON_SRC) \ @@ -33,4 +33,4 @@ $(TEST)_DEFS := $(TMK_COMMON_DEFS) $(OPT_DEFS) $(TEST)_CONFIG := $(TEST_PATH)/config.h -VPATH += $(TOP_DIR)/tests/test_common \ No newline at end of file +VPATH += $(TOP_DIR)/tests/test_common diff --git a/build_json.mk b/builddefs/build_json.mk similarity index 100% rename from build_json.mk rename to builddefs/build_json.mk diff --git a/build_keyboard.mk b/builddefs/build_keyboard.mk similarity index 96% rename from build_keyboard.mk rename to builddefs/build_keyboard.mk index 6473e3e47322..d5efcb4193a1 100644 --- a/build_keyboard.mk +++ b/builddefs/build_keyboard.mk @@ -37,6 +37,17 @@ ifdef SKIP_VERSION OPT_DEFS += -DSKIP_VERSION endif +# Generate the version.h file +ifdef SKIP_VERSION +VERSION_H_FLAGS := --skip-all +endif +ifdef SKIP_GIT +VERSION_H_FLAGS := --skip-git +endif + +# Generate the board's version.h file. +$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(KEYMAP_OUTPUT)/src/version.h) + # Determine which subfolders exist. KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) @@ -100,7 +111,7 @@ INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard include $(INFO_RULES_MK) # Check for keymap.json first, so we can regenerate keymap.c -include build_json.mk +include $(BUILDDEFS_PATH)/build_json.mk # Pull in keymap level rules.mk ifeq ("$(wildcard $(KEYMAP_PATH))", "") @@ -127,9 +138,9 @@ ifeq ("$(wildcard $(KEYMAP_PATH))", "") KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1) else ifneq ($(LAYOUTS),) # If we haven't found a keymap yet fall back to community layouts - include build_layout.mk + include $(BUILDDEFS_PATH)/build_layout.mk else - $(error Could not find keymap) + $(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap) # this state should never be reached endif endif @@ -158,7 +169,7 @@ generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c endif ifeq ($(strip $(CTPC)), yes) - CONVERT_TO_PROTON_C=yes + CONVERT_TO_PROTON_C=yes endif ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes) @@ -384,8 +395,10 @@ VPATH += $(KEYMAP_PATH) VPATH += $(USER_PATH) VPATH += $(KEYBOARD_PATHS) VPATH += $(COMMON_VPATH) +VPATH += $(KEYBOARD_OUTPUT)/src +VPATH += $(KEYMAP_OUTPUT)/src -include common_features.mk +include $(BUILDDEFS_PATH)/common_features.mk include $(BUILDDEFS_PATH)/generic_features.mk include $(TMK_PATH)/protocol.mk include $(PLATFORM_PATH)/common.mk @@ -447,7 +460,7 @@ check-md5: build objs-size: build include $(BUILDDEFS_PATH)/show_options.mk -include $(TMK_PATH)/rules.mk +include $(BUILDDEFS_PATH)/common_rules.mk # Ensure we have generated files available for each of the objects define GEN_FILES diff --git a/build_layout.mk b/builddefs/build_layout.mk similarity index 93% rename from build_layout.mk rename to builddefs/build_layout.mk index b4b00793eadc..6166bd847c59 100644 --- a/build_layout.mk +++ b/builddefs/build_layout.mk @@ -25,7 +25,7 @@ ifneq ($(FORCE_LAYOUT),) $(info Forcing layout: $(FORCE_LAYOUT)) LAYOUTS := $(FORCE_LAYOUT) else - $(error Forced layout does not exist) + $(call CATASTROPHIC_ERROR,Invalid layout,Forced layout does not exist) endif endif diff --git a/build_test.mk b/builddefs/build_test.mk similarity index 92% rename from build_test.mk rename to builddefs/build_test.mk index 136a0455f01c..7226004aabc7 100644 --- a/build_test.mk +++ b/builddefs/build_test.mk @@ -43,6 +43,7 @@ all: elf VPATH += $(COMMON_VPATH) PLATFORM:=TEST PLATFORM_KEY:=test +BOOTLOADER_TYPE:=none ifeq ($(strip $(DEBUG)), 1) CONSOLE_ENABLE = yes @@ -53,7 +54,7 @@ include tests/test_common/build.mk include $(TEST_PATH)/test.mk endif -include common_features.mk +include $(BUILDDEFS_PATH)/common_features.mk include $(BUILDDEFS_PATH)/generic_features.mk include $(PLATFORM_PATH)/common.mk include $(TMK_PATH)/protocol.mk @@ -62,7 +63,7 @@ include $(QUANTUM_PATH)/encoder/tests/rules.mk include $(QUANTUM_PATH)/sequencer/tests/rules.mk include $(PLATFORM_PATH)/test/rules.mk ifneq ($(filter $(FULL_TESTS),$(TEST)),) -include build_full_test.mk +include $(BUILDDEFS_PATH)/build_full_test.mk endif $(TEST)_SRC += \ @@ -76,7 +77,7 @@ $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) $(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG) include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk -include $(TMK_PATH)/rules.mk +include $(BUILDDEFS_PATH)/common_rules.mk $(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null) diff --git a/common_features.mk b/builddefs/common_features.mk similarity index 78% rename from common_features.mk rename to builddefs/common_features.mk index 8c593024f0d1..08d186d656c7 100644 --- a/common_features.mk +++ b/builddefs/common_features.mk @@ -20,7 +20,6 @@ QUANTUM_SRC += \ $(QUANTUM_DIR)/led.c \ $(QUANTUM_DIR)/action.c \ $(QUANTUM_DIR)/action_layer.c \ - $(QUANTUM_DIR)/action_macro.c \ $(QUANTUM_DIR)/action_tapping.c \ $(QUANTUM_DIR)/action_util.c \ $(QUANTUM_DIR)/eeconfig.c \ @@ -109,11 +108,10 @@ ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) SRC += $(QUANTUM_DIR)/mousekey.c endif -VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick cirque_pinnacle_i2c cirque_pinnacle_spi pmw3360 pimoroni_trackball custom -POINTING_DEVICE_DRIVER ?= custom +VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick cirque_pinnacle_i2c cirque_pinnacle_spi pmw3360 pmw3389 pimoroni_trackball custom ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) ifeq ($(filter $(POINTING_DEVICE_DRIVER),$(VALID_POINTING_DEVICE_DRIVER_TYPES)),) - $(error POINTING_DEVICE_DRIVER="$(POINTING_DEVICE_DRIVER)" is not a valid pointing device type) + $(call CATASTROPHIC_ERROR,Invalid POINTING_DEVICE_DRIVER,POINTING_DEVICE_DRIVER="$(POINTING_DEVICE_DRIVER)" is not a valid pointing device type) else OPT_DEFS += -DPOINTING_DEVICE_ENABLE MOUSE_ENABLE := yes @@ -144,6 +142,9 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3360) OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE QUANTUM_LIB_SRC += spi_master.c + else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3389) + OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE + QUANTUM_LIB_SRC += spi_master.c endif endif endif @@ -151,56 +152,88 @@ endif VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi EEPROM_DRIVER ?= vendor ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),) - $(error EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver) + $(call CATASTROPHIC_ERROR,Invalid EEPROM_DRIVER,EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver) else OPT_DEFS += -DEEPROM_ENABLE ifeq ($(strip $(EEPROM_DRIVER)), custom) + # Custom EEPROM implementation -- only needs to implement init/erase/read_block/write_block OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_CUSTOM COMMON_VPATH += $(DRIVER_PATH)/eeprom SRC += eeprom_driver.c else ifeq ($(strip $(EEPROM_DRIVER)), i2c) + # External I2C EEPROM implementation OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_I2C COMMON_VPATH += $(DRIVER_PATH)/eeprom QUANTUM_LIB_SRC += i2c_master.c SRC += eeprom_driver.c eeprom_i2c.c else ifeq ($(strip $(EEPROM_DRIVER)), spi) + # External SPI EEPROM implementation OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI COMMON_VPATH += $(DRIVER_PATH)/eeprom QUANTUM_LIB_SRC += spi_master.c SRC += eeprom_driver.c eeprom_spi.c else ifeq ($(strip $(EEPROM_DRIVER)), transient) + # Transient EEPROM implementation -- no data storage but provides runtime area for it OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT COMMON_VPATH += $(DRIVER_PATH)/eeprom SRC += eeprom_driver.c eeprom_transient.c else ifeq ($(strip $(EEPROM_DRIVER)), vendor) + # Vendor-implemented EEPROM OPT_DEFS += -DEEPROM_VENDOR ifeq ($(PLATFORM),AVR) # Automatically provided by avr-libc, nothing required else ifeq ($(PLATFORM),CHIBIOS) ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6 %_GD32VF103xB %_GD32VF103x8, $(MCU_SERIES)_$(MCU_LDSCRIPT)),) - OPT_DEFS += -DEEPROM_DRIVER + # Emulated EEPROM + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_FLASH_EMULATED COMMON_VPATH += $(DRIVER_PATH)/eeprom SRC += eeprom_driver.c SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) - OPT_DEFS += -DEEPROM_DRIVER + # True EEPROM on STM32L0xx, L1xx + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_L0_L1 COMMON_VPATH += $(DRIVER_PATH)/eeprom COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom SRC += eeprom_driver.c SRC += eeprom_stm32_L0_L1.c + else ifneq ($(filter $(MCU_SERIES),KL2x K20x),) + # Teensy EEPROM implementations + OPT_DEFS += -DEEPROM_TEENSY + SRC += eeprom_teensy.c else - # This will effectively work the same as "transient" if not supported by the chip - SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c + # Fall back to transient, i.e. non-persistent + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c eeprom_transient.c endif else ifeq ($(PLATFORM),ARM_ATSAM) - SRC += $(PLATFORM_COMMON_DIR)/eeprom.c + # arm_atsam EEPROM + OPT_DEFS += -DEEPROM_SAMD + SRC += $(PLATFORM_COMMON_DIR)/eeprom_samd.c else ifeq ($(PLATFORM),TEST) + # Test harness "EEPROM" + OPT_DEFS += -DEEPROM_TEST_HARNESS SRC += $(PLATFORM_COMMON_DIR)/eeprom.c endif endif endif +VALID_FLASH_DRIVER_TYPES := spi +FLASH_DRIVER ?= no +ifneq ($(strip $(FLASH_DRIVER)), no) + ifeq ($(filter $(FLASH_DRIVER),$(VALID_FLASH_DRIVER_TYPES)),) + $(error FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid FLASH driver) + else + OPT_DEFS += -DFLASH_ENABLE + ifeq ($(strip $(FLASH_DRIVER)), spi) + OPT_DEFS += -DFLASH_DRIVER -DFLASH_SPI + COMMON_VPATH += $(DRIVER_PATH)/flash + SRC += flash_spi.c + endif + endif +endif + RGBLIGHT_ENABLE ?= no VALID_RGBLIGHT_TYPES := WS2812 APA102 custom @@ -212,7 +245,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) RGBLIGHT_DRIVER ?= WS2812 ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),) - $(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type) + $(call CATASTROPHIC_ERROR,Invalid RGBLIGHT_DRIVER,RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type) else COMMON_VPATH += $(QUANTUM_DIR)/rgblight POST_CONFIG_H += $(QUANTUM_DIR)/rgblight/rgblight_post_config.h @@ -237,12 +270,12 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif LED_MATRIX_ENABLE ?= no -VALID_LED_MATRIX_TYPES := IS31FL3731 custom +VALID_LED_MATRIX_TYPES := IS31FL3731 IS31FL3742A IS31FL3743A IS31FL3745 IS31FL3746A custom # TODO: IS31FL3733 IS31FL3737 IS31FL3741 ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),) - $(error "$(LED_MATRIX_DRIVER)" is not a valid matrix type) + $(call CATASTROPHIC_ERROR,Invalid LED_MATRIX_DRIVER,LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type) endif OPT_DEFS += -DLED_MATRIX_ENABLE ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) @@ -264,14 +297,43 @@ endif SRC += is31fl3731-simple.c QUANTUM_LIB_SRC += i2c_master.c endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3742A) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3742A -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3743A) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3743A -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3745) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3745 -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + + ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3746A) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3746A -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + endif RGB_MATRIX_ENABLE ?= no -VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 CKLED2001 WS2812 custom +VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 IS31FL3742A IS31FL3743A IS31FL3745 IS31FL3746A CKLED2001 WS2812 custom ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) - $(error "$(RGB_MATRIX_DRIVER)" is not a valid matrix type) + $(call CATASTROPHIC_ERROR,Invalid RGB_MATRIX_DRIVER,RGB_MATRIX_DRIVER="$(RGB_MATRIX_DRIVER)" is not a valid matrix type) endif OPT_DEFS += -DRGB_MATRIX_ENABLE ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) @@ -323,6 +385,34 @@ endif QUANTUM_LIB_SRC += i2c_master.c endif + ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3742A) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3742A -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + + ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3743A) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3743A -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + + ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3745) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3745 -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + + ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3746A) + OPT_DEFS += -DIS31FLCOMMON -DIS31FL3746A -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31flcommon.c + QUANTUM_LIB_SRC += i2c_master.c + endif + ifeq ($(strip $(RGB_MATRIX_DRIVER)), CKLED2001) OPT_DEFS += -DCKLED2001 -DSTM32_I2C -DHAL_USE_I2C=TRUE COMMON_VPATH += $(DRIVER_PATH)/led @@ -356,7 +446,7 @@ endif ifeq ($(strip $(PRINTING_ENABLE)), yes) OPT_DEFS += -DPRINTING_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c - SRC += $(TMK_DIR)/protocol/serial_uart.c + QUANTUM_LIB_SRC += uart.c endif VARIABLE_TRACE ?= no @@ -385,7 +475,7 @@ else endif ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) ifeq ($(filter $(BACKLIGHT_DRIVER),$(VALID_BACKLIGHT_TYPES)),) - $(error BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type) + $(call CATASTROPHIC_ERROR,Invalid BACKLIGHT_DRIVER,BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type) endif COMMON_VPATH += $(QUANTUM_DIR)/backlight @@ -410,7 +500,7 @@ VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c WS2812_DRIVER ?= bitbang ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) ifeq ($(filter $(WS2812_DRIVER),$(VALID_WS2812_DRIVER_TYPES)),) - $(error WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver) + $(call CATASTROPHIC_ERROR,Invalid WS2812_DRIVER,WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver) endif OPT_DEFS += -DWS2812_DRIVER_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]')) @@ -465,7 +555,7 @@ VALID_MAGIC_TYPES := yes BOOTMAGIC_ENABLE ?= no ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),) - $(error BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic) + $(call CATASTROPHIC_ERROR,Invalid BOOTMAGIC_ENABLE,BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic) endif ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) OPT_DEFS += -DBOOTMAGIC_LITE @@ -481,7 +571,7 @@ CUSTOM_MATRIX ?= no ifneq ($(strip $(CUSTOM_MATRIX)), yes) ifeq ($(filter $(CUSTOM_MATRIX),$(VALID_CUSTOM_MATRIX_TYPES)),) - $(error CUSTOM_MATRIX="$(CUSTOM_MATRIX)" is not a valid custom matrix type) + $(call CATASTROPHIC_ERROR,Invalid CUSTOM_MATRIX,CUSTOM_MATRIX="$(CUSTOM_MATRIX)" is not a valid custom matrix type) endif # Include common stuff for all non custom matrix users @@ -564,7 +654,7 @@ VALID_OLED_DRIVER_TYPES := SSD1306 custom OLED_DRIVER ?= SSD1306 ifeq ($(strip $(OLED_ENABLE)), yes) ifeq ($(filter $(OLED_DRIVER),$(VALID_OLED_DRIVER_TYPES)),) - $(error OLED_DRIVER="$(OLED_DRIVER)" is not a valid OLED driver) + $(call CATASTROPHIC_ERROR,Invalid OLED_DRIVER,OLED_DRIVER="$(OLED_DRIVER)" is not a valid OLED driver) else OPT_DEFS += -DOLED_ENABLE COMMON_VPATH += $(DRIVER_PATH)/oled @@ -604,6 +694,7 @@ ifeq ($(strip $(UNICODE_ENABLE)), yes) endif ifeq ($(strip $(UNICODE_COMMON)), yes) + OPT_DEFS += -DUNICODE_COMMON_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c endif @@ -631,7 +722,7 @@ endif ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes) PS2_ENABLE := yes SRC += ps2_busywait.c - SRC += ps2_io_avr.c + SRC += ps2_io.c OPT_DEFS += -DPS2_USE_BUSYWAIT endif @@ -660,7 +751,7 @@ VALID_JOYSTICK_TYPES := analog digital JOYSTICK_DRIVER ?= analog ifeq ($(strip $(JOYSTICK_ENABLE)), yes) ifeq ($(filter $(JOYSTICK_DRIVER),$(VALID_JOYSTICK_TYPES)),) - $(error "$(JOYSTICK_DRIVER)" is not a valid joystick driver) + $(call CATASTROPHIC_ERROR,Invalid JOYSTICK_DRIVER,JOYSTICK_DRIVER="$(JOYSTICK_DRIVER)" is not a valid joystick driver) endif OPT_DEFS += -DJOYSTICK_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_joystick.c @@ -680,7 +771,7 @@ VALID_USBPD_DRIVER_TYPES = custom vendor USBPD_DRIVER ?= vendor ifeq ($(strip $(USBPD_ENABLE)), yes) ifeq ($(filter $(strip $(USBPD_DRIVER)),$(VALID_USBPD_DRIVER_TYPES)),) - $(error USBPD_DRIVER="$(USBPD_DRIVER)" is not a valid USBPD driver) + $(call CATASTROPHIC_ERROR,Invalid USBPD_DRIVER,USBPD_DRIVER="$(USBPD_DRIVER)" is not a valid USBPD driver) else OPT_DEFS += -DUSBPD_ENABLE ifeq ($(strip $(USBPD_DRIVER)), vendor) @@ -690,7 +781,7 @@ ifeq ($(strip $(USBPD_ENABLE)), yes) OPT_DEFS += -DUSBPD_STM32G4 SRC += usbpd_stm32g4.c else - $(error There is no vendor-provided USBPD driver available) + $(call CATASTROPHIC_ERROR,Invalid USBPD_DRIVER,There is no vendor-provided USBPD driver available) endif else ifeq ($(strip $(USBPD_DRIVER)), custom) OPT_DEFS += -DUSBPD_CUSTOM @@ -700,25 +791,26 @@ ifeq ($(strip $(USBPD_ENABLE)), yes) endif BLUETOOTH_ENABLE ?= no -VALID_BLUETOOTH_DRIVER_TYPES := AdafruitBLE RN42 custom +VALID_BLUETOOTH_DRIVER_TYPES := BluefruitLE RN42 custom ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) ifeq ($(filter $(strip $(BLUETOOTH_DRIVER)),$(VALID_BLUETOOTH_DRIVER_TYPES)),) - $(error "$(BLUETOOTH_DRIVER)" is not a valid Bluetooth driver type) + $(call CATASTROPHIC_ERROR,Invalid BLUETOOTH_DRIVER,BLUETOOTH_DRIVER="$(BLUETOOTH_DRIVER)" is not a valid Bluetooth driver type) endif OPT_DEFS += -DBLUETOOTH_ENABLE NO_USB_STARTUP_CHECK := yes COMMON_VPATH += $(DRIVER_PATH)/bluetooth SRC += outputselect.c - ifeq ($(strip $(BLUETOOTH_DRIVER)), AdafruitBLE) - OPT_DEFS += -DMODULE_ADAFRUIT_BLE + ifeq ($(strip $(BLUETOOTH_DRIVER)), BluefruitLE) + OPT_DEFS += -DBLUETOOTH_BLUEFRUIT_LE SRC += analog.c - SRC += $(DRIVER_PATH)/bluetooth/adafruit_ble.cpp + SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp QUANTUM_LIB_SRC += spi_master.c endif ifeq ($(strip $(BLUETOOTH_DRIVER)), RN42) - OPT_DEFS += -DMODULE_RN42 - SRC += $(TMK_DIR)/protocol/serial_uart.c + OPT_DEFS += -DBLUETOOTH_RN42 + SRC += $(DRIVER_PATH)/bluetooth/rn42.c + QUANTUM_LIB_SRC += uart.c endif endif diff --git a/tmk_core/rules.mk b/builddefs/common_rules.mk similarity index 97% rename from tmk_core/rules.mk rename to builddefs/common_rules.mk index 6767a8e4af87..b303a87919b5 100644 --- a/tmk_core/rules.mk +++ b/builddefs/common_rules.mk @@ -234,6 +234,7 @@ endif # Define programs and commands. SHELL = sh +SED = sed REMOVE = rm -f REMOVEDIR = rmdir COPY = cp @@ -292,17 +293,15 @@ sym: $(BUILD_DIR)/$(TARGET).sym LIBNAME=lib$(TARGET).a lib: $(LIBNAME) -# Display size of file. -HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex -#ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf -ELFSIZE = $(SIZE) $(BUILD_DIR)/$(TARGET).elf +# Display size of file, modifying the output so people don't mistakenly grab the hex output +BINARY_SIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(SED) -e 's/\.build\/.*$$/$(TARGET).$(FIRMWARE_FORMAT)/g' sizebefore: - @if test -f $(BUILD_DIR)/$(TARGET).hex; then $(SECHO) $(MSG_SIZE_BEFORE); $(SILENT) || $(HEXSIZE); \ + @if test -f $(BUILD_DIR)/$(TARGET).hex; then $(SECHO) $(MSG_SIZE_BEFORE); $(SILENT) || $(BINARY_SIZE); \ 2>/dev/null; $(SECHO); fi sizeafter: $(BUILD_DIR)/$(TARGET).hex - @if test -f $(BUILD_DIR)/$(TARGET).hex; then $(SECHO); $(SECHO) $(MSG_SIZE_AFTER); $(SILENT) || $(HEXSIZE); \ + @if test -f $(BUILD_DIR)/$(TARGET).hex; then $(SECHO); $(SECHO) $(MSG_SIZE_AFTER); $(SILENT) || $(BINARY_SIZE); \ 2>/dev/null; $(SECHO); fi # Display compiler version information. @@ -479,7 +478,7 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc) SIZE_MARGIN = 1024 check-size: - $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) + $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | $(SED) -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) diff --git a/builddefs/mcu_selection.mk b/builddefs/mcu_selection.mk index 46d34aabe421..9fdd22c3b664 100644 --- a/builddefs/mcu_selection.mk +++ b/builddefs/mcu_selection.mk @@ -143,6 +143,9 @@ ifneq ($(findstring STM32F042, $(MCU)),) # This ensures that the EEPROM page buffer fits into RAM USE_PROCESS_STACKSIZE = 0x600 USE_EXCEPTIONS_STACKSIZE = 0x300 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC400 endif ifneq ($(findstring STM32F072, $(MCU)),) @@ -175,6 +178,9 @@ ifneq ($(findstring STM32F072, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32F0 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC800 endif ifneq ($(findstring STM32F103, $(MCU)),) @@ -239,6 +245,9 @@ ifneq ($(findstring STM32F303, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32F3 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFD800 endif ifneq ($(findstring STM32F401, $(MCU)),) @@ -276,6 +285,9 @@ ifneq ($(findstring STM32F401, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring STM32F405, $(MCU)),) @@ -308,6 +320,9 @@ ifneq ($(findstring STM32F405, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring STM32F407, $(MCU)),) @@ -340,6 +355,9 @@ ifneq ($(findstring STM32F407, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring STM32F411, $(MCU)),) @@ -377,6 +395,9 @@ ifneq ($(findstring STM32F411, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32F4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring STM32F446, $(MCU)),) @@ -406,6 +427,9 @@ ifneq ($(findstring STM32F446, $(MCU)),) BOARD ?= GENERIC_STM32_F446XE USE_FPU ?= yes + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring STM32G431, $(MCU)),) @@ -438,6 +462,9 @@ ifneq ($(findstring STM32G431, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32G4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring STM32G474, $(MCU)),) @@ -470,6 +497,46 @@ ifneq ($(findstring STM32G474, $(MCU)),) # UF2 settings UF2_FAMILY ?= STM32G4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 +endif + +ifneq (,$(filter $(MCU),STM32L432 STM32L442)) + # Cortex version + MCU = cortex-m4 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 7 + + ## chip/board settings + # - the next two should match the directories in + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = STM32 + MCU_SERIES = STM32L4xx + + # Linker script to use + # - it should exist either in /os/common/startup/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT ?= STM32L432xC + + # Startup code to use + # - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP ?= stm32l4xx + + # Board: it should exist either in /os/hal/boards/, + # /boards/, or drivers/boards/ + BOARD ?= GENERIC_STM32_L432XC + + PLATFORM_NAME ?= platform_l432 + + USE_FPU ?= yes + + # UF2 settings + UF2_FAMILY ?= STM32L4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq (,$(filter $(MCU),STM32L433 STM32L443)) @@ -504,6 +571,9 @@ ifneq (,$(filter $(MCU),STM32L433 STM32L443)) # UF2 settings UF2_FAMILY ?= STM32L4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq (,$(filter $(MCU),STM32L412 STM32L422)) @@ -538,6 +608,9 @@ ifneq (,$(filter $(MCU),STM32L412 STM32L422)) # UF2 settings UF2_FAMILY ?= STM32L4 + + # Bootloader address for STM32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 endif ifneq ($(findstring WB32F3G71, $(MCU)),) @@ -567,6 +640,10 @@ ifneq ($(findstring WB32F3G71, $(MCU)),) BOARD ?= GENERIC_WB32_F3G71XX USE_FPU ?= no + + # Bootloader address for WB32 DFU + STM32_BOOTLOADER_ADDRESS ?= 0x1FFFE000 + WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000 endif ifneq ($(findstring GD32VF103, $(MCU)),) diff --git a/builddefs/message.mk b/builddefs/message.mk index cb4ef43719a3..d441f560be7b 100644 --- a/builddefs/message.mk +++ b/builddefs/message.mk @@ -87,6 +87,7 @@ define GENERATE_MSG_AVAILABLE_KEYMAPS endef MSG_AVAILABLE_KEYMAPS = $(eval $(call GENERATE_MSG_AVAILABLE_KEYMAPS))$(MSG_AVAILABLE_KEYMAPS_ACTUAL) +MSG_BOOTLOADER_NOT_FOUND_BASE = Bootloader not found. Make sure the board is in bootloader mode. See https://docs.qmk.fm/\#/newbs_flashing\n MSG_CHECK_FILESIZE = Checking file size of $(TARGET).$(FIRMWARE_FORMAT) MSG_CHECK_FILESIZE_SKIPPED = (Firmware size check does not yet support $(MCU_ORIG); skipping) MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n @@ -97,6 +98,11 @@ MSG_PYTHON_MISSING = $(ERROR_COLOR)ERROR:$(NO_COLOR) Cannot run \"qmk hello\"!\n Please run $(BOLD)qmk setup$(NO_COLOR) to install all the dependencies QMK requires.\n\n MSG_FLASH_BOOTLOADER = $(WARN_COLOR)WARNING:$(NO_COLOR) This board's bootloader is not specified or is not supported by the \":flash\" target at this time.\n\n MSG_FLASH_ARCH = $(WARN_COLOR)WARNING:$(NO_COLOR) This board's architecture is not supported by the \":flash\" target at this time.\n\n -MSG_BOOTLOADER_NOT_FOUND = $(ERROR_COLOR)ERROR:$(NO_COLOR) Bootloader not found. Trying again in 5s (Ctrl+C to cancel)\n +MSG_BOOTLOADER_NOT_FOUND = $(ERROR_COLOR)ERROR:$(NO_COLOR) $(MSG_BOOTLOADER_NOT_FOUND_BASE) Trying again in 5s (Ctrl+C to cancel)\n BOOTLOADER_RETRY_TIME ?= 0.5 -MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY = Bootloader not found. Trying again every $(BOOTLOADER_RETRY_TIME)s (Ctrl+C to cancel) +MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY = $(MSG_BOOTLOADER_NOT_FOUND_BASE) Trying again every $(BOOTLOADER_RETRY_TIME)s (Ctrl+C to cancel) + +define CATASTROPHIC_ERROR + $(shell printf "\n * %-99s $(ERROR_STRING)\n" "$2" >&2) + $(error $1) +endef \ No newline at end of file diff --git a/testlist.mk b/builddefs/testlist.mk similarity index 85% rename from testlist.mk rename to builddefs/testlist.mk index 904485c15ced..86da5668ac9a 100644 --- a/testlist.mk +++ b/builddefs/testlist.mk @@ -8,7 +8,7 @@ include $(PLATFORM_PATH)/test/testlist.mk define VALIDATE_TEST_LIST ifneq ($1,) ifeq ($$(findstring -,$1),-) - $$(error Test names can't contain '-', but '$1' does) + $$(call CATASTROPHIC_ERROR,Invalid test name,Test names can't contain '-', but '$1' does.) else $$(eval $$(call VALIDATE_TEST_LIST,$$(firstword $2),$$(wordlist 2,9999,$2))) endif diff --git a/data/mappings/info_config.json b/data/mappings/info_config.json index 3cb64dd3a2fb..cfe8807d4363 100644 --- a/data/mappings/info_config.json +++ b/data/mappings/info_config.json @@ -15,6 +15,8 @@ "COMBO_TERM": {"info_key": "combo.term", "value_type": "int"}, "DEBOUNCE": {"info_key": "debounce", "value_type": "int"}, "DEVICE_VER": {"info_key": "usb.device_ver", "value_type": "hex"}, + # TODO: Replace ^^^ with vvv + #"DEVICE_VER": {"info_key": "usb.device_version", "value_type": "bcd_version"}, "DESCRIPTION": {"info_key": "keyboard_folder", "to_json": false}, "DIODE_DIRECTION": {"info_key": "diode_direction"}, "FORCE_NKRO": {"info_key": "usb.force_nkro", "value_type": "bool"}, diff --git a/data/mappings/keyboard_aliases.json b/data/mappings/keyboard_aliases.json index c9467f7c84e2..343812718e61 100644 --- a/data/mappings/keyboard_aliases.json +++ b/data/mappings/keyboard_aliases.json @@ -41,8 +41,14 @@ 'atom47/rev3': { target: 'maartenwut/atom47/rev3' }, + bakeneko60: { + target: 'kkatano/bakeneko60' + }, bakeneko65: { - target: 'bakeneko65/rev2' + target: 'kkatano/bakeneko65/rev2' + }, + bakeneko80: { + target: 'kkatano/bakeneko80' }, bear_face: { target: 'bear_face/v1' @@ -215,6 +221,9 @@ LAYOUT: 'LAYOUT_all' } }, + idobo: { + target: 'idobao/id75' + }, 'jj40': { target: 'kprepublic/jj40' }, @@ -260,6 +269,9 @@ 'lfkeyboards/smk65': { target: 'lfkeyboards/smk65/revb' }, + m3v3van: { + target: 'matthewdias/m3n3van' + }, 'maartenwut/atom47/rev2': { target: 'evyd13/atom47/rev2' }, @@ -353,9 +365,15 @@ 'mechlovin/hannah65': { target: 'mechlovin/hannah65/rev1' }, + minim: { + target: 'matthewdias/minim' + }, model01: { target: 'keyboardio/model01' }, + model_v: { + target: 'matthewdias/model_v' + }, m0lly: { target: 'tkc/m0lly' }, @@ -498,6 +516,9 @@ 'tokyo60': { target: 'tokyokeyboard/tokyo60' }, + 'txuu': { + target: 'matthewdias/txuu' + }, underscore33: { target: 'underscore33/rev1' }, @@ -550,7 +571,7 @@ target: 'xelus/valor/rev1' }, yd60mq: { - target: 'yd60mq/12led' + target: 'ymdk/yd60mq/12led' }, ymd75: { target: 'ymd75/rev1' @@ -563,5 +584,615 @@ }, zeal65: { target: 'wilba_tech/zeal65' + }, + # Moved during 2022 Q1 cycle + 6ball: { + target: 'maple_computing/6ball' + }, + 7skb: { + target: 'salicylic_acid3/7skb' + }, + 7splus: { + target: 'salicylic_acid3/7splus' + }, + acr60: { + target: 'mechkeys/acr60' + }, + adalyn: { + target: 'tominabox1/adalyn' + }, + ajisai74: { + target: 'salicylic_acid3/ajisai74' + }, + aleth42: { + target: '25keys/aleth42' + }, + alicia_cook: { + target: 'ibnuda/alicia_cook' + }, + allison: { + target: 'prototypist/allison' + }, + allison_numpad: { + target: 'prototypist/allison_numpad' + }, + alu84: { + target: 'mechkeys/alu84' + }, + angel17: { + target: 'kakunpc/angel17' + }, + angel64/alpha: { + target: 'kakunpc/angel64/alpha' + }, + angel64/rev1: { + target: 'kakunpc/angel64/rev1' + }, + arch_36: { + target: 'obosob/arch_36' + }, + bakeneko60: { + target: 'kkatano/bakeneko60' + }, + bakeneko65/rev2: { + target: 'kkatano/bakeneko65/rev2' + }, + bakeneko65/rev3: { + target: 'kkatano/bakeneko65/rev3' + }, + bakeneko80: { + target: 'kkatano/bakeneko80' + }, + barleycorn: { + target: 'yiancardesigns/barleycorn' + }, + bat43/rev1: { + target: 'dailycraft/bat43/rev1' + }, + bat43/rev2: { + target: 'dailycraft/bat43/rev2' + }, + bigseries/1key: { + target: 'woodkeys/bigseries/1key' + }, + bigseries/2key: { + target: 'woodkeys/bigseries/2key' + }, + bigseries/3key: { + target: 'woodkeys/bigseries/3key' + }, + bigseries/4key: { + target: 'woodkeys/bigseries/4key' + }, + bkf: { + target: 'drhigsby/bkf' + }, + business_card/alpha: { + target: 'kakunpc/business_card/alpha' + }, + business_card/beta: { + target: 'kakunpc/business_card/beta' + }, + butterstick: { + target: 'gboards/butterstick' + }, + c39: { + target: 'maple_computing/c39' + }, + cassette42: { + target: '25keys/cassette42' + }, + chidori: { + target: 'kagizaraya/chidori' + }, + chili: { + target: 'ydkb/chili' + }, + chimera_ergo: { + target: 'glenpickle/chimera_ergo' + }, + chimera_ls: { + target: 'glenpickle/chimera_ls' + }, + chimera_ortho: { + target: 'glenpickle/chimera_ortho' + }, + chimera_ortho_plus: { + target: 'glenpickle/chimera_ortho_plus' + }, + choc_taro: { + target: 'kakunpc/choc_taro' + }, + choco60: { + target: 'recompile_keys/choco60' + }, + christmas_tree: { + target: 'maple_computing/christmas_tree' + }, + claw44/rev1: { + target: 'dailycraft/claw44/rev1' + }, + cocoa40: { + target: 'recompile_keys/cocoa40' + }, + comet46: { + target: 'satt/comet46' + }, + cu24: { + target: 'capsunlocked/cu24' + }, + cu75: { + target: 'capsunlocked/cu75' + }, + cu80: { + target: 'capsunlocked/cu80/v1' + }, + delilah: { + target: 'rainkeebs/delilah' + }, + diverge3: { + target: 'unikeyboard/diverge3' + }, + divergetm2: { + target: 'unikeyboard/divergetm2' + }, + dozen0: { + target: 'yynmt/dozen0' + }, + dubba175: { + target: 'drhigsby/dubba175' + }, + eggman: { + target: 'qpockets/eggman' + }, + ergo42: { + target: 'biacco42/ergo42' + }, + ergoarrows: { + target: 'salicylic_acid3/ergoarrows' + }, + ergodash/mini: { + target: 'omkbd/ergodash/mini' + }, + ergodash/rev1: { + target: 'omkbd/ergodash/rev1' + }, + ergodox_infinity: { + target: 'input_club/ergodox_infinity' + }, + ergotaco: { + target: 'gboards/ergotaco' + }, + espectro: { + target: 'mechkeys/espectro' + }, + felix: { + target: 'unikeyboard/felix' + }, + four_banger: { + target: 'bpiphany/four_banger' + }, + freyr: { + target: 'hnahkb/freyr' + }, + geminate60: { + target: 'weirdo/geminate60' + }, + georgi: { + target: 'gboards/georgi' + }, + gergo: { + target: 'gboards/gergo' + }, + getta25: { + target: 'salicylic_acid3/getta25' + }, + gingham: { + target: 'yiancardesigns/gingham' + }, + gurindam: { + target: 'ibnuda/gurindam' + }, + halberd: { + target: 'kagizaraya/halberd' + }, + hecomi/alpha: { + target: 'takashiski/hecomi/alpha' + }, + hid_liber: { + target: 'bpiphany/hid_liber' + }, + id67/default_rgb: { + target: 'idobao/id67/default_rgb' + }, + id67/rgb: { + target: 'idobao/id67/rgb' + }, + id80: { + target: 'idobao/id80/v1' + }, + id87: { + target: 'idobao/id87/v1' + }, + idobo: { + target: 'idobao/id75/v1' + }, + infinity60: { + target: 'input_club/infinity60' + }, + ivy/rev1: { + target: 'maple_computing/ivy/rev1' + }, + jisplit89: { + target: 'salicylic_acid3/jisplit89' + }, + jnao: { + target: 'maple_computing/jnao' + }, + just60: { + target: 'ydkb/just60' + }, + k_type: { + target: 'input_club/k_type' + }, + kagamidget: { + target: 'yynmt/kagamidget' + }, + kelowna/rgb64: { + target: 'weirdo/kelowna/rgb64' + }, + kprepublic/bm65hsrgb_iso: { + target: 'kprepublic/bm65hsrgb_iso/rev1' + }, + kprepublic/bm68hsrgb: { + target: 'kprepublic/bm68hsrgb/rev1' + }, + latin17rgb: { + target: 'latincompass/latin17rgb' + }, + latin47ble: { + target: 'latincompass/latin47ble' + }, + latin60rgb: { + target: 'latincompass/latin60rgb' + }, + latin64ble: { + target: 'latincompass/latin64ble' + }, + latin6rgb: { + target: 'latincompass/latin6rgb' + }, + latinpad: { + target: 'latincompass/latinpad' + }, + latinpadble: { + target: 'latincompass/latinpadble' + }, + launchpad/rev1: { + target: 'maple_computing/launchpad/rev1' + }, + lck75: { + target: 'lyso1/lck75' + }, + le_chiffre: { + target: 'tominabox1/le_chiffre' + }, + lefishe: { + target: 'lyso1/lefishe' + }, + lets_split_eh/eh: { + target: 'maple_computing/lets_split_eh/eh' + }, + ls_60: { + target: 'weirdo/ls_60' + }, + m3n3van: { + target: 'matthewdias/m3n3van' + }, + mechmini/v1: { + target: 'mechkeys/mechmini/v1' + }, + mechmini/v2: { + target: 'mechkeys/mechmini/v2' + }, + meira: { + target: 'woodkeys/meira' + }, + meishi: { + target: 'biacco42/meishi' + }, + meishi2: { + target: 'biacco42/meishi2' + }, + minidox/rev1: { + target: 'maple_computing/minidox/rev1' + }, + minim: { + target: 'matthewdias/minim' + }, + mio: { + target: 'recompile_keys/mio' + }, + model_v: { + target: 'matthewdias/model_v' + }, + montex: { + target: 'idobao/montex/v1' + }, + nafuda: { + target: 'salicylic_acid3/nafuda' + }, + naiping/np64: { + target: 'weirdo/naiping/np64' + }, + naiping/nphhkb: { + target: 'weirdo/naiping/nphhkb' + }, + naiping/npminila: { + target: 'weirdo/naiping/npminila' + }, + naked48: { + target: 'salicylic_acid3/naked48' + }, + naked60: { + target: 'salicylic_acid3/naked60' + }, + naked64: { + target: 'salicylic_acid3/naked64' + }, + namecard2x4: { + target: 'takashiski/namecard2x4' + }, + nebula12: { + target: 'spaceholdings/nebula12' + }, + nebula68: { + target: 'spaceholdings/nebula68' + }, + nebula68b: { + target: 'spaceholdings/nebula68b' + }, + niu_mini: { + target: 'kbdfans/niu_mini' + }, + nk1: { + target: 'novelkeys/nk1' + }, + nk65: { + target: 'novelkeys/nk65' + }, + nk87: { + target: 'novelkeys/nk87' + }, + nknl7en: { + target: 'salicylic_acid3/nknl7en' + }, + nknl7jp: { + target: 'salicylic_acid3/nknl7jp' + }, + nomu30: { + target: 'recompile_keys/nomu30' + }, + novelpad: { + target: 'novelkeys/novelpad' + }, + ogurec: { + target: 'drhigsby/ogurec' + }, + otaku_split/rev0: { + target: 'takashiski/otaku_split/rev0' + }, + otaku_split/rev1: { + target: 'takashiski/otaku_split/rev1' + }, + owl8: { + target: 'dailycraft/owl8' + }, + packrat: { + target: 'drhigsby/packrat' + }, + pistachio: { + target: 'rate/pistachio' + }, + pistachio_mp: { + target: 'rate/pistachio_mp' + }, + pistachio_pro: { + target: 'rate/pistachio_pro' + }, + plexus75: { + target: 'checkerboards/plexus75' + }, + pursuit40: { + target: 'checkerboards/pursuit40' + }, + qaz: { + target: 'tominabox1/qaz' + }, + quark: { + target: 'checkerboards/quark' + }, + rabbit_capture_plan: { + target: 'kakunpc/rabbit_capture_plan' + }, + rainkeeb: { + target: 'rainkeebs/rainkeeb' + }, + reviung33: { + target: 'reviung/reviung33' + }, + reviung34: { + target: 'reviung/reviung34' + }, + reviung39: { + target: 'reviung/reviung39' + }, + reviung41: { + target: 'reviung/reviung41' + }, + reviung5: { + target: 'reviung/reviung5' + }, + reviung53: { + target: 'reviung/reviung53' + }, + reviung61: { + target: 'reviung/reviung61' + }, + runner3680/3x6: { + target: 'omkbd/runner3680/3x6' + }, + runner3680/3x7: { + target: 'omkbd/runner3680/3x7' + }, + runner3680/3x8: { + target: 'omkbd/runner3680/3x8' + }, + runner3680/4x6: { + target: 'omkbd/runner3680/4x6' + }, + runner3680/4x7: { + target: 'omkbd/runner3680/4x7' + }, + runner3680/4x8: { + target: 'omkbd/runner3680/4x8' + }, + runner3680/5x6: { + target: 'omkbd/runner3680/5x6' + }, + runner3680/5x6_5x8: { + target: 'omkbd/runner3680/5x6_5x8' + }, + runner3680/5x7: { + target: 'omkbd/runner3680/5x7' + }, + runner3680/5x8: { + target: 'omkbd/runner3680/5x8' + }, + scarletbandana: { + target: 'woodkeys/scarletbandana' + }, + scythe: { + target: 'kagizaraya/scythe' + }, + seigaiha: { + target: 'yiancardesigns/seigaiha' + }, + setta21: { + target: 'salicylic_acid3/setta21' + }, + space_space/rev1: { + target: 'qpockets/space_space/rev1' + }, + space_space/rev2: { + target: 'qpockets/space_space/rev2' + }, + spiderisland/winry25tc: { + target: 'winry/winry25tc' + }, + splitreus62: { + target: 'nacly/splitreus62' + }, + squiggle/rev1: { + target: 'ibnuda/squiggle/rev1' + }, + standaside: { + target: 'edi/standaside' + }, + steal_this_keyboard: { + target: 'obosob/steal_this_keyboard' + }, + stella: { + target: 'hnahkb/stella' + }, + suihankey/alpha: { + target: 'kakunpc/suihankey/alpha' + }, + suihankey/rev1: { + target: 'kakunpc/suihankey/rev1' + }, + suihankey/split: { + target: 'kakunpc/suihankey/split' + }, + the_ruler: { + target: 'maple_computing/the_ruler' + }, + thedogkeyboard: { + target: 'kakunpc/thedogkeyboard' + }, + tiger910: { + target: 'weirdo/tiger910' + }, + treadstone32: { + target: 'marksard/treadstone32' + }, + treadstone48/rev1: { + target: 'marksard/treadstone48/rev1' + }, + treadstone48/rev2: { + target: 'marksard/treadstone48/rev2' + }, + txuu: { + target: 'matthewdias/txuu' + }, + ua62: { + target: 'nacly/ua62' + }, + underscore33/rev1: { + target: 'tominabox1/underscore33/rev1' + }, + underscore33/rev2: { + target: 'tominabox1/underscore33/rev2' + }, + vn66: { + target: 'hnahkb/vn66' + }, + wallaby: { + target: 'kkatano/wallaby' + }, + wanten: { + target: 'qpockets/wanten' + }, + whitefox: { + target: 'input_club/whitefox' + }, + wings42/rev1: { + target: 'dailycraft/wings42/rev1' + }, + wings42/rev1_extkeys: { + target: 'dailycraft/wings42/rev1_extkeys' + }, + wings42/rev2: { + target: 'dailycraft/wings42/rev2' + }, + yasui: { + target: 'rainkeebs/yasui' + }, + yd60mq: { + target: 'ymdk/yd60mq' + }, + yd68: { + target: 'ydkb/yd68' + }, + ymd75: { + target: 'ymdk/ymd75' + }, + ymd96: { + target: 'ymdk/ymd96' + }, + ymdk_np21: { + target: 'ymdk/np21' + }, + yurei: { + target: 'kkatano/yurei' + }, + zinc: { + target: '25keys/zinc' + }, + zinc/rev1: { + target: '25keys/zinc/rev1' + }, + zinc/reva: { + target: '25keys/zinc/reva' } } diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index 822f237073c3..9fd503a108b0 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema @@ -20,6 +20,10 @@ "type": "string", "pattern": "^0x[0-9A-F]{4}$" }, + "bcd_version": { + "type": "string", + "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" + }, "text_identifier": { "type": "string", "minLength": 1, @@ -47,6 +51,10 @@ }, "mcu_pin": { "oneOf": [ + { + "type": "string", + "enum": ["NO_PIN"] + }, { "type": "string", "pattern": "^[A-K]\\d{1,2}$" @@ -70,13 +78,13 @@ "signed_int": { "type": "number", "multipleOf": 1 - } + }, "signed_int_8": { "type": "number", "min": -127, "max": 127, "multipleOf": 1 - } + }, "string_array": { "type": "array", "items": { @@ -97,7 +105,7 @@ "type": "number", "min": 0, "multipleOf": 1 - } + }, "unsigned_int_8": { "type": "number", "min": 0, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 308f9b782bef..fc0844a08606 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -13,7 +13,7 @@ }, "processor": { "type": "string", - "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66FX1M0", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L433", "STM32L443", "GD32VF103", "WB32F3G71", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] + "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66FX1M0", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L432", "STM32L433", "STM32L442", "STM32L443", "GD32VF103", "WB32F3G71", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] }, "audio": { "type": "object", @@ -45,7 +45,7 @@ "properties": { "driver": { "type": "string", - "enum": ["AdafruitBLE", "RN42"] + "enum": ["BluefruitLE", "RN42"] }, "lto": {"type": "boolean"}, } @@ -57,7 +57,7 @@ }, "bootloader": { "type": "string", - "enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2"], + "enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "custom", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "md-boot", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2"], }, "bootloader_instructions": { "type": "string", @@ -69,7 +69,7 @@ "properties": { "debounce_type": { "type": "string", - "enum": ["custom", "eager_pk", "eager_pr", "sym_defer_pk", "sym_eager_pk"] + "enum": ["custom", "eager_pk", "eager_pr", "sym_defer_pk", "sym_defer_pr", "sym_eager_pk"] }, "firmware_format": { "type": "string", @@ -320,7 +320,8 @@ "type": "object", "additionalProperties": false, "properties": { - "device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, + "device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, # Deprecated + "device_version": {"$ref": "qmk.definitions.v1#/bcd_version"}, "force_nkro": {"type": "boolean"}, "pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, "vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, diff --git a/data/templates/avr/config.h b/data/templates/avr/config.h deleted file mode 100644 index 7c15e8e70464..000000000000 --- a/data/templates/avr/config.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER %(USER_NAME)s -#define PRODUCT %(KEYBOARD)s - -/* key matrix size */ -#define MATRIX_ROWS 2 -#define MATRIX_COLS 3 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * - */ -#define MATRIX_ROW_PINS { D0, D5 } -#define MATRIX_COL_PINS { F1, F0, B0 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* - * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. - */ -#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 - -//#define LED_NUM_LOCK_PIN B0 -//#define LED_CAPS_LOCK_PIN B1 -//#define LED_SCROLL_LOCK_PIN B2 -//#define LED_COMPOSE_PIN B3 -//#define LED_KANA_PIN B4 - -//#define BACKLIGHT_PIN B7 -//#define BACKLIGHT_LEVELS 3 -//#define BACKLIGHT_BREATHING - -//#define RGB_DI_PIN E2 -//#ifdef RGB_DI_PIN -//# define RGBLED_NUM 16 -//# define RGBLIGHT_HUE_STEP 8 -//# define RGBLIGHT_SAT_STEP 8 -//# define RGBLIGHT_VAL_STEP 8 -//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ -//# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ -/*== all animations enable ==*/ -//# define RGBLIGHT_ANIMATIONS -/*== or choose animations ==*/ -//# define RGBLIGHT_EFFECT_BREATHING -//# define RGBLIGHT_EFFECT_RAINBOW_MOOD -//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -//# define RGBLIGHT_EFFECT_SNAKE -//# define RGBLIGHT_EFFECT_KNIGHT -//# define RGBLIGHT_EFFECT_CHRISTMAS -//# define RGBLIGHT_EFFECT_STATIC_GRADIENT -//# define RGBLIGHT_EFFECT_RGB_TEST -//# define RGBLIGHT_EFFECT_ALTERNATING -/*== customize breathing effect ==*/ -/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -/*==== use exp() and sin() ====*/ -//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 -//#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is useful for the Windows task manager shortcut (ctrl+shift+esc). - */ -//#define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * 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 - -/* disable these deprecated features by default */ -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - -/* Bootmagic Lite key configuration */ -//#define BOOTMAGIC_LITE_ROW 0 -//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/data/templates/base/%(KEYBOARD)s.c b/data/templates/base/%(KEYBOARD)s.c deleted file mode 100644 index 0c509aff6589..000000000000 --- a/data/templates/base/%(KEYBOARD)s.c +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "%(KEYBOARD)s.h" diff --git a/data/templates/base/%(KEYBOARD)s.h b/data/templates/base/%(KEYBOARD)s.h deleted file mode 100644 index 3e8ca3912dc8..000000000000 --- a/data/templates/base/%(KEYBOARD)s.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "quantum.h" - -/* This is a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ - k00, k01, k02, \ - k10, k12 \ -) { \ - { k00, k01, k02 }, \ - { k10, KC_NO, k12 } \ -} diff --git a/data/templates/base/info.json b/data/templates/base/info.json deleted file mode 100644 index a50ccba7bf9b..000000000000 --- a/data/templates/base/info.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "keyboard_name": "%(KEYBOARD)s", - "url": "", - "maintainer": "%(USER_NAME)s", - "layouts": { - "LAYOUT": { - "layout": [ - {"label": "k00", "x": 0, "y": 0}, - {"label": "k01", "x": 1, "y": 0}, - {"label": "k02", "x": 2, "y": 0}, - - {"label": "k10", "x": 0, "y": 1, "w": 1.5}, - {"label": "k12", "x": 1.5, "y": 1, "w": 1.5} - ] - } - } -} diff --git a/data/templates/base/keymaps/default/keymap.c b/data/templates/base/keymaps/default/keymap.c deleted file mode 100644 index 3fec3d51203f..000000000000 --- a/data/templates/base/keymaps/default/keymap.c +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include QMK_KEYBOARD_H - -// Defines names for use in layer keycodes and the keymap -enum layer_names { - _BASE, - _FN -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base */ - [_BASE] = LAYOUT( - KC_A, KC_1, MO(_FN), - KC_TAB, KC_SPC - ), - [_FN] = LAYOUT( - _______, _______, _______, - RESET, XXXXXXX - ) -}; diff --git a/data/templates/base/keymaps/default/readme.md b/data/templates/base/keymaps/default/readme.md deleted file mode 100644 index 63a064327571..000000000000 --- a/data/templates/base/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for %(KEYBOARD)s diff --git a/data/templates/keyboard/config.h b/data/templates/keyboard/config.h new file mode 100644 index 000000000000..b15c8d31f143 --- /dev/null +++ b/data/templates/keyboard/config.h @@ -0,0 +1,20 @@ +// Copyright %YEAR% %REAL_NAME% (@%USER_NAME%) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* + * 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/data/templates/keyboard/info.json b/data/templates/keyboard/info.json new file mode 100644 index 000000000000..777ceb3bd891 --- /dev/null +++ b/data/templates/keyboard/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "%KEYBOARD%", + "maintainer": "%USER_NAME%", + "manufacturer": "%REAL_NAME%", + "processor": "%MCU%", + "bootloader": "%BOOTLOADER%", + "diode_direction": "COL2ROW", + "matrix_pins": { + "cols": ["C2"], + "rows": ["D1"] + }, + "usb": { + "vid": "0xFEED", + "pid": "0x0000", + "device_version": "1.0.0" + }, + "features": { + "bootmagic_lite": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true + } +} \ No newline at end of file diff --git a/data/templates/avr/readme.md b/data/templates/keyboard/readme.md similarity index 82% rename from data/templates/avr/readme.md rename to data/templates/keyboard/readme.md index 207850e06565..ca703c53f014 100644 --- a/data/templates/avr/readme.md +++ b/data/templates/keyboard/readme.md @@ -1,20 +1,20 @@ -# %(KEYBOARD)s +# %KEYBOARD% -![%(KEYBOARD)s](imgur.com image replace me!) +![%KEYBOARD%](imgur.com image replace me!) *A short description of the keyboard/project* -* Keyboard Maintainer: [%(YOUR_NAME)s](https://github.com/%(USER_NAME)s) +* Keyboard Maintainer: [%REAL_NAME%](https://github.com/%USER_NAME%) * 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): - make %(KEYBOARD)s:default + make %KEYBOARD%:default Flashing example for this keyboard: - make %(KEYBOARD)s:default:flash + make %KEYBOARD%: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/data/templates/keyboard/rules.mk b/data/templates/keyboard/rules.mk new file mode 100644 index 000000000000..6e7633bfe015 --- /dev/null +++ b/data/templates/keyboard/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/data/templates/ps2avrgb/config.h b/data/templates/ps2avrgb/config.h deleted file mode 100644 index 876a60252f02..000000000000 --- a/data/templates/ps2avrgb/config.h +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright %(YEAR)s %(YOUR_NAME)s (@%(USER_NAME)s) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER %(USER_NAME)s -#define PRODUCT %(KEYBOARD)s - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * - */ -#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -//#define LED_NUM_LOCK_PIN D0 -//#define LED_CAPS_LOCK_PIN D1 -//#define LED_SCROLL_LOCK_PIN D6 - -#define BACKLIGHT_PIN D4 -//#define BACKLIGHT_LEVELS 3 -//#define BACKLIGHT_BREATHING - -#define RGBLED_NUM 16 -//#define RGBLIGHT_HUE_STEP 8 -//#define RGBLIGHT_SAT_STEP 8 -//#define RGBLIGHT_VAL_STEP 8 -//#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ -//#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ -/*== all animations enable ==*/ -//#define RGBLIGHT_ANIMATIONS -/*== or choose animations ==*/ -//#define RGBLIGHT_EFFECT_BREATHING -//#define RGBLIGHT_EFFECT_RAINBOW_MOOD -//#define RGBLIGHT_EFFECT_RAINBOW_SWIRL -//#define RGBLIGHT_EFFECT_SNAKE -//#define RGBLIGHT_EFFECT_KNIGHT -//#define RGBLIGHT_EFFECT_CHRISTMAS -//#define RGBLIGHT_EFFECT_STATIC_GRADIENT -//#define RGBLIGHT_EFFECT_RGB_TEST -//#define RGBLIGHT_EFFECT_ALTERNATING -/*== customize breathing effect ==*/ -/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -//#define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -/*==== use exp() and sin() ====*/ -//#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -//#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is useful for the Windows task manager shortcut (ctrl+shift+esc). - */ -//#define GRAVE_ESC_CTRL_OVERRIDE - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * 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 - -/* disable these deprecated features by default */ -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - -/* Bootmagic Lite key configuration */ -//#define BOOTMAGIC_LITE_ROW 0 -//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/data/templates/ps2avrgb/readme.md b/data/templates/ps2avrgb/readme.md deleted file mode 100644 index a2ac4495b689..000000000000 --- a/data/templates/ps2avrgb/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# %(KEYBOARD)s - -![%(KEYBOARD)s](imgur.com image replace me!) - -*A short description of the keyboard/project* - -* Keyboard Maintainer: [%(YOUR_NAME)s](https://github.com/yourusername) -* 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): - - make %(KEYBOARD)s:default - -Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) - - make %(KEYBOARD)s: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 -* **BootloadHID reset**: Hold down the key connected to the `A0` and `B0` pins on the MCU if it is known (often top left or bottom left) and plug in the keyboard -* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead -* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/data/templates/ps2avrgb/rules.mk b/data/templates/ps2avrgb/rules.mk deleted file mode 100644 index 1bbfa8fa0ec2..000000000000 --- a/data/templates/ps2avrgb/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# MCU name -MCU = atmega32a - -# Bootloader selection -BOOTLOADER = bootloadhid - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -WS2812_DRIVER = i2c diff --git a/docs/ChangeLog/20220226.md b/docs/ChangeLog/20220226.md new file mode 100644 index 000000000000..a469612fe8b3 --- /dev/null +++ b/docs/ChangeLog/20220226.md @@ -0,0 +1,489 @@ +# QMK Breaking Changes - 2022 February 26 Changelog + +## Notable Features :id=notable-features + +### Default USB Polling rate now 1kHz ([#15352](https://github.com/qmk/qmk_firmware/pull/15352)) + +The default USB Polling rate has been aligned across supported platforms to now be 1ms/1kHz. + +Something something *Lets go gamers!* + +### Split support for pointing devices ([#15304](https://github.com/qmk/qmk_firmware/pull/15304)) + +Pointing devices can now be shared across a split keyboard with support for a single pointing device or a pointing device on each side. + +See the [Pointing Device](feature_pointing_device.md) documentation for further configuration options. + +## Changes Requiring User Action :id=changes-requiring-user-action + +### Legacy macro and action_function system removed ([#16025](https://github.com/qmk/qmk_firmware/pull/16025)) + +The long time deprecated `MACRO()` and `action_get_macro` methods have been removed. Where possible, existing usages have been migrated over to core [Macros](feature_macros.md). + +### Create a build error if no bootloader is specified ([#16181](https://github.com/qmk/qmk_firmware/pull/16181)) + +Bootloader configuration is no longer assumed. Keyboards must now set either: + +* `BOOTLOADER` within `rules.mk` +* `bootloader` within `info.json` + +### Rename `AdafruitBLE` to `BluefruitLE` ([#16127](https://github.com/qmk/qmk_firmware/pull/16127)) + +In preparation of future bluetooth work, the `AdafruitBLE` integration has been renamed to allow potential for any other Adafruit BLE products. + +### Updated Keyboard Codebases :id=updated-keyboard-codebases + +The following keyboards have had their source moved within QMK: + +| Old Keyboard Name | New Keyboard Name | +|----------------------------|------------------------------------| +| 6ball | maple_computing/6ball | +| 7skb | salicylic_acid3/7skb | +| 7splus | salicylic_acid3/7splus | +| acr60 | mechkeys/acr60 | +| adalyn | tominabox1/adalyn | +| ajisai74 | salicylic_acid3/ajisai74 | +| aleth42 | 25keys/aleth42 | +| alicia_cook | ibnuda/alicia_cook | +| allison_numpad | prototypist/allison_numpad | +| allison | prototypist/allison | +| alu84 | mechkeys/alu84 | +| angel17 | kakunpc/angel17 | +| angel64/alpha | kakunpc/angel64/alpha | +| angel64/rev1 | kakunpc/angel64/rev1 | +| arch_36 | obosob/arch_36 | +| bakeneko60 | kkatano/bakeneko60 | +| bakeneko65/rev2 | kkatano/bakeneko65/rev2 | +| bakeneko65/rev3 | kkatano/bakeneko65/rev3 | +| bakeneko80 | kkatano/bakeneko80 | +| barleycorn | yiancardesigns/barleycorn | +| bat43/rev1 | dailycraft/bat43/rev1 | +| bat43/rev2 | dailycraft/bat43/rev2 | +| bigseries/1key | woodkeys/bigseries/1key | +| bigseries/2key | woodkeys/bigseries/2key | +| bigseries/3key | woodkeys/bigseries/3key | +| bigseries/4key | woodkeys/bigseries/4key | +| bkf | drhigsby/bkf | +| business_card/alpha | kakunpc/business_card/alpha | +| business_card/beta | kakunpc/business_card/beta | +| butterstick | gboards/butterstick | +| c39 | maple_computing/c39 | +| cassette42 | 25keys/cassette42 | +| chidori | kagizaraya/chidori | +| chili | ydkb/chili | +| chimera_ergo | glenpickle/chimera_ergo | +| chimera_ls | glenpickle/chimera_ls | +| chimera_ortho | glenpickle/chimera_ortho | +| chimera_ortho_plus | glenpickle/chimera_ortho_plus | +| choco60 | recompile_keys/choco60 | +| choc_taro | kakunpc/choc_taro | +| christmas_tree | maple_computing/christmas_tree | +| claw44/rev1 | dailycraft/claw44/rev1 | +| cocoa40 | recompile_keys/cocoa40 | +| comet46 | satt/comet46 | +| cu24 | capsunlocked/cu24 | +| cu75 | capsunlocked/cu75 | +| cu80 | capsunlocked/cu80/v1 | +| delilah | rainkeebs/delilah | +| diverge3 | unikeyboard/diverge3 | +| divergetm2 | unikeyboard/divergetm2 | +| dozen0 | yynmt/dozen0 | +| dubba175 | drhigsby/dubba175 | +| eggman | qpockets/eggman | +| ergo42 | biacco42/ergo42 | +| ergoarrows | salicylic_acid3/ergoarrows | +| ergodash/mini | omkbd/ergodash/mini | +| ergodash/rev1 | omkbd/ergodash/rev1 | +| ergodox_infinity | input_club/ergodox_infinity | +| ergotaco | gboards/ergotaco | +| espectro | mechkeys/espectro | +| felix | unikeyboard/felix | +| four_banger | bpiphany/four_banger | +| freyr | hnahkb/freyr | +| geminate60 | weirdo/geminate60 | +| georgi | gboards/georgi | +| gergo | gboards/gergo | +| getta25 | salicylic_acid3/getta25 | +| gingham | yiancardesigns/gingham | +| gurindam | ibnuda/gurindam | +| halberd | kagizaraya/halberd | +| hecomi/alpha | takashiski/hecomi/alpha | +| hid_liber | bpiphany/hid_liber | +| id67/default_rgb | idobao/id67/default_rgb | +| id67/rgb | idobao/id67/rgb | +| id80 | idobao/id80/v1 | +| id87 | idobao/id87/v1 | +| idobo | idobao/id75/v1 | +| infinity60 | input_club/infinity60 | +| ivy/rev1 | maple_computing/ivy/rev1 | +| jisplit89 | salicylic_acid3/jisplit89 | +| jnao | maple_computing/jnao | +| just60 | ydkb/just60 | +| kagamidget | yynmt/kagamidget | +| kelowna/rgb64 | weirdo/kelowna/rgb64 | +| kprepublic/bm65hsrgb_iso | kprepublic/bm65hsrgb_iso/rev1 | +| kprepublic/bm68hsrgb | kprepublic/bm68hsrgb/rev1 | +| k_type | input_club/k_type | +| latin17rgb | latincompass/latin17rgb | +| latin47ble | latincompass/latin47ble | +| latin60rgb | latincompass/latin60rgb | +| latin64ble | latincompass/latin64ble | +| latin6rgb | latincompass/latin6rgb | +| latinpadble | latincompass/latinpadble | +| latinpad | latincompass/latinpad | +| launchpad/rev1 | maple_computing/launchpad/rev1 | +| lck75 | lyso1/lck75 | +| le_chiffre | tominabox1/le_chiffre | +| lefishe | lyso1/lefishe | +| lets_split_eh/eh | maple_computing/lets_split_eh/eh | +| ls_60 | weirdo/ls_60 | +| m3n3van | matthewdias/m3n3van | +| mechmini/v1 | mechkeys/mechmini/v1 | +| mechmini/v2 | mechkeys/mechmini/v2 | +| meira | woodkeys/meira | +| meishi2 | biacco42/meishi2 | +| meishi | biacco42/meishi | +| minidox/rev1 | maple_computing/minidox/rev1 | +| minim | matthewdias/minim | +| mio | recompile_keys/mio | +| model_v | matthewdias/model_v | +| montex | idobao/montex/v1 | +| nafuda | salicylic_acid3/nafuda | +| naiping/np64 | weirdo/naiping/np64 | +| naiping/nphhkb | weirdo/naiping/nphhkb | +| naiping/npminila | weirdo/naiping/npminila | +| naked48 | salicylic_acid3/naked48 | +| naked60 | salicylic_acid3/naked60 | +| naked64 | salicylic_acid3/naked64 | +| namecard2x4 | takashiski/namecard2x4 | +| nebula12 | spaceholdings/nebula12 | +| nebula68b | spaceholdings/nebula68b | +| nebula68 | spaceholdings/nebula68 | +| niu_mini | kbdfans/niu_mini | +| nk1 | novelkeys/nk1 | +| nk65 | novelkeys/nk65 | +| nk87 | novelkeys/nk87 | +| nknl7en | salicylic_acid3/nknl7en | +| nknl7jp | salicylic_acid3/nknl7jp | +| nomu30 | recompile_keys/nomu30 | +| novelpad | novelkeys/novelpad | +| ogurec | drhigsby/ogurec | +| otaku_split/rev0 | takashiski/otaku_split/rev0 | +| otaku_split/rev1 | takashiski/otaku_split/rev1 | +| owl8 | dailycraft/owl8 | +| packrat | drhigsby/packrat | +| pistachio_mp | rate/pistachio_mp | +| pistachio_pro | rate/pistachio_pro | +| pistachio | rate/pistachio | +| plexus75 | checkerboards/plexus75 | +| pursuit40 | checkerboards/pursuit40 | +| qaz | tominabox1/qaz | +| quark | checkerboards/quark | +| rabbit_capture_plan | kakunpc/rabbit_capture_plan | +| rainkeeb | rainkeebs/rainkeeb | +| reviung33 | reviung/reviung33 | +| reviung34 | reviung/reviung34 | +| reviung39 | reviung/reviung39 | +| reviung41 | reviung/reviung41 | +| reviung53 | reviung/reviung53 | +| reviung5 | reviung/reviung5 | +| reviung61 | reviung/reviung61 | +| runner3680/3x6 | omkbd/runner3680/3x6 | +| runner3680/3x7 | omkbd/runner3680/3x7 | +| runner3680/3x8 | omkbd/runner3680/3x8 | +| runner3680/4x6 | omkbd/runner3680/4x6 | +| runner3680/4x7 | omkbd/runner3680/4x7 | +| runner3680/4x8 | omkbd/runner3680/4x8 | +| runner3680/5x6_5x8 | omkbd/runner3680/5x6_5x8 | +| runner3680/5x6 | omkbd/runner3680/5x6 | +| runner3680/5x7 | omkbd/runner3680/5x7 | +| runner3680/5x8 | omkbd/runner3680/5x8 | +| scarletbandana | woodkeys/scarletbandana | +| scythe | kagizaraya/scythe | +| seigaiha | yiancardesigns/seigaiha | +| setta21 | salicylic_acid3/setta21 | +| space_space/rev1 | qpockets/space_space/rev1 | +| space_space/rev2 | qpockets/space_space/rev2 | +| spiderisland/winry25tc | winry/winry25tc | +| splitreus62 | nacly/splitreus62 | +| squiggle/rev1 | ibnuda/squiggle/rev1 | +| standaside | edi/standaside | +| steal_this_keyboard | obosob/steal_this_keyboard | +| stella | hnahkb/stella | +| suihankey/alpha | kakunpc/suihankey/alpha | +| suihankey/rev1 | kakunpc/suihankey/rev1 | +| suihankey/split | kakunpc/suihankey/split | +| thedogkeyboard | kakunpc/thedogkeyboard | +| the_ruler | maple_computing/the_ruler | +| tiger910 | weirdo/tiger910 | +| treadstone32 | marksard/treadstone32 | +| treadstone48/rev1 | marksard/treadstone48/rev1 | +| treadstone48/rev2 | marksard/treadstone48/rev2 | +| txuu | matthewdias/txuu | +| ua62 | nacly/ua62 | +| underscore33/rev1 | tominabox1/underscore33/rev1 | +| underscore33/rev2 | tominabox1/underscore33/rev2 | +| vn66 | hnahkb/vn66 | +| wallaby | kkatano/wallaby | +| wanten | qpockets/wanten | +| whitefox | input_club/whitefox | +| wings42/rev1 | dailycraft/wings42/rev1 | +| wings42/rev1_extkeys | dailycraft/wings42/rev1_extkeys | +| wings42/rev2 | dailycraft/wings42/rev2 | +| yasui | rainkeebs/yasui | +| yd60mq | ymdk/yd60mq | +| yd68 | ydkb/yd68 | +| ymd75 | ymdk/ymd75 | +| ymd96 | ymdk/ymd96 | +| ymdk_np21 | ymdk/np21 | +| yurei | kkatano/yurei | +| zinc | 25keys/zinc | +| zinc/rev1 | 25keys/zinc/rev1 | +| zinc/reva | 25keys/zinc/reva | + +## Notable core changes :id=notable-core + +### New MCU Support :id=new-mcu-support + +Building on previous cycles, QMK firmware picked up support for a couple extra MCU variants: + +* STM32L432 +* STM32L442 + +### New Drivers + +QMK now has core-supplied support for the following device peripherals: + +#### LED + +* IS31FL3742A +* IS31FL3743A +* IS31FL3745 +* IS31FL3746A + +#### GPIO + +* SN74x138 +* mcp23018 + +--- + +## Full changelist + +Core: +* Initial pass at data driven new-keyboard subcommand ([#12795](https://github.com/qmk/qmk_firmware/pull/12795)) +* Don't send keyboard reports that propagate no changes to the host ([#14065](https://github.com/qmk/qmk_firmware/pull/14065)) +* Custom matrix lite support for split keyboards ([#14674](https://github.com/qmk/qmk_firmware/pull/14674)) +* Add sym_defer_pr debouncer type ([#14948](https://github.com/qmk/qmk_firmware/pull/14948)) +* Add RGB matrix & LED Matrix support for IS31FL3742A, IS31FL3743A, IS31FL3745, IS31FL3746A ([#14989](https://github.com/qmk/qmk_firmware/pull/14989)) +* New combo configuration options ([#15083](https://github.com/qmk/qmk_firmware/pull/15083)) +* IS31FL3733 driver for LED Matrix ([#15088](https://github.com/qmk/qmk_firmware/pull/15088)) +* Add open-drain GPIO support. ([#15282](https://github.com/qmk/qmk_firmware/pull/15282)) +* Make (un)register code functions weak ([#15285](https://github.com/qmk/qmk_firmware/pull/15285)) +* Split support for pointing devices. ([#15304](https://github.com/qmk/qmk_firmware/pull/15304)) +* Added cancel_key_lock function ([#15321](https://github.com/qmk/qmk_firmware/pull/15321)) +* Remove matrix_is_modified() and debounce_is_active() ([#15349](https://github.com/qmk/qmk_firmware/pull/15349)) +* Change default USB Polling rate to 1kHz ([#15352](https://github.com/qmk/qmk_firmware/pull/15352)) +* Implement MAGIC_TOGGLE_CONTROL_CAPSLOCK ([#15368](https://github.com/qmk/qmk_firmware/pull/15368)) +* Tidy up existing i2c_master implementations ([#15376](https://github.com/qmk/qmk_firmware/pull/15376)) +* Generalize Unicode defines ([#15409](https://github.com/qmk/qmk_firmware/pull/15409)) +* Added external spi flash driver. ([#15419](https://github.com/qmk/qmk_firmware/pull/15419)) +* Remove Deprecated USB Polling comment from vusb.c ([#15420](https://github.com/qmk/qmk_firmware/pull/15420)) +* Expand rotational range for PMW3360 Optical Sensor ([#15431](https://github.com/qmk/qmk_firmware/pull/15431)) +* ChibiOS SVN mirror script update ([#15435](https://github.com/qmk/qmk_firmware/pull/15435)) +* Refactor `bootloader_jump()` implementations ([#15450](https://github.com/qmk/qmk_firmware/pull/15450)) +* added missing audio_off_user() callback ([#15457](https://github.com/qmk/qmk_firmware/pull/15457)) +* Migrate serial_uart usages to UART driver ([#15479](https://github.com/qmk/qmk_firmware/pull/15479)) +* Migrate RN42 to UART driver and refactor ([#15492](https://github.com/qmk/qmk_firmware/pull/15492)) +* pwm3360 driver cleanup and diff reduction to adns9800 ([#15559](https://github.com/qmk/qmk_firmware/pull/15559)) +* Advanced deferred_exec for core-side code. ([#15579](https://github.com/qmk/qmk_firmware/pull/15579)) +* Adjust tap_code16 to account for TAP_HOLD_CAPS_DELAY ([#15635](https://github.com/qmk/qmk_firmware/pull/15635)) +* Slight tidy up of keyboard task loop ([#15725](https://github.com/qmk/qmk_firmware/pull/15725)) +* Unify the key up/down behaviour of RGB keycodes ([#15730](https://github.com/qmk/qmk_firmware/pull/15730)) +* Add PMW3389 optical sensor Support (Updated) ([#15740](https://github.com/qmk/qmk_firmware/pull/15740)) +* ChibiOS: add support for HID Programmable Buttons ([#15787](https://github.com/qmk/qmk_firmware/pull/15787)) +* ChibiOS: shorten USB disconnect state on boot to 50ms ([#15805](https://github.com/qmk/qmk_firmware/pull/15805)) +* Add init function to clear previous matrix effect ([#15815](https://github.com/qmk/qmk_firmware/pull/15815)) +* Optimize initialization of PMW3360 Sensor ([#15821](https://github.com/qmk/qmk_firmware/pull/15821)) +* Add Pixel Flow RGB matrix effect ([#15829](https://github.com/qmk/qmk_firmware/pull/15829)) +* PMW3389 Revert Firmware load during Initilization ([#15859](https://github.com/qmk/qmk_firmware/pull/15859)) +* Combo `TAP_CODE_DELAY` and `clear_weak_mods` ([#15866](https://github.com/qmk/qmk_firmware/pull/15866)) +* Relocate matrix_scan_quantum tasks ([#15882](https://github.com/qmk/qmk_firmware/pull/15882)) +* Adjust mouse key defaults ([#15883](https://github.com/qmk/qmk_firmware/pull/15883)) +* RGB Matrix: Reload from EEPROM ([#15923](https://github.com/qmk/qmk_firmware/pull/15923)) +* Enable a default task throttle for split pointing. ([#15925](https://github.com/qmk/qmk_firmware/pull/15925)) +* Move mcp23018 driver to core ([#15944](https://github.com/qmk/qmk_firmware/pull/15944)) +* Relocate matrix_init_quantum content ([#15953](https://github.com/qmk/qmk_firmware/pull/15953)) +* Align location of some host led logic ([#15954](https://github.com/qmk/qmk_firmware/pull/15954)) +* Rename some Quantum keycodes ([#15968](https://github.com/qmk/qmk_firmware/pull/15968)) +* Migrate more makefile utilities to builddefs sub-directory ([#16002](https://github.com/qmk/qmk_firmware/pull/16002)) +* Various Makefile optimisations ([#16015](https://github.com/qmk/qmk_firmware/pull/16015)) +* Add support for STM32L432, STM32L442. ([#16016](https://github.com/qmk/qmk_firmware/pull/16016)) +* EEPROM refactor: remove `eeprom_teensy.c` by default, use transient instead ([#16020](https://github.com/qmk/qmk_firmware/pull/16020)) +* Deprecate Split Transaction status field ([#16023](https://github.com/qmk/qmk_firmware/pull/16023)) +* Rip out old macro and action_function system ([#16025](https://github.com/qmk/qmk_firmware/pull/16025)) +* Add a script that simplifies running commands under docker. ([#16028](https://github.com/qmk/qmk_firmware/pull/16028)) +* Add support for Q-series on the ckled2001 LED driver ([#16051](https://github.com/qmk/qmk_firmware/pull/16051)) +* Remove unused suspend_idle ([#16063](https://github.com/qmk/qmk_firmware/pull/16063)) +* Initial migration of suspend callbacks ([#16067](https://github.com/qmk/qmk_firmware/pull/16067)) +* Add layout change callbacks to VIA ([#16087](https://github.com/qmk/qmk_firmware/pull/16087)) +* Rename `AdafruitBLE` to `BluefruitLE` ([#16127](https://github.com/qmk/qmk_firmware/pull/16127)) +* Update outputselect to use platform connected state API ([#16185](https://github.com/qmk/qmk_firmware/pull/16185)) +* Remove default pointing device driver. ([#16190](https://github.com/qmk/qmk_firmware/pull/16190)) +* Add SN74x138 demultiplexer driver ([#16217](https://github.com/qmk/qmk_firmware/pull/16217)) +* Standardise error output. ([#16220](https://github.com/qmk/qmk_firmware/pull/16220)) +* Followup to #16220, more test error output. ([#16221](https://github.com/qmk/qmk_firmware/pull/16221)) +* Misc size regression script improvements. ([#16268](https://github.com/qmk/qmk_firmware/pull/16268)) +* Align existing pca9555 driver to better match mcp23018 API ([#16277](https://github.com/qmk/qmk_firmware/pull/16277)) +* Size checks print out target firmware file instead ([#16290](https://github.com/qmk/qmk_firmware/pull/16290)) + +CLI: +* `develop` changelog generator: use the PR title instead ([#15537](https://github.com/qmk/qmk_firmware/pull/15537)) +* `develop` changelog generator: skip code formatting in listing ([#16215](https://github.com/qmk/qmk_firmware/pull/16215)) + +Keyboards: +* Durgod: Increase scan rate by using wait_us timer ([#14091](https://github.com/qmk/qmk_firmware/pull/14091)) +* Add another GMMK Pro ANSI Keymap with custom RGB. ([#14243](https://github.com/qmk/qmk_firmware/pull/14243)) +* Parse USB device version BCD ([#14580](https://github.com/qmk/qmk_firmware/pull/14580)) +* Add vitoni keymap for GMMK Pro (ISO) ([#15006](https://github.com/qmk/qmk_firmware/pull/15006)) +* Move bm65hsrgb_iso and bm68hsrgb to rev1/ to prepare for updates to the boards ([#15132](https://github.com/qmk/qmk_firmware/pull/15132)) +* Convert ergoinu to SPLIT_KEYBOARD ([#15305](https://github.com/qmk/qmk_firmware/pull/15305)) +* Convert not_so_minidox to SPLIT_KEYBOARD ([#15306](https://github.com/qmk/qmk_firmware/pull/15306)) +* Added new handwired keyboard Wakizashi 40 ([#15336](https://github.com/qmk/qmk_firmware/pull/15336)) +* Convert ai03/orbit to SPLIT_KEYBOARD ([#15340](https://github.com/qmk/qmk_firmware/pull/15340)) +* Remove manual enable of LTO within user keymaps ([#15378](https://github.com/qmk/qmk_firmware/pull/15378)) +* Move to organization folder ([#15481](https://github.com/qmk/qmk_firmware/pull/15481)) +* Convert some more boards to Matrix Lite ([#15489](https://github.com/qmk/qmk_firmware/pull/15489)) +* Organize Reviung boards into a directory ([#15636](https://github.com/qmk/qmk_firmware/pull/15636)) +* move winry25tc to winry/ ([#15637](https://github.com/qmk/qmk_firmware/pull/15637)) +* Rename ymdk_np21 to np21 + move to ymdk vendor folder ([#15641](https://github.com/qmk/qmk_firmware/pull/15641)) +* move ymd96 to ymdk vendor folder ([#15643](https://github.com/qmk/qmk_firmware/pull/15643)) +* move ymd75 to ymdk vendor folder ([#15645](https://github.com/qmk/qmk_firmware/pull/15645)) +* move yd60mq to ymdk vendor folder ([#15647](https://github.com/qmk/qmk_firmware/pull/15647)) +* rename idobo to idobao/id75, move to vendor folder ([#15661](https://github.com/qmk/qmk_firmware/pull/15661)) +* move ID67 to IDOBAO vendor folder ([#15662](https://github.com/qmk/qmk_firmware/pull/15662)) +* move ID80 to IDOBAO vendor folder ([#15665](https://github.com/qmk/qmk_firmware/pull/15665)) +* move ID87 to IDOBAO vendor folder ([#15667](https://github.com/qmk/qmk_firmware/pull/15667)) +* move montex to IDOBAO vendor folder ([#15668](https://github.com/qmk/qmk_firmware/pull/15668)) +* move @yangdigi 's keyboards to a YDKB folder ([#15681](https://github.com/qmk/qmk_firmware/pull/15681)) +* move @kkatano 's keyboards to kkatano user folder ([#15684](https://github.com/qmk/qmk_firmware/pull/15684)) +* Sol 3 Keyboard from RGBKB ([#15687](https://github.com/qmk/qmk_firmware/pull/15687)) +* move cu24, cu75, cu80/v1 into capsunlocked folder ([#15758](https://github.com/qmk/qmk_firmware/pull/15758)) +* move mechkeys keyboards into the mechkeys/ vendor folder ([#15760](https://github.com/qmk/qmk_firmware/pull/15760)) +* move @lyso1 's boards into lyso1/ ([#15767](https://github.com/qmk/qmk_firmware/pull/15767)) +* move prototypist boards into vendor folder ([#15780](https://github.com/qmk/qmk_firmware/pull/15780)) +* move @yiancar 's boards into yiancardesigns/ ([#15781](https://github.com/qmk/qmk_firmware/pull/15781)) +* move novelkeys keyboards to vendor folder ([#15783](https://github.com/qmk/qmk_firmware/pull/15783)) +* move @weirdo-f 's keyboards into weirdo/ ([#15785](https://github.com/qmk/qmk_firmware/pull/15785)) +* move @marksard 's boards to marksard/ ([#15786](https://github.com/qmk/qmk_firmware/pull/15786)) +* move input club keyboards into vendor folder ([#15788](https://github.com/qmk/qmk_firmware/pull/15788)) +* move @monksoffunk 's boards into 25keys/ ([#15789](https://github.com/qmk/qmk_firmware/pull/15789)) +* move @Salicylic-acid3 's keyboards to salicylic-acid3/ ([#15791](https://github.com/qmk/qmk_firmware/pull/15791)) +* move @rainkeebs 's keyboards to rainkeebs/ ([#15797](https://github.com/qmk/qmk_firmware/pull/15797)) +* move standaside into edi/ ([#15798](https://github.com/qmk/qmk_firmware/pull/15798)) +* move @obosob 's boards into obosob/ ([#15799](https://github.com/qmk/qmk_firmware/pull/15799)) +* move @nacly 's boards to nacly/ ([#15801](https://github.com/qmk/qmk_firmware/pull/15801)) +* move @kakunpc 's keebs into kakunpc/ ([#15814](https://github.com/qmk/qmk_firmware/pull/15814)) +* move @qpocket 's keyboards to qpocket/ ([#15827](https://github.com/qmk/qmk_firmware/pull/15827)) +* BDN9 keymap ([#15924](https://github.com/qmk/qmk_firmware/pull/15924)) +* move @matthewdias 's keebs into matthewdias/ ([#15991](https://github.com/qmk/qmk_firmware/pull/15991)) +* move id80 and id75 to v1 to accommodate for id75 v2 and id80 v3 ([#15992](https://github.com/qmk/qmk_firmware/pull/15992)) +* Remove `action_function()` from LFKeyboards boards ([#15993](https://github.com/qmk/qmk_firmware/pull/15993)) +* move @latincompass (aka @18438880 , @haierwangwei2005)'s boards to /latincompass ([#16039](https://github.com/qmk/qmk_firmware/pull/16039)) +* move g heavy industry boards into /gboards ([#16040](https://github.com/qmk/qmk_firmware/pull/16040)) +* move @drhigsby 's boards into /drhigsby ([#16041](https://github.com/qmk/qmk_firmware/pull/16041)) +* More keyboard rules.mk cleanups ([#16044](https://github.com/qmk/qmk_firmware/pull/16044)) +* move @That-Canadian 's boards into /maple_computing ([#16050](https://github.com/qmk/qmk_firmware/pull/16050)) +* move @takai 's keyboards into /recompile_keys ([#16053](https://github.com/qmk/qmk_firmware/pull/16053)) +* move @satt99 's comet46 to satt/ ([#16059](https://github.com/qmk/qmk_firmware/pull/16059)) +* move @ka2hiro 's boards into /kagizaraya ([#16070](https://github.com/qmk/qmk_firmware/pull/16070)) +* move @GlenPickle 's chimera* boards into a folder ([#16072](https://github.com/qmk/qmk_firmware/pull/16072)) +* move @yynmt 's boards into /yynmt ([#16075](https://github.com/qmk/qmk_firmware/pull/16075)) +* move @Biacco42 's keebs into /biacco42 ([#16080](https://github.com/qmk/qmk_firmware/pull/16080)) +* move unikeyboard boards to /unikeyboard ([#16081](https://github.com/qmk/qmk_firmware/pull/16081)) +* move four_banger to bpiphany ([#16082](https://github.com/qmk/qmk_firmware/pull/16082)) +* move @takashiski 's keebs into /takashiski ([#16089](https://github.com/qmk/qmk_firmware/pull/16089)) +* move hid_liber to /bpiphany ([#16091](https://github.com/qmk/qmk_firmware/pull/16091)) +* move spaceholdings boards into /spaceholdings ([#16096](https://github.com/qmk/qmk_firmware/pull/16096)) +* move @7-rate 's keebs to /rate ([#16099](https://github.com/qmk/qmk_firmware/pull/16099)) +* move @npspears 's boards into /checkerboards ([#16100](https://github.com/qmk/qmk_firmware/pull/16100)) +* move @vuhopkep 's keebs into /hnahkb ([#16102](https://github.com/qmk/qmk_firmware/pull/16102)) +* move @ibnuda 's keebs into /ibnuda ([#16108](https://github.com/qmk/qmk_firmware/pull/16108)) +* move @tominabox1 's keebs into /tominabox1 ([#16109](https://github.com/qmk/qmk_firmware/pull/16109)) +* move niu_mini to /kbdfans ([#16112](https://github.com/qmk/qmk_firmware/pull/16112)) +* move woodkeys.click keyboards to /woodkeys ([#16113](https://github.com/qmk/qmk_firmware/pull/16113)) +* move @omkbd 's boards to /omkbd ([#16116](https://github.com/qmk/qmk_firmware/pull/16116)) +* Overhaul Tractyl Manuform ([#16134](https://github.com/qmk/qmk_firmware/pull/16134)) +* Reduce firmware size for dztech/dz60rgb_wkl/v2_1:via ([#16254](https://github.com/qmk/qmk_firmware/pull/16254)) + +Keyboard fixes: +* Fix build failure for UT47 ([#15483](https://github.com/qmk/qmk_firmware/pull/15483)) +* Update grs_70ec to use newer custom matrix ([#15609](https://github.com/qmk/qmk_firmware/pull/15609)) +* fix compiler issue with Tractyl Manuform 4x6 ([#15646](https://github.com/qmk/qmk_firmware/pull/15646)) +* Fix CI. ([#15828](https://github.com/qmk/qmk_firmware/pull/15828)) +* Yet another bad `DEFAULT_FOLDER` fix. ([#15904](https://github.com/qmk/qmk_firmware/pull/15904)) +* Fix build failures for `mschwingen/modelm` ([#15987](https://github.com/qmk/qmk_firmware/pull/15987)) +* `rocketboard_16`: Fix mismatched LUT sizes ([#15997](https://github.com/qmk/qmk_firmware/pull/15997)) +* Fix erroneous SRC for Clueboard 66 hotswap ([#16007](https://github.com/qmk/qmk_firmware/pull/16007)) +* Fix handwired/ms_sculpt_mobile default keymap ([#16032](https://github.com/qmk/qmk_firmware/pull/16032)) +* Re-org Hillside folders as new model prep. Fix default keymap. ([#16128](https://github.com/qmk/qmk_firmware/pull/16128)) +* Fix up default folder locations. Again. ([#16135](https://github.com/qmk/qmk_firmware/pull/16135)) +* Sol3 rgb fix ([#16157](https://github.com/qmk/qmk_firmware/pull/16157)) +* Add missing `BOOTLOADER` for a handful of boards ([#16225](https://github.com/qmk/qmk_firmware/pull/16225)) +* Remove half implemented micronucleus bootloader support ([#16252](https://github.com/qmk/qmk_firmware/pull/16252)) +* Fixup bootloaders. ([#16256](https://github.com/qmk/qmk_firmware/pull/16256)) +* Fix idobao/id80/v3 compilation errors ([#16280](https://github.com/qmk/qmk_firmware/pull/16280)) +* Remove parent-relative paths from keyboards. ([#16282](https://github.com/qmk/qmk_firmware/pull/16282)) +* Bodge for helix build failures ([#16376](https://github.com/qmk/qmk_firmware/pull/16376)) + +Others: +* Add a clarification to an error message ([#15207](https://github.com/qmk/qmk_firmware/pull/15207)) +* Clang-format tweaks ([#15906](https://github.com/qmk/qmk_firmware/pull/15906)) +* Add example implementations for compatible MCUs list ([#15935](https://github.com/qmk/qmk_firmware/pull/15935)) +* Add version.h to gitignore ([#16222](https://github.com/qmk/qmk_firmware/pull/16222)) +* Update keyboard mapping for all moved boards this cycle ([#16312](https://github.com/qmk/qmk_firmware/pull/16312)) +* Align docs to new-keyboard behaviour ([#16357](https://github.com/qmk/qmk_firmware/pull/16357)) +* Align new-keyboard with recent schema updates ([#16378](https://github.com/qmk/qmk_firmware/pull/16378)) + +Bugs: +* Fixes potential wpm sampling overflow, along with code comment fixes ([#15277](https://github.com/qmk/qmk_firmware/pull/15277)) +* Add missing define for unicode common ([#15416](https://github.com/qmk/qmk_firmware/pull/15416)) +* Fix for SPI write timing in PMW3360 driver ([#15519](https://github.com/qmk/qmk_firmware/pull/15519)) +* Documentation Typo fix ([#15538](https://github.com/qmk/qmk_firmware/pull/15538)) +* fix a typo ([#15557](https://github.com/qmk/qmk_firmware/pull/15557)) +* Fix avr serial compile ([#15589](https://github.com/qmk/qmk_firmware/pull/15589)) +* More AVR GPIO compilation fixes. ([#15592](https://github.com/qmk/qmk_firmware/pull/15592)) +* Fix bug and code regression for Split Common ([#15603](https://github.com/qmk/qmk_firmware/pull/15603)) +* Include missing string.h include in split ([#15606](https://github.com/qmk/qmk_firmware/pull/15606)) +* Fixes for bootloader refactor build failures ([#15638](https://github.com/qmk/qmk_firmware/pull/15638)) +* Update pmw3360 driver after reading the datasheet top to bottom. Fix some outdated refs. ([#15682](https://github.com/qmk/qmk_firmware/pull/15682)) +* Fix split pointing for analog joystick ([#15691](https://github.com/qmk/qmk_firmware/pull/15691)) +* Fix broken bootloader builds in develop. ([#15880](https://github.com/qmk/qmk_firmware/pull/15880)) +* Fix optical sensor firmware upload ([#15919](https://github.com/qmk/qmk_firmware/pull/15919)) +* Pass in the keyrecord_t of the dual-role/tapping key when calling per-key tap hold functions ([#15938](https://github.com/qmk/qmk_firmware/pull/15938)) +* fixed typo in orange HSV colors decalartion ([#15976](https://github.com/qmk/qmk_firmware/pull/15976)) +* Fix hack for chibiOS reset name ([#15984](https://github.com/qmk/qmk_firmware/pull/15984)) +* Fix right side ws2812 leds having two indices ([#15985](https://github.com/qmk/qmk_firmware/pull/15985)) +* Workaround in Makefile for recursive rule matching ([#15988](https://github.com/qmk/qmk_firmware/pull/15988)) +* Fix BACKLIGHT_CAPS_LOCK warning ([#15999](https://github.com/qmk/qmk_firmware/pull/15999)) +* Fix compilation issues for led indicators ([#16001](https://github.com/qmk/qmk_firmware/pull/16001)) +* ChibiOS timer fixes ([#16017](https://github.com/qmk/qmk_firmware/pull/16017)) +* Fix bootloader_jump for certain CTRL boards ([#16026](https://github.com/qmk/qmk_firmware/pull/16026)) +* Fix up issue with PROGMEM and hand_swap_config ([#16027](https://github.com/qmk/qmk_firmware/pull/16027)) +* Don't make EEPROM size assumptions with dynamic keymaps. ([#16054](https://github.com/qmk/qmk_firmware/pull/16054)) +* fix missed .noci in reviung move ([#16107](https://github.com/qmk/qmk_firmware/pull/16107)) +* Fix issues with Python Tests ([#16162](https://github.com/qmk/qmk_firmware/pull/16162)) +* Fixup multibuild filegen ([#16166](https://github.com/qmk/qmk_firmware/pull/16166)) +* Remove old .gitignore entry. Add more macOS junk exclusions. ([#16167](https://github.com/qmk/qmk_firmware/pull/16167)) +* Fixup builds so that teensy EEPROM knows which MCU it's targeting. ([#16168](https://github.com/qmk/qmk_firmware/pull/16168)) +* Create a build error if no bootloader is specified. ([#16181](https://github.com/qmk/qmk_firmware/pull/16181)) +* Ensure `version.h` is recreated each build. ([#16188](https://github.com/qmk/qmk_firmware/pull/16188)) +* Add `custom` to list of valid bootloader types in info.json ([#16228](https://github.com/qmk/qmk_firmware/pull/16228)) +* Fix `layer_state` restoration at end of dynamic macro feature #16208 ([#16230](https://github.com/qmk/qmk_firmware/pull/16230)) +* Minor additions #12795 ([#16276](https://github.com/qmk/qmk_firmware/pull/16276)) +* Various fixes for matrix _RIGHT handling ([#16292](https://github.com/qmk/qmk_firmware/pull/16292)) +* Fix slashes in build_full_test.mk ([#16300](https://github.com/qmk/qmk_firmware/pull/16300)) +* ps2/avr: use the correct file name ([#16316](https://github.com/qmk/qmk_firmware/pull/16316)) +* Fix compilation of ChibiOS UART driver ([#16348](https://github.com/qmk/qmk_firmware/pull/16348)) +* Various fixes for new-keyboard ([#16358](https://github.com/qmk/qmk_firmware/pull/16358)) +* Allow NO_PIN within data driven configuration ([#16359](https://github.com/qmk/qmk_firmware/pull/16359)) diff --git a/docs/_summary.md b/docs/_summary.md index e26d9ae21061..74203aa0f854 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -37,7 +37,6 @@ * Guides * [Customizing Functionality](custom_quantum_functions.md) * [Driver Installation with Zadig](driver_installation_zadig.md) - * [Easy Maker for One Offs](easy_maker.md) * [Keymap Overview](keymap.md) * Development Environments * [Docker Guide](getting_started_docker.md) @@ -53,9 +52,6 @@ * [Your Fork](newbs_git_using_your_master_branch.md) * [Merge Conflicts](newbs_git_resolving_merge_conflicts.md) * [Fixing Your Branch](newbs_git_resynchronize_a_branch.md) - * Keyboard Building - * [Hand Wiring Guide](hand_wire.md) - * [ISP Flashing Guide](isp_flashing_guide.md) * Simple Keycodes * [Full List](keycodes.md) @@ -124,17 +120,22 @@ * [Thermal Printer](feature_thermal_printer.md) * [Velocikey](feature_velocikey.md) + * Keyboard Building + * [Easy Maker for One Offs](easy_maker.md) + * [Porting Keyboards](porting_your_keyboard_to_qmk.md) + * [Hand Wiring Guide](hand_wire.md) + * [ISP Flashing Guide](isp_flashing_guide.md) + * Developing QMK * [PR Checklist](pr_checklist.md) * Breaking Changes * [Overview](breaking_changes.md) * [My Pull Request Was Flagged](breaking_changes_instructions.md) - * [Most Recent ChangeLog](ChangeLog/20211127.md "QMK v0.15.0 - 2021 Nov 27") + * [Most Recent ChangeLog](ChangeLog/20220226.md "QMK v0.16.0 - 2022 Feb 26") * [Past Breaking Changes](breaking_changes_history.md) * C Development * [ARM Debugging Guide](arm_debugging.md) - * [AVR Processors](hardware_avr.md) * [Coding Conventions](coding_conventions_c.md) * [Compatible Microcontrollers](compatible_microcontrollers.md) * [Drivers](hardware_drivers.md) diff --git a/docs/breaking_changes.md b/docs/breaking_changes.md index 8bde6c88f770..3fed268b9878 100644 --- a/docs/breaking_changes.md +++ b/docs/breaking_changes.md @@ -8,6 +8,7 @@ The breaking change period is when we will merge PR's that change QMK in dangero ## What has been included in past Breaking Changes? +* [2022 Feb 26](ChangeLog/20220226.md) * [2021 Nov 27](ChangeLog/20211127.md) * [2021 Aug 28](ChangeLog/20210828.md) * [2021 May 29](ChangeLog/20210529.md) @@ -20,17 +21,17 @@ The breaking change period is when we will merge PR's that change QMK in dangero ## When is the next Breaking Change? -The next Breaking Change is scheduled for February 26, 2022. +The next Breaking Change is scheduled for May 28, 2022. ### Important Dates -* [x] 2021 Nov 27 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions. -* [ ] 2022 Jan 31 - `develop` closed to new PR's. -* [ ] 2022 Jan 31 - Call for testers. -* [ ] 2022 Feb 12 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes -* [ ] 2022 Feb 24 - `master` is locked, no PR's merged. -* [ ] 2022 Feb 26 - Merge `develop` to `master`. -* [ ] 2022 Feb 26 - `master` is unlocked. PR's can be merged again. +* [x] 2022 Feb 26 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions. +* [ ] 2022 Apr 31 - `develop` closed to new PR's. +* [ ] 2022 Apr 31 - Call for testers. +* [ ] 2022 May 14 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes +* [ ] 2022 May 26 - `master` is locked, no PR's merged. +* [ ] 2022 May 28 - Merge `develop` to `master`. +* [ ] 2022 May 28 - `master` is unlocked. PR's can be merged again. ## What changes will be included? diff --git a/docs/breaking_changes_history.md b/docs/breaking_changes_history.md index 6b1b71b1fdf3..c40989fb5ee4 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. +* [2022 Feb 26](ChangeLog/20220226.md) - version 0.16.0 * [2021 Nov 27](ChangeLog/20211127.md) - version 0.15.0 * [2021 Aug 28](ChangeLog/20210828.md) - version 0.14.0 * [2021 May 29](ChangeLog/20210529.md) - version 0.13.0 diff --git a/docs/cli_commands.md b/docs/cli_commands.md index dfbd4c6a2849..93af906b8a3c 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -310,7 +310,7 @@ Any arguments that are not provided will prompt for input. If `-u` is not passed **Usage**: ``` -qmk new-keyboard [-kb KEYBOARD] [-t {avr,ps2avrgb}] -u USERNAME +qmk new-keyboard [-kb KEYBOARD] [-t {atmega32u4,STM32F303,etc}] [-l {60_ansi,75_iso,etc}] -u USERNAME ``` ## `qmk new-keymap` diff --git a/docs/compatible_microcontrollers.md b/docs/compatible_microcontrollers.md index 1f46a1c634fe..1c5e37f72408 100644 --- a/docs/compatible_microcontrollers.md +++ b/docs/compatible_microcontrollers.md @@ -1,6 +1,6 @@ # Compatible Microcontrollers -QMK runs on any USB-capable AVR or ARM microcontroller with enough flash space - generally 32kB or more, though it will *just* squeeze into 16kB with most features disabled. +QMK runs on any USB-capable AVR or ARM microcontroller with enough flash space - generally 32kB+ for AVR, and 64kB+ for ARM. With significant disabling of features, QMK may *just* squeeze into 16kB AVR MCUs. ## Atmel AVR @@ -8,7 +8,11 @@ The following use [LUFA](https://www.fourwalledcubicle.com/LUFA.php) as the USB * [ATmega16U2](https://www.microchip.com/wwwproducts/en/ATmega16U2) / [ATmega32U2](https://www.microchip.com/wwwproducts/en/ATmega32U2) * [ATmega16U4](https://www.microchip.com/wwwproducts/en/ATmega16U4) / [ATmega32U4](https://www.microchip.com/wwwproducts/en/ATmega32U4) + * SparkFun Pro Micro (and clones) + * PJRC Teensy 2.0 + * Adafruit Feather 32U4 * [AT90USB64](https://www.microchip.com/wwwproducts/en/AT90USB646) / [AT90USB128](https://www.microchip.com/wwwproducts/en/AT90USB1286) + * PJRC Teensy++ 2.0 * [AT90USB162](https://www.microchip.com/wwwproducts/en/AT90USB162) Certain MCUs which do not have native USB will use [V-USB](https://www.obdev.at/products/vusb/index.html) instead: @@ -25,17 +29,23 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s * [STM32F0x2](https://www.st.com/en/microcontrollers-microprocessors/stm32f0x2.html) * [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html) + * Bluepill (with STM32duino bootloader) * [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html) + * QMK Proton-C * [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html) + * WeAct Blackpill * [STM32F405](https://www.st.com/en/microcontrollers-microprocessors/stm32f405-415.html) * [STM32F407](https://www.st.com/en/microcontrollers-microprocessors/stm32f407-417.html) * [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html) + * WeAct Blackpill * [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html) * [STM32G431](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x1.html) * [STM32G474](https://www.st.com/en/microcontrollers-microprocessors/stm32g4x4.html) * [STM32L412](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) * [STM32L422](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) + * [STM32L432](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) * [STM32L433](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html) + * [STM32L442](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html) * [STM32L443](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html) ### WestBerryTech (WB32) @@ -45,13 +55,16 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s ### NXP (Kinetis) * [MKL26Z64](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/kl-series-cortex-m0-plus/kinetis-kl2x-72-96-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x) + * PJRC Teensy LC * [MK20DX128](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-50-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-based-on-arm-cortex-m4-core:K20_50) * [MK20DX256](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72) + * PJRC Teensy 3.2 * [MK66FX1M0](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k6x-ethernet/kinetis-k66-180-mhz-dual-high-speed-full-speed-usbs-2mb-flash-microcontrollers-mcus-based-on-arm-cortex-m4-core:K66_180) + * PJRC Teensy 3.6 ## Atmel ATSAM -There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop). +There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop). However, it is not recommended to design a board with this microcontroller as the support is quite specialized to Massdrop hardware. ## RISC-V diff --git a/docs/config_options.md b/docs/config_options.md index 15ad945b2275..838c4d86fdb0 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -126,10 +126,6 @@ If you define these options you will disable the associated feature, which can s * disable tap dance and other tapping features * `#define NO_ACTION_ONESHOT` * disable one-shot modifiers -* `#define NO_ACTION_MACRO` - * disable old-style macro handling using `MACRO()`, `action_get_macro()` _(deprecated)_ -* `#define NO_ACTION_FUNCTION` - * disable old-style function handling using `fn_actions`, `action_function()` _(deprecated)_ ## Features That Can Be Enabled @@ -385,7 +381,6 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i * A list of [layouts](feature_layouts.md) this keyboard supports. * `LTO_ENABLE` * Enables Link Time Optimization (LTO) when compiling the keyboard. This makes the process take longer, but it can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable). -However, this will automatically disable the legacy TMK Macros and Functions features, as these break when LTO is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`. (Note: This does not affect QMK [Macros](feature_macros.md) and [Layers](feature_layers.md).) ## AVR MCU Options * `MCU = atmega32u4` @@ -436,8 +431,8 @@ Use these to enable or disable building certain features. The more you have enab * MIDI controls * `UNICODE_ENABLE` * Unicode -* `BLUETOOTH` - * Current options are AdafruitBLE, RN42 +* `BLUETOOTH_ENABLE` + * Current options are BluefruitLE, RN42 * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common * `CUSTOM_MATRIX` diff --git a/docs/feature_bluetooth.md b/docs/feature_bluetooth.md index f6fb02d948bc..d4ed494053b1 100644 --- a/docs/feature_bluetooth.md +++ b/docs/feature_bluetooth.md @@ -7,7 +7,7 @@ Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1, QM |Board |Bluetooth Protocol |Connection Type|rules.mk |Bluetooth Chip| |----------------------------------------------------------------|--------------------|---------------|--------------------------------|--------------| |Roving Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic |UART |`BLUETOOTH_DRIVER = RN42` |RN-42 | -|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = AdafruitBLE`|nRF51822 | +|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = BluefruitLE`|nRF51822 | Not Supported Yet but possible: * [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514) @@ -17,9 +17,9 @@ Not Supported Yet but possible: ### Adafruit BLE SPI Friend Currently The only bluetooth chipset supported by QMK is the Adafruit Bluefruit SPI Friend. It's a Nordic nRF51822 based chip running Adafruit's custom firmware. Data is transmitted via Adafruit's SDEP over Hardware SPI. The [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) is supported as it's an AVR mcu connected via SPI to the Nordic BLE chip with Adafruit firmware. If Building a custom board with the SPI friend it would be easiest to just use the pin selection that the 32u4 feather uses but you can change the pins in the config.h options with the following defines: -* `#define ADAFRUIT_BLE_RST_PIN D4` -* `#define ADAFRUIT_BLE_CS_PIN B4` -* `#define ADAFRUIT_BLE_IRQ_PIN E6` +* `#define BLUEFRUIT_LE_RST_PIN D4` +* `#define BLUEFRUIT_LE_CS_PIN B4` +* `#define BLUEFRUIT_LE_IRQ_PIN E6` A Bluefruit UART friend can be converted to an SPI friend, however this [requires](https://github.com/qmk/qmk_firmware/issues/2274) some reflashing and soldering directly to the MDBT40 chip. @@ -32,7 +32,7 @@ Add the following to your `rules.mk`: ```make BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE # or RN42 +BLUETOOTH_DRIVER = BluefruitLE # or RN42 ``` ## Bluetooth Keycodes diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 47128c431bfb..c0e10f09d5ae 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -141,10 +141,13 @@ Processing combos has two buffers, one for the key presses, another for the comb ## Modifier Combos If a combo resolves to a Modifier, the window for processing the combo can be extended independently from normal combos. By default, this is disabled but can be enabled with `#define COMBO_MUST_HOLD_MODS`, and the time window can be configured with `#define COMBO_HOLD_TERM 150` (default: `TAPPING_TERM`). With `COMBO_MUST_HOLD_MODS`, you cannot tap the combo any more which makes the combo less prone to misfires. -## Per Combo Timing, Holding and Tapping -For each combo, it is possible to configure the time window it has to pressed in, if it needs to be held down, or if it needs to be tapped. +## Strict key press order +By defining `COMBO_MUST_PRESS_IN_ORDER` combos only activate when the keys are pressed in the same order as they are defined in the key array. -For example, tap-only combos are useful if any (or all) of the underlying keys is a Mod-Tap or a Layer-Tap key. When you tap the combo, you get the combo result. When you press the combo and hold it down, the combo doesn't actually activate. Instead the keys are processed separately as if the combo wasn't even there. +## Per Combo Timing, Holding, Tapping and Key Press Order +For each combo, it is possible to configure the time window it has to pressed in, if it needs to be held down, if it needs to be tapped, or if its keys need to be pressed in order. + +For example, tap-only combos are useful if any (or all) of the underlying keys are mod-tap or layer-tap keys. When you tap the combo, you get the combo result. When you press the combo and hold it down, the combo doesn't activate. Instead the keys are processed separately as if the combo wasn't even there. In order to use these features, the following configuration options and functions need to be defined. Coming up with useful timings and configuration is left as an exercise for the reader. @@ -153,6 +156,7 @@ In order to use these features, the following configuration options and function | `COMBO_TERM_PER_COMBO` | uint16_t get_combo_term(uint16_t index, combo_t \*combo) | Optional per-combo timeout window. (default: `COMBO_TERM`) | | `COMBO_MUST_HOLD_PER_COMBO` | bool get_combo_must_hold(uint16_t index, combo_t \*combo) | Controls if a given combo should fire immediately on tap or if it needs to be held. (default: `false`) | | `COMBO_MUST_TAP_PER_COMBO` | bool get_combo_must_tap(uint16_t index, combo_t \*combo) | Controls if a given combo should fire only if tapped within `COMBO_HOLD_TERM`. (default: `false`) | +| `COMBO_MUST_PRESS_IN_ORDER_PER_COMBO` | bool get_combo_must_press_in_order(uint16_t index, combo_t \*combo) | Controls if a given combo should fire only if its keys are pressed in order. (default: `true`) | Examples: ```c @@ -216,6 +220,38 @@ bool get_combo_must_tap(uint16_t index, combo_t *combo) { return false; } + +bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) { + switch (combo_index) { + /* List combos here that you want to only activate if their keys + * are pressed in the same order as they are defined in the combo's key + * array. */ + case COMBO_NAME_HERE: + return true; + default: + return false; + } +} +``` + +## Generic hook to (dis)allow a combo activation + +By defining `COMBO_SHOULD_TRIGGER` and its companying function `bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)` you can block or allow combos to activate on the conditions of your choice. +For example, you could disallow some combos on the base layer and allow them on another. Or disable combos on the home row when a timer is running. + +Examples: +```c +bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) { + /* Disable combo `SOME_COMBO` on layer `_LAYER_A` */ + switch (combo_index) { + case SOME_COMBO: + if (layer_state_is(_LAYER_A)) { + return false; + } + } + + return true; +} ``` ## Variable Length Combos diff --git a/docs/feature_debounce_type.md b/docs/feature_debounce_type.md index f37a785b1e78..9cd736a24aca 100644 --- a/docs/feature_debounce_type.md +++ b/docs/feature_debounce_type.md @@ -116,6 +116,7 @@ Where name of algorithm is one of: For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use. * ```sym_eager_pk``` - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key +* ```sym_defer_pr``` - debouncing per row. On any state change, a per-row timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that row, the entire row is pushed. Can improve responsiveness over `sym_defer_g` while being less susceptible than per-key debouncers to noise. * ```sym_defer_pk``` - debouncing per key. On any state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key status change is pushed. * ```asym_eager_defer_pk``` - debouncing per key. On a key-down state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key. On a key-up state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key-up status change is pushed. diff --git a/docs/feature_grave_esc.md b/docs/feature_grave_esc.md index f135b1dede5d..09d098ee4e93 100644 --- a/docs/feature_grave_esc.md +++ b/docs/feature_grave_esc.md @@ -4,17 +4,17 @@ If you're using a 60% keyboard, or any other layout with no F-row, you will have ## Usage -Replace the `KC_GRV` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. Most of the time this key will output `KC_ESC` when pressed. However, when Shift or GUI are held down it will output `KC_GRV` instead. +Replace the `KC_GRV` key in your keymap (usually to the left of the `1` key) with `QK_GESC`. Most of the time this key will output `KC_ESC` when pressed. However, when Shift or GUI are held down it will output `KC_GRV` instead. ## What Your OS Sees -If Mary presses GESC on her keyboard, the OS will see an KC_ESC character. Now if Mary holds Shift down and presses GESC it will output `~`, or a shifted backtick. Now if she holds GUI/CMD/WIN, it will output a simple ` character. +If Mary presses `QK_GESC` on her keyboard, the OS will see an KC_ESC character. Now if Mary holds Shift down and presses `QK_GESC` it will output `~`, or a shifted backtick. Now if she holds GUI/CMD/WIN, it will output a simple ` character. ## Keycodes -|Key |Aliases |Description | -|---------|-----------|------------------------------------------------------------------| -|`KC_GESC`|`GRAVE_ESC`|Escape when pressed, ` when Shift or GUI are held| +|Key |Aliases |Description | +|-----------------|---------|------------------------------------------------------------------| +|`QK_GRAVE_ESCAPE`|`QK_GESC`|Escape when pressed, ` when Shift or GUI are held| ### Caveats diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md index c8c74cb8f0ee..63ac4305ff20 100644 --- a/docs/feature_haptic_feedback.md +++ b/docs/feature_haptic_feedback.md @@ -167,7 +167,7 @@ List of waveform sequences from the datasheet: ``` #define DRV_GREETING *sequence name or number* ``` -If haptic feedback is enabled, the keyboard will vibrate to a specific sqeuence during startup. That can be selected using the following define: +If haptic feedback is enabled, the keyboard will vibrate to a specific sequence during startup. That can be selected using the following define: ``` #define DRV_MODE_DEFAULT *sequence name or number* @@ -191,9 +191,6 @@ With the entry of `#define NO_HAPTIC_MOD` in config.h, the following keys will n * `TT()` layer tap toggle keys, when held to activate a layer. However when tapped `TAPPING_TOGGLE` times to permanently toggle the layer, on the last tap haptic feedback is still triggered. * `MT()` mod tap keys, when held to keep a usual modifier key pressed. However when tapped, and the key is quickly released, and sends a keycode, haptic feedback is still triggered. See also [Mod-Tap](mod_tap.md). -### NO_HAPTIC_FN -With the entry of `#define NO_HAPTIC_FN` in config.h, deprecated `fn_actions` type function keys will not trigger a feedback. - ### NO_HAPTIC_ALPHA With the entry of `#define NO_HAPTIC_ALPHA` in config.h, none of the alpha keys (A ... Z) will trigger a feedback. @@ -207,4 +204,4 @@ With the entry of `#define NO_HAPTIC_LOCKKEYS` in config.h, none of the followin With the entry of `#define NO_HAPTIC_NAV` in config.h, none of the following keys will trigger a feedback: Print Screen, Pause, Insert, Delete, Page Down, Page Up, Left Arrow, Up Arrow, Right Arrow, Down Arrow, End, Home. ### NO_HAPTIC_NUMERIC -With the entry of `#define NO_HAPTIC_NUMERIC` in config.h, none of the following keys between 0 and 9 (KC_1 ... KC_0) will trigger a feedback. \ No newline at end of file +With the entry of `#define NO_HAPTIC_NUMERIC` in config.h, none of the following keys between 0 and 9 (KC_1 ... KC_0) will trigger a feedback. diff --git a/docs/feature_key_lock.md b/docs/feature_key_lock.md index 8e6e29f0e687..76813942298c 100644 --- a/docs/feature_key_lock.md +++ b/docs/feature_key_lock.md @@ -19,4 +19,5 @@ First, enable Key Lock by setting `KEY_LOCK_ENABLE = yes` in your `rules.mk`. Th Key Lock is only able to hold standard action keys and [One Shot modifier](one_shot_keys.md) keys (for example, if you have your Shift defined as `OSM(KC_LSFT)`). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as `KC_LPRN`. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held. -Switching layers will not cancel the Key Lock. +Switching layers will not cancel the Key Lock. The Key Lock can be cancelled by calling the `cancel_key_lock()` function. + diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index 37f38cc6eda1..37c74843aa62 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md @@ -67,6 +67,109 @@ const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/led/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ). +--- +### IS31FLCOMMON :id=is31flcommon + +There is basic support for addressable LED matrix lighting with a selection of I2C ISSI Lumissil LED controllers through a shared common driver. To enable it, add this to your `rules.mk`: + +```makefile +LED_MATRIX_ENABLE = yes +LED_MATRIX_DRIVER = +``` + +Where `` is the applicable LED driver chip as below + +| Driver Name | Data Sheet | Capability | +|-------------|------------|------------| +| `IS31FL3742A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3742A_DS.pdf) | 180 LED, 30x6 Matrix | +| `ISSIFL3743A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3743A_DS.pdf) | 198 LED, 18x11 Matrix | +| `IS31FL3745` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3745_DS.pdf) | 144 LED, 18x8 Matrix | +| `IS31FL3746A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3746A_DS.pdf) | 72 LED, 18x4 Matrix | + +You can use between 1 and 4 IC's. Do not specify `DRIVER_ADDR_` define for IC's if not present on your keyboard. The `DRIVER_ADDR_1` default assumes that all Address pins on the controller have been connected to GND. Drivers that have SYNC functionality have the default settings to disable if 1 driver. If more than 1 drivers then `DRIVER_ADDR_1` will be set to Master and the remaiing ones set to Slave. + +Configure the hardware via your `config.h`: + +| Variable | Description | Default | +|----------|-------------|---------| +| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | +| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | +| `DRIVER_COUNT` | (Required) How many LED driver IC's are present | | +| `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | | +| `DRIVER_ADDR_1` | (Optional) Address for the first LED driver | | +| `DRIVER_ADDR_` | (Required) Address for the additional LED drivers | | +| `ISSI_SSR_` | (Optional) Configuration for the Spread Spectrum Register | | +| `ISSI_CONFIGURATION` | (Optional) Configuration for the Configuration Register | | +| `ISSI_GLOBALCURRENT` | (Optional) Configuration for the Global Current Register | 0xFF | +| `ISSI_PULLDOWNUP` | (Optional) Configuration for the Pull Up & Pull Down Register | | +| `ISSI_TEMP` | (Optional) Configuration for the Tempature Register | | +| `ISSI_PWM_ENABLE` | (Optional) Configuration for the PWM Enable Register | | +| `ISSI_PWM_SET` | (Optional) Configuration for the PWM Setting Register | | +| `ISSI_SCAL_LED ` | (Optional) Configuration for the LEDs Scaling Registers | 0xFF | +| `ISSI_MANUAL_SCALING` | (Optional) If you wish to configure the Scaling Registers manually | | + + +Defaults + +| Variable | IS31FL3742A | IS31FL3743A | IS31FL3745 | IS31FL3746 | +|----------|-------------|-------------|------------|------------| +| `DRIVER_ADDR_1` | 0b0110000 | 0b0100000 | 0b0100000 | 0b1100000 | +| `ISSI_SSR_1` | 0x00 | 0x00 / 0x60 | 0x00 / 0xC0 | 0x00 | +| `ISSI_SSR_<2-4>` | 0x00 | 0x40 | 0x80 | 0x00 | +| `ISSI_CONFIGURATION` | 0x31 | 0x01 | 0x31 | 0x01 | +| `ISSI_PULLDOWNUP` | 0x55 | 0x33 | 0x33 | 0x33 | +| `ISSI_TEMP` | N/A | 0x00 | 0x00 | 0x00 | +| `ISSI_PWM_ENABLE` | N/A | N/A | N/A | 0x00 | +| `ISSI_PWM_SET` | 0x00 | N/A | N/A | 0x00 | + +Here is an example using 2 drivers. + +```c +#define DRIVER_ADDR_2 0b0100001 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 66 +#define DRIVER_2_LED_TOTAL 42 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +``` +!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. + +Currently only 4 drivers are supported, but it would be trivial to support for more. Note that using a combination of different drivers is not supported. All drivers must be of the same model. + +Define these arrays listing all the LEDs in your `.c`: + +```c +const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | LED address + * | | */ + { 0, CS1_SW1 }, + { 0, CS2_SW1 }, + // ... +} +``` + +Where `CSx_SWx` is the location of the LED in the matrix defined by the datasheet. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` for now). + +`ISSI_MANUAL_SCALING` is used to override the Scaling for individual LED's. By default they will be set as per `ISSI_SCAL_LED`. In `config.h` set how many LED's you want to manually set scaling for. +Eg `#define ISSI_MANUAL_SCALING 3` + +Then Define the array listing all the LEDs you want to override in your `.c`: + +```c +const is31_led __flash g_is31_scaling[ISSI_MANUAL_SCALING] = { + * LED Index + * | Scaling + * | | */ + {5, 120}, + {9, 120}, + .... +} +``` + +Where LED Index is the position of the LED in the `g_is31_leds` array. The `scaling` value between 0 and 255 to be written to the Scaling Register. + --- ## Common Configuration :id=common-configuration diff --git a/docs/feature_mouse_keys.md b/docs/feature_mouse_keys.md index 30f563a95ddb..905da36e430c 100644 --- a/docs/feature_mouse_keys.md +++ b/docs/feature_mouse_keys.md @@ -59,13 +59,13 @@ This is the default mode. You can adjust the cursor and scrolling acceleration u |Define |Default|Description | |----------------------------|-------|---------------------------------------------------------| -|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement| -|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements in milliseconds | -|`MOUSEKEY_MOVE_DELTA` |5 |Step size | +|`MOUSEKEY_DELAY` |10 |Delay between pressing a movement key and cursor movement| +|`MOUSEKEY_INTERVAL` |20 |Time between cursor movements in milliseconds | +|`MOUSEKEY_MOVE_DELTA` |8 |Step size | |`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops | -|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached | -|`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement | -|`MOUSEKEY_WHEEL_INTERVAL` |100 |Time between wheel movements | +|`MOUSEKEY_TIME_TO_MAX` |30 |Time until maximum cursor speed is reached | +|`MOUSEKEY_WHEEL_DELAY` |10 |Delay between pressing a wheel key and wheel movement | +|`MOUSEKEY_WHEEL_INTERVAL` |80 |Time between wheel movements | |`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action | |`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached | @@ -85,9 +85,9 @@ This is an extension of the accelerated mode. The kinetic mode uses a quadratic |Define |Default |Description | |--------------------------------------|---------|---------------------------------------------------------------| |`MK_KINETIC_SPEED` |undefined|Enable kinetic mode | -|`MOUSEKEY_DELAY` |8 |Delay between pressing a movement key and cursor movement | -|`MOUSEKEY_INTERVAL` |8 |Time between cursor movements in milliseconds | -|`MOUSEKEY_MOVE_DELTA` |25 |Step size for accelerating from initial to base speed | +|`MOUSEKEY_DELAY` |5 |Delay between pressing a movement key and cursor movement | +|`MOUSEKEY_INTERVAL` |10 |Time between cursor movements in milliseconds | +|`MOUSEKEY_MOVE_DELTA` |5 |Step size for accelerating from initial to base speed | |`MOUSEKEY_INITIAL_SPEED` |100 |Initial speed of the cursor in pixel per second | |`MOUSEKEY_BASE_SPEED` |1000 |Maximum cursor speed at which acceleration stops | |`MOUSEKEY_DECELERATED_SPEED` |400 |Decelerated cursor speed | diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index fb6936620c8d..4b39599f8ab1 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -2,7 +2,7 @@ Pointing Device is a generic name for a feature intended to be generic: moving the system pointer around. There are certainly other options for it - like mousekeys - but this aims to be easily modifiable and hardware driven. You can implement custom keys to control functionality, or you can gather information from other peripherals and insert it directly here - let QMK handle the processing for you. -To enable Pointing Device, uncomment the following line in your rules.mk: +To enable Pointing Device, add the following line in your rules.mk and specify one of the driver options below. ```make POINTING_DEVICE_ENABLE = yes @@ -40,13 +40,13 @@ POINTING_DEVICE_DRIVER = adns9800 The ADNS 9800 is an SPI driven optical sensor, that uses laser output for surface tracking. -| Setting | Description | Default | -|------------------------|------------------------------------------------------------------------|---------------| -|`ADNS9800_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` | -|`ADNS9800_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | -|`ADNS9800_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` | -|`ADNS9800_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | -|`ADNS9800_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | +| Setting | Description | Default | +|--------------------------------|------------------------------------------------------------------------|---------------| +|`ADNS9800_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` | +|`ADNS9800_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | +|`ADNS9800_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` | +|`ADNS9800_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | +|`ADNS9800_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | The CPI range is 800-8200, in increments of 200. Defaults to 1800 CPI. @@ -69,7 +69,7 @@ The Analog Joystick is an analog (ADC) driven sensor. There are a variety of jo |`ANALOG_JOYSTICK_AXIS_MAX` | (Optional) Sets the upper range to be considered movement. | `1023` | |`ANALOG_JOYSTICK_SPEED_REGULATOR` | (Optional) The divisor used to slow down movement. (lower makes it faster) | `20` | |`ANALOG_JOYSTICK_READ_INTERVAL` | (Optional) The interval in milliseconds between reads. | `10` | -|`ANALOG_JOYSTICK_SPEED_MAX` | (Optional) The maxiumum value used for motion. | `2` | +|`ANALOG_JOYSTICK_SPEED_MAX` | (Optional) The maximum value used for motion. | `2` | |`ANALOG_JOYSTICK_CLICK_PIN` | (Optional) The pin wired up to the press switch of the analog stick. | _not defined_ | @@ -127,11 +127,10 @@ The Pimoroni Trackball module is a I2C based breakout board with an RGB enable t | Setting | Description | Default | |-------------------------------------|------------------------------------------------------------------------------------|---------| |`PIMORONI_TRACKBALL_ADDRESS` | (Required) Sets the I2C Address for the Pimoroni Trackball. | `0x0A` | -|`PIMORONI_TRACKBALL_TIMEOUT` | (Optional) The timeout for i2c communication with the trackpad in milliseconds. | `100` | -|`PIMORONI_TRACKBALL_INTERVAL_MS` | (Optional) The update/read interval for the sensor in milliseconds. | `8` | +|`PIMORONI_TRACKBALL_TIMEOUT` | (Optional) The timeout for i2c communication with the trackball in milliseconds. | `100` | |`PIMORONI_TRACKBALL_SCALE` | (Optional) The multiplier used to generate reports from the sensor. | `5` | |`PIMORONI_TRACKBALL_DEBOUNCE_CYCLES` | (Optional) The number of scan cycles used for debouncing on the ball press. | `20` | -|`PIMORONI_TRACKBALL_ERROR_COUNT` | (Optional) Specifies the number of read/write errors until the sensor is disabled. | `10` | +|`PIMORONI_TRACKBALL_ERROR_COUNT` | (Optional) Specifies the number of read/write errors until the sensor is disabled. | `10` | ### PMW 3360 Sensor @@ -145,20 +144,50 @@ The PMW 3360 is an SPI driven optical sensor, that uses a built in IR LED for su | Setting | Description | Default | |-----------------------------|--------------------------------------------------------------------------------------------|---------------| -|`PMW3360_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | -|`PMW3360_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` | -|`PMW3360_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | -|`PMW3360_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` | -|`PMW3360_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | -|`PMW3360_LIFTOFF_DISTANCE` | (Optional) Sets the lift off distance at run time | `0x02` | -|`ROTATIONAL_TRANSFORM_ANGLE` | (Optional) Allows for the sensor data to be rotated +/- 30 degrees directly in the sensor. | `0` | +|`PMW3360_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | +|`PMW3360_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` | +|`PMW3360_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | +|`PMW3360_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` | +|`PMW3360_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | +|`PMW3360_LIFTOFF_DISTANCE` | (Optional) Sets the lift off distance at run time | `0x02` | +|`ROTATIONAL_TRANSFORM_ANGLE` | (Optional) Allows for the sensor data to be rotated +/- 127 degrees directly in the sensor.| `0` | +|`PMW3360_FIRMWARE_UPLOAD_FAST` | (Optional) Skips the 15us wait between firmware blocks. | _not defined_ | The CPI range is 100-12000, in increments of 100. Defaults to 1600 CPI. +### PMW 3389 Sensor + +To use the PMW 3389 sensor, add this to your `rules.mk` + +```make +POINTING_DEVICE_DRIVER = pmw3389 +``` + +The PMW 3389 is an SPI driven optical sensor, that uses a built in IR LED for surface tracking. + +| Setting | Description | Default | +|---------------------------------|--------------------------------------------------------------------------------------------|---------------| +|`PMW3389_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ | +|`PMW3389_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` | +|`PMW3389_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | +|`PMW3389_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` | +|`PMW3389_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | +|`PMW3389_LIFTOFF_DISTANCE` | (Optional) Sets the lift off distance at run time | `0x02` | +|`ROTATIONAL_TRANSFORM_ANGLE` | (Optional) Allows for the sensor data to be rotated +/- 30 degrees directly in the sensor. | `0` | +|`PMW3389_FIRMWARE_UPLOAD_FAST` | (Optional) Skips the 15us wait between firmware blocks. | _not defined_ | + +The CPI range is 50-16000, in increments of 50. Defaults to 2000 CPI. + ### Custom Driver -If you have a sensor type that isn't supported here, you can manually implement it, by adding these functions (with the correct implementation for your device): +If you have a sensor type that isn't supported above, a custom option is available by adding the following to your `rules.mk` + +```make +POINTING_DEVICE_DRIVER = custom +``` + +Using the custom driver will require implementing the following functions: ```c void pointing_device_driver_init(void) {} @@ -171,14 +200,35 @@ void pointing_device_driver_set_cpi(uint16_t cpi) {} ## Common Configuration -| Setting | Description | Default | -|-------------------------------|-----------------------------------------------------------------------|---------------| -|`POINTING_DEVICE_ROTATION_90` | (Optional) Rotates the X and Y data by 90 degrees. | _not defined_ | -|`POINTING_DEVICE_ROTATION_180` | (Optional) Rotates the X and Y data by 180 degrees. | _not defined_ | -|`POINTING_DEVICE_ROTATION_270` | (Optional) Rotates the X and Y data by 270 degrees. | _not defined_ | -|`POINTING_DEVICE_INVERT_X` | (Optional) Inverts the X axis report. | _not defined_ | -|`POINTING_DEVICE_INVERT_Y` | (Optional) Inverts the Y axis report. | _not defined_ | -|`POINTING_DEVICE_MOTION_PIN` | (Optional) If supported, will only read from sensor if pin is active. | _not defined_ | +| Setting | Description | Default | +|----------------------------------|-----------------------------------------------------------------------|-------------------| +|`POINTING_DEVICE_ROTATION_90` | (Optional) Rotates the X and Y data by 90 degrees. | _not defined_ | +|`POINTING_DEVICE_ROTATION_180` | (Optional) Rotates the X and Y data by 180 degrees. | _not defined_ | +|`POINTING_DEVICE_ROTATION_270` | (Optional) Rotates the X and Y data by 270 degrees. | _not defined_ | +|`POINTING_DEVICE_INVERT_X` | (Optional) Inverts the X axis report. | _not defined_ | +|`POINTING_DEVICE_INVERT_Y` | (Optional) Inverts the Y axis report. | _not defined_ | +|`POINTING_DEVICE_MOTION_PIN` | (Optional) If supported, will only read from sensor if pin is active. | _not defined_ | +|`POINTING_DEVICE_TASK_THROTTLE_MS` | (Optional) Limits the frequency that the sensor is polled for motion. | _not defined_ | + +!> When using `SPLIT_POINTING_ENABLE` the `POINTING_DEVICE_MOTION_PIN` functionality is not supported and `POINTING_DEVICE_TASK_THROTTLE_MS` will default to `1`. Increasing this value will increase transport performance at the cost of possible mouse responsiveness. + + +## Split Keyboard Configuration + +The following configuration options are only available when using `SPLIT_POINTING_ENABLE` see [data sync options](feature_split_keyboard.md?id=data-sync-options). The rotation and invert `*_RIGHT` options are only used with `POINTING_DEVICE_COMBINED`. If using `POINTING_DEVICE_LEFT` or `POINTING_DEVICE_RIGHT` use the common configuration above to configure your pointing device. + +| Setting | Description | Default | +|----------------------------------------|-----------------------------------------------------------------------|---------------| +|`POINTING_DEVICE_LEFT` | Pointing device on the left side (Required - pick one only) | _not defined_ | +|`POINTING_DEVICE_RIGHT` | Pointing device on the right side (Required - pick one only) | _not defined_ | +|`POINTING_DEVICE_COMBINED` | Pointing device on both sides (Required - pick one only) | _not defined_ | +|`POINTING_DEVICE_ROTATION_90_RIGHT` | (Optional) Rotates the X and Y data by 90 degrees. | _not defined_ | +|`POINTING_DEVICE_ROTATION_180_RIGHT` | (Optional) Rotates the X and Y data by 180 degrees. | _not defined_ | +|`POINTING_DEVICE_ROTATION_270_RIGHT` | (Optional) Rotates the X and Y data by 270 degrees. | _not defined_ | +|`POINTING_DEVICE_INVERT_X_RIGHT` | (Optional) Inverts the X axis report. | _not defined_ | +|`POINTING_DEVICE_INVERT_Y_RIGHT` | (Optional) Inverts the Y axis report. | _not defined_ | + +!> If there is a `_RIGHT` configuration option or callback, the [common configuration](feature_pointing_device.md?id=common-configuration) option will work for the left. For correct left/right detection you should setup a [handedness option](feature_split_keyboard?id=setting-handedness), `EE_HANDS` is usually a good option for an existing board that doesn't do handedness by hardware. ## Callbacks and Functions @@ -188,7 +238,7 @@ void pointing_device_driver_set_cpi(uint16_t cpi) {} | `pointing_device_init_kb(void)` | Callback to allow for keyboard level initialization. Useful for additional hardware sensors. | | `pointing_device_init_user(void)` | Callback to allow for user level initialization. Useful for additional hardware sensors. | | `pointing_device_task_kb(mouse_report)` | Callback that sends sensor data, so keyboard code can intercept and modify the data. Returns a mouse report. | -| `pointing_device_task_user(mouse_report)` | Callback that sends sensor data, so user coe can intercept and modify the data. Returns a mouse report. | +| `pointing_device_task_user(mouse_report)` | Callback that sends sensor data, so user code can intercept and modify the data. Returns a mouse report. | | `pointing_device_handle_buttons(buttons, pressed, button)` | Callback to handle hardware button presses. Returns a `uint8_t`. | | `pointing_device_get_cpi(void)` | Gets the current CPI/DPI setting from the sensor, if supported. | | `pointing_device_set_cpi(uint16_t)` | Sets the CPI/DPI, if supported. | @@ -196,6 +246,21 @@ void pointing_device_driver_set_cpi(uint16_t cpi) {} | `pointing_device_set_report(mouse_report)` | Sets the mouse report to the assigned `mouse_report_t` data structured passed to the function. | | `pointing_device_send(void)` | Sends the current mouse report to the host system. Function can be replaced. | | `has_mouse_report_changed(old, new)` | Compares the old and new `mouse_report_t` data and returns true only if it has changed. | +| `pointing_device_adjust_by_defines(mouse_report)` | Applies rotations and invert configurations to a raw mouse report. | + + +## Split Keyboard Callbacks and Functions + +The combined functions below are only available when using `SPLIT_POINTING_ENABLE` and `POINTING_DEVICE_COMBINED`. The 2 callbacks `pointing_device_task_combined_*` replace the single sided equivalents above. See the [combined pointing devices example](feature_pointing_device.md?id=combined-pointing-devices) + +| Function | Description | +|-----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------| +| `pointing_device_set_shared_report(mouse_report)` | Sets the shared mouse report to the assigned `mouse_report_t` data structured passed to the function. | +| `pointing_device_set_cpi_on_side(bool, uint16_t)` | Sets the CPI/DPI of one side, if supported. Passing `true` will set the left and `false` the right` | +| `pointing_device_combine_reports(left_report, right_report)` | Returns a combined mouse_report of left_report and right_report (as a `mouse_report_t` data structure) | +| `pointing_device_task_combined_kb(left_report, right_report)` | Callback, so keyboard code can intercept and modify the data. Returns a combined mouse report. | +| `pointing_device_task_combined_user(left_report, right_report)` | Callback, so user code can intercept and modify. Returns a combined mouse report using `pointing_device_combine_reports` | +| `pointing_device_adjust_by_defines_right(mouse_report)` | Applies right side rotations and invert configurations to a raw mouse report. | # Manipulating Mouse Reports @@ -274,3 +339,62 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ``` This allows you to toggle between scrolling and cursor movement by pressing the DRAG_SCROLL key. + +## Split Examples + +The following examples make use the `SPLIT_POINTING_ENABLE` functionality and show how to manipulate the mouse report for a scrolling mode. + +### Single Pointing Device + +The following example will work with either `POINTING_DEVICE_LEFT` or `POINTING_DEVICE_RIGHT` and enables scrolling mode while on a particular layer. + +```c + +static bool scrolling_mode = false; + +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _RAISE: // If we're on the _RAISE layer enable scrolling mode + scrolling_mode = true; + pointing_device_set_cpi(2000); + break; + default: + if (scrolling_mode) { // check if we were scrolling before and set disable if so + scrolling_mode = false; + pointing_device_set_cpi(8000); + } + break; + } + return state; +} + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + if (scrolling_mode) { + mouse_report.h = mouse_report.x; + mouse_report.v = mouse_report.y; + mouse_report.x = 0; + mouse_report.y = 0; + } + return mouse_report; +} +``` + +### Combined Pointing Devices + +The following example requires `POINTING_DEVICE_COMBINED` and sets the left side pointing device to scroll only. + +```c +void keyboard_post_init_user(void) { + pointing_device_set_cpi_on_side(true, 1000); //Set cpi on left side to a low value for slower scrolling. + pointing_device_set_cpi_on_side(false, 8000); //Set cpi on right side to a reasonable value for mousing. +} + +report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report) { + left_report.h = left_report.x; + left_report.v = left_report.y; + left_report.x = 0; + left_report.y = 0; + return pointing_device_combine_reports(left_report, right_report); +} +``` +======= diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 536609b39a3c..a021779d4305 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -232,6 +232,115 @@ const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3737.pdf) and the header file `drivers/led/issi/is31fl3737.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0`, `1` for now). +--- +### IS31FLCOMMON :id=is31flcommon + +There is basic support for addressable RGB matrix lighting with a selection of I2C ISSI Lumissil RGB controllers through a shared common driver. To enable it, add this to your `rules.mk`: + +```makefile +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = +``` + +Where `` is the applicable LED driver chip as below + +| Driver Name | Data Sheet | Capability | +|-------------|------------|------------| +| `IS31FL3742A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3742A_DS.pdf) | 60 RGB, 30x6 Matrix | +| `ISSIFL3743A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3743A_DS.pdf) | 66 RGB, 18x11 Matrix | +| `IS31FL3745` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3745_DS.pdf) | 48 RGB, 18x8 Matrix | +| `IS31FL3746A` | [datasheet](https://www.lumissil.com/assets/pdf/core/IS31FL3746A_DS.pdf) | 24 RGB, 18x4 Matrix | + +You can use between 1 and 4 IC's. Do not specify `DRIVER_ADDR_` define for IC's if not present on your keyboard. The `DRIVER_ADDR_1` default assumes that all Address pins on the controller have been connected to GND. Drivers that have SYNC functionality have the default settings to disable if 1 driver. If more than 1 drivers then `DRIVER_ADDR_1` will be set to Master and the remaining ones set to Slave. + +Configure the hardware via your `config.h`: + +| Variable | Description | Default | +|----------|-------------|---------| +| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | +| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | +| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | +| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | +| `DRIVER_ADDR_1` | (Optional) Address for the first RGB driver | | +| `DRIVER_ADDR_` | (Required) Address for the additional RGB drivers | | +| `ISSI_SSR_` | (Optional) Configuration for the Spread Spectrum Register | | +| `ISSI_CONFIGURATION` | (Optional) Configuration for the Configuration Register | | +| `ISSI_GLOBALCURRENT` | (Optional) Configuration for the Global Current Register | 0xFF | +| `ISSI_PULLDOWNUP` | (Optional) Configuration for the Pull Up & Pull Down Register | | +| `ISSI_TEMP` | (Optional) Configuration for the Tempature Register | | +| `ISSI_PWM_ENABLE` | (Optional) Configuration for the PWM Enable Register | | +| `ISSI_PWM_SET` | (Optional) Configuration for the PWM Setting Register | | +| `ISSI_SCAL_RED` | (Optional) Configuration for the RED LEDs in Scaling Registers | 0xFF | +| `ISSI_SCAL_BLUE` | (Optional) Configuration for the BLUE LEDs in Scaling Registers | 0xFF | +| `ISSI_SCAL_GREEN` | (Optional) Configuration for the GREEN LEDs in Scaling Registers | 0xFF | +| `ISSI_MANUAL_SCALING` | (Optional) If you wish to configure the Scaling Registers manually | | + + +Defaults + +| Variable | IS31FL3742A | IS31FL3743A | IS31FL3745 | IS31FL3746 | +|----------|-------------|-------------|------------|------------| +| `DRIVER_ADDR_1` | 0b0110000 | 0b0100000 | 0b0100000 | 0b1100000 | +| `ISSI_SSR_1` | 0x00 | 0x00 / 0x60 | 0x00 / 0xC0 | 0x00 | +| `ISSI_SSR_<2-4>` | 0x00 | 0x40 | 0x80 | 0x00 | +| `ISSI_CONFIGURATION` | 0x31 | 0x01 | 0x31 | 0x01 | +| `ISSI_PULLDOWNUP` | 0x55 | 0x33 | 0x33 | 0x33 | +| `ISSI_TEMP` | N/A | 0x00 | 0x00 | 0x00 | +| `ISSI_PWM_ENABLE` | N/A | N/A | N/A | 0x00 | +| `ISSI_PWM_SET` | 0x00 | N/A | N/A | 0x00 | + +Here is an example using 2 drivers. + +```c +#define DRIVER_ADDR_2 0b0100001 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 66 +#define DRIVER_2_LED_TOTAL 42 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +``` + +!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. + +Currently only 4 drivers are supported, but it would be trivial to support for more. Note that using a combination of different drivers is not supported. All drivers must be of the same model. + +Define these arrays listing all the LEDs in your `.c`: + +```c +const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, CS1_SW1, CS2_SW1, CS3_SW1}, + .... +} +``` + +Where `CSx_SWx` is the location of the LED in the matrix defined by the datasheet. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` for now). + +`ISSI_MANUAL_SCALING` is used to override the Scaling for individual LED's. By default they will be set as per `ISSI_SCAL_`. In `config.h` set how many LED's you want to manually set scaling for. +Eg `#define ISSI_MANUAL_SCALING 3` + +Then Define the array listing all the LEDs you want to override in your `.c`: + +```c +const is31_led __flash g_is31_scaling[ISSI_MANUAL_SCALING] = { + * LED Index + * | R scaling + * | | G scaling + * | | | B scaling + * | | | | */ + {5, 120, 155, 167}, + {9, 120, 155, 167}, + .... +} +``` + +Where LED Index is the position of the LED in the `g_is31_leds` array. The `scaling` value between 0 and 255 to be written to the Scaling Register. + --- ### WS2812 :id=ws2812 @@ -457,6 +566,7 @@ enum rgb_matrix_effects { RGB_MATRIX_HUE_PENDULUM, // Hue shifts up a slight ammount in a wave to the right, then back to the left RGB_MATRIX_HUE_WAVE, // Hue shifts up a slight ammount and then back down in a wave to the right RGB_MATRIX_PIXEL_FRACTAL, // Single hue fractal filled keys pulsing horizontally out to edges + RGB_MATRIX_PIXEL_FLOW, // Pulsing RGB flow along LED wiring with random hues RGB_MATRIX_PIXEL_RAIN, // Randomly light keys with random hues #if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! @@ -512,6 +622,7 @@ You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `confi |`#define ENABLE_RGB_MATRIX_HUE_PENDULUM` |Enables `RGB_MATRIX_HUE_PENDULUM` | |`#define ENABLE_RGB_MATRIX_HUE_WAVE` |Enables `RGB_MATRIX_HUE_WAVE ` | |`#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL` |Enables `RGB_MATRIX_PIXEL_FRACTAL` | +|`#define ENABLE_RGB_MATRIX_PIXEL_FLOW` |Enables `RGB_MATRIX_PIXEL_FLOW` | |`#define ENABLE_RGB_MATRIX_PIXEL_RAIN` |Enables `RGB_MATRIX_PIXEL_RAIN` | ?> These modes don't require any additional defines. @@ -707,6 +818,7 @@ Where `28` is an unused index from `eeconfig.h`. |`rgb_matrix_decrease_speed_noeeprom()` |Decrease the speed of the animations (not written to EEPROM) | |`rgb_matrix_set_speed(speed)` |Set the speed of the animations to the given value where `speed` is between 0 and 255 | |`rgb_matrix_set_speed_noeeprom(speed)` |Set the speed of the animations to the given value where `speed` is between 0 and 255 (not written to EEPROM) | +|`rgb_matrix_reload_from_eeprom()` |Reload the effect configuration (enabled, mode and color) from EEPROM | ### Change Color :id=change-color |Function |Description | diff --git a/docs/feature_split_keyboard.md b/docs/feature_split_keyboard.md index dbc7740f98dc..6ef70bf788f9 100644 --- a/docs/feature_split_keyboard.md +++ b/docs/feature_split_keyboard.md @@ -273,6 +273,14 @@ This enables transmitting the current OLED on/off status to the slave side of th This enables transmitting the current ST7565 on/off status to the slave side of the split keyboard. The purpose of this feature is to support state (on/off state only) syncing. +```c +#define SPLIT_POINTING_ENABLE +``` + +This enables transmitting the pointing device status to the master side of the split keyboard. The purpose of this feature is to enable use pointing devices on the slave side. + +!> There is additional required configuration for `SPLIT_POINTING_ENABLE` outlined in the [pointing device documentation](feature_pointing_device.md?id=split-keyboard-configuration). + ### Custom data sync between sides :id=custom-data-sync QMK's split transport allows for arbitrary data transactions at both the keyboard and user levels. This is modelled on a remote procedure call, with the master invoking a function on the slave side, with the ability to send data from master to slave, process it slave side, and send data back from slave to master. diff --git a/docs/feature_wpm.md b/docs/feature_wpm.md index 87145c97e3d1..9f98ef8336ca 100644 --- a/docs/feature_wpm.md +++ b/docs/feature_wpm.md @@ -16,7 +16,7 @@ For split keyboards using soft serial, the computed WPM score will be available | `WPM_ALLOW_COUNT_REGRESSION` | _Not defined_ | If defined allows the WPM to be decreased when hitting Delete or Backspace | | `WPM_UNFILTERED` | _Not defined_ | If undefined (the default), WPM values will be smoothed to avoid sudden changes in value | | `WPM_SAMPLE_SECONDS` | `5` | This defines how many seconds of typing to average, when calculating WPM | -| `WPM_SAMPLE_PERIODS` | `50` | This defines how many sampling periods to use when calculating WPM | +| `WPM_SAMPLE_PERIODS` | `25` | This defines how many sampling periods to use when calculating WPM | | `WPM_LAUNCH_CONTROL` | _Not defined_ | If defined, WPM values will be calculated using partial buffers when typing begins | 'WPM_UNFILTERED' is potentially useful if you're filtering data in some other way (and also because it reduces the code required for the WPM feature), or if reducing measurement latency to a minimum is important for you. diff --git a/docs/flash_driver.md b/docs/flash_driver.md new file mode 100644 index 000000000000..fa7fed5171b1 --- /dev/null +++ b/docs/flash_driver.md @@ -0,0 +1,24 @@ +# FLASH Driver Configuration :id=flash-driver-configuration + +The FLASH driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present. + +Driver | Description +-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +`FLASH_DRIVER = spi` | Supports writing to almost all NOR Flash chips. See the driver section below. + + +## SPI FLASH Driver Configuration :id=spi-flash-driver-configuration + +Currently QMK supports almost all NOR Flash chips over SPI. As such, requires a working spi_master driver configuration. You can override the driver configuration via your config.h: + +`config.h` override | Description | Default Value +-----------------------------------------------|--------------------------------------------------------------------------------------|----------------- +`#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN` | SPI Slave select pin in order to inform that the FLASH is currently being addressed | _none_ +`#define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR` | Clock divisor used to divide the peripheral clock to derive the SPI frequency | `8` +`#define EXTERNAL_FLASH_PAGE_SIZE` | The Page size of the FLASH in bytes, as specified in the datasheet | `256` +`#define EXTERNAL_FLASH_SECTOR_SIZE` | The sector size of the FLASH in bytes, as specified in the datasheet | `(4 * 1024)` +`#define EXTERNAL_FLASH_BLOCK_SIZE` | The block size of the FLASH in bytes, as specified in the datasheet | `(64 * 1024)` +`#define EXTERNAL_FLASH_SIZE` | The total size of the FLASH in bytes, as specified in the datasheet | `(512 * 1024)` +`#define EXTERNAL_FLASH_ADDRESS_SIZE` | The Flash address size in bytes, as specified in datasheet | `3` + +!> All the above default configurations are based on MX25L4006E NOR Flash. diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md deleted file mode 100644 index 69aca2cf3455..000000000000 --- a/docs/hardware_avr.md +++ /dev/null @@ -1,182 +0,0 @@ -# Keyboards with AVR Processors - -This page describes the support for AVR processors in QMK. AVR processors include the atmega32u4, atmega32u2, at90usb1286, and other processors from Atmel Corporation. AVR processors are 8-bit MCUs that are designed to be easy to work with. The most common AVR processors in keyboards have on-board USB and plenty of GPIO for supporting large keyboard matrices. They are the most popular MCU for use in keyboards today. - -If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_guidelines.md) to get a sense of how keyboards fit into QMK. - -## Adding Your AVR Keyboard to QMK - -QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started, run `qmk new-keyboard`: - -``` -$ qmk new-keyboard -Ψ Generating a new QMK keyboard directory - -Keyboard Name: mycoolkeeb -Keyboard Type: - 1. avr - 2. ps2avrgb -Please enter your choice: [1] -Your Name: [John Smith] -Ψ Copying base template files... -Ψ Copying avr template files... -Ψ Renaming keyboard.[ch] to mycoolkeeb.[ch]... -Ψ Replacing %YEAR% with 2021... -Ψ Replacing %KEYBOARD% with mycoolkeeb... -Ψ Replacing %YOUR_NAME% with John Smith... - -Ψ Created a new keyboard called mycoolkeeb. -Ψ To start working on things, `cd` into keyboards/mycoolkeeb, -Ψ or open the directory in your preferred text editor. -``` - -This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard. - -## `readme.md` - -This is where you'll describe your keyboard. Please follow the [Keyboard Readme Template](documentation_templates.md#keyboard-readmemd-template) when writing your `readme.md`. You're encouraged to place an image at the top of your `readme.md`, please use an external service such as [Imgur](https://imgur.com) to host the images. - -## `.c` - -This is where all the custom logic for your keyboard goes. Many keyboards do not need to put anything at all in here. You can learn more about writing custom logic in [Custom Quantum Functions](custom_quantum_functions.md). - -## `.h` - -This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this: - -```c -#define LAYOUT( \ - k00, k01, k02, \ - k10, k11 \ -) { \ - { k00, k01, k02 }, \ - { k10, KC_NO, k11 }, \ -} -``` - -The first half of the `LAYOUT` pre-processor macro defines the physical arrangement of keys. The second half of the macro defines the matrix the switches are connected to. This allows you to have a physical arrangement of keys that differs from the wiring matrix. - -Each of the `k__` variables needs to be unique, and typically they follow the format `k`. - -The physical matrix (the second half) must have a number of rows equaling `MATRIX_ROWS`, and each row must have exactly `MATRIX_COLS` elements in it. If you do not have this many physical keys you can use `KC_NO` to fill in the blank spots. - -## `config.h` - -The `config.h` file is where you configure the hardware and feature set for your keyboard. There are a lot of options that can be placed in that file, too many to list there. For a complete overview of available options see the [Config Options](config_options.md) page. - -### Hardware Configuration - - -At the top of the `config.h` you'll find USB related settings. These control how your keyboard appears to the Operating System. If you don't have a good reason to change you should leave the `VENDOR_ID` as `0xFEED`. For the `PRODUCT_ID` you should pick a number that is not yet in use. - -Do change the `MANUFACTURER` and `PRODUCT` lines to accurately reflect your keyboard. - -```c -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER You -#define PRODUCT my_awesome_keyboard -``` - -?> Windows and macOS will display the `MANUFACTURER` and `PRODUCT` in the list of USB devices. `lsusb` on Linux instead prefers the values in the list maintained by the [USB ID Repository](http://www.linux-usb.org/usb-ids.html). By default, it will only use `MANUFACTURER` and `PRODUCT` if the list does not contain that `VENDOR_ID` / `PRODUCT_ID`. `sudo lsusb -v` will show the values reported by the device, and they are also present in kernel logs after plugging it in. - -### Keyboard Matrix Configuration - -The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement. - -```c -#define MATRIX_ROWS 2 -#define MATRIX_COLS 3 -``` - -Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins: - -```c -#define MATRIX_ROW_PINS { D0, D5 } -#define MATRIX_COL_PINS { F1, F0, B0 } -#define UNUSED_PINS -``` - -The number of `MATRIX_ROW_PINS` entries must be the same as the number you assigned to `MATRIX_ROWS`, and likewise for `MATRIX_COL_PINS` and `MATRIX_COLS`. You do not have to specify `UNUSED_PINS`, but you can if you want to document what pins are open. - -Finally, you can specify the direction your diodes point. This can be `COL2ROW` or `ROW2COL`. - -```c -#define DIODE_DIRECTION COL2ROW -``` - -#### Direct Pin Matrix -To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. - -```c -// #define MATRIX_ROW_PINS { D0, D5 } -// #define MATRIX_COL_PINS { F1, F0, B0 } -#define DIRECT_PINS { \ - { F1, E6, B0, B2, B3 }, \ - { F5, F0, B1, B7, D2 }, \ - { F6, F7, C7, D5, D3 }, \ - { B5, C6, B6, NO_PIN, NO_PIN } \ -} -#define UNUSED_PINS - -/* COL2ROW, ROW2COL */ -//#define DIODE_DIRECTION -``` - -### Backlight Configuration - -QMK supports backlighting on most GPIO pins. A select few of these can be driven by the MCU in hardware. For more details see the [Backlight Documentation](feature_backlight.md). - -```c -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_LEVELS 3 -#define BACKLIGHT_BREATHING -#define BREATHING_PERIOD 6 -``` - -### Other Configuration Options - -There are a lot of features that can be configured or tuned in `config.h`. You should see the [Config Options](config_options.md) page for more details. - -## `rules.mk` - -You use the `rules.mk` file to tell QMK what files to build and what features to enable. If you are building around an atmega32u4 you can largely leave these defaults alone. If you are using another MCU you may have to tweak some parameters. - -### MCU Options - -These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable. - -```make -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -``` - -### Bootloaders - -The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. - -#### Teensy Bootloader Example - -```make -BOOTLOADER = halfkay -``` - -#### Atmel DFU Loader Example - -```make -BOOTLOADER = atmel-dfu -``` - -#### Pro Micro Bootloader Example - -```make -BOOTLOADER = caterina -``` - -### Build Options - -There are a number of features that can be turned on or off in `rules.mk`. See the [Config Options](config_options.md#feature-options) page for a detailed list and description. diff --git a/docs/index.html b/docs/index.html index f5a8dbbf1228..e24b25e73a97 100644 --- a/docs/index.html +++ b/docs/index.html @@ -39,7 +39,6 @@ '/glossary': '/reference_glossary', '/key_lock': '/feature_key_lock', '/make_instructions': '/getting_started_make_guide', - '/porting_your_keyboard_to_qmk': '/hardware_avr', '/space_cadet_shift': '/feature_space_cadet_shift', '/getting_started_getting_help': '/support', '/tap_dance': '/feature_tap_dance', diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md index ccd3f8c74d92..e1f1515b71f8 100644 --- a/docs/internals_gpio_control.md +++ b/docs/internals_gpio_control.md @@ -6,17 +6,19 @@ QMK has a GPIO control abstraction layer which is microcontroller agnostic. This The following functions provide basic control of GPIOs and are found in `platforms//gpio.h`. -|Function |Description | Old AVR Examples | Old ChibiOS/ARM Examples | -|------------------------|--------------------------------------------------|-------------------------------------------------|-------------------------------------------------| -| `setPinInput(pin)` | Set pin as input with high impedance (High-Z) | `DDRB &= ~(1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT)` | -| `setPinInputHigh(pin)` | Set pin as input with builtin pull-up resistor | `DDRB &= ~(1<<2); PORTB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT_PULLUP)` | -| `setPinInputLow(pin)` | Set pin as input with builtin pull-down resistor | N/A (Not supported on AVR) | `palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN)` | -| `setPinOutput(pin)` | Set pin as output | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | -| `writePinHigh(pin)` | Set pin level as high, assuming it is an output | `PORTB \|= (1<<2)` | `palSetLine(pin)` | -| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` | -| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` | -| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` | -| `togglePin(pin)` | Invert pin level, assuming it is an output | `PORTB ^= (1<<2)` | `palToggleLine(pin)` | +| Function | Description | Old AVR Examples | Old ChibiOS/ARM Examples | +|------------------------------|-----------------------------------------------------|-------------------------------------------------|--------------------------------------------------| +| `setPinInput(pin)` | Set pin as input with high impedance (High-Z) | `DDRB &= ~(1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT)` | +| `setPinInputHigh(pin)` | Set pin as input with builtin pull-up resistor | `DDRB &= ~(1<<2); PORTB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT_PULLUP)` | +| `setPinInputLow(pin)` | Set pin as input with builtin pull-down resistor | N/A (Not supported on AVR) | `palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN)` | +| `setPinOutput(pin)` | Set pin as output (alias of `setPinOutputPushPull`) | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | +| `setPinOutputPushPull(pin)` | Set pin as output, push/pull mode | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | +| `setPinOutputOpenDrain(pin)` | Set pin as output, open-drain mode | N/A (Not implemented on AVR) | `palSetLineMode(pin, PAL_MODE_OUTPUT_OPENDRAIN)` | +| `writePinHigh(pin)` | Set pin level as high, assuming it is an output | `PORTB \|= (1<<2)` | `palSetLine(pin)` | +| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` | +| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` | +| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` | +| `togglePin(pin)` | Invert pin level, assuming it is an output | `PORTB ^= (1<<2)` | `palToggleLine(pin)` | ## Advanced Settings :id=advanced-settings diff --git a/docs/keycodes.md b/docs/keycodes.md index 84a6d456ba3c..58ce43d309c5 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -219,11 +219,11 @@ See also: [Basic Keycodes](keycodes_basic.md) See also: [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) -|Key |Aliases |Description | -|--------------|---------|-------------------------------------------------------| -|`RESET` | |Put the keyboard into bootloader mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`EEPROM_RESET`|`EEP_RST`|Reinitializes the keyboard's EEPROM (persistent memory)| +|Key |Aliases |Description | +|-----------------|---------|-------------------------------------------------------| +|`QK_BOOTLOADER` |`QK_BOOT`|Put the keyboard into bootloader mode for flashing | +|`QK_DEBUG_TOGGLE`|`DB_TOGG`|Toggle debug mode | +|`QK_CLEAR_EEPROM`|`EE_CLR` |Reinitializes the keyboard's EEPROM (persistent memory)| ## Audio Keys :id=audio-keys @@ -283,9 +283,9 @@ See also: [Dynamic Macros](feature_dynamic_macros.md) See also: [Grave Escape](feature_grave_esc.md) -|Key |Aliases |Description | -|-----------|---------|------------------------------------------------------------------| -|`GRAVE_ESC`|`KC_GESC`|Escape when pressed, ` when Shift or GUI are held| +|Key |Aliases |Description | +|-----------------|---------|------------------------------------------------------------------| +|`QK_GRAVE_ESCAPE`|`QK_GESC`|Escape when pressed, ` when Shift or GUI are held| ## Key Lock :id=key-lock @@ -326,6 +326,7 @@ See also: [Magic Keycodes](keycodes_magic.md) |----------------------------------|---------|--------------------------------------------------------------------------| |`MAGIC_SWAP_CONTROL_CAPSLOCK` |`CL_SWAP`|Swap Caps Lock and Left Control | |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |`CL_NORM`|Unswap Caps Lock and Left Control | +|`MAGIC_TOGGLE_CONTROL_CAPSLOCK` |`CL_TOGG`|Toggle Caps Lock and Left Control swap | |`MAGIC_CAPSLOCK_TO_CONTROL` |`CL_CTRL`|Treat Caps Lock as Control | |`MAGIC_UNCAPSLOCK_TO_CONTROL` |`CL_CAPS`|Stop treating Caps Lock as Control | |`MAGIC_SWAP_LCTL_LGUI` |`LCG_SWP`|Swap Left Control and GUI | diff --git a/docs/keycodes_magic.md b/docs/keycodes_magic.md index 7e1b1a4f6235..01eb69168ef7 100644 --- a/docs/keycodes_magic.md +++ b/docs/keycodes_magic.md @@ -6,6 +6,7 @@ |----------------------------------|---------|--------------------------------------------------------------------------| |`MAGIC_SWAP_CONTROL_CAPSLOCK` |`CL_SWAP`|Swap Caps Lock and Left Control | |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |`CL_NORM`|Unswap Caps Lock and Left Control | +|`MAGIC_TOGGLE_CONTROL_CAPSLOCK` |`CL_TOGG`|Toggle Caps Lock and Left Control swap | |`MAGIC_CAPSLOCK_TO_CONTROL` |`CL_CTRL`|Treat Caps Lock as Control | |`MAGIC_UNCAPSLOCK_TO_CONTROL` |`CL_CAPS`|Stop treating Caps Lock as Control | |`MAGIC_SWAP_LCTL_LGUI` |`LCG_SWP`|Swap Left Control and GUI | diff --git a/docs/keymap.md b/docs/keymap.md index bec781e684e3..a7c9c50d7468 100644 --- a/docs/keymap.md +++ b/docs/keymap.md @@ -136,7 +136,7 @@ After this you'll find a list of LAYOUT() macros. A LAYOUT() is simply a list of `keymaps[][MATRIX_ROWS][MATRIX_COLS]` in QMK holds the 16 bit action code (sometimes referred as the quantum keycode) in it. For the keycode representing typical keys, its high byte is 0 and its low byte is the USB HID usage ID for keyboard. -> TMK from which QMK was forked uses `const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]` instead and holds the 8 bit keycode. Some keycode values are reserved to induce execution of certain action codes via the `fn_actions[]` array. +> TMK from which QMK was forked uses `const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]` instead and holds the 8 bit keycode. #### Base Layer diff --git a/docs/platformdev_chibios_earlyinit.md b/docs/platformdev_chibios_earlyinit.md index eb932bc77431..aaa91ba43837 100644 --- a/docs/platformdev_chibios_earlyinit.md +++ b/docs/platformdev_chibios_earlyinit.md @@ -17,7 +17,6 @@ As such, if you wish to override this API consider limiting use to writing to lo | `config.h` override | Description | Default | |-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| | `#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP` | Whether or not bootloader is to be executed during the early initialisation code of QMK. | `FALSE` | -| `#define STM32_BOOTLOADER_ADDRESS` | Relevant for single-bank STM32 MCUs, signifies the memory address to jump to bootloader. Consult [AN2606](https://www.st.com/content/st_com/en/search.html#q=an2606-t=resources-page=1) for the _System Memory_ address for your MCU. This value should be of the format `0x11111111`. | `` | | `#define STM32_BOOTLOADER_DUAL_BANK` | Relevant for dual-bank STM32 MCUs, signifies that a GPIO is to be toggled in order to enter bootloader mode. | `FALSE` | | `#define STM32_BOOTLOADER_DUAL_BANK_GPIO` | Relevant for dual-bank STM32 MCUs, the pin to toggle when attempting to enter bootloader mode, e.g. `B8` | `` | | `#define STM32_BOOTLOADER_DUAL_BANK_POLARITY` | Relevant for dual-bank STM32 MCUs, the value to set the pin to in order to trigger charging of the RC circuit. e.g. `0` or `1`. | `0` | diff --git a/docs/porting_your_keyboard_to_qmk.md b/docs/porting_your_keyboard_to_qmk.md new file mode 100644 index 000000000000..484d079ea61b --- /dev/null +++ b/docs/porting_your_keyboard_to_qmk.md @@ -0,0 +1,163 @@ +# Adding Your Keyboard to QMK + +This page describes the support for [Compatible Microcontrollers](compatible_microcontrollers.md) in QMK. + +If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_guidelines.md) to get a sense of how keyboards fit into QMK. + + +QMK has a number of features to simplify working with keyboards. For most, you don't have to write a single line of code. To get started, run `qmk new-keyboard`: + +``` +$ qmk new-keyboard +Ψ Generating a new QMK keyboard directory + +Name Your Keyboard Project +For more infomation, see: +https://docs.qmk.fm/#/hardware_keyboard_guidelines?id=naming-your-keyboardproject + +keyboard Name? mycoolkeeb + +Attribution +Used for maintainer, copyright, etc + +Your GitHub Username? [jsmith] + +More Attribution +Used for maintainer, copyright, etc + +Your Real Name? [John Smith] + +Pick Base Layout +As a starting point, one of the common layouts can be used to bootstrap the process + +Default Layout? + 1. 60_ansi +... + 50. tkl_iso + 51. none of the above +Please enter your choice: [51] + +What Powers Your Project +For more infomation, see: +https://docs.qmk.fm/#/compatible_microcontrollers + +MCU? + 1. atmega32u4 +... + 22. STM32F303 +Please enter your choice: [12] +Ψ Created a new keyboard called mycoolkeeb. +Ψ To start working on things, `cd` into keyboards/mycoolkeeb, +Ψ or open the directory in your preferred text editor. +Ψ And build with qmk compile -kb mycoolkeeb -km default. +``` + +This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard. + +## `readme.md` + +This is where you'll describe your keyboard. Please follow the [Keyboard Readme Template](documentation_templates.md#keyboard-readmemd-template) when writing your `readme.md`. You're encouraged to place an image at the top of your `readme.md`, please use an external service such as [Imgur](https://imgur.com) to host the images. + +## `info.json` + +The `info.json` file is where you configure the hardware and feature set for your keyboard. There are a lot of options that can be placed in that file, too many to list here. For a complete overview of available options see the [Data Driven Configuration Options](reference_info_json.md) page. + +### Hardware Configuration + +At the top of the `info.json` you'll find USB related settings. These control how your keyboard appears to the Operating System. If you don't have a good reason to change you should leave the `usb.vid` as `0xFEED`. For the `usb.pid` you should pick a number that is not yet in use. + +Do change the `manufacturer` and `keyboard_name` lines to accurately reflect your keyboard. + +```json + "keyboard_name": "my_awesome_keyboard", + "maintainer": "You", + "usb": { + "vid": "0xFEED", + "pid": "0x0000", + "device_version": "1.0.0" + }, +``` + +?> Windows and macOS will display the `manufacturer` and `keyboard_name` in the list of USB devices. `lsusb` on Linux instead prefers the values in the list maintained by the [USB ID Repository](http://www.linux-usb.org/usb-ids.html). By default, it will only use `manufacturer` and `keyboard_name` if the list does not contain that `usb.vid` / `usb.pid`. `sudo lsusb -v` will show the values reported by the device, and they are also present in kernel logs after plugging it in. + + +### Matrix Configuration + +The next section of the `info` file deals with your keyboard's matrix. The first thing you should define is which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins: + +```json + "matrix_pins": { + "cols": ["C1", "C2", "C3", "C4"], + "rows": ["D1", "D2", "D3", "D4"] + }, +``` + +The size of the `matrix_pins.cols` and `matrix_pins.rows` arrays infer the size of the matrix (previously `MATRIX_ROWS` and `MATRIX_COLS`). + +Finally, you can specify the direction your diodes point. This can be `COL2ROW` or `ROW2COL`. + +```json + "diode_direction": "ROW2COL", +``` + +#### Direct Pin Matrix +To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `matrix_pins.direct`. The mapping defines the pins of each switch in rows and columns, from left to right. The size of the `matrix_pins.direct` array infers the size of the matrix. Use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `diode_direction`, `matrix_pins.cols` and `matrix_pins.rows`. + +```json + "matrix_pins": { + "direct": [ + ["F1", "E6", "B0", "B2", "B3" ], + ["F5", "F0", "B1", "B7", "D2" ], + ["F6", "F7", "C7", "D5", "D3" ], + ["B5", "C6", "B6", "NO_PIN", "NO_PIN"] + ] + }, +``` + +### Layout macros + +Next is configuring Layout Macro(s). These define the physical arrangement of keys, and its position within the matrix that a switch are connected to. This allows you to have a physical arrangement of keys that differs from the wiring matrix. + +```json + "layouts": { + "LAYOUT_ortho_4x4": { + "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": [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": [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": [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 } + ] + } + } + +``` + +In the above example, + +* `LAYOUT_ortho_4x4` defines the name of the layout macro + * It must conform to [hardware_keyboard_guidelines.md#ltkeyboard_namehgt] +* `"matrix": [0, 0]` defines the electrical position + +## Additional Configuration + +There are a lot of features that can be turned on or off, configured or tuned. Some of these have yet to be migrated over to [Data Driven Configuration](data_driven_config.md). The following sections cover the process for when an `info.json` option is unavailable. + +### Configuration Options + +For available options for `config.h`, you should see the [Config Options](config_options.md) page for more details. + +### Build Options + +For available options for `rules.mk`, see the [Config Options](config_options.md#feature-options) page for a detailed list and description. diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index 7ebad2c1ee17..8e29e05886c0 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -8,8 +8,8 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are ## QMK Keycodes :id=qmk-keycodes -|Key |Aliases |Description | -|--------------|---------|-------------------------------------------------------| -|`RESET` | |Put the keyboard into bootloader mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`EEPROM_RESET`|`EEP_RST`|Reinitializes the keyboard's EEPROM (persistent memory)| +|Key |Aliases |Description | +|-----------------|---------|-------------------------------------------------------| +|`QK_BOOTLOADER` |`QK_BOOT`|Put the keyboard into bootloader mode for flashing | +|`QK_DEBUG_TOGGLE`|`DB_TOGG`|Toggle debug mode | +|`QK_CLEAR_EEPROM`|`EE_CLR` |Reinitializes the keyboard's EEPROM (persistent memory)| diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index b2e6cae28e48..3cc807c179d9 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -172,7 +172,7 @@ The following animations can be enabled: ### USB -Every USB keyboard needs to have its USB parmaters defined. At a minimum you need to set vid, pid, and device version. +Every USB keyboard needs to have its USB parameters defined. At a minimum you need to set the Vendor ID, Product ID, and device version. Example: @@ -181,7 +181,9 @@ Example: "usb": { "vid": "0xC1ED", "pid": "0x23B0", - "device_ver": "0x0001" + "device_version": "1.0.0" } } ``` + +The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood. diff --git a/docs/squeezing_avr.md b/docs/squeezing_avr.md index e4d8d7c1465c..4a147e0c6641 100644 --- a/docs/squeezing_avr.md +++ b/docs/squeezing_avr.md @@ -147,6 +147,7 @@ For RGB Matrix, these need to be explicitly enabled as well. To disable any that #undef ENABLE_RGB_MATRIX_HUE_PENDULUM #undef ENABLE_RGB_MATRIX_HUE_WAVE #undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL +#undef ENABLE_RGB_MATRIX_PIXEL_FLOW #undef ENABLE_RGB_MATRIX_PIXEL_RAIN #undef ENABLE_RGB_MATRIX_TYPING_HEATMAP diff --git a/drivers/bluetooth/adafruit_ble.cpp b/drivers/bluetooth/bluefruit_le.cpp similarity index 90% rename from drivers/bluetooth/adafruit_ble.cpp rename to drivers/bluetooth/bluefruit_le.cpp index 34a780e9a5cc..19310767cfc3 100644 --- a/drivers/bluetooth/adafruit_ble.cpp +++ b/drivers/bluetooth/bluefruit_le.cpp @@ -1,4 +1,4 @@ -#include "adafruit_ble.h" +#include "bluefruit_le.h" #include #include @@ -16,20 +16,20 @@ // These are the pin assignments for the 32u4 boards. // You may define them to something else in your config.h // if yours is wired up differently. -#ifndef ADAFRUIT_BLE_RST_PIN -# define ADAFRUIT_BLE_RST_PIN D4 +#ifndef BLUEFRUIT_LE_RST_PIN +# define BLUEFRUIT_LE_RST_PIN D4 #endif -#ifndef ADAFRUIT_BLE_CS_PIN -# define ADAFRUIT_BLE_CS_PIN B4 +#ifndef BLUEFRUIT_LE_CS_PIN +# define BLUEFRUIT_LE_CS_PIN B4 #endif -#ifndef ADAFRUIT_BLE_IRQ_PIN -# define ADAFRUIT_BLE_IRQ_PIN E6 +#ifndef BLUEFRUIT_LE_IRQ_PIN +# define BLUEFRUIT_LE_IRQ_PIN E6 #endif -#ifndef ADAFRUIT_BLE_SCK_DIVISOR -# define ADAFRUIT_BLE_SCK_DIVISOR 2 // 4MHz SCK/8MHz CPU, calculated for Feather 32U4 BLE +#ifndef BLUEFRUIT_LE_SCK_DIVISOR +# define BLUEFRUIT_LE_SCK_DIVISOR 2 // 4MHz SCK/8MHz CPU, calculated for Feather 32U4 BLE #endif #define SAMPLE_BATTERY @@ -77,10 +77,10 @@ struct sdep_msg { // information here. enum queue_type { - QTKeyReport, // 1-byte modifier + 6-byte key report - QTConsumer, // 16-bit key code + QTKeyReport, // 1-byte modifier + 6-byte key report + QTConsumer, // 16-bit key code #ifdef MOUSE_ENABLE - QTMouseMove, // 4-byte mouse report + QTMouseMove, // 4-byte mouse report #endif }; @@ -115,8 +115,8 @@ enum sdep_type { SdepResponse = 0x20, SdepAlert = 0x40, SdepError = 0x80, - SdepSlaveNotReady = 0xFE, // Try again later - SdepSlaveOverflow = 0xFF, // You read more data than is available + SdepSlaveNotReady = 0xFE, // Try again later + SdepSlaveOverflow = 0xFF, // You read more data than is available }; enum ble_cmd { @@ -143,7 +143,7 @@ static bool at_command_P(const char *cmd, char *resp, uint16_t resplen, bool ver // Send a single SDEP packet static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) { - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); uint16_t timerStart = timer_read(); bool success = false; bool ready = false; @@ -157,7 +157,7 @@ static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) { // Release it and let it initialize spi_stop(); wait_us(SdepBackOff); - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); } while (timer_elapsed(timerStart) < timeout); if (ready) { @@ -190,7 +190,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { bool ready = false; do { - ready = readPin(ADAFRUIT_BLE_IRQ_PIN); + ready = readPin(BLUEFRUIT_LE_IRQ_PIN); if (ready) { break; } @@ -198,7 +198,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { } while (timer_elapsed(timerStart) < timeout); if (ready) { - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); do { // Read the command type, waiting for the data to be ready @@ -207,7 +207,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { // Release it and let it initialize spi_stop(); wait_us(SdepBackOff); - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); continue; } @@ -233,7 +233,7 @@ static void resp_buf_read_one(bool greedy) { return; } - if (readPin(ADAFRUIT_BLE_IRQ_PIN)) { + if (readPin(BLUEFRUIT_LE_IRQ_PIN)) { struct sdep_msg msg; again: @@ -244,7 +244,7 @@ static void resp_buf_read_one(bool greedy) { dprintf("recv latency %dms\n", TIMER_DIFF_16(timer_read(), last_send)); } - if (greedy && resp_buf.peek(last_send) && readPin(ADAFRUIT_BLE_IRQ_PIN)) { + if (greedy && resp_buf.peek(last_send) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { goto again; } } @@ -295,24 +295,26 @@ static bool ble_init(void) { state.configured = false; state.is_connected = false; - setPinInput(ADAFRUIT_BLE_IRQ_PIN); + setPinInput(BLUEFRUIT_LE_IRQ_PIN); spi_init(); // Perform a hardware reset - setPinOutput(ADAFRUIT_BLE_RST_PIN); - writePinHigh(ADAFRUIT_BLE_RST_PIN); - writePinLow(ADAFRUIT_BLE_RST_PIN); + setPinOutput(BLUEFRUIT_LE_RST_PIN); + writePinHigh(BLUEFRUIT_LE_RST_PIN); + writePinLow(BLUEFRUIT_LE_RST_PIN); wait_ms(10); - writePinHigh(ADAFRUIT_BLE_RST_PIN); + writePinHigh(BLUEFRUIT_LE_RST_PIN); - wait_ms(1000); // Give it a second to initialize + wait_ms(1000); // Give it a second to initialize state.initialized = true; return state.initialized; } -static inline uint8_t min(uint8_t a, uint8_t b) { return a < b ? a : b; } +static inline uint8_t min(uint8_t a, uint8_t b) { + return a < b ? a : b; +} static bool read_response(char *resp, uint16_t resplen, bool verbose) { char *dest = resp; @@ -424,9 +426,11 @@ bool at_command_P(const char *cmd, char *resp, uint16_t resplen, bool verbose) { return at_command(cmdbuf, resp, resplen, verbose); } -bool adafruit_ble_is_connected(void) { return state.is_connected; } +bool bluefruit_le_is_connected(void) { + return state.is_connected; +} -bool adafruit_ble_enable_keyboard(void) { +bool bluefruit_le_enable_keyboard(void) { char resbuf[128]; if (!state.initialized && !ble_init()) { @@ -498,16 +502,16 @@ static void set_connected(bool connected) { } } -void adafruit_ble_task(void) { +void bluefruit_le_task(void) { char resbuf[48]; - if (!state.configured && !adafruit_ble_enable_keyboard()) { + if (!state.configured && !bluefruit_le_enable_keyboard()) { return; } resp_buf_read_one(true); send_buf_send_one(SdepShortTimeout); - if (resp_buf.empty() && (state.event_flags & UsingEvents) && readPin(ADAFRUIT_BLE_IRQ_PIN)) { + if (resp_buf.empty() && (state.event_flags & UsingEvents) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { // Must be an event update if (at_command_P(PSTR("AT+EVENTSTATUS"), resbuf, sizeof(resbuf))) { uint32_t mask = strtoul(resbuf, NULL, 16); @@ -609,7 +613,7 @@ static bool process_queue_item(struct queue_item *item, uint16_t timeout) { } } -void adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys) { +void bluefruit_le_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys) { struct queue_item item; bool didWait = false; @@ -643,7 +647,7 @@ void adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nk } } -void adafruit_ble_send_consumer_key(uint16_t usage) { +void bluefruit_le_send_consumer_key(uint16_t usage) { struct queue_item item; item.queue_type = QTConsumer; @@ -655,7 +659,7 @@ void adafruit_ble_send_consumer_key(uint16_t usage) { } #ifdef MOUSE_ENABLE -void adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons) { +void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons) { struct queue_item item; item.queue_type = QTMouseMove; @@ -671,9 +675,11 @@ void adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, } #endif -uint32_t adafruit_ble_read_battery_voltage(void) { return state.vbat; } +uint32_t bluefruit_le_read_battery_voltage(void) { + return state.vbat; +} -bool adafruit_ble_set_mode_leds(bool on) { +bool bluefruit_le_set_mode_leds(bool on) { if (!state.configured) { return false; } @@ -689,7 +695,7 @@ bool adafruit_ble_set_mode_leds(bool on) { } // https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/ble-generic#at-plus-blepowerlevel -bool adafruit_ble_set_power_level(int8_t level) { +bool bluefruit_le_set_power_level(int8_t level) { char cmd[46]; if (!state.configured) { return false; diff --git a/drivers/bluetooth/adafruit_ble.h b/drivers/bluetooth/bluefruit_le.h similarity index 70% rename from drivers/bluetooth/adafruit_ble.h rename to drivers/bluetooth/bluefruit_le.h index b43e0771d996..de301c6167a2 100644 --- a/drivers/bluetooth/adafruit_ble.h +++ b/drivers/bluetooth/bluefruit_le.h @@ -16,43 +16,43 @@ extern "C" { #endif /* Instruct the module to enable HID keyboard support and reset */ -extern bool adafruit_ble_enable_keyboard(void); +extern bool bluefruit_le_enable_keyboard(void); /* Query to see if the BLE module is connected */ -extern bool adafruit_ble_query_is_connected(void); +extern bool bluefruit_le_query_is_connected(void); /* Returns true if we believe that the BLE module is connected. * This uses our cached understanding that is maintained by * calling ble_task() periodically. */ -extern bool adafruit_ble_is_connected(void); +extern bool bluefruit_le_is_connected(void); /* Call this periodically to process BLE-originated things */ -extern void adafruit_ble_task(void); +extern void bluefruit_le_task(void); /* Generates keypress events for a set of keys. * The hid modifier mask specifies the state of the modifier keys for * this set of keys. * Also sends a key release indicator, so that the keys do not remain * held down. */ -extern void adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys); +extern void bluefruit_le_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys); /* Send a consumer usage. * (milliseconds) */ -extern void adafruit_ble_send_consumer_key(uint16_t usage); +extern void bluefruit_le_send_consumer_key(uint16_t usage); #ifdef MOUSE_ENABLE /* Send a mouse/wheel movement report. * The parameters are signed and indicate positive or negative direction * change. */ -extern void adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons); +extern void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons); #endif /* Compute battery voltage by reading an analog pin. * Returns the integer number of millivolts */ -extern uint32_t adafruit_ble_read_battery_voltage(void); +extern uint32_t bluefruit_le_read_battery_voltage(void); -extern bool adafruit_ble_set_mode_leds(bool on); -extern bool adafruit_ble_set_power_level(int8_t level); +extern bool bluefruit_le_set_mode_leds(bool on); +extern bool bluefruit_le_set_power_level(int8_t level); #ifdef __cplusplus } diff --git a/drivers/bluetooth/outputselect.c b/drivers/bluetooth/outputselect.c index f758c652809b..b986ba274e9d 100644 --- a/drivers/bluetooth/outputselect.c +++ b/drivers/bluetooth/outputselect.c @@ -13,13 +13,10 @@ along with this program. If not, see . */ #include "outputselect.h" +#include "usb_util.h" -#if defined(PROTOCOL_LUFA) -# include "lufa.h" -#endif - -#ifdef MODULE_ADAFRUIT_BLE -# include "adafruit_ble.h" +#ifdef BLUETOOTH_BLUEFRUIT_LE +# include "bluefruit_le.h" #endif uint8_t desired_output = OUTPUT_DEFAULT; @@ -39,29 +36,23 @@ void set_output(uint8_t output) { */ __attribute__((weak)) void set_output_user(uint8_t output) {} -static bool is_usb_configured(void) { -#if defined(PROTOCOL_LUFA) - return USB_DeviceState == DEVICE_STATE_Configured; -#endif -} - /** \brief Auto Detect Output * * FIXME: Needs doc */ uint8_t auto_detect_output(void) { - if (is_usb_configured()) { + if (usb_connected_state()) { return OUTPUT_USB; } -#ifdef MODULE_ADAFRUIT_BLE - if (adafruit_ble_is_connected()) { +#ifdef BLUETOOTH_BLUEFRUIT_LE + if (bluefruit_le_is_connected()) { return OUTPUT_BLUETOOTH; } #endif #ifdef BLUETOOTH_ENABLE - return OUTPUT_BLUETOOTH; // should check if BT is connected here + return OUTPUT_BLUETOOTH; // should check if BT is connected here #endif return OUTPUT_NONE; diff --git a/drivers/bluetooth/rn42.c b/drivers/bluetooth/rn42.c new file mode 100644 index 000000000000..5d497cda2044 --- /dev/null +++ b/drivers/bluetooth/rn42.c @@ -0,0 +1,101 @@ +/* Copyright 2021 + * + * 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 "report.h" +#include "uart.h" + +#ifndef RN42_BAUD_RATE +# define RN42_BAUD_RATE 115200 +#endif + +// https://cdn.sparkfun.com/datasheets/Wireless/Bluetooth/bluetooth_cr_UG-v1.0r.pdf#G7.663734 +static inline uint16_t rn42_consumer_usage_to_bitmap(uint16_t usage) { + switch (usage) { + case AC_HOME: + return 0x0001; + case AL_EMAIL: + return 0x0002; + case AC_SEARCH: + return 0x0004; + case AL_KEYBOARD_LAYOUT: + return 0x0008; + case AUDIO_VOL_UP: + return 0x0010; + case AUDIO_VOL_DOWN: + return 0x0020; + case AUDIO_MUTE: + return 0x0040; + case TRANSPORT_PLAY_PAUSE: + return 0x0080; + case TRANSPORT_NEXT_TRACK: + return 0x0100; + case TRANSPORT_PREV_TRACK: + return 0x0200; + case TRANSPORT_STOP: + return 0x0400; + case TRANSPORT_EJECT: + return 0x0800; + case TRANSPORT_FAST_FORWARD: + return 0x1000; + case TRANSPORT_REWIND: + return 0x2000; + case TRANSPORT_STOP_EJECT: + return 0x4000; + case AL_LOCAL_BROWSER: + return 0x8000; + default: + return 0; + } +} + +void rn42_init(void) { + uart_init(RN42_BAUD_RATE); +} + +void rn42_send_keyboard(report_keyboard_t *report) { + uart_write(0xFD); + uart_write(0x09); + uart_write(0x01); + uart_write(report->mods); + uart_write(0x00); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + uart_write(report->keys[i]); + } +} + +void rn42_send_mouse(report_mouse_t *report) { + uart_write(0xFD); + uart_write(0x00); + uart_write(0x03); + uart_write(report->buttons); + uart_write(report->x); + uart_write(report->y); + uart_write(report->v); // should try sending the wheel v here + uart_write(report->h); // should try sending the wheel h here + uart_write(0x00); +} + +void rn42_send_consumer(uint16_t data) { + static uint16_t last_data = 0; + if (data == last_data) return; + last_data = data; + uint16_t bitmap = rn42_consumer_usage_to_bitmap(data); + uart_write(0xFD); + uart_write(0x03); + uart_write(0x03); + uart_write(bitmap & 0xFF); + uart_write((bitmap >> 8) & 0xFF); +} diff --git a/drivers/bluetooth/rn42.h b/drivers/bluetooth/rn42.h new file mode 100644 index 000000000000..47477591112d --- /dev/null +++ b/drivers/bluetooth/rn42.h @@ -0,0 +1,25 @@ +/* Copyright 2021 + * + * 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 "report.h" + +void rn42_init(void); + +void rn42_send_keyboard(report_keyboard_t *report); + +void rn42_send_mouse(report_mouse_t *report); + +void rn42_send_consumer(uint16_t data); diff --git a/drivers/eeprom/eeprom_driver.c b/drivers/eeprom/eeprom_driver.c index 6ce47faf7dab..885cf2198115 100644 --- a/drivers/eeprom/eeprom_driver.c +++ b/drivers/eeprom/eeprom_driver.c @@ -37,11 +37,17 @@ uint32_t eeprom_read_dword(const uint32_t *addr) { return ret; } -void eeprom_write_byte(uint8_t *addr, uint8_t value) { eeprom_write_block(&value, addr, 1); } +void eeprom_write_byte(uint8_t *addr, uint8_t value) { + eeprom_write_block(&value, addr, 1); +} -void eeprom_write_word(uint16_t *addr, uint16_t value) { eeprom_write_block(&value, addr, 2); } +void eeprom_write_word(uint16_t *addr, uint16_t value) { + eeprom_write_block(&value, addr, 2); +} -void eeprom_write_dword(uint32_t *addr, uint32_t value) { eeprom_write_block(&value, addr, 4); } +void eeprom_write_dword(uint32_t *addr, uint32_t value) { + eeprom_write_block(&value, addr, 4); +} void eeprom_update_block(const void *buf, void *addr, size_t len) { uint8_t read_buf[len]; diff --git a/drivers/eeprom/eeprom_i2c.c b/drivers/eeprom/eeprom_i2c.c index 8e80ff544fc6..a74a0104157c 100644 --- a/drivers/eeprom/eeprom_i2c.c +++ b/drivers/eeprom/eeprom_i2c.c @@ -43,7 +43,7 @@ #if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT) # include "timer.h" # include "debug.h" -#endif // DEBUG_EEPROM_OUTPUT +#endif // DEBUG_EEPROM_OUTPUT static inline void fill_target_address(uint8_t *buffer, const void *addr) { uintptr_t p = (uintptr_t)addr; @@ -91,7 +91,7 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) { dprintf(" %02X", (int)(((uint8_t *)buf)[i])); } dprintf("\n"); -#endif // DEBUG_EEPROM_OUTPUT +#endif // DEBUG_EEPROM_OUTPUT } void eeprom_write_block(const void *buf, void *addr, size_t len) { @@ -122,7 +122,7 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { dprintf(" %02X", (int)(read_buf[i])); } dprintf("\n"); -#endif // DEBUG_EEPROM_OUTPUT +#endif // DEBUG_EEPROM_OUTPUT i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE + write_length, 100); wait_ms(EXTERNAL_EEPROM_WRITE_TIME); diff --git a/drivers/eeprom/eeprom_spi.c b/drivers/eeprom/eeprom_spi.c index e27309085437..25955498c46a 100644 --- a/drivers/eeprom/eeprom_spi.c +++ b/drivers/eeprom/eeprom_spi.c @@ -52,7 +52,9 @@ # define EXTERNAL_EEPROM_SPI_TIMEOUT 100 #endif -static bool spi_eeprom_start(void) { return spi_start(EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); } +static bool spi_eeprom_start(void) { + return spi_start(EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); +} static spi_status_t spi_eeprom_wait_while_busy(int timeout) { uint32_t deadline = timer_read32() + timeout; @@ -80,7 +82,9 @@ static void spi_eeprom_transmit_address(uintptr_t addr) { //---------------------------------------------------------------------------------------------------------------------- -void eeprom_driver_init(void) { spi_init(); } +void eeprom_driver_init(void) { + spi_init(); +} void eeprom_driver_erase(void) { #if defined(CONSOLE_ENABLE) && defined(DEBUG_EEPROM_OUTPUT) @@ -135,7 +139,7 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) { dprintf(" %02X", (int)(((uint8_t *)buf)[i])); } dprintf("\n"); -#endif // DEBUG_EEPROM_OUTPUT +#endif // DEBUG_EEPROM_OUTPUT spi_stop(); } @@ -192,7 +196,7 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { dprintf(" %02X", (int)(uint8_t)(read_buf[i])); } dprintf("\n"); -#endif // DEBUG_EEPROM_OUTPUT +#endif // DEBUG_EEPROM_OUTPUT spi_write(CMD_WRITE); spi_eeprom_transmit_address(target_addr); diff --git a/drivers/eeprom/eeprom_transient.c b/drivers/eeprom/eeprom_transient.c index b4c78c6f400a..9dc4289c271b 100644 --- a/drivers/eeprom/eeprom_transient.c +++ b/drivers/eeprom/eeprom_transient.c @@ -30,9 +30,13 @@ size_t clamp_length(intptr_t offset, size_t len) { return len; } -void eeprom_driver_init(void) { eeprom_driver_erase(); } +void eeprom_driver_init(void) { + eeprom_driver_erase(); +} -void eeprom_driver_erase(void) { memset(transientBuffer, 0x00, TRANSIENT_EEPROM_SIZE); } +void eeprom_driver_erase(void) { + memset(transientBuffer, 0x00, TRANSIENT_EEPROM_SIZE); +} void eeprom_read_block(void *buf, const void *addr, size_t len) { intptr_t offset = (intptr_t)addr; diff --git a/drivers/eeprom/eeprom_transient.h b/drivers/eeprom/eeprom_transient.h index d06189b246df..687b8619fe5e 100644 --- a/drivers/eeprom/eeprom_transient.h +++ b/drivers/eeprom/eeprom_transient.h @@ -21,5 +21,5 @@ */ #ifndef TRANSIENT_EEPROM_SIZE # include "eeconfig.h" -# define TRANSIENT_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO +# define TRANSIENT_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO #endif diff --git a/drivers/flash/flash_spi.c b/drivers/flash/flash_spi.c new file mode 100644 index 000000000000..f4cbf6515998 --- /dev/null +++ b/drivers/flash/flash_spi.c @@ -0,0 +1,376 @@ +/* +Copyright (C) 2021 Westberry Technology (ChangZhou) Corp., Ltd + +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 + +#include "util.h" +#include "wait.h" +#include "debug.h" +#include "timer.h" +#include "flash_spi.h" +#include "spi_master.h" + +/* + The time-out time of spi flash transmission. +*/ +#ifndef EXTERNAL_FLASH_SPI_TIMEOUT +# define EXTERNAL_FLASH_SPI_TIMEOUT 1000 +#endif + +/* ID comands */ +#define FLASH_CMD_RDID 0x9F /* RDID (Read Identification) */ +#define FLASH_CMD_RES 0xAB /* RES (Read Electronic ID) */ +#define FLASH_CMD_REMS 0x90 /* REMS (Read Electronic & Device ID) */ + +/* register comands */ +#define FLASH_CMD_WRSR 0x01 /* WRSR (Write Status register) */ +#define FLASH_CMD_RDSR 0x05 /* RDSR (Read Status register) */ + +/* READ comands */ +#define FLASH_CMD_READ 0x03 /* READ (1 x I/O) */ +#define FLASH_CMD_FASTREAD 0x0B /* FAST READ (Fast read data) */ +#define FLASH_CMD_DREAD 0x3B /* DREAD (1In/2 Out fast read) */ + +/* Program comands */ +#define FLASH_CMD_WREN 0x06 /* WREN (Write Enable) */ +#define FLASH_CMD_WRDI 0x04 /* WRDI (Write Disable) */ +#define FLASH_CMD_PP 0x02 /* PP (page program) */ + +/* Erase comands */ +#define FLASH_CMD_SE 0x20 /* SE (Sector Erase) */ +#define FLASH_CMD_BE 0xD8 /* BE (Block Erase) */ +#define FLASH_CMD_CE 0x60 /* CE (Chip Erase) hex code: 60 or C7 */ + +/* Mode setting comands */ +#define FLASH_CMD_DP 0xB9 /* DP (Deep Power Down) */ +#define FLASH_CMD_RDP 0xAB /* RDP (Release form Deep Power Down) */ + +/* Status register */ +#define FLASH_FLAG_WIP 0x01 /* Write in progress bit */ +#define FLASH_FLAG_WEL 0x02 /* Write enable latch bit */ + +// #define DEBUG_FLASH_SPI_OUTPUT + +static bool spi_flash_start(void) { + return spi_start(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN, EXTERNAL_FLASH_SPI_LSBFIRST, EXTERNAL_FLASH_SPI_MODE, EXTERNAL_FLASH_SPI_CLOCK_DIVISOR); +} + +static flash_status_t spi_flash_wait_while_busy(void) { + uint32_t deadline = timer_read32() + EXTERNAL_FLASH_SPI_TIMEOUT; + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t retval; + + do { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash wait while busy]\n"); + return FLASH_STATUS_ERROR; + } + + spi_write(FLASH_CMD_RDSR); + + retval = (uint8_t)spi_read(); + + spi_stop(); + + if (timer_read32() >= deadline) { + response = FLASH_STATUS_TIMEOUT; + break; + } + } while (retval & FLASH_FLAG_WIP); + + return response; +} + +static flash_status_t spi_flash_write_enable(void) { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash write enable]\n"); + return FLASH_STATUS_ERROR; + } + + spi_write(FLASH_CMD_WREN); + + spi_stop(); + + return FLASH_STATUS_SUCCESS; +} + +static flash_status_t spi_flash_write_disable(void) { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash write disable]\n"); + return FLASH_STATUS_ERROR; + } + + spi_write(FLASH_CMD_WRDI); + + spi_stop(); + + return FLASH_STATUS_SUCCESS; +} + +/* This function is used for read transfer, write transfer and erase transfer. */ +static flash_status_t spi_flash_transaction(uint8_t cmd, uint32_t addr, uint8_t *data, size_t len) { + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t buffer[EXTERNAL_FLASH_ADDRESS_SIZE + 1]; + + buffer[0] = cmd; + for (int i = 0; i < EXTERNAL_FLASH_ADDRESS_SIZE; ++i) { + buffer[EXTERNAL_FLASH_ADDRESS_SIZE - i] = addr & 0xFF; + addr >>= 8; + } + + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash transmit]\n"); + return FLASH_STATUS_ERROR; + } + + response = spi_transmit(buffer, sizeof(buffer)); + + if ((!response) && (data != NULL)) { + switch (cmd) { + case FLASH_CMD_READ: + response = spi_receive(data, len); + break; + case FLASH_CMD_PP: + response = spi_transmit(data, len); + break; + default: + response = FLASH_STATUS_ERROR; + break; + } + } + + spi_stop(); + + return response; +} + +void flash_init(void) { + spi_init(); +} + +flash_status_t flash_erase_chip(void) { + flash_status_t response = FLASH_STATUS_SUCCESS; + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase chip]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash erase chip]\n"); + return response; + } + + /* Erase Chip. */ + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash erase chip]\n"); + return FLASH_STATUS_ERROR; + } + spi_write(FLASH_CMD_CE); + spi_stop(); + + /* Wait for the write-in-progress bit to be cleared.*/ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase chip]\n"); + return response; + } + + return response; +} + +flash_status_t flash_erase_sector(uint32_t addr) { + flash_status_t response = FLASH_STATUS_SUCCESS; + + /* Check that the address exceeds the limit. */ + if ((addr + (EXTERNAL_FLASH_SECTOR_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_SECTOR_SIZE)) != 0)) { + dprintf("Flash erase sector address over limit! [addr:0x%x]\n", (uint32_t)addr); + return FLASH_STATUS_ERROR; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase sector]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash erase sector]\n"); + return response; + } + + /* Erase Sector. */ + response = spi_flash_transaction(FLASH_CMD_SE, addr, NULL, 0); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to erase sector! [spi flash erase sector]\n"); + return response; + } + + /* Wait for the write-in-progress bit to be cleared.*/ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase sector]\n"); + return response; + } + + return response; +} + +flash_status_t flash_erase_block(uint32_t addr) { + flash_status_t response = FLASH_STATUS_SUCCESS; + + /* Check that the address exceeds the limit. */ + if ((addr + (EXTERNAL_FLASH_BLOCK_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_BLOCK_SIZE)) != 0)) { + dprintf("Flash erase block address over limit! [addr:0x%x]\n", (uint32_t)addr); + return FLASH_STATUS_ERROR; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase block]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash erase block]\n"); + return response; + } + + /* Erase Block. */ + response = spi_flash_transaction(FLASH_CMD_BE, addr, NULL, 0); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to erase block! [spi flash erase block]\n"); + return response; + } + + /* Wait for the write-in-progress bit to be cleared.*/ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase block]\n"); + return response; + } + + return response; +} + +flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t * read_buf = (uint8_t *)buf; + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash read block]\n"); + memset(read_buf, 0, len); + return response; + } + + /* Perform read. */ + response = spi_flash_transaction(FLASH_CMD_READ, addr, read_buf, len); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to read block! [spi flash read block]\n"); + memset(read_buf, 0, len); + return response; + } + +#if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) + dprintf("[SPI FLASH R] 0x%08lX: ", addr); + for (size_t i = 0; i < len; ++i) { + dprintf(" %02X", (int)(((uint8_t *)read_buf)[i])); + } + dprintf("\n"); +#endif // DEBUG_FLASH_SPI_OUTPUT + + return response; +} + +flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len) { + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t * write_buf = (uint8_t *)buf; + + while (len > 0) { + uint32_t page_offset = addr % EXTERNAL_FLASH_PAGE_SIZE; + size_t write_length = EXTERNAL_FLASH_PAGE_SIZE - page_offset; + if (write_length > len) { + write_length = len; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash write block]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash write block]\n"); + return response; + } + +#if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) + dprintf("[SPI FLASH W] 0x%08lX: ", addr); + for (size_t i = 0; i < write_length; i++) { + dprintf(" %02X", (int)(uint8_t)(write_buf[i])); + } + dprintf("\n"); +#endif // DEBUG_FLASH_SPI_OUTPUT + + /* Perform the write. */ + response = spi_flash_transaction(FLASH_CMD_PP, addr, write_buf, write_length); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write block! [spi flash write block]\n"); + return response; + } + + write_buf += write_length; + addr += write_length; + len -= write_length; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash write block]\n"); + return response; + } + + /* Disable writes. */ + response = spi_flash_write_disable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-disable! [spi flash write block]\n"); + return response; + } + + return response; +} diff --git a/drivers/flash/flash_spi.h b/drivers/flash/flash_spi.h new file mode 100644 index 000000000000..abe95e955e56 --- /dev/null +++ b/drivers/flash/flash_spi.h @@ -0,0 +1,136 @@ +/* +Copyright (C) 2021 Westberry Technology (ChangZhou) Corp., Ltd + +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 + +/* All the following default configurations are based on MX25L4006E Nor FLASH. */ + +/* + The slave select pin of the FLASH. + This needs to be a normal GPIO pin_t value, such as B14. +*/ +#ifndef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN +# error "No chip select pin defined -- missing EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN" +#endif + +/* + The clock divisor for SPI to ensure that the MCU is within the + specifications of the FLASH chip. Generally this will be PCLK divided by + the intended divisor -- check your clock settings and the datasheet of + your FLASH. +*/ +#ifndef EXTERNAL_FLASH_SPI_CLOCK_DIVISOR +# ifdef __AVR__ +# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 4 +# else +# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 8 +# endif +#endif + +/* + The SPI mode to communicate with the FLASH. +*/ +#ifndef EXTERNAL_FLASH_SPI_MODE +# define EXTERNAL_FLASH_SPI_MODE 0 +#endif + +/* + Whether or not the SPI communication between the MCU and FLASH should be + LSB-first. +*/ +#ifndef EXTERNAL_FLASH_SPI_LSBFIRST +# define EXTERNAL_FLASH_SPI_LSBFIRST false +#endif + +/* + The Flash address size in bytes, as specified in datasheet. +*/ +#ifndef EXTERNAL_FLASH_ADDRESS_SIZE +# define EXTERNAL_FLASH_ADDRESS_SIZE 3 +#endif + +/* + The page size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_PAGE_SIZE +# define EXTERNAL_FLASH_PAGE_SIZE 256 +#endif + +/* + The sector size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_SECTOR_SIZE +# define EXTERNAL_FLASH_SECTOR_SIZE (4 * 1024) +#endif + +/* + The block size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_BLOCK_SIZE +# define EXTERNAL_FLASH_BLOCK_SIZE (64 * 1024) +#endif + +/* + The total size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_SIZE +# define EXTERNAL_FLASH_SIZE (512 * 1024) +#endif + +/* + The block count of the FLASH, calculated by total FLASH size and block size. +*/ +#define EXTERNAL_FLASH_BLOCK_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_BLOCK_SIZE)) + +/* + The sector count of the FLASH, calculated by total FLASH size and sector size. +*/ +#define EXTERNAL_FLASH_SECTOR_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_SECTOR_SIZE)) + +/* + The page count of the FLASH, calculated by total FLASH size and page size. +*/ +#define EXTERNAL_FLASH_PAGE_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_PAGE_SIZE)) + +typedef int16_t flash_status_t; + +#define FLASH_STATUS_SUCCESS (0) +#define FLASH_STATUS_ERROR (-1) +#define FLASH_STATUS_TIMEOUT (-2) +#define FLASH_STATUS_BAD_ADDRESS (-3) + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void flash_init(void); + +flash_status_t flash_erase_chip(void); + +flash_status_t flash_erase_block(uint32_t addr); + +flash_status_t flash_erase_sector(uint32_t addr); + +flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len); + +flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len); + +#ifdef __cplusplus +} +#endif diff --git a/keyboards/viktus/sp111/mcp23018.c b/drivers/gpio/mcp23018.c similarity index 69% rename from keyboards/viktus/sp111/mcp23018.c rename to drivers/gpio/mcp23018.c index f1d8e568d29d..41cbfe087e4e 100644 --- a/keyboards/viktus/sp111/mcp23018.c +++ b/drivers/gpio/mcp23018.c @@ -1,18 +1,6 @@ -/* Copyright 2020 zvecr - * - * 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 . - */ +// Copyright 2022 zvecr +// SPDX-License-Identifier: GPL-2.0-or-later + #include "mcp23018.h" #include "i2c_master.h" #include "wait.h" @@ -22,11 +10,11 @@ #define TIMEOUT 100 enum { - CMD_IODIRA = 0x00, // i/o direction register + CMD_IODIRA = 0x00, // i/o direction register CMD_IODIRB = 0x01, - CMD_GPPUA = 0x0C, // GPIO pull-up resistor register + CMD_GPPUA = 0x0C, // GPIO pull-up resistor register CMD_GPPUB = 0x0D, - CMD_GPIOA = 0x12, // general purpose i/o port register (write modifies OLAT) + CMD_GPIOA = 0x12, // general purpose i/o port register (write modifies OLAT) CMD_GPIOB = 0x13, }; @@ -40,7 +28,7 @@ void mcp23018_init(uint8_t addr) { } } -bool mcp23018_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { +bool mcp23018_set_config(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmdDirection = port ? CMD_IODIRB : CMD_IODIRA; uint8_t cmdPullup = port ? CMD_GPPUB : CMD_GPPUA; @@ -60,7 +48,7 @@ bool mcp23018_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { return true; } -bool mcp23018_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { +bool mcp23018_set_output(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_GPIOB : CMD_GPIOA; @@ -86,7 +74,7 @@ bool mcp23018_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB) { return true; } -bool mcp23018_readPins(uint8_t slave_addr, uint8_t port, uint8_t* out) { +bool mcp23018_readPins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* out) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_GPIOB : CMD_GPIOA; diff --git a/drivers/gpio/mcp23018.h b/drivers/gpio/mcp23018.h new file mode 100644 index 000000000000..e7c2730dd155 --- /dev/null +++ b/drivers/gpio/mcp23018.h @@ -0,0 +1,65 @@ +// Copyright 2022 zvecr +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +/** + * Port ID + */ +typedef enum { + mcp23018_PORTA, + mcp23018_PORTB, +} mcp23018_port_t; + +/** + * Helpers for set_config + */ +enum { + ALL_OUTPUT = 0, + ALL_INPUT = 0xFF, +}; + +/** + * Helpers for set_output + */ +enum { + ALL_LOW = 0, + ALL_HIGH = 0xFF, +}; + +/** + * Init expander and any other dependent drivers + */ +void mcp23018_init(uint8_t slave_addr); + +/** + * Configure input/output to a given port + */ +bool mcp23018_set_config(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf); + +/** + * Write high/low to a given port + */ +bool mcp23018_set_output(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf); + +/** + * Write high/low to both ports sequentially + * + * - slightly faster than multiple set_output + */ +bool mcp23018_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB); + +/** + * Read state of a given port + */ +bool mcp23018_readPins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* ret); + +/** + * Read state of both ports sequentially + * + * - slightly faster than multiple readPins + */ +bool mcp23018_readPins_all(uint8_t slave_addr, uint16_t* ret); diff --git a/drivers/gpio/pca9555.c b/drivers/gpio/pca9555.c index 02b5abbddef2..adcd040083df 100644 --- a/drivers/gpio/pca9555.c +++ b/drivers/gpio/pca9555.c @@ -1,18 +1,6 @@ -/* Copyright 2019 - * - * 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 . - */ +// Copyright 2020 zvecr +// SPDX-License-Identifier: GPL-2.0-or-later + #include "i2c_master.h" #include "pca9555.h" @@ -45,39 +33,59 @@ void pca9555_init(uint8_t slave_addr) { // i2c_stop(); } -void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { +bool pca9555_set_config(uint8_t slave_addr, pca9555_port_t port, uint8_t conf) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_set_config::FAILED\n"); + return false; } + + return true; } -void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { +bool pca9555_set_output(uint8_t slave_addr, pca9555_port_t port, uint8_t conf) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_set_output::FAILED\n"); + return false; } + + return true; } -uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { +bool pca9555_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB) { + uint8_t addr = SLAVE_TO_ADDR(slave_addr); + uint8_t conf[2] = {confA, confB}; + + i2c_status_t ret = i2c_writeReg(addr, CMD_OUTPUT_0, &conf[0], sizeof(conf), TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) { + dprintf("pca9555_set_output::FAILED::%u\n", ret); + return false; + } + + return true; +} + +bool pca9555_readPins(uint8_t slave_addr, pca9555_port_t port, uint8_t* out) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; - uint8_t data = 0; - i2c_status_t ret = i2c_readReg(addr, cmd, &data, sizeof(data), TIMEOUT); + i2c_status_t ret = i2c_readReg(addr, cmd, out, sizeof(uint8_t), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { print("pca9555_readPins::FAILED\n"); + return false; } - return data; + + return true; } -uint16_t pca9555_readAllPins(uint8_t slave_addr) { +bool pca9555_readPins_all(uint8_t slave_addr, uint16_t* out) { uint8_t addr = SLAVE_TO_ADDR(slave_addr); typedef union { @@ -85,11 +93,14 @@ uint16_t pca9555_readAllPins(uint8_t slave_addr) { uint16_t u16; } data16; - data16 data; + data16 data = {.u16 = 0}; i2c_status_t ret = i2c_readReg(addr, CMD_INPUT_0, &data.u8[0], sizeof(data), TIMEOUT); if (ret != I2C_STATUS_SUCCESS) { - print("pca9555_readAllPins::FAILED\n"); + print("pca9555_readPins_all::FAILED\n"); + return false; } - return data.u16; + + *out = data.u16; + return true; } diff --git a/drivers/gpio/pca9555.h b/drivers/gpio/pca9555.h index 3341ec3eb53f..6362ab68aeba 100644 --- a/drivers/gpio/pca9555.h +++ b/drivers/gpio/pca9555.h @@ -1,20 +1,11 @@ -/* Copyright 2019 - * - * 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 . - */ +// Copyright 2020 zvecr +// SPDX-License-Identifier: GPL-2.0-or-later + #pragma once +#include +#include + /* PCA9555 ,----------. @@ -38,20 +29,60 @@ `----------' */ -#define PCA9555_PORT0 0 -#define PCA9555_PORT1 1 +/** + * Port ID + */ +typedef enum { + PCA9555_PORT0, + PCA9555_PORT1, +} pca9555_port_t; -#define ALL_OUTPUT 0 -#define ALL_INPUT 0xFF -#define ALL_LOW 0 -#define ALL_HIGH 0xFF +/** + * Helpers for set_config + */ +enum { + ALL_OUTPUT = 0, + ALL_INPUT = 0xFF, +}; + +/** + * Helpers for set_output + */ +enum { + ALL_LOW = 0, + ALL_HIGH = 0xFF, +}; +/** + * Init expander and any other dependent drivers + */ void pca9555_init(uint8_t slave_addr); -void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); +/** + * Configure input/output to a given port + */ +bool pca9555_set_config(uint8_t slave_addr, pca9555_port_t port, uint8_t conf); -void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); +/** + * Write high/low to a given port + */ +bool pca9555_set_output(uint8_t slave_addr, pca9555_port_t port, uint8_t conf); -uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port); +/** + * Write high/low to both ports sequentially + * + * - slightly faster than multiple set_output + */ +bool pca9555_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB); -uint16_t pca9555_readAllPins(uint8_t slave_addr); +/** + * Read state of a given port + */ +bool pca9555_readPins(uint8_t slave_addr, pca9555_port_t port, uint8_t* ret); + +/** + * Read state of both ports sequentially + * + * - slightly faster than multiple readPins + */ +bool pca9555_readPins_all(uint8_t slave_addr, uint16_t* ret); diff --git a/drivers/gpio/sn74x138.c b/drivers/gpio/sn74x138.c new file mode 100644 index 000000000000..222e5db56cb6 --- /dev/null +++ b/drivers/gpio/sn74x138.c @@ -0,0 +1,65 @@ +/* Copyright 2022 + * + * 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 "sn74x138.h" +#include "gpio.h" + +#define ADDRESS_PIN_COUNT 3 + +#ifndef SN74X138_ADDRESS_PINS +# error sn74x138: no address pins defined! +#endif + +static const pin_t address_pins[ADDRESS_PIN_COUNT] = SN74X138_ADDRESS_PINS; + +void sn74x138_init(void) { + for (int i = 0; i < ADDRESS_PIN_COUNT; i++) { + setPinOutput(address_pins[i]); + writePinLow(address_pins[i]); + } + +#if defined(SN74X138_E1_PIN) + setPinOutput(SN74X138_E1_PIN); + writePinHigh(SN74X138_E1_PIN); +#endif + +#if defined(SN74X138_E2_PIN) + setPinOutput(SN74X138_E2_PIN); + writePinHigh(SN74X138_E2_PIN); +#endif +#if defined(SN74X138_E3_PIN) + setPinOutput(SN74X138_E3_PIN); + writePinLow(SN74X138_E3_PIN); +#endif +} + +void sn74x138_set_enabled(bool enabled) { +#if defined(SN74X138_E1_PIN) + writePin(SN74X138_E1_PIN, !enabled); +#endif +#if defined(SN74X138_E2_PIN) + writePin(SN74X138_E2_PIN, !enabled); +#endif +#if defined(SN74X138_E3_PIN) + writePin(SN74X138_E3_PIN, enabled); +#endif +} + +void sn74x138_set_addr(uint8_t address) { + for (int i = 0; i < ADDRESS_PIN_COUNT; i++) { + writePin(address_pins[i], address & (1 << i)); + } +} diff --git a/drivers/gpio/sn74x138.h b/drivers/gpio/sn74x138.h new file mode 100644 index 000000000000..6f1f20e61819 --- /dev/null +++ b/drivers/gpio/sn74x138.h @@ -0,0 +1,48 @@ +/* Copyright 2022 + * + * 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 +#include + +/** + * Driver for 74x138 3-to-8 decoder/demultiplexer with inverting outputs + * https://assets.nexperia.com/documents/data-sheet/74HC_HCT138.pdf + */ + +/** + * Initialize the address and output enable pins. + */ +void sn74x138_init(void); + +/** + * Set the enabled state. + * + * When enabled is true, pulls the E1 and E2 pins low, and the E3 pin high. + * + * \param enabled The enable state to set. + */ +void sn74x138_set_enabled(bool enabled); + +/** + * Set the output pin address. + * + * The selected output pin will be pulled low, while the remaining output pins will be high. + * + * \param address The address to set, from 0 to 7. + */ +void sn74x138_set_addr(uint8_t address); diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c index 5de2b354c9a7..5a1d2ca0afb3 100644 --- a/drivers/haptic/DRV2605L.c +++ b/drivers/haptic/DRV2605L.c @@ -106,12 +106,14 @@ void DRV_init(void) { void DRV_rtp_init(void) { DRV_write(DRV_GO, 0x00); - DRV_write(DRV_RTP_INPUT, 20); // 20 is the lowest value I've found where haptics can still be felt. + DRV_write(DRV_RTP_INPUT, 20); // 20 is the lowest value I've found where haptics can still be felt. DRV_write(DRV_MODE, 0x05); DRV_write(DRV_GO, 0x01); } -void DRV_amplitude(uint8_t amplitude) { DRV_write(DRV_RTP_INPUT, amplitude); } +void DRV_amplitude(uint8_t amplitude) { + DRV_write(DRV_RTP_INPUT, amplitude); +} void DRV_pulse(uint8_t sequence) { DRV_write(DRV_GO, 0x00); diff --git a/drivers/haptic/solenoid.c b/drivers/haptic/solenoid.c index 7a09940f78cb..14d868bffe81 100644 --- a/drivers/haptic/solenoid.c +++ b/drivers/haptic/solenoid.c @@ -28,13 +28,21 @@ uint8_t solenoid_dwell = SOLENOID_DEFAULT_DWELL; extern haptic_config_t haptic_config; -void solenoid_buzz_on(void) { haptic_set_buzz(1); } +void solenoid_buzz_on(void) { + haptic_set_buzz(1); +} -void solenoid_buzz_off(void) { haptic_set_buzz(0); } +void solenoid_buzz_off(void) { + haptic_set_buzz(0); +} -void solenoid_set_buzz(int buzz) { haptic_set_buzz(buzz); } +void solenoid_set_buzz(int buzz) { + haptic_set_buzz(buzz); +} -void solenoid_set_dwell(uint8_t dwell) { solenoid_dwell = dwell; } +void solenoid_set_dwell(uint8_t dwell) { + solenoid_dwell = dwell; +} void solenoid_stop(void) { SOLENOID_PIN_WRITE_INACTIVE(); @@ -89,4 +97,6 @@ void solenoid_setup(void) { } } -void solenoid_shutdown(void) { SOLENOID_PIN_WRITE_INACTIVE(); } +void solenoid_shutdown(void) { + SOLENOID_PIN_WRITE_INACTIVE(); +} diff --git a/drivers/lcd/st7565.c b/drivers/lcd/st7565.c index 49b13c00f157..47ee02804ba3 100644 --- a/drivers/lcd/st7565.c +++ b/drivers/lcd/st7565.c @@ -39,7 +39,7 @@ along with this program. If not, see . // Addressing Setting Commands #define PAM_SETCOLUMN_LSB 0x00 #define PAM_SETCOLUMN_MSB 0x10 -#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 +#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 // Hardware Configuration Commands #define DISPLAY_START_LINE 0x40 @@ -138,7 +138,9 @@ bool st7565_init(display_rotation_t rotation) { return true; } -__attribute__((weak)) display_rotation_t st7565_init_user(display_rotation_t rotation) { return rotation; } +__attribute__((weak)) display_rotation_t st7565_init_user(display_rotation_t rotation) { + return rotation; +} void st7565_clear(void) { memset(st7565_buffer, 0, sizeof(st7565_buffer)); @@ -212,7 +214,8 @@ void st7565_advance_page(bool clearPageRemainder) { remaining = remaining / ST7565_FONT_WIDTH; // Write empty character until next line - while (remaining--) st7565_write_char(' ', false); + while (remaining--) + st7565_write_char(' ', false); } else { // Next page index out of bounds? if (index + remaining >= ST7565_MATRIX_SIZE) { @@ -263,7 +266,7 @@ void st7565_write_char(const char data, bool invert) { _Static_assert(sizeof(font) >= ((ST7565_FONT_END + 1 - ST7565_FONT_START) * ST7565_FONT_WIDTH), "ST7565_FONT_END references outside array"); // set the reder buffer data - uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index + uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index if (cast_data < ST7565_FONT_START || cast_data > ST7565_FONT_END) { memset(st7565_cursor, 0x00, ST7565_FONT_WIDTH); } else { @@ -389,7 +392,7 @@ void st7565_write_raw_P(const char *data, uint16_t size) { st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << (i / ST7565_BLOCK_SIZE)); } } -#endif // defined(__AVR__) +#endif // defined(__AVR__) bool st7565_on(void) { if (!st7565_initialized) { @@ -429,7 +432,9 @@ bool st7565_off(void) { __attribute__((weak)) void st7565_off_user(void) {} -bool st7565_is_on(void) { return st7565_active; } +bool st7565_is_on(void) { + return st7565_active; +} bool st7565_invert(bool invert) { if (!st7565_initialized) { @@ -445,9 +450,13 @@ bool st7565_invert(bool invert) { return st7565_inverted; } -uint8_t st7565_max_chars(void) { return ST7565_DISPLAY_WIDTH / ST7565_FONT_WIDTH; } +uint8_t st7565_max_chars(void) { + return ST7565_DISPLAY_WIDTH / ST7565_FONT_WIDTH; +} -uint8_t st7565_max_lines(void) { return ST7565_DISPLAY_HEIGHT / ST7565_FONT_HEIGHT; } +uint8_t st7565_max_lines(void) { + return ST7565_DISPLAY_HEIGHT / ST7565_FONT_HEIGHT; +} void st7565_task(void) { if (!st7565_initialized) { diff --git a/drivers/lcd/st7565.h b/drivers/lcd/st7565.h index d453dbe6da90..0e42c8765be4 100644 --- a/drivers/lcd/st7565.h +++ b/drivers/lcd/st7565.h @@ -29,16 +29,16 @@ along with this program. If not, see . # define ST7565_DISPLAY_HEIGHT 32 #endif #ifndef ST7565_MATRIX_SIZE -# define ST7565_MATRIX_SIZE (ST7565_DISPLAY_HEIGHT / 8 * ST7565_DISPLAY_WIDTH) // 1024 (compile time mathed) +# define ST7565_MATRIX_SIZE (ST7565_DISPLAY_HEIGHT / 8 * ST7565_DISPLAY_WIDTH) // 1024 (compile time mathed) #endif #ifndef ST7565_BLOCK_TYPE # define ST7565_BLOCK_TYPE uint16_t #endif #ifndef ST7565_BLOCK_COUNT -# define ST7565_BLOCK_COUNT (sizeof(ST7565_BLOCK_TYPE) * 8) // 32 (compile time mathed) +# define ST7565_BLOCK_COUNT (sizeof(ST7565_BLOCK_TYPE) * 8) // 32 (compile time mathed) #endif #ifndef ST7565_BLOCK_SIZE -# define ST7565_BLOCK_SIZE (ST7565_MATRIX_SIZE / ST7565_BLOCK_COUNT) // 32 (compile time mathed) +# define ST7565_BLOCK_SIZE (ST7565_MATRIX_SIZE / ST7565_BLOCK_COUNT) // 32 (compile time mathed) #endif // the column address corresponding to the first column in the display hardware @@ -174,7 +174,7 @@ void st7565_write_raw_P(const char *data, uint16_t size); # define st7565_write_P(data, invert) st7565_write(data, invert) # define st7565_write_ln_P(data, invert) st7565_write_ln(data, invert) # define st7565_write_raw_P(data, size) st7565_write_raw(data, size) -#endif // defined(__AVR__) +#endif // defined(__AVR__) // Can be used to manually turn on the screen if it is off // Returns true if the screen was on or turns on diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c index 00e7eb450536..f29194897528 100644 --- a/drivers/led/apa102.c +++ b/drivers/led/apa102.c @@ -20,15 +20,15 @@ #ifndef APA102_NOPS # if defined(__AVR__) -# define APA102_NOPS 0 // AVR at 16 MHz already spends 62.5 ns per clock, so no extra delay is needed +# define APA102_NOPS 0 // AVR at 16 MHz already spends 62.5 ns per clock, so no extra delay is needed # elif defined(PROTOCOL_CHIBIOS) # include "hal.h" # if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103) -# define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns +# 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") -# define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot +# define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot # endif # endif #endif @@ -72,7 +72,9 @@ void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds) { } // Overwrite the default rgblight_call_driver to use apa102 driver -void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { apa102_setleds(start_led, num_leds); } +void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { + apa102_setleds(start_led, num_leds); +} void static apa102_init(void) { setPinOutput(RGB_DI_PIN); diff --git a/drivers/led/aw20216.c b/drivers/led/aw20216.c index 2c7ff8f08898..59389cdcd608 100644 --- a/drivers/led/aw20216.c +++ b/drivers/led/aw20216.c @@ -23,17 +23,17 @@ */ #define AWINIC_ID 0b1010 << 4 -#define AW_PAGE_FUNCTION 0x00 << 1 // PG0, Function registers -#define AW_PAGE_PWM 0x01 << 1 // PG1, LED PWM control -#define AW_PAGE_SCALING 0x02 << 1 // PG2, LED current scaling control -#define AW_PAGE_PATCHOICE 0x03 << 1 // PG3, Pattern choice? -#define AW_PAGE_PWMSCALING 0x04 << 1 // PG4, LED PWM + Scaling control? +#define AW_PAGE_FUNCTION 0x00 << 1 // PG0, Function registers +#define AW_PAGE_PWM 0x01 << 1 // PG1, LED PWM control +#define AW_PAGE_SCALING 0x02 << 1 // PG2, LED current scaling control +#define AW_PAGE_PATCHOICE 0x03 << 1 // PG3, Pattern choice? +#define AW_PAGE_PWMSCALING 0x04 << 1 // PG4, LED PWM + Scaling control? #define AW_WRITE 0 #define AW_READ 1 -#define AW_REG_CONFIGURATION 0x00 // PG0 -#define AW_REG_GLOBALCURRENT 0x01 // PG0 +#define AW_REG_CONFIGURATION 0x00 // PG0 +#define AW_REG_GLOBALCURRENT 0x01 // PG0 // Default value of AW_REG_CONFIGURATION // D7:D4 = 1011, SWSEL (SW1~SW12 active) diff --git a/drivers/led/ckled2001.c b/drivers/led/ckled2001.c index 990e50cb6066..8d71805a2422 100644 --- a/drivers/led/ckled2001.c +++ b/drivers/led/ckled2001.c @@ -125,7 +125,16 @@ void CKLED2001_init(uint8_t addr) { // Set CURRENT PAGE (Page 4) CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, CURRENT_TUNE_PAGE); for (int i = 0; i < LED_CURRENT_TUNE_LENGTH; i++) { - CKLED2001_write_register(addr, i, 0xFF); + switch (i) { + case 2: + case 5: + case 8: + case 11: + CKLED2001_write_register(addr, i, 0xA0); + break; + default: + CKLED2001_write_register(addr, i, 0xFF); + } } // Enable LEDs ON/OFF diff --git a/drivers/led/issi/is31fl3731-simple.c b/drivers/led/issi/is31fl3731-simple.c index f51e2e38aff8..3abe9ea33775 100644 --- a/drivers/led/issi/is31fl3731-simple.c +++ b/drivers/led/issi/is31fl3731-simple.c @@ -42,13 +42,13 @@ #define ISSI_REG_PICTUREFRAME 0x01 // Not defined in the datasheet -- See AN for IC -#define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting +#define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting #define ISSI_REG_SHUTDOWN 0x0A #define ISSI_REG_AUDIOSYNC 0x06 #define ISSI_COMMANDREGISTER 0xFD -#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' +#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' #ifndef ISSI_TIMEOUT # define ISSI_TIMEOUT 100 @@ -148,7 +148,7 @@ void IS31FL3731_init(uint8_t addr) { // enable software shutdown IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); -#ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array +#ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array IS31FL3731_write_register(addr, ISSI_REG_GHOST_IMAGE_PREVENTION, 0x10); #endif diff --git a/drivers/led/issi/is31fl3731.c b/drivers/led/issi/is31fl3731.c index e6190a6b9082..9c6c29f081b0 100644 --- a/drivers/led/issi/is31fl3731.c +++ b/drivers/led/issi/is31fl3731.c @@ -41,13 +41,13 @@ #define ISSI_REG_PICTUREFRAME 0x01 // Not defined in the datasheet -- See AN for IC -#define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting +#define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting #define ISSI_REG_SHUTDOWN 0x0A #define ISSI_REG_AUDIOSYNC 0x06 #define ISSI_COMMANDREGISTER 0xFD -#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' +#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' #ifndef ISSI_TIMEOUT # define ISSI_TIMEOUT 100 @@ -136,7 +136,7 @@ void IS31FL3731_init(uint8_t addr) { // enable software shutdown IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); -#ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array +#ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array IS31FL3731_write_register(addr, ISSI_REG_GHOST_IMAGE_PREVENTION, 0x10); #endif diff --git a/drivers/led/issi/is31fl3733-simple.c b/drivers/led/issi/is31fl3733-simple.c new file mode 100644 index 000000000000..af006f756d0e --- /dev/null +++ b/drivers/led/issi/is31fl3733-simple.c @@ -0,0 +1,248 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * Copyright 2021 Leo Deng + * + * 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 "is31fl3733-simple.h" +#include "i2c_master.h" +#include "wait.h" + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b101(ADDR2)(ADDR1) +#define ISSI_ADDR_DEFAULT 0x50 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_INTERRUPTMASKREGISTER 0xF0 +#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 + +#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 +#define ISSI_PAGE_PWM 0x01 // PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 +#define ISSI_PAGE_FUNCTION 0x03 // PG3 + +#define ISSI_REG_CONFIGURATION 0x00 // PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 +#define ISSI_REG_RESET 0x11 // PG3 +#define ISSI_REG_SWPULLUP 0x0F // PG3 +#define ISSI_REG_CSPULLUP 0x10 // PG3 + +#ifndef ISSI_TIMEOUT +# define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE +# define ISSI_PERSISTENCE 0 +#endif + +#ifndef ISSI_PWM_FREQUENCY +# define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only +#endif + +#ifndef ISSI_SWPULLUP +# define ISSI_SWPULLUP PUR_0R +#endif + +#ifndef ISSI_CSPULLUP +# define ISSI_CSPULLUP PUR_0R +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3733 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3733_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[LED_DRIVER_COUNT][192]; +bool g_pwm_buffer_update_required[LED_DRIVER_COUNT] = {false}; + +/* There's probably a better way to init this... */ +#if LED_DRIVER_COUNT == 1 +uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}}; +#elif LED_DRIVER_COUNT == 2 +uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}, {0}}; +#elif LED_DRIVER_COUNT == 3 +uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}, {0}, {0}}; +#elif LED_DRIVER_COUNT == 4 +uint8_t g_led_control_registers[LED_DRIVER_COUNT][24] = {{0}, {0}, {0}, {0}}; +#endif +bool g_led_control_registers_update_required[LED_DRIVER_COUNT] = {false}; + +bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data) { + // If the transaction fails function returns false. + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + +#if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) != 0) { + return false; + } + } +#else + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) != 0) { + return false; + } +#endif + return true; +} + +bool IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) { + // Assumes PG1 is already selected. + // If any of the transactions fails function returns false. + // Transmit PWM registers in 12 transfers of 16 bytes. + // g_twi_transfer_buffer[] is 20 bytes + + // Iterate over the pwm_buffer contents at 16 byte intervals. + for (int i = 0; i < 192; i += 16) { + g_twi_transfer_buffer[0] = i; + // Copy the data from i to i+15. + // Device will auto-increment register for data after the first byte + // Thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer. + for (int j = 0; j < 16; j++) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + +#if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) != 0) { + return false; + } + } +#else + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) != 0) { + return false; + } +#endif + } + return true; +} + +void IS31FL3733_init(uint8_t addr, uint8_t sync) { + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + // Sync is passed so set it according to the datasheet. + + // Unlock the command register. + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + + // Select PG0 + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); + // Turn off all LEDs. + for (int i = 0x00; i <= 0x17; i++) { + IS31FL3733_write_register(addr, i, 0x00); + } + + // Unlock the command register. + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + + // Select PG1 + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for (int i = 0x00; i <= 0xBF; i++) { + IS31FL3733_write_register(addr, i, 0x00); + } + + // Unlock the command register. + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + + // Select PG3 + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); + // Set de-ghost pull-up resistors (SWx) + IS31FL3733_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); + // Set de-ghost pull-down resistors (CSx) + IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); + // Set global current to maximum. + IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); + // Disable software shutdown. + IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01); + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void IS31FL3733_set_value(int index, uint8_t value) { + if (index >= 0 && index < DRIVER_LED_TOTAL) { + is31_led led = g_is31_leds[index]; + + g_pwm_buffer[led.driver][led.v] = value; + g_pwm_buffer_update_required[led.driver] = true; + } +} + +void IS31FL3733_set_value_all(uint8_t value) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + IS31FL3733_set_value(i, value); + } +} + +void IS31FL3733_set_led_control_register(uint8_t index, bool value) { + is31_led led = g_is31_leds[index]; + + uint8_t control_register = led.v / 8; + uint8_t bit_value = led.v % 8; + + if (value) { + g_led_control_registers[led.driver][control_register] |= (1 << bit_value); + } else { + g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value); + } + + g_led_control_registers_update_required[led.driver] = true; +} + +void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index) { + if (g_pwm_buffer_update_required[index]) { + // Firstly we need to unlock the command register and select PG1. + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); + + // If any of the transactions fail we risk writing dirty PG0, + // refresh page 0 just in case. + if (!IS31FL3733_write_pwm_buffer(addr, g_pwm_buffer[index])) { + g_led_control_registers_update_required[index] = true; + } + g_pwm_buffer_update_required[index] = false; + } +} + +void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index) { + if (g_led_control_registers_update_required[index]) { + // Firstly we need to unlock the command register and select PG0 + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL); + for (int i = 0; i < 24; i++) { + IS31FL3733_write_register(addr, i, g_led_control_registers[index][i]); + } + g_led_control_registers_update_required[index] = false; + } +} diff --git a/drivers/led/issi/is31fl3733-simple.h b/drivers/led/issi/is31fl3733-simple.h new file mode 100644 index 000000000000..f5253e310172 --- /dev/null +++ b/drivers/led/issi/is31fl3733-simple.h @@ -0,0 +1,260 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * Copyright 2021 Leo Deng + * + * 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 +#include +#include "progmem.h" + +typedef struct is31_led { + uint8_t driver : 2; + uint8_t v; +} __attribute__((packed)) is31_led; + +extern const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31FL3733_init(uint8_t addr, uint8_t sync); +bool IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data); +bool IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer); + +void IS31FL3733_set_value(int index, uint8_t value); +void IS31FL3733_set_value_all(uint8_t value); + +void IS31FL3733_set_led_control_register(uint8_t index, bool value); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); +void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); + +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL +#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time +#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time +#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time +#define PUR_16KR 0x06 // 16k Ohm resistor on all the time +#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL + +#define A_1 0x00 +#define A_2 0x01 +#define A_3 0x02 +#define A_4 0x03 +#define A_5 0x04 +#define A_6 0x05 +#define A_7 0x06 +#define A_8 0x07 +#define A_9 0x08 +#define A_10 0x09 +#define A_11 0x0A +#define A_12 0x0B +#define A_13 0x0C +#define A_14 0x0D +#define A_15 0x0E +#define A_16 0x0F + +#define B_1 0x10 +#define B_2 0x11 +#define B_3 0x12 +#define B_4 0x13 +#define B_5 0x14 +#define B_6 0x15 +#define B_7 0x16 +#define B_8 0x17 +#define B_9 0x18 +#define B_10 0x19 +#define B_11 0x1A +#define B_12 0x1B +#define B_13 0x1C +#define B_14 0x1D +#define B_15 0x1E +#define B_16 0x1F + +#define C_1 0x20 +#define C_2 0x21 +#define C_3 0x22 +#define C_4 0x23 +#define C_5 0x24 +#define C_6 0x25 +#define C_7 0x26 +#define C_8 0x27 +#define C_9 0x28 +#define C_10 0x29 +#define C_11 0x2A +#define C_12 0x2B +#define C_13 0x2C +#define C_14 0x2D +#define C_15 0x2E +#define C_16 0x2F + +#define D_1 0x30 +#define D_2 0x31 +#define D_3 0x32 +#define D_4 0x33 +#define D_5 0x34 +#define D_6 0x35 +#define D_7 0x36 +#define D_8 0x37 +#define D_9 0x38 +#define D_10 0x39 +#define D_11 0x3A +#define D_12 0x3B +#define D_13 0x3C +#define D_14 0x3D +#define D_15 0x3E +#define D_16 0x3F + +#define E_1 0x40 +#define E_2 0x41 +#define E_3 0x42 +#define E_4 0x43 +#define E_5 0x44 +#define E_6 0x45 +#define E_7 0x46 +#define E_8 0x47 +#define E_9 0x48 +#define E_10 0x49 +#define E_11 0x4A +#define E_12 0x4B +#define E_13 0x4C +#define E_14 0x4D +#define E_15 0x4E +#define E_16 0x4F + +#define F_1 0x50 +#define F_2 0x51 +#define F_3 0x52 +#define F_4 0x53 +#define F_5 0x54 +#define F_6 0x55 +#define F_7 0x56 +#define F_8 0x57 +#define F_9 0x58 +#define F_10 0x59 +#define F_11 0x5A +#define F_12 0x5B +#define F_13 0x5C +#define F_14 0x5D +#define F_15 0x5E +#define F_16 0x5F + +#define G_1 0x60 +#define G_2 0x61 +#define G_3 0x62 +#define G_4 0x63 +#define G_5 0x64 +#define G_6 0x65 +#define G_7 0x66 +#define G_8 0x67 +#define G_9 0x68 +#define G_10 0x69 +#define G_11 0x6A +#define G_12 0x6B +#define G_13 0x6C +#define G_14 0x6D +#define G_15 0x6E +#define G_16 0x6F + +#define H_1 0x70 +#define H_2 0x71 +#define H_3 0x72 +#define H_4 0x73 +#define H_5 0x74 +#define H_6 0x75 +#define H_7 0x76 +#define H_8 0x77 +#define H_9 0x78 +#define H_10 0x79 +#define H_11 0x7A +#define H_12 0x7B +#define H_13 0x7C +#define H_14 0x7D +#define H_15 0x7E +#define H_16 0x7F + +#define I_1 0x80 +#define I_2 0x81 +#define I_3 0x82 +#define I_4 0x83 +#define I_5 0x84 +#define I_6 0x85 +#define I_7 0x86 +#define I_8 0x87 +#define I_9 0x88 +#define I_10 0x89 +#define I_11 0x8A +#define I_12 0x8B +#define I_13 0x8C +#define I_14 0x8D +#define I_15 0x8E +#define I_16 0x8F + +#define J_1 0x90 +#define J_2 0x91 +#define J_3 0x92 +#define J_4 0x93 +#define J_5 0x94 +#define J_6 0x95 +#define J_7 0x96 +#define J_8 0x97 +#define J_9 0x98 +#define J_10 0x99 +#define J_11 0x9A +#define J_12 0x9B +#define J_13 0x9C +#define J_14 0x9D +#define J_15 0x9E +#define J_16 0x9F + +#define K_1 0xA0 +#define K_2 0xA1 +#define K_3 0xA2 +#define K_4 0xA3 +#define K_5 0xA4 +#define K_6 0xA5 +#define K_7 0xA6 +#define K_8 0xA7 +#define K_9 0xA8 +#define K_10 0xA9 +#define K_11 0xAA +#define K_12 0xAB +#define K_13 0xAC +#define K_14 0xAD +#define K_15 0xAE +#define K_16 0xAF + +#define L_1 0xB0 +#define L_2 0xB1 +#define L_3 0xB2 +#define L_4 0xB3 +#define L_5 0xB4 +#define L_6 0xB5 +#define L_7 0xB6 +#define L_8 0xB7 +#define L_9 0xB8 +#define L_10 0xB9 +#define L_11 0xBA +#define L_12 0xBB +#define L_13 0xBC +#define L_14 0xBD +#define L_15 0xBE +#define L_16 0xBF diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index 696491d0706a..a2fdaa90fa43 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -38,16 +38,16 @@ #define ISSI_INTERRUPTMASKREGISTER 0xF0 #define ISSI_INTERRUPTSTATUSREGISTER 0xF1 -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 +#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 +#define ISSI_PAGE_PWM 0x01 // PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 +#define ISSI_PAGE_FUNCTION 0x03 // PG3 -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 +#define ISSI_REG_CONFIGURATION 0x00 // PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 +#define ISSI_REG_RESET 0x11 // PG3 +#define ISSI_REG_SWPULLUP 0x0F // PG3 +#define ISSI_REG_CSPULLUP 0x10 // PG3 #ifndef ISSI_TIMEOUT # define ISSI_TIMEOUT 100 @@ -58,7 +58,7 @@ #endif #ifndef ISSI_PWM_FREQUENCY -# define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only +# define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only #endif #ifndef ISSI_SWPULLUP diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index c5d62fed8517..7653dd17c031 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -48,13 +48,13 @@ void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bo void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL -#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time -#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time -#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time -#define PUR_16KR 0x06 // 16k Ohm resistor on all the time -#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL +#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time +#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time +#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time +#define PUR_16KR 0x06 // 16k Ohm resistor on all the time +#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL #define A_1 0x00 #define A_2 0x01 diff --git a/drivers/led/issi/is31fl3736.c b/drivers/led/issi/is31fl3736.c index c9a871118d2b..7752a3f6cbb3 100644 --- a/drivers/led/issi/is31fl3736.c +++ b/drivers/led/issi/is31fl3736.c @@ -36,16 +36,16 @@ #define ISSI_INTERRUPTMASKREGISTER 0xF0 #define ISSI_INTERRUPTSTATUSREGISTER 0xF1 -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 - -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 +#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 +#define ISSI_PAGE_PWM 0x01 // PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 +#define ISSI_PAGE_FUNCTION 0x03 // PG3 + +#define ISSI_REG_CONFIGURATION 0x00 // PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 +#define ISSI_REG_RESET 0x11 // PG3 +#define ISSI_REG_SWPULLUP 0x0F // PG3 +#define ISSI_REG_CSPULLUP 0x10 // PG3 #ifndef ISSI_TIMEOUT # define ISSI_TIMEOUT 100 diff --git a/drivers/led/issi/is31fl3736.h b/drivers/led/issi/is31fl3736.h index 9fbe1cc577cb..f126034615df 100644 --- a/drivers/led/issi/is31fl3736.h +++ b/drivers/led/issi/is31fl3736.h @@ -61,14 +61,14 @@ void IS31FL3736_mono_set_led_control_register(uint8_t index, bool enabled); void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2); void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2); -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor -#define PUR_1KR 0x02 // 1.0k Ohm resistor -#define PUR_2KR 0x03 // 2.0k Ohm resistor -#define PUR_4KR 0x04 // 4.0k Ohm resistor -#define PUR_8KR 0x05 // 8.0k Ohm resistor -#define PUR_16KR 0x06 // 16k Ohm resistor -#define PUR_32KR 0x07 // 32k Ohm resistor +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x01 // 0.5k Ohm resistor +#define PUR_1KR 0x02 // 1.0k Ohm resistor +#define PUR_2KR 0x03 // 2.0k Ohm resistor +#define PUR_4KR 0x04 // 4.0k Ohm resistor +#define PUR_8KR 0x05 // 8.0k Ohm resistor +#define PUR_16KR 0x06 // 16k Ohm resistor +#define PUR_32KR 0x07 // 32k Ohm resistor #define A_1 0x00 #define A_2 0x02 diff --git a/drivers/led/issi/is31fl3737.c b/drivers/led/issi/is31fl3737.c index 0722e18869f6..9f2a13de4517 100644 --- a/drivers/led/issi/is31fl3737.c +++ b/drivers/led/issi/is31fl3737.c @@ -38,16 +38,16 @@ #define ISSI_INTERRUPTMASKREGISTER 0xF0 #define ISSI_INTERRUPTSTATUSREGISTER 0xF1 -#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 -#define ISSI_PAGE_PWM 0x01 // PG1 -#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 -#define ISSI_PAGE_FUNCTION 0x03 // PG3 - -#define ISSI_REG_CONFIGURATION 0x00 // PG3 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 -#define ISSI_REG_RESET 0x11 // PG3 -#define ISSI_REG_SWPULLUP 0x0F // PG3 -#define ISSI_REG_CSPULLUP 0x10 // PG3 +#define ISSI_PAGE_LEDCONTROL 0x00 // PG0 +#define ISSI_PAGE_PWM 0x01 // PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 +#define ISSI_PAGE_FUNCTION 0x03 // PG3 + +#define ISSI_REG_CONFIGURATION 0x00 // PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 +#define ISSI_REG_RESET 0x11 // PG3 +#define ISSI_REG_SWPULLUP 0x0F // PG3 +#define ISSI_REG_CSPULLUP 0x10 // PG3 #ifndef ISSI_TIMEOUT # define ISSI_TIMEOUT 100 diff --git a/drivers/led/issi/is31fl3737.h b/drivers/led/issi/is31fl3737.h index 31b1a2226772..ddb70a9df50c 100644 --- a/drivers/led/issi/is31fl3737.h +++ b/drivers/led/issi/is31fl3737.h @@ -48,14 +48,14 @@ void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bo void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2); void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2); -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL -#define PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL -#define PUR_2KR 0x03 // 2.0k Ohm resistor in t_NOL -#define PUR_4KR 0x04 // 4.0k Ohm resistor in t_NOL -#define PUR_8KR 0x05 // 8.0k Ohm resistor in t_NOL -#define PUR_16KR 0x06 // 16k Ohm resistor in t_NOL -#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL +#define PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL +#define PUR_2KR 0x03 // 2.0k Ohm resistor in t_NOL +#define PUR_4KR 0x04 // 4.0k Ohm resistor in t_NOL +#define PUR_8KR 0x05 // 8.0k Ohm resistor in t_NOL +#define PUR_16KR 0x06 // 16k Ohm resistor in t_NOL +#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL #define A_1 0x00 #define A_2 0x01 diff --git a/drivers/led/issi/is31fl3741.c b/drivers/led/issi/is31fl3741.c index 8d347a5e607a..393b0179b536 100644 --- a/drivers/led/issi/is31fl3741.c +++ b/drivers/led/issi/is31fl3741.c @@ -42,16 +42,16 @@ #define ISSI_INTERRUPTSTATUSREGISTER 0xF1 #define ISSI_IDREGISTER 0xFC -#define ISSI_PAGE_PWM0 0x00 // PG0 -#define ISSI_PAGE_PWM1 0x01 // PG1 -#define ISSI_PAGE_SCALING_0 0x02 // PG2 -#define ISSI_PAGE_SCALING_1 0x03 // PG3 -#define ISSI_PAGE_FUNCTION 0x04 // PG4 - -#define ISSI_REG_CONFIGURATION 0x00 // PG4 -#define ISSI_REG_GLOBALCURRENT 0x01 // PG4 -#define ISSI_REG_PULLDOWNUP 0x02 // PG4 -#define ISSI_REG_RESET 0x3F // PG4 +#define ISSI_PAGE_PWM0 0x00 // PG0 +#define ISSI_PAGE_PWM1 0x01 // PG1 +#define ISSI_PAGE_SCALING_0 0x02 // PG2 +#define ISSI_PAGE_SCALING_1 0x03 // PG3 +#define ISSI_PAGE_FUNCTION 0x04 // PG4 + +#define ISSI_REG_CONFIGURATION 0x00 // PG4 +#define ISSI_REG_GLOBALCURRENT 0x01 // PG4 +#define ISSI_REG_PULLDOWNUP 0x02 // PG4 +#define ISSI_REG_RESET 0x3F // PG4 #ifndef ISSI_TIMEOUT # define ISSI_TIMEOUT 100 diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index 8154f8be702f..3bdb23bd2d37 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h @@ -51,14 +51,14 @@ void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor -#define PUR_1KR 0x02 // 1.0k Ohm resistor -#define PUR_2KR 0x03 // 2.0k Ohm resistor -#define PUR_4KR 0x04 // 4.0k Ohm resistor -#define PUR_8KR 0x05 // 8.0k Ohm resistor -#define PUR_16KR 0x06 // 16k Ohm resistor -#define PUR_32KR 0x07 // 32k Ohm resistor +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x01 // 0.5k Ohm resistor +#define PUR_1KR 0x02 // 1.0k Ohm resistor +#define PUR_2KR 0x03 // 2.0k Ohm resistor +#define PUR_4KR 0x04 // 4.0k Ohm resistor +#define PUR_8KR 0x05 // 8.0k Ohm resistor +#define PUR_16KR 0x06 // 16k Ohm resistor +#define PUR_32KR 0x07 // 32k Ohm resistor #define CS1_SW1 0x00 #define CS2_SW1 0x01 diff --git a/drivers/led/issi/is31fl3742.h b/drivers/led/issi/is31fl3742.h new file mode 100644 index 000000000000..c96f12d0f1d4 --- /dev/null +++ b/drivers/led/issi/is31fl3742.h @@ -0,0 +1,299 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * 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 + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR represents A1:A0 of the 7-bit address. +// The result is: 0b01100(ADDR) +#ifndef DRIVER_ADDR_1 +# define DRIVER_ADDR_1 0b0110000 +#endif + +// Command Registers +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_IDREGISTER 0xFC +#define ISSI_REGISTER_UNLOCK 0xC5 + +// Response Registers +#define ISSI_PAGE_PWM 0x00 +#define ISSI_PAGE_SCALING 0x02 +#define ISSI_PAGE_FUNCTION 0x04 + +// Registers under Function Register +#define ISSI_REG_CONFIGURATION 0x00 +#define ISSI_REG_GLOBALCURRENT 0x01 +#define ISSI_REG_PULLDOWNUP 0x02 +#define ISSI_REG_SSR 0x41 +#define ISSI_REG_RESET 0x3F +#define ISSI_REG_PWM_SET 0x36 + +// Set defaults for Function Registers +#ifndef ISSI_CONFIGURATION +# define ISSI_CONFIGURATION 0x31 +#endif +#ifndef ISSI_GLOBALCURRENT +# define ISSI_GLOBALCURRENT 0xFF +#endif +#ifndef ISSI_PULLDOWNUP +# define ISSI_PULLDOWNUP 0x55 +#endif +#ifndef ISSI_PWM_SET +# define ISSI_PWM_SET 0x00 +#endif + +// Set defaults for Spread Spectrum Register +#ifndef ISSI_SSR_1 +# define ISSI_SSR_1 0x00 +#endif +#ifndef ISSI_SSR_2 +# define ISSI_SSR_2 0x00 +#endif +#ifndef ISSI_SSR_3 +# define ISSI_SSR_3 0x00 +#endif +#ifndef ISSI_SSR_4 +# define ISSI_SSR_4 0x00 +#endif + +// Set defaults for Scaling registers +#ifndef ISSI_SCAL_RED +# define ISSI_SCAL_RED 0xFF +#endif +#ifndef ISSI_SCAL_BLUE +# define ISSI_SCAL_BLUE 0xFF +#endif +#ifndef ISSI_SCAL_GREEN +# define ISSI_SCAL_GREEN 0xFF +#endif +#define ISSI_SCAL_RED_OFF 0x00 +#define ISSI_SCAL_GREEN_OFF 0x00 +#define ISSI_SCAL_BLUE_OFF 0x00 + +#ifndef ISSI_SCAL_LED +# define ISSI_SCAL_LED 0xFF +#endif +#define ISSI_SCAL_LED_OFF 0x00 + +// Set buffer sizes +#define ISSI_MAX_LEDS 180 +#define ISSI_SCALING_SIZE 180 +#define ISSI_PWM_TRF_SIZE 18 +#define ISSI_SCALING_TRF_SIZE 18 + +// Location of 1st bit for PWM and Scaling registers +#define ISSI_PWM_REG_1ST 0x00 +#define ISSI_SCL_REG_1ST 0x00 + +// Map CS SW locations to order in PWM / Scaling buffers +// This matches the ORDER in the Datasheet Register not the POSITION +// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) +#define CS1_SW1 0x00 +#define CS2_SW1 0x01 +#define CS3_SW1 0x02 +#define CS4_SW1 0x03 +#define CS5_SW1 0x04 +#define CS6_SW1 0x05 +#define CS7_SW1 0x06 +#define CS8_SW1 0x07 +#define CS9_SW1 0x08 +#define CS10_SW1 0x09 +#define CS11_SW1 0x0A +#define CS12_SW1 0x0B +#define CS13_SW1 0x0C +#define CS14_SW1 0x0D +#define CS15_SW1 0x0E +#define CS16_SW1 0x0F +#define CS17_SW1 0x10 +#define CS18_SW1 0x11 +#define CS19_SW1 0x12 +#define CS20_SW1 0x13 +#define CS21_SW1 0x14 +#define CS22_SW1 0x15 +#define CS23_SW1 0x16 +#define CS24_SW1 0x17 +#define CS25_SW1 0x18 +#define CS26_SW1 0x19 +#define CS27_SW1 0x1A +#define CS28_SW1 0x1B +#define CS29_SW1 0x1C +#define CS30_SW1 0x1D + +#define CS1_SW2 0x1E +#define CS2_SW2 0x1F +#define CS3_SW2 0x20 +#define CS4_SW2 0x21 +#define CS5_SW2 0x22 +#define CS6_SW2 0x23 +#define CS7_SW2 0x24 +#define CS8_SW2 0x25 +#define CS9_SW2 0x26 +#define CS10_SW2 0x27 +#define CS11_SW2 0x28 +#define CS12_SW2 0x29 +#define CS13_SW2 0x2A +#define CS14_SW2 0x2B +#define CS15_SW2 0x2C +#define CS16_SW2 0x2D +#define CS17_SW2 0x2E +#define CS18_SW2 0x2F +#define CS19_SW2 0x30 +#define CS20_SW2 0x31 +#define CS21_SW2 0x32 +#define CS22_SW2 0x33 +#define CS23_SW2 0x34 +#define CS24_SW2 0x35 +#define CS25_SW2 0x36 +#define CS26_SW2 0x37 +#define CS27_SW2 0x38 +#define CS28_SW2 0x39 +#define CS29_SW2 0x3A +#define CS30_SW2 0x3B + +#define CS1_SW3 0x3C +#define CS2_SW3 0x3D +#define CS3_SW3 0x3E +#define CS4_SW3 0x3F +#define CS5_SW3 0x40 +#define CS6_SW3 0x41 +#define CS7_SW3 0x42 +#define CS8_SW3 0x43 +#define CS9_SW3 0x44 +#define CS10_SW3 0x45 +#define CS11_SW3 0x46 +#define CS12_SW3 0x47 +#define CS13_SW3 0x48 +#define CS14_SW3 0x49 +#define CS15_SW3 0x4A +#define CS16_SW3 0x4B +#define CS17_SW3 0x4C +#define CS18_SW3 0x4D +#define CS19_SW3 0x4E +#define CS20_SW3 0x4F +#define CS21_SW3 0x50 +#define CS22_SW3 0x51 +#define CS23_SW3 0x52 +#define CS24_SW3 0x53 +#define CS25_SW3 0x54 +#define CS26_SW3 0x55 +#define CS27_SW3 0x56 +#define CS28_SW3 0x57 +#define CS29_SW3 0x58 +#define CS30_SW3 0x59 + +#define CS1_SW4 0x5A +#define CS2_SW4 0x5B +#define CS3_SW4 0x5C +#define CS4_SW4 0x5D +#define CS5_SW4 0x5E +#define CS6_SW4 0x5F +#define CS7_SW4 0x60 +#define CS8_SW4 0x61 +#define CS9_SW4 0x62 +#define CS10_SW4 0x63 +#define CS11_SW4 0x64 +#define CS12_SW4 0x65 +#define CS13_SW4 0x66 +#define CS14_SW4 0x67 +#define CS15_SW4 0x68 +#define CS16_SW4 0x69 +#define CS17_SW4 0x6A +#define CS18_SW4 0x6B +#define CS19_SW4 0x6C +#define CS20_SW4 0x6D +#define CS21_SW4 0x6E +#define CS22_SW4 0x6F +#define CS23_SW4 0x70 +#define CS24_SW4 0x71 +#define CS25_SW4 0x72 +#define CS26_SW4 0x73 +#define CS27_SW4 0x74 +#define CS28_SW4 0x75 +#define CS29_SW4 0x76 +#define CS30_SW4 0x77 + +#define CS1_SW5 0x78 +#define CS2_SW5 0x79 +#define CS3_SW5 0x7A +#define CS4_SW5 0x7B +#define CS5_SW5 0x7C +#define CS6_SW5 0x7D +#define CS7_SW5 0x7E +#define CS8_SW5 0x7F +#define CS9_SW5 0x80 +#define CS10_SW5 0x81 +#define CS11_SW5 0x82 +#define CS12_SW5 0x83 +#define CS13_SW5 0x84 +#define CS14_SW5 0x85 +#define CS15_SW5 0x86 +#define CS16_SW5 0x87 +#define CS17_SW5 0x88 +#define CS18_SW5 0x89 +#define CS19_SW5 0x8A +#define CS20_SW5 0x8B +#define CS21_SW5 0x8C +#define CS22_SW5 0x8D +#define CS23_SW5 0x8E +#define CS24_SW5 0x8F +#define CS25_SW5 0x90 +#define CS26_SW5 0x91 +#define CS27_SW5 0x92 +#define CS28_SW5 0x93 +#define CS29_SW5 0x94 +#define CS30_SW5 0x95 + +#define CS1_SW6 0x96 +#define CS2_SW6 0x97 +#define CS3_SW6 0x98 +#define CS4_SW6 0x99 +#define CS5_SW6 0x9A +#define CS6_SW6 0x9B +#define CS7_SW6 0x9C +#define CS8_SW6 0x9D +#define CS9_SW6 0x9E +#define CS10_SW6 0x9F +#define CS11_SW6 0xA0 +#define CS12_SW6 0xA1 +#define CS13_SW6 0xA2 +#define CS14_SW6 0xA3 +#define CS15_SW6 0xA4 +#define CS16_SW6 0xA5 +#define CS17_SW6 0xA6 +#define CS18_SW6 0xA7 +#define CS19_SW6 0xA8 +#define CS20_SW6 0xA9 +#define CS21_SW6 0xAA +#define CS22_SW6 0xAB +#define CS23_SW6 0xAC +#define CS24_SW6 0xAD +#define CS25_SW6 0xAE +#define CS26_SW6 0xAF +#define CS27_SW6 0xB0 +#define CS28_SW6 0xB1 +#define CS29_SW6 0xB2 +#define CS30_SW6 0xB3 diff --git a/drivers/led/issi/is31fl3743.h b/drivers/led/issi/is31fl3743.h new file mode 100644 index 000000000000..d8fcd790963b --- /dev/null +++ b/drivers/led/issi/is31fl3743.h @@ -0,0 +1,327 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * 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 + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b010(ADDR2)(ADDR1) +#ifndef DRIVER_ADDR_1 +# define DRIVER_ADDR_1 0b0100000 +#endif + +// Set defaults for Spread Spectrum Register +#ifndef ISSI_SSR_1 +# if DRIVER_COUNT == 1 +# define ISSI_SSR_1 0x00 +# else +# define ISSI_SSR_1 0xC0 +# endif +#endif +#ifndef ISSI_SSR_2 +# define ISSI_SSR_2 0x80 +#endif +#ifndef ISSI_SSR_3 +# define ISSI_SSR_3 0x80 +#endif +#ifndef ISSI_SSR_4 +# define ISSI_SSR_4 0x80 +#endif + +// Command Registers +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_IDREGISTER 0xFC +#define ISSI_REGISTER_UNLOCK 0xC5 + +// Response Registers +#define ISSI_PAGE_PWM 0x00 +#define ISSI_PAGE_SCALING 0x01 +#define ISSI_PAGE_FUNCTION 0x02 + +// Registers under Function Register +#define ISSI_REG_CONFIGURATION 0x00 +#define ISSI_REG_GLOBALCURRENT 0x01 +#define ISSI_REG_PULLDOWNUP 0x02 +#define ISSI_REG_TEMP 0x24 +#define ISSI_REG_SSR 0x25 +#define ISSI_REG_RESET 0x2F + +// Set defaults for Function Registers +#ifndef ISSI_CONFIGURATION +# define ISSI_CONFIGURATION 0x01 +#endif +#ifndef ISSI_GLOBALCURRENT +# define ISSI_GLOBALCURRENT 0xFF +#endif +#ifndef ISSI_PULLDOWNUP +# define ISSI_PULLDOWNUP 0x33 +#endif +#ifndef ISSI_TEMP +# define ISSI_TEMP 0x00 +#endif + +// Set defaults for Scaling registers +#ifndef ISSI_SCAL_RED +# define ISSI_SCAL_RED 0xFF +#endif +#ifndef ISSI_SCAL_BLUE +# define ISSI_SCAL_BLUE 0xFF +#endif +#ifndef ISSI_SCAL_GREEN +# define ISSI_SCAL_GREEN 0xFF +#endif +#define ISSI_SCAL_RED_OFF 0x00 +#define ISSI_SCAL_GREEN_OFF 0x00 +#define ISSI_SCAL_BLUE_OFF 0x00 + +#ifndef ISSI_SCAL_LED +# define ISSI_SCAL_LED 0xFF +#endif +#define ISSI_SCAL_LED_OFF 0x00 + +// Set buffer sizes +#define ISSI_MAX_LEDS 198 +#define ISSI_SCALING_SIZE 198 +#define ISSI_PWM_TRF_SIZE 18 +#define ISSI_SCALING_TRF_SIZE 18 + +// Location of 1st bit for PWM and Scaling registers +#define ISSI_PWM_REG_1ST 0x01 +#define ISSI_SCL_REG_1ST 0x01 + +// Map CS SW locations to order in PWM / Scaling buffers +// This matches the ORDER in the Datasheet Register not the POSITION +// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) +#define CS1_SW1 0x00 +#define CS2_SW1 0x01 +#define CS3_SW1 0x02 +#define CS4_SW1 0x03 +#define CS5_SW1 0x04 +#define CS6_SW1 0x05 +#define CS7_SW1 0x06 +#define CS8_SW1 0x07 +#define CS9_SW1 0x08 +#define CS10_SW1 0x09 +#define CS11_SW1 0x0A +#define CS12_SW1 0x0B +#define CS13_SW1 0x0C +#define CS14_SW1 0x0D +#define CS15_SW1 0x0E +#define CS16_SW1 0x0F +#define CS17_SW1 0x10 +#define CS18_SW1 0x11 + +#define CS1_SW2 0x12 +#define CS2_SW2 0x13 +#define CS3_SW2 0x14 +#define CS4_SW2 0x15 +#define CS5_SW2 0x16 +#define CS6_SW2 0x17 +#define CS7_SW2 0x18 +#define CS8_SW2 0x19 +#define CS9_SW2 0x1A +#define CS10_SW2 0x1B +#define CS11_SW2 0x1C +#define CS12_SW2 0x1D +#define CS13_SW2 0x1E +#define CS14_SW2 0x1F +#define CS15_SW2 0x20 +#define CS16_SW2 0x21 +#define CS17_SW2 0x22 +#define CS18_SW2 0x23 + +#define CS1_SW3 0x24 +#define CS2_SW3 0x25 +#define CS3_SW3 0x26 +#define CS4_SW3 0x27 +#define CS5_SW3 0x28 +#define CS6_SW3 0x29 +#define CS7_SW3 0x2A +#define CS8_SW3 0x2B +#define CS9_SW3 0x2C +#define CS10_SW3 0x2D +#define CS11_SW3 0x2E +#define CS12_SW3 0x2F +#define CS13_SW3 0x30 +#define CS14_SW3 0x31 +#define CS15_SW3 0x32 +#define CS16_SW3 0x33 +#define CS17_SW3 0x34 +#define CS18_SW3 0x35 + +#define CS1_SW4 0x36 +#define CS2_SW4 0x37 +#define CS3_SW4 0x38 +#define CS4_SW4 0x39 +#define CS5_SW4 0x3A +#define CS6_SW4 0x3B +#define CS7_SW4 0x3C +#define CS8_SW4 0x3D +#define CS9_SW4 0x3E +#define CS10_SW4 0x3F +#define CS11_SW4 0x40 +#define CS12_SW4 0x41 +#define CS13_SW4 0x42 +#define CS14_SW4 0x43 +#define CS15_SW4 0x44 +#define CS16_SW4 0x45 +#define CS17_SW4 0x46 +#define CS18_SW4 0x47 + +#define CS1_SW5 0x48 +#define CS2_SW5 0x49 +#define CS3_SW5 0x4A +#define CS4_SW5 0x4B +#define CS5_SW5 0x4C +#define CS6_SW5 0x4D +#define CS7_SW5 0x4E +#define CS8_SW5 0x4F +#define CS9_SW5 0x50 +#define CS10_SW5 0x51 +#define CS11_SW5 0x52 +#define CS12_SW5 0x53 +#define CS13_SW5 0x54 +#define CS14_SW5 0x55 +#define CS15_SW5 0x56 +#define CS16_SW5 0x57 +#define CS17_SW5 0x58 +#define CS18_SW5 0x59 + +#define CS1_SW6 0x5A +#define CS2_SW6 0x5B +#define CS3_SW6 0x5C +#define CS4_SW6 0x5D +#define CS5_SW6 0x5E +#define CS6_SW6 0x5F +#define CS7_SW6 0x60 +#define CS8_SW6 0x61 +#define CS9_SW6 0x62 +#define CS10_SW6 0x63 +#define CS11_SW6 0x64 +#define CS12_SW6 0x65 +#define CS13_SW6 0x66 +#define CS14_SW6 0x67 +#define CS15_SW6 0x68 +#define CS16_SW6 0x69 +#define CS17_SW6 0x6A +#define CS18_SW6 0x6B + +#define CS1_SW7 0x6C +#define CS2_SW7 0x6D +#define CS3_SW7 0x6E +#define CS4_SW7 0x6F +#define CS5_SW7 0x70 +#define CS6_SW7 0x71 +#define CS7_SW7 0x72 +#define CS8_SW7 0x73 +#define CS9_SW7 0x74 +#define CS10_SW7 0x75 +#define CS11_SW7 0x76 +#define CS12_SW7 0x77 +#define CS13_SW7 0x78 +#define CS14_SW7 0x79 +#define CS15_SW7 0x7A +#define CS16_SW7 0x7B +#define CS17_SW7 0x7C +#define CS18_SW7 0x7D + +#define CS1_SW8 0x7E +#define CS2_SW8 0x7F +#define CS3_SW8 0x80 +#define CS4_SW8 0x81 +#define CS5_SW8 0x82 +#define CS6_SW8 0x83 +#define CS7_SW8 0x84 +#define CS8_SW8 0x85 +#define CS9_SW8 0x86 +#define CS10_SW8 0x87 +#define CS11_SW8 0x88 +#define CS12_SW8 0x89 +#define CS13_SW8 0x8A +#define CS14_SW8 0x8B +#define CS15_SW8 0x8C +#define CS16_SW8 0x8D +#define CS17_SW8 0x8E +#define CS18_SW8 0x8F + +#define CS1_SW9 0x90 +#define CS2_SW9 0x91 +#define CS3_SW9 0x92 +#define CS4_SW9 0x93 +#define CS5_SW9 0x94 +#define CS6_SW9 0x95 +#define CS7_SW9 0x96 +#define CS8_SW9 0x97 +#define CS9_SW9 0x98 +#define CS10_SW9 0x99 +#define CS11_SW9 0x9A +#define CS12_SW9 0x9B +#define CS13_SW9 0x9C +#define CS14_SW9 0x9D +#define CS15_SW9 0x9E +#define CS16_SW9 0x9F +#define CS17_SW9 0xA0 +#define CS18_SW9 0xA1 + +#define CS1_SW10 0xA2 +#define CS2_SW10 0xA3 +#define CS3_SW10 0xA4 +#define CS4_SW10 0xA5 +#define CS5_SW10 0xA6 +#define CS6_SW10 0xA7 +#define CS7_SW10 0xA8 +#define CS8_SW10 0xA9 +#define CS9_SW10 0xAA +#define CS10_SW10 0xAB +#define CS11_SW10 0xAC +#define CS12_SW10 0xAD +#define CS13_SW10 0xAE +#define CS14_SW10 0xAF +#define CS15_SW10 0xB0 +#define CS16_SW10 0xB1 +#define CS17_SW10 0xB2 +#define CS18_SW10 0xB3 + +#define CS1_SW11 0xB4 +#define CS2_SW11 0xB5 +#define CS3_SW11 0xB6 +#define CS4_SW11 0xB7 +#define CS5_SW11 0xB8 +#define CS6_SW11 0xB9 +#define CS7_SW11 0xBA +#define CS8_SW11 0xBB +#define CS9_SW11 0xBC +#define CS10_SW11 0xBD +#define CS11_SW11 0xBE +#define CS12_SW11 0xBF +#define CS13_SW11 0xC0 +#define CS14_SW11 0xC1 +#define CS15_SW11 0xC2 +#define CS16_SW11 0xC3 +#define CS17_SW11 0xC4 +#define CS18_SW11 0xC5 diff --git a/drivers/led/issi/is31fl3745.h b/drivers/led/issi/is31fl3745.h new file mode 100644 index 000000000000..ca5dd4a986a8 --- /dev/null +++ b/drivers/led/issi/is31fl3745.h @@ -0,0 +1,270 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * 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 + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b010(ADDR2)(ADDR1) +#ifndef DRIVER_ADDR_1 +# define DRIVER_ADDR_1 0b0100000 +#endif + +// Set defaults for Spread Spectrum Register +#ifndef ISSI_SSR_1 +# if DRIVER_COUNT == 1 +# define ISSI_SSR_1 0x00 +# else +# define ISSI_SSR_1 0xC0 +# endif +#endif +#ifndef ISSI_SSR_2 +# define ISSI_SSR_2 0x80 +#endif +#ifndef ISSI_SSR_3 +# define ISSI_SSR_3 0x80 +#endif +#ifndef ISSI_SSR_4 +# define ISSI_SSR_4 0x80 +#endif + +// Command Registers +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_IDREGISTER 0xFC +#define ISSI_REGISTER_UNLOCK 0xC5 + +// Response Registers +#define ISSI_PAGE_PWM 0x00 +#define ISSI_PAGE_SCALING 0x01 +#define ISSI_PAGE_FUNCTION 0x02 + +// Registers under Function Register +#define ISSI_REG_CONFIGURATION 0x00 +#define ISSI_REG_GLOBALCURRENT 0x01 +#define ISSI_REG_PULLDOWNUP 0x02 +#define ISSI_REG_TEMP 0x24 +#define ISSI_REG_SSR 0x25 +#define ISSI_REG_RESET 0x2F + +// Set defaults for Function Registers +#ifndef ISSI_CONFIGURATION +# define ISSI_CONFIGURATION 0x31 +#endif +#ifndef ISSI_GLOBALCURRENT +# define ISSI_GLOBALCURRENT 0xFF +#endif +#ifndef ISSI_PULLDOWNUP +# define ISSI_PULLDOWNUP 0x33 +#endif +#ifndef ISSI_TEMP +# define ISSI_TEMP 0x00 +#endif + +// Set defaults for Scaling registers +#ifndef ISSI_SCAL_RED +# define ISSI_SCAL_RED 0xFF +#endif +#ifndef ISSI_SCAL_BLUE +# define ISSI_SCAL_BLUE 0xFF +#endif +#ifndef ISSI_SCAL_GREEN +# define ISSI_SCAL_GREEN 0xFF +#endif +#define ISSI_SCAL_RED_OFF 0x00 +#define ISSI_SCAL_GREEN_OFF 0x00 +#define ISSI_SCAL_BLUE_OFF 0x00 + +#ifndef ISSI_SCAL_LED +# define ISSI_SCAL_LED 0xFF +#endif +#define ISSI_SCAL_LED_OFF 0x00 + +// Set buffer sizes +#define ISSI_MAX_LEDS 144 +#define ISSI_SCALING_SIZE 144 +#define ISSI_PWM_TRF_SIZE 18 +#define ISSI_SCALING_TRF_SIZE 18 + +// Location of 1st bit for PWM and Scaling registers +#define ISSI_PWM_REG_1ST 0x01 +#define ISSI_SCL_REG_1ST 0x01 + +// Map CS SW locations to order in PWM / Scaling buffers +// This matches the ORDER in the Datasheet Register not the POSITION +// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) +#define CS1_SW1 0x00 +#define CS2_SW1 0x01 +#define CS3_SW1 0x02 +#define CS4_SW1 0x03 +#define CS5_SW1 0x04 +#define CS6_SW1 0x05 +#define CS7_SW1 0x06 +#define CS8_SW1 0x07 +#define CS9_SW1 0x08 +#define CS10_SW1 0x09 +#define CS11_SW1 0x0A +#define CS12_SW1 0x0B +#define CS13_SW1 0x0C +#define CS14_SW1 0x0D +#define CS15_SW1 0x0E +#define CS16_SW1 0x0F +#define CS17_SW1 0x10 +#define CS18_SW1 0x11 + +#define CS1_SW2 0x12 +#define CS2_SW2 0x13 +#define CS3_SW2 0x14 +#define CS4_SW2 0x15 +#define CS5_SW2 0x16 +#define CS6_SW2 0x17 +#define CS7_SW2 0x18 +#define CS8_SW2 0x19 +#define CS9_SW2 0x1A +#define CS10_SW2 0x1B +#define CS11_SW2 0x1C +#define CS12_SW2 0x1D +#define CS13_SW2 0x1E +#define CS14_SW2 0x1F +#define CS15_SW2 0x20 +#define CS16_SW2 0x21 +#define CS17_SW2 0x22 +#define CS18_SW2 0x23 + +#define CS1_SW3 0x24 +#define CS2_SW3 0x25 +#define CS3_SW3 0x26 +#define CS4_SW3 0x27 +#define CS5_SW3 0x28 +#define CS6_SW3 0x29 +#define CS7_SW3 0x2A +#define CS8_SW3 0x2B +#define CS9_SW3 0x2C +#define CS10_SW3 0x2D +#define CS11_SW3 0x2E +#define CS12_SW3 0x2F +#define CS13_SW3 0x30 +#define CS14_SW3 0x31 +#define CS15_SW3 0x32 +#define CS16_SW3 0x33 +#define CS17_SW3 0x34 +#define CS18_SW3 0x35 + +#define CS1_SW4 0x36 +#define CS2_SW4 0x37 +#define CS3_SW4 0x38 +#define CS4_SW4 0x39 +#define CS5_SW4 0x3A +#define CS6_SW4 0x3B +#define CS7_SW4 0x3C +#define CS8_SW4 0x3D +#define CS9_SW4 0x3E +#define CS10_SW4 0x3F +#define CS11_SW4 0x40 +#define CS12_SW4 0x41 +#define CS13_SW4 0x42 +#define CS14_SW4 0x43 +#define CS15_SW4 0x44 +#define CS16_SW4 0x45 +#define CS17_SW4 0x46 +#define CS18_SW4 0x47 + +#define CS1_SW5 0x48 +#define CS2_SW5 0x49 +#define CS3_SW5 0x4A +#define CS4_SW5 0x4B +#define CS5_SW5 0x4C +#define CS6_SW5 0x4D +#define CS7_SW5 0x4E +#define CS8_SW5 0x4F +#define CS9_SW5 0x50 +#define CS10_SW5 0x51 +#define CS11_SW5 0x52 +#define CS12_SW5 0x53 +#define CS13_SW5 0x54 +#define CS14_SW5 0x55 +#define CS15_SW5 0x56 +#define CS16_SW5 0x57 +#define CS17_SW5 0x58 +#define CS18_SW5 0x59 + +#define CS1_SW6 0x5A +#define CS2_SW6 0x5B +#define CS3_SW6 0x5C +#define CS4_SW6 0x5D +#define CS5_SW6 0x5E +#define CS6_SW6 0x5F +#define CS7_SW6 0x60 +#define CS8_SW6 0x61 +#define CS9_SW6 0x62 +#define CS10_SW6 0x63 +#define CS11_SW6 0x64 +#define CS12_SW6 0x65 +#define CS13_SW6 0x66 +#define CS14_SW6 0x67 +#define CS15_SW6 0x68 +#define CS16_SW6 0x69 +#define CS17_SW6 0x6A +#define CS18_SW6 0x6B + +#define CS1_SW7 0x6C +#define CS2_SW7 0x6D +#define CS3_SW7 0x6E +#define CS4_SW7 0x6F +#define CS5_SW7 0x70 +#define CS6_SW7 0x71 +#define CS7_SW7 0x72 +#define CS8_SW7 0x73 +#define CS9_SW7 0x74 +#define CS10_SW7 0x75 +#define CS11_SW7 0x76 +#define CS12_SW7 0x77 +#define CS13_SW7 0x78 +#define CS14_SW7 0x79 +#define CS15_SW7 0x7A +#define CS16_SW7 0x7B +#define CS17_SW7 0x7C +#define CS18_SW7 0x7D + +#define CS1_SW8 0x7E +#define CS2_SW8 0x7F +#define CS3_SW8 0x80 +#define CS4_SW8 0x81 +#define CS5_SW8 0x82 +#define CS6_SW8 0x83 +#define CS7_SW8 0x84 +#define CS8_SW8 0x85 +#define CS9_SW8 0x86 +#define CS10_SW8 0x87 +#define CS11_SW8 0x88 +#define CS12_SW8 0x89 +#define CS13_SW8 0x8A +#define CS14_SW8 0x8B +#define CS15_SW8 0x8C +#define CS16_SW8 0x8D +#define CS17_SW8 0x8E +#define CS18_SW8 0x8F diff --git a/drivers/led/issi/is31fl3746.h b/drivers/led/issi/is31fl3746.h new file mode 100644 index 000000000000..f89f281533c2 --- /dev/null +++ b/drivers/led/issi/is31fl3746.h @@ -0,0 +1,198 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * 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 + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b110(ADDR2)(ADDR1) +#ifndef DRIVER_ADDR_1 +# define DRIVER_ADDR_1 0b1100000 +#endif + +// Set defaults for Spread Spectrum Register +#ifndef ISSI_SSR_1 +# define ISSI_SSR_1 0x00 +#endif +#ifndef ISSI_SSR_2 +# define ISSI_SSR_2 0x00 +#endif +#ifndef ISSI_SSR_3 +# define ISSI_SSR_3 0x00 +#endif +#ifndef ISSI_SSR_4 +# define ISSI_SSR_4 0x00 +#endif + +// Command Registers +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_IDREGISTER 0xFC +#define ISSI_REGISTER_UNLOCK 0xC5 + +// Response Registers +#define ISSI_PAGE_PWM 0x00 +#define ISSI_PAGE_SCALING 0x01 +#define ISSI_PAGE_FUNCTION 0x01 + +// Registers under Function Register +#define ISSI_REG_CONFIGURATION 0x50 +#define ISSI_REG_GLOBALCURRENT 0x51 +#define ISSI_REG_PULLDOWNUP 0x52 +#define ISSI_REG_TEMP 0x5F +#define ISSI_REG_SSR 0x60 +#define ISSI_REG_RESET 0x8F +#define ISSI_REG_PWM_ENABLE 0xE0 +#define ISSI_REG_PWM_SET 0xE2 + +// Set defaults for Function Registers +#ifndef ISSI_CONFIGURATION +# define ISSI_CONFIGURATION 0x01 +#endif +#ifndef ISSI_GLOBALCURRENT +# define ISSI_GLOBALCURRENT 0xFF +#endif +#ifndef ISSI_PULLDOWNUP +# define ISSI_PULLDOWNUP 0x33 +#endif +#ifndef ISSI_TEMP +# define ISSI_TEMP 0x00 +#endif +#ifndef ISSI_PWM_ENABLE +# define ISSI_PWM_ENABLE 0x00 +#endif +#ifndef ISSI_PWM_SET +# define ISSI_PWM_SET 0x00 +#endif + +// Set defaults for Scaling registers +#ifndef ISSI_SCAL_RED +# define ISSI_SCAL_RED 0xFF +#endif +#ifndef ISSI_SCAL_BLUE +# define ISSI_SCAL_BLUE 0xFF +#endif +#ifndef ISSI_SCAL_GREEN +# define ISSI_SCAL_GREEN 0xFF +#endif +#define ISSI_SCAL_RED_OFF 0x00 +#define ISSI_SCAL_GREEN_OFF 0x00 +#define ISSI_SCAL_BLUE_OFF 0x00 + +#ifndef ISSI_SCAL_LED +# define ISSI_SCAL_LED 0xFF +#endif +#define ISSI_SCAL_LED_OFF 0x00 + +// Set buffer sizes +#define ISSI_MAX_LEDS 72 +#define ISSI_SCALING_SIZE 72 +#define ISSI_PWM_TRF_SIZE 18 +#define ISSI_SCALING_TRF_SIZE 18 + +// Location of 1st bit for PWM and Scaling registers +#define ISSI_PWM_REG_1ST 0x01 +#define ISSI_SCL_REG_1ST 0x01 + +// Map CS SW locations to order in PWM / Scaling buffers +// This matches the ORDER in the Datasheet Register not the POSITION +// It will always count from 0x00 to (ISSI_MAX_LEDS - 1) +#define CS1_SW1 0x00 +#define CS2_SW1 0x01 +#define CS3_SW1 0x02 +#define CS4_SW1 0x03 +#define CS5_SW1 0x04 +#define CS6_SW1 0x05 +#define CS7_SW1 0x06 +#define CS8_SW1 0x07 +#define CS9_SW1 0x08 +#define CS10_SW1 0x09 +#define CS11_SW1 0x0A +#define CS12_SW1 0x0B +#define CS13_SW1 0x0C +#define CS14_SW1 0x0D +#define CS15_SW1 0x0E +#define CS16_SW1 0x0F +#define CS17_SW1 0x10 +#define CS18_SW1 0x11 + +#define CS1_SW2 0x12 +#define CS2_SW2 0x13 +#define CS3_SW2 0x14 +#define CS4_SW2 0x15 +#define CS5_SW2 0x16 +#define CS6_SW2 0x17 +#define CS7_SW2 0x18 +#define CS8_SW2 0x19 +#define CS9_SW2 0x1A +#define CS10_SW2 0x1B +#define CS11_SW2 0x1C +#define CS12_SW2 0x1D +#define CS13_SW2 0x1E +#define CS14_SW2 0x1F +#define CS15_SW2 0x20 +#define CS16_SW2 0x21 +#define CS17_SW2 0x22 +#define CS18_SW2 0x23 + +#define CS1_SW3 0x24 +#define CS2_SW3 0x25 +#define CS3_SW3 0x26 +#define CS4_SW3 0x27 +#define CS5_SW3 0x28 +#define CS6_SW3 0x29 +#define CS7_SW3 0x2A +#define CS8_SW3 0x2B +#define CS9_SW3 0x2C +#define CS10_SW3 0x2D +#define CS11_SW3 0x2E +#define CS12_SW3 0x2F +#define CS13_SW3 0x30 +#define CS14_SW3 0x31 +#define CS15_SW3 0x32 +#define CS16_SW3 0x33 +#define CS17_SW3 0x34 +#define CS18_SW3 0x35 + +#define CS1_SW4 0x36 +#define CS2_SW4 0x37 +#define CS3_SW4 0x38 +#define CS4_SW4 0x39 +#define CS5_SW4 0x3A +#define CS6_SW4 0x3B +#define CS7_SW4 0x3C +#define CS8_SW4 0x3D +#define CS9_SW4 0x3E +#define CS10_SW4 0x3F +#define CS11_SW4 0x40 +#define CS12_SW4 0x41 +#define CS13_SW4 0x42 +#define CS14_SW4 0x43 +#define CS15_SW4 0x44 +#define CS16_SW4 0x45 +#define CS17_SW4 0x46 +#define CS18_SW4 0x47 diff --git a/drivers/led/issi/is31flcommon.c b/drivers/led/issi/is31flcommon.c new file mode 100644 index 000000000000..9f4b2123ffb2 --- /dev/null +++ b/drivers/led/issi/is31flcommon.c @@ -0,0 +1,230 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * 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 "is31flcommon.h" +#include "i2c_master.h" +#include "wait.h" +#include + +// Set defaults for Timeout and Persistence +#ifndef ISSI_TIMEOUT +# define ISSI_TIMEOUT 100 +#endif +#ifndef ISSI_PERSISTENCE +# define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the PWM & scaling registers. +// Storing them like this is optimal for I2C transfers to the registers. +uint8_t g_pwm_buffer[DRIVER_COUNT][ISSI_MAX_LEDS]; +bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; + +uint8_t g_scaling_buffer[DRIVER_COUNT][ISSI_SCALING_SIZE]; +bool g_scaling_buffer_update_required[DRIVER_COUNT] = {false}; + +// For writing of single register entry +void IS31FL_write_single_register(uint8_t addr, uint8_t reg, uint8_t data) { + // Set register address and register data ready to write + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + +#if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break; + } +#else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); +#endif +} + +// For writing of mulitple register entries to make use of address auto increment +// Once the controller has been called and we have written the first bit of data +// the controller will move to the next register meaning we can write sequential blocks. +bool IS31FL_write_multi_registers(uint8_t addr, uint8_t *source_buffer, uint8_t buffer_size, uint8_t transfer_size, uint8_t start_reg_addr) { + // Split the buffer into chunks to transfer + for (int i = 0; i < buffer_size; i += transfer_size) { + // Set the first entry of transfer buffer to the first register we want to write + g_twi_transfer_buffer[0] = i + start_reg_addr; + // Copy the section of our source buffer into the transfer buffer after first register address + memcpy(g_twi_transfer_buffer + 1, source_buffer + i, transfer_size); + +#if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, transfer_size + 1, ISSI_TIMEOUT) != 0) { + return false; + } + } +#else + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, transfer_size + 1, ISSI_TIMEOUT) != 0) { + return false; + } +#endif + } + return true; +} + +void IS31FL_unlock_register(uint8_t addr, uint8_t page) { + // unlock the command register and select Page to write + IS31FL_write_single_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, ISSI_REGISTER_UNLOCK); + IS31FL_write_single_register(addr, ISSI_COMMANDREGISTER, page); +} + +void IS31FL_common_init(uint8_t addr, uint8_t ssr) { + // Setup phase, need to take out of software shutdown and configure + // ISSI_SSR_x is passed to allow Master / Slave setting where applicable + + // Unlock the command register & select Function Register + IS31FL_unlock_register(addr, ISSI_PAGE_FUNCTION); + // Set Configuration Register to remove Software shutdown + IS31FL_write_single_register(addr, ISSI_REG_CONFIGURATION, ISSI_CONFIGURATION); + // Set Golbal Current Control Register + IS31FL_write_single_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT); + // Set Pull up & Down for SWx CSy + IS31FL_write_single_register(addr, ISSI_REG_PULLDOWNUP, ISSI_PULLDOWNUP); +// Set Tempature Status +#ifdef ISSI_REG_TEMP + IS31FL_write_single_register(addr, ISSI_REG_TEMP, ISSI_TEMP); +#endif + // Set Spread Spectrum Register, passed through as sets SYNC function + IS31FL_write_single_register(addr, ISSI_REG_SSR, ssr); +// Set PWM Frequency Enable Register if applicable +#ifdef ISSI_REG_PWM_ENABLE + IS31FL_write_single_register(addr, ISSI_REG_PWM_ENABLE, ISSI_PWM_ENABLE); +#endif +// Set PWM Frequency Register if applicable +#ifdef ISSI_REG_PWM_SET + IS31FL_write_single_register(addr, ISSI_REG_PWM_SET, ISSI_PWM_SET); +#endif + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index) { + if (g_pwm_buffer_update_required[index]) { + // Queue up the correct page + IS31FL_unlock_register(addr, ISSI_PAGE_PWM); + // Hand off the update to IS31FL_write_multi_registers + IS31FL_write_multi_registers(addr, g_pwm_buffer[index], ISSI_MAX_LEDS, ISSI_PWM_TRF_SIZE, ISSI_PWM_REG_1ST); + // Update flags that pwm_buffer has been updated + g_pwm_buffer_update_required[index] = false; + } +} + +#ifdef ISSI_MANUAL_SCALING +void IS31FL_set_manual_scaling_buffer(void) { + for (int i = 0; i < ISSI_MANUAL_SCALING; i++) { + is31_led scale = g_is31_scaling[i]; + if (scale.driver >= 0 && scale.driver < DRIVER_LED_TOTAL) { + is31_led led = g_is31_leds[scale.driver]; + +# ifdef RGB_MATRIX_ENABLE + g_scaling_buffer[led.driver][led.r] = scale.r; + g_scaling_buffer[led.driver][led.g] = scale.g; + g_scaling_buffer[led.driver][led.b] = scale.b; +# elif defined(LED_MATRIX_ENABLE) + g_scaling_buffer[led.driver][led.v] = scale.v; +# endif + g_scaling_buffer_update_required[led.driver] = true; + } + } +} +#endif + +void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index) { + if (g_scaling_buffer_update_required[index]) { + // Queue up the correct page + IS31FL_unlock_register(addr, ISSI_PAGE_SCALING); + // Hand off the update to IS31FL_write_multi_registers + IS31FL_write_multi_registers(addr, g_scaling_buffer[index], ISSI_SCALING_SIZE, ISSI_SCALING_TRF_SIZE, ISSI_SCL_REG_1ST); + // Update flags that scaling_buffer has been updated + g_scaling_buffer_update_required[index] = false; + } +} + +#ifdef RGB_MATRIX_ENABLE +// Colour is set by adjusting PWM register +void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + if (index >= 0 && index < DRIVER_LED_TOTAL) { + is31_led led = g_is31_leds[index]; + + g_pwm_buffer[led.driver][led.r] = red; + g_pwm_buffer[led.driver][led.g] = green; + g_pwm_buffer[led.driver][led.b] = blue; + g_pwm_buffer_update_required[led.driver] = true; + } +} + +void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + IS31FL_RGB_set_color(i, red, green, blue); + } +} + +// Setup Scaling register that decides the peak current of each LED +void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blue) { + is31_led led = g_is31_leds[index]; + if (red) { + g_scaling_buffer[led.driver][led.r] = ISSI_SCAL_RED; + } else { + g_scaling_buffer[led.driver][led.r] = ISSI_SCAL_RED_OFF; + } + if (green) { + g_scaling_buffer[led.driver][led.g] = ISSI_SCAL_GREEN; + } else { + g_scaling_buffer[led.driver][led.g] = ISSI_SCAL_GREEN_OFF; + } + if (blue) { + g_scaling_buffer[led.driver][led.b] = ISSI_SCAL_BLUE; + } else { + g_scaling_buffer[led.driver][led.b] = ISSI_SCAL_BLUE_OFF; + } + g_scaling_buffer_update_required[led.driver] = true; +} + +#elif defined(LED_MATRIX_ENABLE) +// LED Matrix Specific scripts +void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value) { + is31_led led = g_is31_leds[index]; + if (value) { + g_scaling_buffer[led.driver][led.v] = ISSI_SCAL_LED; + } else { + g_scaling_buffer[led.driver][led.v] = ISSI_SCAL_LED_OFF; + } + g_scaling_buffer_update_required[led.driver] = true; +} + +void IS31FL_simple_set_brightness(int index, uint8_t value) { + if (index >= 0 && index < DRIVER_LED_TOTAL) { + is31_led led = g_is31_leds[index]; + g_pwm_buffer[led.driver][led.v] = value; + g_pwm_buffer_update_required[led.driver] = true; + } +} + +void IS31FL_simple_set_brigntness_all(uint8_t value) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + IS31FL_simple_set_brightness(i, value); + } +} +#endif diff --git a/drivers/led/issi/is31flcommon.h b/drivers/led/issi/is31flcommon.h new file mode 100644 index 000000000000..77e9665e3237 --- /dev/null +++ b/drivers/led/issi/is31flcommon.h @@ -0,0 +1,78 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2020 MelGeek + * Copyright 2021 MasterSpoon + * + * 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 +#include +#include "progmem.h" + +// Which variant header file to use +#ifdef IS31FL3742A +# include "is31fl3742.h" +#elif defined(IS31FL3743A) +# include "is31fl3743.h" +#elif defined(IS31FL3745) +# include "is31fl3745.h" +#elif defined(IS31FL3746A) +# include "is31fl3746.h" +#endif + +#ifdef RGB_MATRIX_ENABLE +typedef struct is31_led { + uint8_t driver; + uint8_t r; + uint8_t g; + uint8_t b; +} __attribute__((packed)) is31_led; + +#elif defined(LED_MATRIX_ENABLE) +typedef struct is31_led { + uint8_t driver; + uint8_t v; +} __attribute__((packed)) is31_led; +#endif + +#ifdef ISSI_MANUAL_SCALING +extern const is31_led __flash g_is31_scaling[]; +void IS31FL_set_manual_scaling_buffer(void); +#endif + +extern const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31FL_write_single_register(uint8_t addr, uint8_t reg, uint8_t data); +bool IS31FL_write_multi_registers(uint8_t addr, uint8_t *source_buffer, uint8_t buffer_size, uint8_t transfer_size, uint8_t start_reg_addr); +void IS31FL_unlock_register(uint8_t addr, uint8_t page); +void IS31FL_common_init(uint8_t addr, uint8_t ssr); + +void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index); +void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index); + +#ifdef RGB_MATRIX_ENABLE +// RGB Matrix Specific scripts +void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blue); +#elif defined(LED_MATRIX_ENABLE) +// LED Matrix Specific scripts +void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value); +void IS31FL_simple_set_brightness(int index, uint8_t value); +void IS31FL_simple_set_brigntness_all(uint8_t value); +#endif diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h index 3b56d370dc7e..918b837f07e8 100644 --- a/drivers/oled/oled_driver.h +++ b/drivers/oled/oled_driver.h @@ -34,16 +34,16 @@ along with this program. If not, see . # define OLED_DISPLAY_HEIGHT 64 # endif # ifndef OLED_MATRIX_SIZE -# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 1024 (compile time mathed) +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 1024 (compile time mathed) # endif # ifndef OLED_BLOCK_TYPE # define OLED_BLOCK_TYPE uint16_t # endif # ifndef OLED_BLOCK_COUNT -# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed) +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed) # endif # ifndef OLED_BLOCK_SIZE -# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) # endif # ifndef OLED_COM_PINS # define OLED_COM_PINS COM_PINS_ALT @@ -68,7 +68,7 @@ along with this program. If not, see . // If OLED_BLOCK_TYPE is uint8_t, these tables would look like: // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 } // #define OLED_TARGET_MAP { 56, 120, 48, 112, 40, 104, 32, 96, 24, 88, 16, 80, 8, 72, 0, 64 } -#else // defined(OLED_DISPLAY_128X64) +#else // defined(OLED_DISPLAY_128X64) // Default 128x32 # ifndef OLED_DISPLAY_WIDTH # define OLED_DISPLAY_WIDTH 128 @@ -77,16 +77,16 @@ along with this program. If not, see . # define OLED_DISPLAY_HEIGHT 32 # endif # ifndef OLED_MATRIX_SIZE -# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed) +# define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed) # endif # ifndef OLED_BLOCK_TYPE -# define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only +# define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only # endif # ifndef OLED_BLOCK_COUNT -# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 16 (compile time mathed) +# define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 16 (compile time mathed) # endif # ifndef OLED_BLOCK_SIZE -# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) +# define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) # endif # ifndef OLED_COM_PINS # define OLED_COM_PINS COM_PINS_SEQ @@ -105,7 +105,7 @@ along with this program. If not, see . // If OLED_BLOCK_TYPE is uint8_t, these tables would look like: // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 } // #define OLED_TARGET_MAP { 48, 32, 16, 0, 56, 40, 24, 8 } -#endif // defined(OLED_DISPLAY_CUSTOM) +#endif // defined(OLED_DISPLAY_CUSTOM) #if !defined(OLED_IC) # define OLED_IC OLED_IC_SSD1306 @@ -180,7 +180,7 @@ typedef enum { OLED_ROTATION_0 = 0, OLED_ROTATION_90 = 1, OLED_ROTATION_180 = 2, - OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180 + OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180 } oled_rotation_t; // Initialize the oled display, rotating the rendered output based on the define passed in. @@ -262,7 +262,7 @@ void oled_write_raw_P(const char *data, uint16_t size); # define oled_write_P(data, invert) oled_write(data, invert) # define oled_write_ln_P(data, invert) oled_write(data, invert) # define oled_write_raw_P(data, size) oled_write_raw(data, size) -#endif // defined(__AVR__) +#endif // defined(__AVR__) // Can be used to manually turn on the screen if it is off // Returns true if the screen was on or turns on diff --git a/drivers/oled/ssd1306_sh1106.c b/drivers/oled/ssd1306_sh1106.c index d9bd3c14bd72..30cfeb5648dd 100644 --- a/drivers/oled/ssd1306_sh1106.c +++ b/drivers/oled/ssd1306_sh1106.c @@ -53,7 +53,7 @@ along with this program. If not, see . #define PAGE_ADDR 0x22 #define PAM_SETCOLUMN_LSB 0x00 #define PAM_SETCOLUMN_MSB 0x10 -#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 +#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7 // Hardware Configuration Commands #define DISPLAY_START_LINE 0x40 @@ -97,9 +97,9 @@ along with this program. If not, see . #define I2C_DATA 0x40 #if defined(__AVR__) # define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#else // defined(__AVR__) +#else // defined(__AVR__) # define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) -#endif // defined(__AVR__) +#endif // defined(__AVR__) #define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), OLED_I2C_TIMEOUT) #define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, OLED_I2C_TIMEOUT) @@ -119,7 +119,7 @@ bool oled_inverted = false; uint8_t oled_brightness = OLED_BRIGHTNESS; oled_rotation_t oled_rotation = 0; uint8_t oled_rotation_width = 0; -uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values +uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values uint8_t oled_scroll_start = 0; uint8_t oled_scroll_end = 7; #if OLED_TIMEOUT > 0 @@ -190,7 +190,7 @@ bool oled_init(oled_rotation_t rotation) { #if (OLED_IC != OLED_IC_SH1106) // MEMORY_MODE is unsupported on SH1106 (Page Addressing only) MEMORY_MODE, - 0x00, // Horizontal addressing mode + 0x00, // Horizontal addressing mode #endif }; if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) { @@ -232,8 +232,12 @@ bool oled_init(oled_rotation_t rotation) { return true; } -__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return rotation; } -__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return rotation; } +__attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return rotation; +} +__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return rotation; +} void oled_clear(void) { memset(oled_buffer, 0, sizeof(oled_buffer)); @@ -306,9 +310,9 @@ void oled_render(void) { // Set column & page position static uint8_t display_start[] = {I2C_CMD, COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1}; if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { - calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start + calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start } else { - calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start + calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start } // Send column & page position @@ -368,7 +372,8 @@ void oled_advance_page(bool clearPageRemainder) { remaining = remaining / OLED_FONT_WIDTH; // Write empty character until next line - while (remaining--) oled_write_char(' ', false); + while (remaining--) + oled_write_char(' ', false); } else { // Next page index out of bounds? if (index + remaining >= OLED_MATRIX_SIZE) { @@ -419,7 +424,7 @@ void oled_write_char(const char data, bool invert) { _Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array"); // set the reder buffer data - uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index + uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) { memset(oled_cursor, 0x00, OLED_FONT_WIDTH); } else { @@ -545,7 +550,7 @@ void oled_write_raw_P(const char *data, uint16_t size) { oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); } } -#endif // defined(__AVR__) +#endif // defined(__AVR__) bool oled_on(void) { if (!oled_initialized) { @@ -595,7 +600,9 @@ bool oled_off(void) { return !oled_active; } -bool is_oled_on(void) { return oled_active; } +bool is_oled_on(void) { + return oled_active; +} uint8_t oled_set_brightness(uint8_t level) { if (!oled_initialized) { @@ -613,7 +620,9 @@ uint8_t oled_set_brightness(uint8_t level) { return oled_brightness; } -uint8_t oled_get_brightness(void) { return oled_brightness; } +uint8_t oled_get_brightness(void) { + return oled_brightness; +} // Set the specific 8 lines rows of the screen to scroll. // 0 is the default for start, and 7 for end, which is the entire @@ -693,7 +702,9 @@ bool oled_scroll_off(void) { return !oled_scrolling; } -bool is_oled_scrolling(void) { return oled_scrolling; } +bool is_oled_scrolling(void) { + return oled_scrolling; +} bool oled_invert(bool invert) { if (!oled_initialized) { @@ -777,5 +788,9 @@ void oled_task(void) { #endif } -__attribute__((weak)) bool oled_task_kb(void) { return oled_task_user(); } -__attribute__((weak)) bool oled_task_user(void) { return true; } +__attribute__((weak)) bool oled_task_kb(void) { + return oled_task_user(); +} +__attribute__((weak)) bool oled_task_user(void) { + return true; +} diff --git a/drivers/ps2/ps2_busywait.c b/drivers/ps2/ps2_busywait.c index a4260901550e..18e2501a2664 100644 --- a/drivers/ps2/ps2_busywait.c +++ b/drivers/ps2/ps2_busywait.c @@ -71,12 +71,12 @@ uint8_t ps2_host_send(uint8_t data) { /* terminate a transmission if we have */ inhibit(); - wait_us(100); // 100us [4]p.13, [5]p.50 + wait_us(100); // 100us [4]p.13, [5]p.50 /* 'Request to Send' and Start bit */ data_lo(); clock_hi(); - WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 + WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 /* Data bit */ for (uint8_t i = 0; i < 8; i++) { @@ -142,7 +142,7 @@ uint8_t ps2_host_recv(void) { idle(); /* start bit [1] */ - WAIT(clock_lo, 100, 1); // TODO: this is enough? + WAIT(clock_lo, 100, 1); // TODO: this is enough? WAIT(data_lo, 1, 2); WAIT(clock_hi, 50, 3); diff --git a/drivers/ps2/ps2_interrupt.c b/drivers/ps2/ps2_interrupt.c index 70debd02f7fa..c49b4f8b75e5 100644 --- a/drivers/ps2/ps2_interrupt.c +++ b/drivers/ps2/ps2_interrupt.c @@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE. #if defined(__AVR__) # include -#elif defined(PROTOCOL_CHIBIOS) // TODO: or STM32 ? +#elif defined(PROTOCOL_CHIBIOS) // TODO: or STM32 ? // chibiOS headers # include "ch.h" # include "hal.h" @@ -71,7 +71,9 @@ static inline void pbuf_clear(void); #if defined(PROTOCOL_CHIBIOS) void ps2_interrupt_service_routine(void); -void palCallback(void *arg) { ps2_interrupt_service_routine(); } +void palCallback(void *arg) { + ps2_interrupt_service_routine(); +} # define PS2_INT_INIT() \ { palSetLineMode(PS2_CLOCK_PIN, PAL_MODE_INPUT); } \ @@ -85,7 +87,7 @@ void palCallback(void *arg) { ps2_interrupt_service_routine(); } # define PS2_INT_OFF() \ { palDisableLineEvent(PS2_CLOCK_PIN); } \ while (0) -#endif // PROTOCOL_CHIBIOS +#endif // PROTOCOL_CHIBIOS void ps2_host_init(void) { idle(); @@ -103,12 +105,12 @@ uint8_t ps2_host_send(uint8_t data) { /* terminate a transmission if we have */ inhibit(); - wait_us(100); // 100us [4]p.13, [5]p.50 + wait_us(100); // 100us [4]p.13, [5]p.50 /* 'Request to Send' and Start bit */ data_lo(); clock_hi(); - WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 + WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 /* Data bit[2-9] */ for (uint8_t i = 0; i < 8; i++) { @@ -244,7 +246,9 @@ void ps2_interrupt_service_routine(void) { } #if defined(__AVR__) -ISR(PS2_INT_VECT) { ps2_interrupt_service_routine(); } +ISR(PS2_INT_VECT) { + ps2_interrupt_service_routine(); +} #endif /* send LED state to keyboard */ diff --git a/drivers/ps2/ps2_mouse.c b/drivers/ps2/ps2_mouse.c index 8a6668b41069..ccb0a929aef3 100644 --- a/drivers/ps2/ps2_mouse.c +++ b/drivers/ps2/ps2_mouse.c @@ -42,7 +42,7 @@ static inline void ps2_mouse_scroll_button_task(report_mouse_t *mouse_report); void ps2_mouse_init(void) { ps2_host_init(); - wait_ms(PS2_MOUSE_INIT_DELAY); // wait for powering up + wait_ms(PS2_MOUSE_INIT_DELAY); // wait for powering up PS2_MOUSE_SEND(PS2_MOUSE_RESET, "ps2_mouse_init: sending reset"); @@ -113,9 +113,13 @@ void ps2_mouse_task(void) { ps2_mouse_clear_report(&mouse_report); } -void ps2_mouse_disable_data_reporting(void) { PS2_MOUSE_SEND(PS2_MOUSE_DISABLE_DATA_REPORTING, "ps2 mouse disable data reporting"); } +void ps2_mouse_disable_data_reporting(void) { + PS2_MOUSE_SEND(PS2_MOUSE_DISABLE_DATA_REPORTING, "ps2 mouse disable data reporting"); +} -void ps2_mouse_enable_data_reporting(void) { PS2_MOUSE_SEND(PS2_MOUSE_ENABLE_DATA_REPORTING, "ps2 mouse enable data reporting"); } +void ps2_mouse_enable_data_reporting(void) { + PS2_MOUSE_SEND(PS2_MOUSE_ENABLE_DATA_REPORTING, "ps2 mouse enable data reporting"); +} void ps2_mouse_set_remote_mode(void) { PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_REMOTE_MODE, "ps2 mouse set remote mode"); @@ -127,13 +131,21 @@ void ps2_mouse_set_stream_mode(void) { ps2_mouse_mode = PS2_MOUSE_STREAM_MODE; } -void ps2_mouse_set_scaling_2_1(void) { PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_2_1, "ps2 mouse set scaling 2:1"); } +void ps2_mouse_set_scaling_2_1(void) { + PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_2_1, "ps2 mouse set scaling 2:1"); +} -void ps2_mouse_set_scaling_1_1(void) { PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_1_1, "ps2 mouse set scaling 1:1"); } +void ps2_mouse_set_scaling_1_1(void) { + PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_1_1, "ps2 mouse set scaling 1:1"); +} -void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution) { PS2_MOUSE_SET_SAFE(PS2_MOUSE_SET_RESOLUTION, resolution, "ps2 mouse set resolution"); } +void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution) { + PS2_MOUSE_SET_SAFE(PS2_MOUSE_SET_RESOLUTION, resolution, "ps2 mouse set resolution"); +} -void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate) { PS2_MOUSE_SET_SAFE(PS2_MOUSE_SET_SAMPLE_RATE, sample_rate, "ps2 mouse set sample rate"); } +void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate) { + PS2_MOUSE_SET_SAFE(PS2_MOUSE_SET_SAMPLE_RATE, sample_rate, "ps2 mouse set sample rate"); +} /* ============================= HELPERS ============================ */ @@ -165,7 +177,7 @@ static inline void ps2_mouse_convert_report_to_hid(report_mouse_t *mouse_report) #ifdef PS2_MOUSE_INVERT_X mouse_report->x = -mouse_report->x; #endif -#ifndef PS2_MOUSE_INVERT_Y // NOTE if not! +#ifndef PS2_MOUSE_INVERT_Y // NOTE if not! // invert coordinate of y to conform to USB HID mouse mouse_report->y = -mouse_report->y; #endif diff --git a/drivers/sensors/adns5050.c b/drivers/sensors/adns5050.c index c23d24d5af5e..b76268fba267 100644 --- a/drivers/sensors/adns5050.c +++ b/drivers/sensors/adns5050.c @@ -74,9 +74,13 @@ void adns5050_sync(void) { writePinHigh(ADNS5050_CS_PIN); } -void adns5050_cs_select(void) { writePinLow(ADNS5050_CS_PIN); } +void adns5050_cs_select(void) { + writePinLow(ADNS5050_CS_PIN); +} -void adns5050_cs_deselect(void) { writePinHigh(ADNS5050_CS_PIN); } +void adns5050_cs_deselect(void) { + writePinHigh(ADNS5050_CS_PIN); +} uint8_t adns5050_serial_read(void) { setPinInput(ADNS5050_SDIO_PIN); @@ -190,7 +194,7 @@ int8_t convert_twoscomp(uint8_t data) { // Don't forget to use the definitions for CPI in the header file. void adns5050_set_cpi(uint16_t cpi) { - uint8_t cpival = constrain((cpi / 125), 0x1, 0xD); // limits to 0--119 + uint8_t cpival = constrain((cpi / 125), 0x1, 0xD); // limits to 0--119 adns5050_write_reg(REG_MOUSE_CONTROL2, 0b10000 | cpival); } diff --git a/drivers/sensors/adns9800.c b/drivers/sensors/adns9800.c index c52f9918045d..3633f23e5247 100644 --- a/drivers/sensors/adns9800.c +++ b/drivers/sensors/adns9800.c @@ -77,7 +77,9 @@ #define MSB1 0x80 // clang-format on -void adns9800_spi_start(void) { spi_start(ADNS9800_CS_PIN, false, ADNS9800_SPI_MODE, ADNS9800_SPI_DIVISOR); } +void adns9800_spi_start(void) { + spi_start(ADNS9800_CS_PIN, false, ADNS9800_SPI_MODE, ADNS9800_SPI_DIVISOR); +} void adns9800_write(uint8_t reg_addr, uint8_t data) { adns9800_spi_start(); @@ -135,10 +137,8 @@ void adns9800_init() { wait_us(15); // send all bytes of the firmware - unsigned char c; - for (int i = 0; i < FIRMWARE_LENGTH; i++) { - c = (unsigned char)pgm_read_byte(adns9800_firmware_data + i); - spi_write(c); + for (uint16_t i = 0; i < FIRMWARE_LENGTH; i++) { + spi_write(pgm_read_byte(firmware_data + i)); wait_us(15); } @@ -154,8 +154,8 @@ void adns9800_init() { } config_adns9800_t adns9800_get_config(void) { - uint8_t config_1 = adns9800_read(REG_Configuration_I); - return (config_adns9800_t){(config_1 & 0xFF) * CPI_STEP}; + uint8_t cpival = adns9800_read(REG_Configuration_I); + return (config_adns9800_t){(cpival & 0xFF) * CPI_STEP}; } void adns9800_set_config(config_adns9800_t config) { @@ -164,8 +164,8 @@ void adns9800_set_config(config_adns9800_t config) { } uint16_t adns9800_get_cpi(void) { - uint8_t config_1 = adns9800_read(REG_Configuration_I); - return (uint16_t){(config_1 & 0xFF) * CPI_STEP}; + uint8_t cpival = adns9800_read(REG_Configuration_I); + return (uint16_t)(cpival & 0xFF) * CPI_STEP; } void adns9800_set_cpi(uint16_t cpi) { @@ -184,7 +184,7 @@ static int16_t convertDeltaToInt(uint8_t high, uint8_t low) { } report_adns9800_t adns9800_get_report(void) { - report_adns9800_t report = {0, 0}; + report_adns9800_t report = {0}; adns9800_spi_start(); diff --git a/drivers/sensors/adns9800_srom_A6.h b/drivers/sensors/adns9800_srom_A6.h index d86ecbbd9ebc..e698a401b949 100644 --- a/drivers/sensors/adns9800_srom_A6.h +++ b/drivers/sensors/adns9800_srom_A6.h @@ -6,7 +6,7 @@ // clang-format off -const uint8_t adns9800_firmware_data[FIRMWARE_LENGTH] PROGMEM = { +const uint8_t firmware_data[FIRMWARE_LENGTH] PROGMEM = { 0x03, 0xA6, 0x68, 0x1E, 0x7D, 0x10, 0x7E, 0x7E, 0x5F, 0x1C, 0xB8, 0xF2, 0x47, 0x0C, 0x7B, 0x74, 0x4B, 0x14, 0x8B, 0x75, 0x66, 0x51, 0x0B, 0x8C, 0x76, 0x74, 0x4B, 0x14, 0xAA, 0xD6, 0x0F, 0x9C, 0xBA, 0xF6, 0x6E, 0x3F, 0xDD, 0x38, 0xD5, 0x02, 0x80, 0x9B, 0x82, 0x6D, 0x58, 0x13, 0xA4, 0xAB, diff --git a/drivers/sensors/analog_joystick.c b/drivers/sensors/analog_joystick.c index 1666bed047dd..95f8cff23ab2 100644 --- a/drivers/sensors/analog_joystick.c +++ b/drivers/sensors/analog_joystick.c @@ -24,7 +24,7 @@ uint16_t minAxisValue = ANALOG_JOYSTICK_AXIS_MIN; uint16_t maxAxisValue = ANALOG_JOYSTICK_AXIS_MAX; uint8_t maxCursorSpeed = ANALOG_JOYSTICK_SPEED_MAX; -uint8_t speedRegulator = ANALOG_JOYSTICK_SPEED_REGULATOR; // Lower Values Create Faster Movement +uint8_t speedRegulator = ANALOG_JOYSTICK_SPEED_REGULATOR; // Lower Values Create Faster Movement int16_t xOrigin, yOrigin; diff --git a/drivers/sensors/cirque_pinnacle.c b/drivers/sensors/cirque_pinnacle.c index b807c4f07660..2db7f916fed3 100644 --- a/drivers/sensors/cirque_pinnacle.c +++ b/drivers/sensors/cirque_pinnacle.c @@ -54,7 +54,9 @@ void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count); void RAP_Write(uint8_t address, uint8_t data); #ifdef CONSOLE_ENABLE -void print_byte(uint8_t byte) { xprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); } +void print_byte(uint8_t byte) { + xprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); +} #endif /* Logical Scaling Functions */ @@ -73,8 +75,12 @@ void ClipCoordinates(pinnacle_data_t* coordinates) { } } -uint16_t cirque_pinnacle_get_scale(void) { return scale_data; } -void cirque_pinnacle_set_scale(uint16_t scale) { scale_data = scale; } +uint16_t cirque_pinnacle_get_scale(void) { + return scale_data; +} +void cirque_pinnacle_set_scale(uint16_t scale) { + scale_data = scale; +} // Scales data to desired X & Y resolution void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResolution, uint16_t yResolution) { @@ -105,13 +111,13 @@ void cirque_pinnacle_clear_flags() { void cirque_pinnacle_enable_feed(bool feedEnable) { uint8_t temp; - RAP_ReadBytes(FEEDCONFIG_1, &temp, 1); // Store contents of FeedConfig1 register + RAP_ReadBytes(FEEDCONFIG_1, &temp, 1); // Store contents of FeedConfig1 register if (feedEnable) { - temp |= 0x01; // Set Feed Enable bit + temp |= 0x01; // Set Feed Enable bit RAP_Write(0x04, temp); } else { - temp &= ~0x01; // Clear Feed Enable bit + temp &= ~0x01; // Clear Feed Enable bit RAP_Write(0x04, temp); } } @@ -122,13 +128,13 @@ void cirque_pinnacle_enable_feed(bool feedEnable) { void ERA_ReadBytes(uint16_t address, uint8_t* data, uint16_t count) { uint8_t ERAControlValue = 0xFF; - cirque_pinnacle_enable_feed(false); // Disable feed + cirque_pinnacle_enable_feed(false); // Disable feed - RAP_Write(ERA_HIGH_BYTE, (uint8_t)(address >> 8)); // Send upper byte of ERA address - RAP_Write(ERA_LOW_BYTE, (uint8_t)(address & 0x00FF)); // Send lower byte of ERA address + RAP_Write(ERA_HIGH_BYTE, (uint8_t)(address >> 8)); // Send upper byte of ERA address + RAP_Write(ERA_LOW_BYTE, (uint8_t)(address & 0x00FF)); // Send lower byte of ERA address for (uint16_t i = 0; i < count; i++) { - RAP_Write(ERA_CONTROL, 0x05); // Signal ERA-read (auto-increment) to Pinnacle + RAP_Write(ERA_CONTROL, 0x05); // Signal ERA-read (auto-increment) to Pinnacle // Wait for status register 0x1E to clear do { @@ -145,14 +151,14 @@ void ERA_ReadBytes(uint16_t address, uint8_t* data, uint16_t count) { void ERA_WriteByte(uint16_t address, uint8_t data) { uint8_t ERAControlValue = 0xFF; - cirque_pinnacle_enable_feed(false); // Disable feed + cirque_pinnacle_enable_feed(false); // Disable feed - RAP_Write(ERA_VALUE, data); // Send data byte to be written + RAP_Write(ERA_VALUE, data); // Send data byte to be written - RAP_Write(ERA_HIGH_BYTE, (uint8_t)(address >> 8)); // Upper byte of ERA address - RAP_Write(ERA_LOW_BYTE, (uint8_t)(address & 0x00FF)); // Lower byte of ERA address + RAP_Write(ERA_HIGH_BYTE, (uint8_t)(address >> 8)); // Upper byte of ERA address + RAP_Write(ERA_LOW_BYTE, (uint8_t)(address & 0x00FF)); // Lower byte of ERA address - RAP_Write(ERA_CONTROL, 0x02); // Signal an ERA-write to Pinnacle + RAP_Write(ERA_CONTROL, 0x02); // Signal an ERA-write to Pinnacle // Wait for status register 0x1E to clear do { @@ -166,7 +172,7 @@ void cirque_pinnacle_set_adc_attenuation(uint8_t adcGain) { uint8_t temp = 0x00; ERA_ReadBytes(0x0187, &temp, 1); - temp &= 0x3F; // clear top two bits + temp &= 0x3F; // clear top two bits temp |= adcGain; ERA_WriteByte(0x0187, temp); ERA_ReadBytes(0x0187, &temp, 1); diff --git a/drivers/sensors/cirque_pinnacle.h b/drivers/sensors/cirque_pinnacle.h index db891122a661..c8cb360e0388 100644 --- a/drivers/sensors/cirque_pinnacle.h +++ b/drivers/sensors/cirque_pinnacle.h @@ -26,16 +26,16 @@ void cirque_pinnacle_set_scale(uint16_t scale); // Coordinate scaling values #ifndef CIRQUE_PINNACLE_X_LOWER -# define CIRQUE_PINNACLE_X_LOWER 127 // min "reachable" X value +# define CIRQUE_PINNACLE_X_LOWER 127 // min "reachable" X value #endif #ifndef CIRQUE_PINNACLE_X_UPPER -# define CIRQUE_PINNACLE_X_UPPER 1919 // max "reachable" X value +# define CIRQUE_PINNACLE_X_UPPER 1919 // max "reachable" X value #endif #ifndef CIRQUE_PINNACLE_Y_LOWER -# define CIRQUE_PINNACLE_Y_LOWER 63 // min "reachable" Y value +# define CIRQUE_PINNACLE_Y_LOWER 63 // min "reachable" Y value #endif #ifndef CIRQUE_PINNACLE_Y_UPPER -# define CIRQUE_PINNACLE_Y_UPPER 1471 // max "reachable" Y value +# define CIRQUE_PINNACLE_Y_UPPER 1471 // max "reachable" Y value #endif #ifndef CIRQUE_PINNACLE_X_RANGE # define CIRQUE_PINNACLE_X_RANGE (CIRQUE_PINNACLE_X_UPPER - CIRQUE_PINNACLE_X_LOWER) diff --git a/drivers/sensors/cirque_pinnacle_i2c.c b/drivers/sensors/cirque_pinnacle_i2c.c index 81dd982b0cc8..8a38f1dcea0e 100644 --- a/drivers/sensors/cirque_pinnacle_i2c.c +++ b/drivers/sensors/cirque_pinnacle_i2c.c @@ -14,7 +14,7 @@ extern bool touchpad_init; /* RAP Functions */ // Reads Pinnacle registers starting at
void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) { - uint8_t cmdByte = READ_MASK | address; // Form the READ command byte + uint8_t cmdByte = READ_MASK | address; // Form the READ command byte if (touchpad_init) { i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT); if (i2c_readReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) { @@ -29,7 +29,7 @@ void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) { // Writes single-byte to
void RAP_Write(uint8_t address, uint8_t data) { - uint8_t cmdByte = WRITE_MASK | address; // Form the WRITE command byte + uint8_t cmdByte = WRITE_MASK | address; // Form the WRITE command byte if (touchpad_init) { if (i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) { diff --git a/drivers/sensors/cirque_pinnacle_spi.c b/drivers/sensors/cirque_pinnacle_spi.c index ed40abd9fa1f..e00e73eb8cf6 100644 --- a/drivers/sensors/cirque_pinnacle_spi.c +++ b/drivers/sensors/cirque_pinnacle_spi.c @@ -13,14 +13,14 @@ extern bool touchpad_init; /* RAP Functions */ // Reads Pinnacle registers starting at
void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) { - uint8_t cmdByte = READ_MASK | address; // Form the READ command byte + uint8_t cmdByte = READ_MASK | address; // Form the READ command byte if (touchpad_init) { if (spi_start(CIRQUE_PINNACLE_SPI_CS_PIN, CIRQUE_PINNACLE_SPI_LSBFIRST, CIRQUE_PINNACLE_SPI_MODE, CIRQUE_PINNACLE_SPI_DIVISOR)) { spi_write(cmdByte); - spi_read(); // filler - spi_read(); // filler + spi_read(); // filler + spi_read(); // filler for (uint8_t i = 0; i < count; i++) { - data[i] = spi_read(); // each sepsequent read gets another register's contents + data[i] = spi_read(); // each sepsequent read gets another register's contents } } else { #ifdef CONSOLE_ENABLE @@ -34,7 +34,7 @@ void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) { // Writes single-byte to
void RAP_Write(uint8_t address, uint8_t data) { - uint8_t cmdByte = WRITE_MASK | address; // Form the WRITE command byte + uint8_t cmdByte = WRITE_MASK | address; // Form the WRITE command byte if (touchpad_init) { if (spi_start(CIRQUE_PINNACLE_SPI_CS_PIN, CIRQUE_PINNACLE_SPI_LSBFIRST, CIRQUE_PINNACLE_SPI_MODE, CIRQUE_PINNACLE_SPI_DIVISOR)) { diff --git a/drivers/sensors/pimoroni_trackball.c b/drivers/sensors/pimoroni_trackball.c index 7d390056ead4..333e017a0642 100644 --- a/drivers/sensors/pimoroni_trackball.c +++ b/drivers/sensors/pimoroni_trackball.c @@ -33,8 +33,26 @@ static uint16_t precision = 128; -float pimoroni_trackball_get_precision(void) { return ((float)precision / 128); } -void pimoroni_trackball_set_precision(float floatprecision) { precision = (floatprecision * 128); } +uint16_t pimoroni_trackball_get_cpi(void) { + return (precision * 125); +} +/** + * @brief Sets the scaling value for pimoroni trackball + * + * Sets a scaling value for pimoroni trackball to allow runtime adjustment. This isn't used by the sensor and is an + * approximation so the functions are consistent across drivers. + * + * NOTE: This rounds down to the nearest number divisable by 125 that's a positive integer, values below 125 are clamped to 125. + * + * @param cpi uint16_t + */ +void pimoroni_trackball_set_cpi(uint16_t cpi) { + if (cpi < 249) { + precision = 1; + } else { + precision = (cpi - (cpi % 125)) / 125; + } +} void pimoroni_trackball_set_rgbw(uint8_t r, uint8_t g, uint8_t b, uint8_t w) { uint8_t data[4] = {r, g, b, w}; @@ -60,7 +78,7 @@ i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data) { return status; } -__attribute__((weak)) void pimironi_trackball_device_init(void) { +__attribute__((weak)) void pimoroni_trackball_device_init(void) { i2c_init(); pimoroni_trackball_set_rgbw(0x00, 0x00, 0x00, 0x00); } diff --git a/drivers/sensors/pimoroni_trackball.h b/drivers/sensors/pimoroni_trackball.h index 59ee8724ba66..e20ee748a75b 100644 --- a/drivers/sensors/pimoroni_trackball.h +++ b/drivers/sensors/pimoroni_trackball.h @@ -23,9 +23,6 @@ #ifndef PIMORONI_TRACKBALL_ADDRESS # define PIMORONI_TRACKBALL_ADDRESS 0x0A #endif -#ifndef PIMORONI_TRACKBALL_INTERVAL_MS -# define PIMORONI_TRACKBALL_INTERVAL_MS 8 -#endif #ifndef PIMORONI_TRACKBALL_SCALE # define PIMORONI_TRACKBALL_SCALE 5 #endif @@ -52,10 +49,10 @@ typedef struct { uint8_t click; } pimoroni_data_t; -void pimironi_trackball_device_init(void); +void pimoroni_trackball_device_init(void); void pimoroni_trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white); int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_dir, uint8_t scale); void pimoroni_trackball_adapt_values(int8_t* mouse, int16_t* offset); -float pimoroni_trackball_get_precision(void); -void pimoroni_trackball_set_precision(float precision); +uint16_t pimoroni_trackball_get_cpi(void); +void pimoroni_trackball_set_cpi(uint16_t cpi); i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data); diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c index 50d1c3580185..8c977be1c816 100644 --- a/drivers/sensors/pmw3360.c +++ b/drivers/sensors/pmw3360.c @@ -16,136 +16,126 @@ * along with this program. If not, see . */ +#include "spi_master.h" #include "pmw3360.h" #include "wait.h" #include "debug.h" #include "print.h" -#include PMW3360_FIRMWARE_H +#include "pmw3360_firmware.h" // Registers // clang-format off -#define REG_Product_ID 0x00 -#define REG_Revision_ID 0x01 -#define REG_Motion 0x02 -#define REG_Delta_X_L 0x03 -#define REG_Delta_X_H 0x04 -#define REG_Delta_Y_L 0x05 -#define REG_Delta_Y_H 0x06 -#define REG_SQUAL 0x07 -#define REG_Raw_Data_Sum 0x08 -#define REG_Maximum_Raw_data 0x09 -#define REG_Minimum_Raw_data 0x0A -#define REG_Shutter_Lower 0x0B -#define REG_Shutter_Upper 0x0C -#define REG_Control 0x0D -#define REG_Config1 0x0F -#define REG_Config2 0x10 -#define REG_Angle_Tune 0x11 -#define REG_Frame_Capture 0x12 -#define REG_SROM_Enable 0x13 -#define REG_Run_Downshift 0x14 -#define REG_Rest1_Rate_Lower 0x15 -#define REG_Rest1_Rate_Upper 0x16 -#define REG_Rest1_Downshift 0x17 -#define REG_Rest2_Rate_Lower 0x18 -#define REG_Rest2_Rate_Upper 0x19 -#define REG_Rest2_Downshift 0x1A -#define REG_Rest3_Rate_Lower 0x1B -#define REG_Rest3_Rate_Upper 0x1C -#define REG_Observation 0x24 -#define REG_Data_Out_Lower 0x25 -#define REG_Data_Out_Upper 0x26 -#define REG_Raw_Data_Dump 0x29 -#define REG_SROM_ID 0x2A -#define REG_Min_SQ_Run 0x2B -#define REG_Raw_Data_Threshold 0x2C -#define REG_Config5 0x2F -#define REG_Power_Up_Reset 0x3A -#define REG_Shutdown 0x3B -#define REG_Inverse_Product_ID 0x3F -#define REG_LiftCutoff_Tune3 0x41 -#define REG_Angle_Snap 0x42 -#define REG_LiftCutoff_Tune1 0x4A -#define REG_Motion_Burst 0x50 -#define REG_LiftCutoff_Tune_Timeout 0x58 -#define REG_LiftCutoff_Tune_Min_Length 0x5A -#define REG_SROM_Load_Burst 0x62 -#define REG_Lift_Config 0x63 -#define REG_Raw_Data_Burst 0x64 -#define REG_LiftCutoff_Tune2 0x65 +#define REG_Product_ID 0x00 +#define REG_Revision_ID 0x01 +#define REG_Motion 0x02 +#define REG_Delta_X_L 0x03 +#define REG_Delta_X_H 0x04 +#define REG_Delta_Y_L 0x05 +#define REG_Delta_Y_H 0x06 +#define REG_SQUAL 0x07 +#define REG_Raw_Data_Sum 0x08 +#define REG_Maximum_Raw_data 0x09 +#define REG_Minimum_Raw_data 0x0a +#define REG_Shutter_Lower 0x0b +#define REG_Shutter_Upper 0x0c +#define REG_Control 0x0d +#define REG_Config1 0x0f +#define REG_Config2 0x10 +#define REG_Angle_Tune 0x11 +#define REG_Frame_Capture 0x12 +#define REG_SROM_Enable 0x13 +#define REG_Run_Downshift 0x14 +#define REG_Rest1_Rate_Lower 0x15 +#define REG_Rest1_Rate_Upper 0x16 +#define REG_Rest1_Downshift 0x17 +#define REG_Rest2_Rate_Lower 0x18 +#define REG_Rest2_Rate_Upper 0x19 +#define REG_Rest2_Downshift 0x1a +#define REG_Rest3_Rate_Lower 0x1b +#define REG_Rest3_Rate_Upper 0x1c +#define REG_Observation 0x24 +#define REG_Data_Out_Lower 0x25 +#define REG_Data_Out_Upper 0x26 +#define REG_Raw_Data_Dump 0x29 +#define REG_SROM_ID 0x2a +#define REG_Min_SQ_Run 0x2b +#define REG_Raw_Data_Threshold 0x2c +#define REG_Config5 0x2f +#define REG_Power_Up_Reset 0x3a +#define REG_Shutdown 0x3b +#define REG_Inverse_Product_ID 0x3f +#define REG_LiftCutoff_Tune3 0x41 +#define REG_Angle_Snap 0x42 +#define REG_LiftCutoff_Tune1 0x4a +#define REG_Motion_Burst 0x50 +#define REG_LiftCutoff_Tune_Timeout 0x58 +#define REG_LiftCutoff_Tune_Min_Length 0x5a +#define REG_SROM_Load_Burst 0x62 +#define REG_Lift_Config 0x63 +#define REG_Raw_Data_Burst 0x64 +#define REG_LiftCutoff_Tune2 0x65 + +#define CPI_STEP 100 // clang-format on +// limits to 0--119, resulting in a CPI range of 100 -- 12000 (as only steps of 100 are possible). #ifndef MAX_CPI -# define MAX_CPI 0x77 // limits to 0--119, should be max cpi/100 +# define MAX_CPI 0x77 #endif bool _inBurst = false; #ifdef CONSOLE_ENABLE -void print_byte(uint8_t byte) { dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); } +void print_byte(uint8_t byte) { + dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); +} #endif #define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) -bool spi_start_adv(void) { +bool pmw3360_spi_start(void) { bool status = spi_start(PMW3360_CS_PIN, PMW3360_SPI_LSBFIRST, PMW3360_SPI_MODE, PMW3360_SPI_DIVISOR); + // tNCS-SCLK, 120ns wait_us(1); return status; } -void spi_stop_adv(void) { - wait_us(1); - spi_stop(); -} +spi_status_t pmw3360_write(uint8_t reg_addr, uint8_t data) { + pmw3360_spi_start(); -spi_status_t spi_write_adv(uint8_t reg_addr, uint8_t data) { if (reg_addr != REG_Motion_Burst) { _inBurst = false; } - spi_start_adv(); // send address of the register, with MSBit = 1 to indicate it's a write spi_status_t status = spi_write(reg_addr | 0x80); status = spi_write(data); - // tSCLK-NCS for write operation - wait_us(20); - - // tSWW/tSWR (=120us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound - wait_us(100); + // tSCLK-NCS for write operation is 35us + wait_us(35); spi_stop(); + + // tSWW/tSWR (=180us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound + wait_us(145); return status; } -uint8_t spi_read_adv(uint8_t reg_addr) { - spi_start_adv(); +uint8_t pmw3360_read(uint8_t reg_addr) { + pmw3360_spi_start(); // send adress of the register, with MSBit = 0 to indicate it's a read spi_write(reg_addr & 0x7f); - + // tSRAD (=160us) + wait_us(160); uint8_t data = spi_read(); // tSCLK-NCS for read operation is 120ns wait_us(1); + spi_stop(); // tSRW/tSRR (=20us) minus tSCLK-NCS wait_us(19); - - spi_stop(); return data; } -void pmw3360_set_cpi(uint16_t cpi) { - uint8_t cpival = constrain((cpi / 100) - 1, 0, MAX_CPI); - - spi_start_adv(); - spi_write_adv(REG_Config1, cpival); - spi_stop(); -} - -uint16_t pmw3360_get_cpi(void) { - uint8_t cpival = spi_read_adv(REG_Config1); - return (uint16_t)((cpival + 1) & 0xFF) * 100; -} - bool pmw3360_init(void) { setPinOutput(PMW3360_CS_PIN); @@ -153,42 +143,51 @@ bool pmw3360_init(void) { _inBurst = false; spi_stop(); - spi_start_adv(); + pmw3360_spi_start(); spi_stop(); - spi_write_adv(REG_Shutdown, 0xb6); // Shutdown first + pmw3360_write(REG_Shutdown, 0xb6); // Shutdown first wait_ms(300); - spi_start_adv(); + pmw3360_spi_start(); wait_us(40); - spi_stop_adv(); + spi_stop(); wait_us(40); - spi_write_adv(REG_Power_Up_Reset, 0x5a); + // power up, need to first drive NCS high then low, see above. + pmw3360_write(REG_Power_Up_Reset, 0x5a); wait_ms(50); - spi_read_adv(REG_Motion); - spi_read_adv(REG_Delta_X_L); - spi_read_adv(REG_Delta_X_H); - spi_read_adv(REG_Delta_Y_L); - spi_read_adv(REG_Delta_Y_H); + // read registers and discard + pmw3360_read(REG_Motion); + pmw3360_read(REG_Delta_X_L); + pmw3360_read(REG_Delta_X_H); + pmw3360_read(REG_Delta_Y_L); + pmw3360_read(REG_Delta_Y_H); pmw3360_upload_firmware(); - spi_stop_adv(); + spi_stop(); wait_ms(10); pmw3360_set_cpi(PMW3360_CPI); wait_ms(1); - spi_write_adv(REG_Config2, 0x00); + pmw3360_write(REG_Config2, 0x00); - spi_write_adv(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -30, 30)); + pmw3360_write(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -127, 127)); - spi_write_adv(REG_Lift_Config, PMW3360_LIFTOFF_DISTANCE); + pmw3360_write(REG_Lift_Config, PMW3360_LIFTOFF_DISTANCE); bool init_success = pmw3360_check_signature(); +#ifdef CONSOLE_ENABLE + if (init_success) { + dprintf("pmw3360 signature verified"); + } else { + dprintf("pmw3360 signature verification failed!"); + } +#endif writePinLow(PMW3360_CS_PIN); @@ -196,86 +195,94 @@ bool pmw3360_init(void) { } void pmw3360_upload_firmware(void) { - spi_write_adv(REG_SROM_Enable, 0x1d); + // Datasheet claims we need to disable REST mode first, but during startup + // it's already disabled and we're not turning it on ... + // pmw3360_write(REG_Config2, 0x00); // disable REST mode + pmw3360_write(REG_SROM_Enable, 0x1d); wait_ms(10); - spi_write_adv(REG_SROM_Enable, 0x18); + pmw3360_write(REG_SROM_Enable, 0x18); - spi_start_adv(); + pmw3360_spi_start(); spi_write(REG_SROM_Load_Burst | 0x80); wait_us(15); - unsigned char c; - for (int i = 0; i < FIRMWARE_LENGTH; i++) { - c = (unsigned char)pgm_read_byte(firmware_data + i); - spi_write(c); + for (uint16_t i = 0; i < FIRMWARE_LENGTH; i++) { + spi_write(pgm_read_byte(firmware_data + i)); +#ifndef PMW3360_FIRMWARE_UPLOAD_FAST wait_us(15); +#endif } wait_us(200); - spi_read_adv(REG_SROM_ID); + pmw3360_read(REG_SROM_ID); + pmw3360_write(REG_Config2, 0x00); +} - spi_write_adv(REG_Config2, 0x00); +bool pmw3360_check_signature(void) { + uint8_t pid = pmw3360_read(REG_Product_ID); + uint8_t iv_pid = pmw3360_read(REG_Inverse_Product_ID); + uint8_t SROM_ver = pmw3360_read(REG_SROM_ID); + return (pid == firmware_signature[0] && iv_pid == firmware_signature[1] && SROM_ver == firmware_signature[2]); // signature for SROM 0x04 +} - spi_stop(); - wait_ms(10); +uint16_t pmw3360_get_cpi(void) { + uint8_t cpival = pmw3360_read(REG_Config1); + return (uint16_t)((cpival + 1) & 0xFF) * CPI_STEP; } -bool pmw3360_check_signature(void) { - uint8_t pid = spi_read_adv(REG_Product_ID); - uint8_t iv_pid = spi_read_adv(REG_Inverse_Product_ID); - uint8_t SROM_ver = spi_read_adv(REG_SROM_ID); - return (pid == firmware_signature[0] && iv_pid == firmware_signature[1] && SROM_ver == firmware_signature[2]); // signature for SROM 0x04 +void pmw3360_set_cpi(uint16_t cpi) { + uint8_t cpival = constrain((cpi / CPI_STEP) - 1, 0, MAX_CPI); + pmw3360_write(REG_Config1, cpival); } report_pmw3360_t pmw3360_read_burst(void) { + report_pmw3360_t report = {0}; + if (!_inBurst) { #ifdef CONSOLE_ENABLE dprintf("burst on"); #endif - spi_write_adv(REG_Motion_Burst, 0x00); + pmw3360_write(REG_Motion_Burst, 0x00); _inBurst = true; } - spi_start_adv(); + pmw3360_spi_start(); spi_write(REG_Motion_Burst); - wait_us(35); // waits for tSRAD + wait_us(35); // waits for tSRAD_MOTBR - report_pmw3360_t data = {0}; + report.motion = spi_read(); + spi_read(); // skip Observation + // delta registers + report.dx = spi_read(); + report.mdx = spi_read(); + report.dy = spi_read(); + report.mdy = spi_read(); - data.motion = spi_read(); - spi_write(0x00); // skip Observation - data.dx = spi_read(); - data.mdx = spi_read(); - data.dy = spi_read(); - data.mdy = spi_read(); + if (report.motion & 0b111) { // panic recovery, sometimes burst mode works weird. + _inBurst = false; + } spi_stop(); #ifdef CONSOLE_ENABLE if (debug_mouse) { - print_byte(data.motion); - print_byte(data.dx); - print_byte(data.mdx); - print_byte(data.dy); - print_byte(data.mdy); + print_byte(report.motion); + print_byte(report.dx); + print_byte(report.mdx); + print_byte(report.dy); + print_byte(report.mdy); dprintf("\n"); } #endif - data.isMotion = (data.motion & 0x80) != 0; - data.isOnSurface = (data.motion & 0x08) == 0; - data.dx |= (data.mdx << 8); - data.dx = data.dx * -1; - data.dy |= (data.mdy << 8); - data.dy = data.dy * -1; - - spi_stop(); + report.isMotion = (report.motion & 0x80) != 0; + report.isOnSurface = (report.motion & 0x08) == 0; + report.dx |= (report.mdx << 8); + report.dx = report.dx * -1; + report.dy |= (report.mdy << 8); + report.dy = report.dy * -1; - if (data.motion & 0b111) { // panic recovery, sometimes burst mode works weird. - _inBurst = false; - } - - return data; + return report; } diff --git a/drivers/sensors/pmw3360.h b/drivers/sensors/pmw3360.h index 9aa8e13f8e5e..eec729587160 100644 --- a/drivers/sensors/pmw3360.h +++ b/drivers/sensors/pmw3360.h @@ -19,8 +19,6 @@ #pragma once #include -#include "report.h" -#include "spi_master.h" #ifndef PMW3360_CPI # define PMW3360_CPI 1600 @@ -58,41 +56,20 @@ # error "No chip select pin defined -- missing PMW3360_CS_PIN" #endif -/* -The pmw33660 and pmw3389 use the same registers and timing and such. -The only differences between the two is the firmware used, and the -range for the DPI. So add a semi-secret hack to allow use of the -pmw3389's firmware blob. Also, can set the max cpi range too. -This should work for the 3390 and 3391 too, in theory. -*/ -#ifndef PMW3360_FIRMWARE_H -# define PMW3360_FIRMWARE_H "pmw3360_firmware.h" -#endif - -#ifdef CONSOLE_ENABLE -void print_byte(uint8_t byte); -#endif - typedef struct { int8_t motion; - bool isMotion; // True if a motion is detected. - bool isOnSurface; // True when a chip is on a surface - int16_t dx; // displacement on x directions. Unit: Count. (CPI * Count = Inch value) + bool isMotion; // True if a motion is detected. + bool isOnSurface; // True when a chip is on a surface + int16_t dx; // displacement on x directions. Unit: Count. (CPI * Count = Inch value) int8_t mdx; - int16_t dy; // displacement on y directions. + int16_t dy; // displacement on y directions. int8_t mdy; } report_pmw3360_t; -bool spi_start_adv(void); -void spi_stop_adv(void); -spi_status_t spi_write_adv(uint8_t reg_addr, uint8_t data); -uint8_t spi_read_adv(uint8_t reg_addr); -bool pmw3360_init(void); -void pmw3360_set_cpi(uint16_t cpi); -uint16_t pmw3360_get_cpi(void); -void pmw3360_upload_firmware(void); -bool pmw3360_check_signature(void); +bool pmw3360_init(void); +void pmw3360_upload_firmware(void); +bool pmw3360_check_signature(void); +uint16_t pmw3360_get_cpi(void); +void pmw3360_set_cpi(uint16_t cpi); +/* Reads and clears the current delta values on the sensor */ report_pmw3360_t pmw3360_read_burst(void); - -#define degToRad(angleInDegrees) ((angleInDegrees)*M_PI / 180.0) -#define radToDeg(angleInRadians) ((angleInRadians)*180.0 / M_PI) diff --git a/drivers/sensors/pmw3389.c b/drivers/sensors/pmw3389.c new file mode 100644 index 000000000000..828dafa134fb --- /dev/null +++ b/drivers/sensors/pmw3389.c @@ -0,0 +1,294 @@ +/* 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 . + */ + +#include "spi_master.h" +#include "pmw3389.h" +#include "wait.h" +#include "debug.h" +#include "print.h" +#include "pmw3389_firmware.h" + +// Registers +// clang-format off +#define REG_Product_ID 0x00 +#define REG_Revision_ID 0x01 +#define REG_Motion 0x02 +#define REG_Delta_X_L 0x03 +#define REG_Delta_X_H 0x04 +#define REG_Delta_Y_L 0x05 +#define REG_Delta_Y_H 0x06 +#define REG_SQUAL 0x07 +#define REG_RawData_Sum 0x08 +#define REG_Maximum_RawData 0x09 +#define REG_Minimum_RawData 0x0a +#define REG_Shutter_Lower 0x0b +#define REG_Shutter_Upper 0x0c +#define REG_Ripple_Control 0x0d +#define REG_Resolution_L 0x0e +#define REG_Resolution_H 0x0f +#define REG_Config2 0x10 +#define REG_Angle_Tune 0x11 +#define REG_Frame_Capture 0x12 +#define REG_SROM_Enable 0x13 +#define REG_Run_Downshift 0x14 +#define REG_Rest1_Rate_Lower 0x15 +#define REG_Rest1_Rate_Upper 0x16 +#define REG_Rest1_Downshift 0x17 +#define REG_Rest2_Rate_Lower 0x18 +#define REG_Rest2_Rate_Upper 0x19 +#define REG_Rest2_Downshift 0x1a +#define REG_Rest3_Rate_Lower 0x1b +#define REG_Rest3_Rate_Upper 0x1c +#define REG_Observation 0x24 +#define REG_Data_Out_Lower 0x25 +#define REG_Data_Out_Upper 0x26 +#define REG_SROM_ID 0x2a +#define REG_Min_SQ_Run 0x2b +#define REG_RawData_Threshold 0x2c +#define REG_Control2 0x2d +#define REG_Config5_L 0x2e +#define REG_Config5_H 0x2f +#define REG_Power_Up_Reset 0X3a +#define REG_Shutdown 0x3b +#define REG_Inverse_Product_ID 0x3f +#define REG_LiftCutoff_Cal3 0x41 +#define REG_Angle_Snap 0x42 +#define REG_LiftCutoff_Cal1 0x4a +#define REG_Motion_Burst 0x50 +#define REG_SROM_Load_Burst 0x62 +#define REG_Lift_Config 0x63 +#define REG_RawData_Burst 0x64 +#define REG_LiftCutoff_Cal2 0x65 +#define REG_LiftCutoff_Cal_Timeout 0x71 +#define REG_LiftCutoff_Cal_Min_Length 0x72 +#define REG_PWM_Period_Cnt 0x73 +#define REG_PWM_Width_Cnt 0x74 + +#define CPI_STEP 50 +// clang-format on + +// limits to 0--319, resulting in a CPI range of 50 -- 16000 (as only steps of 50 are possible). +#ifndef MAX_CPI +# define MAX_CPI 0x013f +#endif + +bool _inBurst = false; + +#ifdef CONSOLE_ENABLE +void print_byte(uint8_t byte) { + dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); +} +#endif +#define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) + +bool pmw3389_spi_start(void) { + bool status = spi_start(PMW3389_CS_PIN, PMW3389_SPI_LSBFIRST, PMW3389_SPI_MODE, PMW3389_SPI_DIVISOR); + // tNCS-SCLK, 120ns + wait_us(1); + return status; +} + +spi_status_t pmw3389_write(uint8_t reg_addr, uint8_t data) { + pmw3389_spi_start(); + + if (reg_addr != REG_Motion_Burst) { + _inBurst = false; + } + + // send address of the register, with MSBit = 1 to indicate it's a write + spi_status_t status = spi_write(reg_addr | 0x80); + status = spi_write(data); + + // tSCLK-NCS for write operation is 35 us + wait_us(35); + spi_stop(); + + // tSWW/tSWR (=180us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound + wait_us(145); + return status; +} + +uint8_t pmw3389_read(uint8_t reg_addr) { + pmw3389_spi_start(); + // send adress of the register, with MSBit = 0 to indicate it's a read + spi_write(reg_addr & 0x7f); + // tSRAD (=160us) + wait_us(160); + uint8_t data = spi_read(); + + // tSCLK-NCS, 120ns + wait_us(1); + spi_stop(); + + // tSRW/tSRR (=20us) minus tSCLK-NCS + wait_us(19); + return data; +} + +bool pmw3389_init(void) { + setPinOutput(PMW3389_CS_PIN); + + spi_init(); + _inBurst = false; + + spi_stop(); + pmw3389_spi_start(); + spi_stop(); + + pmw3389_write(REG_Shutdown, 0xb6); // Shutdown first + wait_ms(300); + + pmw3389_spi_start(); + wait_us(40); + spi_stop(); + wait_us(40); + + // power up, need to first drive NCS high then low, see above. + pmw3389_write(REG_Power_Up_Reset, 0x5a); + wait_ms(50); + + // read registers and discard + pmw3389_read(REG_Motion); + pmw3389_read(REG_Delta_X_L); + pmw3389_read(REG_Delta_X_H); + pmw3389_read(REG_Delta_Y_L); + pmw3389_read(REG_Delta_Y_H); + + pmw3389_upload_firmware(); + + spi_stop(); + + wait_ms(10); + pmw3389_set_cpi(PMW3389_CPI); + + wait_ms(1); + + pmw3389_write(REG_Config2, 0x00); + + pmw3389_write(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -127, 127)); + + pmw3389_write(REG_Lift_Config, PMW3389_LIFTOFF_DISTANCE); + + bool init_success = pmw3389_check_signature(); +#ifdef CONSOLE_ENABLE + if (init_success) { + dprintf("pmw3389 signature verified"); + } else { + dprintf("pmw3389 signature verification failed!"); + } +#endif + + writePinLow(PMW3389_CS_PIN); + + return init_success; +} + +void pmw3389_upload_firmware(void) { + // Datasheet claims we need to disable REST mode first, but during startup + // it's already disabled and we're not turning it on ... + // pmw3389_write(REG_Config2, 0x00); // disable REST mode + pmw3389_write(REG_SROM_Enable, 0x1d); + + wait_ms(10); + + pmw3389_write(REG_SROM_Enable, 0x18); + + pmw3389_spi_start(); + spi_write(REG_SROM_Load_Burst | 0x80); + wait_us(15); + + for (uint16_t i = 0; i < FIRMWARE_LENGTH; i++) { + spi_write(pgm_read_byte(firmware_data + i)); +#ifndef PMW3389_FIRMWARE_UPLOAD_FAST + wait_us(15); +#endif + } + wait_us(200); + + pmw3389_read(REG_SROM_ID); + pmw3389_write(REG_Config2, 0x00); +} + +bool pmw3389_check_signature(void) { + uint8_t pid = pmw3389_read(REG_Product_ID); + uint8_t iv_pid = pmw3389_read(REG_Inverse_Product_ID); + uint8_t SROM_ver = pmw3389_read(REG_SROM_ID); + return (pid == firmware_signature[0] && iv_pid == firmware_signature[1] && SROM_ver == firmware_signature[2]); // signature for SROM 0x04 +} + +uint16_t pmw3389_get_cpi(void) { + uint16_t cpival = (pmw3389_read(REG_Resolution_H) << 8) | pmw3389_read(REG_Resolution_L); + return (uint16_t)((cpival + 1) & 0xffff) * CPI_STEP; +} + +void pmw3389_set_cpi(uint16_t cpi) { + uint16_t cpival = constrain((cpi / CPI_STEP) - 1, 0, MAX_CPI); + // Sets upper byte first for more consistent setting of cpi + pmw3389_write(REG_Resolution_H, (cpival >> 8) & 0xff); + pmw3389_write(REG_Resolution_L, cpival & 0xff); +} + +report_pmw3389_t pmw3389_read_burst(void) { + report_pmw3389_t report = {0}; + + if (!_inBurst) { +#ifdef CONSOLE_ENABLE + dprintf("burst on"); +#endif + pmw3389_write(REG_Motion_Burst, 0x00); + _inBurst = true; + } + + pmw3389_spi_start(); + spi_write(REG_Motion_Burst); + wait_us(35); // waits for tSRAD_MOTBR + + report.motion = spi_read(); + spi_read(); // skip Observation + // delta registers + report.dx = spi_read(); + report.mdx = spi_read(); + report.dy = spi_read(); + report.mdy = spi_read(); + + if (report.motion & 0b111) { // panic recovery, sometimes burst mode works weird. + _inBurst = false; + } + + spi_stop(); + +#ifdef CONSOLE_ENABLE + if (debug_mouse) { + print_byte(report.motion); + print_byte(report.dx); + print_byte(report.mdx); + print_byte(report.dy); + print_byte(report.mdy); + dprintf("\n"); + } +#endif + + report.isMotion = (report.motion & 0x80) != 0; + report.isOnSurface = (report.motion & 0x08) == 0; + report.dx |= (report.mdx << 8); + report.dx = report.dx * -1; + report.dy |= (report.mdy << 8); + report.dy = report.dy * -1; + + return report; +} diff --git a/drivers/sensors/pmw3389.h b/drivers/sensors/pmw3389.h new file mode 100644 index 000000000000..db4a763fe358 --- /dev/null +++ b/drivers/sensors/pmw3389.h @@ -0,0 +1,76 @@ +/* Copyright 2021 Alabastard (@Alabastard-64) + * 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 + +#include + +#ifndef PMW3389_CPI +# define PMW3389_CPI 2000 +#endif + +#ifndef PMW3389_CLOCK_SPEED +# define PMW3389_CLOCK_SPEED 2000000 +#endif + +#ifndef PMW3389_SPI_LSBFIRST +# define PMW3389_SPI_LSBFIRST false +#endif + +#ifndef PMW3389_SPI_MODE +# define PMW3389_SPI_MODE 3 +#endif + +#ifndef PMW3389_SPI_DIVISOR +# ifdef __AVR__ +# define PMW3389_SPI_DIVISOR (F_CPU / PMW3389_CLOCK_SPEED) +# else +# define PMW3389_SPI_DIVISOR 64 +# endif +#endif + +#ifndef PMW3389_LIFTOFF_DISTANCE +# define PMW3389_LIFTOFF_DISTANCE 0x02 +#endif + +#ifndef ROTATIONAL_TRANSFORM_ANGLE +# define ROTATIONAL_TRANSFORM_ANGLE 0x00 +#endif + +#ifndef PMW3389_CS_PIN +# error "No chip select pin defined -- missing PMW3389_CS_PIN" +#endif + +typedef struct { + int8_t motion; + bool isMotion; // True if a motion is detected. + bool isOnSurface; // True when a chip is on a surface + int16_t dx; // displacement on x directions. Unit: Count. (CPI * Count = Inch value) + int8_t mdx; + int16_t dy; // displacement on y directions. + int8_t mdy; +} report_pmw3389_t; + +bool pmw3389_init(void); +void pmw3389_upload_firmware(void); +bool pmw3389_check_signature(void); +uint16_t pmw3389_get_cpi(void); +void pmw3389_set_cpi(uint16_t cpi); +/* Reads and clears the current delta values on the sensor */ +report_pmw3389_t pmw3389_read_burst(void); diff --git a/drivers/sensors/pmw3389_firmware.h b/drivers/sensors/pmw3389_firmware.h index 0564dab73afa..cd9638b6059e 100644 --- a/drivers/sensors/pmw3389_firmware.h +++ b/drivers/sensors/pmw3389_firmware.h @@ -18,286 +18,290 @@ #pragma once +#include "progmem.h" + // PID, Inverse PID, SROM version const uint8_t firmware_signature[] PROGMEM = {0x42, 0xBD, 0x04}; +#define FIRMWARE_LENGTH 4094 + +// Firmware Blob for PMW3389 + // clang-format off -// Firmware Blob foor PMW3389 -const uint16_t firmware_length = 4094; -// clang-format off -const uint8_t firmware_data[] PROGMEM = { // SROM 0x04 -0x01, 0xe8, 0xba, 0x26, 0x0b, 0xb2, 0xbe, 0xfe, 0x7e, 0x5f, 0x3c, 0xdb, 0x15, 0xa8, 0xb3, -0xe4, 0x2b, 0xb5, 0xe8, 0x53, 0x07, 0x6d, 0x3b, 0xd1, 0x20, 0xc2, 0x06, 0x6f, 0x3d, 0xd9, -0x11, 0xa0, 0xc2, 0xe7, 0x2d, 0xb9, 0xd1, 0x20, 0xa3, 0xa5, 0xc8, 0xf3, 0x64, 0x4a, 0xf7, -0x4d, 0x18, 0x93, 0xa4, 0xca, 0xf7, 0x6c, 0x5a, 0x36, 0xee, 0x5e, 0x3e, 0xfe, 0x7e, 0x7e, -0x5f, 0x1d, 0x99, 0xb0, 0xc3, 0xe5, 0x29, 0xd3, 0x03, 0x65, 0x48, 0x12, 0x87, 0x6d, 0x58, -0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xf2, 0x4f, 0xfd, 0x59, 0x11, 0x81, 0x61, 0x21, 0xc0, 0x02, -0x86, 0x8e, 0x7f, 0x5d, 0x38, 0xf2, 0x47, 0x0c, 0x7b, 0x55, 0x28, 0xb3, 0xe4, 0x4a, 0x16, -0xab, 0xbf, 0xdd, 0x38, 0xf2, 0x66, 0x4e, 0xff, 0x5d, 0x19, 0x91, 0xa0, 0xa3, 0xa5, 0xc8, -0x12, 0xa6, 0xaf, 0xdc, 0x3a, 0xd1, 0x41, 0x60, 0x75, 0x58, 0x24, 0x92, 0xd4, 0x72, 0x6c, -0xe0, 0x2f, 0xfd, 0x23, 0x8d, 0x1c, 0x5b, 0xb2, 0x97, 0x36, 0x3d, 0x0b, 0xa2, 0x49, 0xb1, -0x58, 0xf2, 0x1f, 0xc0, 0xcb, 0xf8, 0x41, 0x4f, 0xcd, 0x1e, 0x6b, 0x39, 0xa7, 0x2b, 0xe9, -0x30, 0x16, 0x83, 0xd2, 0x0e, 0x47, 0x8f, 0xe3, 0xb1, 0xdf, 0xa2, 0x15, 0xdb, 0x5d, 0x30, -0xc5, 0x1a, 0xab, 0x31, 0x99, 0xf3, 0xfa, 0xb2, 0x86, 0x69, 0xad, 0x7a, 0xe8, 0xa7, 0x18, -0x6a, 0xcc, 0xc8, 0x65, 0x23, 0x87, 0xa8, 0x5f, 0xf5, 0x21, 0x59, 0x75, 0x09, 0x71, 0x45, -0x55, 0x25, 0x4b, 0xda, 0xa1, 0xc3, 0xf7, 0x41, 0xab, 0x59, 0xd9, 0x74, 0x12, 0x55, 0x5f, -0xbc, 0xaf, 0xd9, 0xfd, 0xb0, 0x1e, 0xa3, 0x0f, 0xff, 0xde, 0x11, 0x16, 0x6a, 0xae, 0x0e, -0xe1, 0x5d, 0x3c, 0x10, 0x43, 0x9a, 0xa1, 0x0b, 0x24, 0x8f, 0x0d, 0x7f, 0x0b, 0x5e, 0x4c, -0x42, 0xa4, 0x84, 0x2c, 0x40, 0xd0, 0x55, 0x39, 0xe6, 0x4b, 0xf8, 0x9b, 0x2f, 0xdc, 0x28, -0xff, 0xfa, 0xb5, 0x85, 0x19, 0xe5, 0x28, 0xa1, 0x77, 0xaa, 0x73, 0xf3, 0x03, 0xc7, 0x62, -0xa6, 0x91, 0x18, 0xc9, 0xb0, 0xcd, 0x05, 0xdc, 0xca, 0x81, 0x26, 0x1a, 0x47, 0x40, 0xda, -0x36, 0x7d, 0x6a, 0x53, 0xc8, 0x5a, 0x77, 0x5d, 0x19, 0xa4, 0x1b, 0x23, 0x83, 0xd0, 0xb2, -0xaa, 0x0e, 0xbf, 0x77, 0x4e, 0x3a, 0x3b, 0x59, 0x00, 0x31, 0x0d, 0x02, 0x1b, 0x88, 0x7a, -0xd4, 0xbd, 0x9d, 0xcc, 0x58, 0x04, 0x69, 0xf6, 0x3b, 0xca, 0x42, 0xe2, 0xfd, 0xc3, 0x3d, -0x39, 0xc5, 0xd0, 0x71, 0xe4, 0xc8, 0xb7, 0x3e, 0x3f, 0xc8, 0xe9, 0xca, 0xc9, 0x3f, 0x04, -0x4e, 0x1b, 0x79, 0xca, 0xa5, 0x61, 0xc2, 0xed, 0x1d, 0xa6, 0xda, 0x5a, 0xe9, 0x7f, 0x65, -0x8c, 0xbe, 0x12, 0x6e, 0xa4, 0x5b, 0x33, 0x2f, 0x84, 0x28, 0x9c, 0x1c, 0x88, 0x2d, 0xff, -0x07, 0xbf, 0xa6, 0xd7, 0x5a, 0x88, 0x86, 0xb0, 0x3f, 0xf6, 0x31, 0x5b, 0x11, 0x6d, 0xf5, -0x58, 0xeb, 0x58, 0x02, 0x9e, 0xb5, 0x9a, 0xb1, 0xff, 0x25, 0x9d, 0x8b, 0x4f, 0xb6, 0x0a, -0xf9, 0xea, 0x3e, 0x3f, 0x21, 0x09, 0x65, 0x21, 0x22, 0xfe, 0x3d, 0x4e, 0x11, 0x5b, 0x9e, -0x5a, 0x59, 0x8b, 0xdd, 0xd8, 0xce, 0xd6, 0xd9, 0x59, 0xd2, 0x1e, 0xfd, 0xef, 0x0d, 0x1b, -0xd9, 0x61, 0x7f, 0xd7, 0x2d, 0xad, 0x62, 0x09, 0xe5, 0x22, 0x63, 0xea, 0xc7, 0x31, 0xd9, -0xa1, 0x38, 0x80, 0x5c, 0xa7, 0x32, 0x82, 0xec, 0x1b, 0xa2, 0x49, 0x5a, 0x06, 0xd2, 0x7c, -0xc9, 0x96, 0x57, 0xbb, 0x17, 0x75, 0xfc, 0x7a, 0x8f, 0x0d, 0x77, 0xb5, 0x7a, 0x8e, 0x3e, -0xf4, 0xba, 0x2f, 0x69, 0x13, 0x26, 0xd6, 0xd9, 0x21, 0x60, 0x2f, 0x21, 0x3e, 0x87, 0xee, -0xfd, 0x87, 0x16, 0x0d, 0xc8, 0x08, 0x00, 0x25, 0x71, 0xac, 0x2c, 0x03, 0x2a, 0x37, 0x2d, -0xb3, 0x34, 0x09, 0x91, 0xe3, 0x06, 0x2c, 0x38, 0x37, 0x95, 0x3b, 0x17, 0x7a, 0xaf, 0xac, -0x99, 0x55, 0xab, 0x41, 0x39, 0x5f, 0x8e, 0xa6, 0x43, 0x80, 0x03, 0x88, 0x6f, 0x7d, 0xbd, -0x5a, 0xb4, 0x2b, 0x32, 0x23, 0x5a, 0xa9, 0x31, 0x32, 0x39, 0x4c, 0x5b, 0xf4, 0x6b, 0xaf, -0x66, 0x6f, 0x3c, 0x8e, 0x2d, 0x82, 0x97, 0x9f, 0x4a, 0x01, 0xdc, 0x99, 0x98, 0x00, 0xec, -0x38, 0x7a, 0x79, 0x70, 0xa6, 0x85, 0xd6, 0x21, 0x63, 0x0d, 0x45, 0x9a, 0x2e, 0x5e, 0xa7, -0xb1, 0xea, 0x66, 0x6a, 0xbc, 0x62, 0x2d, 0x7b, 0x7d, 0x85, 0xea, 0x95, 0x2f, 0xc0, 0xe8, -0x6f, 0x35, 0xa0, 0x3a, 0x02, 0x25, 0xbc, 0xb2, 0x5f, 0x5c, 0x43, 0x96, 0xcc, 0x26, 0xd2, -0x16, 0xb4, 0x96, 0x73, 0xd7, 0x13, 0xc7, 0xae, 0x53, 0x15, 0x31, 0x89, 0x68, 0x66, 0x6d, -0x2c, 0x92, 0x1f, 0xcc, 0x5b, 0xa7, 0x8f, 0x5d, 0xbb, 0xc9, 0xdb, 0xe8, 0x3b, 0x9d, 0x61, -0x74, 0x8b, 0x05, 0xa1, 0x58, 0x52, 0x68, 0xee, 0x3d, 0x39, 0x79, 0xa0, 0x9b, 0xdd, 0xe1, -0x55, 0xc9, 0x60, 0xeb, 0xad, 0xb8, 0x5b, 0xc2, 0x5a, 0xb5, 0x2c, 0x18, 0x55, 0xa9, 0x50, -0xc3, 0xf6, 0x72, 0x5f, 0xcc, 0xe2, 0xf4, 0x55, 0xb5, 0xd6, 0xb5, 0x4a, 0x99, 0xa5, 0x28, -0x74, 0x97, 0x18, 0xe8, 0xc0, 0x84, 0x89, 0x50, 0x03, 0x86, 0x4d, 0x1a, 0xb7, 0x09, 0x90, -0xa2, 0x01, 0x04, 0xbb, 0x73, 0x62, 0xcb, 0x97, 0x22, 0x70, 0x5d, 0x52, 0x41, 0x8e, 0xd9, -0x90, 0x15, 0xaa, 0xab, 0x0a, 0x31, 0x65, 0xb4, 0xda, 0xd0, 0xee, 0x24, 0xc9, 0x41, 0x91, -0x1e, 0xbc, 0x46, 0x70, 0x40, 0x9d, 0xda, 0x0e, 0x2a, 0xe4, 0xb2, 0x4c, 0x9f, 0xf2, 0xfc, -0xf3, 0x84, 0x17, 0x44, 0x1e, 0xd7, 0xca, 0x23, 0x1f, 0x3f, 0x5a, 0x22, 0x3d, 0xaf, 0x9b, -0x2d, 0xfc, 0x41, 0xad, 0x26, 0xb4, 0x45, 0x67, 0x0b, 0x80, 0x0e, 0xf9, 0x61, 0x37, 0xec, -0x3b, 0xf4, 0x4b, 0x14, 0xdf, 0x5a, 0x0c, 0x3a, 0x50, 0x0b, 0x14, 0x0c, 0x72, 0xae, 0xc6, -0xc5, 0xec, 0x35, 0x53, 0x2d, 0x59, 0xed, 0x91, 0x74, 0xe2, 0xc4, 0xc8, 0xf2, 0x25, 0x6b, -0x97, 0x6f, 0xc9, 0x76, 0xce, 0xa9, 0xb1, 0x99, 0x8f, 0x5a, 0x92, 0x3b, 0xc4, 0x8d, 0x54, -0x50, 0x40, 0x72, 0xd6, 0x90, 0x83, 0xfc, 0xe5, 0x49, 0x8b, 0x17, 0xf5, 0xfd, 0x6b, 0x8d, -0x32, 0x02, 0xe9, 0x0a, 0xfe, 0xbf, 0x00, 0x6b, 0xa3, 0xad, 0x5f, 0x09, 0x4b, 0x97, 0x2b, -0x00, 0x58, 0x65, 0x2e, 0x07, 0x49, 0x0a, 0x3b, 0x6b, 0x2e, 0x50, 0x6c, 0x1d, 0xac, 0xb7, -0x6a, 0x26, 0xd8, 0x13, 0xa4, 0xca, 0x16, 0xae, 0xab, 0x93, 0xb9, 0x1c, 0x1c, 0xb4, 0x47, -0x6a, 0x38, 0x36, 0x17, 0x27, 0xc9, 0x7f, 0xc7, 0x64, 0xcb, 0x89, 0x58, 0xc5, 0x61, 0xc2, -0xc6, 0xea, 0x15, 0x0b, 0x34, 0x0c, 0x5d, 0x61, 0x76, 0x6e, 0x2b, 0x62, 0x40, 0x92, 0xa3, -0x6c, 0xef, 0xf4, 0xe4, 0xc3, 0xa1, 0xa8, 0xf5, 0x94, 0x79, 0x0d, 0xd1, 0x3d, 0xcb, 0x3d, -0x40, 0xb6, 0xd0, 0xf0, 0x10, 0x54, 0xd8, 0x47, 0x25, 0x51, 0xc5, 0x41, 0x79, 0x00, 0xe5, -0xa0, 0x72, 0xde, 0xbb, 0x3b, 0x62, 0x17, 0xf6, 0xbc, 0x5d, 0x00, 0x76, 0x2e, 0xa7, 0x3b, -0xb6, 0xf1, 0x98, 0x72, 0x59, 0x2a, 0x73, 0xb0, 0x21, 0xd6, 0x49, 0xe0, 0xc0, 0xd5, 0xeb, -0x02, 0x7d, 0x4b, 0x41, 0x28, 0x70, 0x2d, 0xec, 0x2b, 0x71, 0x1f, 0x0b, 0xb9, 0x71, 0x63, -0x06, 0xe6, 0xbc, 0x60, 0xbb, 0xf4, 0x9a, 0x62, 0x43, 0x09, 0x18, 0x4e, 0x93, 0x06, 0x4d, -0x76, 0xfa, 0x7f, 0xbd, 0x02, 0xe4, 0x50, 0x91, 0x12, 0xe5, 0x86, 0xff, 0x64, 0x1e, 0xaf, -0x7e, 0xb3, 0xb2, 0xde, 0x89, 0xc1, 0xa2, 0x6f, 0x40, 0x7b, 0x41, 0x51, 0x63, 0xea, 0x25, -0xd1, 0x97, 0x57, 0x92, 0xa8, 0x45, 0xa1, 0xa5, 0x45, 0x21, 0x43, 0x7f, 0x83, 0x15, 0x29, -0xd0, 0x30, 0x53, 0x32, 0xb4, 0x5a, 0x17, 0x96, 0xbc, 0xc2, 0x68, 0xa9, 0xb7, 0xaf, 0xac, -0xdf, 0xf1, 0xe3, 0x89, 0xba, 0x24, 0x79, 0x54, 0xc6, 0x14, 0x07, 0x1c, 0x1e, 0x0d, 0x3a, -0x6b, 0xe5, 0x3d, 0x4e, 0x10, 0x60, 0x96, 0xec, 0x6c, 0xda, 0x47, 0xae, 0x03, 0x25, 0x39, -0x1d, 0x74, 0xc8, 0xac, 0x6a, 0xf2, 0x6b, 0x05, 0x2a, 0x9a, 0xe7, 0xe8, 0x92, 0xd6, 0xc2, -0x6d, 0xfa, 0xe8, 0xa7, 0x9d, 0x5f, 0x48, 0xc9, 0x75, 0xf1, 0x66, 0x6a, 0xdb, 0x5d, 0x9a, -0xcd, 0x27, 0xdd, 0xb9, 0x24, 0x04, 0x9c, 0x18, 0xc2, 0x6d, 0x0c, 0x91, 0x34, 0x48, 0x42, -0x6f, 0xe9, 0x59, 0x70, 0xc4, 0x7e, 0x81, 0x0e, 0x32, 0x0a, 0x93, 0x48, 0xb0, 0xc0, 0x15, -0x9e, 0x05, 0xac, 0x36, 0x16, 0xcb, 0x59, 0x65, 0xa0, 0x83, 0xdf, 0x3e, 0xda, 0xfb, 0x1d, -0x1a, 0xdb, 0x65, 0xec, 0x9a, 0xc6, 0xc3, 0x8e, 0x3c, 0x45, 0xfd, 0xc8, 0xf5, 0x1c, 0x6a, -0x67, 0x0d, 0x8f, 0x99, 0x7d, 0x30, 0x21, 0x8c, 0xea, 0x22, 0x87, 0x65, 0xc9, 0xb2, 0x4c, -0xe4, 0x1b, 0x46, 0xba, 0x54, 0xbd, 0x7c, 0xca, 0xd5, 0x8f, 0x5b, 0xa5, 0x01, 0x04, 0xd8, -0x0a, 0x16, 0xbf, 0xb9, 0x50, 0x2e, 0x37, 0x2f, 0x64, 0xf3, 0x70, 0x11, 0x02, 0x05, 0x31, -0x9b, 0xa0, 0xb2, 0x01, 0x5e, 0x4f, 0x19, 0xc9, 0xd4, 0xea, 0xa1, 0x79, 0x54, 0x53, 0xa7, -0xde, 0x2f, 0x49, 0xd3, 0xd1, 0x63, 0xb5, 0x03, 0x15, 0x4e, 0xbf, 0x04, 0xb3, 0x26, 0x8b, -0x20, 0xb2, 0x45, 0xcf, 0xcd, 0x5b, 0x82, 0x32, 0x88, 0x61, 0xa7, 0xa8, 0xb2, 0xa0, 0x72, -0x96, 0xc0, 0xdb, 0x2b, 0xe2, 0x5f, 0xba, 0xe3, 0xf5, 0x8a, 0xde, 0xf1, 0x18, 0x01, 0x16, -0x40, 0xd9, 0x86, 0x12, 0x09, 0x18, 0x1b, 0x05, 0x0c, 0xb1, 0xb5, 0x47, 0xe2, 0x43, 0xab, -0xfe, 0x92, 0x63, 0x7e, 0x95, 0x2b, 0xf0, 0xaf, 0xe1, 0xf1, 0xc3, 0x4a, 0xff, 0x2b, 0x09, -0xbb, 0x4a, 0x0e, 0x9a, 0xc4, 0xd8, 0x64, 0x7d, 0x83, 0xa0, 0x4f, 0x44, 0xdb, 0xc4, 0xa8, -0x58, 0xef, 0xfc, 0x9e, 0x77, 0xf9, 0xa6, 0x8f, 0x58, 0x8b, 0x12, 0xf4, 0xe9, 0x81, 0x12, -0x47, 0x51, 0x41, 0x83, 0xef, 0xf6, 0x73, 0xbc, 0x8e, 0x0f, 0x4c, 0x8f, 0x4e, 0x69, 0x90, -0x77, 0x29, 0x5d, 0x92, 0xb0, 0x6d, 0x06, 0x67, 0x29, 0x60, 0xbd, 0x4b, 0x17, 0xc8, 0x89, -0x69, 0x28, 0x29, 0xd6, 0x78, 0xcb, 0x11, 0x4c, 0xba, 0x8b, 0x68, 0xae, 0x7e, 0x9f, 0xef, -0x95, 0xda, 0xe2, 0x9e, 0x7f, 0xe9, 0x55, 0xe5, 0xe1, 0xe2, 0xb7, 0xe6, 0x5f, 0xbb, 0x2c, -0xa2, 0xe6, 0xee, 0xc7, 0x0a, 0x60, 0xa9, 0xd1, 0x80, 0xdf, 0x7f, 0xd6, 0x97, 0xab, 0x1d, -0x22, 0x25, 0xfc, 0x79, 0x23, 0xe0, 0xae, 0xc5, 0xef, 0x16, 0xa4, 0xa1, 0x0f, 0x92, 0xa9, -0xc7, 0xe3, 0x3a, 0x55, 0xdf, 0x62, 0x49, 0xd9, 0xf5, 0x84, 0x49, 0xc5, 0x90, 0x34, 0xd3, -0xe1, 0xac, 0x99, 0x21, 0xb1, 0x02, 0x76, 0x4a, 0xfa, 0xd4, 0xbb, 0xa4, 0x9c, 0xa2, 0xe2, -0xcb, 0x3d, 0x3b, 0x14, 0x75, 0x60, 0xd1, 0x02, 0xb4, 0xa3, 0xb4, 0x72, 0x06, 0xf9, 0x19, -0x9c, 0xe2, 0xe4, 0xa7, 0x0f, 0x25, 0x88, 0xc6, 0x86, 0xd6, 0x8c, 0x74, 0x4e, 0x6e, 0xfc, -0xa8, 0x48, 0x9e, 0xa7, 0x9d, 0x1a, 0x4b, 0x37, 0x09, 0xc8, 0xb0, 0x10, 0xbe, 0x6f, 0xfe, -0xa3, 0xc4, 0x7a, 0xb5, 0x3d, 0xe8, 0x30, 0xf1, 0x0d, 0xa0, 0xb2, 0x44, 0xfc, 0x9b, 0x8c, -0xf8, 0x61, 0xed, 0x81, 0xd1, 0x62, 0x11, 0xb4, 0xe1, 0xd5, 0x39, 0x52, 0x89, 0xd3, 0xa8, -0x49, 0x31, 0xdf, 0xb6, 0xf9, 0x91, 0xf4, 0x1c, 0x9d, 0x09, 0x95, 0x40, 0x56, 0xe7, 0xe3, -0xcd, 0x5c, 0x92, 0xc1, 0x1d, 0x6b, 0xe9, 0x78, 0x6f, 0x8e, 0x94, 0x42, 0x66, 0xa2, 0xaa, -0xd3, 0xc8, 0x2e, 0xe3, 0xf6, 0x07, 0x72, 0x0b, 0x6b, 0x1e, 0x7b, 0xb9, 0x7c, 0xe0, 0xa0, -0xbc, 0xd9, 0x25, 0xdf, 0x87, 0xa8, 0x5f, 0x9c, 0xcc, 0xf0, 0xdb, 0x42, 0x8e, 0x07, 0x31, -0x13, 0x01, 0x66, 0x32, 0xd1, 0xb8, 0xd6, 0xe3, 0x5e, 0x12, 0x76, 0x61, 0xd3, 0x38, 0x89, -0xe6, 0x17, 0x6f, 0xa5, 0xf2, 0x71, 0x0e, 0xa5, 0xe2, 0x88, 0x30, 0xbb, 0xbe, 0x8a, 0xea, -0xc7, 0x62, 0xc4, 0xcf, 0xb8, 0xcd, 0x33, 0x8d, 0x3d, 0x3e, 0xb5, 0x60, 0x3a, 0x03, 0x92, -0xe4, 0x6d, 0x1b, 0xe0, 0xb4, 0x84, 0x08, 0x55, 0x88, 0xa7, 0x3a, 0xb9, 0x3d, 0x43, 0xc3, -0xc0, 0xfa, 0x07, 0x6a, 0xca, 0x94, 0xad, 0x99, 0x55, 0xf1, 0xf1, 0xc0, 0x23, 0x87, 0x1d, -0x3d, 0x1c, 0xd1, 0x66, 0xa0, 0x57, 0x10, 0x52, 0xa2, 0x7f, 0xbe, 0xf9, 0x88, 0xb6, 0x02, -0xbf, 0x08, 0x23, 0xa9, 0x0c, 0x63, 0x17, 0x2a, 0xae, 0xf5, 0xf7, 0xb7, 0x21, 0x83, 0x92, -0x31, 0x23, 0x0d, 0x20, 0xc3, 0xc2, 0x05, 0x21, 0x62, 0x8e, 0x45, 0xe8, 0x14, 0xc1, 0xda, -0x75, 0xb8, 0xf8, 0x92, 0x01, 0xd0, 0x5d, 0x18, 0x9f, 0x99, 0x11, 0x19, 0xf5, 0x35, 0xe8, -0x7f, 0x20, 0x88, 0x8c, 0x05, 0x75, 0xf5, 0xd7, 0x40, 0x17, 0xbb, 0x1e, 0x36, 0x52, 0xd9, -0xa4, 0x9c, 0xc2, 0x9d, 0x42, 0x81, 0xd8, 0xc7, 0x8a, 0xe7, 0x4c, 0x81, 0xe0, 0xb7, 0x57, -0xed, 0x48, 0x8b, 0xf0, 0x97, 0x15, 0x61, 0xd9, 0x2c, 0x7c, 0x45, 0xaf, 0xc2, 0xcd, 0xfc, -0xaa, 0x13, 0xad, 0x59, 0xcc, 0xb2, 0xb2, 0x6e, 0xdd, 0x63, 0x9c, 0x32, 0x0f, 0xec, 0x83, -0xbe, 0x78, 0xac, 0x91, 0x44, 0x1a, 0x1f, 0xea, 0xfd, 0x5d, 0x8e, 0xb4, 0xc0, 0x84, 0xd4, -0xac, 0xb4, 0x87, 0x5f, 0xac, 0xef, 0xdf, 0xcd, 0x12, 0x56, 0xc8, 0xcd, 0xfe, 0xc5, 0xda, -0xd3, 0xc1, 0x69, 0xf3, 0x61, 0x05, 0xea, 0x25, 0xe2, 0x12, 0x05, 0x8f, 0x39, 0x08, 0x08, -0x7c, 0x37, 0xb6, 0x7e, 0x5b, 0xd8, 0xb1, 0x0e, 0xf2, 0xdb, 0x4b, 0xf1, 0xad, 0x90, 0x01, -0x57, 0xcd, 0xa0, 0xb4, 0x52, 0xe8, 0xf3, 0xd7, 0x8a, 0xbd, 0x4f, 0x9f, 0x21, 0x40, 0x72, -0xa4, 0xfc, 0x0b, 0x01, 0x2b, 0x2f, 0xb6, 0x4c, 0x95, 0x2d, 0x35, 0x33, 0x41, 0x6b, 0xa0, -0x93, 0xe7, 0x2c, 0xf2, 0xd3, 0x72, 0x8b, 0xf4, 0x4f, 0x15, 0x3c, 0xaf, 0xd6, 0x12, 0xde, -0x3f, 0x83, 0x3f, 0xff, 0xf8, 0x7f, 0xf6, 0xcc, 0xa6, 0x7f, 0xc9, 0x9a, 0x6e, 0x1f, 0xc1, -0x0c, 0xfb, 0xee, 0x9c, 0xe7, 0xaf, 0xc9, 0x26, 0x54, 0xef, 0xb0, 0x39, 0xef, 0xb2, 0xe9, -0x23, 0xc4, 0xef, 0xd1, 0xa1, 0xa4, 0x25, 0x24, 0x6f, 0x8d, 0x6a, 0xe5, 0x8a, 0x32, 0x3a, -0xaf, 0xfc, 0xda, 0xce, 0x18, 0x25, 0x42, 0x07, 0x4d, 0x45, 0x8b, 0xdf, 0x85, 0xcf, 0x55, -0xb2, 0x24, 0xfe, 0x9c, 0x69, 0x74, 0xa7, 0x6e, 0xa0, 0xce, 0xc0, 0x39, 0xf4, 0x86, 0xc6, -0x8d, 0xae, 0xb9, 0x48, 0x64, 0x13, 0x0b, 0x40, 0x81, 0xa2, 0xc9, 0xa8, 0x85, 0x51, 0xee, -0x9f, 0xcf, 0xa2, 0x8c, 0x19, 0x52, 0x48, 0xe2, 0xc1, 0xa8, 0x58, 0xb4, 0x10, 0x24, 0x06, -0x58, 0x51, 0xfc, 0xb9, 0x12, 0xec, 0xfd, 0x73, 0xb4, 0x6d, 0x84, 0xfa, 0x06, 0x8b, 0x05, -0x0b, 0x2d, 0xd6, 0xd6, 0x1f, 0x29, 0x82, 0x9f, 0x19, 0x12, 0x1e, 0xb2, 0x04, 0x8f, 0x7f, -0x4d, 0xbd, 0x30, 0x2e, 0xe3, 0xe0, 0x88, 0x29, 0xc5, 0x93, 0xd6, 0x6c, 0x1f, 0x29, 0x45, -0x91, 0xa7, 0x58, 0xcd, 0x05, 0x17, 0xd6, 0x6d, 0xb3, 0xca, 0x66, 0xcc, 0x3c, 0x4a, 0x74, -0xfd, 0x08, 0x10, 0xa6, 0x99, 0x92, 0x10, 0xd2, 0x85, 0xab, 0x6e, 0x1d, 0x0e, 0x8b, 0x26, -0x46, 0xd1, 0x6c, 0x84, 0xc0, 0x26, 0x43, 0x59, 0x68, 0xf0, 0x13, 0x1d, 0xfb, 0xe3, 0xd1, -0xd2, 0xb4, 0x71, 0x9e, 0xf2, 0x59, 0x6a, 0x33, 0x29, 0x79, 0xd2, 0xd7, 0x26, 0xf1, 0xae, -0x78, 0x9e, 0x1f, 0x0f, 0x3f, 0xe3, 0xe8, 0xd0, 0x27, 0x78, 0x77, 0xf6, 0xac, 0x9c, 0x56, -0x39, 0x73, 0x8a, 0x6b, 0x2f, 0x34, 0x78, 0xb1, 0x11, 0xdb, 0xa4, 0x5c, 0x80, 0x01, 0x71, -0x6a, 0xc2, 0xd1, 0x2e, 0x5e, 0x76, 0x28, 0x70, 0x93, 0xae, 0x3e, 0x78, 0xb0, 0x1f, 0x0f, -0xda, 0xbf, 0xfb, 0x8a, 0x67, 0x65, 0x4f, 0x91, 0xed, 0x49, 0x75, 0x78, 0x62, 0xa2, 0x93, -0xb5, 0x70, 0x7f, 0x4d, 0x08, 0x4e, 0x79, 0x61, 0xa8, 0x5f, 0x7f, 0xb4, 0x65, 0x9f, 0x91, -0x54, 0x3a, 0xe8, 0x50, 0x33, 0xd3, 0xd5, 0x8a, 0x7c, 0xf3, 0x9e, 0x8b, 0x77, 0x7b, 0xc6, -0xc6, 0x0c, 0x45, 0x95, 0x1f, 0xb0, 0xd0, 0x0b, 0x27, 0x4a, 0xfd, 0xc7, 0xf7, 0x0d, 0x5a, -0x43, 0xc9, 0x7d, 0x35, 0xb0, 0x7d, 0xc4, 0x9c, 0x57, 0x1e, 0x76, 0x0d, 0xf1, 0x95, 0x30, -0x71, 0xcc, 0xb3, 0x66, 0x3b, 0x63, 0xa8, 0x6c, 0xa3, 0x43, 0xa0, 0x24, 0xcc, 0xb7, 0x53, -0xfe, 0xfe, 0xbc, 0x6e, 0x60, 0x89, 0xaf, 0x16, 0x21, 0xc8, 0x91, 0x6a, 0x89, 0xce, 0x80, -0x2c, 0xf1, 0x59, 0xce, 0xc3, 0x60, 0x61, 0x3b, 0x0b, 0x19, 0xfe, 0x99, 0xac, 0x65, 0x90, -0x15, 0x12, 0x05, 0xac, 0x7e, 0xff, 0x98, 0x7b, 0x66, 0x64, 0x0e, 0x4b, 0x5b, 0xaa, 0x8d, -0x3b, 0xd2, 0x56, 0xcf, 0x99, 0x39, 0xee, 0x22, 0x81, 0xd0, 0x60, 0x06, 0x66, 0x20, 0x81, -0x48, 0x3c, 0x6f, 0x3a, 0x77, 0xba, 0xcb, 0x52, 0xac, 0x79, 0x56, 0xaf, 0xe9, 0x16, 0x17, -0x0a, 0xa3, 0x82, 0x08, 0xd5, 0x3c, 0x97, 0xcb, 0x09, 0xff, 0x7f, 0xf9, 0x4f, 0x60, 0x05, -0xb9, 0x53, 0x26, 0xaa, 0xb8, 0x50, 0xaa, 0x19, 0x25, 0xae, 0x5f, 0xea, 0x8a, 0xd0, 0x89, -0x12, 0x80, 0x43, 0x50, 0x24, 0x12, 0x21, 0x14, 0xcd, 0x77, 0xeb, 0x21, 0xcc, 0x5c, 0x09, -0x64, 0xf3, 0xc7, 0xcb, 0xc5, 0x4b, 0xc3, 0xe7, 0xed, 0xe7, 0x86, 0x2c, 0x1d, 0x8e, 0x19, -0x52, 0x9b, 0x2a, 0x0c, 0x18, 0x72, 0x0b, 0x1e, 0x1b, 0xb0, 0x0f, 0x42, 0x99, 0x04, 0xae, -0xd5, 0xb7, 0x89, 0x1a, 0xb9, 0x4f, 0xd6, 0xaf, 0xf3, 0xc9, 0x93, 0x6f, 0xb0, 0x60, 0x83, -0x6e, 0x6b, 0xd1, 0x5f, 0x3f, 0x1a, 0x83, 0x1e, 0x24, 0x00, 0x87, 0xb5, 0x3e, 0xdb, 0xf9, -0x4d, 0xa7, 0x16, 0x2e, 0x19, 0x5b, 0x8f, 0x1b, 0x0d, 0x47, 0x72, 0x42, 0xe9, 0x0a, 0x11, -0x08, 0x2d, 0x88, 0x1c, 0xbc, 0xc7, 0xb4, 0xbe, 0x29, 0x4d, 0x03, 0x5e, 0xec, 0xdf, 0xf3, -0x3d, 0x2f, 0xe8, 0x1d, 0x9a, 0xd2, 0xd1, 0xab, 0x41, 0x3d, 0x87, 0x11, 0x45, 0xb0, 0x0d, -0x46, 0xf5, 0xe8, 0x95, 0x62, 0x1c, 0x68, 0xf7, 0xa6, 0x5b, 0x39, 0x4e, 0xbf, 0x47, 0xba, -0x5d, 0x7f, 0xb7, 0x6a, 0xf4, 0xba, 0x1d, 0x69, 0xf6, 0xa4, 0xe7, 0xe4, 0x6b, 0x3b, 0x0d, -0x23, 0x16, 0x4a, 0xb2, 0x68, 0xf0, 0xb2, 0x0d, 0x09, 0x17, 0x6a, 0x63, 0x8c, 0x83, 0xd3, -0xbd, 0x05, 0xc9, 0xf6, 0xf0, 0xa1, 0x31, 0x0b, 0x2c, 0xac, 0x83, 0xac, 0x80, 0x34, 0x32, -0xb4, 0xec, 0xd0, 0xbc, 0x54, 0x82, 0x9a, 0xc8, 0xf6, 0xa0, 0x7d, 0xc6, 0x79, 0x73, 0xf4, -0x20, 0x99, 0xf3, 0xb4, 0x01, 0xde, 0x91, 0x27, 0xf2, 0xc0, 0xdc, 0x81, 0x00, 0x4e, 0x7e, -0x07, 0x99, 0xc8, 0x3a, 0x51, 0xbc, 0x38, 0xd6, 0x8a, 0xa2, 0xde, 0x3b, 0x6a, 0x8c, 0x1a, -0x7c, 0x81, 0x0f, 0x3a, 0x1f, 0xe4, 0x05, 0x7b, 0x20, 0x35, 0x6b, 0xa5, 0x6a, 0xa7, 0xe7, -0xbc, 0x9c, 0x20, 0xec, 0x00, 0x15, 0xe2, 0x51, 0xaf, 0x77, 0xeb, 0x29, 0x3c, 0x7d, 0x2e, -0x00, 0x5c, 0x81, 0x21, 0xfa, 0x35, 0x6f, 0x40, 0xef, 0xfb, 0xd1, 0x3f, 0xcc, 0x9d, 0x55, -0x53, 0xfb, 0x5a, 0xa5, 0x56, 0x89, 0x0b, 0x52, 0xeb, 0x57, 0x73, 0x4f, 0x1b, 0x67, 0x24, -0xcb, 0xb8, 0x6a, 0x10, 0x69, 0xd6, 0xfb, 0x52, 0x40, 0xff, 0x20, 0xa5, 0xf3, 0x72, 0xe1, -0x3d, 0xa4, 0x8c, 0x81, 0x66, 0x16, 0x0d, 0x5d, 0xad, 0xa8, 0x50, 0x25, 0x78, 0x31, 0x77, -0x0c, 0x57, 0xe4, 0xe9, 0x15, 0x2d, 0xdb, 0x07, 0x87, 0xc8, 0xb0, 0x43, 0xde, 0xfc, 0xfe, -0xa9, 0xeb, 0xf5, 0xb0, 0xd3, 0x7b, 0xe9, 0x1f, 0x6e, 0xca, 0xe4, 0x03, 0x95, 0xc5, 0xd1, -0x59, 0x72, 0x63, 0xf0, 0x86, 0x54, 0xe8, 0x16, 0x62, 0x0b, 0x35, 0x29, 0xc2, 0x68, 0xd0, -0xd6, 0x3e, 0x90, 0x60, 0x57, 0x1d, 0xc9, 0xed, 0x3f, 0xed, 0xb0, 0x2f, 0x7e, 0x97, 0x02, -0x51, 0xec, 0xee, 0x6f, 0x82, 0x74, 0x76, 0x7f, 0xfb, 0xd6, 0xc4, 0xc3, 0xdd, 0xe8, 0xb1, -0x60, 0xfc, 0xc6, 0xb9, 0x0d, 0x6a, 0x33, 0x78, 0xc6, 0xc1, 0xbf, 0x86, 0x2c, 0x50, 0xcc, -0x9a, 0x70, 0x8e, 0x7b, 0xec, 0xab, 0x95, 0xac, 0x53, 0xa0, 0x4b, 0x07, 0x88, 0xaf, 0x42, -0xed, 0x19, 0x8d, 0xf6, 0x32, 0x17, 0x48, 0x47, 0x1d, 0x41, 0x6f, 0xfe, 0x2e, 0xa7, 0x8f, -0x4b, 0xa0, 0x51, 0xf3, 0xbf, 0x02, 0x0a, 0x48, 0x58, 0xf7, 0xa1, 0x6d, 0xea, 0xa5, 0x13, -0x5a, 0x5b, 0xea, 0x0c, 0x9e, 0x52, 0x4f, 0x9e, 0xb9, 0x71, 0x7f, 0x23, 0x83, 0xda, 0x1b, -0x86, 0x9a, 0x41, 0x29, 0xda, 0x70, 0xe7, 0x64, 0xa1, 0x7b, 0xd5, 0x0a, 0x22, 0x0d, 0x5c, -0x40, 0xc4, 0x81, 0x07, 0x25, 0x35, 0x4a, 0x1c, 0x10, 0xdb, 0x45, 0x0a, 0xff, 0x36, 0xd4, -0xe0, 0xeb, 0x5f, 0x68, 0xd6, 0x67, 0xc6, 0xd0, 0x8b, 0x76, 0x1a, 0x7d, 0x59, 0x42, 0xa1, -0xcb, 0x96, 0x4d, 0x84, 0x09, 0x9a, 0x3d, 0xe0, 0x52, 0x85, 0x6e, 0x48, 0x90, 0x85, 0x2a, -0x63, 0xb2, 0x69, 0xd2, 0x00, 0x43, 0x31, 0x37, 0xb3, 0x52, 0xaf, 0x62, 0xfa, 0xc1, 0xe0, -0x03, 0xfb, 0x62, 0xaa, 0x88, 0xc9, 0xb2, 0x2c, 0xd5, 0xa8, 0xf5, 0xa5, 0x4c, 0x12, 0x59, -0x4e, 0x06, 0x5e, 0x9b, 0x15, 0x66, 0x11, 0xb2, 0x27, 0x92, 0xdc, 0x98, 0x59, 0xde, 0xdf, -0xfa, 0x9a, 0x32, 0x2e, 0xc0, 0x5d, 0x3c, 0x33, 0x41, 0x6d, 0xaf, 0xb2, 0x25, 0x23, 0x14, -0xa5, 0x7b, 0xc7, 0x9b, 0x68, 0xf3, 0xda, 0xeb, 0xe3, 0xa9, 0xe2, 0x6f, 0x0e, 0x1d, 0x1c, -0xba, 0x55, 0xb6, 0x34, 0x6a, 0x93, 0x1f, 0x1f, 0xb8, 0x34, 0xc8, 0x84, 0x08, 0xb1, 0x6b, -0x6a, 0x28, 0x74, 0x74, 0xe5, 0xeb, 0x75, 0xe9, 0x7c, 0xd8, 0xba, 0xd8, 0x42, 0xa5, 0xee, -0x1f, 0x80, 0xd9, 0x96, 0xb2, 0x2e, 0xe7, 0xbf, 0xba, 0xeb, 0xd1, 0x69, 0xbb, 0x8f, 0xfd, -0x5a, 0x63, 0x8f, 0x39, 0x7f, 0xdf, 0x1d, 0x37, 0xd2, 0x18, 0x35, 0x9d, 0xb6, 0xcc, 0xe4, -0x27, 0x81, 0x89, 0x38, 0x38, 0x68, 0x33, 0xe7, 0x78, 0xd8, 0x76, 0xf5, 0xee, 0xd0, 0x4a, -0x07, 0x69, 0x19, 0x7a, 0xad, 0x18, 0xb1, 0x94, 0x61, 0x45, 0x53, 0xa2, 0x48, 0xda, 0x96, -0x4a, 0xf9, 0xee, 0x94, 0x2a, 0x1f, 0x6e, 0x18, 0x3c, 0x92, 0x46, 0xd1, 0x1a, 0x28, 0x18, -0x32, 0x1f, 0x3a, 0x45, 0xbe, 0x04, 0x35, 0x92, 0xe5, 0xa3, 0xcb, 0xb5, 0x2e, 0x32, 0x43, -0xac, 0x65, 0x17, 0x89, 0x99, 0x15, 0x03, 0x9e, 0xb1, 0x23, 0x2f, 0xed, 0x76, 0x4d, 0xd8, -0xac, 0x21, 0x40, 0xc4, 0x99, 0x4e, 0x65, 0x71, 0x2c, 0xb3, 0x45, 0xab, 0xfb, 0xe7, 0x72, -0x39, 0x56, 0x30, 0x6d, 0xfb, 0x74, 0xeb, 0x99, 0xf3, 0xcd, 0x57, 0x5c, 0x78, 0x75, 0xe9, -0x8d, 0xc3, 0xa2, 0xfb, 0x5d, 0xe0, 0x90, 0xc5, 0x55, 0xad, 0x91, 0x53, 0x4e, 0x9e, 0xbd, -0x8c, 0x49, 0xa4, 0xa4, 0x69, 0x10, 0x0c, 0xc5, 0x76, 0xe9, 0x25, 0x86, 0x8d, 0x66, 0x23, -0xa8, 0xdb, 0x5c, 0xe8, 0xd9, 0x30, 0xe1, 0x15, 0x7b, 0xc0, 0x99, 0x0f, 0x03, 0xec, 0xaa, -0x12, 0xef, 0xce, 0xd4, 0xea, 0x55, 0x5c, 0x08, 0x86, 0xf4, 0xf4, 0xb0, 0x83, 0x42, 0x95, -0x37, 0xb6, 0x38, 0xe0, 0x2b, 0x54, 0x89, 0xbd, 0x4e, 0x20, 0x9d, 0x3f, 0xc3, 0x4b, 0xb7, -0xec, 0xfa, 0x5a, 0x14, 0x03, 0xcb, 0x64, 0xc8, 0x34, 0x4a, 0x4b, 0x6e, 0xf8, 0x6e, 0x56, -0xf6, 0xdd, 0x5f, 0xa1, 0x24, 0xe2, 0xd4, 0xd0, 0x82, 0x64, 0x1f, 0x8e, 0x9b, 0xfa, 0xb4, -0xcb, 0xdb, 0x0a, 0xe8, 0x15, 0xfc, 0x15, 0xab, 0x4b, 0x18, 0xbf, 0xd4, 0x42, 0x14, 0x48, -0x82, 0x85, 0xdd, 0xeb, 0x49, 0x1b, 0x0b, 0x0b, 0x05, 0xe9, 0xb4, 0xa1, 0x33, 0x0a, 0x5d, -0x0e, 0x6c, 0x4b, 0xc0, 0xd6, 0x6c, 0x7c, 0xfb, 0x69, 0x0b, 0x53, 0x19, 0xe4, 0xf3, 0x35, -0xfc, 0xbe, 0xa1, 0x34, 0x02, 0x09, 0x4f, 0x74, 0x86, 0x92, 0xcd, 0x5d, 0x1a, 0xc1, 0x27, -0x0c, 0xf2, 0xc5, 0xcf, 0xdd, 0x23, 0x93, 0x02, 0xbd, 0x41, 0x5e, 0x42, 0xf0, 0xa0, 0x9d, -0x0c, 0x72, 0xc8, 0xec, 0x32, 0x0a, 0x8a, 0xfd, 0x3d, 0x5a, 0x41, 0x27, 0x0c, 0x88, 0x59, -0xad, 0x94, 0x2e, 0xef, 0x5d, 0x8f, 0xc7, 0xdf, 0x66, 0xe4, 0xdd, 0x56, 0x6c, 0x7b, 0xca, -0x55, 0x81, 0xae, 0xae, 0x5c, 0x1b, 0x1a, 0xab, 0xae, 0x99, 0x8d, 0xcc, 0x42, 0x97, 0x59, -0xf4, 0x14, 0x3f, 0x75, 0xc6, 0xd1, 0x88, 0xba, 0xaa, 0x84, 0x4a, 0xd0, 0x34, 0x08, 0x3b, -0x7d, 0xdb, 0x15, 0x06, 0xb0, 0x5c, 0xbd, 0x40, 0xf5, 0xa8, 0xec, 0xae, 0x36, 0x40, 0xdd, -0x90, 0x1c, 0x3e, 0x0d, 0x7e, 0x73, 0xc7, 0xc2, 0xc5, 0x6a, 0xff, 0x52, 0x05, 0x7f, 0xbe, -0xd0, 0x92, 0xfd, 0xb3, 0x6f, 0xff, 0x5d, 0xb7, 0x97, 0x64, 0x73, 0x7b, 0xca, 0xd1, 0x98, -0x24, 0x6b, 0x0b, 0x01, 0x68, 0xdd, 0x27, 0x85, 0x85, 0xb5, 0x83, 0xc1, 0xe0, 0x50, 0x64, -0xc7, 0xaf, 0xf1, 0xc6, 0x4d, 0xb1, 0xef, 0xc9, 0xb4, 0x0a, 0x6d, 0x65, 0xf3, 0x47, 0xcc, -0xa3, 0x02, 0x21, 0x0c, 0xbe, 0x22, 0x29, 0x05, 0xcf, 0x5f, 0xe8, 0x94, 0x6c, 0xe5, 0xdc, -0xc4, 0xdf, 0xbe, 0x3e, 0xa8, 0xb4, 0x18, 0xb0, 0x99, 0xb8, 0x6f, 0xff, 0x5d, 0xb9, 0xfd, -0x3b, 0x5d, 0x16, 0xbf, 0x3e, 0xd8, 0xb3, 0xd8, 0x08, 0x34, 0xf6, 0x47, 0x35, 0x5b, 0x72, -0x1a, 0x33, 0xad, 0x52, 0x5d, 0xb8, 0xd0, 0x77, 0xc6, 0xab, 0xba, 0x55, 0x09, 0x5f, 0x02, -0xf8, 0xd4, 0x5f, 0x53, 0x06, 0x91, 0xcd, 0x74, 0x42, 0xae, 0x54, 0x91, 0x81, 0x62, 0x13, -0x6f, 0xd8, 0xa9, 0x77, 0xc3, 0x6c, 0xcb, 0xf1, 0x29, 0x5a, 0xcc, 0xda, 0x35, 0xbd, 0x52, -0x23, 0xbe, 0x59, 0xeb, 0x12, 0x6d, 0xb7, 0x53, 0xee, 0xfc, 0xb4, 0x1b, 0x13, 0x5e, 0xba, -0x16, 0x7c, 0xc5, 0xf3, 0xe3, 0x6d, 0x07, 0x78, 0xf5, 0x2b, 0x21, 0x05, 0x88, 0x4c, 0xc0, -0xa1, 0xe3, 0x36, 0x10, 0xf8, 0x1b, 0xd8, 0x17, 0xfb, 0x6a, 0x4e, 0xd8, 0xb3, 0x47, 0x2d, -0x99, 0xbd, 0xbb, 0x5d, 0x37, 0x7d, 0xba, 0xf1, 0xe1, 0x7c, 0xc0, 0xc5, 0x54, 0x62, 0x7f, -0xcf, 0x5a, 0x4a, 0x93, 0xcc, 0xf1, 0x1b, 0x34, 0xc8, 0xa6, 0x05, 0x4c, 0x55, 0x8b, 0x54, -0x84, 0xd5, 0x77, 0xeb, 0xc0, 0x6d, 0x3a, 0x29, 0xbd, 0x75, 0x61, 0x09, 0x9a, 0x2c, 0xbb, -0xf7, 0x18, 0x79, 0x34, 0x90, 0x24, 0xa5, 0x81, 0x70, 0x87, 0xc5, 0x02, 0x7c, 0xba, 0xd4, -0x5e, 0x14, 0x8e, 0xe4, 0xed, 0xa2, 0x61, 0x6a, 0xb9, 0x6e, 0xb5, 0x4a, 0xb9, 0x01, 0x46, -0xf4, 0xcf, 0xbc, 0x09, 0x2f, 0x27, 0x4b, 0xbd, 0x86, 0x7a, 0x10, 0xe1, 0xd4, 0xc8, 0xd9, -0x20, 0x8d, 0x8a, 0x63, 0x00, 0x63, 0x44, 0xeb, 0x54, 0x0b, 0x75, 0x49, 0x10, 0xa2, 0xa7, -0xad, 0xb9, 0xd1, 0x01, 0x80, 0x63, 0x25, 0xc8, 0x12, 0xa6, 0xce, 0x1e, 0xbe, 0xfe, 0x7e, -0x5f, 0x3c, 0xdb, 0x34, 0xea, 0x37, 0xec, 0x3b, 0xd5, 0x28, 0xd2, 0x07, 0x8c, 0x9a, 0xb6, -0xee, 0x5e, 0x3e, 0xdf, 0x1d, 0x99, 0xb0, 0xe2, 0x46, 0xef, 0x5c, 0x1b, 0xb4, 0xea, 0x56, -0x2e, 0xde, 0x1f, 0x9d, 0xb8, 0xd3, 0x24, 0xab, 0xd4, 0x2a, 0xd6, 0x2e, 0xde, 0x1f, 0x9d, -0xb8, 0xf2, 0x66, 0x2f, 0xbd, 0xf8, 0x72, 0x66, 0x4e, 0x1e, 0x9f, 0x9d, 0xb8, 0xf2, 0x47, -0x0c, 0x9a, 0xb6, 0xee, 0x3f, 0xfc, 0x7a, 0x57, 0x0d, 0x79, 0x70, 0x62, 0x27, 0xad, 0xb9, -0xd1, 0x01, 0x61, 0x40, 0x02, 0x67, 0x2d, 0xd8, 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xd7, 0x2c, -0xbb, 0xf4, 0x4b, 0xf5, 0x49, 0xf1, 0x60, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0xf9, 0x51, 0x01, -0x80, 0x63, 0x25, 0xa9, 0xb1, 0xe0, 0x42, 0xe7, 0x4c, 0x1a, 0x97, 0xac, 0xbb, 0xf4, 0x6a, -0x37, 0xcd, 0x18, 0xb2, 0xe6, 0x2f, 0xdc, 0x1b, 0x95, 0xa8, 0xd2, 0x07, 0x6d, 0x58, 0x32, -0xe6, 0x4e, 0x1e, 0x9f, 0xbc, 0xfa, 0x57, 0x0d, 0x79, 0x51, 0x20, 0xc2, 0x06, 0x6f, 0x5c, -0x1b, 0x95, 0xa8, 0xb3, 0xc5, 0xe9, 0x31, 0xe0, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0x18, 0x93, -0x85, 0x69, 0x31, 0xc1, 0xe1, 0x21, 0xc0, 0xe3, 0x44, 0x0a, 0x77, 0x6c, 0x5a, 0x17, 0x8d, -0x98, 0x93, 0xa4, 0xab, 0xd4, 0x2a, 0xb7, 0xec, 0x5a, 0x17, 0xac, 0xbb, 0xf4, 0x4b, 0x14, -0xaa, 0xb7, 0xec, 0x3b, 0xd5, 0x28, 0xb3, 0xc5, 0xe9, 0x31, 0xc1, 0x00, 0x82, 0x67, 0x4c, -0xfb, 0x55, 0x28, 0xd2, 0x26, 0xaf, 0xbd, 0xd9, 0x11, 0x81, 0x61, 0x21, 0xa1, 0xa1, 0xc0, -0x02, 0x86, 0x6f, 0x5c, 0x1b, 0xb4, 0xcb, 0x14, 0x8b, 0x94, 0xaa, 0xd6, 0x2e, 0xbf, 0xdd, -0x19, 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x7c, 0x5b, 0x15, 0x89, 0x90, 0x83, 0x84, 0x6b, 0x54, -0x0b, 0x75, 0x68, 0x52, 0x07, 0x6d, 0x58, 0x32, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0xed, 0x58, -0x32, 0xe6, 0x4e, 0xff, 0x7c, 0x7a, 0x76, 0x6e, 0x3f, 0xdd, 0x38, 0xd3, 0x05, 0x88, 0x92, -0xa6, 0xaf, 0xdc, 0x1b, 0xb4, 0xcb, 0xf5, 0x68, 0x52, 0x07, 0x8c, 0x7b, 0x55, 0x09, 0x90, -0x83, 0x84, 0x6b, 0x54, 0x2a, 0xb7, 0xec, 0x3b, 0xd5, 0x09, 0x90, 0xa2, 0xc6, 0x0e, 0x7f, -0x7c, 0x7a, 0x57, 0x0d, 0x98, 0xb2, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0x0c, 0x7b, 0x74, 0x4b, -0x14, 0x8b, 0x94, 0xaa, 0xb7, 0xcd, 0x18, 0x93, 0xa4, 0xca, 0x16, 0xae, 0xbf, 0xdd, 0x19, -0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x5d, 0x19, 0x91, 0x81, 0x80, 0x63, 0x44, 0xeb, 0x35, 0xc9, -0x10, 0x83, 0x65, 0x48, 0x12, 0xa6, 0xce, 0x1e, 0x9f, 0xbc, 0xdb, 0x15, 0x89, 0x71, 0x60, -0x23, 0xc4, 0xeb, 0x54, 0x2a, 0xb7, 0xec, 0x5a, 0x36, 0xcf, 0x81, 0x10, 0xac, 0x74 }; +const uint8_t firmware_data[FIRMWARE_LENGTH] PROGMEM = { + 0x01, 0xe8, 0xba, 0x26, 0x0b, 0xb2, 0xbe, 0xfe, 0x7e, 0x5f, 0x3c, 0xdb, 0x15, 0xa8, 0xb3, + 0xe4, 0x2b, 0xb5, 0xe8, 0x53, 0x07, 0x6d, 0x3b, 0xd1, 0x20, 0xc2, 0x06, 0x6f, 0x3d, 0xd9, + 0x11, 0xa0, 0xc2, 0xe7, 0x2d, 0xb9, 0xd1, 0x20, 0xa3, 0xa5, 0xc8, 0xf3, 0x64, 0x4a, 0xf7, + 0x4d, 0x18, 0x93, 0xa4, 0xca, 0xf7, 0x6c, 0x5a, 0x36, 0xee, 0x5e, 0x3e, 0xfe, 0x7e, 0x7e, + 0x5f, 0x1d, 0x99, 0xb0, 0xc3, 0xe5, 0x29, 0xd3, 0x03, 0x65, 0x48, 0x12, 0x87, 0x6d, 0x58, + 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xf2, 0x4f, 0xfd, 0x59, 0x11, 0x81, 0x61, 0x21, 0xc0, 0x02, + 0x86, 0x8e, 0x7f, 0x5d, 0x38, 0xf2, 0x47, 0x0c, 0x7b, 0x55, 0x28, 0xb3, 0xe4, 0x4a, 0x16, + 0xab, 0xbf, 0xdd, 0x38, 0xf2, 0x66, 0x4e, 0xff, 0x5d, 0x19, 0x91, 0xa0, 0xa3, 0xa5, 0xc8, + 0x12, 0xa6, 0xaf, 0xdc, 0x3a, 0xd1, 0x41, 0x60, 0x75, 0x58, 0x24, 0x92, 0xd4, 0x72, 0x6c, + 0xe0, 0x2f, 0xfd, 0x23, 0x8d, 0x1c, 0x5b, 0xb2, 0x97, 0x36, 0x3d, 0x0b, 0xa2, 0x49, 0xb1, + 0x58, 0xf2, 0x1f, 0xc0, 0xcb, 0xf8, 0x41, 0x4f, 0xcd, 0x1e, 0x6b, 0x39, 0xa7, 0x2b, 0xe9, + 0x30, 0x16, 0x83, 0xd2, 0x0e, 0x47, 0x8f, 0xe3, 0xb1, 0xdf, 0xa2, 0x15, 0xdb, 0x5d, 0x30, + 0xc5, 0x1a, 0xab, 0x31, 0x99, 0xf3, 0xfa, 0xb2, 0x86, 0x69, 0xad, 0x7a, 0xe8, 0xa7, 0x18, + 0x6a, 0xcc, 0xc8, 0x65, 0x23, 0x87, 0xa8, 0x5f, 0xf5, 0x21, 0x59, 0x75, 0x09, 0x71, 0x45, + 0x55, 0x25, 0x4b, 0xda, 0xa1, 0xc3, 0xf7, 0x41, 0xab, 0x59, 0xd9, 0x74, 0x12, 0x55, 0x5f, + 0xbc, 0xaf, 0xd9, 0xfd, 0xb0, 0x1e, 0xa3, 0x0f, 0xff, 0xde, 0x11, 0x16, 0x6a, 0xae, 0x0e, + 0xe1, 0x5d, 0x3c, 0x10, 0x43, 0x9a, 0xa1, 0x0b, 0x24, 0x8f, 0x0d, 0x7f, 0x0b, 0x5e, 0x4c, + 0x42, 0xa4, 0x84, 0x2c, 0x40, 0xd0, 0x55, 0x39, 0xe6, 0x4b, 0xf8, 0x9b, 0x2f, 0xdc, 0x28, + 0xff, 0xfa, 0xb5, 0x85, 0x19, 0xe5, 0x28, 0xa1, 0x77, 0xaa, 0x73, 0xf3, 0x03, 0xc7, 0x62, + 0xa6, 0x91, 0x18, 0xc9, 0xb0, 0xcd, 0x05, 0xdc, 0xca, 0x81, 0x26, 0x1a, 0x47, 0x40, 0xda, + 0x36, 0x7d, 0x6a, 0x53, 0xc8, 0x5a, 0x77, 0x5d, 0x19, 0xa4, 0x1b, 0x23, 0x83, 0xd0, 0xb2, + 0xaa, 0x0e, 0xbf, 0x77, 0x4e, 0x3a, 0x3b, 0x59, 0x00, 0x31, 0x0d, 0x02, 0x1b, 0x88, 0x7a, + 0xd4, 0xbd, 0x9d, 0xcc, 0x58, 0x04, 0x69, 0xf6, 0x3b, 0xca, 0x42, 0xe2, 0xfd, 0xc3, 0x3d, + 0x39, 0xc5, 0xd0, 0x71, 0xe4, 0xc8, 0xb7, 0x3e, 0x3f, 0xc8, 0xe9, 0xca, 0xc9, 0x3f, 0x04, + 0x4e, 0x1b, 0x79, 0xca, 0xa5, 0x61, 0xc2, 0xed, 0x1d, 0xa6, 0xda, 0x5a, 0xe9, 0x7f, 0x65, + 0x8c, 0xbe, 0x12, 0x6e, 0xa4, 0x5b, 0x33, 0x2f, 0x84, 0x28, 0x9c, 0x1c, 0x88, 0x2d, 0xff, + 0x07, 0xbf, 0xa6, 0xd7, 0x5a, 0x88, 0x86, 0xb0, 0x3f, 0xf6, 0x31, 0x5b, 0x11, 0x6d, 0xf5, + 0x58, 0xeb, 0x58, 0x02, 0x9e, 0xb5, 0x9a, 0xb1, 0xff, 0x25, 0x9d, 0x8b, 0x4f, 0xb6, 0x0a, + 0xf9, 0xea, 0x3e, 0x3f, 0x21, 0x09, 0x65, 0x21, 0x22, 0xfe, 0x3d, 0x4e, 0x11, 0x5b, 0x9e, + 0x5a, 0x59, 0x8b, 0xdd, 0xd8, 0xce, 0xd6, 0xd9, 0x59, 0xd2, 0x1e, 0xfd, 0xef, 0x0d, 0x1b, + 0xd9, 0x61, 0x7f, 0xd7, 0x2d, 0xad, 0x62, 0x09, 0xe5, 0x22, 0x63, 0xea, 0xc7, 0x31, 0xd9, + 0xa1, 0x38, 0x80, 0x5c, 0xa7, 0x32, 0x82, 0xec, 0x1b, 0xa2, 0x49, 0x5a, 0x06, 0xd2, 0x7c, + 0xc9, 0x96, 0x57, 0xbb, 0x17, 0x75, 0xfc, 0x7a, 0x8f, 0x0d, 0x77, 0xb5, 0x7a, 0x8e, 0x3e, + 0xf4, 0xba, 0x2f, 0x69, 0x13, 0x26, 0xd6, 0xd9, 0x21, 0x60, 0x2f, 0x21, 0x3e, 0x87, 0xee, + 0xfd, 0x87, 0x16, 0x0d, 0xc8, 0x08, 0x00, 0x25, 0x71, 0xac, 0x2c, 0x03, 0x2a, 0x37, 0x2d, + 0xb3, 0x34, 0x09, 0x91, 0xe3, 0x06, 0x2c, 0x38, 0x37, 0x95, 0x3b, 0x17, 0x7a, 0xaf, 0xac, + 0x99, 0x55, 0xab, 0x41, 0x39, 0x5f, 0x8e, 0xa6, 0x43, 0x80, 0x03, 0x88, 0x6f, 0x7d, 0xbd, + 0x5a, 0xb4, 0x2b, 0x32, 0x23, 0x5a, 0xa9, 0x31, 0x32, 0x39, 0x4c, 0x5b, 0xf4, 0x6b, 0xaf, + 0x66, 0x6f, 0x3c, 0x8e, 0x2d, 0x82, 0x97, 0x9f, 0x4a, 0x01, 0xdc, 0x99, 0x98, 0x00, 0xec, + 0x38, 0x7a, 0x79, 0x70, 0xa6, 0x85, 0xd6, 0x21, 0x63, 0x0d, 0x45, 0x9a, 0x2e, 0x5e, 0xa7, + 0xb1, 0xea, 0x66, 0x6a, 0xbc, 0x62, 0x2d, 0x7b, 0x7d, 0x85, 0xea, 0x95, 0x2f, 0xc0, 0xe8, + 0x6f, 0x35, 0xa0, 0x3a, 0x02, 0x25, 0xbc, 0xb2, 0x5f, 0x5c, 0x43, 0x96, 0xcc, 0x26, 0xd2, + 0x16, 0xb4, 0x96, 0x73, 0xd7, 0x13, 0xc7, 0xae, 0x53, 0x15, 0x31, 0x89, 0x68, 0x66, 0x6d, + 0x2c, 0x92, 0x1f, 0xcc, 0x5b, 0xa7, 0x8f, 0x5d, 0xbb, 0xc9, 0xdb, 0xe8, 0x3b, 0x9d, 0x61, + 0x74, 0x8b, 0x05, 0xa1, 0x58, 0x52, 0x68, 0xee, 0x3d, 0x39, 0x79, 0xa0, 0x9b, 0xdd, 0xe1, + 0x55, 0xc9, 0x60, 0xeb, 0xad, 0xb8, 0x5b, 0xc2, 0x5a, 0xb5, 0x2c, 0x18, 0x55, 0xa9, 0x50, + 0xc3, 0xf6, 0x72, 0x5f, 0xcc, 0xe2, 0xf4, 0x55, 0xb5, 0xd6, 0xb5, 0x4a, 0x99, 0xa5, 0x28, + 0x74, 0x97, 0x18, 0xe8, 0xc0, 0x84, 0x89, 0x50, 0x03, 0x86, 0x4d, 0x1a, 0xb7, 0x09, 0x90, + 0xa2, 0x01, 0x04, 0xbb, 0x73, 0x62, 0xcb, 0x97, 0x22, 0x70, 0x5d, 0x52, 0x41, 0x8e, 0xd9, + 0x90, 0x15, 0xaa, 0xab, 0x0a, 0x31, 0x65, 0xb4, 0xda, 0xd0, 0xee, 0x24, 0xc9, 0x41, 0x91, + 0x1e, 0xbc, 0x46, 0x70, 0x40, 0x9d, 0xda, 0x0e, 0x2a, 0xe4, 0xb2, 0x4c, 0x9f, 0xf2, 0xfc, + 0xf3, 0x84, 0x17, 0x44, 0x1e, 0xd7, 0xca, 0x23, 0x1f, 0x3f, 0x5a, 0x22, 0x3d, 0xaf, 0x9b, + 0x2d, 0xfc, 0x41, 0xad, 0x26, 0xb4, 0x45, 0x67, 0x0b, 0x80, 0x0e, 0xf9, 0x61, 0x37, 0xec, + 0x3b, 0xf4, 0x4b, 0x14, 0xdf, 0x5a, 0x0c, 0x3a, 0x50, 0x0b, 0x14, 0x0c, 0x72, 0xae, 0xc6, + 0xc5, 0xec, 0x35, 0x53, 0x2d, 0x59, 0xed, 0x91, 0x74, 0xe2, 0xc4, 0xc8, 0xf2, 0x25, 0x6b, + 0x97, 0x6f, 0xc9, 0x76, 0xce, 0xa9, 0xb1, 0x99, 0x8f, 0x5a, 0x92, 0x3b, 0xc4, 0x8d, 0x54, + 0x50, 0x40, 0x72, 0xd6, 0x90, 0x83, 0xfc, 0xe5, 0x49, 0x8b, 0x17, 0xf5, 0xfd, 0x6b, 0x8d, + 0x32, 0x02, 0xe9, 0x0a, 0xfe, 0xbf, 0x00, 0x6b, 0xa3, 0xad, 0x5f, 0x09, 0x4b, 0x97, 0x2b, + 0x00, 0x58, 0x65, 0x2e, 0x07, 0x49, 0x0a, 0x3b, 0x6b, 0x2e, 0x50, 0x6c, 0x1d, 0xac, 0xb7, + 0x6a, 0x26, 0xd8, 0x13, 0xa4, 0xca, 0x16, 0xae, 0xab, 0x93, 0xb9, 0x1c, 0x1c, 0xb4, 0x47, + 0x6a, 0x38, 0x36, 0x17, 0x27, 0xc9, 0x7f, 0xc7, 0x64, 0xcb, 0x89, 0x58, 0xc5, 0x61, 0xc2, + 0xc6, 0xea, 0x15, 0x0b, 0x34, 0x0c, 0x5d, 0x61, 0x76, 0x6e, 0x2b, 0x62, 0x40, 0x92, 0xa3, + 0x6c, 0xef, 0xf4, 0xe4, 0xc3, 0xa1, 0xa8, 0xf5, 0x94, 0x79, 0x0d, 0xd1, 0x3d, 0xcb, 0x3d, + 0x40, 0xb6, 0xd0, 0xf0, 0x10, 0x54, 0xd8, 0x47, 0x25, 0x51, 0xc5, 0x41, 0x79, 0x00, 0xe5, + 0xa0, 0x72, 0xde, 0xbb, 0x3b, 0x62, 0x17, 0xf6, 0xbc, 0x5d, 0x00, 0x76, 0x2e, 0xa7, 0x3b, + 0xb6, 0xf1, 0x98, 0x72, 0x59, 0x2a, 0x73, 0xb0, 0x21, 0xd6, 0x49, 0xe0, 0xc0, 0xd5, 0xeb, + 0x02, 0x7d, 0x4b, 0x41, 0x28, 0x70, 0x2d, 0xec, 0x2b, 0x71, 0x1f, 0x0b, 0xb9, 0x71, 0x63, + 0x06, 0xe6, 0xbc, 0x60, 0xbb, 0xf4, 0x9a, 0x62, 0x43, 0x09, 0x18, 0x4e, 0x93, 0x06, 0x4d, + 0x76, 0xfa, 0x7f, 0xbd, 0x02, 0xe4, 0x50, 0x91, 0x12, 0xe5, 0x86, 0xff, 0x64, 0x1e, 0xaf, + 0x7e, 0xb3, 0xb2, 0xde, 0x89, 0xc1, 0xa2, 0x6f, 0x40, 0x7b, 0x41, 0x51, 0x63, 0xea, 0x25, + 0xd1, 0x97, 0x57, 0x92, 0xa8, 0x45, 0xa1, 0xa5, 0x45, 0x21, 0x43, 0x7f, 0x83, 0x15, 0x29, + 0xd0, 0x30, 0x53, 0x32, 0xb4, 0x5a, 0x17, 0x96, 0xbc, 0xc2, 0x68, 0xa9, 0xb7, 0xaf, 0xac, + 0xdf, 0xf1, 0xe3, 0x89, 0xba, 0x24, 0x79, 0x54, 0xc6, 0x14, 0x07, 0x1c, 0x1e, 0x0d, 0x3a, + 0x6b, 0xe5, 0x3d, 0x4e, 0x10, 0x60, 0x96, 0xec, 0x6c, 0xda, 0x47, 0xae, 0x03, 0x25, 0x39, + 0x1d, 0x74, 0xc8, 0xac, 0x6a, 0xf2, 0x6b, 0x05, 0x2a, 0x9a, 0xe7, 0xe8, 0x92, 0xd6, 0xc2, + 0x6d, 0xfa, 0xe8, 0xa7, 0x9d, 0x5f, 0x48, 0xc9, 0x75, 0xf1, 0x66, 0x6a, 0xdb, 0x5d, 0x9a, + 0xcd, 0x27, 0xdd, 0xb9, 0x24, 0x04, 0x9c, 0x18, 0xc2, 0x6d, 0x0c, 0x91, 0x34, 0x48, 0x42, + 0x6f, 0xe9, 0x59, 0x70, 0xc4, 0x7e, 0x81, 0x0e, 0x32, 0x0a, 0x93, 0x48, 0xb0, 0xc0, 0x15, + 0x9e, 0x05, 0xac, 0x36, 0x16, 0xcb, 0x59, 0x65, 0xa0, 0x83, 0xdf, 0x3e, 0xda, 0xfb, 0x1d, + 0x1a, 0xdb, 0x65, 0xec, 0x9a, 0xc6, 0xc3, 0x8e, 0x3c, 0x45, 0xfd, 0xc8, 0xf5, 0x1c, 0x6a, + 0x67, 0x0d, 0x8f, 0x99, 0x7d, 0x30, 0x21, 0x8c, 0xea, 0x22, 0x87, 0x65, 0xc9, 0xb2, 0x4c, + 0xe4, 0x1b, 0x46, 0xba, 0x54, 0xbd, 0x7c, 0xca, 0xd5, 0x8f, 0x5b, 0xa5, 0x01, 0x04, 0xd8, + 0x0a, 0x16, 0xbf, 0xb9, 0x50, 0x2e, 0x37, 0x2f, 0x64, 0xf3, 0x70, 0x11, 0x02, 0x05, 0x31, + 0x9b, 0xa0, 0xb2, 0x01, 0x5e, 0x4f, 0x19, 0xc9, 0xd4, 0xea, 0xa1, 0x79, 0x54, 0x53, 0xa7, + 0xde, 0x2f, 0x49, 0xd3, 0xd1, 0x63, 0xb5, 0x03, 0x15, 0x4e, 0xbf, 0x04, 0xb3, 0x26, 0x8b, + 0x20, 0xb2, 0x45, 0xcf, 0xcd, 0x5b, 0x82, 0x32, 0x88, 0x61, 0xa7, 0xa8, 0xb2, 0xa0, 0x72, + 0x96, 0xc0, 0xdb, 0x2b, 0xe2, 0x5f, 0xba, 0xe3, 0xf5, 0x8a, 0xde, 0xf1, 0x18, 0x01, 0x16, + 0x40, 0xd9, 0x86, 0x12, 0x09, 0x18, 0x1b, 0x05, 0x0c, 0xb1, 0xb5, 0x47, 0xe2, 0x43, 0xab, + 0xfe, 0x92, 0x63, 0x7e, 0x95, 0x2b, 0xf0, 0xaf, 0xe1, 0xf1, 0xc3, 0x4a, 0xff, 0x2b, 0x09, + 0xbb, 0x4a, 0x0e, 0x9a, 0xc4, 0xd8, 0x64, 0x7d, 0x83, 0xa0, 0x4f, 0x44, 0xdb, 0xc4, 0xa8, + 0x58, 0xef, 0xfc, 0x9e, 0x77, 0xf9, 0xa6, 0x8f, 0x58, 0x8b, 0x12, 0xf4, 0xe9, 0x81, 0x12, + 0x47, 0x51, 0x41, 0x83, 0xef, 0xf6, 0x73, 0xbc, 0x8e, 0x0f, 0x4c, 0x8f, 0x4e, 0x69, 0x90, + 0x77, 0x29, 0x5d, 0x92, 0xb0, 0x6d, 0x06, 0x67, 0x29, 0x60, 0xbd, 0x4b, 0x17, 0xc8, 0x89, + 0x69, 0x28, 0x29, 0xd6, 0x78, 0xcb, 0x11, 0x4c, 0xba, 0x8b, 0x68, 0xae, 0x7e, 0x9f, 0xef, + 0x95, 0xda, 0xe2, 0x9e, 0x7f, 0xe9, 0x55, 0xe5, 0xe1, 0xe2, 0xb7, 0xe6, 0x5f, 0xbb, 0x2c, + 0xa2, 0xe6, 0xee, 0xc7, 0x0a, 0x60, 0xa9, 0xd1, 0x80, 0xdf, 0x7f, 0xd6, 0x97, 0xab, 0x1d, + 0x22, 0x25, 0xfc, 0x79, 0x23, 0xe0, 0xae, 0xc5, 0xef, 0x16, 0xa4, 0xa1, 0x0f, 0x92, 0xa9, + 0xc7, 0xe3, 0x3a, 0x55, 0xdf, 0x62, 0x49, 0xd9, 0xf5, 0x84, 0x49, 0xc5, 0x90, 0x34, 0xd3, + 0xe1, 0xac, 0x99, 0x21, 0xb1, 0x02, 0x76, 0x4a, 0xfa, 0xd4, 0xbb, 0xa4, 0x9c, 0xa2, 0xe2, + 0xcb, 0x3d, 0x3b, 0x14, 0x75, 0x60, 0xd1, 0x02, 0xb4, 0xa3, 0xb4, 0x72, 0x06, 0xf9, 0x19, + 0x9c, 0xe2, 0xe4, 0xa7, 0x0f, 0x25, 0x88, 0xc6, 0x86, 0xd6, 0x8c, 0x74, 0x4e, 0x6e, 0xfc, + 0xa8, 0x48, 0x9e, 0xa7, 0x9d, 0x1a, 0x4b, 0x37, 0x09, 0xc8, 0xb0, 0x10, 0xbe, 0x6f, 0xfe, + 0xa3, 0xc4, 0x7a, 0xb5, 0x3d, 0xe8, 0x30, 0xf1, 0x0d, 0xa0, 0xb2, 0x44, 0xfc, 0x9b, 0x8c, + 0xf8, 0x61, 0xed, 0x81, 0xd1, 0x62, 0x11, 0xb4, 0xe1, 0xd5, 0x39, 0x52, 0x89, 0xd3, 0xa8, + 0x49, 0x31, 0xdf, 0xb6, 0xf9, 0x91, 0xf4, 0x1c, 0x9d, 0x09, 0x95, 0x40, 0x56, 0xe7, 0xe3, + 0xcd, 0x5c, 0x92, 0xc1, 0x1d, 0x6b, 0xe9, 0x78, 0x6f, 0x8e, 0x94, 0x42, 0x66, 0xa2, 0xaa, + 0xd3, 0xc8, 0x2e, 0xe3, 0xf6, 0x07, 0x72, 0x0b, 0x6b, 0x1e, 0x7b, 0xb9, 0x7c, 0xe0, 0xa0, + 0xbc, 0xd9, 0x25, 0xdf, 0x87, 0xa8, 0x5f, 0x9c, 0xcc, 0xf0, 0xdb, 0x42, 0x8e, 0x07, 0x31, + 0x13, 0x01, 0x66, 0x32, 0xd1, 0xb8, 0xd6, 0xe3, 0x5e, 0x12, 0x76, 0x61, 0xd3, 0x38, 0x89, + 0xe6, 0x17, 0x6f, 0xa5, 0xf2, 0x71, 0x0e, 0xa5, 0xe2, 0x88, 0x30, 0xbb, 0xbe, 0x8a, 0xea, + 0xc7, 0x62, 0xc4, 0xcf, 0xb8, 0xcd, 0x33, 0x8d, 0x3d, 0x3e, 0xb5, 0x60, 0x3a, 0x03, 0x92, + 0xe4, 0x6d, 0x1b, 0xe0, 0xb4, 0x84, 0x08, 0x55, 0x88, 0xa7, 0x3a, 0xb9, 0x3d, 0x43, 0xc3, + 0xc0, 0xfa, 0x07, 0x6a, 0xca, 0x94, 0xad, 0x99, 0x55, 0xf1, 0xf1, 0xc0, 0x23, 0x87, 0x1d, + 0x3d, 0x1c, 0xd1, 0x66, 0xa0, 0x57, 0x10, 0x52, 0xa2, 0x7f, 0xbe, 0xf9, 0x88, 0xb6, 0x02, + 0xbf, 0x08, 0x23, 0xa9, 0x0c, 0x63, 0x17, 0x2a, 0xae, 0xf5, 0xf7, 0xb7, 0x21, 0x83, 0x92, + 0x31, 0x23, 0x0d, 0x20, 0xc3, 0xc2, 0x05, 0x21, 0x62, 0x8e, 0x45, 0xe8, 0x14, 0xc1, 0xda, + 0x75, 0xb8, 0xf8, 0x92, 0x01, 0xd0, 0x5d, 0x18, 0x9f, 0x99, 0x11, 0x19, 0xf5, 0x35, 0xe8, + 0x7f, 0x20, 0x88, 0x8c, 0x05, 0x75, 0xf5, 0xd7, 0x40, 0x17, 0xbb, 0x1e, 0x36, 0x52, 0xd9, + 0xa4, 0x9c, 0xc2, 0x9d, 0x42, 0x81, 0xd8, 0xc7, 0x8a, 0xe7, 0x4c, 0x81, 0xe0, 0xb7, 0x57, + 0xed, 0x48, 0x8b, 0xf0, 0x97, 0x15, 0x61, 0xd9, 0x2c, 0x7c, 0x45, 0xaf, 0xc2, 0xcd, 0xfc, + 0xaa, 0x13, 0xad, 0x59, 0xcc, 0xb2, 0xb2, 0x6e, 0xdd, 0x63, 0x9c, 0x32, 0x0f, 0xec, 0x83, + 0xbe, 0x78, 0xac, 0x91, 0x44, 0x1a, 0x1f, 0xea, 0xfd, 0x5d, 0x8e, 0xb4, 0xc0, 0x84, 0xd4, + 0xac, 0xb4, 0x87, 0x5f, 0xac, 0xef, 0xdf, 0xcd, 0x12, 0x56, 0xc8, 0xcd, 0xfe, 0xc5, 0xda, + 0xd3, 0xc1, 0x69, 0xf3, 0x61, 0x05, 0xea, 0x25, 0xe2, 0x12, 0x05, 0x8f, 0x39, 0x08, 0x08, + 0x7c, 0x37, 0xb6, 0x7e, 0x5b, 0xd8, 0xb1, 0x0e, 0xf2, 0xdb, 0x4b, 0xf1, 0xad, 0x90, 0x01, + 0x57, 0xcd, 0xa0, 0xb4, 0x52, 0xe8, 0xf3, 0xd7, 0x8a, 0xbd, 0x4f, 0x9f, 0x21, 0x40, 0x72, + 0xa4, 0xfc, 0x0b, 0x01, 0x2b, 0x2f, 0xb6, 0x4c, 0x95, 0x2d, 0x35, 0x33, 0x41, 0x6b, 0xa0, + 0x93, 0xe7, 0x2c, 0xf2, 0xd3, 0x72, 0x8b, 0xf4, 0x4f, 0x15, 0x3c, 0xaf, 0xd6, 0x12, 0xde, + 0x3f, 0x83, 0x3f, 0xff, 0xf8, 0x7f, 0xf6, 0xcc, 0xa6, 0x7f, 0xc9, 0x9a, 0x6e, 0x1f, 0xc1, + 0x0c, 0xfb, 0xee, 0x9c, 0xe7, 0xaf, 0xc9, 0x26, 0x54, 0xef, 0xb0, 0x39, 0xef, 0xb2, 0xe9, + 0x23, 0xc4, 0xef, 0xd1, 0xa1, 0xa4, 0x25, 0x24, 0x6f, 0x8d, 0x6a, 0xe5, 0x8a, 0x32, 0x3a, + 0xaf, 0xfc, 0xda, 0xce, 0x18, 0x25, 0x42, 0x07, 0x4d, 0x45, 0x8b, 0xdf, 0x85, 0xcf, 0x55, + 0xb2, 0x24, 0xfe, 0x9c, 0x69, 0x74, 0xa7, 0x6e, 0xa0, 0xce, 0xc0, 0x39, 0xf4, 0x86, 0xc6, + 0x8d, 0xae, 0xb9, 0x48, 0x64, 0x13, 0x0b, 0x40, 0x81, 0xa2, 0xc9, 0xa8, 0x85, 0x51, 0xee, + 0x9f, 0xcf, 0xa2, 0x8c, 0x19, 0x52, 0x48, 0xe2, 0xc1, 0xa8, 0x58, 0xb4, 0x10, 0x24, 0x06, + 0x58, 0x51, 0xfc, 0xb9, 0x12, 0xec, 0xfd, 0x73, 0xb4, 0x6d, 0x84, 0xfa, 0x06, 0x8b, 0x05, + 0x0b, 0x2d, 0xd6, 0xd6, 0x1f, 0x29, 0x82, 0x9f, 0x19, 0x12, 0x1e, 0xb2, 0x04, 0x8f, 0x7f, + 0x4d, 0xbd, 0x30, 0x2e, 0xe3, 0xe0, 0x88, 0x29, 0xc5, 0x93, 0xd6, 0x6c, 0x1f, 0x29, 0x45, + 0x91, 0xa7, 0x58, 0xcd, 0x05, 0x17, 0xd6, 0x6d, 0xb3, 0xca, 0x66, 0xcc, 0x3c, 0x4a, 0x74, + 0xfd, 0x08, 0x10, 0xa6, 0x99, 0x92, 0x10, 0xd2, 0x85, 0xab, 0x6e, 0x1d, 0x0e, 0x8b, 0x26, + 0x46, 0xd1, 0x6c, 0x84, 0xc0, 0x26, 0x43, 0x59, 0x68, 0xf0, 0x13, 0x1d, 0xfb, 0xe3, 0xd1, + 0xd2, 0xb4, 0x71, 0x9e, 0xf2, 0x59, 0x6a, 0x33, 0x29, 0x79, 0xd2, 0xd7, 0x26, 0xf1, 0xae, + 0x78, 0x9e, 0x1f, 0x0f, 0x3f, 0xe3, 0xe8, 0xd0, 0x27, 0x78, 0x77, 0xf6, 0xac, 0x9c, 0x56, + 0x39, 0x73, 0x8a, 0x6b, 0x2f, 0x34, 0x78, 0xb1, 0x11, 0xdb, 0xa4, 0x5c, 0x80, 0x01, 0x71, + 0x6a, 0xc2, 0xd1, 0x2e, 0x5e, 0x76, 0x28, 0x70, 0x93, 0xae, 0x3e, 0x78, 0xb0, 0x1f, 0x0f, + 0xda, 0xbf, 0xfb, 0x8a, 0x67, 0x65, 0x4f, 0x91, 0xed, 0x49, 0x75, 0x78, 0x62, 0xa2, 0x93, + 0xb5, 0x70, 0x7f, 0x4d, 0x08, 0x4e, 0x79, 0x61, 0xa8, 0x5f, 0x7f, 0xb4, 0x65, 0x9f, 0x91, + 0x54, 0x3a, 0xe8, 0x50, 0x33, 0xd3, 0xd5, 0x8a, 0x7c, 0xf3, 0x9e, 0x8b, 0x77, 0x7b, 0xc6, + 0xc6, 0x0c, 0x45, 0x95, 0x1f, 0xb0, 0xd0, 0x0b, 0x27, 0x4a, 0xfd, 0xc7, 0xf7, 0x0d, 0x5a, + 0x43, 0xc9, 0x7d, 0x35, 0xb0, 0x7d, 0xc4, 0x9c, 0x57, 0x1e, 0x76, 0x0d, 0xf1, 0x95, 0x30, + 0x71, 0xcc, 0xb3, 0x66, 0x3b, 0x63, 0xa8, 0x6c, 0xa3, 0x43, 0xa0, 0x24, 0xcc, 0xb7, 0x53, + 0xfe, 0xfe, 0xbc, 0x6e, 0x60, 0x89, 0xaf, 0x16, 0x21, 0xc8, 0x91, 0x6a, 0x89, 0xce, 0x80, + 0x2c, 0xf1, 0x59, 0xce, 0xc3, 0x60, 0x61, 0x3b, 0x0b, 0x19, 0xfe, 0x99, 0xac, 0x65, 0x90, + 0x15, 0x12, 0x05, 0xac, 0x7e, 0xff, 0x98, 0x7b, 0x66, 0x64, 0x0e, 0x4b, 0x5b, 0xaa, 0x8d, + 0x3b, 0xd2, 0x56, 0xcf, 0x99, 0x39, 0xee, 0x22, 0x81, 0xd0, 0x60, 0x06, 0x66, 0x20, 0x81, + 0x48, 0x3c, 0x6f, 0x3a, 0x77, 0xba, 0xcb, 0x52, 0xac, 0x79, 0x56, 0xaf, 0xe9, 0x16, 0x17, + 0x0a, 0xa3, 0x82, 0x08, 0xd5, 0x3c, 0x97, 0xcb, 0x09, 0xff, 0x7f, 0xf9, 0x4f, 0x60, 0x05, + 0xb9, 0x53, 0x26, 0xaa, 0xb8, 0x50, 0xaa, 0x19, 0x25, 0xae, 0x5f, 0xea, 0x8a, 0xd0, 0x89, + 0x12, 0x80, 0x43, 0x50, 0x24, 0x12, 0x21, 0x14, 0xcd, 0x77, 0xeb, 0x21, 0xcc, 0x5c, 0x09, + 0x64, 0xf3, 0xc7, 0xcb, 0xc5, 0x4b, 0xc3, 0xe7, 0xed, 0xe7, 0x86, 0x2c, 0x1d, 0x8e, 0x19, + 0x52, 0x9b, 0x2a, 0x0c, 0x18, 0x72, 0x0b, 0x1e, 0x1b, 0xb0, 0x0f, 0x42, 0x99, 0x04, 0xae, + 0xd5, 0xb7, 0x89, 0x1a, 0xb9, 0x4f, 0xd6, 0xaf, 0xf3, 0xc9, 0x93, 0x6f, 0xb0, 0x60, 0x83, + 0x6e, 0x6b, 0xd1, 0x5f, 0x3f, 0x1a, 0x83, 0x1e, 0x24, 0x00, 0x87, 0xb5, 0x3e, 0xdb, 0xf9, + 0x4d, 0xa7, 0x16, 0x2e, 0x19, 0x5b, 0x8f, 0x1b, 0x0d, 0x47, 0x72, 0x42, 0xe9, 0x0a, 0x11, + 0x08, 0x2d, 0x88, 0x1c, 0xbc, 0xc7, 0xb4, 0xbe, 0x29, 0x4d, 0x03, 0x5e, 0xec, 0xdf, 0xf3, + 0x3d, 0x2f, 0xe8, 0x1d, 0x9a, 0xd2, 0xd1, 0xab, 0x41, 0x3d, 0x87, 0x11, 0x45, 0xb0, 0x0d, + 0x46, 0xf5, 0xe8, 0x95, 0x62, 0x1c, 0x68, 0xf7, 0xa6, 0x5b, 0x39, 0x4e, 0xbf, 0x47, 0xba, + 0x5d, 0x7f, 0xb7, 0x6a, 0xf4, 0xba, 0x1d, 0x69, 0xf6, 0xa4, 0xe7, 0xe4, 0x6b, 0x3b, 0x0d, + 0x23, 0x16, 0x4a, 0xb2, 0x68, 0xf0, 0xb2, 0x0d, 0x09, 0x17, 0x6a, 0x63, 0x8c, 0x83, 0xd3, + 0xbd, 0x05, 0xc9, 0xf6, 0xf0, 0xa1, 0x31, 0x0b, 0x2c, 0xac, 0x83, 0xac, 0x80, 0x34, 0x32, + 0xb4, 0xec, 0xd0, 0xbc, 0x54, 0x82, 0x9a, 0xc8, 0xf6, 0xa0, 0x7d, 0xc6, 0x79, 0x73, 0xf4, + 0x20, 0x99, 0xf3, 0xb4, 0x01, 0xde, 0x91, 0x27, 0xf2, 0xc0, 0xdc, 0x81, 0x00, 0x4e, 0x7e, + 0x07, 0x99, 0xc8, 0x3a, 0x51, 0xbc, 0x38, 0xd6, 0x8a, 0xa2, 0xde, 0x3b, 0x6a, 0x8c, 0x1a, + 0x7c, 0x81, 0x0f, 0x3a, 0x1f, 0xe4, 0x05, 0x7b, 0x20, 0x35, 0x6b, 0xa5, 0x6a, 0xa7, 0xe7, + 0xbc, 0x9c, 0x20, 0xec, 0x00, 0x15, 0xe2, 0x51, 0xaf, 0x77, 0xeb, 0x29, 0x3c, 0x7d, 0x2e, + 0x00, 0x5c, 0x81, 0x21, 0xfa, 0x35, 0x6f, 0x40, 0xef, 0xfb, 0xd1, 0x3f, 0xcc, 0x9d, 0x55, + 0x53, 0xfb, 0x5a, 0xa5, 0x56, 0x89, 0x0b, 0x52, 0xeb, 0x57, 0x73, 0x4f, 0x1b, 0x67, 0x24, + 0xcb, 0xb8, 0x6a, 0x10, 0x69, 0xd6, 0xfb, 0x52, 0x40, 0xff, 0x20, 0xa5, 0xf3, 0x72, 0xe1, + 0x3d, 0xa4, 0x8c, 0x81, 0x66, 0x16, 0x0d, 0x5d, 0xad, 0xa8, 0x50, 0x25, 0x78, 0x31, 0x77, + 0x0c, 0x57, 0xe4, 0xe9, 0x15, 0x2d, 0xdb, 0x07, 0x87, 0xc8, 0xb0, 0x43, 0xde, 0xfc, 0xfe, + 0xa9, 0xeb, 0xf5, 0xb0, 0xd3, 0x7b, 0xe9, 0x1f, 0x6e, 0xca, 0xe4, 0x03, 0x95, 0xc5, 0xd1, + 0x59, 0x72, 0x63, 0xf0, 0x86, 0x54, 0xe8, 0x16, 0x62, 0x0b, 0x35, 0x29, 0xc2, 0x68, 0xd0, + 0xd6, 0x3e, 0x90, 0x60, 0x57, 0x1d, 0xc9, 0xed, 0x3f, 0xed, 0xb0, 0x2f, 0x7e, 0x97, 0x02, + 0x51, 0xec, 0xee, 0x6f, 0x82, 0x74, 0x76, 0x7f, 0xfb, 0xd6, 0xc4, 0xc3, 0xdd, 0xe8, 0xb1, + 0x60, 0xfc, 0xc6, 0xb9, 0x0d, 0x6a, 0x33, 0x78, 0xc6, 0xc1, 0xbf, 0x86, 0x2c, 0x50, 0xcc, + 0x9a, 0x70, 0x8e, 0x7b, 0xec, 0xab, 0x95, 0xac, 0x53, 0xa0, 0x4b, 0x07, 0x88, 0xaf, 0x42, + 0xed, 0x19, 0x8d, 0xf6, 0x32, 0x17, 0x48, 0x47, 0x1d, 0x41, 0x6f, 0xfe, 0x2e, 0xa7, 0x8f, + 0x4b, 0xa0, 0x51, 0xf3, 0xbf, 0x02, 0x0a, 0x48, 0x58, 0xf7, 0xa1, 0x6d, 0xea, 0xa5, 0x13, + 0x5a, 0x5b, 0xea, 0x0c, 0x9e, 0x52, 0x4f, 0x9e, 0xb9, 0x71, 0x7f, 0x23, 0x83, 0xda, 0x1b, + 0x86, 0x9a, 0x41, 0x29, 0xda, 0x70, 0xe7, 0x64, 0xa1, 0x7b, 0xd5, 0x0a, 0x22, 0x0d, 0x5c, + 0x40, 0xc4, 0x81, 0x07, 0x25, 0x35, 0x4a, 0x1c, 0x10, 0xdb, 0x45, 0x0a, 0xff, 0x36, 0xd4, + 0xe0, 0xeb, 0x5f, 0x68, 0xd6, 0x67, 0xc6, 0xd0, 0x8b, 0x76, 0x1a, 0x7d, 0x59, 0x42, 0xa1, + 0xcb, 0x96, 0x4d, 0x84, 0x09, 0x9a, 0x3d, 0xe0, 0x52, 0x85, 0x6e, 0x48, 0x90, 0x85, 0x2a, + 0x63, 0xb2, 0x69, 0xd2, 0x00, 0x43, 0x31, 0x37, 0xb3, 0x52, 0xaf, 0x62, 0xfa, 0xc1, 0xe0, + 0x03, 0xfb, 0x62, 0xaa, 0x88, 0xc9, 0xb2, 0x2c, 0xd5, 0xa8, 0xf5, 0xa5, 0x4c, 0x12, 0x59, + 0x4e, 0x06, 0x5e, 0x9b, 0x15, 0x66, 0x11, 0xb2, 0x27, 0x92, 0xdc, 0x98, 0x59, 0xde, 0xdf, + 0xfa, 0x9a, 0x32, 0x2e, 0xc0, 0x5d, 0x3c, 0x33, 0x41, 0x6d, 0xaf, 0xb2, 0x25, 0x23, 0x14, + 0xa5, 0x7b, 0xc7, 0x9b, 0x68, 0xf3, 0xda, 0xeb, 0xe3, 0xa9, 0xe2, 0x6f, 0x0e, 0x1d, 0x1c, + 0xba, 0x55, 0xb6, 0x34, 0x6a, 0x93, 0x1f, 0x1f, 0xb8, 0x34, 0xc8, 0x84, 0x08, 0xb1, 0x6b, + 0x6a, 0x28, 0x74, 0x74, 0xe5, 0xeb, 0x75, 0xe9, 0x7c, 0xd8, 0xba, 0xd8, 0x42, 0xa5, 0xee, + 0x1f, 0x80, 0xd9, 0x96, 0xb2, 0x2e, 0xe7, 0xbf, 0xba, 0xeb, 0xd1, 0x69, 0xbb, 0x8f, 0xfd, + 0x5a, 0x63, 0x8f, 0x39, 0x7f, 0xdf, 0x1d, 0x37, 0xd2, 0x18, 0x35, 0x9d, 0xb6, 0xcc, 0xe4, + 0x27, 0x81, 0x89, 0x38, 0x38, 0x68, 0x33, 0xe7, 0x78, 0xd8, 0x76, 0xf5, 0xee, 0xd0, 0x4a, + 0x07, 0x69, 0x19, 0x7a, 0xad, 0x18, 0xb1, 0x94, 0x61, 0x45, 0x53, 0xa2, 0x48, 0xda, 0x96, + 0x4a, 0xf9, 0xee, 0x94, 0x2a, 0x1f, 0x6e, 0x18, 0x3c, 0x92, 0x46, 0xd1, 0x1a, 0x28, 0x18, + 0x32, 0x1f, 0x3a, 0x45, 0xbe, 0x04, 0x35, 0x92, 0xe5, 0xa3, 0xcb, 0xb5, 0x2e, 0x32, 0x43, + 0xac, 0x65, 0x17, 0x89, 0x99, 0x15, 0x03, 0x9e, 0xb1, 0x23, 0x2f, 0xed, 0x76, 0x4d, 0xd8, + 0xac, 0x21, 0x40, 0xc4, 0x99, 0x4e, 0x65, 0x71, 0x2c, 0xb3, 0x45, 0xab, 0xfb, 0xe7, 0x72, + 0x39, 0x56, 0x30, 0x6d, 0xfb, 0x74, 0xeb, 0x99, 0xf3, 0xcd, 0x57, 0x5c, 0x78, 0x75, 0xe9, + 0x8d, 0xc3, 0xa2, 0xfb, 0x5d, 0xe0, 0x90, 0xc5, 0x55, 0xad, 0x91, 0x53, 0x4e, 0x9e, 0xbd, + 0x8c, 0x49, 0xa4, 0xa4, 0x69, 0x10, 0x0c, 0xc5, 0x76, 0xe9, 0x25, 0x86, 0x8d, 0x66, 0x23, + 0xa8, 0xdb, 0x5c, 0xe8, 0xd9, 0x30, 0xe1, 0x15, 0x7b, 0xc0, 0x99, 0x0f, 0x03, 0xec, 0xaa, + 0x12, 0xef, 0xce, 0xd4, 0xea, 0x55, 0x5c, 0x08, 0x86, 0xf4, 0xf4, 0xb0, 0x83, 0x42, 0x95, + 0x37, 0xb6, 0x38, 0xe0, 0x2b, 0x54, 0x89, 0xbd, 0x4e, 0x20, 0x9d, 0x3f, 0xc3, 0x4b, 0xb7, + 0xec, 0xfa, 0x5a, 0x14, 0x03, 0xcb, 0x64, 0xc8, 0x34, 0x4a, 0x4b, 0x6e, 0xf8, 0x6e, 0x56, + 0xf6, 0xdd, 0x5f, 0xa1, 0x24, 0xe2, 0xd4, 0xd0, 0x82, 0x64, 0x1f, 0x8e, 0x9b, 0xfa, 0xb4, + 0xcb, 0xdb, 0x0a, 0xe8, 0x15, 0xfc, 0x15, 0xab, 0x4b, 0x18, 0xbf, 0xd4, 0x42, 0x14, 0x48, + 0x82, 0x85, 0xdd, 0xeb, 0x49, 0x1b, 0x0b, 0x0b, 0x05, 0xe9, 0xb4, 0xa1, 0x33, 0x0a, 0x5d, + 0x0e, 0x6c, 0x4b, 0xc0, 0xd6, 0x6c, 0x7c, 0xfb, 0x69, 0x0b, 0x53, 0x19, 0xe4, 0xf3, 0x35, + 0xfc, 0xbe, 0xa1, 0x34, 0x02, 0x09, 0x4f, 0x74, 0x86, 0x92, 0xcd, 0x5d, 0x1a, 0xc1, 0x27, + 0x0c, 0xf2, 0xc5, 0xcf, 0xdd, 0x23, 0x93, 0x02, 0xbd, 0x41, 0x5e, 0x42, 0xf0, 0xa0, 0x9d, + 0x0c, 0x72, 0xc8, 0xec, 0x32, 0x0a, 0x8a, 0xfd, 0x3d, 0x5a, 0x41, 0x27, 0x0c, 0x88, 0x59, + 0xad, 0x94, 0x2e, 0xef, 0x5d, 0x8f, 0xc7, 0xdf, 0x66, 0xe4, 0xdd, 0x56, 0x6c, 0x7b, 0xca, + 0x55, 0x81, 0xae, 0xae, 0x5c, 0x1b, 0x1a, 0xab, 0xae, 0x99, 0x8d, 0xcc, 0x42, 0x97, 0x59, + 0xf4, 0x14, 0x3f, 0x75, 0xc6, 0xd1, 0x88, 0xba, 0xaa, 0x84, 0x4a, 0xd0, 0x34, 0x08, 0x3b, + 0x7d, 0xdb, 0x15, 0x06, 0xb0, 0x5c, 0xbd, 0x40, 0xf5, 0xa8, 0xec, 0xae, 0x36, 0x40, 0xdd, + 0x90, 0x1c, 0x3e, 0x0d, 0x7e, 0x73, 0xc7, 0xc2, 0xc5, 0x6a, 0xff, 0x52, 0x05, 0x7f, 0xbe, + 0xd0, 0x92, 0xfd, 0xb3, 0x6f, 0xff, 0x5d, 0xb7, 0x97, 0x64, 0x73, 0x7b, 0xca, 0xd1, 0x98, + 0x24, 0x6b, 0x0b, 0x01, 0x68, 0xdd, 0x27, 0x85, 0x85, 0xb5, 0x83, 0xc1, 0xe0, 0x50, 0x64, + 0xc7, 0xaf, 0xf1, 0xc6, 0x4d, 0xb1, 0xef, 0xc9, 0xb4, 0x0a, 0x6d, 0x65, 0xf3, 0x47, 0xcc, + 0xa3, 0x02, 0x21, 0x0c, 0xbe, 0x22, 0x29, 0x05, 0xcf, 0x5f, 0xe8, 0x94, 0x6c, 0xe5, 0xdc, + 0xc4, 0xdf, 0xbe, 0x3e, 0xa8, 0xb4, 0x18, 0xb0, 0x99, 0xb8, 0x6f, 0xff, 0x5d, 0xb9, 0xfd, + 0x3b, 0x5d, 0x16, 0xbf, 0x3e, 0xd8, 0xb3, 0xd8, 0x08, 0x34, 0xf6, 0x47, 0x35, 0x5b, 0x72, + 0x1a, 0x33, 0xad, 0x52, 0x5d, 0xb8, 0xd0, 0x77, 0xc6, 0xab, 0xba, 0x55, 0x09, 0x5f, 0x02, + 0xf8, 0xd4, 0x5f, 0x53, 0x06, 0x91, 0xcd, 0x74, 0x42, 0xae, 0x54, 0x91, 0x81, 0x62, 0x13, + 0x6f, 0xd8, 0xa9, 0x77, 0xc3, 0x6c, 0xcb, 0xf1, 0x29, 0x5a, 0xcc, 0xda, 0x35, 0xbd, 0x52, + 0x23, 0xbe, 0x59, 0xeb, 0x12, 0x6d, 0xb7, 0x53, 0xee, 0xfc, 0xb4, 0x1b, 0x13, 0x5e, 0xba, + 0x16, 0x7c, 0xc5, 0xf3, 0xe3, 0x6d, 0x07, 0x78, 0xf5, 0x2b, 0x21, 0x05, 0x88, 0x4c, 0xc0, + 0xa1, 0xe3, 0x36, 0x10, 0xf8, 0x1b, 0xd8, 0x17, 0xfb, 0x6a, 0x4e, 0xd8, 0xb3, 0x47, 0x2d, + 0x99, 0xbd, 0xbb, 0x5d, 0x37, 0x7d, 0xba, 0xf1, 0xe1, 0x7c, 0xc0, 0xc5, 0x54, 0x62, 0x7f, + 0xcf, 0x5a, 0x4a, 0x93, 0xcc, 0xf1, 0x1b, 0x34, 0xc8, 0xa6, 0x05, 0x4c, 0x55, 0x8b, 0x54, + 0x84, 0xd5, 0x77, 0xeb, 0xc0, 0x6d, 0x3a, 0x29, 0xbd, 0x75, 0x61, 0x09, 0x9a, 0x2c, 0xbb, + 0xf7, 0x18, 0x79, 0x34, 0x90, 0x24, 0xa5, 0x81, 0x70, 0x87, 0xc5, 0x02, 0x7c, 0xba, 0xd4, + 0x5e, 0x14, 0x8e, 0xe4, 0xed, 0xa2, 0x61, 0x6a, 0xb9, 0x6e, 0xb5, 0x4a, 0xb9, 0x01, 0x46, + 0xf4, 0xcf, 0xbc, 0x09, 0x2f, 0x27, 0x4b, 0xbd, 0x86, 0x7a, 0x10, 0xe1, 0xd4, 0xc8, 0xd9, + 0x20, 0x8d, 0x8a, 0x63, 0x00, 0x63, 0x44, 0xeb, 0x54, 0x0b, 0x75, 0x49, 0x10, 0xa2, 0xa7, + 0xad, 0xb9, 0xd1, 0x01, 0x80, 0x63, 0x25, 0xc8, 0x12, 0xa6, 0xce, 0x1e, 0xbe, 0xfe, 0x7e, + 0x5f, 0x3c, 0xdb, 0x34, 0xea, 0x37, 0xec, 0x3b, 0xd5, 0x28, 0xd2, 0x07, 0x8c, 0x9a, 0xb6, + 0xee, 0x5e, 0x3e, 0xdf, 0x1d, 0x99, 0xb0, 0xe2, 0x46, 0xef, 0x5c, 0x1b, 0xb4, 0xea, 0x56, + 0x2e, 0xde, 0x1f, 0x9d, 0xb8, 0xd3, 0x24, 0xab, 0xd4, 0x2a, 0xd6, 0x2e, 0xde, 0x1f, 0x9d, + 0xb8, 0xf2, 0x66, 0x2f, 0xbd, 0xf8, 0x72, 0x66, 0x4e, 0x1e, 0x9f, 0x9d, 0xb8, 0xf2, 0x47, + 0x0c, 0x9a, 0xb6, 0xee, 0x3f, 0xfc, 0x7a, 0x57, 0x0d, 0x79, 0x70, 0x62, 0x27, 0xad, 0xb9, + 0xd1, 0x01, 0x61, 0x40, 0x02, 0x67, 0x2d, 0xd8, 0x32, 0xe6, 0x2f, 0xdc, 0x3a, 0xd7, 0x2c, + 0xbb, 0xf4, 0x4b, 0xf5, 0x49, 0xf1, 0x60, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0xf9, 0x51, 0x01, + 0x80, 0x63, 0x25, 0xa9, 0xb1, 0xe0, 0x42, 0xe7, 0x4c, 0x1a, 0x97, 0xac, 0xbb, 0xf4, 0x6a, + 0x37, 0xcd, 0x18, 0xb2, 0xe6, 0x2f, 0xdc, 0x1b, 0x95, 0xa8, 0xd2, 0x07, 0x6d, 0x58, 0x32, + 0xe6, 0x4e, 0x1e, 0x9f, 0xbc, 0xfa, 0x57, 0x0d, 0x79, 0x51, 0x20, 0xc2, 0x06, 0x6f, 0x5c, + 0x1b, 0x95, 0xa8, 0xb3, 0xc5, 0xe9, 0x31, 0xe0, 0x23, 0xc4, 0x0a, 0x77, 0x4d, 0x18, 0x93, + 0x85, 0x69, 0x31, 0xc1, 0xe1, 0x21, 0xc0, 0xe3, 0x44, 0x0a, 0x77, 0x6c, 0x5a, 0x17, 0x8d, + 0x98, 0x93, 0xa4, 0xab, 0xd4, 0x2a, 0xb7, 0xec, 0x5a, 0x17, 0xac, 0xbb, 0xf4, 0x4b, 0x14, + 0xaa, 0xb7, 0xec, 0x3b, 0xd5, 0x28, 0xb3, 0xc5, 0xe9, 0x31, 0xc1, 0x00, 0x82, 0x67, 0x4c, + 0xfb, 0x55, 0x28, 0xd2, 0x26, 0xaf, 0xbd, 0xd9, 0x11, 0x81, 0x61, 0x21, 0xa1, 0xa1, 0xc0, + 0x02, 0x86, 0x6f, 0x5c, 0x1b, 0xb4, 0xcb, 0x14, 0x8b, 0x94, 0xaa, 0xd6, 0x2e, 0xbf, 0xdd, + 0x19, 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x7c, 0x5b, 0x15, 0x89, 0x90, 0x83, 0x84, 0x6b, 0x54, + 0x0b, 0x75, 0x68, 0x52, 0x07, 0x6d, 0x58, 0x32, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0xed, 0x58, + 0x32, 0xe6, 0x4e, 0xff, 0x7c, 0x7a, 0x76, 0x6e, 0x3f, 0xdd, 0x38, 0xd3, 0x05, 0x88, 0x92, + 0xa6, 0xaf, 0xdc, 0x1b, 0xb4, 0xcb, 0xf5, 0x68, 0x52, 0x07, 0x8c, 0x7b, 0x55, 0x09, 0x90, + 0x83, 0x84, 0x6b, 0x54, 0x2a, 0xb7, 0xec, 0x3b, 0xd5, 0x09, 0x90, 0xa2, 0xc6, 0x0e, 0x7f, + 0x7c, 0x7a, 0x57, 0x0d, 0x98, 0xb2, 0xc7, 0xed, 0x58, 0x32, 0xc7, 0x0c, 0x7b, 0x74, 0x4b, + 0x14, 0x8b, 0x94, 0xaa, 0xb7, 0xcd, 0x18, 0x93, 0xa4, 0xca, 0x16, 0xae, 0xbf, 0xdd, 0x19, + 0xb0, 0xe2, 0x46, 0x0e, 0x7f, 0x5d, 0x19, 0x91, 0x81, 0x80, 0x63, 0x44, 0xeb, 0x35, 0xc9, + 0x10, 0x83, 0x65, 0x48, 0x12, 0xa6, 0xce, 0x1e, 0x9f, 0xbc, 0xdb, 0x15, 0x89, 0x71, 0x60, + 0x23, 0xc4, 0xeb, 0x54, 0x2a, 0xb7, 0xec, 0x5a, 0x36, 0xcf, 0x81, 0x10, 0xac, 0x74 +}; // clang-format off diff --git a/drivers/serial.h b/drivers/serial.h index d9c2a69e9699..0cfdbd995946 100644 --- a/drivers/serial.h +++ b/drivers/serial.h @@ -26,21 +26,4 @@ void soft_serial_initiator_init(void); // target is interrupt accept side void soft_serial_target_init(void); -// initiator result -#define TRANSACTION_END 0 -#define TRANSACTION_NO_RESPONSE 0x1 -#define TRANSACTION_DATA_ERROR 0x2 -#define TRANSACTION_TYPE_ERROR 0x4 -int soft_serial_transaction(int sstd_index); - -// target status -// *SSTD_t.status has -// initiator: -// TRANSACTION_END -// or TRANSACTION_NO_RESPONSE -// or TRANSACTION_DATA_ERROR -// target: -// TRANSACTION_DATA_ERROR -// or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x8 -int soft_serial_get_and_clean_status(int sstd_index); +bool soft_serial_transaction(int sstd_index); diff --git a/drivers/usb2422.c b/drivers/usb2422.c index 62b919093b96..8ee54b24eebe 100644 --- a/drivers/usb2422.c +++ b/drivers/usb2422.c @@ -352,7 +352,7 @@ void USB2422_init() { setPinInput(USB2422_ACTIVE_PIN); #endif - i2c_init(); // IC2 clk must be high at USB2422 reset release time to signal SMB configuration + i2c_init(); // IC2 clk must be high at USB2422 reset release time to signal SMB configuration } void USB2422_configure() { @@ -363,14 +363,14 @@ void USB2422_configure() { // configure Usb2422 registers config.VID.reg = USB2422_VENDOR_ID; config.PID.reg = USB2422_PRODUCT_ID; - config.DID.reg = USB2422_DEVICE_VER; // BCD format, eg 01.01 - config.CFG1.bit.SELF_BUS_PWR = 1; // self powered for now - config.CFG1.bit.HS_DISABLE = 1; // full or high speed + config.DID.reg = USB2422_DEVICE_VER; // BCD format, eg 01.01 + config.CFG1.bit.SELF_BUS_PWR = 1; // self powered for now + config.CFG1.bit.HS_DISABLE = 1; // full or high speed // config.CFG2.bit.COMPOUND = 0; // compound device - config.CFG3.bit.STRING_EN = 1; // strings enabled + config.CFG3.bit.STRING_EN = 1; // strings enabled // config.NRD.bit.PORT2_NR = 0; // MCU is non-removable - config.MAXPB.reg = 20; // 0mA - config.HCMCB.reg = 20; // 0mA + config.MAXPB.reg = 20; // 0mA + config.HCMCB.reg = 20; // 0mA config.MFRSL.reg = sizeof(USB2422_MANUFACTURER); config.PRDSL.reg = sizeof(USB2422_PRODUCT); config.SERSL.reg = sizeof(SERNAME); diff --git a/drivers/ws2812.h b/drivers/ws2812.h index 945b3d072892..5985b5340c2a 100644 --- a/drivers/ws2812.h +++ b/drivers/ws2812.h @@ -33,19 +33,19 @@ #endif #ifndef WS2812_T1H -# define WS2812_T1H 900 // Width of a 1 bit in ns +# define WS2812_T1H 900 // Width of a 1 bit in ns #endif #ifndef WS2812_T1L -# define WS2812_T1L (WS2812_TIMING - WS2812_T1H) // Width of a 1 bit in ns +# define WS2812_T1L (WS2812_TIMING - WS2812_T1H) // Width of a 1 bit in ns #endif #ifndef WS2812_T0H -# define WS2812_T0H 350 // Width of a 0 bit in ns +# define WS2812_T0H 350 // Width of a 0 bit in ns #endif #ifndef WS2812_T0L -# define WS2812_T0L (WS2812_TIMING - WS2812_T0H) // Width of a 0 bit in ns +# define WS2812_T0L (WS2812_TIMING - WS2812_T0H) // Width of a 0 bit in ns #endif /* diff --git a/keyboards/10bleoledhub/rules.mk b/keyboards/10bleoledhub/rules.mk index 33170c43a23b..bd10e11022f4 100644 --- a/keyboards/10bleoledhub/rules.mk +++ b/keyboards/10bleoledhub/rules.mk @@ -20,7 +20,7 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE OLED_ENABLE = yes OLED_DRIVER = SSD1306 ENCODER_ENABLE = yes diff --git a/keyboards/aleth42/info.json b/keyboards/25keys/aleth42/info.json similarity index 100% rename from keyboards/aleth42/info.json rename to keyboards/25keys/aleth42/info.json diff --git a/keyboards/aleth42/keymaps/default/keymap.c b/keyboards/25keys/aleth42/keymaps/default/keymap.c similarity index 100% rename from keyboards/aleth42/keymaps/default/keymap.c rename to keyboards/25keys/aleth42/keymaps/default/keymap.c diff --git a/keyboards/aleth42/keymaps/default/readme.md b/keyboards/25keys/aleth42/keymaps/default/readme.md similarity index 100% rename from keyboards/aleth42/keymaps/default/readme.md rename to keyboards/25keys/aleth42/keymaps/default/readme.md diff --git a/keyboards/aleth42/keymaps/via/config.h b/keyboards/25keys/aleth42/keymaps/via/config.h similarity index 100% rename from keyboards/aleth42/keymaps/via/config.h rename to keyboards/25keys/aleth42/keymaps/via/config.h diff --git a/keyboards/aleth42/keymaps/via/keymap.c b/keyboards/25keys/aleth42/keymaps/via/keymap.c similarity index 100% rename from keyboards/aleth42/keymaps/via/keymap.c rename to keyboards/25keys/aleth42/keymaps/via/keymap.c diff --git a/keyboards/aleth42/keymaps/via/readme.md b/keyboards/25keys/aleth42/keymaps/via/readme.md similarity index 100% rename from keyboards/aleth42/keymaps/via/readme.md rename to keyboards/25keys/aleth42/keymaps/via/readme.md diff --git a/keyboards/aleth42/keymaps/via/rules.mk b/keyboards/25keys/aleth42/keymaps/via/rules.mk similarity index 100% rename from keyboards/aleth42/keymaps/via/rules.mk rename to keyboards/25keys/aleth42/keymaps/via/rules.mk diff --git a/keyboards/aleth42/rev1/readme.md b/keyboards/25keys/aleth42/readme.md similarity index 95% rename from keyboards/aleth42/rev1/readme.md rename to keyboards/25keys/aleth42/readme.md index 3da1231d60a5..acf9c38e2e95 100644 --- a/keyboards/aleth42/rev1/readme.md +++ b/keyboards/25keys/aleth42/readme.md @@ -10,6 +10,6 @@ Make example for this keyboard (after setting up your build environment): - make aleth42:default + make 25keys/aleth42/rev1: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/aleth42/rev0/config.h b/keyboards/25keys/aleth42/rev0/config.h similarity index 100% rename from keyboards/aleth42/rev0/config.h rename to keyboards/25keys/aleth42/rev0/config.h diff --git a/keyboards/aleth42/rev0/readme.md b/keyboards/25keys/aleth42/rev0/readme.md similarity index 100% rename from keyboards/aleth42/rev0/readme.md rename to keyboards/25keys/aleth42/rev0/readme.md diff --git a/keyboards/aleth42/rev0/rev0.c b/keyboards/25keys/aleth42/rev0/rev0.c similarity index 100% rename from keyboards/aleth42/rev0/rev0.c rename to keyboards/25keys/aleth42/rev0/rev0.c diff --git a/keyboards/aleth42/rev0/rev0.h b/keyboards/25keys/aleth42/rev0/rev0.h similarity index 100% rename from keyboards/aleth42/rev0/rev0.h rename to keyboards/25keys/aleth42/rev0/rev0.h diff --git a/keyboards/aleth42/rev0/rules.mk b/keyboards/25keys/aleth42/rev0/rules.mk similarity index 100% rename from keyboards/aleth42/rev0/rules.mk rename to keyboards/25keys/aleth42/rev0/rules.mk diff --git a/keyboards/aleth42/rev1/config.h b/keyboards/25keys/aleth42/rev1/config.h similarity index 100% rename from keyboards/aleth42/rev1/config.h rename to keyboards/25keys/aleth42/rev1/config.h diff --git a/keyboards/aleth42/readme.md b/keyboards/25keys/aleth42/rev1/readme.md similarity index 100% rename from keyboards/aleth42/readme.md rename to keyboards/25keys/aleth42/rev1/readme.md diff --git a/keyboards/aleth42/rev1/rev1.c b/keyboards/25keys/aleth42/rev1/rev1.c similarity index 100% rename from keyboards/aleth42/rev1/rev1.c rename to keyboards/25keys/aleth42/rev1/rev1.c diff --git a/keyboards/aleth42/rev1/rev1.h b/keyboards/25keys/aleth42/rev1/rev1.h similarity index 100% rename from keyboards/aleth42/rev1/rev1.h rename to keyboards/25keys/aleth42/rev1/rev1.h diff --git a/keyboards/aleth42/rev1/rules.mk b/keyboards/25keys/aleth42/rev1/rules.mk similarity index 100% rename from keyboards/aleth42/rev1/rules.mk rename to keyboards/25keys/aleth42/rev1/rules.mk diff --git a/keyboards/25keys/aleth42/rules.mk b/keyboards/25keys/aleth42/rules.mk new file mode 100644 index 000000000000..8034ad544072 --- /dev/null +++ b/keyboards/25keys/aleth42/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = 25keys/aleth42/rev1 diff --git a/keyboards/cassette42/cassette42.c b/keyboards/25keys/cassette42/cassette42.c similarity index 100% rename from keyboards/cassette42/cassette42.c rename to keyboards/25keys/cassette42/cassette42.c diff --git a/keyboards/cassette42/cassette42.h b/keyboards/25keys/cassette42/cassette42.h similarity index 100% rename from keyboards/cassette42/cassette42.h rename to keyboards/25keys/cassette42/cassette42.h diff --git a/keyboards/cassette42/common/glcdfont.c b/keyboards/25keys/cassette42/common/glcdfont.c similarity index 100% rename from keyboards/cassette42/common/glcdfont.c rename to keyboards/25keys/cassette42/common/glcdfont.c diff --git a/keyboards/cassette42/common/oled_helper.c b/keyboards/25keys/cassette42/common/oled_helper.c similarity index 100% rename from keyboards/cassette42/common/oled_helper.c rename to keyboards/25keys/cassette42/common/oled_helper.c diff --git a/keyboards/cassette42/common/oled_helper.h b/keyboards/25keys/cassette42/common/oled_helper.h similarity index 100% rename from keyboards/cassette42/common/oled_helper.h rename to keyboards/25keys/cassette42/common/oled_helper.h diff --git a/keyboards/cassette42/config.h b/keyboards/25keys/cassette42/config.h similarity index 95% rename from keyboards/cassette42/config.h rename to keyboards/25keys/cassette42/config.h index 1729c31fbd84..cac03f6346c0 100644 --- a/keyboards/cassette42/config.h +++ b/keyboards/25keys/cassette42/config.h @@ -49,4 +49,4 @@ along with this program. If not, see . # define RGBLIGHT_ANIMATIONS #endif -#define OLED_FONT_H "keyboards/cassette42/common/glcdfont.c" +#define OLED_FONT_H "keyboards/25keys/cassette42/common/glcdfont.c" diff --git a/keyboards/cassette42/info.json b/keyboards/25keys/cassette42/info.json similarity index 100% rename from keyboards/cassette42/info.json rename to keyboards/25keys/cassette42/info.json diff --git a/keyboards/cassette42/keymaps/default/keymap.c b/keyboards/25keys/cassette42/keymaps/default/keymap.c similarity index 100% rename from keyboards/cassette42/keymaps/default/keymap.c rename to keyboards/25keys/cassette42/keymaps/default/keymap.c diff --git a/keyboards/cassette42/keymaps/default/readme.md b/keyboards/25keys/cassette42/keymaps/default/readme.md similarity index 100% rename from keyboards/cassette42/keymaps/default/readme.md rename to keyboards/25keys/cassette42/keymaps/default/readme.md diff --git a/keyboards/cassette42/readme.md b/keyboards/25keys/cassette42/readme.md similarity index 95% rename from keyboards/cassette42/readme.md rename to keyboards/25keys/cassette42/readme.md index 2ba9a661bb19..cb6b2cc5b729 100644 --- a/keyboards/cassette42/readme.md +++ b/keyboards/25keys/cassette42/readme.md @@ -10,6 +10,6 @@ An audio control pad with 4 switches and 2 rotary encoders. Make example for this keyboard (after setting up your build environment): - make cassette42:default + make 25keys/cassette42: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/cassette42/rules.mk b/keyboards/25keys/cassette42/rules.mk similarity index 100% rename from keyboards/cassette42/rules.mk rename to keyboards/25keys/cassette42/rules.mk diff --git a/keyboards/7skb/.noci b/keyboards/25keys/zinc/.noci similarity index 100% rename from keyboards/7skb/.noci rename to keyboards/25keys/zinc/.noci diff --git a/keyboards/7skb/config.h b/keyboards/25keys/zinc/config.h similarity index 100% rename from keyboards/7skb/config.h rename to keyboards/25keys/zinc/config.h diff --git a/keyboards/zinc/info.json b/keyboards/25keys/zinc/info.json similarity index 100% rename from keyboards/zinc/info.json rename to keyboards/25keys/zinc/info.json diff --git a/keyboards/zinc/keymaps/default/config.h b/keyboards/25keys/zinc/keymaps/default/config.h similarity index 100% rename from keyboards/zinc/keymaps/default/config.h rename to keyboards/25keys/zinc/keymaps/default/config.h diff --git a/keyboards/zinc/keymaps/default/keymap.c b/keyboards/25keys/zinc/keymaps/default/keymap.c similarity index 100% rename from keyboards/zinc/keymaps/default/keymap.c rename to keyboards/25keys/zinc/keymaps/default/keymap.c diff --git a/keyboards/zinc/keymaps/default/readme_en.md b/keyboards/25keys/zinc/keymaps/default/readme_en.md similarity index 100% rename from keyboards/zinc/keymaps/default/readme_en.md rename to keyboards/25keys/zinc/keymaps/default/readme_en.md diff --git a/keyboards/zinc/keymaps/default/readme_jp.md b/keyboards/25keys/zinc/keymaps/default/readme_jp.md similarity index 100% rename from keyboards/zinc/keymaps/default/readme_jp.md rename to keyboards/25keys/zinc/keymaps/default/readme_jp.md diff --git a/keyboards/zinc/keymaps/default/rules.mk b/keyboards/25keys/zinc/keymaps/default/rules.mk similarity index 100% rename from keyboards/zinc/keymaps/default/rules.mk rename to keyboards/25keys/zinc/keymaps/default/rules.mk diff --git a/keyboards/zinc/keymaps/ginjake/config.h b/keyboards/25keys/zinc/keymaps/ginjake/config.h similarity index 100% rename from keyboards/zinc/keymaps/ginjake/config.h rename to keyboards/25keys/zinc/keymaps/ginjake/config.h diff --git a/keyboards/zinc/keymaps/ginjake/keymap.c b/keyboards/25keys/zinc/keymaps/ginjake/keymap.c similarity index 100% rename from keyboards/zinc/keymaps/ginjake/keymap.c rename to keyboards/25keys/zinc/keymaps/ginjake/keymap.c diff --git a/keyboards/zinc/keymaps/ginjake/readme_jp.md b/keyboards/25keys/zinc/keymaps/ginjake/readme_jp.md similarity index 100% rename from keyboards/zinc/keymaps/ginjake/readme_jp.md rename to keyboards/25keys/zinc/keymaps/ginjake/readme_jp.md diff --git a/keyboards/zinc/keymaps/ginjake/rules.mk b/keyboards/25keys/zinc/keymaps/ginjake/rules.mk similarity index 100% rename from keyboards/zinc/keymaps/ginjake/rules.mk rename to keyboards/25keys/zinc/keymaps/ginjake/rules.mk diff --git a/keyboards/zinc/keymaps/monks/config.h b/keyboards/25keys/zinc/keymaps/monks/config.h similarity index 100% rename from keyboards/zinc/keymaps/monks/config.h rename to keyboards/25keys/zinc/keymaps/monks/config.h diff --git a/keyboards/zinc/keymaps/monks/keymap.c b/keyboards/25keys/zinc/keymaps/monks/keymap.c similarity index 100% rename from keyboards/zinc/keymaps/monks/keymap.c rename to keyboards/25keys/zinc/keymaps/monks/keymap.c diff --git a/keyboards/zinc/keymaps/monks/readme_jp.md b/keyboards/25keys/zinc/keymaps/monks/readme_jp.md similarity index 100% rename from keyboards/zinc/keymaps/monks/readme_jp.md rename to keyboards/25keys/zinc/keymaps/monks/readme_jp.md diff --git a/keyboards/zinc/keymaps/monks/rules.mk b/keyboards/25keys/zinc/keymaps/monks/rules.mk similarity index 100% rename from keyboards/zinc/keymaps/monks/rules.mk rename to keyboards/25keys/zinc/keymaps/monks/rules.mk diff --git a/keyboards/zinc/keymaps/toshi0383/config.h b/keyboards/25keys/zinc/keymaps/toshi0383/config.h similarity index 100% rename from keyboards/zinc/keymaps/toshi0383/config.h rename to keyboards/25keys/zinc/keymaps/toshi0383/config.h diff --git a/keyboards/zinc/keymaps/toshi0383/keymap.c b/keyboards/25keys/zinc/keymaps/toshi0383/keymap.c similarity index 100% rename from keyboards/zinc/keymaps/toshi0383/keymap.c rename to keyboards/25keys/zinc/keymaps/toshi0383/keymap.c diff --git a/keyboards/zinc/keymaps/toshi0383/rules.mk b/keyboards/25keys/zinc/keymaps/toshi0383/rules.mk similarity index 100% rename from keyboards/zinc/keymaps/toshi0383/rules.mk rename to keyboards/25keys/zinc/keymaps/toshi0383/rules.mk diff --git a/keyboards/zinc/keymaps/via/config.h b/keyboards/25keys/zinc/keymaps/via/config.h similarity index 100% rename from keyboards/zinc/keymaps/via/config.h rename to keyboards/25keys/zinc/keymaps/via/config.h diff --git a/keyboards/zinc/keymaps/via/keymap.c b/keyboards/25keys/zinc/keymaps/via/keymap.c similarity index 100% rename from keyboards/zinc/keymaps/via/keymap.c rename to keyboards/25keys/zinc/keymaps/via/keymap.c diff --git a/keyboards/zinc/keymaps/via/readme_en.md b/keyboards/25keys/zinc/keymaps/via/readme_en.md similarity index 100% rename from keyboards/zinc/keymaps/via/readme_en.md rename to keyboards/25keys/zinc/keymaps/via/readme_en.md diff --git a/keyboards/zinc/keymaps/via/readme_jp.md b/keyboards/25keys/zinc/keymaps/via/readme_jp.md similarity index 100% rename from keyboards/zinc/keymaps/via/readme_jp.md rename to keyboards/25keys/zinc/keymaps/via/readme_jp.md diff --git a/keyboards/zinc/keymaps/via/rules.mk b/keyboards/25keys/zinc/keymaps/via/rules.mk similarity index 100% rename from keyboards/zinc/keymaps/via/rules.mk rename to keyboards/25keys/zinc/keymaps/via/rules.mk diff --git a/keyboards/zinc/readme.md b/keyboards/25keys/zinc/readme.md similarity index 95% rename from keyboards/zinc/readme.md rename to keyboards/25keys/zinc/readme.md index 0e8d6cd65dfd..61172f163543 100644 --- a/keyboards/zinc/readme.md +++ b/keyboards/25keys/zinc/readme.md @@ -11,7 +11,7 @@ Zinc Make example for this keyboard (after setting up your build environment): - make zinc:default + make 25keys/zinc/rev1: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/angel17/.noci b/keyboards/25keys/zinc/rev1/.noci similarity index 100% rename from keyboards/angel17/.noci rename to keyboards/25keys/zinc/rev1/.noci diff --git a/keyboards/zinc/rev1/config.h b/keyboards/25keys/zinc/rev1/config.h similarity index 100% rename from keyboards/zinc/rev1/config.h rename to keyboards/25keys/zinc/rev1/config.h diff --git a/keyboards/zinc/rev1/info.json b/keyboards/25keys/zinc/rev1/info.json similarity index 100% rename from keyboards/zinc/rev1/info.json rename to keyboards/25keys/zinc/rev1/info.json diff --git a/keyboards/zinc/rev1/post_config.h b/keyboards/25keys/zinc/rev1/post_config.h similarity index 100% rename from keyboards/zinc/rev1/post_config.h rename to keyboards/25keys/zinc/rev1/post_config.h diff --git a/keyboards/zinc/rev1/rev1.c b/keyboards/25keys/zinc/rev1/rev1.c similarity index 100% rename from keyboards/zinc/rev1/rev1.c rename to keyboards/25keys/zinc/rev1/rev1.c diff --git a/keyboards/zinc/rev1/rev1.h b/keyboards/25keys/zinc/rev1/rev1.h similarity index 100% rename from keyboards/zinc/rev1/rev1.h rename to keyboards/25keys/zinc/rev1/rev1.h diff --git a/keyboards/zinc/rev1/rules.mk b/keyboards/25keys/zinc/rev1/rules.mk similarity index 100% rename from keyboards/zinc/rev1/rules.mk rename to keyboards/25keys/zinc/rev1/rules.mk diff --git a/keyboards/angel17/alpha/.noci b/keyboards/25keys/zinc/reva/.noci similarity index 100% rename from keyboards/angel17/alpha/.noci rename to keyboards/25keys/zinc/reva/.noci diff --git a/keyboards/zinc/reva/config.h b/keyboards/25keys/zinc/reva/config.h similarity index 100% rename from keyboards/zinc/reva/config.h rename to keyboards/25keys/zinc/reva/config.h diff --git a/keyboards/zinc/reva/info.json b/keyboards/25keys/zinc/reva/info.json similarity index 100% rename from keyboards/zinc/reva/info.json rename to keyboards/25keys/zinc/reva/info.json diff --git a/keyboards/zinc/reva/post_config.h b/keyboards/25keys/zinc/reva/post_config.h similarity index 100% rename from keyboards/zinc/reva/post_config.h rename to keyboards/25keys/zinc/reva/post_config.h diff --git a/keyboards/zinc/reva/reva.c b/keyboards/25keys/zinc/reva/reva.c similarity index 100% rename from keyboards/zinc/reva/reva.c rename to keyboards/25keys/zinc/reva/reva.c diff --git a/keyboards/zinc/reva/reva.h b/keyboards/25keys/zinc/reva/reva.h similarity index 100% rename from keyboards/zinc/reva/reva.h rename to keyboards/25keys/zinc/reva/reva.h diff --git a/keyboards/zinc/reva/rules.mk b/keyboards/25keys/zinc/reva/rules.mk similarity index 100% rename from keyboards/zinc/reva/rules.mk rename to keyboards/25keys/zinc/reva/rules.mk diff --git a/keyboards/zinc/rules.mk b/keyboards/25keys/zinc/rules.mk similarity index 95% rename from keyboards/zinc/rules.mk rename to keyboards/25keys/zinc/rules.mk index c83741f40c79..2fd608c56c6c 100644 --- a/keyboards/zinc/rules.mk +++ b/keyboards/25keys/zinc/rules.mk @@ -19,7 +19,7 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this w RGB_MATRIX_ENABLE = no RGB_MATRIX_DRIVER = WS2812 -DEFAULT_FOLDER = zinc/rev1 +DEFAULT_FOLDER = 25keys/zinc/rev1 #SRC += i2c.c SRC += serial.c diff --git a/keyboards/zinc/zinc.c b/keyboards/25keys/zinc/zinc.c similarity index 100% rename from keyboards/zinc/zinc.c rename to keyboards/25keys/zinc/zinc.c diff --git a/keyboards/zinc/zinc.h b/keyboards/25keys/zinc/zinc.h similarity index 58% rename from keyboards/zinc/zinc.h rename to keyboards/25keys/zinc/zinc.h index dedc9253b0ef..8a80538e4c6b 100644 --- a/keyboards/zinc/zinc.h +++ b/keyboards/25keys/zinc/zinc.h @@ -1,9 +1,9 @@ #pragma once -#ifdef KEYBOARD_zinc_reva +#ifdef KEYBOARD_25keys_zinc_reva #include "reva.h" #endif -#ifdef KEYBOARD_zinc_rev1 +#ifdef KEYBOARD_25keys_zinc_rev1 #include "rev1.h" #endif diff --git a/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk b/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk index 231a88371991..5b5f23fbce12 100644 --- a/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk +++ b/keyboards/3w6/rev2/keymaps/default_pimoroni/rules.mk @@ -1,3 +1,4 @@ POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = custom SRC += pimoroni_trackball.c MOUSEKEY_ENABLE = no diff --git a/keyboards/40percentclub/25/config.h b/keyboards/40percentclub/25/config.h index 8ff526467119..d478131e95c0 100644 --- a/keyboards/40percentclub/25/config.h +++ b/keyboards/40percentclub/25/config.h @@ -19,9 +19,9 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x4025 -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0F25 +#define VENDOR_ID 0x4025 // 40% +#define PRODUCT_ID 0x0F25 +#define DEVICE_VER 0x0100 #define MANUFACTURER di0ib #define PRODUCT The 5x5 Keyboard diff --git a/keyboards/40percentclub/5x5/config.h b/keyboards/40percentclub/5x5/config.h index c9a83de7372b..c3bb5d6380c7 100644 --- a/keyboards/40percentclub/5x5/config.h +++ b/keyboards/40percentclub/5x5/config.h @@ -5,9 +5,9 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x4025 -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x05B5 +#define VENDOR_ID 0x4025 // 40% +#define PRODUCT_ID 0x05B5 +#define DEVICE_VER 0x0100 #define MANUFACTURER di0ib #define PRODUCT The 5x5 Keyboard diff --git a/keyboards/40percentclub/6lit/config.h b/keyboards/40percentclub/6lit/config.h index f5c0ea30400a..ae4ee1bad87d 100644 --- a/keyboards/40percentclub/6lit/config.h +++ b/keyboards/40percentclub/6lit/config.h @@ -19,9 +19,9 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x4025 -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0F61 +#define VENDOR_ID 0x4025 // 40% +#define PRODUCT_ID 0x0F61 +#define DEVICE_VER 0x0100 #define MANUFACTURER di0ib #define PRODUCT The 6lit Macropad diff --git a/keyboards/40percentclub/foobar/config.h b/keyboards/40percentclub/foobar/config.h index a65b6e51bf48..1e91d3bd10bb 100644 --- a/keyboards/40percentclub/foobar/config.h +++ b/keyboards/40percentclub/foobar/config.h @@ -19,9 +19,9 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x4025 -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0F00 +#define VENDOR_ID 0x4025 // 40% +#define PRODUCT_ID 0x0F00 +#define DEVICE_VER 0x0100 #define MANUFACTURER di0ib #define PRODUCT The foobar Keyboard diff --git a/keyboards/40percentclub/half_n_half/config.h b/keyboards/40percentclub/half_n_half/config.h index f79f83839c86..0c819031da2a 100644 --- a/keyboards/40percentclub/half_n_half/config.h +++ b/keyboards/40percentclub/half_n_half/config.h @@ -20,9 +20,9 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x4025 -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x4A1F +#define VENDOR_ID 0x4025 // 40% +#define PRODUCT_ID 0x4A1F +#define DEVICE_VER 0x0100 #define MANUFACTURER di0ib #define PRODUCT half_n_half diff --git a/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk b/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk index 160b3684b3c4..975c58188334 100644 --- a/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk +++ b/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk @@ -5,5 +5,5 @@ F_CPU = 8000000 # change yes to no to disable # BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE BACKLIGHT_ENABLE = no diff --git a/keyboards/40percentclub/ut47/keymaps/default/keymap.c b/keyboards/40percentclub/ut47/keymaps/default/keymap.c index 0fa7838dfd79..4eb2c190c192 100644 --- a/keyboards/40percentclub/ut47/keymaps/default/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/default/keymap.c @@ -15,7 +15,7 @@ */ #include QMK_KEYBOARD_H #ifdef LED_ENABLE - #include "protocol/serial.h" + #include "uart.h" #endif #define LT3_TAB LT(3, KC_TAB) @@ -108,11 +108,11 @@ LAYOUT( /* Tab */ //LED keymap functions #ifdef LED_ENABLE void led_chmode(void) { - serial_send(101); + uart_write(0x65); } void led_toggle(void) { - serial_send(100); + uart_write(0x64); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c index 0c1c2e75999b..8a0ba7b3916c 100644 --- a/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c @@ -15,7 +15,7 @@ */ #include QMK_KEYBOARD_H #ifdef LED_ENABLE - #include "protocol/serial.h" + #include "uart.h" #endif #define LT3_TAB LT(3, KC_TAB) @@ -108,11 +108,11 @@ LAYOUT( /* Tab */ //LED keymap functions #ifdef LED_ENABLE void led_chmode(void) { - serial_send(101); + uart_write(0x65); } void led_toggle(void) { - serial_send(100); + uart_write(0x64); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c index 52372e285785..5e79cdb9a47c 100644 --- a/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c @@ -15,7 +15,7 @@ */ #include QMK_KEYBOARD_H #ifdef LED_ENABLE - #include "protocol/serial.h" + #include "uart.h" #endif @@ -151,11 +151,11 @@ LAYOUT( /* GAMING, toggled on and off - L5 */ //LED keymap functions #ifdef LED_ENABLE void led_chmode(void) { - serial_send(101); + uart_write(0x65); } void led_toggle(void) { - serial_send(100); + uart_write(0x64); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c index ae8ad3e378ec..75dba3a2d42e 100644 --- a/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c @@ -15,7 +15,7 @@ */ #include QMK_KEYBOARD_H #ifdef LED_ENABLE - #include "protocol/serial.h" + #include "uart.h" #endif #define LT3_TAB LT(3, KC_TAB) @@ -60,11 +60,11 @@ LAYOUT( /* Tab */ //LED keymap functions #ifdef LED_ENABLE void led_chmode(void) { - serial_send(101); + uart_write(0x65); } void led_toggle(void) { - serial_send(100); + uart_write(0x64); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/40percentclub/ut47/matrix.c b/keyboards/40percentclub/ut47/matrix.c index e47c7f8e1362..89537592c52a 100644 --- a/keyboards/40percentclub/ut47/matrix.c +++ b/keyboards/40percentclub/ut47/matrix.c @@ -26,10 +26,6 @@ along with this program. If not, see . #include "debug.h" #include "util.h" #include "matrix.h" -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - #ifndef DEBOUNCE # define DEBOUNCE 5 @@ -69,10 +65,6 @@ void matrix_init(void) matrix[i] = 0; matrix_debouncing[i] = 0; } - -#ifdef LED_ENABLE - serial_init(); -#endif } uint8_t matrix_scan(void) @@ -104,12 +96,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/40percentclub/ut47/rules.mk b/keyboards/40percentclub/ut47/rules.mk index 29cee474ff5d..6c9805e0fc44 100644 --- a/keyboards/40percentclub/ut47/rules.mk +++ b/keyboards/40percentclub/ut47/rules.mk @@ -18,4 +18,5 @@ AUDIO_ENABLE = no # Audio output # custom matrix setup CUSTOM_MATRIX = yes -SRC += matrix.c protocol/serial_uart.c +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/40percentclub/ut47/ut47.c b/keyboards/40percentclub/ut47/ut47.c index 9054335e5ac1..864edaeb57da 100644 --- a/keyboards/40percentclub/ut47/ut47.c +++ b/keyboards/40percentclub/ut47/ut47.c @@ -15,7 +15,11 @@ */ #include "ut47.h" #ifdef LED_ENABLE - #include "protocol/serial.h" + #include "uart.h" + +void matrix_init_kb() { + uart_init(9600); +} #endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { @@ -23,7 +27,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { // runs for every action, just before processing by the firmware if (record->event.pressed) { #ifdef LED_ENABLE - serial_send((record->event.key.row*16)+record->event.key.col); + uart_write((record->event.key.row*16)+record->event.key.col); #endif } return process_record_user(keycode, record); diff --git a/keyboards/adalyn/rules.mk b/keyboards/adalyn/rules.mk deleted file mode 100644 index 078a9bca0645..000000000000 --- a/keyboards/adalyn/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -COMBO_ENABLE = no diff --git a/keyboards/ai03/orbit/config.h b/keyboards/ai03/orbit/config.h index 9ad384c8ffba..0e4f4c3baf84 100644 --- a/keyboards/ai03/orbit/config.h +++ b/keyboards/ai03/orbit/config.h @@ -44,13 +44,6 @@ along with this program. If not, see . #define MATRIX_COL_PINS { C7, B4, D7, D6, D4, F1, F0 } #define MATRIX_ROW_PINS_RIGHT { B6, B5, B4, D7, E6 } #define MATRIX_COL_PINS_RIGHT { D4, D6, F1, F0, F4, F5, C6 } - -#define SPLIT_HAND_PIN D5 - -//#define USE_I2C - -#define SELECT_SOFT_SERIAL_SPEED 1 - #define UNUSED_PINS /* COL2ROW, ROW2COL */ @@ -60,6 +53,12 @@ along with this program. If not, see . * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. */ #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SELECT_SOFT_SERIAL_SPEED 1 + +#define SPLIT_LED_STATE_ENABLE +#define SPLIT_LAYER_STATE_ENABLE + +#define SPLIT_HAND_PIN D5 #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING diff --git a/keyboards/ai03/orbit/keymaps/default/keymap.c b/keyboards/ai03/orbit/keymaps/default/keymap.c index fa383d7c0030..c9696ccde62d 100644 --- a/keyboards/ai03/orbit/keymaps/default/keymap.c +++ b/keyboards/ai03/orbit/keymaps/default/keymap.c @@ -48,25 +48,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case MANUAL: - if (record->event.pressed) - { - // Keypress + if (record->event.pressed) { SEND_STRING("https://kb.ai03.me/redir/orbit"); - } - else - { - // Key release } break; case DBLZERO: - if (record->event.pressed) - { - // Keypress + if (record->event.pressed) { SEND_STRING("00"); - } - else - { - // Key release } break; } diff --git a/keyboards/ai03/orbit/matrix.c b/keyboards/ai03/orbit/matrix.c deleted file mode 100644 index b8e3296686de..000000000000 --- a/keyboards/ai03/orbit/matrix.c +++ /dev/null @@ -1,328 +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 "wait.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "config.h" -#include "split_flags.h" -#include "quantum.h" -#include "debounce.h" -#include "transport.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -//#define ROWS_PER_HAND (MATRIX_ROWS / 2) - -#ifdef DIRECT_PINS -static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; -#else -static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t raw_matrix[ROWS_PER_HAND]; - -// row offsets for each hand -uint8_t thisHand, thatHand; - -// user-defined overridable functions - -__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } - -__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } - -__attribute__((weak)) void matrix_init_user(void) {} - -__attribute__((weak)) void matrix_scan_user(void) {} - -__attribute__((weak)) void matrix_slave_scan_user(void) {} - -// helper functions - -inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } - -inline uint8_t matrix_cols(void) { return MATRIX_COLS; } - -bool matrix_is_modified(void) { - if (debounce_active()) return false; - return true; -} - -inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } - -inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } - -void matrix_print(void) { - print_matrix_header(); - - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - print_hex8(row); - print(": "); - print_matrix_row(row); - print("\n"); - } -} - -uint8_t matrix_key_count(void) { - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - count += matrix_bitpop(i); - } - return count; -} - -// matrix code - -#ifdef DIRECT_PINS - -static void init_pins(void) { - for (int row = 0; row < MATRIX_ROWS; row++) { - for (int col = 0; col < MATRIX_COLS; col++) { - pin_t pin = direct_pins[row][col]; - if (pin != NO_PIN) { - setPinInputHigh(pin); - } - } - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { - matrix_row_t last_row_value = current_matrix[current_row]; - current_matrix[current_row] = 0; - - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - pin_t pin = direct_pins[current_row][col_index]; - if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); - } - } - - return (last_row_value != current_matrix[current_row]); -} - -#elif (DIODE_DIRECTION == COL2ROW) - -static void select_row(uint8_t row) { - setPinOutput(row_pins[row]); - writePinLow(row_pins[row]); -} - -static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } - -static void unselect_rows(void) { - for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { - setPinInputHigh(row_pins[x]); - } -} - -static void init_pins(void) { - unselect_rows(); - for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinInputHigh(col_pins[x]); - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void select_col(uint8_t col) { - setPinOutput(col_pins[col]); - writePinLow(col_pins[col]); -} - -static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } - -static void unselect_cols(void) { - for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinInputHigh(col_pins[x]); - } -} - -static void init_pins(void) { - unselect_cols(); - for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { - setPinInputHigh(row_pins[x]); - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if (readPin(row_pins[row_index])) { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } else { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -#endif - -void matrix_init(void) { - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - - // Set pinout for right half if pinout for that half is defined - if (!isLeftHand) { -#ifdef MATRIX_ROW_PINS_RIGHT - const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - row_pins[i] = row_pins_right[i]; - } -#endif -#ifdef MATRIX_COL_PINS_RIGHT - const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; - for (uint8_t i = 0; i < MATRIX_COLS; i++) { - col_pins[i] = col_pins_right[i]; - } -#endif - } - - thisHand = isLeftHand ? 0 : (ROWS_PER_HAND); - thatHand = ROWS_PER_HAND - thisHand; - - // initialize key pins - init_pins(); - - // initialize matrix state: all keys off - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - } - - debounce_init(ROWS_PER_HAND); - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) { - bool changed = false; - -#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { - changed |= read_cols_on_row(raw_matrix, current_row); - } -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { - changed |= read_rows_on_col(raw_matrix, current_col); - } -#endif - - debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); - - return 1; -} - -uint8_t matrix_scan(void) { - uint8_t ret = _matrix_scan(); - - if (is_keyboard_master()) { - static uint8_t error_count; - - if (!transport_master(matrix + thatHand)) { - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[thatHand + i] = 0; - } - } - } else { - error_count = 0; - } - - matrix_scan_quantum(); - } else { - transport_slave(matrix + thisHand); - matrix_slave_scan_user(); - } - - return ret; -} diff --git a/keyboards/ai03/orbit/orbit.c b/keyboards/ai03/orbit/orbit.c index 97553e318a7e..5097f9cd90a2 100644 --- a/keyboards/ai03/orbit/orbit.c +++ b/keyboards/ai03/orbit/orbit.c @@ -15,196 +15,124 @@ */ #include "orbit.h" #include "split_util.h" -#include "transport.h" +void led_init_ports(void) { + // Initialize indicator LEDs to output + if (isLeftHand) { + setPinOutput(C6); + setPinOutput(B6); + setPinOutput(B5); + } else { + setPinOutput(F6); + setPinOutput(F7); + setPinOutput(C7); + } + + set_layer_indicators(0); +} // Call led_toggle to set LEDs easily // LED IDs: -// +// // (LEFT) 0 1 2 | 3 4 5 (RIGHT) - -void led_toggle(int id, bool on) { - - if (isLeftHand) { - switch(id) { - case 0: - // Left hand C6 - if (on) - //PORTC |= (1<<6); - writePinHigh(C6); - else - //PORTC &= ~(1<<6); - writePinLow(C6); - break; - case 1: - // Left hand B6 - if (on) - //PORTB |= (1<<6); - writePinHigh(B6); - else - //PORTB &= ~(1<<6); - writePinLow(B6); - break; - case 2: - // Left hand B5 - if (on) - //PORTB |= (1<<5); - writePinHigh(B5); - else - //PORTB &= ~(1<<5); - writePinLow(B5); - break; - default: - break; - } - } else { - switch(id) { - case 3: - // Right hand F6 - if (on) - //PORTF |= (1<<6); - writePinHigh(F6); - else - //PORTF &= ~(1<<6); - writePinLow(F6); - break; - case 4: - // Right hand F7 - if (on) - //PORTF |= (1<<7); - writePinHigh(F7); - else - //PORTF &= ~(1<<7); - writePinLow(F7); - break; - case 5: - // Right hand C7 - if (on) - //PORTC |= (1<<7); - writePinHigh(C7); - else - //PORTC &= ~(1<<7); - writePinLow(C7); - break; - default: - break; - } - } +void led_toggle(uint8_t id, bool on) { + if (isLeftHand) { + switch (id) { + case 0: + // Left hand C6 + writePin(C6, on); + break; + case 1: + // Left hand B6 + writePin(B6, on); + break; + case 2: + // Left hand B5 + writePin(B5, on); + break; + default: + break; + } + } else { + switch (id) { + case 3: + // Right hand F6 + writePin(F6, on); + break; + case 4: + // Right hand F7 + writePin(F7, on); + break; + case 5: + // Right hand C7 + writePin(C7, on); + break; + default: + break; + } + } } // Set all LEDs at once using an array of 6 booleans // LED IDs: -// +// // (LEFT) 0 1 2 | 3 4 5 (RIGHT) -// +// // Ex. set_all_leds({ false, false, false, true, true, true }) would turn off left hand, turn on right hand void set_all_leds(bool leds[6]) { - for (int i = 0; i < 6; i++) { - led_toggle(i, leds[i]); - } + for (int i = 0; i < 6; i++) { + led_toggle(i, leds[i]); + } } void set_layer_indicators(uint8_t layer) { - - switch (layer) - { - case 0: - led_toggle(0, true); - led_toggle(1, false); - led_toggle(2, false); - break; - case 1: - led_toggle(0, true); - led_toggle(1, true); - led_toggle(2, false); - break; - case 2: - led_toggle(0, true); - led_toggle(1, true); - led_toggle(2, true); - break; - case 3: - led_toggle(0, false); - led_toggle(1, true); - led_toggle(2, true); - break; - case 4: - led_toggle(0, false); - led_toggle(1, false); - led_toggle(2, true); - break; - default: - led_toggle(0, true); - led_toggle(1, false); - led_toggle(2, true); - break; - } - + switch (layer) { + case 0: + led_toggle(0, true); + led_toggle(1, false); + led_toggle(2, false); + break; + case 1: + led_toggle(0, true); + led_toggle(1, true); + led_toggle(2, false); + break; + case 2: + led_toggle(0, true); + led_toggle(1, true); + led_toggle(2, true); + break; + case 3: + led_toggle(0, false); + led_toggle(1, true); + led_toggle(2, true); + break; + case 4: + led_toggle(0, false); + led_toggle(1, false); + led_toggle(2, true); + break; + default: + led_toggle(0, true); + led_toggle(1, false); + led_toggle(2, true); + break; + } } -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - // Initialize indicator LEDs to output - if (isLeftHand) - { - setPinOutput(C6); - setPinOutput(B6); - setPinOutput(B5); - //DDRC |= (1<<6); - //DDRB |= (1<<6); - //DDRB |= (1<<5); - } - else - { - setPinOutput(F6); - setPinOutput(F7); - setPinOutput(C7); - //DDRF |= (1<<6); - //DDRF |= (1<<7); - //DDRC |= (1<<7); - } - - set_layer_indicators(0); - - matrix_init_user(); +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if (res) { + led_toggle(3, led_state.num_lock); + led_toggle(4, led_state.caps_lock); + led_toggle(5, led_state.scroll_lock); + } + return res; } -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - if (is_keyboard_master()) { - - serial_m2s_buffer.nlock_led = IS_LED_ON(usb_led, USB_LED_NUM_LOCK); - serial_m2s_buffer.clock_led = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK); - serial_m2s_buffer.slock_led = IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK); - - led_toggle(3, IS_LED_ON(usb_led, USB_LED_NUM_LOCK)); - led_toggle(4, IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)); - led_toggle(5, IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)); - - } - - led_set_user(usb_led); -} +layer_state_t layer_state_set_kb(layer_state_t state) { + set_layer_indicators(get_highest_layer(state)); -uint32_t layer_state_set_kb(uint32_t state) { - - if (is_keyboard_master()) - { - serial_m2s_buffer.current_layer = biton32(state); - - // If left half, do the LED toggle thing - if (isLeftHand) - { - set_layer_indicators(biton32(state)); - } - - } - // NOTE: Do not set slave LEDs here. - // This is not called on slave - - return layer_state_set_user(state); + return layer_state_set_user(state); } diff --git a/keyboards/ai03/orbit/orbit.h b/keyboards/ai03/orbit/orbit.h index 39f1ebb0e36e..7f3b1aca32b2 100644 --- a/keyboards/ai03/orbit/orbit.h +++ b/keyboards/ai03/orbit/orbit.h @@ -18,6 +18,8 @@ #include "quantum.h" +#define XXX KC_NO + /* This a shortcut to help you visually see your layout. * * The first section contains all of the arguments representing the physical @@ -26,17 +28,6 @@ * The second converts the arguments into a two-dimensional array which * represents the switch matrix. */ - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -#define XXX KC_NO - #define LAYOUT( \ L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ @@ -56,6 +47,6 @@ { R40, R41, R42, R43, R44, R45, XXX } \ } -extern void led_toggle(int id, bool on); +void led_toggle(uint8_t id, bool on); void set_all_leds(bool leds[6]); -extern void set_layer_indicators(uint8_t layer); +void set_layer_indicators(uint8_t layer); diff --git a/keyboards/ai03/orbit/readme.md b/keyboards/ai03/orbit/readme.md index 58ba2079d5de..0c320929b6c9 100644 --- a/keyboards/ai03/orbit/readme.md +++ b/keyboards/ai03/orbit/readme.md @@ -4,9 +4,9 @@ A split ergonomic keyboard project. -Keyboard Maintainer: [ai03](https://github.com/ai03-2725) -Hardware Supported: The [Orbit PCB](https://github.com/ai03-2725/Orbit) -Hardware Availability: [This repository](https://github.com/ai03-2725/Orbit) has PCB files. Case group buy orders are currently closed. +* Keyboard Maintainer: [ai03](https://github.com/ai03-2725) +* Hardware Supported: The [Orbit PCB](https://github.com/ai03-2725/Orbit) +* Hardware Availability: [This repository](https://github.com/ai03-2725/Orbit) has PCB files. Case group buy orders are currently closed. Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/ai03/orbit/rules.mk b/keyboards/ai03/orbit/rules.mk index f98e2382f10d..a0f1ab94a94b 100644 --- a/keyboards/ai03/orbit/rules.mk +++ b/keyboards/ai03/orbit/rules.mk @@ -16,12 +16,4 @@ NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -USE_I2C = no # I2C for split communication -CUSTOM_MATRIX = yes # For providing custom matrix.c (in this case, override regular matrix.c with split matrix.c) -# SPLIT_KEYBOARD = yes # Split keyboard flag disabled as manual edits had to be done to the split common files - -SRC += split_util.c \ - split_flags.c \ - serial.c \ - transport.c \ - matrix.c +SPLIT_KEYBOARD = yes # Split keyboard flag disabled as manual edits had to be done to the split common files diff --git a/keyboards/ai03/orbit/serial.c b/keyboards/ai03/orbit/serial.c deleted file mode 100644 index 636dfa090677..000000000000 --- a/keyboards/ai03/orbit/serial.c +++ /dev/null @@ -1,545 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - * - * 2018-10-28 checked - * avr-gcc 4.9.2 - * avr-gcc 5.4.0 - * avr-gcc 7.3.0 - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include -#include "serial.h" - -#ifdef SOFT_SERIAL_PIN - -#ifdef __AVR_ATmega32U4__ - // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. - #ifdef USE_AVR_I2C - #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 - #error Using ATmega32U4 I2C, so can not use PD0, PD1 - #endif - #endif - - #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 - #define SERIAL_PIN_DDR DDRD - #define SERIAL_PIN_PORT PORTD - #define SERIAL_PIN_INPUT PIND - #if SOFT_SERIAL_PIN == D0 - #define SERIAL_PIN_MASK _BV(PD0) - #define EIMSK_BIT _BV(INT0) - #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) - #define SERIAL_PIN_INTERRUPT INT0_vect - #elif SOFT_SERIAL_PIN == D1 - #define SERIAL_PIN_MASK _BV(PD1) - #define EIMSK_BIT _BV(INT1) - #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) - #define SERIAL_PIN_INTERRUPT INT1_vect - #elif SOFT_SERIAL_PIN == D2 - #define SERIAL_PIN_MASK _BV(PD2) - #define EIMSK_BIT _BV(INT2) - #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) - #define SERIAL_PIN_INTERRUPT INT2_vect - #elif SOFT_SERIAL_PIN == D3 - #define SERIAL_PIN_MASK _BV(PD3) - #define EIMSK_BIT _BV(INT3) - #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) - #define SERIAL_PIN_INTERRUPT INT3_vect - #endif - #elif SOFT_SERIAL_PIN == E6 - #define SERIAL_PIN_DDR DDRE - #define SERIAL_PIN_PORT PORTE - #define SERIAL_PIN_INPUT PINE - #define SERIAL_PIN_MASK _BV(PE6) - #define EIMSK_BIT _BV(INT6) - #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) - #define SERIAL_PIN_INTERRUPT INT6_vect - #else - #error invalid SOFT_SERIAL_PIN value - #endif - -#else - #error serial.c now support ATmega32U4 only -#endif - -#define ALWAYS_INLINE __attribute__((always_inline)) -#define NO_INLINE __attribute__((noinline)) -#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) - -// parity check -#define ODD_PARITY 1 -#define EVEN_PARITY 0 -#define PARITY EVEN_PARITY - -#ifdef SERIAL_DELAY - // custom setup in config.h - // #define TID_SEND_ADJUST 2 - // #define SERIAL_DELAY 6 // micro sec - // #define READ_WRITE_START_ADJUST 30 // cycles - // #define READ_WRITE_WIDTH_ADJUST 8 // cycles -#else -// ============ Standard setups ============ - -#ifndef SELECT_SOFT_SERIAL_SPEED -#define SELECT_SOFT_SERIAL_SPEED 1 -// 0: about 189kbps (Experimental only) -// 1: about 137kbps (default) -// 2: about 75kbps -// 3: about 39kbps -// 4: about 26kbps -// 5: about 20kbps -#endif - -#if __GNUC__ < 6 - #define TID_SEND_ADJUST 14 -#else - #define TID_SEND_ADJUST 2 -#endif - -#if SELECT_SOFT_SERIAL_SPEED == 0 - // Very High speed - #define SERIAL_DELAY 4 // micro sec - #if __GNUC__ < 6 - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_START_ADJUST 34 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 1 - // High speed - #define SERIAL_DELAY 6 // micro sec - #if __GNUC__ < 6 - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 2 - // Middle speed - #define SERIAL_DELAY 12 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 3 - // Low speed - #define SERIAL_DELAY 24 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 4 - // Very Low speed - #define SERIAL_DELAY 36 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 5 - // Ultra Low speed - #define SERIAL_DELAY 48 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#else -#error invalid SELECT_SOFT_SERIAL_SPEED value -#endif /* SELECT_SOFT_SERIAL_SPEED */ -#endif /* SERIAL_DELAY */ - -#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) -#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) - -#define SLAVE_INT_WIDTH_US 1 -#ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY -#else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 -#endif - -static SSTD_t *Transaction_table = NULL; -static uint8_t Transaction_table_size = 0; - -inline static void serial_delay(void) ALWAYS_INLINE; -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static void serial_delay_half1(void) ALWAYS_INLINE; -inline static -void serial_delay_half1(void) { - _delay_us(SERIAL_DELAY_HALF1); -} - -inline static void serial_delay_half2(void) ALWAYS_INLINE; -inline static -void serial_delay_half2(void) { - _delay_us(SERIAL_DELAY_HALF2); -} - -inline static void serial_output(void) ALWAYS_INLINE; -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static void serial_input_with_pullup(void) ALWAYS_INLINE; -inline static -void serial_input_with_pullup(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static void serial_low(void) ALWAYS_INLINE; -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static void serial_high(void) ALWAYS_INLINE; -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) -{ - Transaction_table = sstd_table; - Transaction_table_size = (uint8_t)sstd_table_size; - serial_output(); - serial_high(); -} - -void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) -{ - Transaction_table = sstd_table; - Transaction_table_size = (uint8_t)sstd_table_size; - serial_input_with_pullup(); - - // Enable INT0-INT3,INT6 - EIMSK |= EIMSK_BIT; -#if SERIAL_PIN_MASK == _BV(PE6) - // Trigger on falling edge of INT6 - EICRB &= EICRx_BIT; -#else - // Trigger on falling edge of INT0-INT3 - EICRA &= EICRx_BIT; -#endif -} - -// Used by the sender to synchronize timing with the reciver. -static void sync_recv(void) NO_INLINE; -static -void sync_recv(void) { - for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { - } - // This shouldn't hang if the target disconnects because the - // serial line will float to high if the target does disconnect. - while (!serial_read_pin()); -} - -// Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void) NO_INLINE; -static -void sync_send(void) { - serial_low(); - serial_delay(); - serial_high(); -} - -// Reads a byte from the serial line -static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; -static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { - uint8_t byte, i, p, pb; - - _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { - serial_delay_half1(); // read the middle of pulses - if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; - } else { - byte = (byte << 1) | 0; p ^= 0; - } - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); - } - /* recive parity bit */ - serial_delay_half1(); // read the middle of pulses - pb = serial_read_pin(); - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); - - *pterrcount += (p != pb)? 1 : 0; - - return byte; -} - -// Sends a byte with MSB ordering -void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; -void serial_write_chunk(uint8_t data, uint8_t bit) { - uint8_t b, p; - for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); - } - /* send parity bit */ - if(p & 1) { serial_high(); } - else { serial_low(); } - serial_delay(); - - serial_low(); // sync_send() / senc_recv() need raise edge -} - -static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; -static -void serial_send_packet(uint8_t *buffer, uint8_t size) { - for (uint8_t i = 0; i < size; ++i) { - uint8_t data; - data = buffer[i]; - sync_send(); - serial_write_chunk(data,8); - } -} - -static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; -static -uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { - uint8_t pecount = 0; - for (uint8_t i = 0; i < size; ++i) { - uint8_t data; - sync_recv(); - data = serial_read_chunk(&pecount, 8); - buffer[i] = data; - } - return pecount == 0; -} - -inline static -void change_sender2reciver(void) { - sync_send(); //0 - serial_delay_half1(); //1 - serial_low(); //2 - serial_input_with_pullup(); //2 - serial_delay_half1(); //3 -} - -inline static -void change_reciver2sender(void) { - sync_recv(); //0 - serial_delay(); //1 - serial_low(); //3 - serial_output(); //3 - serial_delay_half1(); //4 -} - -static inline uint8_t nibble_bits_count(uint8_t bits) -{ - bits = (bits & 0x5) + (bits >> 1 & 0x5); - bits = (bits & 0x3) + (bits >> 2 & 0x3); - return bits; -} - -// interrupt handle to be used by the target device -ISR(SERIAL_PIN_INTERRUPT) { - -#ifndef SERIAL_USE_MULTI_TRANSACTION - serial_low(); - serial_output(); - SSTD_t *trans = Transaction_table; -#else - // recive transaction table index - uint8_t tid, bits; - uint8_t pecount = 0; - sync_recv(); - bits = serial_read_chunk(&pecount,7); - tid = bits>>3; - bits = (bits&7) != nibble_bits_count(tid); - if( bits || pecount> 0 || tid > Transaction_table_size ) { - return; - } - serial_delay_half1(); - - serial_high(); // response step1 low->high - serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); - SSTD_t *trans = &Transaction_table[tid]; - serial_low(); // response step2 ack high->low -#endif - - // target send phase - if( trans->target2initiator_buffer_size > 0 ) - serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); - // target switch to input - change_sender2reciver(); - - // target recive phase - if( trans->initiator2target_buffer_size > 0 ) { - if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; - } else { - *trans->status = TRANSACTION_DATA_ERROR; - } - } else { - *trans->status = TRANSACTION_ACCEPTED; - } - - sync_recv(); //weit initiator output to high -} - -///////// -// start transaction by initiator -// -// int soft_serial_transaction(int sstd_index) -// -// Returns: -// TRANSACTION_END -// TRANSACTION_NO_RESPONSE -// TRANSACTION_DATA_ERROR -// this code is very time dependent, so we need to disable interrupts -#ifndef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_transaction(void) { - SSTD_t *trans = Transaction_table; -#else -int soft_serial_transaction(int sstd_index) { - if( sstd_index > Transaction_table_size ) - return TRANSACTION_TYPE_ERROR; - SSTD_t *trans = &Transaction_table[sstd_index]; -#endif - cli(); - - // signal to the target that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); - -#ifndef SERIAL_USE_MULTI_TRANSACTION - // wait for the target response - serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); - - // check if the target is present - if (serial_read_pin()) { - // target failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; - } - -#else - // send transaction table index - int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); - sync_send(); - _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(tid, 7); - serial_delay_half1(); - - // wait for the target response (step1 low->high) - serial_input_with_pullup(); - while( !serial_read_pin() ) { - _delay_sub_us(2); - } - - // check if the target is present (step2 high->low) - for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; - } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); - } -#endif - - // initiator recive phase - // if the target is present syncronize with it - if( trans->target2initiator_buffer_size > 0 ) { - if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; - } - } - - // initiator switch to output - change_reciver2sender(); - - // initiator send phase - if( trans->initiator2target_buffer_size > 0 ) { - serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); - } - - // always, release the line when not in use - sync_send(); - - *trans->status = TRANSACTION_END; - sei(); - return TRANSACTION_END; -} - -#ifdef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_get_and_clean_status(int sstd_index) { - SSTD_t *trans = &Transaction_table[sstd_index]; - cli(); - int retval = *trans->status; - *trans->status = 0;; - sei(); - return retval; -} -#endif - -#endif - -// Helix serial.c history -// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) -// (adjusted with avr-gcc 4.9.2) -// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) -// (adjusted with avr-gcc 4.9.2) -// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) -// (adjusted with avr-gcc 4.9.2) -// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) -// (adjusted with avr-gcc 7.3.0) -// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) -// (adjusted with avr-gcc 5.4.0, 7.3.0) -// 2018-12-17 copy to TOP/quantum/split_common/ and remove backward compatibility code (#4669) diff --git a/keyboards/ai03/orbit/serial.h b/keyboards/ai03/orbit/serial.h deleted file mode 100644 index 1c1e640069c9..000000000000 --- a/keyboards/ai03/orbit/serial.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once - -#include - -// ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in config.h -// ///////////////////////////////////////////////////////////////// -// ex. -// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 -// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 -// // 1: about 137kbps (default) -// // 2: about 75kbps -// // 3: about 39kbps -// // 4: about 26kbps -// // 5: about 20kbps -// -// //// USE simple API (using signle-type transaction function) -// /* nothing */ -// //// USE flexible API (using multi-type transaction function) -// #define SERIAL_USE_MULTI_TRANSACTION -// -// ///////////////////////////////////////////////////////////////// - -// Soft Serial Transaction Descriptor -typedef struct _SSTD_t { - uint8_t *status; - uint8_t initiator2target_buffer_size; - uint8_t *initiator2target_buffer; - uint8_t target2initiator_buffer_size; - uint8_t *target2initiator_buffer; -} SSTD_t; -#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) - -// initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); -// target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); - -// initiator resullt -#define TRANSACTION_END 0 -#define TRANSACTION_NO_RESPONSE 0x1 -#define TRANSACTION_DATA_ERROR 0x2 -#define TRANSACTION_TYPE_ERROR 0x4 -#ifndef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_transaction(void); -#else -int soft_serial_transaction(int sstd_index); -#endif - -// target status -// *SSTD_t.status has -// initiator: -// TRANSACTION_END -// or TRANSACTION_NO_RESPONSE -// or TRANSACTION_DATA_ERROR -// target: -// TRANSACTION_DATA_ERROR -// or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x8 -#ifdef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_get_and_clean_status(int sstd_index); -#endif diff --git a/keyboards/ai03/orbit/split_flags.c b/keyboards/ai03/orbit/split_flags.c deleted file mode 100644 index 1f5825d65020..000000000000 --- a/keyboards/ai03/orbit/split_flags.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "split_flags.h" - -volatile bool RGB_DIRTY = false; - -volatile bool BACKLIT_DIRTY = false; \ No newline at end of file diff --git a/keyboards/ai03/orbit/split_flags.h b/keyboards/ai03/orbit/split_flags.h deleted file mode 100644 index aaac474a7dbf..000000000000 --- a/keyboards/ai03/orbit/split_flags.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include - -/** -* Global Flags -**/ - -//RGB Stuff -extern volatile bool RGB_DIRTY; - - -//Backlight Stuff -extern volatile bool BACKLIT_DIRTY; diff --git a/keyboards/ai03/orbit/split_util.c b/keyboards/ai03/orbit/split_util.c deleted file mode 100644 index 2352e5a11186..000000000000 --- a/keyboards/ai03/orbit/split_util.c +++ /dev/null @@ -1,87 +0,0 @@ -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" -#include "split_flags.h" -#include "transport.h" -#include "quantum.h" - -#ifdef EE_HANDS -# include "eeprom.h" -# include "eeconfig.h" -#endif - -volatile bool isLeftHand = true; - -__attribute__((weak)) -bool is_keyboard_left(void) { - #ifdef SPLIT_HAND_PIN - // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - setPinInput(SPLIT_HAND_PIN); - return readPin(SPLIT_HAND_PIN); - #else - #ifdef EE_HANDS - return eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - #ifdef MASTER_RIGHT - return !is_keyboard_master(); - #else - return is_keyboard_master(); - #endif - #endif - #endif -} - -bool is_keyboard_master(void) -{ -#ifdef __AVR__ - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; - - // only check once, as this is called often - if (usbstate == UNKNOWN) - { - USBCON |= (1 << OTGPADE); // enables VBUS pad - wait_us(5); - - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS - } - - return (usbstate == MASTER); -#else - return true; -#endif -} - -static void keyboard_master_setup(void) { -#if defined(USE_I2C) - #ifdef SSD1306OLED - matrix_master_OLED_init (); - #endif -#endif - transport_master_init(); - - // For master the Backlight info needs to be sent on startup - // Otherwise the salve won't start with the proper info until an update - BACKLIT_DIRTY = true; -} - -static void keyboard_slave_setup(void) -{ - transport_slave_init(); -} - -// this code runs before the usb and keyboard is initialized -void matrix_setup(void) -{ - isLeftHand = is_keyboard_left(); - - if (is_keyboard_master()) - { - keyboard_master_setup(); - } - else - { - keyboard_slave_setup(); - } -} diff --git a/keyboards/ai03/orbit/split_util.h b/keyboards/ai03/orbit/split_util.h deleted file mode 100644 index 20f7535bf44b..000000000000 --- a/keyboards/ai03/orbit/split_util.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -extern volatile bool isLeftHand; - -void matrix_master_OLED_init (void); diff --git a/keyboards/ai03/orbit/transport.c b/keyboards/ai03/orbit/transport.c deleted file mode 100644 index 447fafed1442..000000000000 --- a/keyboards/ai03/orbit/transport.c +++ /dev/null @@ -1,238 +0,0 @@ - -#include "transport.h" - -#include "config.h" -#include "matrix.h" -#include "quantum.h" - -#include "orbit.h" - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif - -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#if defined(USE_I2C) - -#include "i2c.h" - -#ifndef SLAVE_I2C_ADDRESS -# define SLAVE_I2C_ADDRESS 0x32 -#endif - -#if (MATRIX_COLS > 8) -# error "Currently only supports 8 COLS" -#endif - -// Get rows from other half over i2c -bool transport_master(matrix_row_t matrix[]) { - int err = 0; - - // write backlight info -#ifdef BACKLIGHT_ENABLE - if (BACKLIT_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) { goto i2c_error; } - - // Backlight location - err = i2c_master_write(I2C_BACKLIT_START); - if (err) { goto i2c_error; } - - // Write backlight - i2c_master_write(get_backlight_level()); - - BACKLIT_DIRTY = false; - } -#endif - - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) { goto i2c_error; } - - // start of matrix stored at I2C_KEYMAP_START - err = i2c_master_write(I2C_KEYMAP_START); - if (err) { goto i2c_error; } - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) { goto i2c_error; } - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[i] = i2c_master_read(I2C_ACK); - } - matrix[i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return false; - } - -#ifdef RGBLIGHT_ENABLE - if (RGB_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) { goto i2c_error; } - - // RGB Location - err = i2c_master_write(I2C_RGB_START); - if (err) { goto i2c_error; } - - uint32_t dword = eeconfig_read_rgblight(); - - // Write RGB - err = i2c_master_write_data(&dword, 4); - if (err) { goto i2c_error; } - - RGB_DIRTY = false; - i2c_master_stop(); - } -#endif - - return true; -} - -void transport_slave(matrix_row_t matrix[]) { - - for (int i = 0; i < ROWS_PER_HAND; ++i) - { - i2c_slave_buffer[I2C_KEYMAP_START + i] = matrix[i]; - } - // Read Backlight Info - #ifdef BACKLIGHT_ENABLE - if (BACKLIT_DIRTY) - { - backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); - BACKLIT_DIRTY = false; - } - #endif - #ifdef RGBLIGHT_ENABLE - if (RGB_DIRTY) - { - // Disable interupts (RGB data is big) - cli(); - // Create new DWORD for RGB data - uint32_t dword; - - // Fill the new DWORD with the data that was sent over - uint8_t * dword_dat = (uint8_t *)(&dword); - for (int i = 0; i < 4; i++) - { - dword_dat[i] = i2c_slave_buffer[I2C_RGB_START + i]; - } - - // Update the RGB now with the new data and set RGB_DIRTY to false - rgblight_update_dword(dword); - RGB_DIRTY = false; - // Re-enable interupts now that RGB is set - sei(); - } - #endif -} - -void transport_master_init(void) { - i2c_master_init(); -} - -void transport_slave_init(void) { - i2c_slave_init(SLAVE_I2C_ADDRESS); -} - -#else // USE_SERIAL - -#include "serial.h" - - - -volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; -volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; -uint8_t volatile status0 = 0; - -SSTD_t transactions[] = { - { (uint8_t *)&status0, - sizeof(serial_m2s_buffer), (uint8_t *)&serial_m2s_buffer, - sizeof(serial_s2m_buffer), (uint8_t *)&serial_s2m_buffer - } -}; - -uint8_t slave_layer_cache; -uint8_t slave_nlock_cache; -uint8_t slave_clock_cache; -uint8_t slave_slock_cache; - -void transport_master_init(void) -{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } - -void transport_slave_init(void) -{ - soft_serial_target_init(transactions, TID_LIMIT(transactions)); - slave_layer_cache = 255; - slave_nlock_cache = 255; - slave_clock_cache = 255; - slave_slock_cache = 255; -} - -bool transport_master(matrix_row_t matrix[]) { - - if (soft_serial_transaction()) { - return false; - } - - // TODO: if MATRIX_COLS > 8 change to unpack() - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[i] = serial_s2m_buffer.smatrix[i]; - } - - #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) - // Code to send RGB over serial goes here (not implemented yet) - #endif - - #ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; - #endif - - return true; -} - -void transport_slave(matrix_row_t matrix[]) { - - // TODO: if MATRIX_COLS > 8 change to pack() - for (int i = 0; i < ROWS_PER_HAND; ++i) - { - serial_s2m_buffer.smatrix[i] = matrix[i]; - } - #ifdef BACKLIGHT_ENABLE - backlight_set(serial_m2s_buffer.backlight_level); - #endif - #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) - // Add serial implementation for RGB here - #endif - - if (slave_layer_cache != serial_m2s_buffer.current_layer) { - slave_layer_cache = serial_m2s_buffer.current_layer; - set_layer_indicators(slave_layer_cache); - } - - if (slave_nlock_cache != serial_m2s_buffer.nlock_led) { - slave_nlock_cache = serial_m2s_buffer.nlock_led; - led_toggle(3, slave_nlock_cache); - } - if (slave_clock_cache != serial_m2s_buffer.clock_led) { - slave_clock_cache = serial_m2s_buffer.clock_led; - led_toggle(4, slave_clock_cache); - } - if (slave_slock_cache != serial_m2s_buffer.slock_led) { - slave_slock_cache = serial_m2s_buffer.slock_led; - led_toggle(5, slave_slock_cache); - } - -} - -#endif diff --git a/keyboards/ai03/orbit/transport.h b/keyboards/ai03/orbit/transport.h deleted file mode 100644 index 757eae6f5c48..000000000000 --- a/keyboards/ai03/orbit/transport.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "matrix.h" - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -typedef struct _Serial_s2m_buffer_t { - // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack - matrix_row_t smatrix[ROWS_PER_HAND]; -} Serial_s2m_buffer_t; - -typedef struct _Serial_m2s_buffer_t { -#ifdef BACKLIGHT_ENABLE - uint8_t backlight_level; -#endif -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) - rgblight_config_t rgblight_config; //not yet use - // - // When MCUs on both sides drive their respective RGB LED chains, - // it is necessary to synchronize, so it is necessary to communicate RGB information. - // In that case, define the RGBLIGHT_SPLIT macro. - // - // Otherwise, if the master side MCU drives both sides RGB LED chains, - // there is no need to communicate. -#endif - - uint8_t current_layer; - uint8_t nlock_led; - uint8_t clock_led; - uint8_t slock_led; - -} Serial_m2s_buffer_t; - -extern volatile Serial_s2m_buffer_t serial_s2m_buffer; -extern volatile Serial_m2s_buffer_t serial_m2s_buffer; - -void transport_master_init(void); -void transport_slave_init(void); - -// returns false if valid data not received from slave -bool transport_master(matrix_row_t matrix[]); -void transport_slave(matrix_row_t matrix[]); diff --git a/keyboards/aleth42/rules.mk b/keyboards/aleth42/rules.mk deleted file mode 100644 index 8d130979b880..000000000000 --- a/keyboards/aleth42/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = aleth42/rev1 diff --git a/keyboards/amj96/matrix.c b/keyboards/amj96/matrix.c index 8e7bbaa79128..ffd66d120f59 100644 --- a/keyboards/amj96/matrix.c +++ b/keyboards/amj96/matrix.c @@ -108,12 +108,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/amjkeyboard/amj84/keymaps/default/keymap.c b/keyboards/amjkeyboard/amj84/keymaps/default/keymap.c index 11f8482352e0..3f83fc823698 100644 --- a/keyboards/amjkeyboard/amj84/keymaps/default/keymap.c +++ b/keyboards/amjkeyboard/amj84/keymaps/default/keymap.c @@ -37,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | |Lef|Dow|Rig| | | | | | |Hom|PgU| | * |-----------------------------------------------------------| - * | | |App|Fn1|Fn2|Fn3|VoD|VoU|Mut|End|PgD| | | + * | | |App| | | |VoD|VoU|Mut|End|PgD| | | * |-----------------------------------------------------------| * | | | | | | | | | * `-----------------------------------------------------------' @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_UP, KC_TRNS,KC_TRNS,KC_TRNS,KC_CALC,KC_TRNS,KC_INS, KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_TRNS,KC_TRNS, BL_BRTG,KC_LEFT,KC_DOWN,KC_RGHT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_PGUP,KC_TRNS,KC_TRNS,KC_TRNS, - BL_STEP,KC_NO, KC_TRNS,KC_APP, KC_FN1, KC_FN2, KC_FN3, KC_VOLD,KC_VOLU,KC_MUTE,KC_END, KC_PGDN,KC_TRNS,KC_TRNS,KC_TRNS, + BL_STEP,KC_NO, KC_TRNS,KC_APP, KC_TRNS,KC_TRNS,KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_END, KC_PGDN,KC_TRNS,KC_TRNS,KC_TRNS, KC_SLEP,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS) }; diff --git a/keyboards/atreus/feather/rules.mk b/keyboards/atreus/feather/rules.mk index ad0b4a5046be..6280275c1e58 100644 --- a/keyboards/atreus/feather/rules.mk +++ b/keyboards/atreus/feather/rules.mk @@ -11,5 +11,5 @@ BOOTLOADER = caterina # change yes to no to disable # BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE CONSOLE_ENABLE = no diff --git a/keyboards/angel64/.noci b/keyboards/biacco42/ergo42/.noci similarity index 100% rename from keyboards/angel64/.noci rename to keyboards/biacco42/ergo42/.noci diff --git a/keyboards/ergo42/config.h b/keyboards/biacco42/ergo42/config.h similarity index 100% rename from keyboards/ergo42/config.h rename to keyboards/biacco42/ergo42/config.h diff --git a/keyboards/ergo42/ergo42.c b/keyboards/biacco42/ergo42/ergo42.c similarity index 100% rename from keyboards/ergo42/ergo42.c rename to keyboards/biacco42/ergo42/ergo42.c diff --git a/keyboards/ergo42/ergo42.h b/keyboards/biacco42/ergo42/ergo42.h similarity index 63% rename from keyboards/ergo42/ergo42.h rename to keyboards/biacco42/ergo42/ergo42.h index 656b211308a5..265e605e6c1b 100644 --- a/keyboards/ergo42/ergo42.h +++ b/keyboards/biacco42/ergo42/ergo42.h @@ -2,6 +2,6 @@ #include "quantum.h" -#ifdef KEYBOARD_ergo42_rev1 +#ifdef KEYBOARD_biacco42_ergo42_rev1 #include "rev1.h" #endif diff --git a/keyboards/ergo42/info.json b/keyboards/biacco42/ergo42/info.json similarity index 100% rename from keyboards/ergo42/info.json rename to keyboards/biacco42/ergo42/info.json diff --git a/keyboards/ergo42/keymaps/biacco-biacco/config.h b/keyboards/biacco42/ergo42/keymaps/biacco-biacco/config.h similarity index 100% rename from keyboards/ergo42/keymaps/biacco-biacco/config.h rename to keyboards/biacco42/ergo42/keymaps/biacco-biacco/config.h diff --git a/keyboards/ergo42/keymaps/biacco-biacco/keymap.c b/keyboards/biacco42/ergo42/keymaps/biacco-biacco/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/biacco-biacco/keymap.c rename to keyboards/biacco42/ergo42/keymaps/biacco-biacco/keymap.c diff --git a/keyboards/ergo42/keymaps/biacco-macOS/config.h b/keyboards/biacco42/ergo42/keymaps/biacco-macOS/config.h similarity index 100% rename from keyboards/ergo42/keymaps/biacco-macOS/config.h rename to keyboards/biacco42/ergo42/keymaps/biacco-macOS/config.h diff --git a/keyboards/ergo42/keymaps/biacco-macOS/keymap.c b/keyboards/biacco42/ergo42/keymaps/biacco-macOS/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/biacco-macOS/keymap.c rename to keyboards/biacco42/ergo42/keymaps/biacco-macOS/keymap.c diff --git a/keyboards/ergo42/keymaps/biacco-underglow/config.h b/keyboards/biacco42/ergo42/keymaps/biacco-underglow/config.h similarity index 100% rename from keyboards/ergo42/keymaps/biacco-underglow/config.h rename to keyboards/biacco42/ergo42/keymaps/biacco-underglow/config.h diff --git a/keyboards/ergo42/keymaps/biacco-underglow/keymap.c b/keyboards/biacco42/ergo42/keymaps/biacco-underglow/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/biacco-underglow/keymap.c rename to keyboards/biacco42/ergo42/keymaps/biacco-underglow/keymap.c diff --git a/keyboards/ergo42/keymaps/biacco-underglow/rules.mk b/keyboards/biacco42/ergo42/keymaps/biacco-underglow/rules.mk similarity index 100% rename from keyboards/ergo42/keymaps/biacco-underglow/rules.mk rename to keyboards/biacco42/ergo42/keymaps/biacco-underglow/rules.mk diff --git a/keyboards/ergo42/keymaps/biacco-winjp/config.h b/keyboards/biacco42/ergo42/keymaps/biacco-winjp/config.h similarity index 100% rename from keyboards/ergo42/keymaps/biacco-winjp/config.h rename to keyboards/biacco42/ergo42/keymaps/biacco-winjp/config.h diff --git a/keyboards/ergo42/keymaps/biacco-winjp/keymap.c b/keyboards/biacco42/ergo42/keymaps/biacco-winjp/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/biacco-winjp/keymap.c rename to keyboards/biacco42/ergo42/keymaps/biacco-winjp/keymap.c diff --git a/keyboards/ergo42/keymaps/biacco/config.h b/keyboards/biacco42/ergo42/keymaps/biacco/config.h similarity index 100% rename from keyboards/ergo42/keymaps/biacco/config.h rename to keyboards/biacco42/ergo42/keymaps/biacco/config.h diff --git a/keyboards/ergo42/keymaps/biacco/keymap.c b/keyboards/biacco42/ergo42/keymaps/biacco/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/biacco/keymap.c rename to keyboards/biacco42/ergo42/keymaps/biacco/keymap.c diff --git a/keyboards/ergo42/keymaps/default-illustrator/config.h b/keyboards/biacco42/ergo42/keymaps/default-illustrator/config.h similarity index 100% rename from keyboards/ergo42/keymaps/default-illustrator/config.h rename to keyboards/biacco42/ergo42/keymaps/default-illustrator/config.h diff --git a/keyboards/ergo42/keymaps/default-illustrator/keymap.c b/keyboards/biacco42/ergo42/keymaps/default-illustrator/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/default-illustrator/keymap.c rename to keyboards/biacco42/ergo42/keymaps/default-illustrator/keymap.c diff --git a/keyboards/ergo42/keymaps/default-underglow/config.h b/keyboards/biacco42/ergo42/keymaps/default-underglow/config.h similarity index 100% rename from keyboards/ergo42/keymaps/default-underglow/config.h rename to keyboards/biacco42/ergo42/keymaps/default-underglow/config.h diff --git a/keyboards/ergo42/keymaps/default-underglow/keymap.c b/keyboards/biacco42/ergo42/keymaps/default-underglow/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/default-underglow/keymap.c rename to keyboards/biacco42/ergo42/keymaps/default-underglow/keymap.c diff --git a/keyboards/ergo42/keymaps/default-underglow/rules.mk b/keyboards/biacco42/ergo42/keymaps/default-underglow/rules.mk similarity index 100% rename from keyboards/ergo42/keymaps/default-underglow/rules.mk rename to keyboards/biacco42/ergo42/keymaps/default-underglow/rules.mk diff --git a/keyboards/ergo42/keymaps/default/config.h b/keyboards/biacco42/ergo42/keymaps/default/config.h similarity index 100% rename from keyboards/ergo42/keymaps/default/config.h rename to keyboards/biacco42/ergo42/keymaps/default/config.h diff --git a/keyboards/ergo42/keymaps/default/keymap.c b/keyboards/biacco42/ergo42/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/default/keymap.c rename to keyboards/biacco42/ergo42/keymaps/default/keymap.c diff --git a/keyboards/ergo42/keymaps/hdbx/config.h b/keyboards/biacco42/ergo42/keymaps/hdbx/config.h similarity index 100% rename from keyboards/ergo42/keymaps/hdbx/config.h rename to keyboards/biacco42/ergo42/keymaps/hdbx/config.h diff --git a/keyboards/ergo42/keymaps/hdbx/keymap.c b/keyboards/biacco42/ergo42/keymaps/hdbx/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/hdbx/keymap.c rename to keyboards/biacco42/ergo42/keymaps/hdbx/keymap.c diff --git a/keyboards/ergo42/keymaps/hdbx/readme.md b/keyboards/biacco42/ergo42/keymaps/hdbx/readme.md similarity index 100% rename from keyboards/ergo42/keymaps/hdbx/readme.md rename to keyboards/biacco42/ergo42/keymaps/hdbx/readme.md diff --git a/keyboards/ergo42/keymaps/ichi-t/config.h b/keyboards/biacco42/ergo42/keymaps/ichi-t/config.h similarity index 100% rename from keyboards/ergo42/keymaps/ichi-t/config.h rename to keyboards/biacco42/ergo42/keymaps/ichi-t/config.h diff --git a/keyboards/ergo42/keymaps/ichi-t/keymap.c b/keyboards/biacco42/ergo42/keymaps/ichi-t/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/ichi-t/keymap.c rename to keyboards/biacco42/ergo42/keymaps/ichi-t/keymap.c diff --git a/keyboards/ergo42/keymaps/koba/config.h b/keyboards/biacco42/ergo42/keymaps/koba/config.h similarity index 100% rename from keyboards/ergo42/keymaps/koba/config.h rename to keyboards/biacco42/ergo42/keymaps/koba/config.h diff --git a/keyboards/ergo42/keymaps/koba/keymap.c b/keyboards/biacco42/ergo42/keymaps/koba/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/koba/keymap.c rename to keyboards/biacco42/ergo42/keymaps/koba/keymap.c diff --git a/keyboards/ergo42/keymaps/koba/readme.md b/keyboards/biacco42/ergo42/keymaps/koba/readme.md similarity index 100% rename from keyboards/ergo42/keymaps/koba/readme.md rename to keyboards/biacco42/ergo42/keymaps/koba/readme.md diff --git a/keyboards/ergo42/keymaps/koba/readme_ja.md b/keyboards/biacco42/ergo42/keymaps/koba/readme_ja.md similarity index 100% rename from keyboards/ergo42/keymaps/koba/readme_ja.md rename to keyboards/biacco42/ergo42/keymaps/koba/readme_ja.md diff --git a/keyboards/ergo42/keymaps/shinze/config.h b/keyboards/biacco42/ergo42/keymaps/shinze/config.h similarity index 100% rename from keyboards/ergo42/keymaps/shinze/config.h rename to keyboards/biacco42/ergo42/keymaps/shinze/config.h diff --git a/keyboards/ergo42/keymaps/shinze/keymap.c b/keyboards/biacco42/ergo42/keymaps/shinze/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/shinze/keymap.c rename to keyboards/biacco42/ergo42/keymaps/shinze/keymap.c diff --git a/keyboards/ergo42/keymaps/yshrsmz/config.h b/keyboards/biacco42/ergo42/keymaps/yshrsmz/config.h similarity index 100% rename from keyboards/ergo42/keymaps/yshrsmz/config.h rename to keyboards/biacco42/ergo42/keymaps/yshrsmz/config.h diff --git a/keyboards/ergo42/keymaps/yshrsmz/keymap.c b/keyboards/biacco42/ergo42/keymaps/yshrsmz/keymap.c similarity index 100% rename from keyboards/ergo42/keymaps/yshrsmz/keymap.c rename to keyboards/biacco42/ergo42/keymaps/yshrsmz/keymap.c diff --git a/keyboards/ergo42/keymaps/yshrsmz/rules.mk b/keyboards/biacco42/ergo42/keymaps/yshrsmz/rules.mk similarity index 100% rename from keyboards/ergo42/keymaps/yshrsmz/rules.mk rename to keyboards/biacco42/ergo42/keymaps/yshrsmz/rules.mk diff --git a/keyboards/ergo42/readme.md b/keyboards/biacco42/ergo42/readme.md similarity index 95% rename from keyboards/ergo42/readme.md rename to keyboards/biacco42/ergo42/readme.md index c43b47382b27..778c64a99f04 100644 --- a/keyboards/ergo42/readme.md +++ b/keyboards/biacco42/ergo42/readme.md @@ -11,6 +11,6 @@ A split 7x4 ortholinear keyboard. [Hardware project repo](https://github.com/Bia Make example for this keyboard (after setting up your build environment): - make ergo42/rev1:default:flash + make biacco42/ergo42/rev1: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/ergo42/rev1/config.h b/keyboards/biacco42/ergo42/rev1/config.h similarity index 100% rename from keyboards/ergo42/rev1/config.h rename to keyboards/biacco42/ergo42/rev1/config.h diff --git a/keyboards/ergo42/rev1/rev1.c b/keyboards/biacco42/ergo42/rev1/rev1.c similarity index 100% rename from keyboards/ergo42/rev1/rev1.c rename to keyboards/biacco42/ergo42/rev1/rev1.c diff --git a/keyboards/ergo42/rev1/rev1.h b/keyboards/biacco42/ergo42/rev1/rev1.h similarity index 100% rename from keyboards/ergo42/rev1/rev1.h rename to keyboards/biacco42/ergo42/rev1/rev1.h diff --git a/keyboards/ergo42/rev1/rules.mk b/keyboards/biacco42/ergo42/rev1/rules.mk similarity index 100% rename from keyboards/ergo42/rev1/rules.mk rename to keyboards/biacco42/ergo42/rev1/rules.mk diff --git a/keyboards/minidox/rules.mk b/keyboards/biacco42/ergo42/rules.mk similarity index 94% rename from keyboards/minidox/rules.mk rename to keyboards/biacco42/ergo42/rules.mk index 69d7bcced467..9420c9b4eb9f 100644 --- a/keyboards/minidox/rules.mk +++ b/keyboards/biacco42/ergo42/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = minidox/rev1 +DEFAULT_FOLDER = biacco42/ergo42/rev1 diff --git a/keyboards/meishi/config.h b/keyboards/biacco42/meishi/config.h similarity index 100% rename from keyboards/meishi/config.h rename to keyboards/biacco42/meishi/config.h diff --git a/keyboards/meishi/info.json b/keyboards/biacco42/meishi/info.json similarity index 100% rename from keyboards/meishi/info.json rename to keyboards/biacco42/meishi/info.json diff --git a/keyboards/meishi/keymaps/default/keymap.c b/keyboards/biacco42/meishi/keymaps/default/keymap.c similarity index 100% rename from keyboards/meishi/keymaps/default/keymap.c rename to keyboards/biacco42/meishi/keymaps/default/keymap.c diff --git a/keyboards/meishi/keymaps/default/readme.md b/keyboards/biacco42/meishi/keymaps/default/readme.md similarity index 100% rename from keyboards/meishi/keymaps/default/readme.md rename to keyboards/biacco42/meishi/keymaps/default/readme.md diff --git a/keyboards/meishi/meishi.c b/keyboards/biacco42/meishi/meishi.c similarity index 100% rename from keyboards/meishi/meishi.c rename to keyboards/biacco42/meishi/meishi.c diff --git a/keyboards/meishi/meishi.h b/keyboards/biacco42/meishi/meishi.h similarity index 100% rename from keyboards/meishi/meishi.h rename to keyboards/biacco42/meishi/meishi.h diff --git a/keyboards/meishi/readme.md b/keyboards/biacco42/meishi/readme.md similarity index 94% rename from keyboards/meishi/readme.md rename to keyboards/biacco42/meishi/readme.md index 99421ed8d33d..4648c14b4daf 100644 --- a/keyboards/meishi/readme.md +++ b/keyboards/biacco42/meishi/readme.md @@ -13,7 +13,7 @@ Hardware Availability: [Tanoshi life - Booth](https://biacco42.booth.pm/) Make example for this keyboard (after setting up your build environment): ``` -$ make meishi:default:avrdude +$ make biacco42/meishi:default:avrdude ``` See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/meishi/rules.mk b/keyboards/biacco42/meishi/rules.mk similarity index 100% rename from keyboards/meishi/rules.mk rename to keyboards/biacco42/meishi/rules.mk diff --git a/keyboards/meishi2/config.h b/keyboards/biacco42/meishi2/config.h similarity index 100% rename from keyboards/meishi2/config.h rename to keyboards/biacco42/meishi2/config.h diff --git a/keyboards/meishi2/info.json b/keyboards/biacco42/meishi2/info.json similarity index 100% rename from keyboards/meishi2/info.json rename to keyboards/biacco42/meishi2/info.json diff --git a/keyboards/meishi2/keymaps/default/keymap.c b/keyboards/biacco42/meishi2/keymaps/default/keymap.c similarity index 100% rename from keyboards/meishi2/keymaps/default/keymap.c rename to keyboards/biacco42/meishi2/keymaps/default/keymap.c diff --git a/keyboards/meishi2/keymaps/default/readme.md b/keyboards/biacco42/meishi2/keymaps/default/readme.md similarity index 100% rename from keyboards/meishi2/keymaps/default/readme.md rename to keyboards/biacco42/meishi2/keymaps/default/readme.md diff --git a/keyboards/meishi2/keymaps/led_status/keymap.c b/keyboards/biacco42/meishi2/keymaps/led_status/keymap.c similarity index 100% rename from keyboards/meishi2/keymaps/led_status/keymap.c rename to keyboards/biacco42/meishi2/keymaps/led_status/keymap.c diff --git a/keyboards/meishi2/keymaps/led_status/readme.md b/keyboards/biacco42/meishi2/keymaps/led_status/readme.md similarity index 100% rename from keyboards/meishi2/keymaps/led_status/readme.md rename to keyboards/biacco42/meishi2/keymaps/led_status/readme.md diff --git a/keyboards/meishi2/keymaps/moc/config.h b/keyboards/biacco42/meishi2/keymaps/moc/config.h similarity index 100% rename from keyboards/meishi2/keymaps/moc/config.h rename to keyboards/biacco42/meishi2/keymaps/moc/config.h diff --git a/keyboards/meishi2/keymaps/moc/keymap.c b/keyboards/biacco42/meishi2/keymaps/moc/keymap.c similarity index 100% rename from keyboards/meishi2/keymaps/moc/keymap.c rename to keyboards/biacco42/meishi2/keymaps/moc/keymap.c diff --git a/keyboards/meishi2/keymaps/moc/readme.md b/keyboards/biacco42/meishi2/keymaps/moc/readme.md similarity index 100% rename from keyboards/meishi2/keymaps/moc/readme.md rename to keyboards/biacco42/meishi2/keymaps/moc/readme.md diff --git a/keyboards/meishi2/keymaps/via/keymap.c b/keyboards/biacco42/meishi2/keymaps/via/keymap.c similarity index 100% rename from keyboards/meishi2/keymaps/via/keymap.c rename to keyboards/biacco42/meishi2/keymaps/via/keymap.c diff --git a/keyboards/meishi2/keymaps/via/rules.mk b/keyboards/biacco42/meishi2/keymaps/via/rules.mk similarity index 100% rename from keyboards/meishi2/keymaps/via/rules.mk rename to keyboards/biacco42/meishi2/keymaps/via/rules.mk diff --git a/keyboards/meishi2/meishi2.c b/keyboards/biacco42/meishi2/meishi2.c similarity index 100% rename from keyboards/meishi2/meishi2.c rename to keyboards/biacco42/meishi2/meishi2.c diff --git a/keyboards/meishi2/meishi2.h b/keyboards/biacco42/meishi2/meishi2.h similarity index 100% rename from keyboards/meishi2/meishi2.h rename to keyboards/biacco42/meishi2/meishi2.h diff --git a/keyboards/meishi2/readme.md b/keyboards/biacco42/meishi2/readme.md similarity index 95% rename from keyboards/meishi2/readme.md rename to keyboards/biacco42/meishi2/readme.md index d80ec44184ae..97c5465f8660 100644 --- a/keyboards/meishi2/readme.md +++ b/keyboards/biacco42/meishi2/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [links to where you can find this hardware](https://githu Make example for this keyboard (after setting up your build environment): - make meishi2:default + make biacco42/meishi2: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/meishi2/rules.mk b/keyboards/biacco42/meishi2/rules.mk similarity index 100% rename from keyboards/meishi2/rules.mk rename to keyboards/biacco42/meishi2/rules.mk diff --git a/keyboards/bioi/main.c b/keyboards/bioi/main.c index 7c8922c0a05c..54caf6937b56 100644 --- a/keyboards/bioi/main.c +++ b/keyboards/bioi/main.c @@ -45,8 +45,8 @@ extern keymap_config_t keymap_config; #endif #ifdef BLUETOOTH_ENABLE -#ifdef MODULE_ADAFRUIT_BLE -#include "adafruit_ble.h" +#ifdef BLUETOOTH_BLUEFRUIT_LE +#include "bluefruit_le.h" #else #include "bluetooth.h" #endif @@ -319,7 +319,7 @@ int main(void) setup_usb(); sei(); -#if defined(MODULE_ADAFRUIT_EZKEY) || defined(MODULE_RN42) +#if defined(BLUETOOTH_RN42) serial_init(); #endif diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h index 80896242e074..138dedab5709 100644 --- a/keyboards/boston_meetup/2019/config.h +++ b/keyboards/boston_meetup/2019/config.h @@ -1,7 +1,7 @@ #pragma once /* USB Device descriptor parameter */ -#define DEVICE_VER 0x07E3 +#define DEVICE_VER 0x2019 #undef MATRIX_ROWS #undef MATRIX_COLS diff --git a/keyboards/four_banger/config.h b/keyboards/bpiphany/four_banger/config.h similarity index 100% rename from keyboards/four_banger/config.h rename to keyboards/bpiphany/four_banger/config.h diff --git a/keyboards/four_banger/four_banger.c b/keyboards/bpiphany/four_banger/four_banger.c similarity index 100% rename from keyboards/four_banger/four_banger.c rename to keyboards/bpiphany/four_banger/four_banger.c diff --git a/keyboards/four_banger/four_banger.h b/keyboards/bpiphany/four_banger/four_banger.h similarity index 100% rename from keyboards/four_banger/four_banger.h rename to keyboards/bpiphany/four_banger/four_banger.h diff --git a/keyboards/four_banger/info.json b/keyboards/bpiphany/four_banger/info.json similarity index 100% rename from keyboards/four_banger/info.json rename to keyboards/bpiphany/four_banger/info.json diff --git a/keyboards/four_banger/keymaps/default/keymap.c b/keyboards/bpiphany/four_banger/keymaps/default/keymap.c similarity index 100% rename from keyboards/four_banger/keymaps/default/keymap.c rename to keyboards/bpiphany/four_banger/keymaps/default/keymap.c diff --git a/keyboards/four_banger/readme.md b/keyboards/bpiphany/four_banger/readme.md similarity index 82% rename from keyboards/four_banger/readme.md rename to keyboards/bpiphany/four_banger/readme.md index 913ca6ee85a9..d508447b5650 100644 --- a/keyboards/four_banger/readme.md +++ b/keyboards/bpiphany/four_banger/readme.md @@ -9,6 +9,6 @@ Hardware Availability: [1up Keyboards](https://1upkeyboards.com/) Make example for this keyboard (after setting up your build environment): - make four_banger:default + make bpiphany/four_banger:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/four_banger/rules.mk b/keyboards/bpiphany/four_banger/rules.mk similarity index 100% rename from keyboards/four_banger/rules.mk rename to keyboards/bpiphany/four_banger/rules.mk diff --git a/keyboards/hid_liber/config.h b/keyboards/bpiphany/hid_liber/config.h similarity index 100% rename from keyboards/hid_liber/config.h rename to keyboards/bpiphany/hid_liber/config.h diff --git a/keyboards/hid_liber/hid_liber.c b/keyboards/bpiphany/hid_liber/hid_liber.c similarity index 100% rename from keyboards/hid_liber/hid_liber.c rename to keyboards/bpiphany/hid_liber/hid_liber.c diff --git a/keyboards/hid_liber/hid_liber.h b/keyboards/bpiphany/hid_liber/hid_liber.h similarity index 100% rename from keyboards/hid_liber/hid_liber.h rename to keyboards/bpiphany/hid_liber/hid_liber.h diff --git a/keyboards/hid_liber/info.json b/keyboards/bpiphany/hid_liber/info.json similarity index 100% rename from keyboards/hid_liber/info.json rename to keyboards/bpiphany/hid_liber/info.json diff --git a/keyboards/hid_liber/keymaps/bakageta/config.h b/keyboards/bpiphany/hid_liber/keymaps/bakageta/config.h similarity index 100% rename from keyboards/hid_liber/keymaps/bakageta/config.h rename to keyboards/bpiphany/hid_liber/keymaps/bakageta/config.h diff --git a/keyboards/hid_liber/keymaps/bakageta/keymap.c b/keyboards/bpiphany/hid_liber/keymaps/bakageta/keymap.c similarity index 100% rename from keyboards/hid_liber/keymaps/bakageta/keymap.c rename to keyboards/bpiphany/hid_liber/keymaps/bakageta/keymap.c diff --git a/keyboards/hid_liber/keymaps/bakageta/readme.md b/keyboards/bpiphany/hid_liber/keymaps/bakageta/readme.md similarity index 100% rename from keyboards/hid_liber/keymaps/bakageta/readme.md rename to keyboards/bpiphany/hid_liber/keymaps/bakageta/readme.md diff --git a/keyboards/hid_liber/keymaps/bakageta/rules.mk b/keyboards/bpiphany/hid_liber/keymaps/bakageta/rules.mk similarity index 100% rename from keyboards/hid_liber/keymaps/bakageta/rules.mk rename to keyboards/bpiphany/hid_liber/keymaps/bakageta/rules.mk diff --git a/keyboards/hid_liber/keymaps/default/keymap.c b/keyboards/bpiphany/hid_liber/keymaps/default/keymap.c similarity index 100% rename from keyboards/hid_liber/keymaps/default/keymap.c rename to keyboards/bpiphany/hid_liber/keymaps/default/keymap.c diff --git a/keyboards/hid_liber/keymaps/default/readme.md b/keyboards/bpiphany/hid_liber/keymaps/default/readme.md similarity index 100% rename from keyboards/hid_liber/keymaps/default/readme.md rename to keyboards/bpiphany/hid_liber/keymaps/default/readme.md diff --git a/keyboards/hid_liber/matrix.c b/keyboards/bpiphany/hid_liber/matrix.c similarity index 98% rename from keyboards/hid_liber/matrix.c rename to keyboards/bpiphany/hid_liber/matrix.c index ff59a1715341..da73c616d78c 100755 --- a/keyboards/hid_liber/matrix.c +++ b/keyboards/bpiphany/hid_liber/matrix.c @@ -218,12 +218,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - // NOTE: no longer used - return true; -} - inline bool matrix_has_ghost(void) { diff --git a/keyboards/hid_liber/readme.md b/keyboards/bpiphany/hid_liber/readme.md similarity index 96% rename from keyboards/hid_liber/readme.md rename to keyboards/bpiphany/hid_liber/readme.md index d70ace123d5f..3f653cc040bc 100755 --- a/keyboards/hid_liber/readme.md +++ b/keyboards/bpiphany/hid_liber/readme.md @@ -12,6 +12,6 @@ DIY daughterboard for Filco Majestouch TKL developed by Geekhack and Deskthority Make example for this keyboard (after setting up your build environment): - make hid_liber:default + make bpiphany/hid_liber: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/hid_liber/rules.mk b/keyboards/bpiphany/hid_liber/rules.mk similarity index 100% rename from keyboards/hid_liber/rules.mk rename to keyboards/bpiphany/hid_liber/rules.mk diff --git a/keyboards/bpiphany/kitten_paw/matrix.c b/keyboards/bpiphany/kitten_paw/matrix.c index b59089cdf43e..56114858f153 100644 --- a/keyboards/bpiphany/kitten_paw/matrix.c +++ b/keyboards/bpiphany/kitten_paw/matrix.c @@ -117,13 +117,6 @@ uint8_t matrix_scan(void) { return 1; } -bool matrix_is_modified(void) { - if (debouncing) - return false; - else - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1<event.pressed) ? &add_key : &del_key; - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); - method(shifted ? KC_GRAVE : KC_ESCAPE); - send_keyboard_report(); - }else if(event->event.pressed){ - switch(id){ - case LFK_SET_DEFAULT_LAYER: - // set/save the current base layer to eeprom, falls through to LFK_CLEAR - eeconfig_update_default_layer(1UL << opt); - default_layer_set(1UL << opt); - case LFK_CLEAR: - // Go back to default layer - layer_clear(); - break; -#ifdef AUDIO_ENABLE - case LFK_CLICK_FREQ_LOWER: - sign = -1; // continue to next statement - case LFK_CLICK_FREQ_HIGHER: - click_hz += sign * 100; - click(click_hz, click_time); - break; - case LFK_CLICK_TOGGLE: - if(click_toggle){ - click_toggle = 0; - click(4000, 100); - click(1000, 100); - }else{ - click_toggle = 1; - click(1000, 100); - click(4000, 100); - } - break; - case LFK_CLICK_TIME_SHORTER: - sign = -1; // continue to next statement - case LFK_CLICK_TIME_LONGER: - click_time += sign; - click(click_hz, click_time); - break; -#endif - case LFK_DEBUG_SETTINGS: - dprintf("Click:\n"); - dprintf(" toggle: %d\n", click_toggle); - dprintf(" freq(hz): %d\n", click_hz); - dprintf(" duration(ms): %d\n", click_time); - break; - } - } -} - void reset_keyboard_kb(){ #ifdef WATCHDOG_ENABLE MCUSR = 0; diff --git a/keyboards/cu75/cu75.h b/keyboards/capsunlocked/cu75/cu75.h similarity index 89% rename from keyboards/cu75/cu75.h rename to keyboards/capsunlocked/cu75/cu75.h index 444c8daaec93..11a01b8b7ed2 100644 --- a/keyboards/cu75/cu75.h +++ b/keyboards/capsunlocked/cu75/cu75.h @@ -19,19 +19,6 @@ typedef struct Layer_Info { extern const uint32_t layer_count; extern const Layer_Info layer_info[]; -enum action_functions { - LFK_CLEAR = 0, // Resets all layers - LFK_ESC_TILDE, // esc+lshift = ~ - LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom - LFK_CLICK_TOGGLE, // Adjusts click duration - LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency - LFK_CLICK_FREQ_LOWER, // Adjusts click frequency - LFK_CLICK_TIME_LONGER, // Adjusts click duration - LFK_CLICK_TIME_SHORTER, // Adjusts click duration - LFK_DEBUG_SETTINGS, // prints LED and click settings to HID - LFK_LED_TEST // cycles through switch and RGB LEDs -}; - #define CLICK_HZ 500 #define CLICK_MS 2 #define CLICK_ENABLED 0 diff --git a/keyboards/cu75/info.json b/keyboards/capsunlocked/cu75/info.json similarity index 100% rename from keyboards/cu75/info.json rename to keyboards/capsunlocked/cu75/info.json diff --git a/keyboards/cu75/keymaps/default/keymap.c b/keyboards/capsunlocked/cu75/keymaps/default/keymap.c similarity index 100% rename from keyboards/cu75/keymaps/default/keymap.c rename to keyboards/capsunlocked/cu75/keymaps/default/keymap.c diff --git a/keyboards/cu75/keymaps/default/rules.mk b/keyboards/capsunlocked/cu75/keymaps/default/rules.mk similarity index 100% rename from keyboards/cu75/keymaps/default/rules.mk rename to keyboards/capsunlocked/cu75/keymaps/default/rules.mk diff --git a/keyboards/cu75/keymaps/iso/keymap.c b/keyboards/capsunlocked/cu75/keymaps/iso/keymap.c similarity index 100% rename from keyboards/cu75/keymaps/iso/keymap.c rename to keyboards/capsunlocked/cu75/keymaps/iso/keymap.c diff --git a/keyboards/cu75/keymaps/iso/rules.mk b/keyboards/capsunlocked/cu75/keymaps/iso/rules.mk similarity index 100% rename from keyboards/cu75/keymaps/iso/rules.mk rename to keyboards/capsunlocked/cu75/keymaps/iso/rules.mk diff --git a/keyboards/cu75/readme.md b/keyboards/capsunlocked/cu75/readme.md similarity index 85% rename from keyboards/cu75/readme.md rename to keyboards/capsunlocked/cu75/readme.md index 43603440fd24..78882b257384 100644 --- a/keyboards/cu75/readme.md +++ b/keyboards/capsunlocked/cu75/readme.md @@ -1,6 +1,6 @@ # CU75 -![CU75](https://geekhack.org/index.php?action=dlattach;topic=91767.0;attach=179167;image) +![CU75](https://i.imgur.com/42ltqi6.jpg) A luxurious 75% keyboard with various layouts. Includes RGB underglow, backlight and an aluminium, brass and nylon case. @@ -12,6 +12,6 @@ This PCB uses lighting libraries from LFKeyboards Make example for this keyboard (after setting up your build environment): - make CU75:default + make capsunlocked/cu75:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/cu75/rules.mk b/keyboards/capsunlocked/cu75/rules.mk similarity index 56% rename from keyboards/cu75/rules.mk rename to keyboards/capsunlocked/cu75/rules.mk index 6274267ab150..d3979a914918 100644 --- a/keyboards/cu75/rules.mk +++ b/keyboards/capsunlocked/cu75/rules.mk @@ -9,4 +9,6 @@ BOOTLOADER = atmel-dfu # BACKLIGHT_DRIVER = custom -SRC = ../lfkeyboards/TWIlib.c ../lfkeyboards/issi.c ../lfkeyboards/lighting.c +# TODO: These boards need to be converted to RGB Matrix +VPATH += keyboards/lfkeyboards +SRC = TWIlib.c issi.c lighting.c diff --git a/keyboards/cu80/config.h b/keyboards/capsunlocked/cu80/v1/config.h similarity index 100% rename from keyboards/cu80/config.h rename to keyboards/capsunlocked/cu80/v1/config.h diff --git a/keyboards/cu80/info.json b/keyboards/capsunlocked/cu80/v1/info.json similarity index 100% rename from keyboards/cu80/info.json rename to keyboards/capsunlocked/cu80/v1/info.json diff --git a/keyboards/cu80/keymaps/default/keymap.c b/keyboards/capsunlocked/cu80/v1/keymaps/default/keymap.c similarity index 100% rename from keyboards/cu80/keymaps/default/keymap.c rename to keyboards/capsunlocked/cu80/v1/keymaps/default/keymap.c diff --git a/keyboards/cu80/keymaps/default/readme.md b/keyboards/capsunlocked/cu80/v1/keymaps/default/readme.md similarity index 100% rename from keyboards/cu80/keymaps/default/readme.md rename to keyboards/capsunlocked/cu80/v1/keymaps/default/readme.md diff --git a/keyboards/cu80/readme.md b/keyboards/capsunlocked/cu80/v1/readme.md similarity index 79% rename from keyboards/cu80/readme.md rename to keyboards/capsunlocked/cu80/v1/readme.md index cb48c875b99f..9d6141a4a056 100644 --- a/keyboards/cu80/readme.md +++ b/keyboards/capsunlocked/cu80/v1/readme.md @@ -1,6 +1,6 @@ # CU80 -![cu80](https://cdn11.bigcommerce.com/s-vdedjo0w46/images/stencil/900x900/products/287/2336/DSCF3583__16019.1567722956.png?c=2) +![cu80](https://i.imgur.com/p8D4POn.png) A customizable 80% keyboard. @@ -10,6 +10,6 @@ A customizable 80% keyboard. Make example for this keyboard (after setting up your build environment): - make cu80:default + make capsunlocked/cu80/v1: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/cu80/rules.mk b/keyboards/capsunlocked/cu80/v1/rules.mk similarity index 100% rename from keyboards/cu80/rules.mk rename to keyboards/capsunlocked/cu80/v1/rules.mk diff --git a/keyboards/dm9records/ergoinu/keymaps/default/config.h b/keyboards/capsunlocked/cu80/v1/v1.c similarity index 74% rename from keyboards/dm9records/ergoinu/keymaps/default/config.h rename to keyboards/capsunlocked/cu80/v1/v1.c index bb266f25e72d..96161175b28e 100644 --- a/keyboards/dm9records/ergoinu/keymaps/default/config.h +++ b/keyboards/capsunlocked/cu80/v1/v1.c @@ -1,9 +1,5 @@ /* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2018 Takuya Urakawa +Copyright 2020 Andy Holland 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 @@ -19,6 +15,4 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#pragma once - -#define RGBLIGHT_ANIMATIONS +#include "v1.h" diff --git a/keyboards/cu80/cu80.h b/keyboards/capsunlocked/cu80/v1/v1.h similarity index 100% rename from keyboards/cu80/cu80.h rename to keyboards/capsunlocked/cu80/v1/v1.h diff --git a/keyboards/capsunlocked/cu80/v2_ansi/info.json b/keyboards/capsunlocked/cu80/v2_ansi/info.json index f0317de36d54..7615d9f02969 100644 --- a/keyboards/capsunlocked/cu80/v2_ansi/info.json +++ b/keyboards/capsunlocked/cu80/v2_ansi/info.json @@ -37,7 +37,7 @@ }, "url": "https://caps-unlocked.com/cu80-round-2/", "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x0081", "vid": "0x4355" }, diff --git a/keyboards/capsunlocked/cu80/v2_iso/info.json b/keyboards/capsunlocked/cu80/v2_iso/info.json index c3321560695c..43f074f170d4 100644 --- a/keyboards/capsunlocked/cu80/v2_iso/info.json +++ b/keyboards/capsunlocked/cu80/v2_iso/info.json @@ -37,7 +37,7 @@ }, "url": "https://caps-unlocked.com/cu80-round-2/", "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x0080", "vid": "0x4355" }, diff --git a/keyboards/centromere/config.h b/keyboards/centromere/config.h index e502e2534bce..b4cae20332c1 100644 --- a/keyboards/centromere/config.h +++ b/keyboards/centromere/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 500000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/centromere/matrix.c b/keyboards/centromere/matrix.c index 7256cd5cb5a7..bbd771f41bb9 100644 --- a/keyboards/centromere/matrix.c +++ b/keyboards/centromere/matrix.c @@ -15,80 +15,21 @@ 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 -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} -void matrix_init(void) { +#include "quantum.h" +#include "matrix.h" +#include "uart.h" - matrix_init_quantum(); - serial_init(); +void matrix_init_custom(void) { + uart_init(500000); } -uint8_t matrix_scan(void) -{ +bool matrix_scan_custom(matrix_row_t current_matrix[]) { uint32_t timeout = 0; + bool changed = false; //the s character requests the RF remote slave to send the matrix information - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates, erase the last set of data uint8_t uart_data[11] = {0}; @@ -96,58 +37,27 @@ uint8_t matrix_scan(void) //there are 10 bytes corresponding to 1w columns, and an end byte for (uint8_t i = 0; i < 11; i++) { //wait for the serial data, timeout if it's been too long - while(!SERIAL_UART_RXD_PRESENT){ + while (!uart_available()) { timeout++; - if (timeout > 10000){ + if (timeout > 10000) { break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { + if (uart_data[10] == 0xE0) { //shifting and transferring the keystates to the QMK matrix variable for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5; + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 5; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; } } - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - - matrix_init_quantum(); - serial_init(); -} - -uint8_t matrix_scan(void) -{ - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[14] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 14; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { - //shifting and transferring the keystates to the QMK matrix variable - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 6; - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#elif (MATRIX_COLS <= 64) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse64(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop64(matrix[i]) -# define ROW_SHIFTER ((uint64_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - matrix_init_quantum(); - serial_init(); -} - -uint8_t matrix_scan(void) -{ - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[11] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 11; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { - //shifting and transferring the keystates to the QMK matrix variable - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5; - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - - matrix_init_quantum(); - serial_init(); -} - -uint8_t matrix_scan(void) -{ - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[11] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 11; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { - //shifting and transferring the keystates to the QMK matrix variable - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5; - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - - matrix_init_quantum(); - serial_init(); -} - -uint8_t matrix_scan(void) -{ - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[14] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 14; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { - //shifting and transferring the keystates to the QMK matrix variable - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 6; - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - - matrix_init_quantum(); - serial_init(); -} - -uint8_t matrix_scan(void) -{ - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[11] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 11; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { - //shifting and transferring the keystates to the QMK matrix variable - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5; - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. get_mods() == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) - - -/* Serial(USART) configuration - * asynchronous, negative logic, 9600baud, no flow control - * 1-start bit, 8-data bit, non parity, 1-stop bit - */ -#define SERIAL_SOFT_BAUD 9600 -#define SERIAL_SOFT_PARITY_NONE -#define SERIAL_SOFT_BIT_ORDER_LSB -#if (HANDSPRING == 0) - #define SERIAL_SOFT_LOGIC_NEGATIVE //RS232 logic -#endif -/* RXD Port */ -#define SERIAL_SOFT_RXD_ENABLE - -// we are using Pro micro pin 3 / D0 as serial -#define SERIAL_SOFT_RXD_DDR DDRD -#define SERIAL_SOFT_RXD_PORT PORTD -#define SERIAL_SOFT_RXD_PIN PIND -#define SERIAL_SOFT_RXD_BIT 0 -#define SERIAL_SOFT_RXD_VECT INT0_vect - -/* RXD Interupt */ -#define SERIAL_SOFT_RXD_INIT() do { \ - /* pin configuration: input with pull-up */ \ - SERIAL_SOFT_RXD_DDR &= ~(1<. */ #include QMK_KEYBOARD_H -#include "protocol/serial.h" +#include "uart.h" #include "timer.h" @@ -58,8 +58,6 @@ static uint16_t disconnect_counter = 0; #define COL(code) ((code & COL_MASK) ) #define KEYUP(code) ((code & KEY_MASK) >>7 ) -static bool is_modified = false; - __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); @@ -166,7 +164,7 @@ uint8_t rts_reset(void) { uint8_t get_serial_byte(void) { static uint8_t code; while(1) { - code = serial_recv(); + code = uart_read(); if (code) { debug_hex(code); debug(" "); return code; @@ -242,7 +240,7 @@ void matrix_init(void) debug_enable = true; //debug_matrix =true; - serial_init(); // arguments all #defined + uart_init(9600); // arguments all #defined #if (HANDSPRING == 0) pins_init(); // set all inputs and outputs. @@ -292,7 +290,7 @@ void matrix_init(void) uint8_t matrix_scan(void) { uint8_t code; - code = serial_recv(); + code = uart_read(); if (!code) { /* disconnect_counter ++; @@ -354,11 +352,6 @@ uint8_t matrix_scan(void) return code; } -bool matrix_is_modified(void) -{ - return is_modified; -} - inline bool matrix_has_ghost(void) { diff --git a/keyboards/converter/palm_usb/post_rules.mk b/keyboards/converter/palm_usb/post_rules.mk deleted file mode 100644 index 9c110767015e..000000000000 --- a/keyboards/converter/palm_usb/post_rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -ifdef HARDWARE_SERIAL - # Untested with palm_usb - SRC += protocol/serial_uart.c - OPT_DEFS += -DHARDWARE_SERIAL -else - SRC += protocol/serial_soft.c -endif diff --git a/keyboards/converter/palm_usb/rules.mk b/keyboards/converter/palm_usb/rules.mk index c5e680b8830d..a1d2e39b233b 100644 --- a/keyboards/converter/palm_usb/rules.mk +++ b/keyboards/converter/palm_usb/rules.mk @@ -20,5 +20,6 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. CUSTOM_MATRIX = yes SRC += matrix.c +QUANTUM_LIB_SRC += uart.c DEFAULT_FOLDER = converter/palm_usb/stowaway diff --git a/keyboards/converter/sun_usb/command_extra.c b/keyboards/converter/sun_usb/command_extra.c index 756a9160bb1f..332776ab904e 100644 --- a/keyboards/converter/sun_usb/command_extra.c +++ b/keyboards/converter/sun_usb/command_extra.c @@ -1,5 +1,5 @@ #include QMK_KEYBOARD_H -#include "protocol/serial.h" +#include "uart.h" bool sun_bell = false; bool sun_click = false; @@ -20,41 +20,41 @@ bool command_extra(uint8_t code) return false; case KC_DEL: print("Reset\n"); - serial_send(0x01); + uart_write(0x01); break; case KC_HOME: sun_bell = !sun_bell; if (sun_bell) { print("Bell On\n"); - serial_send(0x02); + uart_write(0x02); } else { print("Bell Off\n"); - serial_send(0x03); + uart_write(0x03); } break; case KC_END: sun_click = !sun_click; if (sun_click) { print("Click On\n"); - serial_send(0x0A); + uart_write(0x0A); } else { print("Click Off\n"); - serial_send(0x0B); + uart_write(0x0B); } break; case KC_PGUP: print("LED all on\n"); - serial_send(0x0E); - serial_send(0xFF); + uart_write(0x0E); + uart_write(0xFF); break; case KC_PGDOWN: print("LED all off\n"); - serial_send(0x0E); - serial_send(0x00); + uart_write(0x0E); + uart_write(0x00); break; case KC_INSERT: print("layout\n"); - serial_send(0x0F); + uart_write(0x0F); break; default: xprintf("Unknown extra command: %02X\n", code); diff --git a/keyboards/converter/sun_usb/config.h b/keyboards/converter/sun_usb/config.h index c67ae5ebae86..0a4aa019f781 100644 --- a/keyboards/converter/sun_usb/config.h +++ b/keyboards/converter/sun_usb/config.h @@ -33,50 +33,3 @@ along with this program. If not, see . get_mods() == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) - - -/* Serial(USART) configuration - * asynchronous, negative logic, 1200baud, no flow control - * 1-start bit, 8-data bit, non parity, 1-stop bit - */ -#define SERIAL_SOFT_BAUD 1200 -#define SERIAL_SOFT_PARITY_NONE -#define SERIAL_SOFT_BIT_ORDER_LSB -#define SERIAL_SOFT_LOGIC_NEGATIVE -/* RXD Port */ -#define SERIAL_SOFT_RXD_ENABLE -#define SERIAL_SOFT_RXD_DDR DDRD -#define SERIAL_SOFT_RXD_PORT PORTD -#define SERIAL_SOFT_RXD_PIN PIND -#define SERIAL_SOFT_RXD_BIT 2 -#define SERIAL_SOFT_RXD_VECT INT2_vect -/* RXD Interupt */ -#define SERIAL_SOFT_RXD_INIT() do { \ - /* pin configuration: input with pull-up */ \ - SERIAL_SOFT_RXD_DDR &= ~(1<. */ #include QMK_KEYBOARD_H -#include "protocol/serial.h" +#include "uart.h" void led_set(uint8_t usb_led) { @@ -27,6 +27,6 @@ void led_set(uint8_t usb_led) if (usb_led & (1<. */ #include QMK_KEYBOARD_H -#include "protocol/serial.h" +#include "uart.h" /* * Matrix Array usage: @@ -38,8 +38,6 @@ static uint8_t matrix[MATRIX_ROWS]; #define ROW(code) ((code>>3)&0xF) #define COL(code) (code&0x07) -static bool is_modified = false; - __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); @@ -76,7 +74,7 @@ void matrix_init(void) /* PORTD |= (1<<6); */ debug_enable = true; - serial_init(); + uart_init(1200); // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; @@ -86,12 +84,12 @@ void matrix_init(void) /* print("Reseting "); */ /* while (1) { */ /* print("."); */ - /* while (serial_recv()); */ - /* serial_send(0x01); */ + /* while (uart_read()); */ + /* uart_write(0x01); */ /* _delay_ms(500); */ - /* if (serial_recv() == 0xFF) { */ + /* if (uart_read() == 0xFF) { */ /* _delay_ms(500); */ - /* if (serial_recv() == 0x04) */ + /* if (uart_read() == 0x04) */ /* break; */ /* } */ /* } */ @@ -106,7 +104,7 @@ void matrix_init(void) uint8_t matrix_scan(void) { uint8_t code; - code = serial_recv(); + code = uart_read(); if (!code) return 0; debug_hex(code); debug(" "); @@ -115,7 +113,7 @@ uint8_t matrix_scan(void) case 0xFF: // reset success: FF 04 print("reset: "); _delay_ms(500); - code = serial_recv(); + code = uart_read(); xprintf("%02X\n", code); if (code == 0x04) { // LED status @@ -125,12 +123,12 @@ uint8_t matrix_scan(void) case 0xFE: // layout: FE print("layout: "); _delay_ms(500); - xprintf("%02X\n", serial_recv()); + xprintf("%02X\n", uart_read()); return 0; case 0x7E: // reset fail: 7E 01 print("reset fail: "); _delay_ms(500); - xprintf("%02X\n", serial_recv()); + xprintf("%02X\n", uart_read()); return 0; case 0x7F: // all keys up @@ -154,11 +152,6 @@ uint8_t matrix_scan(void) return code; } -bool matrix_is_modified(void) -{ - return is_modified; -} - inline bool matrix_has_ghost(void) { diff --git a/keyboards/converter/sun_usb/post_rules.mk b/keyboards/converter/sun_usb/post_rules.mk deleted file mode 100644 index 2ea1f0a5bf3e..000000000000 --- a/keyboards/converter/sun_usb/post_rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -ifdef HARDWARE_SERIAL - SRC += protocol/serial_uart.c - OPT_DEFS += -DHARDWARE_SERIAL -else - SRC += protocol/serial_soft.c -endif diff --git a/keyboards/converter/sun_usb/rules.mk b/keyboards/converter/sun_usb/rules.mk index 2f2ddde1d04e..d25bcc7ffa77 100644 --- a/keyboards/converter/sun_usb/rules.mk +++ b/keyboards/converter/sun_usb/rules.mk @@ -20,5 +20,6 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. CUSTOM_MATRIX = yes SRC += matrix.c led.c +QUANTUM_LIB_SRC += uart.c DEFAULT_FOLDER = converter/sun_usb/type5 diff --git a/keyboards/converter/usb_usb/ble/config.h b/keyboards/converter/usb_usb/ble/config.h index 80e4968c41d7..92df24d00376 100644 --- a/keyboards/converter/usb_usb/ble/config.h +++ b/keyboards/converter/usb_usb/ble/config.h @@ -4,8 +4,8 @@ #define PRODUCT QMK BLE Adapter // Turn off the mode leds on the BLE module -#define ADAFRUIT_BLE_ENABLE_MODE_LEDS 0 -#define ADAFRUIT_BLE_ENABLE_POWER_LED 0 +#define BLUEFRUIT_LE_ENABLE_MODE_LEDS 0 +#define BLUEFRUIT_LE_ENABLE_POWER_LED 0 #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk index 596f7196302d..df5bc36635b8 100644 --- a/keyboards/converter/usb_usb/ble/rules.mk +++ b/keyboards/converter/usb_usb/ble/rules.mk @@ -12,6 +12,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LTO_ENABLE = yes diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index 296f7fcd026b..265fb2c68d92 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -185,17 +185,13 @@ extern "C" // restore LED state when keyboard comes up if (usb_state == USB_STATE_RUNNING) { dprintf("speed: %s\n", usb_host.getVbusState()==FSHOST ? "full" : "low"); - keyboard_set_leds(host_keyboard_leds()); + led_set(host_keyboard_leds()); } } matrix_scan_quantum(); return 1; } - bool matrix_is_modified(void) { - return matrix_is_mod; - } - bool matrix_is_on(uint8_t row, uint8_t col) { uint8_t code = CODE(row, col); diff --git a/keyboards/crkbd/keymaps/snowe/rules.mk b/keyboards/crkbd/keymaps/snowe/rules.mk index ce3b5928fadc..96ae4bbf95f8 100644 --- a/keyboards/crkbd/keymaps/snowe/rules.mk +++ b/keyboards/crkbd/keymaps/snowe/rules.mk @@ -21,6 +21,6 @@ OCEAN_DREAM_ENABLE = yes LUNA_ENABLE = no # disabled so travis build succeeds # if firmware size over limit, try this option -CFLAGS += -flto +LTO_ENABLE = yes WPM_ENABLE = yes diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk b/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk index bd53c1921199..92ded45e93fb 100644 --- a/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_right/rules.mk @@ -1,5 +1,6 @@ # Build Options POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. +POINTING_DEVICE_DRIVER = custom MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/cu80/cu80.c b/keyboards/cu80/cu80.c deleted file mode 100644 index f794161717c6..000000000000 --- a/keyboards/cu80/cu80.c +++ /dev/null @@ -1 +0,0 @@ -#include "cu80.h" \ No newline at end of file diff --git a/keyboards/cybergear/macro25/info.json b/keyboards/cybergear/macro25/info.json index a029ae1ce33d..75078962bffb 100644 --- a/keyboards/cybergear/macro25/info.json +++ b/keyboards/cybergear/macro25/info.json @@ -5,7 +5,7 @@ "usb": { "vid": "0x1209", "pid": "0x69A1", - "device_ver": "0x0001" + "device_version": "0.0.1", }, "diode_direction": "COL2ROW", "layouts": { diff --git a/keyboards/angel64/alpha/.noci b/keyboards/dailycraft/bat43/.noci similarity index 100% rename from keyboards/angel64/alpha/.noci rename to keyboards/dailycraft/bat43/.noci diff --git a/keyboards/bat43/bat43.c b/keyboards/dailycraft/bat43/bat43.c similarity index 100% rename from keyboards/bat43/bat43.c rename to keyboards/dailycraft/bat43/bat43.c diff --git a/keyboards/bat43/bat43.h b/keyboards/dailycraft/bat43/bat43.h similarity index 55% rename from keyboards/bat43/bat43.h rename to keyboards/dailycraft/bat43/bat43.h index 42d44107b4ab..046788a0a120 100644 --- a/keyboards/bat43/bat43.h +++ b/keyboards/dailycraft/bat43/bat43.h @@ -1,9 +1,9 @@ #pragma once -#ifdef KEYBOARD_bat43_rev1 +#ifdef KEYBOARD_dailycraft_bat43_rev1 #include "rev1.h" #endif -#ifdef KEYBOARD_bat43_rev2 +#ifdef KEYBOARD_dailycraft_bat43_rev2 #include "rev2.h" #endif diff --git a/keyboards/bat43/config.h b/keyboards/dailycraft/bat43/config.h similarity index 100% rename from keyboards/bat43/config.h rename to keyboards/dailycraft/bat43/config.h diff --git a/keyboards/bat43/keymaps/default/keymap.c b/keyboards/dailycraft/bat43/keymaps/default/keymap.c similarity index 100% rename from keyboards/bat43/keymaps/default/keymap.c rename to keyboards/dailycraft/bat43/keymaps/default/keymap.c diff --git a/keyboards/bat43/keymaps/default/readme.md b/keyboards/dailycraft/bat43/keymaps/default/readme.md similarity index 100% rename from keyboards/bat43/keymaps/default/readme.md rename to keyboards/dailycraft/bat43/keymaps/default/readme.md diff --git a/keyboards/bat43/keymaps/via/keymap.c b/keyboards/dailycraft/bat43/keymaps/via/keymap.c similarity index 100% rename from keyboards/bat43/keymaps/via/keymap.c rename to keyboards/dailycraft/bat43/keymaps/via/keymap.c diff --git a/keyboards/bat43/keymaps/via/readme.md b/keyboards/dailycraft/bat43/keymaps/via/readme.md similarity index 100% rename from keyboards/bat43/keymaps/via/readme.md rename to keyboards/dailycraft/bat43/keymaps/via/readme.md diff --git a/keyboards/bakeneko65/rev3/keymaps/via/rules.mk b/keyboards/dailycraft/bat43/keymaps/via/rules.mk similarity index 100% rename from keyboards/bakeneko65/rev3/keymaps/via/rules.mk rename to keyboards/dailycraft/bat43/keymaps/via/rules.mk diff --git a/keyboards/bat43/readme.md b/keyboards/dailycraft/bat43/readme.md similarity index 62% rename from keyboards/bat43/readme.md rename to keyboards/dailycraft/bat43/readme.md index 7097aa7af594..6b58aa5ca3b3 100644 --- a/keyboards/bat43/readme.md +++ b/keyboards/dailycraft/bat43/readme.md @@ -6,10 +6,21 @@ A 43-key keyboard. * Keyboard Maintainer: [yfuku](https://github.com/yfuku) * Hardware Supported: bat43 PCB, Pro Micro -* Hardware Availability: https://yfuku.booth.pm/ +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make bat43:default + make dailycraft/bat43:default + +Flashing example for this keyboard: + + make dailycraft/bat43: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 reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/bat43/.noci b/keyboards/dailycraft/bat43/rev1/.noci similarity index 100% rename from keyboards/bat43/.noci rename to keyboards/dailycraft/bat43/rev1/.noci diff --git a/keyboards/bat43/rev1/info.json b/keyboards/dailycraft/bat43/rev1/info.json similarity index 100% rename from keyboards/bat43/rev1/info.json rename to keyboards/dailycraft/bat43/rev1/info.json diff --git a/keyboards/bat43/rev1/rev1.c b/keyboards/dailycraft/bat43/rev1/rev1.c similarity index 100% rename from keyboards/bat43/rev1/rev1.c rename to keyboards/dailycraft/bat43/rev1/rev1.c diff --git a/keyboards/bat43/rev1/rev1.h b/keyboards/dailycraft/bat43/rev1/rev1.h similarity index 100% rename from keyboards/bat43/rev1/rev1.h rename to keyboards/dailycraft/bat43/rev1/rev1.h diff --git a/keyboards/bat43/rev1/rules.mk b/keyboards/dailycraft/bat43/rev1/rules.mk similarity index 100% rename from keyboards/bat43/rev1/rules.mk rename to keyboards/dailycraft/bat43/rev1/rules.mk diff --git a/keyboards/bat43/rev1/.noci b/keyboards/dailycraft/bat43/rev2/.noci similarity index 100% rename from keyboards/bat43/rev1/.noci rename to keyboards/dailycraft/bat43/rev2/.noci diff --git a/keyboards/bat43/rev2/info.json b/keyboards/dailycraft/bat43/rev2/info.json similarity index 100% rename from keyboards/bat43/rev2/info.json rename to keyboards/dailycraft/bat43/rev2/info.json diff --git a/keyboards/bat43/rev2/rev2.c b/keyboards/dailycraft/bat43/rev2/rev2.c similarity index 100% rename from keyboards/bat43/rev2/rev2.c rename to keyboards/dailycraft/bat43/rev2/rev2.c diff --git a/keyboards/bat43/rev2/rev2.h b/keyboards/dailycraft/bat43/rev2/rev2.h similarity index 100% rename from keyboards/bat43/rev2/rev2.h rename to keyboards/dailycraft/bat43/rev2/rev2.h diff --git a/keyboards/bat43/rev2/rules.mk b/keyboards/dailycraft/bat43/rev2/rules.mk similarity index 100% rename from keyboards/bat43/rev2/rules.mk rename to keyboards/dailycraft/bat43/rev2/rules.mk diff --git a/keyboards/bat43/rules.mk b/keyboards/dailycraft/bat43/rules.mk similarity index 94% rename from keyboards/bat43/rules.mk rename to keyboards/dailycraft/bat43/rules.mk index 7bd7394e4f57..c2e1c5755f01 100644 --- a/keyboards/bat43/rules.mk +++ b/keyboards/dailycraft/bat43/rules.mk @@ -17,4 +17,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -DEFAULT_FOLDER = bat43/rev2 +DEFAULT_FOLDER = dailycraft/bat43/rev2 diff --git a/keyboards/bat43/rev2/.noci b/keyboards/dailycraft/claw44/.noci similarity index 100% rename from keyboards/bat43/rev2/.noci rename to keyboards/dailycraft/claw44/.noci diff --git a/keyboards/claw44/claw44.c b/keyboards/dailycraft/claw44/claw44.c similarity index 100% rename from keyboards/claw44/claw44.c rename to keyboards/dailycraft/claw44/claw44.c diff --git a/keyboards/claw44/claw44.h b/keyboards/dailycraft/claw44/claw44.h similarity index 51% rename from keyboards/claw44/claw44.h rename to keyboards/dailycraft/claw44/claw44.h index 4ca25fcb2b1e..76ecda6e90a0 100644 --- a/keyboards/claw44/claw44.h +++ b/keyboards/dailycraft/claw44/claw44.h @@ -1,5 +1,5 @@ #pragma once -#ifdef KEYBOARD_claw44_rev1 +#ifdef KEYBOARD_dailycraft_claw44_rev1 #include "rev1.h" #endif diff --git a/keyboards/claw44/config.h b/keyboards/dailycraft/claw44/config.h similarity index 100% rename from keyboards/claw44/config.h rename to keyboards/dailycraft/claw44/config.h diff --git a/keyboards/claw44/keymaps/default/config.h b/keyboards/dailycraft/claw44/keymaps/default/config.h similarity index 100% rename from keyboards/claw44/keymaps/default/config.h rename to keyboards/dailycraft/claw44/keymaps/default/config.h diff --git a/keyboards/claw44/keymaps/default/keymap.c b/keyboards/dailycraft/claw44/keymaps/default/keymap.c similarity index 100% rename from keyboards/claw44/keymaps/default/keymap.c rename to keyboards/dailycraft/claw44/keymaps/default/keymap.c diff --git a/keyboards/claw44/keymaps/oled/config.h b/keyboards/dailycraft/claw44/keymaps/oled/config.h similarity index 100% rename from keyboards/claw44/keymaps/oled/config.h rename to keyboards/dailycraft/claw44/keymaps/oled/config.h diff --git a/keyboards/claw44/keymaps/oled/keymap.c b/keyboards/dailycraft/claw44/keymaps/oled/keymap.c similarity index 100% rename from keyboards/claw44/keymaps/oled/keymap.c rename to keyboards/dailycraft/claw44/keymaps/oled/keymap.c diff --git a/keyboards/claw44/keymaps/oled/rules.mk b/keyboards/dailycraft/claw44/keymaps/oled/rules.mk similarity index 100% rename from keyboards/claw44/keymaps/oled/rules.mk rename to keyboards/dailycraft/claw44/keymaps/oled/rules.mk diff --git a/keyboards/claw44/keymaps/via/config.h b/keyboards/dailycraft/claw44/keymaps/via/config.h similarity index 100% rename from keyboards/claw44/keymaps/via/config.h rename to keyboards/dailycraft/claw44/keymaps/via/config.h diff --git a/keyboards/claw44/keymaps/via/keymap.c b/keyboards/dailycraft/claw44/keymaps/via/keymap.c similarity index 100% rename from keyboards/claw44/keymaps/via/keymap.c rename to keyboards/dailycraft/claw44/keymaps/via/keymap.c diff --git a/keyboards/barleycorn/keymaps/via/rules.mk b/keyboards/dailycraft/claw44/keymaps/via/rules.mk similarity index 100% rename from keyboards/barleycorn/keymaps/via/rules.mk rename to keyboards/dailycraft/claw44/keymaps/via/rules.mk diff --git a/keyboards/claw44/lib/glcdfont.c b/keyboards/dailycraft/claw44/lib/glcdfont.c similarity index 100% rename from keyboards/claw44/lib/glcdfont.c rename to keyboards/dailycraft/claw44/lib/glcdfont.c diff --git a/keyboards/claw44/readme.md b/keyboards/dailycraft/claw44/readme.md similarity index 50% rename from keyboards/claw44/readme.md rename to keyboards/dailycraft/claw44/readme.md index 7e72e0897134..e533bd7c82ff 100644 --- a/keyboards/claw44/readme.md +++ b/keyboards/dailycraft/claw44/readme.md @@ -4,12 +4,23 @@ A split keyboard with 3x6 vertically staggered keys and 4 thumb keys. -Keyboard Maintainer: [@yfuku_](https://twitter.com/yfuku_) -Hardware Supported: Claw44 PCB, ProMicro -Hardware Availability: https://yfuku.booth.pm/ +* Keyboard Maintainer: [yfuku](https://github.com/yfuku) +* Hardware Supported: Claw44 PCB, ProMicro +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make claw44:default + make dailycraft/claw44:default + +Flashing example for this keyboard: + + make dailycraft/claw44: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 reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/bigseries/1key/.noci b/keyboards/dailycraft/claw44/rev1/.noci similarity index 100% rename from keyboards/bigseries/1key/.noci rename to keyboards/dailycraft/claw44/rev1/.noci diff --git a/keyboards/claw44/rev1/config.h b/keyboards/dailycraft/claw44/rev1/config.h similarity index 100% rename from keyboards/claw44/rev1/config.h rename to keyboards/dailycraft/claw44/rev1/config.h diff --git a/keyboards/claw44/rev1/info.json b/keyboards/dailycraft/claw44/rev1/info.json similarity index 100% rename from keyboards/claw44/rev1/info.json rename to keyboards/dailycraft/claw44/rev1/info.json diff --git a/keyboards/claw44/rev1/readme.md b/keyboards/dailycraft/claw44/rev1/readme.md similarity index 100% rename from keyboards/claw44/rev1/readme.md rename to keyboards/dailycraft/claw44/rev1/readme.md diff --git a/keyboards/7skb/rev1/rev1.c b/keyboards/dailycraft/claw44/rev1/rev1.c similarity index 100% rename from keyboards/7skb/rev1/rev1.c rename to keyboards/dailycraft/claw44/rev1/rev1.c diff --git a/keyboards/claw44/rev1/rev1.h b/keyboards/dailycraft/claw44/rev1/rev1.h similarity index 100% rename from keyboards/claw44/rev1/rev1.h rename to keyboards/dailycraft/claw44/rev1/rev1.h diff --git a/keyboards/claw44/rev1/rules.mk b/keyboards/dailycraft/claw44/rev1/rules.mk similarity index 100% rename from keyboards/claw44/rev1/rules.mk rename to keyboards/dailycraft/claw44/rev1/rules.mk diff --git a/keyboards/claw44/rules.mk b/keyboards/dailycraft/claw44/rules.mk similarity index 93% rename from keyboards/claw44/rules.mk rename to keyboards/dailycraft/claw44/rules.mk index 6ba5e853fb0a..69c59f28e6a5 100644 --- a/keyboards/claw44/rules.mk +++ b/keyboards/dailycraft/claw44/rules.mk @@ -17,4 +17,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -DEFAULT_FOLDER = claw44/rev1 +DEFAULT_FOLDER = dailycraft/claw44/rev1 diff --git a/keyboards/owl8/config.h b/keyboards/dailycraft/owl8/config.h similarity index 100% rename from keyboards/owl8/config.h rename to keyboards/dailycraft/owl8/config.h diff --git a/keyboards/owl8/info.json b/keyboards/dailycraft/owl8/info.json similarity index 100% rename from keyboards/owl8/info.json rename to keyboards/dailycraft/owl8/info.json diff --git a/keyboards/owl8/keymaps/default/keymap.c b/keyboards/dailycraft/owl8/keymaps/default/keymap.c similarity index 100% rename from keyboards/owl8/keymaps/default/keymap.c rename to keyboards/dailycraft/owl8/keymaps/default/keymap.c diff --git a/keyboards/owl8/keymaps/default/readme.md b/keyboards/dailycraft/owl8/keymaps/default/readme.md similarity index 100% rename from keyboards/owl8/keymaps/default/readme.md rename to keyboards/dailycraft/owl8/keymaps/default/readme.md diff --git a/keyboards/owl8/keymaps/via/keymap.c b/keyboards/dailycraft/owl8/keymaps/via/keymap.c similarity index 100% rename from keyboards/owl8/keymaps/via/keymap.c rename to keyboards/dailycraft/owl8/keymaps/via/keymap.c diff --git a/keyboards/owl8/keymaps/via/readme.md b/keyboards/dailycraft/owl8/keymaps/via/readme.md similarity index 100% rename from keyboards/owl8/keymaps/via/readme.md rename to keyboards/dailycraft/owl8/keymaps/via/readme.md diff --git a/keyboards/bat43/keymaps/via/rules.mk b/keyboards/dailycraft/owl8/keymaps/via/rules.mk similarity index 100% rename from keyboards/bat43/keymaps/via/rules.mk rename to keyboards/dailycraft/owl8/keymaps/via/rules.mk diff --git a/keyboards/owl8/owl8.c b/keyboards/dailycraft/owl8/owl8.c similarity index 100% rename from keyboards/owl8/owl8.c rename to keyboards/dailycraft/owl8/owl8.c diff --git a/keyboards/owl8/owl8.h b/keyboards/dailycraft/owl8/owl8.h similarity index 100% rename from keyboards/owl8/owl8.h rename to keyboards/dailycraft/owl8/owl8.h diff --git a/keyboards/owl8/readme.md b/keyboards/dailycraft/owl8/readme.md similarity index 64% rename from keyboards/owl8/readme.md rename to keyboards/dailycraft/owl8/readme.md index b40a5f35cb32..c7fab17476d6 100644 --- a/keyboards/owl8/readme.md +++ b/keyboards/dailycraft/owl8/readme.md @@ -6,14 +6,21 @@ macropad * Keyboard Maintainer: [yfuku](https://github.com/yfuku) * Hardware Supported: owl8 PCB, Pro Micro -* Hardware Availability: https://yfuku.booth.pm/ +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make owl8:default + make dailycraft/owl8:default Flashing example for this keyboard: - make owl8:default:flash + make dailycraft/owl8: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 reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/owl8/rules.mk b/keyboards/dailycraft/owl8/rules.mk similarity index 100% rename from keyboards/owl8/rules.mk rename to keyboards/dailycraft/owl8/rules.mk diff --git a/keyboards/ergodash/config.h b/keyboards/dailycraft/wings42/config.h similarity index 100% rename from keyboards/ergodash/config.h rename to keyboards/dailycraft/wings42/config.h diff --git a/keyboards/wings42/rev2/readme.md b/keyboards/dailycraft/wings42/readme.md similarity index 67% rename from keyboards/wings42/rev2/readme.md rename to keyboards/dailycraft/wings42/readme.md index 158372feb4cb..c91965339717 100644 --- a/keyboards/wings42/rev2/readme.md +++ b/keyboards/dailycraft/wings42/readme.md @@ -6,16 +6,21 @@ A split keyboard with 3x6 vertically staggered keys and 3 thumb keys. * Keyboard Maintainer: [yfuku](https://github.com/yfuku) * Hardware Supported: wings42 PCB, Pro Micro -* Hardware Availability: https://yfuku.booth.pm/ +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make wings42:default + make dailycraft/wings42:default Flashing example for this keyboard: - make wings42:default:flash + make dailycraft/wings42: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). -A build guide for this keyboard can be found here: [wings42 build guide](https://yfuku.com/wings42/buildguide/) +## Bootloader + +Enter the bootloader in 2 ways: + +* **Physical reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/wings42/rev1/config.h b/keyboards/dailycraft/wings42/rev1/config.h similarity index 100% rename from keyboards/wings42/rev1/config.h rename to keyboards/dailycraft/wings42/rev1/config.h diff --git a/keyboards/wings42/rev1/info.json b/keyboards/dailycraft/wings42/rev1/info.json similarity index 100% rename from keyboards/wings42/rev1/info.json rename to keyboards/dailycraft/wings42/rev1/info.json diff --git a/keyboards/wings42/rev1/keymaps/default/keymap.c b/keyboards/dailycraft/wings42/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/wings42/rev1/keymaps/default/keymap.c rename to keyboards/dailycraft/wings42/rev1/keymaps/default/keymap.c diff --git a/keyboards/wings42/rev1/keymaps/default/readme.md b/keyboards/dailycraft/wings42/rev1/keymaps/default/readme.md similarity index 100% rename from keyboards/wings42/rev1/keymaps/default/readme.md rename to keyboards/dailycraft/wings42/rev1/keymaps/default/readme.md diff --git a/keyboards/wings42/rev1/keymaps/via/keymap.c b/keyboards/dailycraft/wings42/rev1/keymaps/via/keymap.c similarity index 100% rename from keyboards/wings42/rev1/keymaps/via/keymap.c rename to keyboards/dailycraft/wings42/rev1/keymaps/via/keymap.c diff --git a/keyboards/chili/keymaps/via/rules.mk b/keyboards/dailycraft/wings42/rev1/keymaps/via/rules.mk similarity index 100% rename from keyboards/chili/keymaps/via/rules.mk rename to keyboards/dailycraft/wings42/rev1/keymaps/via/rules.mk diff --git a/keyboards/wings42/rev1_extkeys/readme.md b/keyboards/dailycraft/wings42/rev1/readme.md similarity index 66% rename from keyboards/wings42/rev1_extkeys/readme.md rename to keyboards/dailycraft/wings42/rev1/readme.md index 7be464a141f5..959052c41d5e 100644 --- a/keyboards/wings42/rev1_extkeys/readme.md +++ b/keyboards/dailycraft/wings42/rev1/readme.md @@ -6,16 +6,21 @@ A split keyboard with 3x6 vertically staggered keys and 3 thumb keys. * Keyboard Maintainer: [yfuku](https://github.com/yfuku) * Hardware Supported: wings42 PCB, Pro Micro -* Hardware Availability: https://yfuku.booth.pm/ +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make make wings42/rev1_extkeys:default + make dailycraft/wings42/rev1:default Flashing example for this keyboard: - make make wings42/rev1_extkeys:default:flash + make dailycraft/wings42/rev1: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). -A build guide for this keyboard can be found here: [wings42 build guide](https://yfuku.com/wings42/buildguide/) +## Bootloader + +Enter the bootloader in 2 ways: + +* **Physical reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/wings42/rev1/rev1.c b/keyboards/dailycraft/wings42/rev1/rev1.c similarity index 100% rename from keyboards/wings42/rev1/rev1.c rename to keyboards/dailycraft/wings42/rev1/rev1.c diff --git a/keyboards/wings42/rev1/rev1.h b/keyboards/dailycraft/wings42/rev1/rev1.h similarity index 100% rename from keyboards/wings42/rev1/rev1.h rename to keyboards/dailycraft/wings42/rev1/rev1.h diff --git a/keyboards/7skb/rev1/rules.mk b/keyboards/dailycraft/wings42/rev1/rules.mk similarity index 100% rename from keyboards/7skb/rev1/rules.mk rename to keyboards/dailycraft/wings42/rev1/rules.mk diff --git a/keyboards/wings42/rev1_extkeys/config.h b/keyboards/dailycraft/wings42/rev1_extkeys/config.h similarity index 100% rename from keyboards/wings42/rev1_extkeys/config.h rename to keyboards/dailycraft/wings42/rev1_extkeys/config.h diff --git a/keyboards/wings42/rev1_extkeys/info.json b/keyboards/dailycraft/wings42/rev1_extkeys/info.json similarity index 100% rename from keyboards/wings42/rev1_extkeys/info.json rename to keyboards/dailycraft/wings42/rev1_extkeys/info.json diff --git a/keyboards/wings42/rev1_extkeys/keymaps/default/keymap.c b/keyboards/dailycraft/wings42/rev1_extkeys/keymaps/default/keymap.c similarity index 100% rename from keyboards/wings42/rev1_extkeys/keymaps/default/keymap.c rename to keyboards/dailycraft/wings42/rev1_extkeys/keymaps/default/keymap.c diff --git a/keyboards/wings42/rev1_extkeys/keymaps/default/readme.md b/keyboards/dailycraft/wings42/rev1_extkeys/keymaps/default/readme.md similarity index 100% rename from keyboards/wings42/rev1_extkeys/keymaps/default/readme.md rename to keyboards/dailycraft/wings42/rev1_extkeys/keymaps/default/readme.md diff --git a/keyboards/wings42/rev1_extkeys/keymaps/via/keymap.c b/keyboards/dailycraft/wings42/rev1_extkeys/keymaps/via/keymap.c similarity index 100% rename from keyboards/wings42/rev1_extkeys/keymaps/via/keymap.c rename to keyboards/dailycraft/wings42/rev1_extkeys/keymaps/via/keymap.c diff --git a/keyboards/choc_taro/keymaps/via/rules.mk b/keyboards/dailycraft/wings42/rev1_extkeys/keymaps/via/rules.mk similarity index 100% rename from keyboards/choc_taro/keymaps/via/rules.mk rename to keyboards/dailycraft/wings42/rev1_extkeys/keymaps/via/rules.mk diff --git a/keyboards/wings42/readme.md b/keyboards/dailycraft/wings42/rev1_extkeys/readme.md similarity index 65% rename from keyboards/wings42/readme.md rename to keyboards/dailycraft/wings42/rev1_extkeys/readme.md index fc71d58ab696..4a34063ad4cf 100644 --- a/keyboards/wings42/readme.md +++ b/keyboards/dailycraft/wings42/rev1_extkeys/readme.md @@ -6,14 +6,21 @@ A split keyboard with 3x6 vertically staggered keys and 3 thumb keys. * Keyboard Maintainer: [yfuku](https://github.com/yfuku) * Hardware Supported: wings42 PCB, Pro Micro -* Hardware Availability: https://yfuku.booth.pm/ +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make wings42:default + make dailycraft/wings42/rev1_extkeys:default Flashing example for this keyboard: - make wings42:default:flash + make dailycraft/wings42/rev1_extkeys: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 reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/wings42/rev1_extkeys/rev1_extkeys.c b/keyboards/dailycraft/wings42/rev1_extkeys/rev1_extkeys.c similarity index 100% rename from keyboards/wings42/rev1_extkeys/rev1_extkeys.c rename to keyboards/dailycraft/wings42/rev1_extkeys/rev1_extkeys.c diff --git a/keyboards/wings42/rev1_extkeys/rev1_extkeys.h b/keyboards/dailycraft/wings42/rev1_extkeys/rev1_extkeys.h similarity index 100% rename from keyboards/wings42/rev1_extkeys/rev1_extkeys.h rename to keyboards/dailycraft/wings42/rev1_extkeys/rev1_extkeys.h diff --git a/keyboards/angel64/alpha/rules.mk b/keyboards/dailycraft/wings42/rev1_extkeys/rules.mk similarity index 100% rename from keyboards/angel64/alpha/rules.mk rename to keyboards/dailycraft/wings42/rev1_extkeys/rules.mk diff --git a/keyboards/wings42/rev2/config.h b/keyboards/dailycraft/wings42/rev2/config.h similarity index 100% rename from keyboards/wings42/rev2/config.h rename to keyboards/dailycraft/wings42/rev2/config.h diff --git a/keyboards/wings42/rev2/info.json b/keyboards/dailycraft/wings42/rev2/info.json similarity index 100% rename from keyboards/wings42/rev2/info.json rename to keyboards/dailycraft/wings42/rev2/info.json diff --git a/keyboards/wings42/rev2/keymaps/default/keymap.c b/keyboards/dailycraft/wings42/rev2/keymaps/default/keymap.c similarity index 100% rename from keyboards/wings42/rev2/keymaps/default/keymap.c rename to keyboards/dailycraft/wings42/rev2/keymaps/default/keymap.c diff --git a/keyboards/wings42/rev2/keymaps/default/readme.md b/keyboards/dailycraft/wings42/rev2/keymaps/default/readme.md similarity index 100% rename from keyboards/wings42/rev2/keymaps/default/readme.md rename to keyboards/dailycraft/wings42/rev2/keymaps/default/readme.md diff --git a/keyboards/wings42/rev2/keymaps/via/config.h b/keyboards/dailycraft/wings42/rev2/keymaps/via/config.h similarity index 100% rename from keyboards/wings42/rev2/keymaps/via/config.h rename to keyboards/dailycraft/wings42/rev2/keymaps/via/config.h diff --git a/keyboards/wings42/rev2/keymaps/via/keymap.c b/keyboards/dailycraft/wings42/rev2/keymaps/via/keymap.c similarity index 100% rename from keyboards/wings42/rev2/keymaps/via/keymap.c rename to keyboards/dailycraft/wings42/rev2/keymaps/via/keymap.c diff --git a/keyboards/wings42/rev2/keymaps/via/rules.mk b/keyboards/dailycraft/wings42/rev2/keymaps/via/rules.mk similarity index 100% rename from keyboards/wings42/rev2/keymaps/via/rules.mk rename to keyboards/dailycraft/wings42/rev2/keymaps/via/rules.mk diff --git a/keyboards/wings42/rev1/readme.md b/keyboards/dailycraft/wings42/rev2/readme.md similarity index 67% rename from keyboards/wings42/rev1/readme.md rename to keyboards/dailycraft/wings42/rev2/readme.md index 4ddfe3e83c5a..c91965339717 100644 --- a/keyboards/wings42/rev1/readme.md +++ b/keyboards/dailycraft/wings42/rev2/readme.md @@ -6,16 +6,21 @@ A split keyboard with 3x6 vertically staggered keys and 3 thumb keys. * Keyboard Maintainer: [yfuku](https://github.com/yfuku) * Hardware Supported: wings42 PCB, Pro Micro -* Hardware Availability: https://yfuku.booth.pm/ +* Hardware Availability: https://shop.dailycraft.jp/ Make example for this keyboard (after setting up your build environment): - make wings42/rev1:default + make dailycraft/wings42:default Flashing example for this keyboard: - make wings42/rev1:default:flash + make dailycraft/wings42: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). -A build guide for this keyboard can be found here: [wings42 build guide](https://yfuku.com/wings42/buildguide/) +## Bootloader + +Enter the bootloader in 2 ways: + +* **Physical reset button**: Briefly press the button on the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/wings42/rev2/rev2.c b/keyboards/dailycraft/wings42/rev2/rev2.c similarity index 100% rename from keyboards/wings42/rev2/rev2.c rename to keyboards/dailycraft/wings42/rev2/rev2.c diff --git a/keyboards/wings42/rev2/rev2.h b/keyboards/dailycraft/wings42/rev2/rev2.h similarity index 100% rename from keyboards/wings42/rev2/rev2.h rename to keyboards/dailycraft/wings42/rev2/rev2.h diff --git a/keyboards/angel64/rev1/rules.mk b/keyboards/dailycraft/wings42/rev2/rules.mk similarity index 100% rename from keyboards/angel64/rev1/rules.mk rename to keyboards/dailycraft/wings42/rev2/rules.mk diff --git a/keyboards/wings42/rules.mk b/keyboards/dailycraft/wings42/rules.mk similarity index 94% rename from keyboards/wings42/rules.mk rename to keyboards/dailycraft/wings42/rules.mk index 74e894efecde..94459dbcc559 100644 --- a/keyboards/wings42/rules.mk +++ b/keyboards/dailycraft/wings42/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = wings42/rev2 +DEFAULT_FOLDER = dailycraft/wings42/rev2 diff --git a/keyboards/wings42/wings42.c b/keyboards/dailycraft/wings42/wings42.c similarity index 100% rename from keyboards/wings42/wings42.c rename to keyboards/dailycraft/wings42/wings42.c diff --git a/keyboards/wings42/wings42.h b/keyboards/dailycraft/wings42/wings42.h similarity index 86% rename from keyboards/wings42/wings42.h rename to keyboards/dailycraft/wings42/wings42.h index 9412b7117a17..d839f048847a 100644 --- a/keyboards/wings42/wings42.h +++ b/keyboards/dailycraft/wings42/wings42.h @@ -18,13 +18,13 @@ #include "quantum.h" -#ifdef KEYBOARD_wings42_rev1 +#ifdef KEYBOARD_dailycraft_wings42_rev1 # include "rev1.h" #endif -#ifdef KEYBOARD_wings42_rev1_extkeys +#ifdef KEYBOARD_dailycraft_wings42_rev1_extkeys # include "rev1_extkeys.h" #endif -#ifdef KEYBOARD_wings42_rev2 +#ifdef KEYBOARD_dailycraft_wings42_rev2 # include "rev2.h" #endif diff --git a/keyboards/dc01/arrow/matrix.c b/keyboards/dc01/arrow/matrix.c index 0102ad0fa422..b69e14791417 100644 --- a/keyboards/dc01/arrow/matrix.c +++ b/keyboards/dc01/arrow/matrix.c @@ -205,14 +205,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c index 40533beac4ce..3eeb2586bc92 100644 --- a/keyboards/dc01/left/matrix.c +++ b/keyboards/dc01/left/matrix.c @@ -230,14 +230,6 @@ if (i2c_transaction(SLAVE_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)) { return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/dc01/numpad/matrix.c b/keyboards/dc01/numpad/matrix.c index 38130114eb34..e8e2a1b14a2f 100644 --- a/keyboards/dc01/numpad/matrix.c +++ b/keyboards/dc01/numpad/matrix.c @@ -205,14 +205,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/dc01/right/matrix.c b/keyboards/dc01/right/matrix.c index 544c8dc538e1..2509bd7d4c68 100644 --- a/keyboards/dc01/right/matrix.c +++ b/keyboards/dc01/right/matrix.c @@ -206,14 +206,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/deltapad/rules.mk b/keyboards/deltapad/rules.mk index 9906266f4822..1275531ef6d6 100644 --- a/keyboards/deltapad/rules.mk +++ b/keyboards/deltapad/rules.mk @@ -12,10 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/deltasplit75/keymaps/default/keymap.c b/keyboards/deltasplit75/keymaps/default/keymap.c index c13b0627c0a7..7d698eb329e7 100644 --- a/keyboards/deltasplit75/keymaps/default/keymap.c +++ b/keyboards/deltasplit75/keymaps/default/keymap.c @@ -20,8 +20,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, KC_BSLS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - M(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_VOLD, M(0), KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_VOLD, _______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), diff --git a/keyboards/dichotomy/config.h b/keyboards/dichotomy/config.h index 03e19b138838..40e7f18e6f79 100644 --- a/keyboards/dichotomy/config.h +++ b/keyboards/dichotomy/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/dichotomy/dichotomy.c b/keyboards/dichotomy/dichotomy.c index 967d7e603cec..afd52cc8b3c2 100755 --- a/keyboards/dichotomy/dichotomy.c +++ b/keyboards/dichotomy/dichotomy.c @@ -1,11 +1,13 @@ #include "dichotomy.h" +//#include "uart.h" + void pointing_device_task(void){ /*report_mouse_t currentReport = {}; uint32_t timeout = 0; //the m character requests the RF slave to send the mouse report - SERIAL_UART_DATA = 'm'; + uart_write('m'); //trust the external inputs completely, erase old data uint8_t uart_data[5] = {0}; @@ -15,7 +17,7 @@ void pointing_device_task(void){ //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while(!uart_available()){ timeout++; if (timeout > 10000){ xprintf("\r\nTIMED OUT"); @@ -23,7 +25,7 @@ void pointing_device_task(void){ } } xprintf("\r\nGOT DATA for %d",i); - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, bytes 1-4 are movement and scroll diff --git a/keyboards/dichotomy/matrix.c b/keyboards/dichotomy/matrix.c index ed83bd452c10..806b66d498cd 100755 --- a/keyboards/dichotomy/matrix.c +++ b/keyboards/dichotomy/matrix.c @@ -29,7 +29,7 @@ along with this program. If not, see . #include "dichotomy.h" #include "pointing_device.h" #include "report.h" -#include "protocol/serial.h" +#include "uart.h" #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") @@ -94,7 +94,7 @@ uint8_t matrix_cols(void) { void matrix_init(void) { matrix_init_quantum(); - serial_init(); + uart_init(1000000); } uint8_t matrix_scan(void) @@ -104,7 +104,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates entirely, erase the last data uint8_t uart_data[11] = {0}; @@ -114,14 +114,14 @@ uint8_t matrix_scan(void) //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while(!uart_available()){ timeout++; if (timeout > 10000){ xprintf("\r\nTime out in keyboard."); break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 diff --git a/keyboards/dichotomy/rules.mk b/keyboards/dichotomy/rules.mk index 2b5eb0360cc9..420e409e4398 100755 --- a/keyboards/dichotomy/rules.mk +++ b/keyboards/dichotomy/rules.mk @@ -10,6 +10,7 @@ BOOTLOADER = caterina BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite #MOUSEKEY_ENABLE = yes # Mouse keys POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. +POINTING_DEVICE_DRIVER = custom EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration @@ -18,4 +19,5 @@ NKRO_ENABLE = yes # Enable N-Key Rollover # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # # project specific files -SRC += matrix.c serial_uart.c +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/dm9records/ergoinu/config.h b/keyboards/dm9records/ergoinu/config.h index 113eaf9f7601..89ea9e7903a4 100644 --- a/keyboards/dm9records/ergoinu/config.h +++ b/keyboards/dm9records/ergoinu/config.h @@ -20,7 +20,6 @@ along with this program. If not, see . #pragma once #include "config_common.h" -#include "serial_config.h" /* USB Device descriptor parameter VID & PID are lisenced from microchip sublisence program, Don't use other project! */ @@ -30,11 +29,11 @@ along with this program. If not, see . #define MANUFACTURER Dm9Records #define PRODUCT ergoinu -#define TAPPING_FORCE_HOLD -#define TAPPING_TERM 100 - #define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D2 + /* Select hand configuration */ #define MASTER_LEFT // #define MASTER_RIGHT @@ -49,6 +48,9 @@ along with this program. If not, see . #define MATRIX_COLS 7 #define MATRIX_COL_PINS { B4, E6, D7, C6, D4, F5, F4 } +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/dm9records/ergoinu/ergoinu.c b/keyboards/dm9records/ergoinu/ergoinu.c index c6d099a14835..a01ac0a25c32 100644 --- a/keyboards/dm9records/ergoinu/ergoinu.c +++ b/keyboards/dm9records/ergoinu/ergoinu.c @@ -1 +1,18 @@ +/* +Copyright 2018 Takuya Urakawa + +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 "ergoinu.h" diff --git a/keyboards/dm9records/ergoinu/ergoinu.h b/keyboards/dm9records/ergoinu/ergoinu.h index 43249a84404b..c275d3fa27a8 100644 --- a/keyboards/dm9records/ergoinu/ergoinu.h +++ b/keyboards/dm9records/ergoinu/ergoinu.h @@ -19,10 +19,6 @@ along with this program. If not, see . #include "quantum.h" -#ifdef RGBLIGHT_ENABLE -#include "ws2812.h" -#endif - #define LAYOUT( \ L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ L07, L08, L09, L10, L11, L12, L13, R07, R08, R09, R10, R11, R12, R13, \ @@ -41,4 +37,3 @@ along with this program. If not, see . { R27, R26, R25, R24, R23, R22, R21 }, \ { KC_NO, KC_NO, R32, R31, R30, R29, R28 } \ } - diff --git a/keyboards/dm9records/ergoinu/keymaps/default/keymap.c b/keyboards/dm9records/ergoinu/keymaps/default/keymap.c index 00c5da820dac..862b53882960 100644 --- a/keyboards/dm9records/ergoinu/keymaps/default/keymap.c +++ b/keyboards/dm9records/ergoinu/keymaps/default/keymap.c @@ -5,14 +5,6 @@ extern rgblight_config_t rgblight_config; #endif -#define JA_CLON KC_QUOT // : and + -#define JA_AT KC_LBRC // @ and ` -#define JA_HAT KC_EQL // ^ and ~ -#define JA_ENUN KC_RO // \ and _ (EN mark and UNder score) -#define JA_ENVL KC_JYEN // \ and | (EN mark and Vertical Line) -#define JA_LBRC KC_RBRC // [ and { -#define JA_RBRC KC_BSLS // ] and } - enum LAYER_NO { BASE = 0, META, @@ -24,33 +16,30 @@ enum CUSTOM_KEYCODES { RGB_TYPE, }; -// Fillers to make layering more clear -#define ______ KC_TRNS -#define XXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = 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_EQL, KC_BSLS, - KC_DEL, 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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_GRV, - 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_RSFT, + 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_BSLS, + KC_DEL, 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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_GRV, + 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_RSFT, MO(META),KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, KC_RALT, MO(META) ), [META] = LAYOUT( MO(CONF),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_INS, - ______, KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, - ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RGHT, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ + _______, KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [CONF] = LAYOUT( - ______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX + + [CONF] = LAYOUT( + _______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ) }; diff --git a/keyboards/dm9records/ergoinu/keymaps/default/rules.mk b/keyboards/dm9records/ergoinu/keymaps/default/rules.mk deleted file mode 100644 index 8567c2ae2ef7..000000000000 --- a/keyboards/dm9records/ergoinu/keymaps/default/rules.mk +++ /dev/null @@ -1,18 +0,0 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = no # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing - -# ergoinu configs -DISABLE_PROMICRO_LEDs = yes - -# Uncomment these for debugging -# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) -# $(info -- OPT_DEFS=$(OPT_DEFS)) -# $(info ) diff --git a/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c b/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c index a9a9f71f4d26..32289c44db26 100644 --- a/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c +++ b/keyboards/dm9records/ergoinu/keymaps/default_jis/keymap.c @@ -24,10 +24,6 @@ enum CUSTOM_KEYCODES { RGB_TYPE, }; -// Fillers to make layering more clear -#define ______ KC_TRNS -#define XXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT( @@ -38,20 +34,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MO(META),KC_LALT, KC_ZKHK, KC_BSPC, KC_SPC, KC_ENT, KC_BSPC, KC_MHEN, KC_KANA, MO(META) ), - [META] = LAYOUT( MO(CONF),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_INS, - ______, KC_CAPS, ______, KC_UP, ______, ______, ______, ______, ______, ______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, - ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RGHT, - ______, ______, KC_RGUI, KC_DEL, KC_ENT, ______, KC_DEL, KC_HENK, KC_LGUI, ______ + _______, KC_CAPS, _______, KC_UP, _______, _______, _______, _______, _______, _______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, + _______, _______, KC_RGUI, KC_DEL, KC_ENT, _______, KC_DEL, KC_HENK, KC_LGUI, _______ ), - [CONF] = LAYOUT( - ______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX + + [CONF] = LAYOUT( + _______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ) }; diff --git a/keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk b/keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk deleted file mode 100644 index 97154be6365f..000000000000 --- a/keyboards/dm9records/ergoinu/keymaps/default_jis/rules.mk +++ /dev/null @@ -1,18 +0,0 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing - -# ergoinu configs -DISABLE_PROMICRO_LEDs = yes - -# Uncomment these for debugging -# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) -# $(info -- OPT_DEFS=$(OPT_DEFS)) -# $(info ) diff --git a/keyboards/dm9records/ergoinu/matrix.c b/keyboards/dm9records/ergoinu/matrix.c deleted file mode 100644 index b1c58f88fe79..000000000000 --- a/keyboards/dm9records/ergoinu/matrix.c +++ /dev/null @@ -1,292 +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 -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "quantum.h" - -#include "serial.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; -uint8_t is_master = 0 ; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); -static uint8_t matrix_master_scan(void); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - - #ifdef DISABLE_PROMICRO_LEDs - writePinHigh(B0); - writePinHigh(D5); - #endif - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - is_master = has_usb(); - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) { - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int ret=serial_update_buffers(); - if (ret ) { -#ifndef DISABLE_PROMICRO_LEDs - if(ret==2) writePinLow(B0); -#endif - return 1; - } -#ifndef DISABLE_PROMICRO_LEDs - writePinHigh(B0); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} - -uint8_t matrix_scan(void) { - if (is_master) { - matrix_master_scan(); - }else{ - matrix_slave_scan(); - - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[offset+i] = serial_master_buffer[i]; - } - - matrix_scan_quantum(); - } - return 1; -} - - -uint8_t matrix_master_scan(void) { - - int ret = _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_master_buffer[i] = matrix[offset+i]; - } - - if( serial_transaction() ) { -#ifndef DISABLE_PROMICRO_LEDs - // turn on the indicator led when halves are disconnected - writePinLow(D5); -#endif - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { -#ifndef DISABLE_PROMICRO_LEDs - // turn off the indicator led on no error - writePinHigh(D5); -#endif - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/dm9records/ergoinu/post_rules.mk b/keyboards/dm9records/ergoinu/post_rules.mk deleted file mode 100644 index 02aa48104c19..000000000000 --- a/keyboards/dm9records/ergoinu/post_rules.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifneq ($(strip $(ERGOINU)),) - ifeq ($(findstring promicroled, $(ERGOINU)), promicroled) - DISABLE_PROMICRO_LEDs = no - endif -endif - -ifeq ($(strip $(DISABLE_PROMICRO_LEDs)), yes) - OPT_DEFS += -DDISABLE_PROMICRO_LEDs -endif diff --git a/keyboards/dm9records/ergoinu/readme.md b/keyboards/dm9records/ergoinu/readme.md index de0a1c6c9706..45f91dbac24e 100644 --- a/keyboards/dm9records/ergoinu/readme.md +++ b/keyboards/dm9records/ergoinu/readme.md @@ -1,13 +1,12 @@ -ErgoInu -=== +# ErgoInu ![ergoinu](https://i.imgur.com/4CCM8Vl.jpg) An (Not Portable But Small) Ergonomic Split Keyboard. -Keyboard Maintainer: [hsgw](https://github.com/hsgw/) [twitter](https://twitter.com/hsgw) -Hardware Supported: Pro Micro -Hardware Availability & Repository: [https://github.com/hsgw/ergoinu](https://github.com/hsgw/ergoinu) +* Keyboard Maintainer: [hsgw](https://github.com/hsgw/) [twitter](https://twitter.com/hsgw) +* Hardware Supported: Pro Micro +* Hardware Availability & Repository: [https://github.com/hsgw/ergoinu](https://github.com/hsgw/ergoinu) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/dm9records/ergoinu/rules.mk b/keyboards/dm9records/ergoinu/rules.mk index 0a634ee79450..aba3644c9ed7 100644 --- a/keyboards/dm9records/ergoinu/rules.mk +++ b/keyboards/dm9records/ergoinu/rules.mk @@ -7,20 +7,14 @@ BOOTLOADER = caterina # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = no # Audio control and System control +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = no -USE_I2C = no # i2c is not supported -CUSTOM_MATRIX = yes -SRC += matrix.c serial.c split_util.c - -# ergoinu configs -DISABLE_PROMICRO_LEDs = yes +SPLIT_KEYBOARD = yes diff --git a/keyboards/dm9records/ergoinu/serial.c b/keyboards/dm9records/ergoinu/serial.c deleted file mode 100644 index 591941587789..000000000000 --- a/keyboards/dm9records/ergoinu/serial.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifdef USE_SERIAL - -#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) - -// Serial pulse period in microseconds. -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 - // Very High speed - #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 1 - // High speed - #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 23 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 2 - // Middle speed - #define SERIAL_DELAY 12 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 3 - // Low speed - #define SERIAL_DELAY 24 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#elif SELECT_SERIAL_SPEED == 4 - // Very Low speed - #define SERIAL_DELAY 50 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles -#else -#error Illegal Serial Speed -#endif - - -#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) -#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) - -#define SLAVE_INT_WIDTH 1 -#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_delay_half1(void) { - _delay_us(SERIAL_DELAY_HALF1); -} - -inline static -void serial_delay_half2(void) { - _delay_us(SERIAL_DELAY_HALF2); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input_with_pullup(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input_with_pullup(); - -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); -#else - #error unknown SERIAL_PIN_MASK value -#endif -} - -// Used by the sender to synchronize timing with the reciver. -static -void sync_recv(void) { - for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { - } - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); -} - -// Used by the reciver to send a synchronization signal to the sender. -static -void sync_send(void) { - serial_low(); - serial_delay(); - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - _delay_sub_us(READ_WRITE_START_ADJUST); - for ( uint8_t i = 0; i < 8; ++i) { - serial_delay_half1(); // read the middle of pulses - byte = (byte << 1) | serial_read_pin(); - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); - } - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 1<<7; - while( b ) { - if(data & b) { - serial_high(); - } else { - serial_low(); - } - b >>= 1; - serial_delay(); - } - serial_low(); // sync_send() / senc_recv() need raise edge -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - serial_output(); - - // slave send phase - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - sync_send(); - serial_write_byte(serial_slave_buffer[i]); - checksum += serial_slave_buffer[i]; - } - sync_send(); - serial_write_byte(checksum); - - // slave switch to input - sync_send(); //0 - serial_delay_half1(); //1 - serial_low(); //2 - serial_input_with_pullup(); //2 - serial_delay_half1(); //3 - - // slave recive phase - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - sync_recv(); - serial_master_buffer[i] = serial_read_byte(); - checksum_computed += serial_master_buffer[i]; - } - sync_recv(); - uint8_t checksum_received = serial_read_byte(); - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } - - sync_recv(); //weit master output to high -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -// 2 => checksum error -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(SLAVE_INT_WIDTH); - - // wait for the slaves response - serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - sei(); - return 1; - } - - // master recive phase - // if the slave is present syncronize with it - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - sync_recv(); - serial_slave_buffer[i] = serial_read_byte(); - checksum_computed += serial_slave_buffer[i]; - } - sync_recv(); - uint8_t checksum_received = serial_read_byte(); - - if (checksum_computed != checksum_received) { - serial_output(); - serial_high(); - sei(); - return 2; - } - - // master switch to output - sync_recv(); //0 - serial_delay(); //1 - serial_low(); //3 - serial_output(); // 3 - serial_delay_half1(); //4 - - // master send phase - uint8_t checksum = 0; - - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - sync_send(); - serial_write_byte(serial_master_buffer[i]); - checksum += serial_master_buffer[i]; - } - sync_send(); - serial_write_byte(checksum); - - // always, release the line when not in use - sync_send(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/dm9records/ergoinu/serial.h b/keyboards/dm9records/ergoinu/serial.h deleted file mode 100644 index 67cf06ac6b81..000000000000 --- a/keyboards/dm9records/ergoinu/serial.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -// //////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h -// //////////////////////////////////////////// -// ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); diff --git a/keyboards/dm9records/ergoinu/serial_config.h b/keyboards/dm9records/ergoinu/serial_config.h deleted file mode 100644 index a16db684ca8f..000000000000 --- a/keyboards/dm9records/ergoinu/serial_config.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -/* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/dm9records/ergoinu/split_util.c b/keyboards/dm9records/ergoinu/split_util.c deleted file mode 100644 index 0cbc2c69c46a..000000000000 --- a/keyboards/dm9records/ergoinu/split_util.c +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" - -#include "serial.h" - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { - serial_master_init(); -} - -static void keyboard_slave_setup(void) { - serial_slave_init(); -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); diff --git a/keyboards/bkf/bkf.c b/keyboards/drhigsby/bkf/bkf.c similarity index 100% rename from keyboards/bkf/bkf.c rename to keyboards/drhigsby/bkf/bkf.c diff --git a/keyboards/bkf/bkf.h b/keyboards/drhigsby/bkf/bkf.h similarity index 100% rename from keyboards/bkf/bkf.h rename to keyboards/drhigsby/bkf/bkf.h diff --git a/keyboards/bkf/config.h b/keyboards/drhigsby/bkf/config.h similarity index 100% rename from keyboards/bkf/config.h rename to keyboards/drhigsby/bkf/config.h diff --git a/keyboards/bkf/info.json b/keyboards/drhigsby/bkf/info.json similarity index 100% rename from keyboards/bkf/info.json rename to keyboards/drhigsby/bkf/info.json diff --git a/keyboards/bkf/keymaps/default/keymap.c b/keyboards/drhigsby/bkf/keymaps/default/keymap.c similarity index 100% rename from keyboards/bkf/keymaps/default/keymap.c rename to keyboards/drhigsby/bkf/keymaps/default/keymap.c diff --git a/keyboards/bkf/keymaps/default/readme.md b/keyboards/drhigsby/bkf/keymaps/default/readme.md similarity index 100% rename from keyboards/bkf/keymaps/default/readme.md rename to keyboards/drhigsby/bkf/keymaps/default/readme.md diff --git a/keyboards/bkf/readme.md b/keyboards/drhigsby/bkf/readme.md similarity index 94% rename from keyboards/bkf/readme.md rename to keyboards/drhigsby/bkf/readme.md index d55f9637eefd..18742920a495 100644 --- a/keyboards/bkf/readme.md +++ b/keyboards/drhigsby/bkf/readme.md @@ -10,12 +10,12 @@ BKF, Base Kit Forty, is a 40% style keyboard that is fully compatbile with a sta Make example for this keyboard (after setting up your build environment): - make bkf:default + make drhigsby/bkf:default To place this keyboard into bootloader mode, press the reset button on the PCB or short the RST and GND pins on the pro micro. Flashing example for this keyboard: - make bkf:default:flash + make drhigsby/bkf: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/bkf/rules.mk b/keyboards/drhigsby/bkf/rules.mk similarity index 100% rename from keyboards/bkf/rules.mk rename to keyboards/drhigsby/bkf/rules.mk diff --git a/keyboards/dubba175/config.h b/keyboards/drhigsby/dubba175/config.h similarity index 100% rename from keyboards/dubba175/config.h rename to keyboards/drhigsby/dubba175/config.h diff --git a/keyboards/dubba175/dubba175.c b/keyboards/drhigsby/dubba175/dubba175.c similarity index 100% rename from keyboards/dubba175/dubba175.c rename to keyboards/drhigsby/dubba175/dubba175.c diff --git a/keyboards/dubba175/dubba175.h b/keyboards/drhigsby/dubba175/dubba175.h similarity index 100% rename from keyboards/dubba175/dubba175.h rename to keyboards/drhigsby/dubba175/dubba175.h diff --git a/keyboards/dubba175/info.json b/keyboards/drhigsby/dubba175/info.json similarity index 100% rename from keyboards/dubba175/info.json rename to keyboards/drhigsby/dubba175/info.json diff --git a/keyboards/dubba175/keymaps/default/config.h b/keyboards/drhigsby/dubba175/keymaps/default/config.h similarity index 100% rename from keyboards/dubba175/keymaps/default/config.h rename to keyboards/drhigsby/dubba175/keymaps/default/config.h diff --git a/keyboards/dubba175/keymaps/default/keymap.c b/keyboards/drhigsby/dubba175/keymaps/default/keymap.c similarity index 100% rename from keyboards/dubba175/keymaps/default/keymap.c rename to keyboards/drhigsby/dubba175/keymaps/default/keymap.c diff --git a/keyboards/dubba175/keymaps/default/readme.md b/keyboards/drhigsby/dubba175/keymaps/default/readme.md similarity index 100% rename from keyboards/dubba175/keymaps/default/readme.md rename to keyboards/drhigsby/dubba175/keymaps/default/readme.md diff --git a/keyboards/adalyn/keymaps/default/rules.mk b/keyboards/drhigsby/dubba175/keymaps/default/rules.mk similarity index 100% rename from keyboards/adalyn/keymaps/default/rules.mk rename to keyboards/drhigsby/dubba175/keymaps/default/rules.mk diff --git a/keyboards/dubba175/readme.md b/keyboards/drhigsby/dubba175/readme.md similarity index 95% rename from keyboards/dubba175/readme.md rename to keyboards/drhigsby/dubba175/readme.md index f8f1459236b6..a07da251ab9c 100644 --- a/keyboards/dubba175/readme.md +++ b/keyboards/drhigsby/dubba175/readme.md @@ -10,6 +10,6 @@ Dubba175 is a 10u wide ortholinear keyboard featuring 2x 1.75u spacebars as the Make example for this keyboard (after setting up your build environment): - make dubba175:default + make drhigsby/dubba175: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/dubba175/rules.mk b/keyboards/drhigsby/dubba175/rules.mk similarity index 100% rename from keyboards/dubba175/rules.mk rename to keyboards/drhigsby/dubba175/rules.mk diff --git a/keyboards/ogurec/config.h b/keyboards/drhigsby/ogurec/config.h similarity index 100% rename from keyboards/ogurec/config.h rename to keyboards/drhigsby/ogurec/config.h diff --git a/keyboards/ogurec/info.json b/keyboards/drhigsby/ogurec/info.json similarity index 100% rename from keyboards/ogurec/info.json rename to keyboards/drhigsby/ogurec/info.json diff --git a/keyboards/ogurec/keymaps/dack/config.h b/keyboards/drhigsby/ogurec/keymaps/dack/config.h similarity index 100% rename from keyboards/ogurec/keymaps/dack/config.h rename to keyboards/drhigsby/ogurec/keymaps/dack/config.h diff --git a/keyboards/ogurec/keymaps/dack/keymap.c b/keyboards/drhigsby/ogurec/keymaps/dack/keymap.c similarity index 100% rename from keyboards/ogurec/keymaps/dack/keymap.c rename to keyboards/drhigsby/ogurec/keymaps/dack/keymap.c diff --git a/keyboards/ogurec/keymaps/dack/readme.md b/keyboards/drhigsby/ogurec/keymaps/dack/readme.md similarity index 100% rename from keyboards/ogurec/keymaps/dack/readme.md rename to keyboards/drhigsby/ogurec/keymaps/dack/readme.md diff --git a/keyboards/ogurec/keymaps/default/config.h b/keyboards/drhigsby/ogurec/keymaps/default/config.h similarity index 100% rename from keyboards/ogurec/keymaps/default/config.h rename to keyboards/drhigsby/ogurec/keymaps/default/config.h diff --git a/keyboards/ogurec/keymaps/default/keymap.c b/keyboards/drhigsby/ogurec/keymaps/default/keymap.c similarity index 100% rename from keyboards/ogurec/keymaps/default/keymap.c rename to keyboards/drhigsby/ogurec/keymaps/default/keymap.c diff --git a/keyboards/ogurec/keymaps/default/readme.md b/keyboards/drhigsby/ogurec/keymaps/default/readme.md similarity index 100% rename from keyboards/ogurec/keymaps/default/readme.md rename to keyboards/drhigsby/ogurec/keymaps/default/readme.md diff --git a/keyboards/dubba175/keymaps/default/rules.mk b/keyboards/drhigsby/ogurec/keymaps/default/rules.mk similarity index 100% rename from keyboards/dubba175/keymaps/default/rules.mk rename to keyboards/drhigsby/ogurec/keymaps/default/rules.mk diff --git a/keyboards/ogurec/left_pm/left_pm.h b/keyboards/drhigsby/ogurec/left_pm/left_pm.h similarity index 100% rename from keyboards/ogurec/left_pm/left_pm.h rename to keyboards/drhigsby/ogurec/left_pm/left_pm.h diff --git a/keyboards/ogurec/left_pm/readme.md b/keyboards/drhigsby/ogurec/left_pm/readme.md similarity index 100% rename from keyboards/ogurec/left_pm/readme.md rename to keyboards/drhigsby/ogurec/left_pm/readme.md diff --git a/keyboards/infinity60/rev1/rules.mk b/keyboards/drhigsby/ogurec/left_pm/rules.mk similarity index 100% rename from keyboards/infinity60/rev1/rules.mk rename to keyboards/drhigsby/ogurec/left_pm/rules.mk diff --git a/keyboards/ogurec/ogurec.c b/keyboards/drhigsby/ogurec/ogurec.c similarity index 100% rename from keyboards/ogurec/ogurec.c rename to keyboards/drhigsby/ogurec/ogurec.c diff --git a/keyboards/ogurec/ogurec.h b/keyboards/drhigsby/ogurec/ogurec.h similarity index 89% rename from keyboards/ogurec/ogurec.h rename to keyboards/drhigsby/ogurec/ogurec.h index 53956aa586e6..154d5d6cfef1 100644 --- a/keyboards/ogurec/ogurec.h +++ b/keyboards/drhigsby/ogurec/ogurec.h @@ -17,8 +17,8 @@ #include "quantum.h" -#if defined(KEYBOARD_ogurec_left_pm) +#if defined(KEYBOARD_drhigsby_ogurec_left_pm) # include "left_pm.h" -#elif defined(KEYBOARD_ogurec_right_pm) +#elif defined(KEYBOARD_drhigsby_ogurec_right_pm) # include "right_pm.h" #endif diff --git a/keyboards/ogurec/readme.md b/keyboards/drhigsby/ogurec/readme.md similarity index 87% rename from keyboards/ogurec/readme.md rename to keyboards/drhigsby/ogurec/readme.md index 3e0ae153faf0..909db6787e8a 100644 --- a/keyboards/ogurec/readme.md +++ b/keyboards/drhigsby/ogurec/readme.md @@ -14,14 +14,14 @@ When flashing ogurec with the PM soldered onto the right side, follow the second Make example for this keyboard (after setting up your build environment): - make ogurec:default - make ogurec/right_pm:default + make drhigsby/ogurec:default + make drhigsby/ogurec/right_pm:default To place the keyboard into bootloader mode, solder a reset switch onto the PCB and press it OR short the GND and RST pins on the pro micro. Flashing example for this keyboard: - make ogurec:default:flash - make ogurec/right_pm:default:flash + make drhigsby/ogurec:default:flash + make drhigsby/ogurec/right_pm: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/ogurec/right_pm/readme.md b/keyboards/drhigsby/ogurec/right_pm/readme.md similarity index 100% rename from keyboards/ogurec/right_pm/readme.md rename to keyboards/drhigsby/ogurec/right_pm/readme.md diff --git a/keyboards/ogurec/right_pm/right_pm.h b/keyboards/drhigsby/ogurec/right_pm/right_pm.h similarity index 100% rename from keyboards/ogurec/right_pm/right_pm.h rename to keyboards/drhigsby/ogurec/right_pm/right_pm.h diff --git a/keyboards/ivy/rev1/rules.mk b/keyboards/drhigsby/ogurec/right_pm/rules.mk similarity index 100% rename from keyboards/ivy/rev1/rules.mk rename to keyboards/drhigsby/ogurec/right_pm/rules.mk diff --git a/keyboards/ogurec/rules.mk b/keyboards/drhigsby/ogurec/rules.mk similarity index 93% rename from keyboards/ogurec/rules.mk rename to keyboards/drhigsby/ogurec/rules.mk index cf372ceb7e80..11587edf86e8 100644 --- a/keyboards/ogurec/rules.mk +++ b/keyboards/drhigsby/ogurec/rules.mk @@ -16,4 +16,4 @@ NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -DEFAULT_FOLDER = ogurec/left_pm +DEFAULT_FOLDER = drhigsby/ogurec/left_pm diff --git a/keyboards/packrat/config.h b/keyboards/drhigsby/packrat/config.h similarity index 100% rename from keyboards/packrat/config.h rename to keyboards/drhigsby/packrat/config.h diff --git a/keyboards/packrat/info.json b/keyboards/drhigsby/packrat/info.json similarity index 100% rename from keyboards/packrat/info.json rename to keyboards/drhigsby/packrat/info.json diff --git a/keyboards/packrat/keymaps/3uc/config.h b/keyboards/drhigsby/packrat/keymaps/3uc/config.h similarity index 100% rename from keyboards/packrat/keymaps/3uc/config.h rename to keyboards/drhigsby/packrat/keymaps/3uc/config.h diff --git a/keyboards/packrat/keymaps/3uc/keymap.c b/keyboards/drhigsby/packrat/keymaps/3uc/keymap.c similarity index 100% rename from keyboards/packrat/keymaps/3uc/keymap.c rename to keyboards/drhigsby/packrat/keymaps/3uc/keymap.c diff --git a/keyboards/packrat/keymaps/3uc/readme.md b/keyboards/drhigsby/packrat/keymaps/3uc/readme.md similarity index 100% rename from keyboards/packrat/keymaps/3uc/readme.md rename to keyboards/drhigsby/packrat/keymaps/3uc/readme.md diff --git a/keyboards/eggman/keymaps/default/rules.mk b/keyboards/drhigsby/packrat/keymaps/3uc/rules.mk similarity index 100% rename from keyboards/eggman/keymaps/default/rules.mk rename to keyboards/drhigsby/packrat/keymaps/3uc/rules.mk diff --git a/keyboards/packrat/keymaps/default/config.h b/keyboards/drhigsby/packrat/keymaps/default/config.h similarity index 100% rename from keyboards/packrat/keymaps/default/config.h rename to keyboards/drhigsby/packrat/keymaps/default/config.h diff --git a/keyboards/packrat/keymaps/default/keymap.c b/keyboards/drhigsby/packrat/keymaps/default/keymap.c similarity index 100% rename from keyboards/packrat/keymaps/default/keymap.c rename to keyboards/drhigsby/packrat/keymaps/default/keymap.c diff --git a/keyboards/packrat/keymaps/default/readme.md b/keyboards/drhigsby/packrat/keymaps/default/readme.md similarity index 100% rename from keyboards/packrat/keymaps/default/readme.md rename to keyboards/drhigsby/packrat/keymaps/default/readme.md diff --git a/keyboards/id80/ansi/keymaps/msf/rules.mk b/keyboards/drhigsby/packrat/keymaps/default/rules.mk similarity index 100% rename from keyboards/id80/ansi/keymaps/msf/rules.mk rename to keyboards/drhigsby/packrat/keymaps/default/rules.mk diff --git a/keyboards/packrat/packrat.c b/keyboards/drhigsby/packrat/packrat.c similarity index 100% rename from keyboards/packrat/packrat.c rename to keyboards/drhigsby/packrat/packrat.c diff --git a/keyboards/packrat/packrat.h b/keyboards/drhigsby/packrat/packrat.h similarity index 100% rename from keyboards/packrat/packrat.h rename to keyboards/drhigsby/packrat/packrat.h diff --git a/keyboards/packrat/readme.md b/keyboards/drhigsby/packrat/readme.md similarity index 97% rename from keyboards/packrat/readme.md rename to keyboards/drhigsby/packrat/readme.md index a53377f870a3..98b12543dcf0 100644 --- a/keyboards/packrat/readme.md +++ b/keyboards/drhigsby/packrat/readme.md @@ -12,7 +12,7 @@ Packrat is an 11u wide ortholinear keyboard featuring multiple bottom row option Make example for this keyboard (after setting up your build environment): - make packrat:default + make drhigsby/packrat: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/packrat/rules.mk b/keyboards/drhigsby/packrat/rules.mk similarity index 100% rename from keyboards/packrat/rules.mk rename to keyboards/drhigsby/packrat/rules.mk diff --git a/keyboards/dtisaac/cg108/rules.mk b/keyboards/dtisaac/cg108/rules.mk index 5786064c5634..e0403a960b51 100644 --- a/keyboards/dtisaac/cg108/rules.mk +++ b/keyboards/dtisaac/cg108/rules.mk @@ -15,5 +15,4 @@ COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output diff --git a/keyboards/dtisaac/dosa40rgb/readme.md b/keyboards/dtisaac/dosa40rgb/readme.md index 5f288c6b760e..a2995a5c0f76 100644 --- a/keyboards/dtisaac/dosa40rgb/readme.md +++ b/keyboards/dtisaac/dosa40rgb/readme.md @@ -5,7 +5,7 @@ A 40 percent keyboard dosa40rgb Bluetooth Low Energy * Keyboard Maintainer: [DTIsaac](https://github.com/daotakisaac) -* Hardware Supported: ATmega32U4 + AdafruitBLE SPI +* Hardware Supported: ATmega32U4 + Bluefruit LE SPI Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/dtisaac/dosa40rgb/rules.mk b/keyboards/dtisaac/dosa40rgb/rules.mk index 58f478a96c5b..caecba365e4e 100644 --- a/keyboards/dtisaac/dosa40rgb/rules.mk +++ b/keyboards/dtisaac/dosa40rgb/rules.mk @@ -15,10 +15,9 @@ COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes # Enable Bluetooth -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 diff --git a/keyboards/duck/jetfire/matrix.c b/keyboards/duck/jetfire/matrix.c index 2dd94a72ac0f..729fa6dd1449 100644 --- a/keyboards/duck/jetfire/matrix.c +++ b/keyboards/duck/jetfire/matrix.c @@ -116,12 +116,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/ducky/one2mini/1861st/1861st.c b/keyboards/ducky/one2mini/1861st/1861st.c new file mode 100644 index 000000000000..1c164ea70d44 --- /dev/null +++ b/keyboards/ducky/one2mini/1861st/1861st.c @@ -0,0 +1,8 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include "1861st.h" + +void bootloader_jump(void) { + // TODO: Work out how to jump to LDROM, for now just reset the board. + NVIC_SystemReset(); +} diff --git a/keyboards/ducky/one2mini/1861st/rules.mk b/keyboards/ducky/one2mini/1861st/rules.mk index 277108c8acda..a5b4708b26f4 100644 --- a/keyboards/ducky/one2mini/1861st/rules.mk +++ b/keyboards/ducky/one2mini/1861st/rules.mk @@ -1,6 +1,9 @@ MCU_FAMILY = NUMICRO MCU_SERIES = NUC123 +# Bootloader selection +BOOTLOADER = custom + # linker script to use MCU_LDSCRIPT = NUC123xD4xx0 diff --git a/keyboards/durgod/boards/DURGOD_STM32_F070/bootloader_defs.h b/keyboards/durgod/boards/DURGOD_STM32_F070/bootloader_defs.h deleted file mode 100644 index 02c48c4e6dcb..000000000000 --- a/keyboards/durgod/boards/DURGOD_STM32_F070/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here (page 175): - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/durgod/boards/DURGOD_STM32_F070/chconf.h b/keyboards/durgod/boards/DURGOD_STM32_F070/chconf.h index a7d95c51a9c2..d70f188178eb 100644 --- a/keyboards/durgod/boards/DURGOD_STM32_F070/chconf.h +++ b/keyboards/durgod/boards/DURGOD_STM32_F070/chconf.h @@ -21,7 +21,7 @@ #pragma once -#define CH_CFG_ST_FREQUENCY 10000 +#define CH_CFG_ST_FREQUENCY 1000 #define CH_CFG_ST_TIMEDELTA 0 diff --git a/keyboards/durgod/boards/DURGOD_STM32_F070/mcuconf.h b/keyboards/durgod/boards/DURGOD_STM32_F070/mcuconf.h index 6d67aa96aa9f..a24c1cee127d 100644 --- a/keyboards/durgod/boards/DURGOD_STM32_F070/mcuconf.h +++ b/keyboards/durgod/boards/DURGOD_STM32_F070/mcuconf.h @@ -85,7 +85,7 @@ */ #define STM32_GPT_USE_TIM1 FALSE #define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM3 TRUE #define STM32_GPT_USE_TIM14 FALSE #define STM32_GPT_TIM1_IRQ_PRIORITY 2 #define STM32_GPT_TIM2_IRQ_PRIORITY 2 diff --git a/keyboards/durgod/dgk6x/config.h b/keyboards/durgod/dgk6x/config.h index 92673e5c24a5..a15ed8665057 100644 --- a/keyboards/durgod/dgk6x/config.h +++ b/keyboards/durgod/dgk6x/config.h @@ -22,6 +22,9 @@ #define VENDOR_ID 0xD60D #define MANUFACTURER Hoksi Technology +#define USB_POLLING_INTERVAL_MS 1 +#define WAIT_US_TIMER GPTD3 + /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL diff --git a/keyboards/durgod/dgk6x/halconf.h b/keyboards/durgod/dgk6x/halconf.h index 1772f8e4104e..9c1c6e52805a 100644 --- a/keyboards/durgod/dgk6x/halconf.h +++ b/keyboards/durgod/dgk6x/halconf.h @@ -19,4 +19,7 @@ #ifdef RGB_MATRIX_ENABLE #define HAL_USE_I2C TRUE #endif + +#define HAL_USE_GPT TRUE + #include_next diff --git a/keyboards/durgod/dgk6x/rules.mk b/keyboards/durgod/dgk6x/rules.mk index 56c5b1ac2454..660719104da7 100644 --- a/keyboards/durgod/dgk6x/rules.mk +++ b/keyboards/durgod/dgk6x/rules.mk @@ -1,9 +1,11 @@ # MCU name # Actually F070, but close enough MCU = STM32F072 - BOARD = DURGOD_STM32_F070 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Do not put the microcontroller into power saving mode NO_SUSPEND_POWER_DOWN = yes diff --git a/keyboards/durgod/k3x0/config.h b/keyboards/durgod/k3x0/config.h index ef73a710164b..af543bb970b7 100644 --- a/keyboards/durgod/k3x0/config.h +++ b/keyboards/durgod/k3x0/config.h @@ -23,6 +23,9 @@ #define VENDOR_ID 0xD60D #define MANUFACTURER Hoksi Technology +#define USB_POLLING_INTERVAL_MS 1 +#define WAIT_US_TIMER GPTD3 + /* key matrix size (rows in specific keyboard variant) */ #define MATRIX_COLS 16 diff --git a/keyboards/durgod/k3x0/halconf.h b/keyboards/durgod/k3x0/halconf.h index fa20fe30a98e..d2a9d8c7c0b3 100644 --- a/keyboards/durgod/k3x0/halconf.h +++ b/keyboards/durgod/k3x0/halconf.h @@ -19,4 +19,6 @@ #define HAL_USE_PAL TRUE #define PAL_USE_CALLBACKS TRUE +#define HAL_USE_GPT TRUE + #include_next diff --git a/keyboards/dyz/dyz60/info.json b/keyboards/dyz/dyz60/info.json index 24ff25755418..d946f9b97ba1 100644 --- a/keyboards/dyz/dyz60/info.json +++ b/keyboards/dyz/dyz60/info.json @@ -20,7 +20,7 @@ "usb": { "vid": "0xD772", "pid": "0x000A", - "device_ver": "0x0001" + "device_version": "0.0.1" }, "layouts": { "LAYOUT_all": { diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk index 15b8ec1bafc0..e2618e52906a 100644 --- a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/rules.mk @@ -2,6 +2,6 @@ NKRO_ENABLE = yes # USB Nkey Rollover AUTO_SHIFT_ENABLE = yes # Auto Shift # VELOCIKEY_ENABLE = yes -EXTRAFLAGS += -flto +LTO_ENABLE = yes # SRC += dz60rgb.c diff --git a/keyboards/dztech/dz60rgb_wkl/v2_1/config.h b/keyboards/dztech/dz60rgb_wkl/v2_1/config.h index bfa9d8d9555d..960285b97649 100644 --- a/keyboards/dztech/dz60rgb_wkl/v2_1/config.h +++ b/keyboards/dztech/dz60rgb_wkl/v2_1/config.h @@ -86,7 +86,7 @@ # define ENABLE_RGB_MATRIX_HUE_PENDULUM # define ENABLE_RGB_MATRIX_HUE_WAVE # define ENABLE_RGB_MATRIX_PIXEL_RAIN -# define ENABLE_RGB_MATRIX_PIXEL_FLOW +// # define ENABLE_RGB_MATRIX_PIXEL_FLOW # define ENABLE_RGB_MATRIX_PIXEL_FRACTAL // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined # define ENABLE_RGB_MATRIX_TYPING_HEATMAP diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk b/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk index 24a765ab9a04..2f8ab8ecc382 100644 --- a/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk +++ b/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk @@ -2,7 +2,7 @@ DYNAMIC_MACRO_ENABLE = yes LEADER_ENABLE = yes # Firmware size Optimizations -EXTRAFLAGS += -flto +LTO_ENABLE = yes MOUSEKEY_ENABLE = no NKRO_ENABLE = no SPACE_CADET_ENABLE = no diff --git a/keyboards/edi/hardlight/mk2/rules.mk b/keyboards/edi/hardlight/mk2/rules.mk index 5ffab4a55e63..3ee5e5a9c448 100644 --- a/keyboards/edi/hardlight/mk2/rules.mk +++ b/keyboards/edi/hardlight/mk2/rules.mk @@ -2,7 +2,7 @@ MCU = STM32F072 # Bootloader selection -Bootloader = stm32-dfu +BOOTLOADER = stm32-dfu # Wildcard to allow APM32 MCU DFU_SUFFIX_ARGS = -v FFFF -p FFFF @@ -15,10 +15,7 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/standaside/config.h b/keyboards/edi/standaside/config.h similarity index 100% rename from keyboards/standaside/config.h rename to keyboards/edi/standaside/config.h diff --git a/keyboards/standaside/info.json b/keyboards/edi/standaside/info.json similarity index 100% rename from keyboards/standaside/info.json rename to keyboards/edi/standaside/info.json diff --git a/keyboards/standaside/keymaps/default/keymap.c b/keyboards/edi/standaside/keymaps/default/keymap.c similarity index 100% rename from keyboards/standaside/keymaps/default/keymap.c rename to keyboards/edi/standaside/keymaps/default/keymap.c diff --git a/keyboards/standaside/readme.md b/keyboards/edi/standaside/readme.md similarity index 94% rename from keyboards/standaside/readme.md rename to keyboards/edi/standaside/readme.md index ca1cfb2763de..51911c877d20 100644 --- a/keyboards/standaside/readme.md +++ b/keyboards/edi/standaside/readme.md @@ -10,6 +10,6 @@ Hardware Availability: Seven Store (https://store.7storm.org). Make example for this keyboard (after setting up your build environment): - make standaside:default + make edi/standaside: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). \ No newline at end of file +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/standaside/rules.mk b/keyboards/edi/standaside/rules.mk similarity index 100% rename from keyboards/standaside/rules.mk rename to keyboards/edi/standaside/rules.mk diff --git a/keyboards/standaside/standaside.c b/keyboards/edi/standaside/standaside.c similarity index 100% rename from keyboards/standaside/standaside.c rename to keyboards/edi/standaside/standaside.c diff --git a/keyboards/standaside/standaside.h b/keyboards/edi/standaside/standaside.h similarity index 100% rename from keyboards/standaside/standaside.h rename to keyboards/edi/standaside/standaside.h diff --git a/keyboards/ergodox_ez/keymaps/default_glow/rules.mk b/keyboards/ergodox_ez/keymaps/default_glow/rules.mk index 360c3c51b899..20bac4ab9ddd 100644 --- a/keyboards/ergodox_ez/keymaps/default_glow/rules.mk +++ b/keyboards/ergodox_ez/keymaps/default_glow/rules.mk @@ -1,4 +1,4 @@ RGBLIGHT_ENABLE = no RGB_MATRIX_ENABLE = yes # enable later -SRC += ../default/keymap.c +SRC += keymaps/default/keymap.c diff --git a/keyboards/ergodox_stm32/ergodox_stm32.c b/keyboards/ergodox_stm32/ergodox_stm32.c index 846c29d7a4b6..8419b40f4180 100644 --- a/keyboards/ergodox_stm32/ergodox_stm32.c +++ b/keyboards/ergodox_stm32/ergodox_stm32.c @@ -16,6 +16,11 @@ void board_init(void) { AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; } +void bootloader_jump(void) { + // This board doesn't use the "standard" stm32duino bootloader, and is resident in memory at the base location. All we can do here is reset. + NVIC_SystemReset(); +} + void matrix_init_kb(void) { // Init LED Ports diff --git a/keyboards/ergodox_stm32/matrix.c b/keyboards/ergodox_stm32/matrix.c index 383bf9790a5b..094d4a9e0f76 100644 --- a/keyboards/ergodox_stm32/matrix.c +++ b/keyboards/ergodox_stm32/matrix.c @@ -119,10 +119,6 @@ uint8_t matrix_scan(void) { return 0; } -bool matrix_is_modified(void) { - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1 << col)); diff --git a/keyboards/ergodox_stm32/rules.mk b/keyboards/ergodox_stm32/rules.mk index 3a035cee01b0..e730df82aa91 100644 --- a/keyboards/ergodox_stm32/rules.mk +++ b/keyboards/ergodox_stm32/rules.mk @@ -1,11 +1,10 @@ # MCU name MCU = STM32F103 - MCU_LDSCRIPT = stm32f103_bootloader BOARD = ST_NUCLEO64_F103RB -CFLAGS += "-Wno-error=deprecated" -EXTRAFLAGS = -O0 -g +# Bootloader selection +BOOTLOADER = custom BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite MOUSEKEY_ENABLE = no # Mouse keys diff --git a/keyboards/eternal_keypad/rules.mk b/keyboards/eternal_keypad/rules.mk index ef9b9d80de44..e0403a960b51 100644 --- a/keyboards/eternal_keypad/rules.mk +++ b/keyboards/eternal_keypad/rules.mk @@ -12,7 +12,7 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/evyd13/wasdat/config.h b/keyboards/evyd13/wasdat/config.h index 36bbd30821fa..38f9fe4bda08 100644 --- a/keyboards/evyd13/wasdat/config.h +++ b/keyboards/evyd13/wasdat/config.h @@ -41,22 +41,16 @@ along with this program. If not, see . * */ #define MATRIX_ROW_PINS { D6, D4, F6, F7, F4, F5, F0, F1 } -#define MATRIX_COL_PINS { } +#define MATRIX_COL_PINS { C7, B6, C6, B4, B5, D7, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, D3, B7, B3 } // Columns 6-12 controlled by demux #define UNUSED_PINS -/* COL2ROW, ROW2COL*/ -#define DIODE_DIRECTION ROW2COL +#define SN74X138_ADDRESS_PINS { D2, D1, D0 } // For QMK DFU #define QMK_ESC_OUTPUT D6 #define QMK_ESC_INPUT D7 #define QMK_LED B0 -/* - * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. - */ -//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 - #define LED_NUM_LOCK_PIN B2 #define LED_CAPS_LOCK_PIN B0 #define LED_SCROLL_LOCK_PIN B1 diff --git a/keyboards/evyd13/wasdat/matrix.c b/keyboards/evyd13/wasdat/matrix.c index 6dd79b53306c..c97dd8469444 100644 --- a/keyboards/evyd13/wasdat/matrix.c +++ b/keyboards/evyd13/wasdat/matrix.c @@ -14,268 +14,66 @@ 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 #include -#include "wait.h" -#include "util.h" #include "matrix.h" -#include "debounce.h" #include "quantum.h" +#include "sn74x138.h" -#ifdef DIRECT_PINS -static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; -#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -//static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -#endif - -// matrix code - -#ifdef DIRECT_PINS - -static void init_pins(void) { - for (int row = 0; row < MATRIX_ROWS; row++) { - for (int col = 0; col < MATRIX_COLS; col++) { - pin_t pin = direct_pins[row][col]; - if (pin != NO_PIN) { - setPinInputHigh(pin); - } - } - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { - matrix_row_t last_row_value = current_matrix[current_row]; - current_matrix[current_row] = 0; - - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - pin_t pin = direct_pins[current_row][col_index]; - if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); - } - } - - return (last_row_value != current_matrix[current_row]); -} - -#elif (DIODE_DIRECTION == COL2ROW) - -static void select_row(uint8_t row) { - setPinOutput(row_pins[row]); - writePinLow(row_pins[row]); -} - -static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } - -static void unselect_rows(void) { - for (uint8_t x = 0; x < MATRIX_ROWS; x++) { - setPinInputHigh(row_pins[x]); - } -} +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -static void init_pins(void) { - unselect_rows(); - for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinInputHigh(col_pins[x]); - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin_state = readPin(col_pins[col_index]); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -#elif (DIODE_DIRECTION == ROW2COL) - -/* Cols 0 - 15 - * col 0: C7 - * col 1: B6 +/* col 0: C7 + * col 1: B6 * col 2: C6 - * col 3: B4 - * col 4: B5 - * col 5: D7 - * These columns use a 74HC237D 3 to 8 bit demultiplexer. - * A0 A1 A2 - * col / pin: PD2 PD1 PD0 - * 6: 1 1 1 - * 7: 0 1 1 - * 8: 1 0 1 - * 9: 0 0 1 - * 10: 1 1 0 - * 11: 0 1 0 - * 12: 1 0 0 - * col 13: D3 - * col 14: B7 - * col 15: B3 + * col 3: B4 + * col 4: B5 + * col 5: D7 + * + * These columns use a 74HC138 3 to 8 bit demultiplexer. + * A2 A1 A0 + * col / pin: PD0 PD1 PD2 + * 6: 1 1 1 + * 7: 1 1 0 + * 8: 1 0 1 + * 9: 1 0 0 + * 10: 0 1 1 + * 11: 0 1 0 + * 12: 0 0 1 + * + * col 13: D3 + * col 14: B7 + * col 15: B3 */ static void select_col(uint8_t col) { - switch (col) { - case 0: - writePinLow(C7); - break; - case 1: - writePinLow(B6); - break; - case 2: - writePinLow(C6); - break; - case 3: - writePinLow(B4); - break; - case 4: - writePinLow(B5); - break; - case 5: - writePinLow(D7); - break; - case 6: - writePinHigh(D0); - writePinHigh(D1); - writePinHigh(D2); - break; - case 7: - writePinHigh(D0); - writePinHigh(D1); - break; - case 8: - writePinHigh(D0); - writePinHigh(D2); - break; - case 9: - writePinHigh(D0); - break; - case 10: - writePinHigh(D1); - writePinHigh(D2); - break; - case 11: - writePinHigh(D1); - break; - case 12: - writePinHigh(D2); - break; - case 13: - writePinLow(D3); - break; - case 14: - writePinLow(B7); - break; - case 15: - writePinLow(B3); - break; + if (col_pins[col] != NO_PIN) { + writePinLow(col_pins[col]); + } else { + sn74x138_set_addr(13 - col); } } static void unselect_col(uint8_t col) { - switch (col) { - case 0: - writePinHigh(C7); - break; - case 1: - writePinHigh(B6); - break; - case 2: - writePinHigh(C6); - break; - case 3: - writePinHigh(B4); - break; - case 4: - writePinHigh(B5); - break; - case 5: - writePinHigh(D7); - break; - case 6: - writePinLow(D0); - writePinLow(D1); - writePinLow(D2); - break; - case 7: - writePinLow(D0); - writePinLow(D1); - break; - case 8: - writePinLow(D0); - writePinLow(D2); - break; - case 9: - writePinLow(D0); - break; - case 10: - writePinLow(D1); - writePinLow(D2); - break; - case 11: - writePinLow(D1); - break; - case 12: - writePinLow(D2); - break; - case 13: - writePinHigh(D3); - break; - case 14: - writePinHigh(B7); - break; - case 15: - writePinHigh(B3); - break; + if (col_pins[col] != NO_PIN) { + setPinOutput(col_pins[col]); + writePinHigh(col_pins[col]); + } else { + sn74x138_set_addr(0); } } static void unselect_cols(void) { - //Native - setPinOutput(D3); - setPinOutput(D7); - writePinHigh(D3); - writePinHigh(D7); - - setPinOutput(C6); - setPinOutput(C7); - writePinHigh(C6); - writePinHigh(C7); - - setPinOutput(B3); - setPinOutput(B4); - setPinOutput(B5); - setPinOutput(B6); - setPinOutput(B7); - writePinHigh(B3); - writePinHigh(B4); - writePinHigh(B5); - writePinHigh(B6); - writePinHigh(B7); + // Native + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + if (col_pins[x] != NO_PIN) { + setPinOutput(col_pins[x]); + writePinHigh(col_pins[x]); + } + } - //Demultiplexer - setPinOutput(D0); - setPinOutput(D1); - setPinOutput(D2); - writePinLow(D0); - writePinLow(D1); - writePinLow(D2); + // Demultiplexer + sn74x138_set_addr(0); } static void init_pins(void) { @@ -288,9 +86,9 @@ static void init_pins(void) { static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { bool matrix_changed = false; - // Select col and wait for col selecton to stabilize + // Select col and wait for col selection to stabilize select_col(current_col); - wait_us(30); + matrix_io_delay(); // For each row... for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { @@ -318,27 +116,20 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) return matrix_changed; } -#endif - void matrix_init_custom(void) { // initialize key pins init_pins(); + // initialize demultiplexer + sn74x138_init(); } bool matrix_scan_custom(matrix_row_t current_matrix[]) { bool changed = false; -#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { - changed |= read_cols_on_row(current_matrix, current_row); - } -#elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { changed |= read_rows_on_col(current_matrix, current_col); } -#endif return changed; } diff --git a/keyboards/evyd13/wasdat/rules.mk b/keyboards/evyd13/wasdat/rules.mk index d9f65747fb38..bb4261a4fea4 100644 --- a/keyboards/evyd13/wasdat/rules.mk +++ b/keyboards/evyd13/wasdat/rules.mk @@ -18,6 +18,7 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = lite -SRC += matrix.c +VPATH += drivers/gpio +SRC += matrix.c sn74x138.c LAYOUTS = fullsize_ansi fullsize_iso tkl_ansi tkl_iso diff --git a/keyboards/ez_maker/directpins/promicro/info.json b/keyboards/ez_maker/directpins/promicro/info.json index 419450385ce9..264ee350c8cf 100644 --- a/keyboards/ez_maker/directpins/promicro/info.json +++ b/keyboards/ez_maker/directpins/promicro/info.json @@ -26,7 +26,7 @@ }, "processor": "atmega32u4", "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x2320", "vid": "0xFEED" }, diff --git a/keyboards/ez_maker/directpins/proton_c/info.json b/keyboards/ez_maker/directpins/proton_c/info.json index a284e5c41f60..d35fe9a90a19 100644 --- a/keyboards/ez_maker/directpins/proton_c/info.json +++ b/keyboards/ez_maker/directpins/proton_c/info.json @@ -5,6 +5,7 @@ "debounce": 5, "processor": "STM32F303", "board": "QMK_PROTON_C", + "bootloader": "stm32-dfu", "features": { "bootmagic": true, "extrakey": true, @@ -31,7 +32,7 @@ ] }, "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x2321", "vid": "0xFEED" }, diff --git a/keyboards/ez_maker/directpins/teensy_2/info.json b/keyboards/ez_maker/directpins/teensy_2/info.json index 0c8fa672a9fa..731d089322e9 100644 --- a/keyboards/ez_maker/directpins/teensy_2/info.json +++ b/keyboards/ez_maker/directpins/teensy_2/info.json @@ -28,7 +28,7 @@ ] }, "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x2322", "vid": "0xFEED" }, diff --git a/keyboards/ez_maker/directpins/teensy_2pp/info.json b/keyboards/ez_maker/directpins/teensy_2pp/info.json index 578fe1c0db12..d1aa41edd524 100644 --- a/keyboards/ez_maker/directpins/teensy_2pp/info.json +++ b/keyboards/ez_maker/directpins/teensy_2pp/info.json @@ -35,7 +35,7 @@ ] }, "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x2323", "vid": "0xFEED" }, diff --git a/keyboards/ez_maker/directpins/teensy_32/info.json b/keyboards/ez_maker/directpins/teensy_32/info.json index 207bc4fd0b6b..0a6ac5c3745b 100644 --- a/keyboards/ez_maker/directpins/teensy_32/info.json +++ b/keyboards/ez_maker/directpins/teensy_32/info.json @@ -4,6 +4,7 @@ "maintainer": "skullydazed", "debounce": 5, "processor": "MK20DX256", + "bootloader": "halfkay", "features": { "bootmagic": true, "extrakey": true, @@ -27,7 +28,7 @@ ] }, "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x2324", "vid": "0xFEED" }, diff --git a/keyboards/ez_maker/directpins/teensy_lc/info.json b/keyboards/ez_maker/directpins/teensy_lc/info.json index 8477fd0d8354..1e88239d4165 100644 --- a/keyboards/ez_maker/directpins/teensy_lc/info.json +++ b/keyboards/ez_maker/directpins/teensy_lc/info.json @@ -4,6 +4,7 @@ "maintainer": "skullydazed", "debounce": 5, "processor": "MKL26Z64", + "bootloader": "halfkay", "features": { "bootmagic": true, "extrakey": true, @@ -27,7 +28,7 @@ ] }, "usb": { - "device_ver": "0x0001", + "device_version": "0.0.1", "pid": "0x2325", "vid": "0xFEED" }, diff --git a/keyboards/forever65/info.json b/keyboards/forever65/info.json index 6cb2442a08be..b50a2cf40654 100644 --- a/keyboards/forever65/info.json +++ b/keyboards/forever65/info.json @@ -3,6 +3,7 @@ "manufacturer": "Nightingale Studios", "maintainer": "zvecr", "processor": "STM32F072", + "bootloader": "stm32-dfu", "diode_direction": "COL2ROW", "matrix_pins": { "cols": ["A3", "F1", "F0", "C15", "C14", "C13", "B11", "B10", "B2", "B1", "B0", "A7", "A5", "A6", "A4", "B5"], @@ -11,7 +12,7 @@ "usb": { "vid": "0x4E53", "pid": "0x0F65", - "device_ver": "0x0001" + "device_version": "0.0.1" }, "features": { "bootmagic": true, diff --git a/keyboards/frooastboard/nano/info.json b/keyboards/frooastboard/nano/info.json index 7c594187ebee..ae94705195c3 100644 --- a/keyboards/frooastboard/nano/info.json +++ b/keyboards/frooastboard/nano/info.json @@ -37,6 +37,6 @@ "usb": { "vid": "0x4642", "pid": "0x6F21", - "device_ver": "0x0001" + "device_version": "0.0.1" } } diff --git a/keyboards/butterstick/butterstick.c b/keyboards/gboards/butterstick/butterstick.c similarity index 100% rename from keyboards/butterstick/butterstick.c rename to keyboards/gboards/butterstick/butterstick.c diff --git a/keyboards/butterstick/butterstick.h b/keyboards/gboards/butterstick/butterstick.h similarity index 100% rename from keyboards/butterstick/butterstick.h rename to keyboards/gboards/butterstick/butterstick.h diff --git a/keyboards/butterstick/config.h b/keyboards/gboards/butterstick/config.h similarity index 100% rename from keyboards/butterstick/config.h rename to keyboards/gboards/butterstick/config.h diff --git a/keyboards/butterstick/info.json b/keyboards/gboards/butterstick/info.json similarity index 100% rename from keyboards/butterstick/info.json rename to keyboards/gboards/butterstick/info.json diff --git a/keyboards/butterstick/keymaps/default/keymap.c b/keyboards/gboards/butterstick/keymaps/default/keymap.c similarity index 100% rename from keyboards/butterstick/keymaps/default/keymap.c rename to keyboards/gboards/butterstick/keymaps/default/keymap.c diff --git a/keyboards/butterstick/keymaps/dennytom/README.md b/keyboards/gboards/butterstick/keymaps/dennytom/README.md similarity index 100% rename from keyboards/butterstick/keymaps/dennytom/README.md rename to keyboards/gboards/butterstick/keymaps/dennytom/README.md diff --git a/keyboards/butterstick/keymaps/dennytom/keymap.c b/keyboards/gboards/butterstick/keymaps/dennytom/keymap.c similarity index 100% rename from keyboards/butterstick/keymaps/dennytom/keymap.c rename to keyboards/gboards/butterstick/keymaps/dennytom/keymap.c diff --git a/keyboards/butterstick/keymaps/dennytom/keymap_def.json b/keyboards/gboards/butterstick/keymaps/dennytom/keymap_def.json similarity index 100% rename from keyboards/butterstick/keymaps/dennytom/keymap_def.json rename to keyboards/gboards/butterstick/keymaps/dennytom/keymap_def.json diff --git a/keyboards/butterstick/keymaps/dennytom/rules.mk b/keyboards/gboards/butterstick/keymaps/dennytom/rules.mk similarity index 100% rename from keyboards/butterstick/keymaps/dennytom/rules.mk rename to keyboards/gboards/butterstick/keymaps/dennytom/rules.mk diff --git a/keyboards/butterstick/readme.md b/keyboards/gboards/butterstick/readme.md similarity index 95% rename from keyboards/butterstick/readme.md rename to keyboards/gboards/butterstick/readme.md index 8bae8ba5a05f..37e9375d8859 100644 --- a/keyboards/butterstick/readme.md +++ b/keyboards/gboards/butterstick/readme.md @@ -9,6 +9,6 @@ Hardware Availability: [g Heavy Industries](https://www.gboards.ca/product/butte Make example for this keyboard (after setting up your build environment): - make butterstick:default + make gboards/butterstick: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/butterstick/rules.mk b/keyboards/gboards/butterstick/rules.mk similarity index 100% rename from keyboards/butterstick/rules.mk rename to keyboards/gboards/butterstick/rules.mk diff --git a/keyboards/butterstick/sten.c b/keyboards/gboards/butterstick/sten.c similarity index 100% rename from keyboards/butterstick/sten.c rename to keyboards/gboards/butterstick/sten.c diff --git a/keyboards/butterstick/sten.h b/keyboards/gboards/butterstick/sten.h similarity index 100% rename from keyboards/butterstick/sten.h rename to keyboards/gboards/butterstick/sten.h diff --git a/keyboards/ergotaco/config.h b/keyboards/gboards/ergotaco/config.h similarity index 100% rename from keyboards/ergotaco/config.h rename to keyboards/gboards/ergotaco/config.h diff --git a/keyboards/ergotaco/ergotaco.c b/keyboards/gboards/ergotaco/ergotaco.c similarity index 100% rename from keyboards/ergotaco/ergotaco.c rename to keyboards/gboards/ergotaco/ergotaco.c diff --git a/keyboards/ergotaco/ergotaco.h b/keyboards/gboards/ergotaco/ergotaco.h similarity index 100% rename from keyboards/ergotaco/ergotaco.h rename to keyboards/gboards/ergotaco/ergotaco.h diff --git a/keyboards/ergotaco/info.json b/keyboards/gboards/ergotaco/info.json similarity index 100% rename from keyboards/ergotaco/info.json rename to keyboards/gboards/ergotaco/info.json diff --git a/keyboards/ergotaco/keymaps/default/keymap.c b/keyboards/gboards/ergotaco/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergotaco/keymaps/default/keymap.c rename to keyboards/gboards/ergotaco/keymaps/default/keymap.c diff --git a/keyboards/ergotaco/keymaps/default/readme.md b/keyboards/gboards/ergotaco/keymaps/default/readme.md similarity index 79% rename from keyboards/ergotaco/keymaps/default/readme.md rename to keyboards/gboards/ergotaco/keymaps/default/readme.md index 653f3774eaa9..d9c7c1601f51 100644 --- a/keyboards/ergotaco/keymaps/default/readme.md +++ b/keyboards/gboards/ergotaco/keymaps/default/readme.md @@ -1,6 +1,6 @@ This is the default keymap for the ErgoTaco, Make it your own! ## Settings -To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/ergotaco/keymaps/default/rules.mk +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gboards/ergotaco/keymaps/default/rules.mk Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/ergotaco/keymaps/default/rules.mk b/keyboards/gboards/ergotaco/keymaps/default/rules.mk similarity index 100% rename from keyboards/ergotaco/keymaps/default/rules.mk rename to keyboards/gboards/ergotaco/keymaps/default/rules.mk diff --git a/keyboards/ergotaco/matrix.c b/keyboards/gboards/ergotaco/matrix.c similarity index 98% rename from keyboards/ergotaco/matrix.c rename to keyboards/gboards/ergotaco/matrix.c index e5af1c27fd75..16300a7e4fab 100644 --- a/keyboards/ergotaco/matrix.c +++ b/keyboards/gboards/ergotaco/matrix.c @@ -199,11 +199,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/ergotaco/post_rules.mk b/keyboards/gboards/ergotaco/post_rules.mk similarity index 100% rename from keyboards/ergotaco/post_rules.mk rename to keyboards/gboards/ergotaco/post_rules.mk diff --git a/keyboards/ergotaco/readme.md b/keyboards/gboards/ergotaco/readme.md similarity index 91% rename from keyboards/ergotaco/readme.md rename to keyboards/gboards/ergotaco/readme.md index 40077e2a8dca..dc9db3bb64ed 100644 --- a/keyboards/ergotaco/readme.md +++ b/keyboards/gboards/ergotaco/readme.md @@ -11,13 +11,13 @@ Hardware Availability: [gboards.ca](http://gboards.ca) ## Firmware building Clone the QMK Repo and install dfu-programmer, flash with: - make ergotaco:default:dfu + make gboards/ergotaco:default:dfu And reset your keyboard! To just test if your build system is sane, try compiling the default keymap using: - make ergotaco:default + make gboards/ergotaco: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/ergotaco/rules.mk b/keyboards/gboards/ergotaco/rules.mk similarity index 100% rename from keyboards/ergotaco/rules.mk rename to keyboards/gboards/ergotaco/rules.mk diff --git a/keyboards/georgi/config.h b/keyboards/gboards/georgi/config.h similarity index 100% rename from keyboards/georgi/config.h rename to keyboards/gboards/georgi/config.h diff --git a/keyboards/georgi/georgi.c b/keyboards/gboards/georgi/georgi.c similarity index 100% rename from keyboards/georgi/georgi.c rename to keyboards/gboards/georgi/georgi.c diff --git a/keyboards/georgi/georgi.h b/keyboards/gboards/georgi/georgi.h similarity index 100% rename from keyboards/georgi/georgi.h rename to keyboards/gboards/georgi/georgi.h diff --git a/keyboards/georgi/info.json b/keyboards/gboards/georgi/info.json similarity index 100% rename from keyboards/georgi/info.json rename to keyboards/gboards/georgi/info.json diff --git a/keyboards/georgi/keymaps/colemak-dh/keymap.c b/keyboards/gboards/georgi/keymaps/colemak-dh/keymap.c similarity index 100% rename from keyboards/georgi/keymaps/colemak-dh/keymap.c rename to keyboards/gboards/georgi/keymaps/colemak-dh/keymap.c diff --git a/keyboards/georgi/keymaps/colemak-dh/readme.md b/keyboards/gboards/georgi/keymaps/colemak-dh/readme.md similarity index 100% rename from keyboards/georgi/keymaps/colemak-dh/readme.md rename to keyboards/gboards/georgi/keymaps/colemak-dh/readme.md diff --git a/keyboards/georgi/keymaps/colemak-dh/rules.mk b/keyboards/gboards/georgi/keymaps/colemak-dh/rules.mk similarity index 100% rename from keyboards/georgi/keymaps/colemak-dh/rules.mk rename to keyboards/gboards/georgi/keymaps/colemak-dh/rules.mk diff --git a/keyboards/georgi/keymaps/default-flipped/keymap.c b/keyboards/gboards/georgi/keymaps/default-flipped/keymap.c similarity index 100% rename from keyboards/georgi/keymaps/default-flipped/keymap.c rename to keyboards/gboards/georgi/keymaps/default-flipped/keymap.c diff --git a/keyboards/georgi/keymaps/default-flipped/readme.md b/keyboards/gboards/georgi/keymaps/default-flipped/readme.md similarity index 100% rename from keyboards/georgi/keymaps/default-flipped/readme.md rename to keyboards/gboards/georgi/keymaps/default-flipped/readme.md diff --git a/keyboards/georgi/keymaps/default-flipped/rules.mk b/keyboards/gboards/georgi/keymaps/default-flipped/rules.mk similarity index 100% rename from keyboards/georgi/keymaps/default-flipped/rules.mk rename to keyboards/gboards/georgi/keymaps/default-flipped/rules.mk diff --git a/keyboards/georgi/keymaps/default/keymap.c b/keyboards/gboards/georgi/keymaps/default/keymap.c similarity index 100% rename from keyboards/georgi/keymaps/default/keymap.c rename to keyboards/gboards/georgi/keymaps/default/keymap.c diff --git a/keyboards/georgi/keymaps/default/readme.md b/keyboards/gboards/georgi/keymaps/default/readme.md similarity index 100% rename from keyboards/georgi/keymaps/default/readme.md rename to keyboards/gboards/georgi/keymaps/default/readme.md diff --git a/keyboards/georgi/keymaps/default/rules.mk b/keyboards/gboards/georgi/keymaps/default/rules.mk similarity index 100% rename from keyboards/georgi/keymaps/default/rules.mk rename to keyboards/gboards/georgi/keymaps/default/rules.mk diff --git a/keyboards/georgi/keymaps/dennytom/README.md b/keyboards/gboards/georgi/keymaps/dennytom/README.md similarity index 100% rename from keyboards/georgi/keymaps/dennytom/README.md rename to keyboards/gboards/georgi/keymaps/dennytom/README.md diff --git a/keyboards/georgi/keymaps/dennytom/keymap.c b/keyboards/gboards/georgi/keymaps/dennytom/keymap.c similarity index 100% rename from keyboards/georgi/keymaps/dennytom/keymap.c rename to keyboards/gboards/georgi/keymaps/dennytom/keymap.c diff --git a/keyboards/georgi/keymaps/dennytom/keymap_def.json b/keyboards/gboards/georgi/keymaps/dennytom/keymap_def.json similarity index 100% rename from keyboards/georgi/keymaps/dennytom/keymap_def.json rename to keyboards/gboards/georgi/keymaps/dennytom/keymap_def.json diff --git a/keyboards/georgi/keymaps/dennytom/rules.mk b/keyboards/gboards/georgi/keymaps/dennytom/rules.mk similarity index 100% rename from keyboards/georgi/keymaps/dennytom/rules.mk rename to keyboards/gboards/georgi/keymaps/dennytom/rules.mk diff --git a/keyboards/georgi/keymaps/minimal/keymap.c b/keyboards/gboards/georgi/keymaps/minimal/keymap.c similarity index 100% rename from keyboards/georgi/keymaps/minimal/keymap.c rename to keyboards/gboards/georgi/keymaps/minimal/keymap.c diff --git a/keyboards/georgi/keymaps/minimal/readme.md b/keyboards/gboards/georgi/keymaps/minimal/readme.md similarity index 100% rename from keyboards/georgi/keymaps/minimal/readme.md rename to keyboards/gboards/georgi/keymaps/minimal/readme.md diff --git a/keyboards/georgi/keymaps/minimal/rules.mk b/keyboards/gboards/georgi/keymaps/minimal/rules.mk similarity index 100% rename from keyboards/georgi/keymaps/minimal/rules.mk rename to keyboards/gboards/georgi/keymaps/minimal/rules.mk diff --git a/keyboards/georgi/keymaps/norman/keymap.c b/keyboards/gboards/georgi/keymaps/norman/keymap.c similarity index 100% rename from keyboards/georgi/keymaps/norman/keymap.c rename to keyboards/gboards/georgi/keymaps/norman/keymap.c diff --git a/keyboards/georgi/keymaps/norman/readme.md b/keyboards/gboards/georgi/keymaps/norman/readme.md similarity index 100% rename from keyboards/georgi/keymaps/norman/readme.md rename to keyboards/gboards/georgi/keymaps/norman/readme.md diff --git a/keyboards/georgi/keymaps/norman/rules.mk b/keyboards/gboards/georgi/keymaps/norman/rules.mk similarity index 100% rename from keyboards/georgi/keymaps/norman/rules.mk rename to keyboards/gboards/georgi/keymaps/norman/rules.mk diff --git a/keyboards/georgi/matrix.c b/keyboards/gboards/georgi/matrix.c similarity index 99% rename from keyboards/georgi/matrix.c rename to keyboards/gboards/georgi/matrix.c index 438412102b58..7d635ad8d74f 100644 --- a/keyboards/georgi/matrix.c +++ b/keyboards/gboards/georgi/matrix.c @@ -220,11 +220,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/georgi/readme.md b/keyboards/gboards/georgi/readme.md similarity index 80% rename from keyboards/georgi/readme.md rename to keyboards/gboards/georgi/readme.md index 247219b9345c..2ba259ab7eee 100644 --- a/keyboards/georgi/readme.md +++ b/keyboards/gboards/georgi/readme.md @@ -13,13 +13,13 @@ Hardware Availability: [gboards.ca](http://gboards.ca) ## Firmware building After cloning the QMK repo and installing dfu-programmer build and flash with. Be sure to reset your keyboard! - make georgi:default:dfu + make gboards/georgi:default:dfu To just test your build with the default keymap - make georgi:default + make gboards/georgi:default -Build options can be enabled/disabled in keyboards/georgi/keymaps/default/rules.mk . Copy the default directory and make any changes to your layout, if you think they're worth sharing submit a PR! +Build options can be enabled/disabled in keyboards/gboards/georgi/keymaps/default/rules.mk . Copy the default directory and make any changes to your layout, if you think they're worth sharing submit a PR! ## Documentation Is hosted over on [docs.gboards.ca](http://docs.gboards.ca/). Please take a look at the docs for customizing your firmware! diff --git a/keyboards/georgi/rules.mk b/keyboards/gboards/georgi/rules.mk similarity index 100% rename from keyboards/georgi/rules.mk rename to keyboards/gboards/georgi/rules.mk diff --git a/keyboards/georgi/sten.c b/keyboards/gboards/georgi/sten.c similarity index 100% rename from keyboards/georgi/sten.c rename to keyboards/gboards/georgi/sten.c diff --git a/keyboards/georgi/sten.h b/keyboards/gboards/georgi/sten.h similarity index 100% rename from keyboards/georgi/sten.h rename to keyboards/gboards/georgi/sten.h diff --git a/keyboards/gergo/config.h b/keyboards/gboards/gergo/config.h similarity index 100% rename from keyboards/gergo/config.h rename to keyboards/gboards/gergo/config.h diff --git a/keyboards/gergo/gergo.c b/keyboards/gboards/gergo/gergo.c similarity index 100% rename from keyboards/gergo/gergo.c rename to keyboards/gboards/gergo/gergo.c diff --git a/keyboards/gergo/gergo.h b/keyboards/gboards/gergo/gergo.h similarity index 100% rename from keyboards/gergo/gergo.h rename to keyboards/gboards/gergo/gergo.h diff --git a/keyboards/gergo/info.json b/keyboards/gboards/gergo/info.json similarity index 100% rename from keyboards/gergo/info.json rename to keyboards/gboards/gergo/info.json diff --git a/keyboards/gergo/keymaps/abstractkb/config.h b/keyboards/gboards/gergo/keymaps/abstractkb/config.h similarity index 100% rename from keyboards/gergo/keymaps/abstractkb/config.h rename to keyboards/gboards/gergo/keymaps/abstractkb/config.h diff --git a/keyboards/gergo/keymaps/abstractkb/keymap.c b/keyboards/gboards/gergo/keymaps/abstractkb/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/abstractkb/keymap.c rename to keyboards/gboards/gergo/keymaps/abstractkb/keymap.c diff --git a/keyboards/gergo/keymaps/abstractkb/readme.md b/keyboards/gboards/gergo/keymaps/abstractkb/readme.md similarity index 88% rename from keyboards/gergo/keymaps/abstractkb/readme.md rename to keyboards/gboards/gergo/keymaps/abstractkb/readme.md index 0b07136e89a2..863b21e8e23c 100644 --- a/keyboards/gergo/keymaps/abstractkb/readme.md +++ b/keyboards/gboards/gergo/keymaps/abstractkb/readme.md @@ -5,6 +5,6 @@ This is my personal modification to the stock gergo keymap. ## Settings -To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gboards/gergo/keymaps/default/rules.mk Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/abstractkb/rules.mk b/keyboards/gboards/gergo/keymaps/abstractkb/rules.mk similarity index 96% rename from keyboards/gergo/keymaps/abstractkb/rules.mk rename to keyboards/gboards/gergo/keymaps/abstractkb/rules.mk index b87e599734a6..4b4e56c4a047 100644 --- a/keyboards/gergo/keymaps/abstractkb/rules.mk +++ b/keyboards/gboards/gergo/keymaps/abstractkb/rules.mk @@ -27,6 +27,7 @@ ifneq ($(strip $(SCROLLSTEP)),) endif ifeq ($(strip $(BALLER)), yes) POINTING_DEVICE_ENABLE = yes + POINTING_DEVICE_DRIVER = custom OPT_DEFS += -DBALLER endif ifeq ($(strip $(DEBUG_BALLER)), yes) diff --git a/keyboards/gergo/keymaps/colemak/keymap.c b/keyboards/gboards/gergo/keymaps/colemak/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/colemak/keymap.c rename to keyboards/gboards/gergo/keymaps/colemak/keymap.c diff --git a/keyboards/gergo/keymaps/colemak/readme.md b/keyboards/gboards/gergo/keymaps/colemak/readme.md similarity index 92% rename from keyboards/gergo/keymaps/colemak/readme.md rename to keyboards/gboards/gergo/keymaps/colemak/readme.md index 1c1cc7bdea23..5cfe3b83065f 100644 --- a/keyboards/gergo/keymaps/colemak/readme.md +++ b/keyboards/gboards/gergo/keymaps/colemak/readme.md @@ -11,6 +11,6 @@ You can view this layout over at [keyboad-layout-editor.com](http://www.keyboard-layout-editor.com/#/gists/f04d6a3b0cd3db91407c51f7ba36aeb3). ## Settings -To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gboards/gergo/keymaps/default/rules.mk Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/colemak/rules.mk b/keyboards/gboards/gergo/keymaps/colemak/rules.mk similarity index 100% rename from keyboards/gergo/keymaps/colemak/rules.mk rename to keyboards/gboards/gergo/keymaps/colemak/rules.mk diff --git a/keyboards/gergo/keymaps/default/config.h b/keyboards/gboards/gergo/keymaps/default/config.h similarity index 100% rename from keyboards/gergo/keymaps/default/config.h rename to keyboards/gboards/gergo/keymaps/default/config.h diff --git a/keyboards/gergo/keymaps/default/keymap.c b/keyboards/gboards/gergo/keymaps/default/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/default/keymap.c rename to keyboards/gboards/gergo/keymaps/default/keymap.c diff --git a/keyboards/gergo/keymaps/germ/readme.md b/keyboards/gboards/gergo/keymaps/default/readme.md similarity index 90% rename from keyboards/gergo/keymaps/germ/readme.md rename to keyboards/gboards/gergo/keymaps/default/readme.md index 471a20fbdff2..8e49b2f5b06a 100644 --- a/keyboards/gergo/keymaps/germ/readme.md +++ b/keyboards/gboards/gergo/keymaps/default/readme.md @@ -5,6 +5,6 @@ This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap. ## Settings -To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gboards/gergo/keymaps/default/rules.mk Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/default/rules.mk b/keyboards/gboards/gergo/keymaps/default/rules.mk similarity index 96% rename from keyboards/gergo/keymaps/default/rules.mk rename to keyboards/gboards/gergo/keymaps/default/rules.mk index 351c5255835d..bc2b3cf43bdc 100644 --- a/keyboards/gergo/keymaps/default/rules.mk +++ b/keyboards/gboards/gergo/keymaps/default/rules.mk @@ -27,6 +27,7 @@ ifneq ($(strip $(SCROLLSTEP)),) endif ifeq ($(strip $(BALLER)), yes) POINTING_DEVICE_ENABLE = yes + POINTING_DEVICE_DRIVER = custom OPT_DEFS += -DBALLER endif ifeq ($(strip $(DEBUG_BALLER)), yes) diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gboards/gergo/keymaps/drashna/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/drashna/keymap.c rename to keyboards/gboards/gergo/keymaps/drashna/keymap.c diff --git a/keyboards/gergo/keymaps/drashna/rules.mk b/keyboards/gboards/gergo/keymaps/drashna/rules.mk similarity index 100% rename from keyboards/gergo/keymaps/drashna/rules.mk rename to keyboards/gboards/gergo/keymaps/drashna/rules.mk diff --git a/keyboards/gergo/keymaps/germ/config.h b/keyboards/gboards/gergo/keymaps/germ/config.h similarity index 100% rename from keyboards/gergo/keymaps/germ/config.h rename to keyboards/gboards/gergo/keymaps/germ/config.h diff --git a/keyboards/gergo/keymaps/germ/keymap.c b/keyboards/gboards/gergo/keymaps/germ/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/germ/keymap.c rename to keyboards/gboards/gergo/keymaps/germ/keymap.c diff --git a/keyboards/gergo/keymaps/oled/readme.md b/keyboards/gboards/gergo/keymaps/germ/readme.md similarity index 90% rename from keyboards/gergo/keymaps/oled/readme.md rename to keyboards/gboards/gergo/keymaps/germ/readme.md index 471a20fbdff2..8e49b2f5b06a 100644 --- a/keyboards/gergo/keymaps/oled/readme.md +++ b/keyboards/gboards/gergo/keymaps/germ/readme.md @@ -5,6 +5,6 @@ This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap. ## Settings -To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gboards/gergo/keymaps/default/rules.mk Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/germ/rules.mk b/keyboards/gboards/gergo/keymaps/germ/rules.mk similarity index 96% rename from keyboards/gergo/keymaps/germ/rules.mk rename to keyboards/gboards/gergo/keymaps/germ/rules.mk index badfe7bb9988..0fd941bb53dd 100644 --- a/keyboards/gergo/keymaps/germ/rules.mk +++ b/keyboards/gboards/gergo/keymaps/germ/rules.mk @@ -28,6 +28,7 @@ endif ifeq ($(strip $(BALLER)), yes) OPT_DEFS += -DBALLER POINTING_DEVICE_ENABLE = yes + POINTING_DEVICE_DRIVER = custom endif ifeq ($(strip $(DEBUG_BALLER)), yes) OPT_DEFS += -DDEBUG_BALLER diff --git a/keyboards/gergo/keymaps/gotham/config.h b/keyboards/gboards/gergo/keymaps/gotham/config.h similarity index 100% rename from keyboards/gergo/keymaps/gotham/config.h rename to keyboards/gboards/gergo/keymaps/gotham/config.h diff --git a/keyboards/gergo/keymaps/gotham/keymap.c b/keyboards/gboards/gergo/keymaps/gotham/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/gotham/keymap.c rename to keyboards/gboards/gergo/keymaps/gotham/keymap.c diff --git a/keyboards/gergo/keymaps/gotham/readme.md b/keyboards/gboards/gergo/keymaps/gotham/readme.md similarity index 100% rename from keyboards/gergo/keymaps/gotham/readme.md rename to keyboards/gboards/gergo/keymaps/gotham/readme.md diff --git a/keyboards/gergo/keymaps/gotham/rules.mk b/keyboards/gboards/gergo/keymaps/gotham/rules.mk similarity index 96% rename from keyboards/gergo/keymaps/gotham/rules.mk rename to keyboards/gboards/gergo/keymaps/gotham/rules.mk index 351c5255835d..bc2b3cf43bdc 100644 --- a/keyboards/gergo/keymaps/gotham/rules.mk +++ b/keyboards/gboards/gergo/keymaps/gotham/rules.mk @@ -27,6 +27,7 @@ ifneq ($(strip $(SCROLLSTEP)),) endif ifeq ($(strip $(BALLER)), yes) POINTING_DEVICE_ENABLE = yes + POINTING_DEVICE_DRIVER = custom OPT_DEFS += -DBALLER endif ifeq ($(strip $(DEBUG_BALLER)), yes) diff --git a/keyboards/gergo/keymaps/manna-harbour_miryoku/config.h b/keyboards/gboards/gergo/keymaps/manna-harbour_miryoku/config.h similarity index 100% rename from keyboards/gergo/keymaps/manna-harbour_miryoku/config.h rename to keyboards/gboards/gergo/keymaps/manna-harbour_miryoku/config.h diff --git a/keyboards/gergo/keymaps/manna-harbour_miryoku/keymap.c b/keyboards/gboards/gergo/keymaps/manna-harbour_miryoku/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/manna-harbour_miryoku/keymap.c rename to keyboards/gboards/gergo/keymaps/manna-harbour_miryoku/keymap.c diff --git a/keyboards/gboards/gergo/keymaps/oled/config.h b/keyboards/gboards/gergo/keymaps/oled/config.h new file mode 100644 index 000000000000..af960a1eed89 --- /dev/null +++ b/keyboards/gboards/gergo/keymaps/oled/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT +#define OLED_FONT_H "keyboards/gboards/gergo/keymaps/oled/glcdfont.c" diff --git a/keyboards/gergo/keymaps/oled/glcdfont.c b/keyboards/gboards/gergo/keymaps/oled/glcdfont.c similarity index 100% rename from keyboards/gergo/keymaps/oled/glcdfont.c rename to keyboards/gboards/gergo/keymaps/oled/glcdfont.c diff --git a/keyboards/gergo/keymaps/oled/keymap.c b/keyboards/gboards/gergo/keymaps/oled/keymap.c similarity index 100% rename from keyboards/gergo/keymaps/oled/keymap.c rename to keyboards/gboards/gergo/keymaps/oled/keymap.c diff --git a/keyboards/gergo/keymaps/default/readme.md b/keyboards/gboards/gergo/keymaps/oled/readme.md similarity index 90% rename from keyboards/gergo/keymaps/default/readme.md rename to keyboards/gboards/gergo/keymaps/oled/readme.md index 471a20fbdff2..8e49b2f5b06a 100644 --- a/keyboards/gergo/keymaps/default/readme.md +++ b/keyboards/gboards/gergo/keymaps/oled/readme.md @@ -5,6 +5,6 @@ This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap. ## Settings -To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gboards/gergo/keymaps/default/rules.mk Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/oled/rules.mk b/keyboards/gboards/gergo/keymaps/oled/rules.mk similarity index 96% rename from keyboards/gergo/keymaps/oled/rules.mk rename to keyboards/gboards/gergo/keymaps/oled/rules.mk index 63180889885e..788041671962 100644 --- a/keyboards/gergo/keymaps/oled/rules.mk +++ b/keyboards/gboards/gergo/keymaps/oled/rules.mk @@ -29,6 +29,7 @@ ifneq ($(strip $(SCROLLSTEP)),) endif ifeq ($(strip $(BALLER)), yes) POINTING_DEVICE_ENABLE = yes + POINTING_DEVICE_DRIVER = custom OPT_DEFS += -DBALLER endif ifeq ($(strip $(DEBUG_BALLER)), yes) diff --git a/keyboards/gergo/matrix.c b/keyboards/gboards/gergo/matrix.c similarity index 99% rename from keyboards/gergo/matrix.c rename to keyboards/gboards/gergo/matrix.c index 655e7293566d..443e97132bc4 100644 --- a/keyboards/gergo/matrix.c +++ b/keyboards/gboards/gergo/matrix.c @@ -273,11 +273,6 @@ uint8_t matrix_scan(void) { return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } diff --git a/keyboards/gergo/readme.md b/keyboards/gboards/gergo/readme.md similarity index 77% rename from keyboards/gergo/readme.md rename to keyboards/gboards/gergo/readme.md index 3436090b27ec..b2558e6715f4 100644 --- a/keyboards/gergo/readme.md +++ b/keyboards/gboards/gergo/readme.md @@ -13,13 +13,13 @@ Hardware Availability: [gboards.ca](http://gboards.ca) ## Firmware building After cloning the QMK repo and installing dfu-programmer build and flash with. Be sure to reset your keyboard! - make gergo:germ:dfu + make gboards/gergo:germ:dfu To just test your build with the default keymap - make gergo:germ + make gboards/gergo:germ -Gadgets and options can be enabled/disabled in keyboards/gergo/keymaps/default/rules.mk . Copy the default directory and make any changes to your layout, if you think they're worth sharing submit a PR! +Gadgets and options can be enabled/disabled in keyboards/gboards/gergo/keymaps/default/rules.mk . Copy the default directory and make any changes to your layout, if you think they're worth sharing submit a PR! 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/gergo/rules.mk b/keyboards/gboards/gergo/rules.mk similarity index 100% rename from keyboards/gergo/rules.mk rename to keyboards/gboards/gergo/rules.mk diff --git a/keyboards/gboards/gergoplex/matrix.c b/keyboards/gboards/gergoplex/matrix.c index 716390241a1d..a075b8572584 100644 --- a/keyboards/gboards/gergoplex/matrix.c +++ b/keyboards/gboards/gergoplex/matrix.c @@ -152,11 +152,6 @@ uint8_t matrix_scan(void) { return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } diff --git a/keyboards/gboards/readme.md b/keyboards/gboards/readme.md index 743bacbcc154..384b568d895a 100644 --- a/keyboards/gboards/readme.md +++ b/keyboards/gboards/readme.md @@ -22,11 +22,11 @@ multi-chords! You can browse the available combo lists in combos/ ## Engine This is the onboard chording engine for all sorts of fun shenanigans. Be aware that this currently is a bit of a QMK -replacement focused on pure chording. Take a look at the configuration in keyboards/ginny for ideas, all these dicts +replacement focused on pure chording. Take a look at the configuration in keyboards/gboards/ginny for ideas, all these dicts are stored over in dicts/ ## Installation -You will need to add the following bits to your rules.mk, refer to keyboards/ginny for a working example +You will need to add the following bits to your rules.mk, refer to keyboards/gboards/ginny for a working example `VPATH += keyboards/gboards/` And if you're using the chording engine, this as well. @@ -35,5 +35,5 @@ And if you're using the chording engine, this as well. For combos, add `#include "g/keymap_combos.h"` to keymap.c to compile your combos.def into your keymap For the chording engine, add `#include "g/keymap_engine.h"` to keymap.c compile your dicts.def into your keymap. If you -don't have a config_engine.h file for your keyboard, you will need to create it. (Once again, look at keyboards/ginny/ +don't have a config_engine.h file for your keyboard, you will need to create it. (Once again, look at keyboards/gboards/ginny/ for a example of how to do this. diff --git a/keyboards/gergo/keymaps/oled/config.h b/keyboards/gergo/keymaps/oled/config.h deleted file mode 100644 index b18608068132..000000000000 --- a/keyboards/gergo/keymaps/oled/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#define IGNORE_MOD_TAP_INTERRUPT -#define OLED_FONT_H "keyboards/gergo/keymaps/oled/glcdfont.c" diff --git a/keyboards/chimera_ergo/chimera_ergo.c b/keyboards/glenpickle/chimera_ergo/chimera_ergo.c similarity index 100% rename from keyboards/chimera_ergo/chimera_ergo.c rename to keyboards/glenpickle/chimera_ergo/chimera_ergo.c diff --git a/keyboards/chimera_ergo/chimera_ergo.h b/keyboards/glenpickle/chimera_ergo/chimera_ergo.h similarity index 100% rename from keyboards/chimera_ergo/chimera_ergo.h rename to keyboards/glenpickle/chimera_ergo/chimera_ergo.h diff --git a/keyboards/chimera_ergo/config.h b/keyboards/glenpickle/chimera_ergo/config.h similarity index 80% rename from keyboards/chimera_ergo/config.h rename to keyboards/glenpickle/chimera_ergo/config.h index 0767a218b5a2..3c0cc5c16203 100644 --- a/keyboards/chimera_ergo/config.h +++ b/keyboards/glenpickle/chimera_ergo/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/chimera_ergo/info.json b/keyboards/glenpickle/chimera_ergo/info.json similarity index 100% rename from keyboards/chimera_ergo/info.json rename to keyboards/glenpickle/chimera_ergo/info.json diff --git a/keyboards/chimera_ergo/keymaps/default/keymap.c b/keyboards/glenpickle/chimera_ergo/keymaps/default/keymap.c similarity index 100% rename from keyboards/chimera_ergo/keymaps/default/keymap.c rename to keyboards/glenpickle/chimera_ergo/keymaps/default/keymap.c diff --git a/keyboards/glenpickle/chimera_ergo/matrix.c b/keyboards/glenpickle/chimera_ergo/matrix.c new file mode 100644 index 000000000000..603ad0f38605 --- /dev/null +++ b/keyboards/glenpickle/chimera_ergo/matrix.c @@ -0,0 +1,65 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ + +#include "quantum.h" +#include "matrix.h" +#include "uart.h" + +void matrix_init_custom(void) { + uart_init(1000000); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + uint32_t timeout = 0; + bool changed = false; + + //the s character requests the RF slave to send the matrix + uart_write('s'); + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[14] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 14; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while (!uart_available()) { + timeout++; + if (timeout > 10000) { + break; + } + } + uart_data[i] = uart_read(); + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[10] == 0xE0) { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 6; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; + } + } + + return changed; +} diff --git a/keyboards/chimera_ergo/readme.md b/keyboards/glenpickle/chimera_ergo/readme.md similarity index 93% rename from keyboards/chimera_ergo/readme.md rename to keyboards/glenpickle/chimera_ergo/readme.md index 2b5d2d65c04d..4ccd039ee08d 100644 --- a/keyboards/chimera_ergo/readme.md +++ b/keyboards/glenpickle/chimera_ergo/readme.md @@ -10,7 +10,7 @@ Hardware Availability: [Gerbers](https://github.com/GlenPickle/Chimera/tree/mast Make example for this keyboard (after setting up your build environment): - make chimera_ergo:default + make glenpickle/chimera_ergo:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/glenpickle/chimera_ergo/rules.mk b/keyboards/glenpickle/chimera_ergo/rules.mk new file mode 100644 index 000000000000..8cb17361471c --- /dev/null +++ b/keyboards/glenpickle/chimera_ergo/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +CUSTOM_MATRIX = lite + +# project specific files +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/chimera_ls/chimera_ls.c b/keyboards/glenpickle/chimera_ls/chimera_ls.c similarity index 100% rename from keyboards/chimera_ls/chimera_ls.c rename to keyboards/glenpickle/chimera_ls/chimera_ls.c diff --git a/keyboards/chimera_ls/chimera_ls.h b/keyboards/glenpickle/chimera_ls/chimera_ls.h similarity index 100% rename from keyboards/chimera_ls/chimera_ls.h rename to keyboards/glenpickle/chimera_ls/chimera_ls.h diff --git a/keyboards/chimera_ls/config.h b/keyboards/glenpickle/chimera_ls/config.h similarity index 80% rename from keyboards/chimera_ls/config.h rename to keyboards/glenpickle/chimera_ls/config.h index 2eb028471d5b..ca92e1e2e416 100644 --- a/keyboards/chimera_ls/config.h +++ b/keyboards/glenpickle/chimera_ls/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/chimera_ls/info.json b/keyboards/glenpickle/chimera_ls/info.json similarity index 100% rename from keyboards/chimera_ls/info.json rename to keyboards/glenpickle/chimera_ls/info.json diff --git a/keyboards/chimera_ls/keymaps/default/keymap.c b/keyboards/glenpickle/chimera_ls/keymaps/default/keymap.c similarity index 100% rename from keyboards/chimera_ls/keymaps/default/keymap.c rename to keyboards/glenpickle/chimera_ls/keymaps/default/keymap.c diff --git a/keyboards/glenpickle/chimera_ls/matrix.c b/keyboards/glenpickle/chimera_ls/matrix.c new file mode 100644 index 000000000000..a92c3e843108 --- /dev/null +++ b/keyboards/glenpickle/chimera_ls/matrix.c @@ -0,0 +1,65 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ + +#include "quantum.h" +#include "matrix.h" +#include "uart.h" + +void matrix_init_custom(void) { + uart_init(1000000); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + uint32_t timeout = 0; + bool changed = false; + + //the s character requests the RF slave to send the matrix + uart_write('s'); + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[11] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 11; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while (!uart_available()) { + timeout++; + if (timeout > 10000) { + break; + } + } + uart_data[i] = uart_read(); + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[10] == 0xE0) { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 5; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; + } + } + + return changed; +} diff --git a/keyboards/chimera_ls/readme.md b/keyboards/glenpickle/chimera_ls/readme.md similarity index 94% rename from keyboards/chimera_ls/readme.md rename to keyboards/glenpickle/chimera_ls/readme.md index 0170dd8a8f3a..bb882b66a82c 100644 --- a/keyboards/chimera_ls/readme.md +++ b/keyboards/glenpickle/chimera_ls/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [Gerbers](https://github.com/GlenPickle/Chimera/tree/mast Make example for this keyboard (after setting up your build environment): - make chimera_ls:default + make glenpickle/chimera_ls: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/glenpickle/chimera_ls/rules.mk b/keyboards/glenpickle/chimera_ls/rules.mk new file mode 100644 index 000000000000..b7f6db5aa5a2 --- /dev/null +++ b/keyboards/glenpickle/chimera_ls/rules.mk @@ -0,0 +1,30 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +CUSTOM_MATRIX = lite + +# project specific files +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c + +LAYOUTS = ortho_4x12 + +# Disable unsupported hardware +RGBLIGHT_SUPPORTED = no +AUDIO_SUPPORTED = no +BACKLIGHT_SUPPORTED = no diff --git a/keyboards/chimera_ortho/chimera_ortho.c b/keyboards/glenpickle/chimera_ortho/chimera_ortho.c similarity index 100% rename from keyboards/chimera_ortho/chimera_ortho.c rename to keyboards/glenpickle/chimera_ortho/chimera_ortho.c diff --git a/keyboards/chimera_ortho/chimera_ortho.h b/keyboards/glenpickle/chimera_ortho/chimera_ortho.h similarity index 100% rename from keyboards/chimera_ortho/chimera_ortho.h rename to keyboards/glenpickle/chimera_ortho/chimera_ortho.h diff --git a/keyboards/chimera_ortho/config.h b/keyboards/glenpickle/chimera_ortho/config.h similarity index 80% rename from keyboards/chimera_ortho/config.h rename to keyboards/glenpickle/chimera_ortho/config.h index 974502525c08..3d86343a67b0 100644 --- a/keyboards/chimera_ortho/config.h +++ b/keyboards/glenpickle/chimera_ortho/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/chimera_ortho/info.json b/keyboards/glenpickle/chimera_ortho/info.json similarity index 100% rename from keyboards/chimera_ortho/info.json rename to keyboards/glenpickle/chimera_ortho/info.json diff --git a/keyboards/chimera_ortho/keymaps/default/config.h b/keyboards/glenpickle/chimera_ortho/keymaps/default/config.h similarity index 100% rename from keyboards/chimera_ortho/keymaps/default/config.h rename to keyboards/glenpickle/chimera_ortho/keymaps/default/config.h diff --git a/keyboards/chimera_ortho/keymaps/default/keymap.c b/keyboards/glenpickle/chimera_ortho/keymaps/default/keymap.c similarity index 100% rename from keyboards/chimera_ortho/keymaps/default/keymap.c rename to keyboards/glenpickle/chimera_ortho/keymaps/default/keymap.c diff --git a/keyboards/glenpickle/chimera_ortho/matrix.c b/keyboards/glenpickle/chimera_ortho/matrix.c new file mode 100644 index 000000000000..a92c3e843108 --- /dev/null +++ b/keyboards/glenpickle/chimera_ortho/matrix.c @@ -0,0 +1,65 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ + +#include "quantum.h" +#include "matrix.h" +#include "uart.h" + +void matrix_init_custom(void) { + uart_init(1000000); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + uint32_t timeout = 0; + bool changed = false; + + //the s character requests the RF slave to send the matrix + uart_write('s'); + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[11] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 11; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while (!uart_available()) { + timeout++; + if (timeout > 10000) { + break; + } + } + uart_data[i] = uart_read(); + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[10] == 0xE0) { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 5; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; + } + } + + return changed; +} diff --git a/keyboards/chimera_ortho/readme.md b/keyboards/glenpickle/chimera_ortho/readme.md similarity index 93% rename from keyboards/chimera_ortho/readme.md rename to keyboards/glenpickle/chimera_ortho/readme.md index 644300f9862d..bff001d3c934 100644 --- a/keyboards/chimera_ortho/readme.md +++ b/keyboards/glenpickle/chimera_ortho/readme.md @@ -13,7 +13,7 @@ Hardware Availability: [Gerbers](https://github.com/GlenPickle/Chimera/tree/mast Make example for this keyboard (after setting up your build environment): - make chimera_ortho:default + make glenpickle/chimera_ortho:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/glenpickle/chimera_ortho/rules.mk b/keyboards/glenpickle/chimera_ortho/rules.mk new file mode 100644 index 000000000000..8cb17361471c --- /dev/null +++ b/keyboards/glenpickle/chimera_ortho/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +CUSTOM_MATRIX = lite + +# project specific files +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/chimera_ortho_plus/chimera_ortho_plus.c b/keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c similarity index 100% rename from keyboards/chimera_ortho_plus/chimera_ortho_plus.c rename to keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c diff --git a/keyboards/chimera_ortho_plus/chimera_ortho_plus.h b/keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.h similarity index 100% rename from keyboards/chimera_ortho_plus/chimera_ortho_plus.h rename to keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.h diff --git a/keyboards/chimera_ortho_plus/config.h b/keyboards/glenpickle/chimera_ortho_plus/config.h similarity index 80% rename from keyboards/chimera_ortho_plus/config.h rename to keyboards/glenpickle/chimera_ortho_plus/config.h index 4b12796e95b2..ebffb8565751 100644 --- a/keyboards/chimera_ortho_plus/config.h +++ b/keyboards/glenpickle/chimera_ortho_plus/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/chimera_ortho_plus/info.json b/keyboards/glenpickle/chimera_ortho_plus/info.json similarity index 100% rename from keyboards/chimera_ortho_plus/info.json rename to keyboards/glenpickle/chimera_ortho_plus/info.json diff --git a/keyboards/chimera_ortho_plus/keymaps/default/config.h b/keyboards/glenpickle/chimera_ortho_plus/keymaps/default/config.h similarity index 100% rename from keyboards/chimera_ortho_plus/keymaps/default/config.h rename to keyboards/glenpickle/chimera_ortho_plus/keymaps/default/config.h diff --git a/keyboards/chimera_ortho_plus/keymaps/default/keymap.c b/keyboards/glenpickle/chimera_ortho_plus/keymaps/default/keymap.c similarity index 100% rename from keyboards/chimera_ortho_plus/keymaps/default/keymap.c rename to keyboards/glenpickle/chimera_ortho_plus/keymaps/default/keymap.c diff --git a/keyboards/glenpickle/chimera_ortho_plus/matrix.c b/keyboards/glenpickle/chimera_ortho_plus/matrix.c new file mode 100644 index 000000000000..603ad0f38605 --- /dev/null +++ b/keyboards/glenpickle/chimera_ortho_plus/matrix.c @@ -0,0 +1,65 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ + +#include "quantum.h" +#include "matrix.h" +#include "uart.h" + +void matrix_init_custom(void) { + uart_init(1000000); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + uint32_t timeout = 0; + bool changed = false; + + //the s character requests the RF slave to send the matrix + uart_write('s'); + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[14] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 14; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while (!uart_available()) { + timeout++; + if (timeout > 10000) { + break; + } + } + uart_data[i] = uart_read(); + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[10] == 0xE0) { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 6; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; + } + } + + return changed; +} diff --git a/keyboards/chimera_ortho_plus/readme.md b/keyboards/glenpickle/chimera_ortho_plus/readme.md similarity index 93% rename from keyboards/chimera_ortho_plus/readme.md rename to keyboards/glenpickle/chimera_ortho_plus/readme.md index ad4cb9d392e4..259e9828324e 100644 --- a/keyboards/chimera_ortho_plus/readme.md +++ b/keyboards/glenpickle/chimera_ortho_plus/readme.md @@ -10,6 +10,6 @@ A split wireless 50% ortholinear keyboard. Make example for this keyboard (after setting up your build environment): - make chimera_ortho_plus:default + make glenpickle/chimera_ortho_plus: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/chimera_ortho_plus/rules.mk b/keyboards/glenpickle/chimera_ortho_plus/rules.mk similarity index 91% rename from keyboards/chimera_ortho_plus/rules.mk rename to keyboards/glenpickle/chimera_ortho_plus/rules.mk index e99e79c3279d..0a8a31e7dd7c 100644 --- a/keyboards/chimera_ortho_plus/rules.mk +++ b/keyboards/glenpickle/chimera_ortho_plus/rules.mk @@ -17,7 +17,8 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output UNICODE_ENABLE = yes -CUSTOM_MATRIX = yes +CUSTOM_MATRIX = lite # project specific files -SRC += matrix.c serial_uart.c +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/gmmk/pro/ansi/keymaps/cedrikl/keymap.c b/keyboards/gmmk/pro/ansi/keymaps/cedrikl/keymap.c new file mode 100644 index 000000000000..2361ab56608b --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/cedrikl/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2021 Cedrik Lussier @cedrikl +.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin + * + * 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 QMK_KEYBOARD_H +#include "rgb_matrix_map.h" +#include "cedrikl.h" + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Rotary(Mute) +// ~ 1 2 3 4 5 6 7 8 9 0 - (=) BackSpc Del +// Tab Q W E R T Y U I O P [ ] \ PgUp +// Caps A S D F G H J K L ; " Enter PgDn +// Sh_L Z X C V B N M , . ? Sh_R Up End +// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right + + + // The FN key by default maps to a momentary toggle to layer 1 to provide access to the RESET key (to put the board into bootloader mode). Without + // this mapping, you have to open the case to hit the button on the bottom of the PCB (near the USB cable attachment) while plugging in the USB + // cable to get the board into bootloader mode - definitely not fun when you're working on your QMK builds. Remove this and put it back to KC_RGUI + // if that's your preference. + // + // To put the keyboard in bootloader mode, use FN+backslash. If you accidentally put it into bootloader, you can just unplug the USB cable and + // it'll be back to normal when you plug it back in. + // + // This keyboard defaults to 6KRO instead of NKRO for compatibility reasons (some KVMs and BIOSes are incompatible with NKRO). + // Since this is, among other things, a "gaming" keyboard, a key combination to enable NKRO on the fly is provided for convenience. + // Press Fn+N to toggle between 6KRO and NKRO. This setting is persisted to the EEPROM and thus persists between restarts. + [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_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_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_RGHT + ), + + [1] = LAYOUT( + EEP_RST, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, KC_MUTE, + KC_NLCK, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_BSPC, KC_PSCR, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PSLS, KC_PAST, KC_BSLS, KC_PGUP, + KC_CAPS, RGB_VAD, RGB_TOG, RGB_VAI, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_PENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_PDOT, KC_SLSH, KC_RSFT, KC_UP, KC_INS, + KC_LCTL, KC_RGUI, KC_LALT, KC_SPC, KC_RALT, KC_NO, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; +// clang-format on + +#ifdef ENCODER_ENABLE + bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return true; + } +#endif // ENCODER_ENABLE + + +#ifdef RGB_MATRIX_ENABLE +//void set_layer_rgb(uint8_t led_min, uint8_t led_max, int layer) { +// const ledmap *l = &(ledmaps[layer]); +// +// +// +// for (int i = 0; i < DRIVER_LED_TOTAL; i++) { +// HSV hsv = { +// .h = (*l)[i][0], +// .s = (*l)[i][1], +// .v = val, +// }; +// +// if (hsv.h || hsv.s) { +// RGB rgb = hsv_to_rgb(hsv); +// RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); +// } +// } +//} + + // These shorthands are used below to set led colors on each matrix cycle + void loop_colorset(const uint8_t *indices, int array_size, const HSV target_color) { + HSV work_color = target_color; + work_color.v = rgb_matrix_get_val(); + + RGB final_color = hsv_to_rgb(work_color); + + for (int i = 0; i < array_size; i++) { + rgb_matrix_set_color(indices[i], final_color.r, final_color.g, final_color.b); // Set color A here + } + } + + // Capslock, Scroll lock and Numlock indicator on Left side lights. + void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + loop_colorset(LED_REGION_A, (sizeof(LED_REGION_A) / sizeof(LED_REGION_A[0])), hsv_cl_blue); + loop_colorset(LED_REGION_B, (sizeof(LED_REGION_B) / sizeof(LED_REGION_B[0])), hsv_cl_purple); + loop_colorset(LED_REGION_L_SIDE, (sizeof(LED_REGION_L_SIDE) / sizeof(LED_REGION_L_SIDE[0])), hsv_cl_purple); + loop_colorset(LED_REGION_R_SIDE, (sizeof(LED_REGION_R_SIDE) / sizeof(LED_REGION_R_SIDE[0])), hsv_cl_purple); + + switch(get_highest_layer(layer_state)){ // special handling per layer + case 1: //layer 1 + //rgb_matrix_set_color_all(RGB_AZURE); + loop_colorset(LED_REGION_NUMPAD, (sizeof(LED_REGION_NUMPAD) / sizeof(LED_REGION_NUMPAD[0])), hsv_cl_numpad); + loop_colorset(LED_REGION_OTHER, (sizeof(LED_REGION_OTHER) / sizeof(LED_REGION_OTHER[0])), hsv_cl_mods); + break; + default: //layer 0 + // + break; + break; + } + + HSV bad_hsv = hsv_cl_bad; + bad_hsv.v = rgb_matrix_get_val(); + RGB bad_rgb = hsv_to_rgb(bad_hsv); + led_t led_state = host_keyboard_led_state(); + + if (!led_state.num_lock) { // on if NUM lock is OFF + rgb_matrix_set_color(LED_R1, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R2, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R3, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R4, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R5, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R6, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R7, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_R8, bad_rgb.r, bad_rgb.g, bad_rgb.b); + } + if (led_state.caps_lock) { + rgb_matrix_set_color(LED_L1, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L2, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L3, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L4, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L5, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L6, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L7, bad_rgb.r, bad_rgb.g, bad_rgb.b); + rgb_matrix_set_color(LED_L8, bad_rgb.r, bad_rgb.g, bad_rgb.b); + loop_colorset(LED_REGION_CAPS, (sizeof(LED_REGION_CAPS) / sizeof(LED_REGION_CAPS[0])), hsv_cl_bad); + } + } +#endif diff --git a/keyboards/gmmk/pro/ansi/keymaps/cedrikl/rgb_matrix_map.h b/keyboards/gmmk/pro/ansi/keymaps/cedrikl/rgb_matrix_map.h new file mode 100644 index 000000000000..484f64b74c7d --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/cedrikl/rgb_matrix_map.h @@ -0,0 +1,185 @@ +/* Copyright 2021 Cedrik Lussier @cedrikl +.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin + * + * 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 . + */ + +#ifdef RGB_MATRIX_ENABLE + + // Custom RGB Colours + const HSV hsv_cl_blue = {150, 255, 255}; + const HSV hsv_cl_purple = {188, 255, 255}; + const HSV hsv_cl_numpad = {85, 255, 255}; + const HSV hsv_cl_mods = {42, 255, 255}; + const HSV hsv_cl_bad = {0, 255, 255}; + + // RGB LED locations + enum led_location_map { + LED_ESC, // 0, ESC, k13 + LED_GRV, // 1, ~, k16 + LED_TAB, // 2, Tab, k11 + LED_CAPS, // 3, Caps, k21 + LED_LSFT, // 4, Sh_L, k00 + LED_LCTL, // 5, Ct_L, k06 + LED_F1, // 6, F1, k26 + LED_1, // 7, 1, k17 + LED_Q, // 8, Q, k10 + LED_A, // 9, A, k12 + LED_Z, // 10, Z, k14 + LED_LWIN, // 11, Win_L, k90 + LED_F2, // 12, F2, k36 + LED_2, // 13, 2, k27 + LED_W, // 14, W, k20 + LED_S, // 15, S, k22 + LED_X, // 16, X, k24 + LED_LALT, // 17, Alt_L, k93 + LED_F3, // 18, F3, k31 + LED_3, // 19, 3, k37 + LED_E, // 20, E, k30 + LED_D, // 21, D, k32 + LED_C, // 22, C, k34 + LED_F4, // 23, F4, k33 + LED_4, // 24, 4, k47 + LED_R, // 25, R, k40 + LED_F, // 26, F, k42 + LED_V, // 27, V, k44 + LED_F5, // 28, F5, k07 + LED_5, // 29, 5, k46 + LED_T, // 30, T, k41 + LED_G, // 31, G, k43 + LED_B, // 32, B, k45 + LED_SPC, // 33, SPACE, k94 + LED_F6, // 34, F6, k63 + LED_6, // 35, 6, k56 + LED_Y, // 36, Y, k51 + LED_H, // 37, H, k53 + LED_N, // 38, N, k55 + LED_F7, // 39, F7, k71 + LED_7, // 40, 7, k57 + LED_U, // 41, U, k50 + LED_J, // 42, J, k52 + LED_M, // 43, M, k54 + LED_F8, // 44, F8, k76 + LED_8, // 45, 8, k67 + LED_I, // 46, I, k60 + LED_K, // 47, K, k62 + LED_COMM, // 48, ,, k64 + LED_RALT, // 49, Alt_R, k95 + LED_F9, // 50, F9, ka6 + LED_9, // 51, 9, k77 + LED_O, // 52, O, k70 + LED_L, // 53, L, k72 + LED_DOT, // 54, ., k74 + LED_FN, // 55, FN, k92 + LED_F10, // 56, F10, ka7 + LED_0, // 57, 0, k87 + LED_P, // 58, P, k80 + LED_SCLN, // 59, ;, k82 + LED_SLSH, // 60, ?, k85 + LED_F11, // 61, F11, ka3 + LED_MINS, // 62, -, k86 + LED_LBRC, // 63, [, k81 + LED_QUOT, // 64, ", k83 + LED_RCTL, // 65, Ct_R, k04 + LED_F12, // 66, F12, ka5 + LED_L1, // 67, LED, l01 + LED_R1, // 68, LED, l11 + LED_DEL, // 69, Prt, k97 -- remapped to DEL + LED_L2, // 70, LED, l02 + LED_R2, // 71, LED, l12 + LED_HOME, // 72, Del, k65 + LED_L3, // 73, LED, l03 + LED_R3, // 74, LED, l13 + LED_PGUP, // 75, PgUp, k15 + LED_L4, // 76, LED, l04 + LED_R4, // 77, LED, l14 + LED_EQL, // 78, =, k66 + LED_RGHT, // 79, Right, k05 + LED_L5, // 80, LED, l05 + LED_R5, // 81, LED, l15 + LED_END, // 82, End, k75 + LED_L6, // 83, LED, l06 + LED_R6, // 84, LED, l16 + LED_BSPC, // 85, BSpc, ka1 + LED_PGDN, // 86, PgDn, k25 + LED_L7, // 87, LED, l07 + LED_R7, // 88, LED, l17 + LED_RBRC, // 89, ], k61 + LED_RSFT, // 90, Sh_R, k91 + LED_L8, // 91, LED, l08 + LED_R8, // 92, LED, l18 + LED_BSLS, // 93, \, ka2 + LED_UP, // 94, Up, k35 + LED_LEFT, // 95, Left, k03 + LED_ENT, // 96, Enter, ka4 + LED_DOWN // 97, Down, k73 + }; + +const uint8_t LED_REGION_L_SIDE[] = {LED_L1, LED_L2, LED_L3, LED_L4, LED_L5, LED_L6, LED_L7,LED_L8}; +const uint8_t LED_REGION_R_SIDE[] = {LED_R1, LED_R2, LED_R3, LED_R4, LED_R5, LED_R6, LED_R7,LED_R8}; + + //const uint8_t LED_MATRIX[] = { + // LED_ESC, LED_F1, LED_F2, LED_F3, LED_F4, LED_F5, LED_F6, LED_F7, LED_F8, LED_F9, LED_F10, LED_F11, LED_F12, LED_DEL, + // LED_GRV, LED_1, LED_2, LED_3, LED_4, LED_5, LED_6, LED_7, LED_8, LED_9, LED_0, LED_MINS, LED_EQL, LED_BSPC, LED_HOME, + // LED_TAB, LED_Q, LED_W, LED_E, LED_R, LED_T, LED_Y, LED_U, LED_I, LED_O, LED_P, LED_LBRC, LED_RBRC, LED_BSLS, LED_PGUP, + // LED_CAPS, LED_A, LED_S, LED_D, LED_F, LED_G, LED_H, LED_J, LED_K, LED_L, LED_SCLN, LED_QUOT, LED_ENT, LED_PGDN, + // LED_LSFT, LED_Z, LED_X, LED_C, LED_V, LED_B, LED_N, LED_M, LED_COMM, LED_DOT, LED_SLSH, LED_RSFT, LED_UP, LED_END, + // LED_LCTL, LED_LWIN, LED_LALT, LED_SPC, LED_RALT, LED_FN, LED_RCTL, LED_LEFT, LED_DOWN, LED_RGHT + //}; + + const uint8_t LED_REGION_A[] = { + LED_ESC, LED_F9, LED_F10, LED_F11, LED_F12, LED_DEL, + LED_GRV, LED_1, LED_0, LED_MINS, LED_EQL, LED_BSPC, LED_HOME, + LED_TAB, LED_Q, LED_P, LED_LBRC, LED_RBRC, LED_BSLS, LED_PGUP, + LED_CAPS, LED_A, LED_SCLN, LED_QUOT, LED_ENT, LED_PGDN, + LED_LSFT, LED_Z, LED_SLSH, LED_RSFT, LED_UP, LED_END, + LED_LCTL, LED_LWIN, LED_LALT, LED_RCTL, LED_LEFT, LED_DOWN, LED_RGHT + }; + const uint8_t LED_REGION_B[] = { + LED_F1, LED_F2, LED_F3, LED_F4, LED_F5, LED_F6, LED_F7, LED_F8, + LED_2, LED_3, LED_4, LED_5, LED_6, LED_7, LED_8, LED_9, + LED_W, LED_E, LED_R, LED_T, LED_Y, LED_U, LED_I, LED_O, + LED_S, LED_D, LED_F, LED_G, LED_H, LED_J, LED_K, LED_L, + LED_X, LED_C, LED_V, LED_B, LED_N, LED_M, LED_COMM, LED_DOT, + LED_SPC, LED_RALT, LED_FN + }; + + const uint8_t LED_REGION_NUMPAD[] = { + + LED_GRV, LED_1, LED_2, LED_3, LED_4, LED_5, LED_6, LED_7, LED_8, LED_9, LED_0, LED_MINS, LED_EQL, + LED_LBRC, LED_RBRC, + LED_ENT, + LED_DOT + + }; + + const uint8_t LED_REGION_OTHER[] = { + LED_ESC, LED_DEL, + LED_HOME, + + LED_A, LED_S, LED_D, + LED_END, + LED_LWIN + }; + + const uint8_t LED_REGION_CAPS[] = { + + LED_GRV, LED_1, + LED_TAB, LED_Q, + LED_CAPS, LED_A, + LED_LSFT, + LED_LCTL + }; + +#endif diff --git a/keyboards/gmmk/pro/ansi/keymaps/cedrikl/rules.mk b/keyboards/gmmk/pro/ansi/keymaps/cedrikl/rules.mk new file mode 100644 index 000000000000..4b7ed8bf0b9b --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/cedrikl/rules.mk @@ -0,0 +1,2 @@ +IDLE_TIMEOUT_ENABLE = yes +STARTUP_NUMLOCK_ON = yes diff --git a/keyboards/gmmk/pro/iso/keymaps/vitoni/config.h b/keyboards/gmmk/pro/iso/keymaps/vitoni/config.h new file mode 100644 index 000000000000..fd8f1d6859e7 --- /dev/null +++ b/keyboards/gmmk/pro/iso/keymaps/vitoni/config.h @@ -0,0 +1,20 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#if defined(RGB_MATRIX_ENABLE) + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR + // number of milliseconds to wait until turning off RGB automatically + #define RGB_DISABLE_TIMEOUT 300000 // 300 seconds / 5 min + // start fading out before getting disabled + // fading out is timed (depending on the rgb_matrix_config.speed) to have finished before reaching RGB_DISABLE_TIMEOUT + #define RGB_DISABLE_WITH_FADE_OUT + #define RGB_DISABLE_WHEN_USB_SUSPENDED + // number of milliseconds to wait until activating RGB idle effects + #define RGB_IDLE_TIMEOUT 4500 // 4.5 seconds + // activate breathe effect when idle + #define RGB_IDLE_BREATHE + // fade in when we have been suspended + #define RGB_FADE_IN +#endif diff --git a/keyboards/gmmk/pro/iso/keymaps/vitoni/keymap.c b/keyboards/gmmk/pro/iso/keymaps/vitoni/keymap.c new file mode 100644 index 000000000000..d5b64c153ab7 --- /dev/null +++ b/keyboards/gmmk/pro/iso/keymaps/vitoni/keymap.c @@ -0,0 +1,148 @@ +// Copyright 2021 Glorious, LLC , +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#include "vitoni.h" + +enum layer_names { + _BASE, + _MOV, + _RGB +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Rotary(Mute) +// ~ 1 2 3 4 5 6 7 8 9 0 - (=) BackSpc Del +// Tab Q W E R T Y U I O P [ ] PgUp +// Caps A S D F G H J K L ; " # Enter PgDn +// Sh_L / Z X C V B N M , . ? Sh_R Up End +// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right + + + // + // This keyboard defaults to 6KRO instead of NKRO for compatibility reasons (some KVMs and BIOSes are incompatible with NKRO). + // Since this is, among other things, a "gaming" keyboard, a key combination to enable NKRO on the fly is provided for convenience. + // Press CAPS+N to toggle between 6KRO and NKRO. This setting is persisted to the EEPROM and thus persists between restarts. + [_BASE] = 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_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_DEL, + 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_PGUP, + MO(_MOV), 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_PGDN, + 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_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, TG(_RGB),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_MOV] = LAYOUT( + RESET, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MSTP, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + + [_RGB] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_SPI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, RGB_SPD, + _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI + ), + +}; +// clang-format on + +#if defined(ENCODER_ENABLE) +bool encoder_update_user(uint8_t index, bool clockwise) { + switch (get_highest_layer(layer_state)) { + case _MOV: + if (clockwise) { + tap_code16(C(KC_TAB)); + } else { + tap_code16(S(C(KC_TAB))); + } + break; +#if defined(RGB_MATRIX_ENABLE) + case _RGB: + if (clockwise) { + rgb_matrix_increase_val_noeeprom(); + } else { + rgb_matrix_decrease_val_noeeprom(); + } + break; +#endif // RGB_MATRIX_ENABLE + default: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + } + return true; +} +#endif // ENCODER_ENABLE + +#if defined(RGB_MATRIX_ENABLE) +/* +* Set up default RGB color. +*/ +void rgb_matrix_set_default_color(void) { + rgb_matrix_sethsv_noeeprom_user(HSV_CHARTREUSE); +} + +/* +* Set up RGB defaults. +*/ +void rgb_matrix_configure_default_settings(void) { + rgb_matrix_set_default_color(); +} + +void keyboard_post_init_user(void) { + rgb_matrix_enable_noeeprom(); + rgb_matrix_configure_default_settings(); +} + +/* +* Use RGB underglow to indicate specific layers. +*/ +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _MOV: + rgb_matrix_sethsv_noeeprom_user(HSV_SPRINGGREEN); + break; + case _RGB: + rgb_matrix_sethsv_noeeprom_user(HSV_GREEN); + break; + default: // for any other layer + rgb_matrix_set_default_color(); + break; + } + return state; +} + +void matrix_scan_user(void) { + matrix_scan_user_rgb(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user_rgb(keycode, record)) { + return false; + } + + switch (keycode) { + case RESET: // when activating RESET mode for flashing + if (record->event.pressed) { + rgb_matrix_set_color_all(63, 0, 0); + rgb_matrix_driver.flush(); + } + return true; + } + return true; // Process all other keycodes normally +} +#endif // RGB_MATRIX_ENABLE diff --git a/keyboards/gmmk/pro/iso/keymaps/vitoni/readme.adoc b/keyboards/gmmk/pro/iso/keymaps/vitoni/readme.adoc new file mode 100644 index 000000000000..38a74a568bf0 --- /dev/null +++ b/keyboards/gmmk/pro/iso/keymaps/vitoni/readme.adoc @@ -0,0 +1,104 @@ += ViToni's keymap for GMMK Pro ISO + +== Layout +Based on the stock layout but making use of CAPS as FN similar to laptop keyboards. +This frees up the left row for other uses (although not remapped yet). +Since both Delete and Insert are used for coding they are part of the CAPS layer as well. + +The differences are as follows: + +=== Layer 0 (`_BASE`) +Mostly stock + CAPS goes to layer `_MOV`. +FN toggles the layer `_RGB`. + +=== Layer 1 (`_MOV`), accessed by pressing `CAPS` on layer `_BASE` +[%header] +|=== +| Key / Action | Mapped to +| ESC | _RESET_ +| F1 | KC_MYCM +| F2 | KC_WHOM +| F3 | KC_CALC +| F4 | KC_MSEL +| F5 | KC_MPRV +| F6 | KC_MPLY +| F7 | KC_MSTP +| F8 | KC_MNXT +| F9 | KC_MUTE +| F10 | KC_VOLD +| F11 | KC_VOLU +| N | NK_TOGG +| Delete | Insert +| Left | Home +| Right | End +| Up | PgUp +| Down | PgDn +|=== + +=== Layer 2 (`_RGB`), accessed by pressing `FN` on layer `_BASE` +Revamped the stock FN layer to focus on RGB only. + +[%header] +|=== +| Key / Action | Mapped to +| Knob clockwise | Value/Brightness up +| Knob anti-clockwise | Value/Brightness down +| Backspace | _RESET_ +| Enter | RGB_TOG +| Del | RGB_MOD +| PgUp | RGB_RMOD +| PgDn | RGB_SPI +| End | RGB_SPD +| Left | RGB_HUD +| Right | RGB_HUI +| Up | RGB_SAI +| Down | RGB_SAD +|=== + +No other changes have been made. + +== RGB light + +The code customizing RGB light usage is decribed here: + +* link:../../../../../../users/vitoni/readme.adoc[/users/vitoni/readme.adoc] + +When using `RGB_DISABLE_TIMEOUT` addtional options are available: + +* `RGB_FADE_IN` makes the RGB lights fade in instead of setting the value/brightness to 100% (implicitly due to HSV including the brightness) when resuming after RGB lights have been turned off. +Fade in occurs when the keyboard is initialized and when the RGB brightness has been changed (e.g. suspending, fade out, etc.). +* `RGB_DISABLE_WITH_FADE_OUT` activates fade out before the keyboard is disabled by `RGB_DISABLE_TIMEOUT`. + +Parameters used to define the behavior are: +[%header] +|=== +|Key | Default | Description + +| RGB_MATRIX_MAXIMUM_BRIGHTNESS +| 200 (<= UNIT8_MAX) +| Maximum assumed value for brightness. +Used to calculate lead time for fade out before suspend timeout. + +|=== + +`RGB_IDLE_TIMEOUT` enables fading out after being idle for the defined time and allows +* `RGB_IDLE_BREATHE` also activates a brethe effect while idling. + +[%header] +|=== +|Key | Default | Description + +|RGB_IDLE_TIMEOUT +|4500 +|Time in milliseconds without activity before considered to be idle. + +|RGB_IDLE_MINIMUM_BRIGHTNESS +|`RGB_MATRIX_MAXIMUM_BRIGHTNESS` / 5 +|Brightness value RGB is dimmed to when starting to idle. + +When breathing used as the lower bound of the brightness value. + +|RGB_IDLE_MAXIMUM_BRIGHTNESS +|`RGB_MATRIX_MAXIMUM_BRIGHTNESS` * 2/5 +|Upper bound of brightness value of the RGB light while breathing. + +|=== diff --git a/keyboards/handwired/42/rules.mk b/keyboards/handwired/42/rules.mk index 5742e84bf573..655ce00befdd 100644 --- a/keyboards/handwired/42/rules.mk +++ b/keyboards/handwired/42/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk index e5abbcfb8892..a3082cf3642f 100644 --- a/keyboards/handwired/bdn9_ble/rules.mk +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = no BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/carpolly/rules.mk b/keyboards/handwired/carpolly/rules.mk index a7f3367d866a..0cc90c116072 100644 --- a/keyboards/handwired/carpolly/rules.mk +++ b/keyboards/handwired/carpolly/rules.mk @@ -15,7 +15,6 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output # generated by KBFirmware JSON to QMK Parser diff --git a/keyboards/handwired/croxsplit44/rules.mk b/keyboards/handwired/croxsplit44/rules.mk index 0b2170c45601..87f77b103aee 100644 --- a/keyboards/handwired/croxsplit44/rules.mk +++ b/keyboards/handwired/croxsplit44/rules.mk @@ -12,10 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output \ No newline at end of file +AUDIO_ENABLE = no # Audio output diff --git a/keyboards/handwired/dactyl/matrix.c b/keyboards/handwired/dactyl/matrix.c index a21cd08e1453..a70e8c5acadc 100644 --- a/keyboards/handwired/dactyl/matrix.c +++ b/keyboards/handwired/dactyl/matrix.c @@ -281,14 +281,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk index 6d2e27cb41ca..5ad63b02b703 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk @@ -1,3 +1,3 @@ KEY_LOCK_ENABLE = yes CONSOLE_ENABLE = no -EXTRAFLAGS += -flto +LTO_ENABLE = yes diff --git a/keyboards/handwired/dygma/raise/rules.mk b/keyboards/handwired/dygma/raise/rules.mk index 0fd995571556..a0120c815930 100644 --- a/keyboards/handwired/dygma/raise/rules.mk +++ b/keyboards/handwired/dygma/raise/rules.mk @@ -12,7 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = no # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/handwired/frenchdev/matrix.c b/keyboards/handwired/frenchdev/matrix.c index 5ab254a6f95a..a043f7853839 100644 --- a/keyboards/handwired/frenchdev/matrix.c +++ b/keyboards/handwired/frenchdev/matrix.c @@ -174,12 +174,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/handwired/fruity60/rules.mk b/keyboards/handwired/fruity60/rules.mk index 74628e3e6fd8..c84f68f0bf05 100644 --- a/keyboards/handwired/fruity60/rules.mk +++ b/keyboards/handwired/fruity60/rules.mk @@ -20,6 +20,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LAYOUTS = 60_tsangan_hhkb diff --git a/keyboards/handwired/hillside/0_1/info.json b/keyboards/handwired/hillside/0_1/info.json index 4505bf3e3525..8c00f70366e3 100644 --- a/keyboards/handwired/hillside/0_1/info.json +++ b/keyboards/handwired/hillside/0_1/info.json @@ -1,4 +1,14 @@ { + "manufacturer": "mmccoyd", + "maintainer": "mmccoyd", + + "keyboard_name": "Hillside", + "url": "http://github.com/mmccoyd/hillside/", + + "tags": ["split", "column stagger", "choc v1", "choc spaced" ], + + "processor": "atmega32u4", + "matrix_pins": { "rows": ["D7", "E6", "B4", "B5"], "cols": ["F6", "F7", "B1", "B3", "B2", "B6"] @@ -9,5 +19,91 @@ "vid": "0xFEED", "pid": "0x67C0", "device_ver": "0x0001" + }, + + "features": { + "encoder": true, + "extrakey": true, + "rgblight": true + }, + "split": { + "soft_serial_pin": "D2", + "main": "left" + }, + + "rgblight": { + "led_count": 5, + "pin": "D3", + "split": true, + "hue_steps": 8, + "saturation_steps": 8, + "brightness_steps": 8 + }, + + "layouts": { + "LAYOUT": { + "layout": [ + + {"label": "Tab", "x": 0, "y": 0.93}, + {"label": "Q", "x": 1, "y": 0.93}, + {"label": "W", "x": 2, "y": 0.31}, + {"label": "E", "x": 3, "y": 0}, + {"label": "R", "x": 4, "y": 0.28}, + {"label": "T", "x": 5, "y": 0.42}, + + {"label": "Y", "x": 9.5, "y": 0.42}, + {"label": "U", "x": 10.5, "y": 0.28}, + {"label": "I", "x": 11.5, "y": 0}, + {"label": "O", "x": 12.5, "y": 0.31}, + {"label": "P", "x": 13.5, "y": 0.93}, + {"label": "Backspace", "x": 14.5, "y": 0.93}, + + + {"label": "Ctrl", "x": 0, "y": 1.93}, + {"label": "A", "x": 1, "y": 1.93}, + {"label": "S", "x": 2, "y": 1.31}, + {"label": "D", "x": 3, "y": 1}, + {"label": "F", "x": 4, "y": 1.28}, + {"label": "G", "x": 5, "y": 1.42}, + + {"label": "H", "x": 9.5, "y": 1.42}, + {"label": "J", "x": 10.5, "y": 1.28}, + {"label": "K", "x": 11.5, "y": 1}, + {"label": "L", "x": 12.5, "y": 1.31}, + {"label": ";", "x": 13.5, "y": 1.93}, + {"label": "'", "x": 14.5, "y": 1.93}, + + + {"label": "Shift", "x": 0, "y": 2.93}, + {"label": "Z", "x": 1, "y": 2.93}, + {"label": "X", "x": 2, "y": 2.31}, + {"label": "C", "x": 3, "y": 2}, + {"label": "V", "x": 4, "y": 2.28}, + {"label": "B", "x": 5, "y": 2.42}, + {"label": "`", "x": 6, "y": 2.78}, + + {"label": "Esc", "x": 8.5, "y": 2.78}, + {"label": "N", "x": 9.5, "y": 2.42}, + {"label": "M", "x": 10.5, "y": 2.28}, + {"label": ",", "x": 11.5, "y": 2}, + {"label": ".", "x": 12.5, "y": 2.31}, + {"label": "/", "x": 13.5, "y": 2.93}, + {"label": "Shift", "x": 14.5, "y": 2.93}, + + + {"label": "Enter", "x": 2, "y": 3.31}, + {"label": "Gui", "x": 3.5, "y": 3.28}, + {"label": "Alt", "x": 4.5, "y": 3.42}, + {"label": "Num", "x": 5.5, "y": 3.78}, + {"label": "Nav", "x": 6.5, "y": 4.14}, + + + {"label": "Sym", "x": 8, "y": 4.14}, + {"label": "Space", "x": 9, "y": 3.78}, + {"label": "Alt", "x": 10, "y": 3.42}, + {"label": "Gui", "x": 11, "y": 3.28}, + {"label": "App", "x": 12.5, "y": 3.31} + ] + } } } diff --git a/keyboards/handwired/hillside/0_1/keymaps/default/keymap.json b/keyboards/handwired/hillside/0_1/keymaps/default/keymap.json new file mode 100644 index 000000000000..c5837a16fbd5 --- /dev/null +++ b/keyboards/handwired/hillside/0_1/keymaps/default/keymap.json @@ -0,0 +1,101 @@ +{ "version": 1, + "notes": "", + "documentation": "\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", + "keyboard": "handwired/hillside/0_1", + "keymap": "default", + "layout": "LAYOUT", + "layers": [ + ["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_CAPS", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "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_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_QUOT" + + ], + ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", + "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", + + "KC_CAPS", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", + "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_ENT", + + "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", + "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_SLSH" + + ], + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", + "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", + + "KC_CAPS", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", + "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_ENT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", + "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_QUOT" + + ], + ["KC_NO" , "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", + "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", + + "KC_NO" , "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", + "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_TRNS", + + "KC_LSFT", "LCTL(KC_Z)" , "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", + "KC_ESC" , "OSM(MOD_RALT)", "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_APP" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", + "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_RCTL" + + ], + ["KC_F11" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", + "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_TRNS", + + "KC_F12" , "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", + "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_TRNS", + + "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_PSCR", + "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_RCTL" + + ], + ["KC_TAB" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", + "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", + + "KC_NO" , "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", + "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_TRNS", + + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", + "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_RCTL" + + ], + ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "CL_SWAP" , "CL_NORM", + "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", + + "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" + + ] + ], + "author": "@mmccoyd" +} diff --git a/keyboards/handwired/hillside/keymaps/default/readme.md b/keyboards/handwired/hillside/0_1/keymaps/default/readme.md similarity index 79% rename from keyboards/handwired/hillside/keymaps/default/readme.md rename to keyboards/handwired/hillside/0_1/keymaps/default/readme.md index a982c0c380bc..ae4a5c5648ca 100644 --- a/keyboards/handwired/hillside/keymaps/default/readme.md +++ b/keyboards/handwired/hillside/0_1/keymaps/default/readme.md @@ -27,60 +27,56 @@ We've deliberately omitted some features: ``` | TAB | Q | W | E | R | T |---------------------------| Y | U | I | O | P | BKSPC | -| CTRL | A | S | D | F | G |---------------------------| H | J | K | L | ; | ' | +| CAPS | A | S | D | F | G |---------------------------| H | J | K | L | ; | ENTER | | SHIFT | Z | X | C | V | B | ~ |---------------| ESC | N | M | , | . | / | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- +--------------|CTRL |-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| ' |-------------- ``` -The base layer can be either of QWERTY, Colemak-DH or Dvorak, - with identical non-alpha and non-symbol keys. -QWERTY is the default. +The base layer provides a very standard key layout: -A standard keyboard layout is used for: - -- Tab, backspace and shift keys in the outer columns. -- Alt/option and GUI/command keys on both thumbs, with the location swappable for windows or mac. +- Return, Tab, backspace and shift keys in the outer columns. +- Alt/option and win/command keys on both thumbs, with the location swappable for windows or mac. - A space key on the right thumb. The differences from a standard layout are: - There are three additional "shift" keys to access the navigation/editing, symbol/function, and number layers. -- Enter is on the left thumb or ring finger. - This location allowed preserving the more common right-hand keys. - Feel free to swap it with the quote key or have it share the right shift key - as a mod-tap key. -- Control is in the caps lock spot. - Esc and `~ are above the thumbs. -- The rarer AltGr key is in a layer. +- The Menu and AltGr keys are on a layer. + +The default layout is QWERTY with alternatives of Dvorak and Colemak-DH +and the alt/option and win/command key locations are swappable for windows or mac.
Details of Dvorak and Colemak-DH -In the Dvorak layout, the outer home row key is the "/?" symbols +The Dvorak and Colemak-DH base layers + have identical non-alpha and non-symbol keys as the QWERTY base layer. +In the Dvorak layout, the symbol key in the bottom row is the "/?" symbols so that the same 12 symbols are taken care of on the base layer. ``` Dvorak | TAB | ' | , | . | P | Y |---------------------------| F | G | C | R | L | BKSPC | -| CTRL | A | O | E | U | I |---------------------------| D | H | T | N | S | / | +| CAPS | A | O | E | U | I |---------------------------| D | H | T | N | S | ENTER | | SHIFT | ; | Q | J | K | X | ~ |---------------| ESC | B | M | W | V | Z | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- +--------------|CTRL |-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| / |-------------- Colemak-DH | TAB | Q | W | F | P | B |---------------------------| J | L | U | Y | ; | BKSPC | -| CTRL | A | R | S | T | G |---------------------------| M | N | E | I | O | ' | +| CAPS | A | R | S | T | G |---------------------------| M | N | E | I | O | ENTER | | SHIFT | Z | X | C | D | V | ~ |---------------| ESC | K | H | , | . | / | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- +--------------|CTRL |-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| ' |-------------- ```
## Navigation, Editing and Media Layer ``` -| CAPS | INS | | | |VOL+ |---------------------------|PG_UP|HOME | | END| | DEL | -| CTRL | GUI | ALT |CTRL |SHIFT|VOL- |---------------------------|PG_DN|LEFT | UP |RIGHT| | CTRL | -| SHIFT |UNDO | CUT |COPY |PASTE|REDO |MUTE |---------------| ESC | |WORDL|DOWN |WORDR|RALT | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | *** |---| Adj |BSPC | ALT | GUI |-----| APP |-------------- +| | INS | | | |VOL+ |---------------------------|PG_UP|HOME | | END| | DEL | +| | GUI | ALT |CTRL |SHIFT|VOL- |---------------------------|PG_DN|LEFT | UP |RIGHT| | ENTER | +| SHIFT |UNDO | CUT |COPY |PASTE|REDO |MUTE |---------------| ESC |RALT |WORDL|DOWN |WORDR|MENU | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | *** |---| Adj |BSPC | ALT | GUI |-----|CTRL |-------------- ``` Holding down the Nav key accesses a navigation and editing layer: @@ -96,33 +92,33 @@ Holding down the Nav key accesses a navigation and editing layer: - The base layer modifiers and escape are in the same spots as on the base layer, and a right-hand control key is added. - Media volume and play keys are on the left, accessible with one hand. -- AltGr and caps lock fill out the layer. +- Menu and AltGr keys fill out the layer. - A few keys do nothing and are available for more user-specific needs. ## Symbol and Function Layer ``` -| F12 | ! | @ | # | $ | % |---------------------------| ^ | & | * | ( | ) | BSPC | -| CTRL | F1 | F2 | F3 | F4 | F5 |---------------------------| | |SHIFT|CTRL | ALT | GUI | CTRL | -| SHIFT | F6 | F7 | F8 | F9 | F10 | F11 |---------------| ESC | \ | [ | ] | { | } | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Adj |---| *** |SPACE| ALT | GUI |-----| APP |-------------- +| F11 | ! | @ | # | $ | % |---------------------------| ^ | & | * | ( | ) | BSPC | +| F12 | F1 | F2 | F3 | F4 | F5 |---------------------------| | |SHIFT|CTRL | ALT | GUI | ENTER | +| SHIFT | F6 | F7 | F8 | F9 | F10 |PRTSC|---------------| ESC | \ | [ | ] | { | } | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | Adj |---| *** |SPACE| ALT | GUI |-----|CTRL |-------------- ``` Holding down the Sym key accesses a layer of symbol and function keys: - The symbols usually found on the number keys are in the top row. If desired, you can use these positions for other things, as the symbols are also accessible from the number pad layer with the shift key. -- The remaining symbols appear on the right. +- Several more symbols appear on the right. - The function keys are on the left, beginning with two rows of five. - A row of modifiers in the home row allows the comfortable creation of any modifier and function key combination. - The base layer modifier and escape keys are still available, as is a right-hand control key. ## Number Pad and Algebraic Layer ``` -| | - | + | = | / | * |---------------------------| . | 7 | 8 | 9 | | BSPC | -| CTRL | GUI | ALT |CTRL |SHIFT| |---------------------------| 0 | 1 | 2 | 3 | _ | CTRL | +| TAB | - | + | = | / | * |---------------------------| . | 7 | 8 | 9 | | BSPC | +| | GUI | ALT |CTRL |SHIFT| |---------------------------| 0 | 1 | 2 | 3 | _ | ENTER | | SHIFT | | | | | | |---------------| ESC | , | 4 | 5 | 6 | | SHIFT | ---------------|ENTER|-----| GUI | ALT | *** | |---| |BSPC | ALT | GUI |-----| APP |-------------- +--------------|CTRL |-----| GUI | ALT | *** | |---| |BSPC | ALT | GUI |-----|CTRL |-------------- ``` Holding down the Num key accesses a number pad and arithmetic symbols: @@ -136,7 +132,7 @@ Holding down the Num key accesses a number pad and arithmetic symbols: ## Adjust Layer ``` | |QWERT|DVORK|COLMK|AG_SWAP|AG_NORM|-----------------------| | | | | | | -| | | | | | |---------------------------|MOD+ |BRI+ |HUE+ |SAT+ | | | +| | | | |CTR_S|CTR_N|---------------------------|MOD+ |BRI+ |HUE+ |SAT+ | | | | RESET | | | | | | |--------------|RGBTOG|MOD- |BRI- |HUE- |SAT- | | | --------------| |-----| | | | *** |---| *** | | | |-----| |-------------- ``` @@ -204,7 +200,7 @@ Or, you can use the graphical configurator to edit the keymap. To do that: - Save the keymap using the green down arrow button. - Copy those changes back into your QMK repository and reformat for easy reading using the format script: ``` -./keyboards/handwired/hillside/keymaps/json2hill.py --input /default.json > ./keyboards/handwired/hillside/keymaps/default/keymap.json +./keyboards/handwired/hillside/0_1/keymaps/json2hill.py --input /default.json > ./keyboards/handwired/hillside/0_1/keymaps/default/keymap.json ``` You may need to make that script executable with ```chmod +x```. After your keymap is safely copied and formated, you may want to remove the keymap from your download directory so later downloads will automatically receive the same file name. diff --git a/keyboards/handwired/hillside/keymaps/json2hill.py b/keyboards/handwired/hillside/0_1/keymaps/json2hill.py similarity index 100% rename from keyboards/handwired/hillside/keymaps/json2hill.py rename to keyboards/handwired/hillside/0_1/keymaps/json2hill.py diff --git a/keyboards/handwired/hillside/0_1/keymaps/via/keymap.json b/keyboards/handwired/hillside/0_1/keymaps/via/keymap.json new file mode 100644 index 000000000000..a015f0241c6b --- /dev/null +++ b/keyboards/handwired/hillside/0_1/keymaps/via/keymap.json @@ -0,0 +1,61 @@ +{ "version": 1, + "notes": "", + "keyboard": "handwired/hillside/0_1", + "keymap": "via", + "layout": "LAYOUT", + "layers": [ + ["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_CAPS" , "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "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_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH", "KC_RSFT", + + "KC_LCTL" , "KC_LGUI", "KC_LALT", "MO(3)" , "MO(1)", + "MO(2)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_QUOT" + + ], + ["KC_NO" , "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", + "KC_PGUP" , "KC_HOME", "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", + + "KC_NO" , "KC_LGUI", "KC_LALT", "KC_LCTL", "KC_LSFT", "KC_VOLD", + "KC_PGDN" , "KC_LEFT", "KC_UP" , "KC_RGHT", "KC_NO" , "KC_TRNS", + + "KC_LSFT" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_MUTE", + "KC_ESC" , "KC_CAPS", "KC_NO" , "KC_DOWN", "KC_NO" , "KC_APP" , "KC_TRNS", + + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", + "KC_TRNS" , "KC_BSPC", "KC_TRNS", "KC_TRNS", "KC_RCTL" + + ], + ["KC_F11" , "KC_EXLM", "KC_AT" , "KC_HASH", "KC_DLR" , "KC_PERC", + "KC_CIRC" , "KC_AMPR", "KC_ASTR", "KC_LPRN", "KC_RPRN", "KC_TRNS", + + "KC_F12" , "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", + "KC_PIPE" , "KC_LSFT", "KC_LCTL", "KC_LALT", "KC_LGUI", "KC_TRNS", + + "KC_LSFT" , "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_PSCR", + "KC_ESC" , "KC_BSLS", "KC_LBRC", "KC_RBRC", "KC_LCBR", "KC_RCBR", "KC_TRNS", + + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_RCTL" + + ], + ["KC_TAB" , "KC_MINS", "KC_PLUS", "KC_EQL" , "KC_SLSH", "KC_ASTR", + "KC_COMM" , "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", + + "ANY(RGB_TOG)", "KC_LGUI", "KC_LALT", "KC_LCTL", "KC_LSFT", "KC_NO", + "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS", "KC_TRNS", + + "KC_TRNS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", + + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_NO", + "KC_NO" , "KC_BSPC", "KC_TRNS", "KC_TRNS", "KC_RCTL" + + ] + ], + "author": "@mmccoyd" +} diff --git a/keyboards/handwired/hillside/0_1/readme.md b/keyboards/handwired/hillside/0_1/readme.md new file mode 100644 index 000000000000..f1ff0f850667 --- /dev/null +++ b/keyboards/handwired/hillside/0_1/readme.md @@ -0,0 +1,29 @@ +# Hillside + +![hillside](https://imgur.com/XW0rX13.png) + +[Hillside](https://github.com/mmccoyd/hillside) + is a split ergonomic keyboard + with 3x6+4+2 choc-spaced keys with aggressive column stagger, + a longer thumb arc and a breakoff outer-pinky column. + +* Keyboard Maintainer: [Michael McCoyd](https://github.com/mmccoyd) +* Hardware Supported: ProMicro/Elite-C and compatible +* Hardware Availability: https://github.com/mmccoyd/hillside + +Make example for this keyboard (after setting up your build environment): + + make handwired/hillside/0_1:default + +Flashing example for this keyboard: + + make handwired/hillside/0_1:default:flash + +## Bootloader + +Enter the bootloader by either: + +* **Physical reset button**: Briefly press the button on the front of the PCB. +* **Keycode in layout**: Press the key mapped to `RESET` if it is available + +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/handwired/hillside/info.json b/keyboards/handwired/hillside/info.json index 7a29df1c64ec..781b43c0ff78 100644 --- a/keyboards/handwired/hillside/info.json +++ b/keyboards/handwired/hillside/info.json @@ -2,96 +2,5 @@ "manufacturer": "mmccoyd", "maintainer": "mmccoyd", - "keyboard_name": "Hillside", - "url": "http://github.com/mmccoyd/hillside/", - - "tags": ["split", "column stagger", "choc v1", "choc spaced" ], - - "processor": "atmega32u4", - - "features": { - "encoder": true, - "extrakey": true, - "rgblight": true - }, - "split": { - "soft_serial_pin": "D2", - "main": "left" - }, - - "rgblight": { - "led_count": 5, - "pin": "D3", - "split": true, - "hue_steps": 8, - "saturation_steps": 8, - "brightness_steps": 8 - }, - - "layouts": { - "LAYOUT": { - "layout": [ - - {"label": "Tab", "x": 0, "y": 0.93}, - {"label": "Q", "x": 1, "y": 0.93}, - {"label": "W", "x": 2, "y": 0.31}, - {"label": "E", "x": 3, "y": 0}, - {"label": "R", "x": 4, "y": 0.28}, - {"label": "T", "x": 5, "y": 0.42}, - - {"label": "Y", "x": 9.5, "y": 0.42}, - {"label": "U", "x": 10.5, "y": 0.28}, - {"label": "I", "x": 11.5, "y": 0}, - {"label": "O", "x": 12.5, "y": 0.31}, - {"label": "P", "x": 13.5, "y": 0.93}, - {"label": "Backspace", "x": 14.5, "y": 0.93}, - - - {"label": "Ctrl", "x": 0, "y": 1.93}, - {"label": "A", "x": 1, "y": 1.93}, - {"label": "S", "x": 2, "y": 1.31}, - {"label": "D", "x": 3, "y": 1}, - {"label": "F", "x": 4, "y": 1.28}, - {"label": "G", "x": 5, "y": 1.42}, - - {"label": "H", "x": 9.5, "y": 1.42}, - {"label": "J", "x": 10.5, "y": 1.28}, - {"label": "K", "x": 11.5, "y": 1}, - {"label": "L", "x": 12.5, "y": 1.31}, - {"label": ";", "x": 13.5, "y": 1.93}, - {"label": "'", "x": 14.5, "y": 1.93}, - - - {"label": "Shift", "x": 0, "y": 2.93}, - {"label": "Z", "x": 1, "y": 2.93}, - {"label": "X", "x": 2, "y": 2.31}, - {"label": "C", "x": 3, "y": 2}, - {"label": "V", "x": 4, "y": 2.28}, - {"label": "B", "x": 5, "y": 2.42}, - {"label": "`", "x": 6, "y": 2.78}, - - {"label": "Esc", "x": 8.5, "y": 2.78}, - {"label": "N", "x": 9.5, "y": 2.42}, - {"label": "M", "x": 10.5, "y": 2.28}, - {"label": ",", "x": 11.5, "y": 2}, - {"label": ".", "x": 12.5, "y": 2.31}, - {"label": "/", "x": 13.5, "y": 2.93}, - {"label": "Shift", "x": 14.5, "y": 2.93}, - - - {"label": "Enter", "x": 2, "y": 3.31}, - {"label": "Gui", "x": 3.5, "y": 3.28}, - {"label": "Alt", "x": 4.5, "y": 3.42}, - {"label": "Num", "x": 5.5, "y": 3.78}, - {"label": "Nav", "x": 6.5, "y": 4.14}, - - - {"label": "Sym", "x": 8, "y": 4.14}, - {"label": "Space", "x": 9, "y": 3.78}, - {"label": "Alt", "x": 10, "y": 3.42}, - {"label": "Gui", "x": 11, "y": 3.28}, - {"label": "App", "x": 12.5, "y": 3.31} - ] - } - } + "url": "http://github.com/mmccoyd/hillside/" } diff --git a/keyboards/handwired/hillside/keymaps/default/keymap.json b/keyboards/handwired/hillside/keymaps/default/keymap.json deleted file mode 100644 index f5871b073f28..000000000000 --- a/keyboards/handwired/hillside/keymaps/default/keymap.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "version": 1, - "notes": "", - "documentation": "\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", - "keyboard": "handwired/hillside/0_1", - "author": "@mmccoyd", - "keymap": "default", - "layout": "LAYOUT", - "layers": [ - ["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_GRV", - "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", - "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", - "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_SLSH", - - "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", - "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", - "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", - "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", - "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_CAPS", "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", - "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", - - "KC_LCTL", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", - "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_RCTL", - - "KC_LSFT", "LCTL(KC_Z)", "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", - "KC_ESC" , "KC_NO" , "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_RALT" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", - "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_F12" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", - "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_BSPC", - - "KC_LCTL", "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", - "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_RCTL", - - "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_F11", - "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", - "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", - "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_RCTL", - - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", - "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", - - "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" - - ] - ] -} diff --git a/keyboards/handwired/hillside/keymaps/via/keymap.json b/keyboards/handwired/hillside/keymaps/via/keymap.json deleted file mode 100644 index 8b4810c3098d..000000000000 --- a/keyboards/handwired/hillside/keymaps/via/keymap.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "version": 1, - "notes": "", - "keyboard": "handwired/hillside/0_1", - "author": "@mmccoyd", - "keymap": "via", - "layout": "LAYOUT", - "layers": [ - ["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_GRV", - "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", - "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", - "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_SLSH", - - "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", - "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", - "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", - "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", - "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_CAPS", "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", - "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", - - "KC_LCTL", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", - "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_RCTL", - - "KC_LSFT", "LCTL(KC_Z)", "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", - "KC_ESC" , "KC_NO" , "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_RALT" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", - "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_F12" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", - "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_BSPC", - - "KC_LCTL", "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", - "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_RCTL", - - "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_F11", - "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", - "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", - "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_RCTL", - - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", - "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", - - "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" - - ] - ] -} diff --git a/keyboards/handwired/hillside/readme.md b/keyboards/handwired/hillside/readme.md index f1ff0f850667..cffb3875aa14 100644 --- a/keyboards/handwired/hillside/readme.md +++ b/keyboards/handwired/hillside/readme.md @@ -2,28 +2,10 @@ ![hillside](https://imgur.com/XW0rX13.png) -[Hillside](https://github.com/mmccoyd/hillside) - is a split ergonomic keyboard - with 3x6+4+2 choc-spaced keys with aggressive column stagger, - a longer thumb arc and a breakoff outer-pinky column. +Hillside is a small family of split ergonomic keyboards, currently of one. +Inside this directory is support for each model. * Keyboard Maintainer: [Michael McCoyd](https://github.com/mmccoyd) -* Hardware Supported: ProMicro/Elite-C and compatible +* Hardware Supported: + * [Hillside 0_1](https://github.com/qmk/qmk_firmware/blob/master/keyboards/handwired/hillside/0_1): ProMicro/Elite-C and compatible * Hardware Availability: https://github.com/mmccoyd/hillside - -Make example for this keyboard (after setting up your build environment): - - make handwired/hillside/0_1:default - -Flashing example for this keyboard: - - make handwired/hillside/0_1:default:flash - -## Bootloader - -Enter the bootloader by either: - -* **Physical reset button**: Briefly press the button on the front of the PCB. -* **Keycode in layout**: Press the key mapped to `RESET` if it is available - -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/handwired/ms_sculpt_mobile/babblePaste.c b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.c similarity index 100% rename from keyboards/handwired/ms_sculpt_mobile/babblePaste.c rename to keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.c diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.h b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.h similarity index 100% rename from keyboards/handwired/ms_sculpt_mobile/babblePaste.h rename to keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.h diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.txt similarity index 100% rename from keyboards/handwired/ms_sculpt_mobile/babblePaste.txt rename to keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.txt diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk index 6d1eae2bf92a..5b45f586b5da 100644 --- a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk @@ -15,3 +15,6 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Keymap specific files +SRC = babblePaste.c diff --git a/keyboards/handwired/ms_sculpt_mobile/rules.mk b/keyboards/handwired/ms_sculpt_mobile/rules.mk index 72015d93d857..6498fa6c7603 100644 --- a/keyboards/handwired/ms_sculpt_mobile/rules.mk +++ b/keyboards/handwired/ms_sculpt_mobile/rules.mk @@ -24,6 +24,3 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output - -# Project specific files -SRC = babblePaste.c diff --git a/keyboards/handwired/not_so_minidox/config.h b/keyboards/handwired/not_so_minidox/config.h index de9286eda541..177552e2a6c7 100644 --- a/keyboards/handwired/not_so_minidox/config.h +++ b/keyboards/handwired/not_so_minidox/config.h @@ -40,6 +40,11 @@ along with this program. If not, see . #define USE_SERIAL +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + //#define EE_HANDS #define MASTER_LEFT diff --git a/keyboards/handwired/not_so_minidox/i2c.c b/keyboards/handwired/not_so_minidox/i2c.c deleted file mode 100644 index 084c890c405f..000000000000 --- a/keyboards/handwired/not_so_minidox/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c b/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c index 296a7a281da5..435eed2f1fcd 100644 --- a/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c +++ b/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c @@ -8,17 +8,10 @@ #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define _ADJUST 16 +#define _ADJUST 3 -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_LOWR LOWER -#define KC_RASE RAISE +#define KC_LOWR MO(_LOWER) +#define KC_RASE MO(_RAISE) #define KC_RST RESET #define KC_CAD LCTL(LALT(KC_DEL)) @@ -72,45 +65,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - return true; +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); } diff --git a/keyboards/handwired/not_so_minidox/matrix.c b/keyboards/handwired/not_so_minidox/matrix.c deleted file mode 100644 index b7cec9370c5c..000000000000 --- a/keyboards/handwired/not_so_minidox/matrix.c +++ /dev/null @@ -1,308 +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 -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "config.h" -#include "quantum.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - int ret = _matrix_scan(); - - - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - writePinLow(D5); - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - writePinHigh(D5); - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/handwired/not_so_minidox/rules.mk b/keyboards/handwired/not_so_minidox/rules.mk index 3eab0fba7e63..8f9772df22e5 100644 --- a/keyboards/handwired/not_so_minidox/rules.mk +++ b/keyboards/handwired/not_so_minidox/rules.mk @@ -7,19 +7,14 @@ BOOTLOADER = caterina # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = no # Audio control and System control +EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -USE_I2C = no -CUSTOM_MATRIX = yes -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c +SPLIT_KEYBOARD = yes diff --git a/keyboards/handwired/not_so_minidox/serial.c b/keyboards/handwired/not_so_minidox/serial.c deleted file mode 100644 index 74bcbb6bf6e2..000000000000 --- a/keyboards/handwired/not_so_minidox/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/handwired/not_so_minidox/serial.h b/keyboards/handwired/not_so_minidox/serial.h deleted file mode 100644 index 28fcc56ce75f..000000000000 --- a/keyboards/handwired/not_so_minidox/serial.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); diff --git a/keyboards/handwired/not_so_minidox/split_util.c b/keyboards/handwired/not_so_minidox/split_util.c deleted file mode 100644 index 39639c3b4bd8..000000000000 --- a/keyboards/handwired/not_so_minidox/split_util.c +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); diff --git a/keyboards/handwired/onekey/nucleo_l432kc/config.h b/keyboards/handwired/onekey/nucleo_l432kc/config.h new file mode 100644 index 000000000000..7aa74f668227 --- /dev/null +++ b/keyboards/handwired/onekey/nucleo_l432kc/config.h @@ -0,0 +1,21 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "config_common.h" + +#define PRODUCT Onekey L432KC + +#define MATRIX_COL_PINS { A2 } +#define MATRIX_ROW_PINS { A1 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B8 +#define BACKLIGHT_PWM_DRIVER PWMD4 +#define BACKLIGHT_PWM_CHANNEL 3 +#define BACKLIGHT_PAL_MODE 2 + +#define RGB_DI_PIN A0 +#define RGB_CI_PIN B13 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/nucleo_l432kc/readme.md b/keyboards/handwired/onekey/nucleo_l432kc/readme.md new file mode 100644 index 000000000000..c7d13cb97385 --- /dev/null +++ b/keyboards/handwired/onekey/nucleo_l432kc/readme.md @@ -0,0 +1,5 @@ +# STM32 Nucleo-L432 onekey + +To trigger keypress, short together pins *A1* and *A2*. + +You'll also need to connect `VIN`, `GND`, USB `D+` to `PA12`/`D2`, and USB `D-` to `PA11`/`D10`. diff --git a/keyboards/handwired/onekey/nucleo_l432kc/rules.mk b/keyboards/handwired/onekey/nucleo_l432kc/rules.mk new file mode 100644 index 000000000000..64dae7746edf --- /dev/null +++ b/keyboards/handwired/onekey/nucleo_l432kc/rules.mk @@ -0,0 +1,5 @@ +# MCU name +MCU = STM32L432 + +# Bootloader selection +BOOTLOADER = stm32-dfu diff --git a/keyboards/handwired/onekey/teensy_32/rules.mk b/keyboards/handwired/onekey/teensy_32/rules.mk index c1b90d0d2bf7..937c9d5103aa 100644 --- a/keyboards/handwired/onekey/teensy_32/rules.mk +++ b/keyboards/handwired/onekey/teensy_32/rules.mk @@ -1,5 +1,8 @@ # MCU name MCU = MK20DX256 +# Bootloader selection +BOOTLOADER = halfkay + # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/handwired/onekey/teensy_lc/rules.mk b/keyboards/handwired/onekey/teensy_lc/rules.mk index b3daabe317d9..0e3c7edf7a08 100644 --- a/keyboards/handwired/onekey/teensy_lc/rules.mk +++ b/keyboards/handwired/onekey/teensy_lc/rules.mk @@ -2,5 +2,8 @@ MCU = MKL26Z64 USE_CHIBIOS_CONTRIB = yes +# Bootloader selection +BOOTLOADER = halfkay + # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/handwired/ortho_brass/rules.mk b/keyboards/handwired/ortho_brass/rules.mk index 19154c58f9e9..4e3b0d925ad2 100644 --- a/keyboards/handwired/ortho_brass/rules.mk +++ b/keyboards/handwired/ortho_brass/rules.mk @@ -1,7 +1,7 @@ # MCU name MCU = atmega32u4 -# Bootloader +# Bootloader selection BOOTLOADER = qmk-dfu # Build Options @@ -10,13 +10,10 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # N-key Rollover +NKRO_ENABLE = yes # Enable N-key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - LAYOUTS = ortho_4x12 RGBLIGHT_SUPPORTED = no diff --git a/keyboards/handwired/prkl30/feather/rules.mk b/keyboards/handwired/prkl30/feather/rules.mk index f83173fa0ba2..7578dcef743a 100644 --- a/keyboards/handwired/prkl30/feather/rules.mk +++ b/keyboards/handwired/prkl30/feather/rules.mk @@ -22,4 +22,4 @@ AUDIO_ENABLE = no # This can be enabled if a speaker is connected to t RGBLIGHT_ENABLE = no # This can be enabled if a ws2812 strip is connected to the expansion port. BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/promethium/keymaps/default/keymap.c b/keyboards/handwired/promethium/keymaps/default/keymap.c index 14a293bb39cd..e12142c50ba6 100644 --- a/keyboards/handwired/promethium/keymaps/default/keymap.c +++ b/keyboards/handwired/promethium/keymaps/default/keymap.c @@ -137,7 +137,7 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef MODULE_ADAFRUIT_BLE +#ifndef BLUETOOTH_BLUEFRUIT_LE OUT_BT, #endif RGBDEMO, @@ -1261,7 +1261,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE switch(output) { case OUTPUT_USB: led_set_output_usb(); @@ -1285,7 +1285,7 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 094eb1576211..94b505aa2c5a 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -140,7 +140,7 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef MODULE_ADAFRUIT_BLE +#ifndef BLUETOOTH_BLUEFRUIT_LE OUT_BT, #endif RGBDEMO, @@ -1264,7 +1264,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE switch(output) { case OUTPUT_USB: led_set_output_usb(); @@ -1288,7 +1288,7 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c index e3a41af288c5..90dbce14a954 100644 --- a/keyboards/handwired/promethium/matrix.c +++ b/keyboards/handwired/promethium/matrix.c @@ -148,14 +148,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index 8eb1680d847b..0df6c28e9b09 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -3,7 +3,7 @@ #include "timer.h" #include "matrix.h" #include "musical_notes.h" -#include "adafruit_ble.h" +#include "bluefruit_le.h" float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); @@ -12,7 +12,7 @@ float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} uint8_t battery_level(void) { - float voltage = adafruit_ble_read_battery_voltage() * 2 * 3.3 / 1024; + float voltage = bluefruit_le_read_battery_voltage() * 2 * 3.3 / 1024; if (voltage < MIN_VOLTAGE) return 0; if (voltage > MAX_VOLTAGE) return 255; return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index f41e88b0c46f..383800ee0141 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -23,7 +23,7 @@ PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes CUSTOM_MATRIX = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += ws2812.c SRC += rgbsps.c diff --git a/keyboards/handwired/pterodactyl/matrix.c b/keyboards/handwired/pterodactyl/matrix.c index 21e6a128dfd4..d0f74802a01b 100644 --- a/keyboards/handwired/pterodactyl/matrix.c +++ b/keyboards/handwired/pterodactyl/matrix.c @@ -282,14 +282,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/handwired/pterodactyl/rules.mk b/keyboards/handwired/pterodactyl/rules.mk index 629b30e385a9..fd63e2ad48d1 100644 --- a/keyboards/handwired/pterodactyl/rules.mk +++ b/keyboards/handwired/pterodactyl/rules.mk @@ -22,7 +22,7 @@ AUDIO_ENABLE = no # Audio output UNICODE_ENABLE = yes CUSTOM_MATRIX = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += matrix.c QUANTUM_LIB_SRC += i2c_master.c diff --git a/keyboards/handwired/qc60/config.h b/keyboards/handwired/qc60/config.h index 0c27755910f9..db3d88dcf4f9 100644 --- a/keyboards/handwired/qc60/config.h +++ b/keyboards/handwired/qc60/config.h @@ -5,7 +5,7 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0C60 -#define DEVICE_VER 0x00C6 +#define DEVICE_VER 0x0100 #define MANUFACTURER PeiorisBoards #define PRODUCT QC60 diff --git a/keyboards/handwired/slash/rules.mk b/keyboards/handwired/slash/rules.mk index 275a2eb7ebd5..53d114978f8a 100644 --- a/keyboards/handwired/slash/rules.mk +++ b/keyboards/handwired/slash/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk index e83e9a7bba17..c497bb2ee889 100644 --- a/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk @@ -21,9 +21,7 @@ RGB_MATRIX_DRIVER = WS2812 POINTING_DEVICE_ENABLE = yes -MOUSE_SHARED_EP = no +POINTING_DEVICE_DRIVER = pmw3360 +MOUSE_SHARED_EP = yes SPLIT_KEYBOARD = yes - -SRC += drivers/sensors/pmw3360.c -QUANTUM_LIB_SRC += spi_master.c tm_sync.c diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/config.h index 59cd098fdb33..b4f09e5e87f7 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/config.h @@ -50,5 +50,4 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define POINTING_DEVICE_TASK_THROTTLE #define POINTING_DEVICE_RIGHT diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h index 6ae51ca6f034..87c323905717 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h @@ -79,7 +79,8 @@ along with this program. If not, see . #define I2C1_SDA_PIN B9 #define I2C1_SCL_PAL_MODE 4 #define I2C1_SDA_PAL_MODE 4 -// #define I2C1_CLOCK_SPEED 400000 +#define I2C1_CLOCK_SPEED 400000 +#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 /* encoder config */ #define ENCODERS_PAD_A \ diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index fa1e8897eee2..570760cf6621 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -61,8 +61,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MOUSE] = LAYOUT_5x6_right( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, DPI_CONFIG, + _______, _______, _______, _______, _______, _______, KC_WH_U, DPI_MOD, DPI_RMOD,S_D_MOD, S_D_RMOD,DRGSCRL, + _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk index 37bbbb4daeda..a689be3dd5a6 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk @@ -18,6 +18,4 @@ MOUSE_SHARED_EP = yes SPLIT_KEYBOARD = yes -QUANTUM_LIB_SRC += tm_sync.c - DEFAULT_FOLDER = handwired/tractyl_manuform/5x6_right/teensy2pp diff --git a/keyboards/handwired/tractyl_manuform/config.h b/keyboards/handwired/tractyl_manuform/config.h index cc8a7546f4fa..f9160ea148cb 100644 --- a/keyboards/handwired/tractyl_manuform/config.h +++ b/keyboards/handwired/tractyl_manuform/config.h @@ -24,8 +24,6 @@ along with this program. If not, see . #define VENDOR_ID 0x44DD #define MANUFACTURER Drashna -#define USB_POLLING_INTERVAL_MS 1 - /* disable debug print */ // #define NO_DEBUG @@ -39,4 +37,7 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC, RPC_ID_POINTER_STATE_SYNC +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_TASK_THROTTLE_MS 1 + +#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC diff --git a/keyboards/handwired/tractyl_manuform/tm_sync.c b/keyboards/handwired/tractyl_manuform/tm_sync.c deleted file mode 100644 index 549a17a22f37..000000000000 --- a/keyboards/handwired/tractyl_manuform/tm_sync.c +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2021 Dasky (@daskygit) - - * 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 QMK_KEYBOARD_H -#include "pointing_device.h" -#include "transactions.h" -#include -#ifdef MOUSEKEY_ENABLE -# include "mousekey.h" -#endif - -// typedef struct { -// uint16_t device_cpi; -// } kb_config_data_t; - -kb_config_data_t kb_config; -static report_mouse_t shared_mouse_report; -extern const pointing_device_driver_t pointing_device_driver; - -void kb_pointer_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - shared_mouse_report = pointing_device_driver.get_report(shared_mouse_report); - memcpy(target2initiator_buffer, &shared_mouse_report, sizeof(report_mouse_t)); - shared_mouse_report.x = 0; - shared_mouse_report.y = 0; - shared_mouse_report.h = 0; - shared_mouse_report.v = 0; -} - -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(kb_config)) { - memcpy(&kb_config, initiator2target_buffer, sizeof(kb_config)); - } - - static uint16_t cpi = 0; - // Check if the state values are different - if (cpi != kb_config.device_cpi) { - cpi = kb_config.device_cpi; - if (!is_keyboard_left()) { - pointing_device_set_cpi(cpi); - } - } -} - -void keyboard_pre_init_sync(void) { - memset(&kb_config, 0, sizeof(kb_config)); - memset(&shared_mouse_report, 0, sizeof(shared_mouse_report)); -} - -void keyboard_post_init_sync(void) { - // Register keyboard state sync split transaction - transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); - transaction_register_rpc(RPC_ID_POINTER_STATE_SYNC, kb_pointer_sync_handler); -} - -void housekeeping_task_sync(void) { - if (is_keyboard_master()) { - // Keep track of the last state, so that we can tell if we need to propagate to slave - static kb_config_data_t last_kb_config; - static uint32_t last_sync = 0; - bool needs_sync = false; - - // Check if the state values are different - if (memcmp(&kb_config, &last_kb_config, sizeof(kb_config))) { - needs_sync = true; - memcpy(&last_kb_config, &kb_config, sizeof(kb_config)); - } - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync) > 500) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config), &kb_config)) { - last_sync = timer_read32(); - } - } - } -} - -void trackball_set_cpi(uint16_t cpi) { - kb_config.device_cpi = cpi; - if (!is_keyboard_left()) { - pointing_device_set_cpi(cpi); - } -} - -void pointing_device_task(void) { - if (!is_keyboard_master()) { - return; - } - -#if defined(POINTING_DEVICE_TASK_THROTTLE) - static uint32_t last_exec = 0; - if (timer_elapsed32(last_exec) < 1) { - return; - } - last_exec = timer_read32(); -#endif - - report_mouse_t local_report = pointing_device_get_report(); - - // Gather report info -#ifdef POINTING_DEVICE_MOTION_PIN - if (!readPin(POINTING_DEVICE_MOTION_PIN)) -#endif -#if defined(POINTING_DEVICE_COMBINED) - local_report = pointing_device_driver.get_report(local_report); - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &shared_mouse_report); - local_report.x = local_report.x | shared_mouse_report.x; - local_report.y = local_report.y | shared_mouse_report.y; - local_report.h = local_report.h | shared_mouse_report.h; - local_report.v = local_report.v | shared_mouse_report.v; -#elif defined(POINTING_DEVICE_LEFT) - if (is_keyboard_left()) { - local_report = pointing_device_driver.get_report(local_report); - } else { - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &local_report); - } -#elif defined(POINTING_DEVICE_RIGHT) - if (!is_keyboard_left()) { - local_report = pointing_device_driver.get_report(local_report); - } else { - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &local_report); - } -#else -# error "You need to define the side(s) the pointing device is on. POINTING_DEVICE_COMBINED / POINTING_DEVICE_LEFT / POINTING_DEVICE_RIGHT" -#endif - - // Support rotation of the sensor data -#if defined(POINTING_DEVICE_ROTATION_90) || defined(POINTING_DEVICE_ROTATION_180) || defined(POINTING_DEVICE_ROTATION_270) - int8_t x = local_report.x, y = local_report.y; -# if defined(POINTING_DEVICE_ROTATION_90) - local_report.x = y; - local_report.y = -x; -# elif defined(POINTING_DEVICE_ROTATION_180) - local_report.x = -x; - local_report.y = -y; -# elif defined(POINTING_DEVICE_ROTATION_270) - local_report.x = -y; - local_report.y = x; -# else -# error "How the heck did you get here?!" -# endif -#endif - // Support Inverting the X and Y Axises -#if defined(POINTING_DEVICE_INVERT_X) - local_report.x = -local_report.x; -#endif -#if defined(POINTING_DEVICE_INVERT_Y) - local_report.y = -local_report.y; -#endif - - // allow kb to intercept and modify report - local_report = pointing_device_task_kb(local_report); - // combine with mouse report to ensure that the combined is sent correctly -#ifdef MOUSEKEY_ENABLE - report_mouse_t mousekey_report = mousekey_get_report(); - local_report.buttons = local_report.buttons | mousekey_report.buttons; -#endif -#if defined(POINTING_DEVICE_COMBINED) - local_report.buttons = local_report.buttons | shared_mouse_report.buttons; -#endif - pointing_device_set_report(local_report); - pointing_device_send(); -} diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 6095bfb7e2aa..033146134d65 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -17,114 +17,369 @@ #include "tractyl_manuform.h" #include "transactions.h" #include -#include "drivers/sensors/pmw3360.h" -#ifndef TRACKBALL_DPI_OPTIONS -# define TRACKBALL_DPI_OPTIONS \ - { 1200, 1600, 2400 } -# ifndef TRACKBALL_DPI_DEFAULT -# define TRACKBALL_DPI_DEFAULT 1 -# endif -#endif -#ifndef TRACKBALL_DPI_DEFAULT -# define TRACKBALL_DPI_DEFAULT 0 -#endif +#ifdef CONSOLE_ENABLE +# include "print.h" +#endif // CONSOLE_ENABLE -keyboard_config_t keyboard_config; -uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) +#ifdef POINTING_DEVICE_ENABLE +# ifndef CHARYBDIS_MINIMUM_DEFAULT_DPI +# define CHARYBDIS_MINIMUM_DEFAULT_DPI 400 +# endif // CHARYBDIS_MINIMUM_DEFAULT_DPI +# ifndef CHARYBDIS_DEFAULT_DPI_CONFIG_STEP +# define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200 +# endif // CHARYBDIS_DEFAULT_DPI_CONFIG_STEP +# ifndef CHARYBDIS_MINIMUM_SNIPING_DPI +# define CHARYBDIS_MINIMUM_SNIPING_DPI 200 +# endif // CHARYBDIS_MINIMUM_SNIPER_MODE_DPI -bool process_record_kb(uint16_t keycode, keyrecord_t* record) { - if (!process_record_user(keycode, record)) { - return false; +# ifndef CHARYBDIS_SNIPING_DPI_CONFIG_STEP +# define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100 +# endif // CHARYBDIS_SNIPING_DPI_CONFIG_STEP + +// Fixed DPI for drag-scroll. +# ifndef CHARYBDIS_DRAGSCROLL_DPI +# define CHARYBDIS_DRAGSCROLL_DPI 100 +# endif // CHARYBDIS_DRAGSCROLL_DPI + +# ifndef CHARYBDIS_DRAGSCROLL_BUFFER_SIZE +# define CHARYBDIS_DRAGSCROLL_BUFFER_SIZE 6 +# endif // !CHARYBDIS_DRAGSCROLL_BUFFER_SIZE + +# ifndef CHARYBDIS_POINTER_ACCELERATION_FACTOR +# define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24 +# endif // !CHARYBDIS_POINTER_ACCELERATION_FACTOR + +typedef union { + uint8_t raw; + struct { + uint8_t pointer_default_dpi : 4; // 16 steps available. + uint8_t pointer_sniping_dpi : 2; // 4 steps available. + bool is_dragscroll_enabled : 1; + bool is_sniping_enabled : 1; + } __attribute__((packed)); +} charybdis_config_t; + +static charybdis_config_t g_charybdis_config = {0}; + +/** + * \brief Set the value of `config` from EEPROM. + * + * Note that `is_dragscroll_enabled` and `is_sniping_enabled` are purposefully + * ignored since we do not want to persist this state to memory. In practice, + * this state is always written to maximize write-performances. Therefore, we + * explicitly set them to `false` in this function. + */ +static void read_charybdis_config_from_eeprom(charybdis_config_t* config) { + config->raw = eeconfig_read_kb() & 0xff; + config->is_dragscroll_enabled = false; + config->is_sniping_enabled = false; +} + +/** + * \brief Save the value of `config` to eeprom. + * + * Note that all values are written verbatim, including whether drag-scroll + * and/or sniper mode are enabled. `read_charybdis_config_from_eeprom(…)` + * resets these 2 values to `false` since it does not make sense to persist + * these across reboots of the board. + */ +static void write_charybdis_config_to_eeprom(charybdis_config_t* config) { eeconfig_update_kb(config->raw); } + +/** \brief Return the current value of the pointer's default DPI. */ +static uint16_t get_pointer_default_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_default_dpi * CHARYBDIS_DEFAULT_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_DEFAULT_DPI; } + +/** \brief Return the current value of the pointer's sniper-mode DPI. */ +static uint16_t get_pointer_sniping_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_sniping_dpi * CHARYBDIS_SNIPING_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_SNIPING_DPI; } + +/** \brief Set the appropriate DPI for the input config. */ +static void maybe_update_pointing_device_cpi(charybdis_config_t* config) { + if (config->is_dragscroll_enabled) { + pointing_device_set_cpi(CHARYBDIS_DRAGSCROLL_DPI); + } else if (config->is_sniping_enabled) { + pointing_device_set_cpi(get_pointer_sniping_dpi(config)); + } else { + pointing_device_set_cpi(get_pointer_default_dpi(config)); } +} -#ifdef POINTING_DEVICE_ENABLE - if (keycode == DPI_CONFIG && record->event.pressed) { - if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { - keyboard_config.dpi_config = (keyboard_config.dpi_config - 1) % DPI_OPTION_SIZE; - } else { - keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; +/** + * \brief Update the pointer's default DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP. + */ +static void step_pointer_default_dpi(charybdis_config_t* config, bool forward) { + config->pointer_default_dpi += forward ? 1 : -1; + maybe_update_pointing_device_cpi(config); +} + +/** + * \brief Update the pointer's sniper-mode DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP. + */ +static void step_pointer_sniping_dpi(charybdis_config_t* config, bool forward) { + config->pointer_sniping_dpi += forward ? 1 : -1; + maybe_update_pointing_device_cpi(config); +} + +uint16_t charybdis_get_pointer_default_dpi(void) { return get_pointer_default_dpi(&g_charybdis_config); } + +uint16_t charybdis_get_pointer_sniping_dpi(void) { return get_pointer_sniping_dpi(&g_charybdis_config); } + +void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward) { step_pointer_default_dpi(&g_charybdis_config, forward); } + +void charybdis_cycle_pointer_default_dpi(bool forward) { + step_pointer_default_dpi(&g_charybdis_config, forward); + write_charybdis_config_to_eeprom(&g_charybdis_config); +} + +void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward) { step_pointer_sniping_dpi(&g_charybdis_config, forward); } + +void charybdis_cycle_pointer_sniping_dpi(bool forward) { + step_pointer_sniping_dpi(&g_charybdis_config, forward); + write_charybdis_config_to_eeprom(&g_charybdis_config); +} + +bool charybdis_get_pointer_sniping_enabled(void) { return g_charybdis_config.is_sniping_enabled; } + +void charybdis_set_pointer_sniping_enabled(bool enable) { + g_charybdis_config.is_sniping_enabled = enable; + maybe_update_pointing_device_cpi(&g_charybdis_config); +} + +bool charybdis_get_pointer_dragscroll_enabled(void) { return g_charybdis_config.is_dragscroll_enabled; } + +void charybdis_set_pointer_dragscroll_enabled(bool enable) { + g_charybdis_config.is_dragscroll_enabled = enable; + maybe_update_pointing_device_cpi(&g_charybdis_config); +} + +void pointing_device_init_kb(void) { maybe_update_pointing_device_cpi(&g_charybdis_config); } + +# ifndef CONSTRAIN_HID +# define CONSTRAIN_HID(value) ((value) < -127 ? -127 : ((value) > 127 ? 127 : (value))) +# endif // !CONSTRAIN_HID + +/** + * \brief Add optional acceleration effect. + * + * If `CHARYBDIS_ENABLE_POINTER_ACCELERATION` is defined, add a simple and naive + * acceleration effect to the provided value. Return the value unchanged + * otherwise. + */ +# ifndef DISPLACEMENT_WITH_ACCELERATION +# ifdef CHARYBDIS_POINTER_ACCELERATION_ENABLE +# define DISPLACEMENT_WITH_ACCELERATION(d) (CONSTRAIN_HID(d > 0 ? d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d : -d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d)) +# else // !CHARYBDIS_POINTER_ACCELERATION_ENABLE +# define DISPLACEMENT_WITH_ACCELERATION(d) (d) +# endif // CHARYBDIS_POINTER_ACCELERATION_ENABLE +# endif // !DISPLACEMENT_WITH_ACCELERATION + +/** + * \brief Augment the pointing device behavior. + * + * Implement the Charybdis-specific features for pointing devices: + * - Drag-scroll + * - Sniping + * - Acceleration + */ +static void pointing_device_task_charybdis(report_mouse_t* mouse_report) { + static int16_t scroll_buffer_x = 0; + static int16_t scroll_buffer_y = 0; + if (g_charybdis_config.is_dragscroll_enabled) { +# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_X + scroll_buffer_x -= mouse_report->x; +# else + scroll_buffer_x += mouse_report->x; +# endif // CHARYBDIS_DRAGSCROLL_REVERSE_X +# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_Y + scroll_buffer_y -= mouse_report->y; +# else + scroll_buffer_y += mouse_report->y; +# endif // CHARYBDIS_DRAGSCROLL_REVERSE_Y + mouse_report->x = 0; + mouse_report->y = 0; + if (abs(scroll_buffer_x) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) { + mouse_report->h = scroll_buffer_x > 0 ? 1 : -1; + scroll_buffer_x = 0; + } + if (abs(scroll_buffer_y) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) { + mouse_report->v = scroll_buffer_y > 0 ? 1 : -1; + scroll_buffer_y = 0; } - eeconfig_update_kb(keyboard_config.raw); - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + } else if (!g_charybdis_config.is_sniping_enabled) { + mouse_report->x = DISPLACEMENT_WITH_ACCELERATION(mouse_report->x); + mouse_report->y = DISPLACEMENT_WITH_ACCELERATION(mouse_report->y); } -#endif +} -/* If Mousekeys is disabled, then use handle the mouse button - * keycodes. This makes things simpler, and allows usage of - * the keycodes in a consistent manner. But only do this if - * Mousekeys is not enable, so it's not handled twice. +report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { + pointing_device_task_charybdis(&mouse_report); + mouse_report = pointing_device_task_user(mouse_report); + + return mouse_report; +} + +# if defined(POINTING_DEVICE_ENABLE) && !defined(NO_CHARYBDIS_KEYCODES) +/** \brief Whether SHIFT mod is enabled. */ +static bool has_shift_mod(void) { +# ifdef NO_ACTION_ONESHOT + return mod_config(get_mods()) & MOD_MASK_SHIFT; +# else + return mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; +# endif // NO_ACTION_ONESHOT +} +# endif // POINTING_DEVICE_ENABLE && !NO_CHARYBDIS_KEYCODES + +/** + * \brief Outputs the Charybdis configuration to console. + * + * Prints the in-memory configuration structure to console, for debugging. + * Includes: + * - raw value + * - drag-scroll: on/off + * - sniping: on/off + * - default DPI: internal table index/actual DPI + * - sniping DPI: internal table index/actual DPI */ -#ifndef MOUSEKEY_ENABLE +static void debug_charybdis_config_to_console(charybdis_config_t* config) { +# ifdef CONSOLE_ENABLE + dprintf("(charybdis) process_record_kb: config = {\n" + "\traw = 0x%04X,\n" + "\t{\n" + "\t\tis_dragscroll_enabled=%b\n" + "\t\tis_sniping_enabled=%b\n" + "\t\tdefault_dpi=0x%02X (%ld)\n" + "\t\tsniping_dpi=0x%01X (%ld)\n" + "\t}\n" + "}\n", + config->raw, config->is_dragscroll_enabled, config->is_sniping_enabled, config->pointer_default_dpi, get_pointer_default_dpi(config), config->pointer_sniping_dpi, get_pointer_sniping_dpi(config)); +# endif // CONSOLE_ENABLE +} + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + if (!process_record_user(keycode, record)) { + debug_charybdis_config_to_console(&g_charybdis_config); + return false; + } +# ifndef NO_CHARYBDIS_KEYCODES + switch (keycode) { + case POINTER_DEFAULT_DPI_FORWARD: + if (record->event.pressed) { + // Step backward if shifted, forward otherwise. + charybdis_cycle_pointer_default_dpi(/* forward= */ !has_shift_mod()); + } + break; + case POINTER_DEFAULT_DPI_REVERSE: + if (record->event.pressed) { + // Step forward if shifted, backward otherwise. + charybdis_cycle_pointer_default_dpi(/* forward= */ has_shift_mod()); + } + break; + case POINTER_SNIPING_DPI_FORWARD: + if (record->event.pressed) { + // Step backward if shifted, forward otherwise. + charybdis_cycle_pointer_sniping_dpi(/* forward= */ !has_shift_mod()); + } + break; + case POINTER_SNIPING_DPI_REVERSE: + if (record->event.pressed) { + // Step forward if shifted, backward otherwise. + charybdis_cycle_pointer_sniping_dpi(/* forward= */ has_shift_mod()); + } + break; + case SNIPING_MODE: + charybdis_set_pointer_sniping_enabled(record->event.pressed); + break; + case SNIPING_MODE_TOGGLE: + if (record->event.pressed) { + charybdis_set_pointer_sniping_enabled(!charybdis_get_pointer_sniping_enabled()); + } + break; + case DRAGSCROLL_MODE: + charybdis_set_pointer_dragscroll_enabled(record->event.pressed); + break; + case DRAGSCROLL_MODE_TOGGLE: + if (record->event.pressed) { + charybdis_set_pointer_dragscroll_enabled(!charybdis_get_pointer_dragscroll_enabled()); + } + break; + } +# endif // !NO_CHARYBDIS_KEYCODES +# ifndef MOUSEKEY_ENABLE + // Simulate mouse keys if full support is not enabled (reduces firmware size + // while maintaining support for mouse keys). if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pointing_device_handle_buttons(currentReport.buttons, record->event.pressed, keycode - KC_MS_BTN1); - pointing_device_set_report(currentReport); + report_mouse_t mouse_report = pointing_device_get_report(); + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, record->event.pressed, keycode - KC_MS_BTN1); + pointing_device_set_report(mouse_report); pointing_device_send(); } -#endif - +# endif // !MOUSEKEY_ENABLE + debug_charybdis_config_to_console(&g_charybdis_config); return true; } -__attribute__((weak)) void keyboard_pre_init_sync(void) {} -__attribute__((weak)) void keyboard_pre_init_sub(void) {} -void keyboard_pre_init_kb(void) { - // debug_enable = true; - // debug_matrix = true; - // debug_mouse = true; - // debug_encoder = true; - // This is the debug LED. -#if defined(DEBUG_LED_PIN) - setPinOutput(DEBUG_LED_PIN); - writePin(DEBUG_LED_PIN, !debug_enable); -#endif - - keyboard_pre_init_sub(); - keyboard_pre_init_sync(); - keyboard_pre_init_user(); +void eeconfig_init_kb(void) { + g_charybdis_config.raw = 0; + write_charybdis_config_to_eeprom(&g_charybdis_config); + maybe_update_pointing_device_cpi(&g_charybdis_config); + eeconfig_init_user(); } -__attribute__((weak)) void keyboard_post_init_sync(void) {} -void keyboard_post_init_kb(void) { - keyboard_post_init_sync(); - keyboard_post_init_user(); +void matrix_power_up(void) { pointing_device_task(); } + +void charybdis_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(g_charybdis_config)) { + memcpy(&g_charybdis_config, initiator2target_buffer, sizeof(g_charybdis_config)); + } } -#ifdef POINTING_DEVICE_ENABLE -void pointing_device_init_kb(void) { - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); - pointing_device_init_user(); +void keyboard_post_init_kb(void) { + transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, charybdis_config_sync_handler); + + keyboard_post_init_user(); } -report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { +void housekeeping_task_kb(void) { if (is_keyboard_master()) { - mouse_report = pointing_device_task_user(mouse_report); + // Keep track of the last state, so that we can tell if we need to propagate to slave + static charybdis_config_t last_charybdis_config = {0}; + static uint32_t last_sync = 0; + bool needs_sync = false; + + // Check if the state values are different + if (memcmp(&g_charybdis_config, &last_charybdis_config, sizeof(g_charybdis_config))) { + needs_sync = true; + memcpy(&last_charybdis_config, &g_charybdis_config, sizeof(g_charybdis_config)); + } + // Send to slave every 500ms regardless of state change + if (timer_elapsed32(last_sync) > 500) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(g_charybdis_config), &g_charybdis_config)) { + last_sync = timer_read32(); + } + } } - return mouse_report; + // no need for user function, is called already } -#endif -void eeconfig_init_kb(void) { - keyboard_config.dpi_config = TRACKBALL_DPI_DEFAULT; -#ifdef POINTING_DEVICE_ENABLE - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); -#endif - eeconfig_update_kb(keyboard_config.raw); - eeconfig_init_user(); -} +#endif // POINTING_DEVICE_ENABLE __attribute__((weak)) void matrix_init_sub_kb(void) {} void matrix_init_kb(void) { - // is safe to just read DPI setting since matrix init - // comes before pointing device init. - keyboard_config.raw = eeconfig_read_kb(); - if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { - eeconfig_init_kb(); - } +#ifdef POINTING_DEVICE_ENABLE + read_charybdis_config_from_eeprom(&g_charybdis_config); +#endif // POINTING_DEVICE_ENABLE matrix_init_sub_kb(); matrix_init_user(); } @@ -134,13 +389,3 @@ void matrix_scan_kb(void) { matrix_scan_sub_kb(); matrix_scan_user(); } - -__attribute__((weak)) void housekeeping_task_sync(void) {} -void housekeeping_task_kb(void) { - housekeeping_task_sync(); - // no need for user function, is called already -} - -#ifdef POINTING_DEVICE_ENABLE -void matrix_power_up(void) { pointing_device_task(); } -#endif diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index c3acade6f1d0..197aee985e59 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -17,7 +17,6 @@ #pragma once #include "quantum.h" -#include "pointing_device.h" #if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) # include "5x6_right.h" @@ -25,30 +24,100 @@ # include "4x6_right.h" #endif -typedef union { - uint32_t raw; - struct { - uint8_t dpi_config; - }; -} keyboard_config_t; - -extern keyboard_config_t keyboard_config; - -enum ploopy_keycodes { - DPI_CONFIG = SAFE_RANGE, +#ifdef POINTING_DEVICE_ENABLE +# ifndef NO_CHARYBDIS_KEYCODES +enum charybdis_keycodes { +# ifdef VIA_ENABLE + POINTER_DEFAULT_DPI_FORWARD = USER00, +# else + POINTER_DEFAULT_DPI_FORWARD = SAFE_RANGE, +# endif // VIA_ENABLE + POINTER_DEFAULT_DPI_REVERSE, + POINTER_SNIPING_DPI_FORWARD, + POINTER_SNIPING_DPI_REVERSE, + SNIPING_MODE, + SNIPING_MODE_TOGGLE, + DRAGSCROLL_MODE, + DRAGSCROLL_MODE_TOGGLE, KEYMAP_SAFE_RANGE, }; +# define CHARYBDIS_SAFE_RANGE KEYMAP_SAFE_RANGE +# define DPI_MOD POINTER_DEFAULT_DPI_FORWARD +# define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE +# define S_D_MOD POINTER_SNIPING_DPI_FORWARD +# define S_D_RMOD POINTER_SNIPING_DPI_REVERSE +# define SNIPING SNIPING_MODE +# define SNP_TOG SNIPING_MODE_TOGGLE +# define DRGSCRL DRAGSCROLL_MODE +# define DRG_TOG DRAGSCROLL_MODE_TOGGLE +# endif // !NO_CHARYBDIS_KEYCODES -typedef struct { - uint16_t device_cpi; -} kb_config_data_t; +/** \brief Return the current DPI value for the pointer's default mode. */ +uint16_t charybdis_get_pointer_default_dpi(void); -extern kb_config_data_t kb_config; +/** + * \brief Update the pointer's default DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP. + * + * The new value is persisted in EEPROM. + */ +void charybdis_cycle_pointer_default_dpi(bool forward); + +/** + * \brief Same as `charybdis_cycle_pointer_default_dpi`, but do not write to + * EEPROM. + * + * This means that reseting the board will revert the value to the last + * persisted one. + */ +void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward); + +/** \brief Return the current DPI value for the pointer's sniper-mode. */ +uint16_t charybdis_get_pointer_sniping_dpi(void); + +/** + * \brief Update the pointer's sniper-mode DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP. + * + * The new value is persisted in EEPROM. + */ +void charybdis_cycle_pointer_sniping_dpi(bool forward); + +/** + * \brief Same as `charybdis_cycle_pointer_sniping_dpi`, but do not write to + * EEPROM. + * + * This means that reseting the board will revert the value to the last + * persisted one. + */ +void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward); + +/** \brief Whether sniper-mode is enabled. */ +bool charybdis_get_pointer_sniping_enabled(void); + +/** + * \brief Enable/disable sniper mode. + * + * When sniper mode is enabled the dpi is reduced to slow down the pointer for + * more accurate movements. + */ +void charybdis_set_pointer_sniping_enabled(bool enable); + +/** \brief Whether drag-scroll is enabled. */ +bool charybdis_get_pointer_dragscroll_enabled(void); + +/** + * \brief Enable/disable drag-scroll mode. + * + * When drag-scroll mode is enabled, horizontal and vertical pointer movements + * are translated into horizontal and vertical scroll movements. + */ +void charybdis_set_pointer_dragscroll_enabled(bool enable); +#endif // POINTING_DEVICE_ENABLE -void trackball_set_cpi(uint16_t cpi); void matrix_init_sub_kb(void); void matrix_scan_sub_kb(void); - -void keyboard_pre_init_sync(void); -void keyboard_post_init_sync(void); -void housekeeping_task_sync(void); diff --git a/keyboards/handwired/twadlee/tp69/rules.mk b/keyboards/handwired/twadlee/tp69/rules.mk index 216e797c4b8e..a1c290cf15bf 100644 --- a/keyboards/handwired/twadlee/tp69/rules.mk +++ b/keyboards/handwired/twadlee/tp69/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = MKL26Z64 +# Bootloader selection +BOOTLOADER = halfkay + # Build Options # change yes to no to disable # diff --git a/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/config.h b/keyboards/handwired/wakizashi40/config.h similarity index 61% rename from platforms/chibios/boards/GENERIC_STM32_G431XB/configs/config.h rename to keyboards/handwired/wakizashi40/config.h index 39ce627e771d..78f85f219745 100644 --- a/platforms/chibios/boards/GENERIC_STM32_G431XB/configs/config.h +++ b/keyboards/handwired/wakizashi40/config.h @@ -1,4 +1,4 @@ -/* Copyright 2018-2020 Nick Brassel (@tzarc) +/* Copyright 2021 xiao (@xia0) * * 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 @@ -14,10 +14,7 @@ * along with this program. If not, see . */ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here (page 175): - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 +#pragma once + +#include "config_common.h" +#define DYNAMIC_KEYMAP_LAYER_COUNT 12 diff --git a/keyboards/handwired/wakizashi40/info.json b/keyboards/handwired/wakizashi40/info.json new file mode 100644 index 000000000000..b64ab55116e2 --- /dev/null +++ b/keyboards/handwired/wakizashi40/info.json @@ -0,0 +1,88 @@ +{ + "manufacturer": "fumbucker", + "keyboard_name": "Wakizashi 40", + "maintainer": "fumbucker", + "debounce": 5, + "processor": "at90usb1286", + "diode_direction": "COL2ROW", + "features": { + "audio": false, + "backlight": false, + "bluetooth": false, + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "midi": false, + "mousekey": true, + "nkro": true, + "rgblight": false, + "unicode": false + }, + "matrix_pins": { + "cols": ["C5", "C4", "D2", "D3", "D4", "D5", "C6", "D7", "B0", "B1", "B2", "B3", "B4"], + "rows": ["C0", "C1", "C2", "C3"] + }, + "usb": { + "device_ver": "0x0001", + "pid": "0x7740", + "vid": "0x6662" + }, + "layout_aliases": { + "LAYOUT": "LAYOUT_all" + }, + "layouts": { + "LAYOUT_all": { + "layout": [ + { "label": "TAB", "matrix": [0, 0], "w": 1.5, "x": 0, "y": 0 }, + { "label": "Q", "matrix": [0, 2], "w": 1, "x": 1.5, "y": 0 }, + { "label": "W", "matrix": [0, 3], "w": 1, "x": 2.5, "y": 0 }, + { "label": "E", "matrix": [0, 4], "w": 1, "x": 3.5, "y": 0 }, + { "label": "R", "matrix": [0, 5], "w": 1, "x": 4.5, "y": 0 }, + { "label": "T", "matrix": [0, 6], "w": 1, "x": 5.5, "y": 0 }, + { "label": "Y", "matrix": [0, 7], "w": 1, "x": 6.5, "y": 0 }, + { "label": "U", "matrix": [0, 8], "w": 1, "x": 7.5, "y": 0 }, + { "label": "I", "matrix": [0, 9], "w": 1, "x": 8.5, "y": 0 }, + { "label": "O", "matrix": [0, 10], "w": 1, "x": 9.5, "y": 0 }, + { "label": "P", "matrix": [0, 11], "w": 1, "x": 10.5, "y": 0 }, + { "label": "BACKSPACE", "matrix": [0, 12], "w": 1.5, "x": 11.5, "y": 0 }, + + { "label": "CAPSLOCK", "matrix": [1, 0], "w": 1.25, "x": 0, "y": 1 }, + { "label": "A", "matrix": [1, 1], "w": 1, "x": 1.25, "y": 1 }, + { "label": "S", "matrix": [1, 2], "w": 1, "x": 2.25, "y": 1 }, + { "label": "D", "matrix": [1, 3], "w": 1, "x": 3.25, "y": 1 }, + { "label": "F", "matrix": [1, 4], "w": 1, "x": 4.25, "y": 1 }, + { "label": "G", "matrix": [1, 5], "w": 1, "x": 5.75, "y": 1 }, + { "label": "H", "matrix": [1, 7], "w": 1, "x": 6.75, "y": 1 }, + { "label": "J", "matrix": [1, 8], "w": 1, "x": 7.75, "y": 1 }, + { "label": "K", "matrix": [1, 9], "w": 1, "x": 8.75, "y": 1 }, + { "label": "L", "matrix": [1, 10], "w": 1, "x": 9.75, "y": 1 }, + { "label": "SEMICOLON", "matrix": [1, 11], "w": 1, "x": 10.75, "y": 1 }, + { "label": "ENTER", "matrix": [1, 12], "w": 1.25, "x": 11.75, "y": 1 }, + + { "label": "LSHIFT", "matrix": [2, 0], "w": 1, "x": 0, "y": 2 }, + { "label": "Z", "matrix": [2, 1], "w": 1, "x": 1, "y": 2 }, + { "label": "X", "matrix": [2, 2], "w": 1, "x": 2, "y": 2 }, + { "label": "C", "matrix": [2, 3], "w": 1, "x": 3, "y": 2 }, + { "label": "V", "matrix": [2, 4], "w": 1, "x": 4, "y": 2 }, + { "label": "B", "matrix": [2, 5], "w": 1, "x": 5, "y": 2 }, + { "label": "ESCAPE", "matrix": [2, 6], "w": 1, "x": 6, "y": 2 }, + { "label": "N", "matrix": [2, 7], "w": 1, "x": 7, "y": 2 }, + { "label": "M", "matrix": [2, 8], "w": 1, "x": 8, "y": 2 }, + { "label": "COMMA", "matrix": [2, 9], "w": 1, "x": 9, "y": 2 }, + { "label": "PERIOD", "matrix": [2, 10], "w": 1, "x": 10, "y": 2 }, + { "label": "SLASH", "matrix": [2, 11], "w": 1, "x": 11, "y": 2 }, + { "label": "RSHIFT", "matrix": [2, 12], "w": 1, "x": 12, "y": 2 }, + + { "label": "LCTRL", "matrix": [3, 0], "w": 1.25, "x": 0, "y": 3 }, + { "label": "LWIN", "matrix": [3, 1], "w": 1.25, "x": 1.25, "y": 3 }, + { "label": "LALT", "matrix": [3, 3], "w": 1.25, "x": 2.5, "y": 3 }, + { "label": "SPACE1", "matrix": [3, 5], "w": 2.75, "x": 3.75, "y": 3 }, + { "label": "SPACE2", "matrix": [3, 7], "w": 2.75, "x": 6.5, "y": 3 }, + { "label": "RALT", "matrix": [3, 9], "w": 1.25, "x": 9.25, "y": 3 }, + { "label": "MENU", "matrix": [3, 11], "w": 1.25, "x": 10.5, "y": 3 }, + { "label": "RCTRL", "matrix": [3, 12], "w": 1.25, "x": 11.75, "y": 3 } + ] + } + } +} diff --git a/keyboards/handwired/wakizashi40/keymaps/default/keymap.c b/keyboards/handwired/wakizashi40/keymaps/default/keymap.c new file mode 100644 index 000000000000..910e5bde123b --- /dev/null +++ b/keyboards/handwired/wakizashi40/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2021 xiao (@xia0) + * + * 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 QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, 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_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(2, KC_SPC), KC_LALT, KC_MENU, KC_LCTL), + + [1] = LAYOUT_all( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + MO(3), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_TRNS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + MO(11), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_QUOT, + 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_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_QUOT, + 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, KC_TRNS, KC_TRNS, KC_TRNS) + +}; diff --git a/keyboards/handwired/wakizashi40/keymaps/via/keymap.c b/keyboards/handwired/wakizashi40/keymaps/via/keymap.c new file mode 100644 index 000000000000..d456b8b40a3b --- /dev/null +++ b/keyboards/handwired/wakizashi40/keymaps/via/keymap.c @@ -0,0 +1,92 @@ +/* Copyright 2021 xiao (@xia0) + * + * 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 QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, 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_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(2, KC_SPC), KC_LALT, KC_MENU, KC_LCTL), + + [1] = LAYOUT_all( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + MO(11), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_TRNS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + MO(11), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_QUOT, + 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_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_QUOT, + 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, KC_TRNS, KC_TRNS, KC_TRNS), + + [4] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [5] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [6] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [7] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [8] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [9] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [10] = LAYOUT_all( + 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, 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, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [11] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, 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, 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; diff --git a/keyboards/handwired/wakizashi40/keymaps/via/rules.mk b/keyboards/handwired/wakizashi40/keymaps/via/rules.mk new file mode 100644 index 000000000000..7a49719505df --- /dev/null +++ b/keyboards/handwired/wakizashi40/keymaps/via/rules.mk @@ -0,0 +1,4 @@ +# rules.mk overrides to enable VIA + +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/handwired/wakizashi40/readme.md b/keyboards/handwired/wakizashi40/readme.md new file mode 100644 index 000000000000..d94a75651cc9 --- /dev/null +++ b/keyboards/handwired/wakizashi40/readme.md @@ -0,0 +1,19 @@ +# Wakizashi 40 + +![Wakizashi40](https://cdn.thingiverse.com/renders/51/50/81/13/a9/7078248666f70b422127c6662cf79563_preview_featured.jpg) + +Reverse stagger 40% keyboard based on the Katana 60. + +* Keyboard Maintainer: [fumbucker](https://github.com/xia0) +* Hardware Supported: Teensy2++ +* Hardware Availability: [thingiverse](https://www.thingiverse.com/thing:3467930) + +Make example for this keyboard (after setting up your build environment): + + make handwired/wakizashi40:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +## Bootloader + +* **Keycode in layout**: Press the key mapped to `RESET` if it is available (Capslock + R). diff --git a/keyboards/handwired/wakizashi40/rules.mk b/keyboards/handwired/wakizashi40/rules.mk new file mode 100644 index 000000000000..6e7633bfe015 --- /dev/null +++ b/keyboards/handwired/wakizashi40/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index 8eed7e58b74d..699c15358bea 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -287,12 +287,6 @@ void matrix_slave_scan(void) { #endif } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/helix/rev2/split_util.h b/keyboards/helix/rev2/split_util.h index b839ce6e3ee7..535949118a7b 100644 --- a/keyboards/helix/rev2/split_util.h +++ b/keyboards/helix/rev2/split_util.h @@ -14,3 +14,7 @@ void split_keyboard_setup(void); bool is_helix_master(void); void matrix_master_OLED_init (void); + +// stubs as this is handled by legacy code +static inline void split_pre_init(void){} +static inline void split_post_init(void){} diff --git a/keyboards/hhkb/ansi/matrix.c b/keyboards/hhkb/ansi/matrix.c index 529ba8b8fc9f..5dde74cce9f8 100644 --- a/keyboards/hhkb/ansi/matrix.c +++ b/keyboards/hhkb/ansi/matrix.c @@ -163,15 +163,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix[i] != matrix_prev[i]) - return true; - } - return false; -} - inline bool matrix_has_ghost(void) { diff --git a/keyboards/hhkb/ansi/post_rules.mk b/keyboards/hhkb/ansi/post_rules.mk index bc6ad5cd4cb9..eb9a8f0adb2c 100644 --- a/keyboards/hhkb/ansi/post_rules.mk +++ b/keyboards/hhkb/ansi/post_rules.mk @@ -4,14 +4,14 @@ OPT_DEFS += -DHHKB_RN42_ENABLE # Support for the RN42 Bluetooth module. This is the BT module in Hasu's BT # HHKB Alt controller. -RN42_DIR = ../rn42 +RN42_DIR = keyboards/hhkb/rn42 SRC += serial_uart.c \ - ../rn42/suart.S \ - ../rn42/rn42.c \ - ../rn42/rn42_task.c \ - ../rn42/battery.c \ - ../rn42/main.c + suart.S \ + rn42.c \ + rn42_task.c \ + battery.c \ + main.c VPATH += $(RN42_DIR) diff --git a/keyboards/hhkb/jp/matrix.c b/keyboards/hhkb/jp/matrix.c index c0dca6a990b4..81db77fca7ae 100644 --- a/keyboards/hhkb/jp/matrix.c +++ b/keyboards/hhkb/jp/matrix.c @@ -164,15 +164,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix[i] != matrix_prev[i]) - return true; - } - return false; -} - inline bool matrix_has_ghost(void) { diff --git a/keyboards/hhkb/jp/post_rules.mk b/keyboards/hhkb/jp/post_rules.mk index bc6ad5cd4cb9..eb9a8f0adb2c 100644 --- a/keyboards/hhkb/jp/post_rules.mk +++ b/keyboards/hhkb/jp/post_rules.mk @@ -4,14 +4,14 @@ OPT_DEFS += -DHHKB_RN42_ENABLE # Support for the RN42 Bluetooth module. This is the BT module in Hasu's BT # HHKB Alt controller. -RN42_DIR = ../rn42 +RN42_DIR = keyboards/hhkb/rn42 SRC += serial_uart.c \ - ../rn42/suart.S \ - ../rn42/rn42.c \ - ../rn42/rn42_task.c \ - ../rn42/battery.c \ - ../rn42/main.c + suart.S \ + rn42.c \ + rn42_task.c \ + battery.c \ + main.c VPATH += $(RN42_DIR) diff --git a/keyboards/freyr/config.h b/keyboards/hnahkb/freyr/config.h similarity index 100% rename from keyboards/freyr/config.h rename to keyboards/hnahkb/freyr/config.h diff --git a/keyboards/freyr/freyr.c b/keyboards/hnahkb/freyr/freyr.c similarity index 100% rename from keyboards/freyr/freyr.c rename to keyboards/hnahkb/freyr/freyr.c diff --git a/keyboards/freyr/freyr.h b/keyboards/hnahkb/freyr/freyr.h similarity index 100% rename from keyboards/freyr/freyr.h rename to keyboards/hnahkb/freyr/freyr.h diff --git a/keyboards/freyr/info.json b/keyboards/hnahkb/freyr/info.json similarity index 100% rename from keyboards/freyr/info.json rename to keyboards/hnahkb/freyr/info.json diff --git a/keyboards/freyr/keymaps/default/keymap.c b/keyboards/hnahkb/freyr/keymaps/default/keymap.c similarity index 100% rename from keyboards/freyr/keymaps/default/keymap.c rename to keyboards/hnahkb/freyr/keymaps/default/keymap.c diff --git a/keyboards/freyr/keymaps/default/readme.md b/keyboards/hnahkb/freyr/keymaps/default/readme.md similarity index 100% rename from keyboards/freyr/keymaps/default/readme.md rename to keyboards/hnahkb/freyr/keymaps/default/readme.md diff --git a/keyboards/freyr/readme.md b/keyboards/hnahkb/freyr/readme.md similarity index 91% rename from keyboards/freyr/readme.md rename to keyboards/hnahkb/freyr/readme.md index 20fa484e8c40..93df05b4752d 100644 --- a/keyboards/freyr/readme.md +++ b/keyboards/hnahkb/freyr/readme.md @@ -11,10 +11,10 @@ Freyr is a tenkeyless keyboard, support ansi and iso layout. Make example for this keyboard (after setting up your build environment): - make freyr:default + make hnahkb/freyr:default Flashing example for this keyboard: - make freyr:default:flash + make hnahkb/freyr: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/freyr/rules.mk b/keyboards/hnahkb/freyr/rules.mk similarity index 100% rename from keyboards/freyr/rules.mk rename to keyboards/hnahkb/freyr/rules.mk diff --git a/keyboards/stella/config.h b/keyboards/hnahkb/stella/config.h similarity index 100% rename from keyboards/stella/config.h rename to keyboards/hnahkb/stella/config.h diff --git a/keyboards/stella/info.json b/keyboards/hnahkb/stella/info.json similarity index 100% rename from keyboards/stella/info.json rename to keyboards/hnahkb/stella/info.json diff --git a/keyboards/stella/keymaps/default/keymap.c b/keyboards/hnahkb/stella/keymaps/default/keymap.c similarity index 100% rename from keyboards/stella/keymaps/default/keymap.c rename to keyboards/hnahkb/stella/keymaps/default/keymap.c diff --git a/keyboards/stella/keymaps/default/readme.md b/keyboards/hnahkb/stella/keymaps/default/readme.md similarity index 100% rename from keyboards/stella/keymaps/default/readme.md rename to keyboards/hnahkb/stella/keymaps/default/readme.md diff --git a/keyboards/stella/readme.md b/keyboards/hnahkb/stella/readme.md similarity index 91% rename from keyboards/stella/readme.md rename to keyboards/hnahkb/stella/readme.md index f5820dcf9b40..32481d9d09de 100644 --- a/keyboards/stella/readme.md +++ b/keyboards/hnahkb/stella/readme.md @@ -10,10 +10,10 @@ A custom keyboard design for VGS community Make example for this keyboard (after setting up your build environment): - make stella:default + make hnahkb/stella:default Flashing example for this keyboard: - make stella:default:flash + make hnahkb/stella: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/stella/rules.mk b/keyboards/hnahkb/stella/rules.mk similarity index 100% rename from keyboards/stella/rules.mk rename to keyboards/hnahkb/stella/rules.mk diff --git a/keyboards/stella/stella.c b/keyboards/hnahkb/stella/stella.c similarity index 100% rename from keyboards/stella/stella.c rename to keyboards/hnahkb/stella/stella.c diff --git a/keyboards/stella/stella.h b/keyboards/hnahkb/stella/stella.h similarity index 100% rename from keyboards/stella/stella.h rename to keyboards/hnahkb/stella/stella.h diff --git a/keyboards/vn66/config.h b/keyboards/hnahkb/vn66/config.h similarity index 100% rename from keyboards/vn66/config.h rename to keyboards/hnahkb/vn66/config.h diff --git a/keyboards/vn66/info.json b/keyboards/hnahkb/vn66/info.json similarity index 100% rename from keyboards/vn66/info.json rename to keyboards/hnahkb/vn66/info.json diff --git a/keyboards/vn66/keymaps/default/keymap.c b/keyboards/hnahkb/vn66/keymaps/default/keymap.c similarity index 100% rename from keyboards/vn66/keymaps/default/keymap.c rename to keyboards/hnahkb/vn66/keymaps/default/keymap.c diff --git a/keyboards/vn66/keymaps/default/readme.md b/keyboards/hnahkb/vn66/keymaps/default/readme.md similarity index 100% rename from keyboards/vn66/keymaps/default/readme.md rename to keyboards/hnahkb/vn66/keymaps/default/readme.md diff --git a/keyboards/vn66/readme.md b/keyboards/hnahkb/vn66/readme.md similarity index 90% rename from keyboards/vn66/readme.md rename to keyboards/hnahkb/vn66/readme.md index 9b043cb08107..f917da5ea531 100644 --- a/keyboards/vn66/readme.md +++ b/keyboards/hnahkb/vn66/readme.md @@ -10,10 +10,10 @@ A compact 60% keyboard for VNMK Make example for this keyboard (after setting up your build environment): - make vn66:default + make hnahkb/vn66:default Flashing example for this keyboard: - make vn66:default:flash + make hnahkb/vn66: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/vn66/rules.mk b/keyboards/hnahkb/vn66/rules.mk similarity index 100% rename from keyboards/vn66/rules.mk rename to keyboards/hnahkb/vn66/rules.mk diff --git a/keyboards/vn66/vn66.c b/keyboards/hnahkb/vn66/vn66.c similarity index 100% rename from keyboards/vn66/vn66.c rename to keyboards/hnahkb/vn66/vn66.c diff --git a/keyboards/vn66/vn66.h b/keyboards/hnahkb/vn66/vn66.h similarity index 100% rename from keyboards/vn66/vn66.h rename to keyboards/hnahkb/vn66/vn66.h diff --git a/keyboards/honeycomb/config.h b/keyboards/honeycomb/config.h index 725f9490cbe4..c9595436183f 100755 --- a/keyboards/honeycomb/config.h +++ b/keyboards/honeycomb/config.h @@ -45,12 +45,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/honeycomb/honeycomb.c b/keyboards/honeycomb/honeycomb.c index 1254196d39c2..603400c7a39a 100755 --- a/keyboards/honeycomb/honeycomb.c +++ b/keyboards/honeycomb/honeycomb.c @@ -7,7 +7,7 @@ void pointing_device_task(void){ uint32_t timeout = 0; //the m character requests the RF slave to send the mouse report - SERIAL_UART_DATA = 'm'; + uart_write('m'); //trust the external inputs completely, erase old data uint8_t uart_data[5] = {0}; @@ -17,7 +17,7 @@ void pointing_device_task(void){ //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while(!uart_available()){ timeout++; if (timeout > 10000){ xprintf("\r\nTIMED OUT"); @@ -25,7 +25,7 @@ void pointing_device_task(void){ } } xprintf("\r\nGOT DATA for %d",i); - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, bytes 1-4 are movement and scroll diff --git a/keyboards/honeycomb/matrix.c b/keyboards/honeycomb/matrix.c index 7fef6f0fd852..fe1e4ce8ff6a 100755 --- a/keyboards/honeycomb/matrix.c +++ b/keyboards/honeycomb/matrix.c @@ -30,7 +30,7 @@ along with this program. If not, see . #include "honeycomb.h" #include "pointing_device.h" #include "report.h" -#include "protocol/serial.h" +#include "uart.h" #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") @@ -95,7 +95,7 @@ uint8_t matrix_cols(void) { void matrix_init(void) { matrix_init_quantum(); - serial_init(); + uart_init(1000000); } uint8_t matrix_scan(void) @@ -103,7 +103,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; // The 's' character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); // Trust the external keystates entirely, erase the last data uint8_t uart_data[4] = {0}; @@ -113,14 +113,14 @@ uint8_t matrix_scan(void) // Wait for the serial data, timeout if it's been too long // This only happened in testing with a loose wire, but does no // harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while(!uart_available()){ timeout++; if (timeout > 10000){ xprintf("\r\nTime out in keyboard."); break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } // Check for the end packet, it's our checksum. diff --git a/keyboards/honeycomb/rules.mk b/keyboards/honeycomb/rules.mk index 2b5eb0360cc9..420e409e4398 100755 --- a/keyboards/honeycomb/rules.mk +++ b/keyboards/honeycomb/rules.mk @@ -10,6 +10,7 @@ BOOTLOADER = caterina BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite #MOUSEKEY_ENABLE = yes # Mouse keys POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. +POINTING_DEVICE_DRIVER = custom EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration @@ -18,4 +19,5 @@ NKRO_ENABLE = yes # Enable N-Key Rollover # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # # project specific files -SRC += matrix.c serial_uart.c +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/alicia_cook/alicia_cook.c b/keyboards/ibnuda/alicia_cook/alicia_cook.c similarity index 100% rename from keyboards/alicia_cook/alicia_cook.c rename to keyboards/ibnuda/alicia_cook/alicia_cook.c diff --git a/keyboards/alicia_cook/alicia_cook.h b/keyboards/ibnuda/alicia_cook/alicia_cook.h similarity index 100% rename from keyboards/alicia_cook/alicia_cook.h rename to keyboards/ibnuda/alicia_cook/alicia_cook.h diff --git a/keyboards/alicia_cook/config.h b/keyboards/ibnuda/alicia_cook/config.h similarity index 100% rename from keyboards/alicia_cook/config.h rename to keyboards/ibnuda/alicia_cook/config.h diff --git a/keyboards/alicia_cook/info.json b/keyboards/ibnuda/alicia_cook/info.json similarity index 100% rename from keyboards/alicia_cook/info.json rename to keyboards/ibnuda/alicia_cook/info.json diff --git a/keyboards/alicia_cook/keymaps/default/keymap.c b/keyboards/ibnuda/alicia_cook/keymaps/default/keymap.c similarity index 100% rename from keyboards/alicia_cook/keymaps/default/keymap.c rename to keyboards/ibnuda/alicia_cook/keymaps/default/keymap.c diff --git a/keyboards/alicia_cook/keymaps/default/readme.md b/keyboards/ibnuda/alicia_cook/keymaps/default/readme.md similarity index 100% rename from keyboards/alicia_cook/keymaps/default/readme.md rename to keyboards/ibnuda/alicia_cook/keymaps/default/readme.md diff --git a/keyboards/alicia_cook/keymaps/rick/config.h b/keyboards/ibnuda/alicia_cook/keymaps/rick/config.h similarity index 100% rename from keyboards/alicia_cook/keymaps/rick/config.h rename to keyboards/ibnuda/alicia_cook/keymaps/rick/config.h diff --git a/keyboards/alicia_cook/keymaps/rick/keymap.c b/keyboards/ibnuda/alicia_cook/keymaps/rick/keymap.c similarity index 100% rename from keyboards/alicia_cook/keymaps/rick/keymap.c rename to keyboards/ibnuda/alicia_cook/keymaps/rick/keymap.c diff --git a/keyboards/alicia_cook/keymaps/rick/readme.md b/keyboards/ibnuda/alicia_cook/keymaps/rick/readme.md similarity index 100% rename from keyboards/alicia_cook/keymaps/rick/readme.md rename to keyboards/ibnuda/alicia_cook/keymaps/rick/readme.md diff --git a/keyboards/alicia_cook/keymaps/rick/rules.mk b/keyboards/ibnuda/alicia_cook/keymaps/rick/rules.mk similarity index 100% rename from keyboards/alicia_cook/keymaps/rick/rules.mk rename to keyboards/ibnuda/alicia_cook/keymaps/rick/rules.mk diff --git a/keyboards/alicia_cook/readme.md b/keyboards/ibnuda/alicia_cook/readme.md similarity index 92% rename from keyboards/alicia_cook/readme.md rename to keyboards/ibnuda/alicia_cook/readme.md index 4e37a366e71b..f4475cd22ee7 100644 --- a/keyboards/alicia_cook/readme.md +++ b/keyboards/ibnuda/alicia_cook/readme.md @@ -10,11 +10,11 @@ Make example for this keyboard (after setting up your build environment): - make alicia_cook:default + make ibnuda/alicia_cook:default Flashing example for this keyboard: - make alicia_cook:default:flash + make ibnuda/alicia_cook: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/alicia_cook/rules.mk b/keyboards/ibnuda/alicia_cook/rules.mk similarity index 100% rename from keyboards/alicia_cook/rules.mk rename to keyboards/ibnuda/alicia_cook/rules.mk diff --git a/keyboards/gurindam/config.h b/keyboards/ibnuda/gurindam/config.h similarity index 100% rename from keyboards/gurindam/config.h rename to keyboards/ibnuda/gurindam/config.h diff --git a/keyboards/gurindam/gurindam.c b/keyboards/ibnuda/gurindam/gurindam.c similarity index 100% rename from keyboards/gurindam/gurindam.c rename to keyboards/ibnuda/gurindam/gurindam.c diff --git a/keyboards/gurindam/gurindam.h b/keyboards/ibnuda/gurindam/gurindam.h similarity index 100% rename from keyboards/gurindam/gurindam.h rename to keyboards/ibnuda/gurindam/gurindam.h diff --git a/keyboards/gurindam/info.json b/keyboards/ibnuda/gurindam/info.json similarity index 100% rename from keyboards/gurindam/info.json rename to keyboards/ibnuda/gurindam/info.json diff --git a/keyboards/gurindam/keymaps/default/keymap.c b/keyboards/ibnuda/gurindam/keymaps/default/keymap.c similarity index 100% rename from keyboards/gurindam/keymaps/default/keymap.c rename to keyboards/ibnuda/gurindam/keymaps/default/keymap.c diff --git a/keyboards/gurindam/keymaps/default/readme.md b/keyboards/ibnuda/gurindam/keymaps/default/readme.md similarity index 100% rename from keyboards/gurindam/keymaps/default/readme.md rename to keyboards/ibnuda/gurindam/keymaps/default/readme.md diff --git a/keyboards/gurindam/keymaps/via/keymap.c b/keyboards/ibnuda/gurindam/keymaps/via/keymap.c similarity index 100% rename from keyboards/gurindam/keymaps/via/keymap.c rename to keyboards/ibnuda/gurindam/keymaps/via/keymap.c diff --git a/keyboards/7skb/keymaps/via/rules.mk b/keyboards/ibnuda/gurindam/keymaps/via/rules.mk similarity index 100% rename from keyboards/7skb/keymaps/via/rules.mk rename to keyboards/ibnuda/gurindam/keymaps/via/rules.mk diff --git a/keyboards/gurindam/readme.md b/keyboards/ibnuda/gurindam/readme.md similarity index 96% rename from keyboards/gurindam/readme.md rename to keyboards/ibnuda/gurindam/readme.md index 0f6ae158b00c..072084f4f07d 100644 --- a/keyboards/gurindam/readme.md +++ b/keyboards/ibnuda/gurindam/readme.md @@ -10,7 +10,7 @@ A keyboard inspired by Arisu which in turn by Lyn's EM7 and TGR Alice. Make example for this keyboard (after setting up your build environment): - make gurindam:default + make ibnuda/gurindam: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/gurindam/rules.mk b/keyboards/ibnuda/gurindam/rules.mk similarity index 100% rename from keyboards/gurindam/rules.mk rename to keyboards/ibnuda/gurindam/rules.mk diff --git a/keyboards/squiggle/config.h b/keyboards/ibnuda/squiggle/config.h similarity index 100% rename from keyboards/squiggle/config.h rename to keyboards/ibnuda/squiggle/config.h diff --git a/keyboards/squiggle/keymaps/default/config.h b/keyboards/ibnuda/squiggle/keymaps/default/config.h similarity index 100% rename from keyboards/squiggle/keymaps/default/config.h rename to keyboards/ibnuda/squiggle/keymaps/default/config.h diff --git a/keyboards/squiggle/keymaps/default/keymap.c b/keyboards/ibnuda/squiggle/keymaps/default/keymap.c similarity index 100% rename from keyboards/squiggle/keymaps/default/keymap.c rename to keyboards/ibnuda/squiggle/keymaps/default/keymap.c diff --git a/keyboards/squiggle/keymaps/default/readme.md b/keyboards/ibnuda/squiggle/keymaps/default/readme.md similarity index 100% rename from keyboards/squiggle/keymaps/default/readme.md rename to keyboards/ibnuda/squiggle/keymaps/default/readme.md diff --git a/keyboards/le_chiffre/keymaps/default/rules.mk b/keyboards/ibnuda/squiggle/keymaps/default/rules.mk similarity index 100% rename from keyboards/le_chiffre/keymaps/default/rules.mk rename to keyboards/ibnuda/squiggle/keymaps/default/rules.mk diff --git a/keyboards/squiggle/keymaps/default38/config.h b/keyboards/ibnuda/squiggle/keymaps/default38/config.h similarity index 100% rename from keyboards/squiggle/keymaps/default38/config.h rename to keyboards/ibnuda/squiggle/keymaps/default38/config.h diff --git a/keyboards/squiggle/keymaps/default38/keymap.c b/keyboards/ibnuda/squiggle/keymaps/default38/keymap.c similarity index 100% rename from keyboards/squiggle/keymaps/default38/keymap.c rename to keyboards/ibnuda/squiggle/keymaps/default38/keymap.c diff --git a/keyboards/squiggle/keymaps/default38/readme.md b/keyboards/ibnuda/squiggle/keymaps/default38/readme.md similarity index 100% rename from keyboards/squiggle/keymaps/default38/readme.md rename to keyboards/ibnuda/squiggle/keymaps/default38/readme.md diff --git a/keyboards/minidox/keymaps/rsthd_combos/rules.mk b/keyboards/ibnuda/squiggle/keymaps/default38/rules.mk similarity index 100% rename from keyboards/minidox/keymaps/rsthd_combos/rules.mk rename to keyboards/ibnuda/squiggle/keymaps/default38/rules.mk diff --git a/keyboards/squiggle/keymaps/defaultfull/config.h b/keyboards/ibnuda/squiggle/keymaps/defaultfull/config.h similarity index 100% rename from keyboards/squiggle/keymaps/defaultfull/config.h rename to keyboards/ibnuda/squiggle/keymaps/defaultfull/config.h diff --git a/keyboards/squiggle/keymaps/defaultfull/keymap.c b/keyboards/ibnuda/squiggle/keymaps/defaultfull/keymap.c similarity index 100% rename from keyboards/squiggle/keymaps/defaultfull/keymap.c rename to keyboards/ibnuda/squiggle/keymaps/defaultfull/keymap.c diff --git a/keyboards/squiggle/keymaps/defaultfull/readme.md b/keyboards/ibnuda/squiggle/keymaps/defaultfull/readme.md similarity index 100% rename from keyboards/squiggle/keymaps/defaultfull/readme.md rename to keyboards/ibnuda/squiggle/keymaps/defaultfull/readme.md diff --git a/keyboards/ogurec/keymaps/default/rules.mk b/keyboards/ibnuda/squiggle/keymaps/defaultfull/rules.mk similarity index 100% rename from keyboards/ogurec/keymaps/default/rules.mk rename to keyboards/ibnuda/squiggle/keymaps/defaultfull/rules.mk diff --git a/keyboards/squiggle/keymaps/defaultminidox/config.h b/keyboards/ibnuda/squiggle/keymaps/defaultminidox/config.h similarity index 100% rename from keyboards/squiggle/keymaps/defaultminidox/config.h rename to keyboards/ibnuda/squiggle/keymaps/defaultminidox/config.h diff --git a/keyboards/squiggle/keymaps/defaultminidox/keymap.c b/keyboards/ibnuda/squiggle/keymaps/defaultminidox/keymap.c similarity index 100% rename from keyboards/squiggle/keymaps/defaultminidox/keymap.c rename to keyboards/ibnuda/squiggle/keymaps/defaultminidox/keymap.c diff --git a/keyboards/squiggle/keymaps/defaultminidox/readme.md b/keyboards/ibnuda/squiggle/keymaps/defaultminidox/readme.md similarity index 100% rename from keyboards/squiggle/keymaps/defaultminidox/readme.md rename to keyboards/ibnuda/squiggle/keymaps/defaultminidox/readme.md diff --git a/keyboards/packrat/keymaps/3uc/rules.mk b/keyboards/ibnuda/squiggle/keymaps/defaultminidox/rules.mk similarity index 100% rename from keyboards/packrat/keymaps/3uc/rules.mk rename to keyboards/ibnuda/squiggle/keymaps/defaultminidox/rules.mk diff --git a/keyboards/squiggle/keymaps/rick-complicated/config.h b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/config.h similarity index 100% rename from keyboards/squiggle/keymaps/rick-complicated/config.h rename to keyboards/ibnuda/squiggle/keymaps/rick-complicated/config.h diff --git a/keyboards/squiggle/keymaps/rick-complicated/keymap.c b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c similarity index 100% rename from keyboards/squiggle/keymaps/rick-complicated/keymap.c rename to keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c diff --git a/keyboards/squiggle/keymaps/rick-complicated/readme.md b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/readme.md similarity index 100% rename from keyboards/squiggle/keymaps/rick-complicated/readme.md rename to keyboards/ibnuda/squiggle/keymaps/rick-complicated/readme.md diff --git a/keyboards/squiggle/keymaps/rick-complicated/rules.mk b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/rules.mk similarity index 100% rename from keyboards/squiggle/keymaps/rick-complicated/rules.mk rename to keyboards/ibnuda/squiggle/keymaps/rick-complicated/rules.mk diff --git a/keyboards/squiggle/keymaps/rick/config.h b/keyboards/ibnuda/squiggle/keymaps/rick/config.h similarity index 100% rename from keyboards/squiggle/keymaps/rick/config.h rename to keyboards/ibnuda/squiggle/keymaps/rick/config.h diff --git a/keyboards/squiggle/keymaps/rick/keymap.c b/keyboards/ibnuda/squiggle/keymaps/rick/keymap.c similarity index 100% rename from keyboards/squiggle/keymaps/rick/keymap.c rename to keyboards/ibnuda/squiggle/keymaps/rick/keymap.c diff --git a/keyboards/squiggle/keymaps/rick/readme.md b/keyboards/ibnuda/squiggle/keymaps/rick/readme.md similarity index 100% rename from keyboards/squiggle/keymaps/rick/readme.md rename to keyboards/ibnuda/squiggle/keymaps/rick/readme.md diff --git a/keyboards/packrat/keymaps/default/rules.mk b/keyboards/ibnuda/squiggle/keymaps/rick/rules.mk similarity index 100% rename from keyboards/packrat/keymaps/default/rules.mk rename to keyboards/ibnuda/squiggle/keymaps/rick/rules.mk diff --git a/keyboards/squiggle/readme.md b/keyboards/ibnuda/squiggle/readme.md similarity index 95% rename from keyboards/squiggle/readme.md rename to keyboards/ibnuda/squiggle/readme.md index 8d7b58125e4a..95204ade57d7 100644 --- a/keyboards/squiggle/readme.md +++ b/keyboards/ibnuda/squiggle/readme.md @@ -15,7 +15,7 @@ It's a keyboard family which has the following requirements: Make example for this keyboard (after setting up your build environment): - make squiggle:default + make ibnuda/squiggle: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/bigseries/2key/.noci b/keyboards/ibnuda/squiggle/rev1/.noci similarity index 100% rename from keyboards/bigseries/2key/.noci rename to keyboards/ibnuda/squiggle/rev1/.noci diff --git a/keyboards/squiggle/rev1/config.h b/keyboards/ibnuda/squiggle/rev1/config.h similarity index 100% rename from keyboards/squiggle/rev1/config.h rename to keyboards/ibnuda/squiggle/rev1/config.h diff --git a/keyboards/squiggle/rev1/info.json b/keyboards/ibnuda/squiggle/rev1/info.json similarity index 100% rename from keyboards/squiggle/rev1/info.json rename to keyboards/ibnuda/squiggle/rev1/info.json diff --git a/keyboards/claw44/rev1/rev1.c b/keyboards/ibnuda/squiggle/rev1/rev1.c similarity index 100% rename from keyboards/claw44/rev1/rev1.c rename to keyboards/ibnuda/squiggle/rev1/rev1.c diff --git a/keyboards/squiggle/rev1/rev1.h b/keyboards/ibnuda/squiggle/rev1/rev1.h similarity index 100% rename from keyboards/squiggle/rev1/rev1.h rename to keyboards/ibnuda/squiggle/rev1/rev1.h diff --git a/keyboards/squiggle/rev1/rules.mk b/keyboards/ibnuda/squiggle/rev1/rules.mk similarity index 100% rename from keyboards/squiggle/rev1/rules.mk rename to keyboards/ibnuda/squiggle/rev1/rules.mk diff --git a/keyboards/ibnuda/squiggle/rules.mk b/keyboards/ibnuda/squiggle/rules.mk new file mode 100644 index 000000000000..0214333999bd --- /dev/null +++ b/keyboards/ibnuda/squiggle/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = ibnuda/squiggle/rev1 diff --git a/keyboards/squiggle/squiggle.c b/keyboards/ibnuda/squiggle/squiggle.c similarity index 100% rename from keyboards/squiggle/squiggle.c rename to keyboards/ibnuda/squiggle/squiggle.c diff --git a/keyboards/squiggle/squiggle.h b/keyboards/ibnuda/squiggle/squiggle.h similarity index 95% rename from keyboards/squiggle/squiggle.h rename to keyboards/ibnuda/squiggle/squiggle.h index 1f3e48552fc1..4ed95e707cec 100644 --- a/keyboards/squiggle/squiggle.h +++ b/keyboards/ibnuda/squiggle/squiggle.h @@ -16,7 +16,7 @@ #pragma once -#ifdef KEYBOARD_squiggle_rev1 +#ifdef KEYBOARD_ibnuda_squiggle_rev1 #include "rev1.h" #endif diff --git a/keyboards/id67/default_rgb/config.h b/keyboards/idobao/id67/default_rgb/config.h similarity index 100% rename from keyboards/id67/default_rgb/config.h rename to keyboards/idobao/id67/default_rgb/config.h diff --git a/keyboards/id67/default_rgb/default_rgb.c b/keyboards/idobao/id67/default_rgb/default_rgb.c similarity index 100% rename from keyboards/id67/default_rgb/default_rgb.c rename to keyboards/idobao/id67/default_rgb/default_rgb.c diff --git a/keyboards/id67/default_rgb/default_rgb.h b/keyboards/idobao/id67/default_rgb/default_rgb.h similarity index 100% rename from keyboards/id67/default_rgb/default_rgb.h rename to keyboards/idobao/id67/default_rgb/default_rgb.h diff --git a/keyboards/id67/default_rgb/info.json b/keyboards/idobao/id67/default_rgb/info.json similarity index 100% rename from keyboards/id67/default_rgb/info.json rename to keyboards/idobao/id67/default_rgb/info.json diff --git a/keyboards/id67/default_rgb/readme.md b/keyboards/idobao/id67/default_rgb/readme.md similarity index 100% rename from keyboards/id67/default_rgb/readme.md rename to keyboards/idobao/id67/default_rgb/readme.md diff --git a/keyboards/id67/default_rgb/rules.mk b/keyboards/idobao/id67/default_rgb/rules.mk similarity index 100% rename from keyboards/id67/default_rgb/rules.mk rename to keyboards/idobao/id67/default_rgb/rules.mk diff --git a/keyboards/id67/keymaps/default/keymap.c b/keyboards/idobao/id67/keymaps/default/keymap.c similarity index 100% rename from keyboards/id67/keymaps/default/keymap.c rename to keyboards/idobao/id67/keymaps/default/keymap.c diff --git a/keyboards/id67/keymaps/via/keymap.c b/keyboards/idobao/id67/keymaps/via/keymap.c similarity index 100% rename from keyboards/id67/keymaps/via/keymap.c rename to keyboards/idobao/id67/keymaps/via/keymap.c diff --git a/keyboards/id67/keymaps/via/rules.mk b/keyboards/idobao/id67/keymaps/via/rules.mk similarity index 100% rename from keyboards/id67/keymaps/via/rules.mk rename to keyboards/idobao/id67/keymaps/via/rules.mk diff --git a/keyboards/id67/readme.md b/keyboards/idobao/id67/readme.md similarity index 84% rename from keyboards/id67/readme.md rename to keyboards/idobao/id67/readme.md index 7949ee1af2ad..134d45b18e91 100644 --- a/keyboards/id67/readme.md +++ b/keyboards/idobao/id67/readme.md @@ -16,14 +16,14 @@ Currently there are two variants for the id67: Make examples for this keyboard (after setting up your build environment): - make id67/default_rgb:default + make idobao/id67/default_rgb:default - make id67/rgb:default + make idobao/id67/rgb:default Flashing examples for this keyboard: - make id67/default_rgb:default:flash + make idobao/id67/default_rgb:default:flash - make id67/rgb:default:flash + make idobao/id67/rgb: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/id67/rgb/config.h b/keyboards/idobao/id67/rgb/config.h similarity index 100% rename from keyboards/id67/rgb/config.h rename to keyboards/idobao/id67/rgb/config.h diff --git a/keyboards/id67/rgb/info.json b/keyboards/idobao/id67/rgb/info.json similarity index 100% rename from keyboards/id67/rgb/info.json rename to keyboards/idobao/id67/rgb/info.json diff --git a/keyboards/id67/rgb/keymaps/default/keymap.c b/keyboards/idobao/id67/rgb/keymaps/default/keymap.c similarity index 100% rename from keyboards/id67/rgb/keymaps/default/keymap.c rename to keyboards/idobao/id67/rgb/keymaps/default/keymap.c diff --git a/keyboards/id67/rgb/keymaps/thewerther/config.h b/keyboards/idobao/id67/rgb/keymaps/thewerther/config.h similarity index 100% rename from keyboards/id67/rgb/keymaps/thewerther/config.h rename to keyboards/idobao/id67/rgb/keymaps/thewerther/config.h diff --git a/keyboards/id67/rgb/keymaps/thewerther/keymap.c b/keyboards/idobao/id67/rgb/keymaps/thewerther/keymap.c similarity index 100% rename from keyboards/id67/rgb/keymaps/thewerther/keymap.c rename to keyboards/idobao/id67/rgb/keymaps/thewerther/keymap.c diff --git a/keyboards/id67/rgb/keymaps/thewerther/rules.mk b/keyboards/idobao/id67/rgb/keymaps/thewerther/rules.mk similarity index 100% rename from keyboards/id67/rgb/keymaps/thewerther/rules.mk rename to keyboards/idobao/id67/rgb/keymaps/thewerther/rules.mk diff --git a/keyboards/id67/rgb/readme.md b/keyboards/idobao/id67/rgb/readme.md similarity index 100% rename from keyboards/id67/rgb/readme.md rename to keyboards/idobao/id67/rgb/readme.md diff --git a/keyboards/id67/rgb/rgb.c b/keyboards/idobao/id67/rgb/rgb.c similarity index 100% rename from keyboards/id67/rgb/rgb.c rename to keyboards/idobao/id67/rgb/rgb.c diff --git a/keyboards/id67/rgb/rgb.h b/keyboards/idobao/id67/rgb/rgb.h similarity index 100% rename from keyboards/id67/rgb/rgb.h rename to keyboards/idobao/id67/rgb/rgb.h diff --git a/keyboards/id67/rgb/rules.mk b/keyboards/idobao/id67/rgb/rules.mk similarity index 100% rename from keyboards/id67/rgb/rules.mk rename to keyboards/idobao/id67/rgb/rules.mk diff --git a/keyboards/idobo/keymaps/default/keymap.c b/keyboards/idobao/id75/keymaps/default/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/default/keymap.c rename to keyboards/idobao/id75/keymaps/default/keymap.c diff --git a/keyboards/idobo/keymaps/default/readme.md b/keyboards/idobao/id75/keymaps/default/readme.md similarity index 100% rename from keyboards/idobo/keymaps/default/readme.md rename to keyboards/idobao/id75/keymaps/default/readme.md diff --git a/keyboards/idobo/keymaps/default75/keymap.c b/keyboards/idobao/id75/keymaps/default75/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/default75/keymap.c rename to keyboards/idobao/id75/keymaps/default75/keymap.c diff --git a/keyboards/idobo/keymaps/default75/readme.md b/keyboards/idobao/id75/keymaps/default75/readme.md similarity index 100% rename from keyboards/idobo/keymaps/default75/readme.md rename to keyboards/idobao/id75/keymaps/default75/readme.md diff --git a/keyboards/idobo/keymaps/drewdobo/config.h b/keyboards/idobao/id75/keymaps/drewdobo/config.h similarity index 100% rename from keyboards/idobo/keymaps/drewdobo/config.h rename to keyboards/idobao/id75/keymaps/drewdobo/config.h diff --git a/keyboards/idobo/keymaps/drewdobo/keymap.c b/keyboards/idobao/id75/keymaps/drewdobo/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/drewdobo/keymap.c rename to keyboards/idobao/id75/keymaps/drewdobo/keymap.c diff --git a/keyboards/idobo/keymaps/drewdobo/readme.md b/keyboards/idobao/id75/keymaps/drewdobo/readme.md similarity index 100% rename from keyboards/idobo/keymaps/drewdobo/readme.md rename to keyboards/idobao/id75/keymaps/drewdobo/readme.md diff --git a/keyboards/idobo/keymaps/drewdobo/rules.mk b/keyboards/idobao/id75/keymaps/drewdobo/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/drewdobo/rules.mk rename to keyboards/idobao/id75/keymaps/drewdobo/rules.mk diff --git a/keyboards/idobo/keymaps/egstad/config.h b/keyboards/idobao/id75/keymaps/egstad/config.h similarity index 100% rename from keyboards/idobo/keymaps/egstad/config.h rename to keyboards/idobao/id75/keymaps/egstad/config.h diff --git a/keyboards/idobo/keymaps/egstad/keymap.c b/keyboards/idobao/id75/keymaps/egstad/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/egstad/keymap.c rename to keyboards/idobao/id75/keymaps/egstad/keymap.c diff --git a/keyboards/idobo/keymaps/egstad/readme.md b/keyboards/idobao/id75/keymaps/egstad/readme.md similarity index 100% rename from keyboards/idobo/keymaps/egstad/readme.md rename to keyboards/idobao/id75/keymaps/egstad/readme.md diff --git a/keyboards/idobo/keymaps/egstad/rules.mk b/keyboards/idobao/id75/keymaps/egstad/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/egstad/rules.mk rename to keyboards/idobao/id75/keymaps/egstad/rules.mk diff --git a/keyboards/idobo/keymaps/gkbd/config.h b/keyboards/idobao/id75/keymaps/gkbd/config.h similarity index 100% rename from keyboards/idobo/keymaps/gkbd/config.h rename to keyboards/idobao/id75/keymaps/gkbd/config.h diff --git a/keyboards/idobo/keymaps/gkbd/keymap.c b/keyboards/idobao/id75/keymaps/gkbd/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/gkbd/keymap.c rename to keyboards/idobao/id75/keymaps/gkbd/keymap.c diff --git a/keyboards/idobo/keymaps/gkbd/readme.md b/keyboards/idobao/id75/keymaps/gkbd/readme.md similarity index 100% rename from keyboards/idobo/keymaps/gkbd/readme.md rename to keyboards/idobao/id75/keymaps/gkbd/readme.md diff --git a/keyboards/idobo/keymaps/gkbd/rules.mk b/keyboards/idobao/id75/keymaps/gkbd/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/gkbd/rules.mk rename to keyboards/idobao/id75/keymaps/gkbd/rules.mk diff --git a/keyboards/idobo/keymaps/gkbd_75/config.h b/keyboards/idobao/id75/keymaps/gkbd_75/config.h similarity index 100% rename from keyboards/idobo/keymaps/gkbd_75/config.h rename to keyboards/idobao/id75/keymaps/gkbd_75/config.h diff --git a/keyboards/idobo/keymaps/gkbd_75/keymap.c b/keyboards/idobao/id75/keymaps/gkbd_75/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/gkbd_75/keymap.c rename to keyboards/idobao/id75/keymaps/gkbd_75/keymap.c diff --git a/keyboards/idobo/keymaps/gkbd_75/readme.md b/keyboards/idobao/id75/keymaps/gkbd_75/readme.md similarity index 100% rename from keyboards/idobo/keymaps/gkbd_75/readme.md rename to keyboards/idobao/id75/keymaps/gkbd_75/readme.md diff --git a/keyboards/idobo/keymaps/gkbd_orthon/config.h b/keyboards/idobao/id75/keymaps/gkbd_orthon/config.h similarity index 100% rename from keyboards/idobo/keymaps/gkbd_orthon/config.h rename to keyboards/idobao/id75/keymaps/gkbd_orthon/config.h diff --git a/keyboards/idobo/keymaps/gkbd_orthon/keymap.c b/keyboards/idobao/id75/keymaps/gkbd_orthon/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/gkbd_orthon/keymap.c rename to keyboards/idobao/id75/keymaps/gkbd_orthon/keymap.c diff --git a/keyboards/idobo/keymaps/gkbd_orthon/readme.md b/keyboards/idobao/id75/keymaps/gkbd_orthon/readme.md similarity index 100% rename from keyboards/idobo/keymaps/gkbd_orthon/readme.md rename to keyboards/idobao/id75/keymaps/gkbd_orthon/readme.md diff --git a/keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json b/keyboards/idobao/id75/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json similarity index 100% rename from keyboards/idobo/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json rename to keyboards/idobao/id75/keymaps/greenshadowmaker/keyboard-layout-editor-gsm-idobo.json diff --git a/keyboards/idobo/keymaps/greenshadowmaker/keymap.c b/keyboards/idobao/id75/keymaps/greenshadowmaker/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/greenshadowmaker/keymap.c rename to keyboards/idobao/id75/keymaps/greenshadowmaker/keymap.c diff --git a/keyboards/idobo/keymaps/greenshadowmaker/readme.md b/keyboards/idobao/id75/keymaps/greenshadowmaker/readme.md similarity index 100% rename from keyboards/idobo/keymaps/greenshadowmaker/readme.md rename to keyboards/idobao/id75/keymaps/greenshadowmaker/readme.md diff --git a/keyboards/idobo/keymaps/greenshadowmaker/rules.mk b/keyboards/idobao/id75/keymaps/greenshadowmaker/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/greenshadowmaker/rules.mk rename to keyboards/idobao/id75/keymaps/greenshadowmaker/rules.mk diff --git a/keyboards/idobo/keymaps/ifohancroft/config.h b/keyboards/idobao/id75/keymaps/ifohancroft/config.h similarity index 100% rename from keyboards/idobo/keymaps/ifohancroft/config.h rename to keyboards/idobao/id75/keymaps/ifohancroft/config.h diff --git a/keyboards/idobo/keymaps/ifohancroft/keymap.c b/keyboards/idobao/id75/keymaps/ifohancroft/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/ifohancroft/keymap.c rename to keyboards/idobao/id75/keymaps/ifohancroft/keymap.c diff --git a/keyboards/idobo/keymaps/ifohancroft/readme.md b/keyboards/idobao/id75/keymaps/ifohancroft/readme.md similarity index 100% rename from keyboards/idobo/keymaps/ifohancroft/readme.md rename to keyboards/idobao/id75/keymaps/ifohancroft/readme.md diff --git a/keyboards/idobo/keymaps/ifohancroft/rules.mk b/keyboards/idobao/id75/keymaps/ifohancroft/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/ifohancroft/rules.mk rename to keyboards/idobao/id75/keymaps/ifohancroft/rules.mk diff --git a/keyboards/idobo/keymaps/pathnirvana/config.h b/keyboards/idobao/id75/keymaps/pathnirvana/config.h similarity index 100% rename from keyboards/idobo/keymaps/pathnirvana/config.h rename to keyboards/idobao/id75/keymaps/pathnirvana/config.h diff --git a/keyboards/idobo/keymaps/pathnirvana/keymap.c b/keyboards/idobao/id75/keymaps/pathnirvana/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/pathnirvana/keymap.c rename to keyboards/idobao/id75/keymaps/pathnirvana/keymap.c diff --git a/keyboards/idobo/keymaps/pathnirvana/rules.mk b/keyboards/idobao/id75/keymaps/pathnirvana/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/pathnirvana/rules.mk rename to keyboards/idobao/id75/keymaps/pathnirvana/rules.mk diff --git a/keyboards/idobo/keymaps/revok75/config.h b/keyboards/idobao/id75/keymaps/revok75/config.h similarity index 100% rename from keyboards/idobo/keymaps/revok75/config.h rename to keyboards/idobao/id75/keymaps/revok75/config.h diff --git a/keyboards/idobo/keymaps/revok75/keymap.c b/keyboards/idobao/id75/keymaps/revok75/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/revok75/keymap.c rename to keyboards/idobao/id75/keymaps/revok75/keymap.c diff --git a/keyboards/idobo/keymaps/revok75/readme.md b/keyboards/idobao/id75/keymaps/revok75/readme.md similarity index 100% rename from keyboards/idobo/keymaps/revok75/readme.md rename to keyboards/idobao/id75/keymaps/revok75/readme.md diff --git a/keyboards/idobo/keymaps/revok75/rules.mk b/keyboards/idobao/id75/keymaps/revok75/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/revok75/rules.mk rename to keyboards/idobao/id75/keymaps/revok75/rules.mk diff --git a/keyboards/idobo/keymaps/via/keymap.c b/keyboards/idobao/id75/keymaps/via/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/via/keymap.c rename to keyboards/idobao/id75/keymaps/via/keymap.c diff --git a/keyboards/claw44/keymaps/via/rules.mk b/keyboards/idobao/id75/keymaps/via/rules.mk similarity index 100% rename from keyboards/claw44/keymaps/via/rules.mk rename to keyboards/idobao/id75/keymaps/via/rules.mk diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/config.h b/keyboards/idobao/id75/keymaps/xaceofspaidsx/config.h similarity index 100% rename from keyboards/idobo/keymaps/xaceofspaidsx/config.h rename to keyboards/idobao/id75/keymaps/xaceofspaidsx/config.h diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c b/keyboards/idobao/id75/keymaps/xaceofspaidsx/keymap.c similarity index 100% rename from keyboards/idobo/keymaps/xaceofspaidsx/keymap.c rename to keyboards/idobao/id75/keymaps/xaceofspaidsx/keymap.c diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/readme.md b/keyboards/idobao/id75/keymaps/xaceofspaidsx/readme.md similarity index 100% rename from keyboards/idobo/keymaps/xaceofspaidsx/readme.md rename to keyboards/idobao/id75/keymaps/xaceofspaidsx/readme.md diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk b/keyboards/idobao/id75/keymaps/xaceofspaidsx/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/xaceofspaidsx/rules.mk rename to keyboards/idobao/id75/keymaps/xaceofspaidsx/rules.mk diff --git a/keyboards/idobo/config.h b/keyboards/idobao/id75/v1/config.h similarity index 98% rename from keyboards/idobo/config.h rename to keyboards/idobao/id75/v1/config.h index ffe0bb70114b..caaf7f75dc95 100644 --- a/keyboards/idobo/config.h +++ b/keyboards/idobao/id75/v1/config.h @@ -23,8 +23,8 @@ along with this program. If not, see . #define VENDOR_ID 0x6964 // ID #define PRODUCT_ID 0x0075 #define DEVICE_VER 0x0001 -#define MANUFACTURER Generic -#define PRODUCT Idobo +#define MANUFACTURER IDOBAO +#define PRODUCT ID75 /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/idobo/info.json b/keyboards/idobao/id75/v1/info.json similarity index 100% rename from keyboards/idobo/info.json rename to keyboards/idobao/id75/v1/info.json diff --git a/keyboards/idobo/readme.md b/keyboards/idobao/id75/v1/readme.md similarity index 61% rename from keyboards/idobo/readme.md rename to keyboards/idobao/id75/v1/readme.md index 254616decb86..545f3121f784 100644 --- a/keyboards/idobo/readme.md +++ b/keyboards/idobao/id75/v1/readme.md @@ -1,17 +1,19 @@ -# IDOBO +# ID75 -![IDOBO](imgur.com image replace me!) +![ID75](https://i.imgur.com/VOP1SzD.jpeg) 75Keys Aluminum Mechanical Keyboard. Firmware here originally appeared on qmkeyboard.cn Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: IDOBO PCB -Hardware Availability: [IDOBO on Drop](https://drop.com/buy/id75-hot-swappable-ortholinear-keyboard-kit) +Hardware Supported: ID75 PCB +Hardware Availability: +* [ID75 on Drop](https://drop.com/buy/id75-hot-swappable-ortholinear-keyboard-kit) +* [ID75 on IDOBAO](https://idobao.net/products/idobao-id75v1-hot-swappable-mechanical-keyboard-kit) Make example for this keyboard (after setting up your build environment): - make idobo:default + make idobao/id75/v1: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/idobo/rules.mk b/keyboards/idobao/id75/v1/rules.mk similarity index 72% rename from keyboards/idobo/rules.mk rename to keyboards/idobao/id75/v1/rules.mk index 721b7f56068a..0ce4fe96d9fd 100644 --- a/keyboards/idobo/rules.mk +++ b/keyboards/idobao/id75/v1/rules.mk @@ -11,10 +11,10 @@ BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output LTO_ENABLE = yes # Use link time optimization diff --git a/keyboards/idobo/idobo.c b/keyboards/idobao/id75/v1/v1.c similarity index 97% rename from keyboards/idobo/idobo.c rename to keyboards/idobao/id75/v1/v1.c index ccf654f87138..992a292616f4 100644 --- a/keyboards/idobo/idobo.c +++ b/keyboards/idobao/id75/v1/v1.c @@ -13,4 +13,4 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "idobo.h" +#include "v1.h" diff --git a/keyboards/idobo/idobo.h b/keyboards/idobao/id75/v1/v1.h similarity index 100% rename from keyboards/idobo/idobo.h rename to keyboards/idobao/id75/v1/v1.h diff --git a/keyboards/id80/ansi/config.h b/keyboards/idobao/id80/v1/ansi/config.h similarity index 100% rename from keyboards/id80/ansi/config.h rename to keyboards/idobao/id80/v1/ansi/config.h diff --git a/keyboards/id80/ansi/keymaps/default/keymap.c b/keyboards/idobao/id80/v1/ansi/keymaps/default/keymap.c similarity index 100% rename from keyboards/id80/ansi/keymaps/default/keymap.c rename to keyboards/idobao/id80/v1/ansi/keymaps/default/keymap.c diff --git a/keyboards/id80/ansi/keymaps/default/readme.md b/keyboards/idobao/id80/v1/ansi/keymaps/default/readme.md similarity index 100% rename from keyboards/id80/ansi/keymaps/default/readme.md rename to keyboards/idobao/id80/v1/ansi/keymaps/default/readme.md diff --git a/keyboards/id80/ansi/keymaps/msf/config.h b/keyboards/idobao/id80/v1/ansi/keymaps/msf/config.h similarity index 100% rename from keyboards/id80/ansi/keymaps/msf/config.h rename to keyboards/idobao/id80/v1/ansi/keymaps/msf/config.h diff --git a/keyboards/id80/ansi/keymaps/msf/keymap.c b/keyboards/idobao/id80/v1/ansi/keymaps/msf/keymap.c similarity index 100% rename from keyboards/id80/ansi/keymaps/msf/keymap.c rename to keyboards/idobao/id80/v1/ansi/keymaps/msf/keymap.c diff --git a/keyboards/id80/ansi/keymaps/msf/readme.md b/keyboards/idobao/id80/v1/ansi/keymaps/msf/readme.md similarity index 100% rename from keyboards/id80/ansi/keymaps/msf/readme.md rename to keyboards/idobao/id80/v1/ansi/keymaps/msf/readme.md diff --git a/keyboards/qaz/keymaps/default/rules.mk b/keyboards/idobao/id80/v1/ansi/keymaps/msf/rules.mk similarity index 100% rename from keyboards/qaz/keymaps/default/rules.mk rename to keyboards/idobao/id80/v1/ansi/keymaps/msf/rules.mk diff --git a/keyboards/id80/keymaps/rverst/keymap.c b/keyboards/idobao/id80/v1/ansi/keymaps/rverst/keymap.c similarity index 100% rename from keyboards/id80/keymaps/rverst/keymap.c rename to keyboards/idobao/id80/v1/ansi/keymaps/rverst/keymap.c diff --git a/keyboards/id80/keymaps/rverst/readme.md b/keyboards/idobao/id80/v1/ansi/keymaps/rverst/readme.md similarity index 100% rename from keyboards/id80/keymaps/rverst/readme.md rename to keyboards/idobao/id80/v1/ansi/keymaps/rverst/readme.md diff --git a/keyboards/id80/keymaps/rverst/rverst.json b/keyboards/idobao/id80/v1/ansi/keymaps/rverst/rverst.json similarity index 100% rename from keyboards/id80/keymaps/rverst/rverst.json rename to keyboards/idobao/id80/v1/ansi/keymaps/rverst/rverst.json diff --git a/keyboards/id80/ansi/keymaps/via/keymap.c b/keyboards/idobao/id80/v1/ansi/keymaps/via/keymap.c similarity index 100% rename from keyboards/id80/ansi/keymaps/via/keymap.c rename to keyboards/idobao/id80/v1/ansi/keymaps/via/keymap.c diff --git a/keyboards/id80/ansi/keymaps/via/rules.mk b/keyboards/idobao/id80/v1/ansi/keymaps/via/rules.mk similarity index 100% rename from keyboards/id80/ansi/keymaps/via/rules.mk rename to keyboards/idobao/id80/v1/ansi/keymaps/via/rules.mk diff --git a/keyboards/id80/ansi/readme.md b/keyboards/idobao/id80/v1/ansi/readme.md similarity index 100% rename from keyboards/id80/ansi/readme.md rename to keyboards/idobao/id80/v1/ansi/readme.md diff --git a/keyboards/id80/ansi/rules.mk b/keyboards/idobao/id80/v1/ansi/rules.mk similarity index 100% rename from keyboards/id80/ansi/rules.mk rename to keyboards/idobao/id80/v1/ansi/rules.mk diff --git a/keyboards/id80/config.h b/keyboards/idobao/id80/v1/config.h similarity index 100% rename from keyboards/id80/config.h rename to keyboards/idobao/id80/v1/config.h diff --git a/keyboards/id80/info.json b/keyboards/idobao/id80/v1/info.json similarity index 100% rename from keyboards/id80/info.json rename to keyboards/idobao/id80/v1/info.json diff --git a/keyboards/id80/iso/config.h b/keyboards/idobao/id80/v1/iso/config.h similarity index 100% rename from keyboards/id80/iso/config.h rename to keyboards/idobao/id80/v1/iso/config.h diff --git a/keyboards/id80/iso/keymaps/default/keymap.c b/keyboards/idobao/id80/v1/iso/keymaps/default/keymap.c similarity index 100% rename from keyboards/id80/iso/keymaps/default/keymap.c rename to keyboards/idobao/id80/v1/iso/keymaps/default/keymap.c diff --git a/keyboards/id80/iso/keymaps/default/readme.md b/keyboards/idobao/id80/v1/iso/keymaps/default/readme.md similarity index 100% rename from keyboards/id80/iso/keymaps/default/readme.md rename to keyboards/idobao/id80/v1/iso/keymaps/default/readme.md diff --git a/keyboards/id80/iso/keymaps/via/keymap.c b/keyboards/idobao/id80/v1/iso/keymaps/via/keymap.c similarity index 100% rename from keyboards/id80/iso/keymaps/via/keymap.c rename to keyboards/idobao/id80/v1/iso/keymaps/via/keymap.c diff --git a/keyboards/id80/iso/keymaps/via/rules.mk b/keyboards/idobao/id80/v1/iso/keymaps/via/rules.mk similarity index 100% rename from keyboards/id80/iso/keymaps/via/rules.mk rename to keyboards/idobao/id80/v1/iso/keymaps/via/rules.mk diff --git a/keyboards/id80/iso/readme.md b/keyboards/idobao/id80/v1/iso/readme.md similarity index 100% rename from keyboards/id80/iso/readme.md rename to keyboards/idobao/id80/v1/iso/readme.md diff --git a/keyboards/id80/iso/rules.mk b/keyboards/idobao/id80/v1/iso/rules.mk similarity index 100% rename from keyboards/id80/iso/rules.mk rename to keyboards/idobao/id80/v1/iso/rules.mk diff --git a/keyboards/id80/readme.md b/keyboards/idobao/id80/v1/readme.md similarity index 93% rename from keyboards/id80/readme.md rename to keyboards/idobao/id80/v1/readme.md index 016d2a177ffc..8a26378b3b06 100644 --- a/keyboards/id80/readme.md +++ b/keyboards/idobao/id80/v1/readme.md @@ -12,7 +12,7 @@ A 75% hotswap keyboard from IDOBAO. Make example for this keyboard (after setting up your build environment): - make id80/ansi:default + make idobao/id80/v1/ansi:default ## ISO support: @@ -22,6 +22,6 @@ Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment): - make id80/iso:default + make idobao/id80/v1/iso: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/id80/rules.mk b/keyboards/idobao/id80/v1/rules.mk similarity index 95% rename from keyboards/id80/rules.mk rename to keyboards/idobao/id80/v1/rules.mk index eea8b699005e..0baebd07fc5f 100644 --- a/keyboards/id80/rules.mk +++ b/keyboards/idobao/id80/v1/rules.mk @@ -1,5 +1,5 @@ # Defalt to the ansi version -DEFAULT_FOLDER = id80/ansi +DEFAULT_FOLDER = idobao/id80/v1/ansi # MCU name MCU = atmega32u4 diff --git a/keyboards/id80/id80.c b/keyboards/idobao/id80/v1/v1.c similarity index 97% rename from keyboards/id80/id80.c rename to keyboards/idobao/id80/v1/v1.c index 4a06660de91f..7147b6163e18 100644 --- a/keyboards/id80/id80.c +++ b/keyboards/idobao/id80/v1/v1.c @@ -13,4 +13,4 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "id80.h" +#include "v1.h" diff --git a/keyboards/id80/id80.h b/keyboards/idobao/id80/v1/v1.h similarity index 100% rename from keyboards/id80/id80.h rename to keyboards/idobao/id80/v1/v1.h diff --git a/keyboards/idobao/id80/v3/config.h b/keyboards/idobao/id80/v3/config.h index 06ca74a0e9b2..4b2fb8d0567e 100644 --- a/keyboards/idobao/id80/v3/config.h +++ b/keyboards/idobao/id80/v3/config.h @@ -62,14 +62,10 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW - +#undef RGB_DI_PIN #define RGB_DI_PIN B6 -# define DRIVER_LED_TOTAL 96 /* 16 Bottom 80 top*/ -#ifdef RGB_DI_PIN -# define RGBLED_NUM 96 /* 16 Bottom 80 top*/ -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses -#endif #ifdef RGB_MATRIX_ENABLE +# define DRIVER_LED_TOTAL 96 /* 16 Bottom 80 top*/ # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 // Limit to vendor-recommended value // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: @@ -108,7 +104,7 @@ along with this program. If not, see . // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined # define ENABLE_RGB_MATRIX_TYPING_HEATMAP # define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +// enabled only if RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE # define ENABLE_RGB_MATRIX_SOLID_REACTIVE # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE diff --git a/keyboards/idobao/id80/v3/rules.mk b/keyboards/idobao/id80/v3/rules.mk index 49781db616e2..6805b8f0f9db 100644 --- a/keyboards/idobao/id80/v3/rules.mk +++ b/keyboards/idobao/id80/v3/rules.mk @@ -17,6 +17,7 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes +LTO_ENABLE = yes RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 diff --git a/keyboards/id87/config.h b/keyboards/idobao/id87/v1/config.h similarity index 100% rename from keyboards/id87/config.h rename to keyboards/idobao/id87/v1/config.h diff --git a/keyboards/id87/info.json b/keyboards/idobao/id87/v1/info.json similarity index 100% rename from keyboards/id87/info.json rename to keyboards/idobao/id87/v1/info.json diff --git a/keyboards/id87/keymaps/default/keymap.c b/keyboards/idobao/id87/v1/keymaps/default/keymap.c similarity index 100% rename from keyboards/id87/keymaps/default/keymap.c rename to keyboards/idobao/id87/v1/keymaps/default/keymap.c diff --git a/keyboards/id87/keymaps/default/readme.md b/keyboards/idobao/id87/v1/keymaps/default/readme.md similarity index 100% rename from keyboards/id87/keymaps/default/readme.md rename to keyboards/idobao/id87/v1/keymaps/default/readme.md diff --git a/keyboards/id87/keymaps/via/keymap.c b/keyboards/idobao/id87/v1/keymaps/via/keymap.c similarity index 100% rename from keyboards/id87/keymaps/via/keymap.c rename to keyboards/idobao/id87/v1/keymaps/via/keymap.c diff --git a/keyboards/id87/keymaps/via/rules.mk b/keyboards/idobao/id87/v1/keymaps/via/rules.mk similarity index 100% rename from keyboards/id87/keymaps/via/rules.mk rename to keyboards/idobao/id87/v1/keymaps/via/rules.mk diff --git a/keyboards/id87/readme.md b/keyboards/idobao/id87/v1/readme.md similarity index 91% rename from keyboards/id87/readme.md rename to keyboards/idobao/id87/v1/readme.md index ee3604f84926..59814f81f709 100644 --- a/keyboards/id87/readme.md +++ b/keyboards/idobao/id87/v1/readme.md @@ -10,10 +10,10 @@ A TKL hotswap board from IDOBAO. Make example for this keyboard (after setting up your build environment): - make id87:default + make idobao/id87/v1:default Flashing example for this keyboard: - make id87:default:flash + make idobao/id87/v1: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/id87/rules.mk b/keyboards/idobao/id87/v1/rules.mk similarity index 100% rename from keyboards/id87/rules.mk rename to keyboards/idobao/id87/v1/rules.mk diff --git a/keyboards/id87/id87.c b/keyboards/idobao/id87/v1/v1.c similarity index 97% rename from keyboards/id87/id87.c rename to keyboards/idobao/id87/v1/v1.c index 145edc163998..59dc3daab468 100644 --- a/keyboards/id87/id87.c +++ b/keyboards/idobao/id87/v1/v1.c @@ -12,4 +12,4 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "id87.h" +#include "v1.h" diff --git a/keyboards/id87/id87.h b/keyboards/idobao/id87/v1/v1.h similarity index 100% rename from keyboards/id87/id87.h rename to keyboards/idobao/id87/v1/v1.h diff --git a/keyboards/montex/config.h b/keyboards/idobao/montex/v1/config.h similarity index 100% rename from keyboards/montex/config.h rename to keyboards/idobao/montex/v1/config.h diff --git a/keyboards/montex/info.json b/keyboards/idobao/montex/v1/info.json similarity index 100% rename from keyboards/montex/info.json rename to keyboards/idobao/montex/v1/info.json diff --git a/keyboards/montex/keymaps/default/keymap.c b/keyboards/idobao/montex/v1/keymaps/default/keymap.c similarity index 100% rename from keyboards/montex/keymaps/default/keymap.c rename to keyboards/idobao/montex/v1/keymaps/default/keymap.c diff --git a/keyboards/montex/keymaps/via/keymap.c b/keyboards/idobao/montex/v1/keymaps/via/keymap.c similarity index 100% rename from keyboards/montex/keymaps/via/keymap.c rename to keyboards/idobao/montex/v1/keymaps/via/keymap.c diff --git a/keyboards/montex/keymaps/via/rules.mk b/keyboards/idobao/montex/v1/keymaps/via/rules.mk similarity index 100% rename from keyboards/montex/keymaps/via/rules.mk rename to keyboards/idobao/montex/v1/keymaps/via/rules.mk diff --git a/keyboards/montex/readme.md b/keyboards/idobao/montex/v1/readme.md similarity index 97% rename from keyboards/montex/readme.md rename to keyboards/idobao/montex/v1/readme.md index 8c4a7226ce52..e9d84fa674b2 100644 --- a/keyboards/montex/readme.md +++ b/keyboards/idobao/montex/v1/readme.md @@ -16,6 +16,6 @@ Then press the button labeled SW2 located between the 2 upper LEDs. Make example for this keyboard (after setting up your build environment): - make montex:default + make idobao/montex/v1: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/montex/rules.mk b/keyboards/idobao/montex/v1/rules.mk similarity index 100% rename from keyboards/montex/rules.mk rename to keyboards/idobao/montex/v1/rules.mk diff --git a/keyboards/montex/montex.c b/keyboards/idobao/montex/v1/v1.c similarity index 97% rename from keyboards/montex/montex.c rename to keyboards/idobao/montex/v1/v1.c index 4d3ecb186016..e927383097ad 100644 --- a/keyboards/montex/montex.c +++ b/keyboards/idobao/montex/v1/v1.c @@ -14,4 +14,4 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "montex.h" +#include "v1.h" diff --git a/keyboards/montex/montex.h b/keyboards/idobao/montex/v1/v1.h similarity index 100% rename from keyboards/montex/montex.h rename to keyboards/idobao/montex/v1/v1.h diff --git a/keyboards/ergodox_infinity/MEMO.txt b/keyboards/input_club/ergodox_infinity/MEMO.txt similarity index 100% rename from keyboards/ergodox_infinity/MEMO.txt rename to keyboards/input_club/ergodox_infinity/MEMO.txt diff --git a/keyboards/ergodox_infinity/chconf.h b/keyboards/input_club/ergodox_infinity/chconf.h similarity index 100% rename from keyboards/ergodox_infinity/chconf.h rename to keyboards/input_club/ergodox_infinity/chconf.h diff --git a/keyboards/ergodox_infinity/config.h b/keyboards/input_club/ergodox_infinity/config.h similarity index 100% rename from keyboards/ergodox_infinity/config.h rename to keyboards/input_club/ergodox_infinity/config.h diff --git a/keyboards/ergodox_infinity/ergodox_infinity.c b/keyboards/input_club/ergodox_infinity/ergodox_infinity.c similarity index 100% rename from keyboards/ergodox_infinity/ergodox_infinity.c rename to keyboards/input_club/ergodox_infinity/ergodox_infinity.c diff --git a/keyboards/ergodox_infinity/ergodox_infinity.h b/keyboards/input_club/ergodox_infinity/ergodox_infinity.h similarity index 100% rename from keyboards/ergodox_infinity/ergodox_infinity.h rename to keyboards/input_club/ergodox_infinity/ergodox_infinity.h diff --git a/keyboards/ergodox_infinity/halconf.h b/keyboards/input_club/ergodox_infinity/halconf.h similarity index 100% rename from keyboards/ergodox_infinity/halconf.h rename to keyboards/input_club/ergodox_infinity/halconf.h diff --git a/keyboards/ergodox_infinity/info.json b/keyboards/input_club/ergodox_infinity/info.json similarity index 100% rename from keyboards/ergodox_infinity/info.json rename to keyboards/input_club/ergodox_infinity/info.json diff --git a/keyboards/ergodox_infinity/keymaps/default/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/default/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/default/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/dudeofawesome/README.md b/keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/README.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/dudeofawesome/README.md rename to keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/README.md diff --git a/keyboards/ergodox_infinity/keymaps/dudeofawesome/config.h b/keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/config.h similarity index 100% rename from keyboards/ergodox_infinity/keymaps/dudeofawesome/config.h rename to keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/config.h diff --git a/keyboards/ergodox_infinity/keymaps/dudeofawesome/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/dudeofawesome/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/dudeofawesome/layers.h b/keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/layers.h similarity index 100% rename from keyboards/ergodox_infinity/keymaps/dudeofawesome/layers.h rename to keyboards/input_club/ergodox_infinity/keymaps/dudeofawesome/layers.h diff --git a/keyboards/ergodox_infinity/keymaps/gordon/config.h b/keyboards/input_club/ergodox_infinity/keymaps/gordon/config.h similarity index 100% rename from keyboards/ergodox_infinity/keymaps/gordon/config.h rename to keyboards/input_club/ergodox_infinity/keymaps/gordon/config.h diff --git a/keyboards/ergodox_infinity/keymaps/gordon/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/gordon/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/gordon/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/gordon/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/gordon/rules.mk b/keyboards/input_club/ergodox_infinity/keymaps/gordon/rules.mk similarity index 100% rename from keyboards/ergodox_infinity/keymaps/gordon/rules.mk rename to keyboards/input_club/ergodox_infinity/keymaps/gordon/rules.mk diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h b/keyboards/input_club/ergodox_infinity/keymaps/halfkeyboard/config.h similarity index 100% rename from keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h rename to keyboards/input_club/ergodox_infinity/keymaps/halfkeyboard/config.h diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/halfkeyboard/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/halfkeyboard/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/rules.mk b/keyboards/input_club/ergodox_infinity/keymaps/halfkeyboard/rules.mk similarity index 100% rename from keyboards/ergodox_infinity/keymaps/halfkeyboard/rules.mk rename to keyboards/input_club/ergodox_infinity/keymaps/halfkeyboard/rules.mk diff --git a/keyboards/ergodox_infinity/keymaps/input_club/README.md b/keyboards/input_club/ergodox_infinity/keymaps/input_club/README.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/input_club/README.md rename to keyboards/input_club/ergodox_infinity/keymaps/input_club/README.md diff --git a/keyboards/ergodox_infinity/keymaps/input_club/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/input_club/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/input_club/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/input_club/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/narze/config.h b/keyboards/input_club/ergodox_infinity/keymaps/narze/config.h similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/config.h rename to keyboards/input_club/ergodox_infinity/keymaps/narze/config.h diff --git a/keyboards/ergodox_infinity/keymaps/narze/default.png.md b/keyboards/input_club/ergodox_infinity/keymaps/narze/default.png.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/default.png.md rename to keyboards/input_club/ergodox_infinity/keymaps/narze/default.png.md diff --git a/keyboards/ergodox_infinity/keymaps/narze/default_highres.png.md b/keyboards/input_club/ergodox_infinity/keymaps/narze/default_highres.png.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/default_highres.png.md rename to keyboards/input_club/ergodox_infinity/keymaps/narze/default_highres.png.md diff --git a/keyboards/ergodox_infinity/keymaps/narze/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/narze/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/narze/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/narze/readme.md b/keyboards/input_club/ergodox_infinity/keymaps/narze/readme.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/readme.md rename to keyboards/input_club/ergodox_infinity/keymaps/narze/readme.md diff --git a/keyboards/ergodox_infinity/keymaps/narze/rules.mk b/keyboards/input_club/ergodox_infinity/keymaps/narze/rules.mk similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/rules.mk rename to keyboards/input_club/ergodox_infinity/keymaps/narze/rules.mk diff --git a/keyboards/ergodox_infinity/keymaps/narze/visualizer.c b/keyboards/input_club/ergodox_infinity/keymaps/narze/visualizer.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/narze/visualizer.c rename to keyboards/input_club/ergodox_infinity/keymaps/narze/visualizer.c diff --git a/keyboards/ergodox_infinity/keymaps/nordic_ergo/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/nordic_ergo/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/nordic_ergo/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/nordic_ergo/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/nordic_ergo/readme.md b/keyboards/input_club/ergodox_infinity/keymaps/nordic_ergo/readme.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/nordic_ergo/readme.md rename to keyboards/input_club/ergodox_infinity/keymaps/nordic_ergo/readme.md diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/readme.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md rename to keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/readme.md diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/rules.mk similarity index 100% rename from keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk rename to keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/rules.mk diff --git a/keyboards/ergodox_infinity/keymaps/rask/README.md b/keyboards/input_club/ergodox_infinity/keymaps/rask/README.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/rask/README.md rename to keyboards/input_club/ergodox_infinity/keymaps/rask/README.md diff --git a/keyboards/ergodox_infinity/keymaps/rask/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/rask/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/rask/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/rask/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/rjhilgefort/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/rjhilgefort/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/rjhilgefort/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/rjhilgefort/keymap.c diff --git a/keyboards/ergodox_infinity/keymaps/rjhilgefort/readme.md b/keyboards/input_club/ergodox_infinity/keymaps/rjhilgefort/readme.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/rjhilgefort/readme.md rename to keyboards/input_club/ergodox_infinity/keymaps/rjhilgefort/readme.md diff --git a/keyboards/ergodox_infinity/keymaps/trulyergonomic/README.md b/keyboards/input_club/ergodox_infinity/keymaps/trulyergonomic/README.md similarity index 100% rename from keyboards/ergodox_infinity/keymaps/trulyergonomic/README.md rename to keyboards/input_club/ergodox_infinity/keymaps/trulyergonomic/README.md diff --git a/keyboards/ergodox_infinity/keymaps/trulyergonomic/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/trulyergonomic/keymap.c similarity index 100% rename from keyboards/ergodox_infinity/keymaps/trulyergonomic/keymap.c rename to keyboards/input_club/ergodox_infinity/keymaps/trulyergonomic/keymap.c diff --git a/keyboards/ergodox_infinity/mcuconf.h b/keyboards/input_club/ergodox_infinity/mcuconf.h similarity index 100% rename from keyboards/ergodox_infinity/mcuconf.h rename to keyboards/input_club/ergodox_infinity/mcuconf.h diff --git a/keyboards/ergodox_infinity/readme.md b/keyboards/input_club/ergodox_infinity/readme.md similarity index 83% rename from keyboards/ergodox_infinity/readme.md rename to keyboards/input_club/ergodox_infinity/readme.md index c51bdd7c82d5..1f8b6433403d 100644 --- a/keyboards/ergodox_infinity/readme.md +++ b/keyboards/input_club/ergodox_infinity/readme.md @@ -5,19 +5,19 @@ for the left and right halves seperately. To flash them: - Make sure you are in the top-level qmk_firmware directory - - Build the firmware with `make ergodox_infinity:keymapname` + - Build the firmware with `make input_club/ergodox_infinity:keymapname` - Plug in the left hand keyboard only. - Press the program button (back of keyboard, above thumb pad). - - Install the firmware with `sudo make ergodox_infinity:keymapname:dfu-util` + - Install the firmware with `sudo make input_club/ergodox_infinity:keymapname:dfu-util` - Plug in the right hand keyboard only. - Press the program button (back of keyboard, above thumb pad). - - Install the firmware with `sudo make ergodox_infinity:keymapname:dfu-util` + - Install the firmware with `sudo make input_club/ergodox_infinity:keymapname:dfu-util` More information on the Infinity firmware is available in the [TMK/chibios for Input Club Infinity Ergodox](https://github.com/fredizzimo/infinity_ergodox/blob/master/README.md) @@ -43,7 +43,7 @@ They only need to be done once, unless you reset the EEPROM later. - Plug in the left keyboard half to the computer, and press its program button. - - Flash the left half with `make ergodox_infinity:default:dfu-util-split-left` + - Flash the left half with `make input_club/ergodox_infinity:default:dfu-util-split-left` (If you need to use a different method to flash your keyboard, still run this command, and abort it with Ctrl+C when the flashing attempts starts to print errors, then flash the built firmware). @@ -53,13 +53,13 @@ They only need to be done once, unless you reset the EEPROM later. - Plug in the right keyboard half to the computer, and press its program button. - - Flash the right half with `make ergodox_infinity:default:dfu-util-split-right` + - Flash the right half with `make input_club/ergodox_infinity:default:dfu-util-split-right` - On the right half, press the top vertical 1.5U key (second from the top in the leftmost column) once, then the 1U key at the bottom in the opposite corner (bottom right corner). - Add `#define EE_HANDS` to the config.h file of your keymap, and build your firmware using - `make ergodox_infinity:keymapname`. + `make input_club/ergodox_infinity:keymapname`. - After this, you can flash both halves with the same firmware, _without_ risking a mirrored keyboard when connected the wrong way. If you reset your EEPROM later, you'll have to follow these steps again, though. diff --git a/keyboards/ergodox_infinity/rules.mk b/keyboards/input_club/ergodox_infinity/rules.mk similarity index 100% rename from keyboards/ergodox_infinity/rules.mk rename to keyboards/input_club/ergodox_infinity/rules.mk diff --git a/keyboards/infinity60/chconf.h b/keyboards/input_club/infinity60/chconf.h similarity index 100% rename from keyboards/infinity60/chconf.h rename to keyboards/input_club/infinity60/chconf.h diff --git a/keyboards/infinity60/config.h b/keyboards/input_club/infinity60/config.h similarity index 100% rename from keyboards/infinity60/config.h rename to keyboards/input_club/infinity60/config.h diff --git a/keyboards/infinity60/halconf.h b/keyboards/input_club/infinity60/halconf.h similarity index 100% rename from keyboards/infinity60/halconf.h rename to keyboards/input_club/infinity60/halconf.h diff --git a/keyboards/infinity60/infinity60.c b/keyboards/input_club/infinity60/infinity60.c similarity index 100% rename from keyboards/infinity60/infinity60.c rename to keyboards/input_club/infinity60/infinity60.c diff --git a/keyboards/infinity60/infinity60.h b/keyboards/input_club/infinity60/infinity60.h similarity index 100% rename from keyboards/infinity60/infinity60.h rename to keyboards/input_club/infinity60/infinity60.h diff --git a/keyboards/infinity60/info.json b/keyboards/input_club/infinity60/info.json similarity index 100% rename from keyboards/infinity60/info.json rename to keyboards/input_club/infinity60/info.json diff --git a/keyboards/infinity60/keymaps/default/keymap.c b/keyboards/input_club/infinity60/keymaps/default/keymap.c similarity index 100% rename from keyboards/infinity60/keymaps/default/keymap.c rename to keyboards/input_club/infinity60/keymaps/default/keymap.c diff --git a/keyboards/infinity60/keymaps/depariel/keymap.c b/keyboards/input_club/infinity60/keymaps/depariel/keymap.c similarity index 100% rename from keyboards/infinity60/keymaps/depariel/keymap.c rename to keyboards/input_club/infinity60/keymaps/depariel/keymap.c diff --git a/keyboards/infinity60/keymaps/hasu/keymap.c b/keyboards/input_club/infinity60/keymaps/hasu/keymap.c similarity index 100% rename from keyboards/infinity60/keymaps/hasu/keymap.c rename to keyboards/input_club/infinity60/keymaps/hasu/keymap.c diff --git a/keyboards/infinity60/keymaps/jpetermans/config.h b/keyboards/input_club/infinity60/keymaps/jpetermans/config.h similarity index 100% rename from keyboards/infinity60/keymaps/jpetermans/config.h rename to keyboards/input_club/infinity60/keymaps/jpetermans/config.h diff --git a/keyboards/infinity60/keymaps/jpetermans/keymap.c b/keyboards/input_club/infinity60/keymaps/jpetermans/keymap.c similarity index 100% rename from keyboards/infinity60/keymaps/jpetermans/keymap.c rename to keyboards/input_club/infinity60/keymaps/jpetermans/keymap.c diff --git a/keyboards/infinity60/keymaps/jpetermans/readme.md b/keyboards/input_club/infinity60/keymaps/jpetermans/readme.md similarity index 100% rename from keyboards/infinity60/keymaps/jpetermans/readme.md rename to keyboards/input_club/infinity60/keymaps/jpetermans/readme.md diff --git a/keyboards/infinity60/led.c b/keyboards/input_club/infinity60/led.c similarity index 100% rename from keyboards/infinity60/led.c rename to keyboards/input_club/infinity60/led.c diff --git a/keyboards/infinity60/led/config.h b/keyboards/input_club/infinity60/led/config.h similarity index 100% rename from keyboards/infinity60/led/config.h rename to keyboards/input_club/infinity60/led/config.h diff --git a/keyboards/infinity60/led/readme.md b/keyboards/input_club/infinity60/led/readme.md similarity index 100% rename from keyboards/infinity60/led/readme.md rename to keyboards/input_club/infinity60/led/readme.md diff --git a/keyboards/infinity60/led/rules.mk b/keyboards/input_club/infinity60/led/rules.mk similarity index 100% rename from keyboards/infinity60/led/rules.mk rename to keyboards/input_club/infinity60/led/rules.mk diff --git a/keyboards/infinity60/led_controller.c b/keyboards/input_club/infinity60/led_controller.c similarity index 100% rename from keyboards/infinity60/led_controller.c rename to keyboards/input_club/infinity60/led_controller.c diff --git a/keyboards/infinity60/led_controller.h b/keyboards/input_club/infinity60/led_controller.h similarity index 100% rename from keyboards/infinity60/led_controller.h rename to keyboards/input_club/infinity60/led_controller.h diff --git a/keyboards/infinity60/mcuconf.h b/keyboards/input_club/infinity60/mcuconf.h similarity index 100% rename from keyboards/infinity60/mcuconf.h rename to keyboards/input_club/infinity60/mcuconf.h diff --git a/keyboards/infinity60/readme.md b/keyboards/input_club/infinity60/readme.md similarity index 86% rename from keyboards/infinity60/readme.md rename to keyboards/input_club/infinity60/readme.md index d99d1df08033..e8ee6a9dad72 100644 --- a/keyboards/infinity60/readme.md +++ b/keyboards/input_club/infinity60/readme.md @@ -8,10 +8,10 @@ A compact community driven keyboard. Make example for this keyboard (after setting up your build environment): - make infinity60:default + make input_club/infinity60/rev1:default Flashing example for this keyboard: - make infinity60:default:flash + make input_club/infinity60/rev1: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/infinity60/rev1/config.h b/keyboards/input_club/infinity60/rev1/config.h similarity index 100% rename from keyboards/infinity60/rev1/config.h rename to keyboards/input_club/infinity60/rev1/config.h diff --git a/keyboards/infinity60/rev1/readme.md b/keyboards/input_club/infinity60/rev1/readme.md similarity index 100% rename from keyboards/infinity60/rev1/readme.md rename to keyboards/input_club/infinity60/rev1/readme.md diff --git a/keyboards/jisplit89/rev1/rules.mk b/keyboards/input_club/infinity60/rev1/rules.mk similarity index 100% rename from keyboards/jisplit89/rev1/rules.mk rename to keyboards/input_club/infinity60/rev1/rules.mk diff --git a/keyboards/infinity60/rules.mk b/keyboards/input_club/infinity60/rules.mk similarity index 95% rename from keyboards/infinity60/rules.mk rename to keyboards/input_club/infinity60/rules.mk index a3e05edde112..7e21a06a9b16 100644 --- a/keyboards/infinity60/rules.mk +++ b/keyboards/input_club/infinity60/rules.mk @@ -26,7 +26,7 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -DEFAULT_FOLDER = infinity60/led +DEFAULT_FOLDER = input_club/infinity60/led LAYOUTS = 60_ansi_split_bs_rshift diff --git a/keyboards/k_type/chconf.h b/keyboards/input_club/k_type/chconf.h similarity index 100% rename from keyboards/k_type/chconf.h rename to keyboards/input_club/k_type/chconf.h diff --git a/keyboards/k_type/config.h b/keyboards/input_club/k_type/config.h similarity index 100% rename from keyboards/k_type/config.h rename to keyboards/input_club/k_type/config.h diff --git a/keyboards/k_type/halconf.h b/keyboards/input_club/k_type/halconf.h similarity index 100% rename from keyboards/k_type/halconf.h rename to keyboards/input_club/k_type/halconf.h diff --git a/keyboards/k_type/i2c_master.c b/keyboards/input_club/k_type/i2c_master.c similarity index 100% rename from keyboards/k_type/i2c_master.c rename to keyboards/input_club/k_type/i2c_master.c diff --git a/keyboards/k_type/i2c_master.h b/keyboards/input_club/k_type/i2c_master.h similarity index 100% rename from keyboards/k_type/i2c_master.h rename to keyboards/input_club/k_type/i2c_master.h diff --git a/keyboards/k_type/info.json b/keyboards/input_club/k_type/info.json similarity index 100% rename from keyboards/k_type/info.json rename to keyboards/input_club/k_type/info.json diff --git a/keyboards/k_type/is31fl3733-dual.c b/keyboards/input_club/k_type/is31fl3733-dual.c similarity index 100% rename from keyboards/k_type/is31fl3733-dual.c rename to keyboards/input_club/k_type/is31fl3733-dual.c diff --git a/keyboards/k_type/is31fl3733-dual.h b/keyboards/input_club/k_type/is31fl3733-dual.h similarity index 100% rename from keyboards/k_type/is31fl3733-dual.h rename to keyboards/input_club/k_type/is31fl3733-dual.h diff --git a/keyboards/k_type/k_type-rgbdriver.c b/keyboards/input_club/k_type/k_type-rgbdriver.c similarity index 100% rename from keyboards/k_type/k_type-rgbdriver.c rename to keyboards/input_club/k_type/k_type-rgbdriver.c diff --git a/keyboards/k_type/k_type.c b/keyboards/input_club/k_type/k_type.c similarity index 100% rename from keyboards/k_type/k_type.c rename to keyboards/input_club/k_type/k_type.c diff --git a/keyboards/k_type/k_type.h b/keyboards/input_club/k_type/k_type.h similarity index 100% rename from keyboards/k_type/k_type.h rename to keyboards/input_club/k_type/k_type.h diff --git a/keyboards/k_type/keymaps/andrew-fahmy/config.h b/keyboards/input_club/k_type/keymaps/andrew-fahmy/config.h similarity index 100% rename from keyboards/k_type/keymaps/andrew-fahmy/config.h rename to keyboards/input_club/k_type/keymaps/andrew-fahmy/config.h diff --git a/keyboards/k_type/keymaps/andrew-fahmy/keymap.c b/keyboards/input_club/k_type/keymaps/andrew-fahmy/keymap.c similarity index 100% rename from keyboards/k_type/keymaps/andrew-fahmy/keymap.c rename to keyboards/input_club/k_type/keymaps/andrew-fahmy/keymap.c diff --git a/keyboards/k_type/keymaps/andrew-fahmy/rules.mk b/keyboards/input_club/k_type/keymaps/andrew-fahmy/rules.mk similarity index 100% rename from keyboards/k_type/keymaps/andrew-fahmy/rules.mk rename to keyboards/input_club/k_type/keymaps/andrew-fahmy/rules.mk diff --git a/keyboards/k_type/keymaps/belak/keymap.c b/keyboards/input_club/k_type/keymaps/belak/keymap.c similarity index 100% rename from keyboards/k_type/keymaps/belak/keymap.c rename to keyboards/input_club/k_type/keymaps/belak/keymap.c diff --git a/keyboards/k_type/keymaps/default/keymap.c b/keyboards/input_club/k_type/keymaps/default/keymap.c similarity index 100% rename from keyboards/k_type/keymaps/default/keymap.c rename to keyboards/input_club/k_type/keymaps/default/keymap.c diff --git a/keyboards/k_type/keymaps/default/rules.mk b/keyboards/input_club/k_type/keymaps/default/rules.mk similarity index 100% rename from keyboards/k_type/keymaps/default/rules.mk rename to keyboards/input_club/k_type/keymaps/default/rules.mk diff --git a/keyboards/k_type/mcuconf.h b/keyboards/input_club/k_type/mcuconf.h similarity index 100% rename from keyboards/k_type/mcuconf.h rename to keyboards/input_club/k_type/mcuconf.h diff --git a/keyboards/k_type/readme.md b/keyboards/input_club/k_type/readme.md similarity index 90% rename from keyboards/k_type/readme.md rename to keyboards/input_club/k_type/readme.md index 11123c357c27..a69ca38d4d8d 100644 --- a/keyboards/k_type/readme.md +++ b/keyboards/input_club/k_type/readme.md @@ -8,10 +8,10 @@ Firmware for custom keyboard PCB with TKL Key Layout Make example for this keyboard (after setting up your build environment): - make k_type:default + make input_club/k_type:default Flashing example for this keyboard: - make k_type:default:flash + make input_club/k_type: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/k_type/rules.mk b/keyboards/input_club/k_type/rules.mk similarity index 100% rename from keyboards/k_type/rules.mk rename to keyboards/input_club/k_type/rules.mk diff --git a/keyboards/whitefox/board_is31fl3731c.h b/keyboards/input_club/whitefox/board_is31fl3731c.h similarity index 100% rename from keyboards/whitefox/board_is31fl3731c.h rename to keyboards/input_club/whitefox/board_is31fl3731c.h diff --git a/keyboards/whitefox/chconf.h b/keyboards/input_club/whitefox/chconf.h similarity index 100% rename from keyboards/whitefox/chconf.h rename to keyboards/input_club/whitefox/chconf.h diff --git a/keyboards/whitefox/config.h b/keyboards/input_club/whitefox/config.h similarity index 100% rename from keyboards/whitefox/config.h rename to keyboards/input_club/whitefox/config.h diff --git a/keyboards/whitefox/halconf.h b/keyboards/input_club/whitefox/halconf.h similarity index 100% rename from keyboards/whitefox/halconf.h rename to keyboards/input_club/whitefox/halconf.h diff --git a/keyboards/whitefox/info.json b/keyboards/input_club/whitefox/info.json similarity index 100% rename from keyboards/whitefox/info.json rename to keyboards/input_club/whitefox/info.json diff --git a/keyboards/whitefox/keymaps/billypython/config.h b/keyboards/input_club/whitefox/keymaps/billypython/config.h similarity index 100% rename from keyboards/whitefox/keymaps/billypython/config.h rename to keyboards/input_club/whitefox/keymaps/billypython/config.h diff --git a/keyboards/whitefox/keymaps/billypython/keymap.c b/keyboards/input_club/whitefox/keymaps/billypython/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/billypython/keymap.c rename to keyboards/input_club/whitefox/keymaps/billypython/keymap.c diff --git a/keyboards/whitefox/keymaps/billypython/rules.mk b/keyboards/input_club/whitefox/keymaps/billypython/rules.mk similarity index 100% rename from keyboards/whitefox/keymaps/billypython/rules.mk rename to keyboards/input_club/whitefox/keymaps/billypython/rules.mk diff --git a/keyboards/whitefox/keymaps/default/keymap.c b/keyboards/input_club/whitefox/keymaps/default/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/default/keymap.c rename to keyboards/input_club/whitefox/keymaps/default/keymap.c diff --git a/keyboards/whitefox/keymaps/dhertz/keymap.c b/keyboards/input_club/whitefox/keymaps/dhertz/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/dhertz/keymap.c rename to keyboards/input_club/whitefox/keymaps/dhertz/keymap.c diff --git a/keyboards/whitefox/keymaps/dudeofawesome/keymap.c b/keyboards/input_club/whitefox/keymaps/dudeofawesome/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/dudeofawesome/keymap.c rename to keyboards/input_club/whitefox/keymaps/dudeofawesome/keymap.c diff --git a/keyboards/whitefox/keymaps/dudeofawesome/readme.md b/keyboards/input_club/whitefox/keymaps/dudeofawesome/readme.md similarity index 100% rename from keyboards/whitefox/keymaps/dudeofawesome/readme.md rename to keyboards/input_club/whitefox/keymaps/dudeofawesome/readme.md diff --git a/keyboards/whitefox/keymaps/jetpacktuxedo/keymap.c b/keyboards/input_club/whitefox/keymaps/jetpacktuxedo/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/jetpacktuxedo/keymap.c rename to keyboards/input_club/whitefox/keymaps/jetpacktuxedo/keymap.c diff --git a/keyboards/whitefox/keymaps/jetpacktuxedo/readme.md b/keyboards/input_club/whitefox/keymaps/jetpacktuxedo/readme.md similarity index 100% rename from keyboards/whitefox/keymaps/jetpacktuxedo/readme.md rename to keyboards/input_club/whitefox/keymaps/jetpacktuxedo/readme.md diff --git a/keyboards/whitefox/keymaps/jetpacktuxedo/rules.mk b/keyboards/input_club/whitefox/keymaps/jetpacktuxedo/rules.mk similarity index 100% rename from keyboards/whitefox/keymaps/jetpacktuxedo/rules.mk rename to keyboards/input_club/whitefox/keymaps/jetpacktuxedo/rules.mk diff --git a/keyboards/whitefox/keymaps/kim-kim/keymap.c b/keyboards/input_club/whitefox/keymaps/kim-kim/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/kim-kim/keymap.c rename to keyboards/input_club/whitefox/keymaps/kim-kim/keymap.c diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/input_club/whitefox/keymaps/konstantin/config.h similarity index 100% rename from keyboards/whitefox/keymaps/konstantin/config.h rename to keyboards/input_club/whitefox/keymaps/konstantin/config.h diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/input_club/whitefox/keymaps/konstantin/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/konstantin/keymap.c rename to keyboards/input_club/whitefox/keymaps/konstantin/keymap.c diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/input_club/whitefox/keymaps/konstantin/rules.mk similarity index 100% rename from keyboards/whitefox/keymaps/konstantin/rules.mk rename to keyboards/input_club/whitefox/keymaps/konstantin/rules.mk diff --git a/keyboards/whitefox/keymaps/matt3o/keymap.c b/keyboards/input_club/whitefox/keymaps/matt3o/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/matt3o/keymap.c rename to keyboards/input_club/whitefox/keymaps/matt3o/keymap.c diff --git a/keyboards/whitefox/keymaps/mattrighetti/keymap.c b/keyboards/input_club/whitefox/keymaps/mattrighetti/keymap.c similarity index 100% rename from keyboards/whitefox/keymaps/mattrighetti/keymap.c rename to keyboards/input_club/whitefox/keymaps/mattrighetti/keymap.c diff --git a/keyboards/whitefox/keymaps/mattrighetti/rules.mk b/keyboards/input_club/whitefox/keymaps/mattrighetti/rules.mk similarity index 100% rename from keyboards/whitefox/keymaps/mattrighetti/rules.mk rename to keyboards/input_club/whitefox/keymaps/mattrighetti/rules.mk diff --git a/keyboards/whitefox/mcuconf.h b/keyboards/input_club/whitefox/mcuconf.h similarity index 100% rename from keyboards/whitefox/mcuconf.h rename to keyboards/input_club/whitefox/mcuconf.h diff --git a/keyboards/whitefox/readme.md b/keyboards/input_club/whitefox/readme.md similarity index 87% rename from keyboards/whitefox/readme.md rename to keyboards/input_club/whitefox/readme.md index a170723e22fe..d6676f6ce7ff 100644 --- a/keyboards/whitefox/readme.md +++ b/keyboards/input_club/whitefox/readme.md @@ -8,10 +8,10 @@ A compact 65% keyboard. Make example for this keyboard (after setting up your build environment): - make whitefox:default + make input_club/whitefox:default Flashing example for this keyboard: - make whitefox:default:flash + make input_club/whitefox: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/whitefox/rules.mk b/keyboards/input_club/whitefox/rules.mk similarity index 100% rename from keyboards/whitefox/rules.mk rename to keyboards/input_club/whitefox/rules.mk diff --git a/keyboards/whitefox/whitefox.c b/keyboards/input_club/whitefox/whitefox.c similarity index 100% rename from keyboards/whitefox/whitefox.c rename to keyboards/input_club/whitefox/whitefox.c diff --git a/keyboards/whitefox/whitefox.h b/keyboards/input_club/whitefox/whitefox.h similarity index 100% rename from keyboards/whitefox/whitefox.h rename to keyboards/input_club/whitefox/whitefox.h diff --git a/keyboards/jm60/jm60.c b/keyboards/jm60/jm60.c index f7b434f30e0a..823892dce9d8 100644 --- a/keyboards/jm60/jm60.c +++ b/keyboards/jm60/jm60.c @@ -20,3 +20,8 @@ along with this program. If not, see . void board_init(void) { AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; } + +void bootloader_jump(void) { + // This board doesn't use the "standard" stm32duino bootloader. There's no information on how to jump to the custom bootloader, so all we can do here is reset. + NVIC_SystemReset(); +} diff --git a/keyboards/jm60/rules.mk b/keyboards/jm60/rules.mk index 6cb13d932dcd..c6de64a13033 100644 --- a/keyboards/jm60/rules.mk +++ b/keyboards/jm60/rules.mk @@ -4,6 +4,9 @@ MCU = STM32F103 MCU_LDSCRIPT = jm60_bootloader BOARD = ST_NUCLEO64_F103RB +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/jolofsor/denial75/rules.mk b/keyboards/jolofsor/denial75/rules.mk index 0d5a61e25551..61ec6a921a4d 100644 --- a/keyboards/jolofsor/denial75/rules.mk +++ b/keyboards/jolofsor/denial75/rules.mk @@ -12,8 +12,7 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/kabedon/kabedon980/config.h b/keyboards/kabedon/kabedon980/config.h index 5dc70dfebf31..db93dfcf85ed 100644 --- a/keyboards/kabedon/kabedon980/config.h +++ b/keyboards/kabedon/kabedon980/config.h @@ -32,21 +32,21 @@ along with this program. If not, see . #define MATRIX_COLS 13 /* Keyboard Matrix Assignments */ -#define MATRIX_ROW_PINS {D0,D2,F7,B1,B0,D6,C7,D7,B5,B2} -#define MATRIX_COL_PINS {F5,F4,F6,C6,B6,B4,D3,D1,D4,F1,B3,D5,F0} +#define MATRIX_ROW_PINS {D0,D2,F7,B1,B0,D6,C7,D7,B5,B2} +#define MATRIX_COL_PINS {F5,F4,F6,C6,B6,B4,D3,D1,D4,F1,B3,D5,F0} #define UNUSED_PINS -#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 +#define DYNAMIC_KEYMAP_LAYER_COUNT 3 /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL -#define RGB_DI_PIN B7 +#define RGB_DI_PIN B7 #ifdef RGB_DI_PIN #define RGBLED_NUM 20 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ - #define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_ANIMATIONS #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ diff --git a/keyboards/kabedon/kabedon980/keymaps/via/keymap.c b/keyboards/kabedon/kabedon980/keymaps/via/keymap.c index 44574452bfb6..76eaa3968aae 100644 --- a/keyboards/kabedon/kabedon980/keymaps/via/keymap.c +++ b/keyboards/kabedon/kabedon980/keymaps/via/keymap.c @@ -6,32 +6,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_DEL, KC_HOME, KC_PGUP, KC_PGDN, 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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, 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_P7, KC_P8, KC_P9, KC_PPLS, - 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_P4, KC_P5, KC_P6, + 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_P4, KC_P5, KC_P6, 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_P1, KC_P2, KC_P3, KC_PENT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT ), - + [1] = LAYOUT( RGB_MOD, RGB_TOG, RGB_SAI, RGB_SAD, RGB_HUI, RGB_HUD, RGB_SPI, RGB_SPD, RGB_VAI, RGB_VAD, 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, 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, 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, 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, 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, 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 ), - + [2] = LAYOUT( - 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, 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, 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, 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, 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, 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, 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - - [3] = LAYOUT( - 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, 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, 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, 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, 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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ) }; diff --git a/keyboards/bigseries/3key/.noci b/keyboards/kagizaraya/chidori/.noci similarity index 100% rename from keyboards/bigseries/3key/.noci rename to keyboards/kagizaraya/chidori/.noci diff --git a/keyboards/chidori/board.c b/keyboards/kagizaraya/chidori/board.c similarity index 100% rename from keyboards/chidori/board.c rename to keyboards/kagizaraya/chidori/board.c diff --git a/keyboards/chidori/board.h b/keyboards/kagizaraya/chidori/board.h similarity index 100% rename from keyboards/chidori/board.h rename to keyboards/kagizaraya/chidori/board.h diff --git a/keyboards/chidori/chidori.c b/keyboards/kagizaraya/chidori/chidori.c similarity index 100% rename from keyboards/chidori/chidori.c rename to keyboards/kagizaraya/chidori/chidori.c diff --git a/keyboards/chidori/chidori.h b/keyboards/kagizaraya/chidori/chidori.h similarity index 100% rename from keyboards/chidori/chidori.h rename to keyboards/kagizaraya/chidori/chidori.h diff --git a/keyboards/chidori/config.h b/keyboards/kagizaraya/chidori/config.h similarity index 100% rename from keyboards/chidori/config.h rename to keyboards/kagizaraya/chidori/config.h diff --git a/keyboards/chidori/info.json b/keyboards/kagizaraya/chidori/info.json similarity index 100% rename from keyboards/chidori/info.json rename to keyboards/kagizaraya/chidori/info.json diff --git a/keyboards/chidori/keymaps/default/config.h b/keyboards/kagizaraya/chidori/keymaps/default/config.h similarity index 100% rename from keyboards/chidori/keymaps/default/config.h rename to keyboards/kagizaraya/chidori/keymaps/default/config.h diff --git a/keyboards/chidori/keymaps/default/keymap.c b/keyboards/kagizaraya/chidori/keymaps/default/keymap.c similarity index 100% rename from keyboards/chidori/keymaps/default/keymap.c rename to keyboards/kagizaraya/chidori/keymaps/default/keymap.c diff --git a/keyboards/chidori/keymaps/default/readme.md b/keyboards/kagizaraya/chidori/keymaps/default/readme.md similarity index 100% rename from keyboards/chidori/keymaps/default/readme.md rename to keyboards/kagizaraya/chidori/keymaps/default/readme.md diff --git a/keyboards/chidori/keymaps/extended/config.h b/keyboards/kagizaraya/chidori/keymaps/extended/config.h similarity index 100% rename from keyboards/chidori/keymaps/extended/config.h rename to keyboards/kagizaraya/chidori/keymaps/extended/config.h diff --git a/keyboards/chidori/keymaps/extended/keymap.c b/keyboards/kagizaraya/chidori/keymaps/extended/keymap.c similarity index 100% rename from keyboards/chidori/keymaps/extended/keymap.c rename to keyboards/kagizaraya/chidori/keymaps/extended/keymap.c diff --git a/keyboards/chidori/keymaps/extended/readme.md b/keyboards/kagizaraya/chidori/keymaps/extended/readme.md similarity index 100% rename from keyboards/chidori/keymaps/extended/readme.md rename to keyboards/kagizaraya/chidori/keymaps/extended/readme.md diff --git a/keyboards/chidori/keymaps/oled_sample/keymap.c b/keyboards/kagizaraya/chidori/keymaps/oled_sample/keymap.c similarity index 100% rename from keyboards/chidori/keymaps/oled_sample/keymap.c rename to keyboards/kagizaraya/chidori/keymaps/oled_sample/keymap.c diff --git a/keyboards/chidori/keymaps/oled_sample/readme.md b/keyboards/kagizaraya/chidori/keymaps/oled_sample/readme.md similarity index 100% rename from keyboards/chidori/keymaps/oled_sample/readme.md rename to keyboards/kagizaraya/chidori/keymaps/oled_sample/readme.md diff --git a/keyboards/chidori/keymaps/oled_sample/rules.mk b/keyboards/kagizaraya/chidori/keymaps/oled_sample/rules.mk similarity index 100% rename from keyboards/chidori/keymaps/oled_sample/rules.mk rename to keyboards/kagizaraya/chidori/keymaps/oled_sample/rules.mk diff --git a/keyboards/chidori/matrix.c b/keyboards/kagizaraya/chidori/matrix.c similarity index 100% rename from keyboards/chidori/matrix.c rename to keyboards/kagizaraya/chidori/matrix.c diff --git a/keyboards/chidori/readme.md b/keyboards/kagizaraya/chidori/readme.md similarity index 94% rename from keyboards/chidori/readme.md rename to keyboards/kagizaraya/chidori/readme.md index d02b50a75865..b77658349179 100644 --- a/keyboards/chidori/readme.md +++ b/keyboards/kagizaraya/chidori/readme.md @@ -10,6 +10,6 @@ Yet another split keyboard made with only through-hole components. Make example for this keyboard (after setting up your build environment): - make chidori:default:usbasp + make kagizaraya/chidori:default:usbasp 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/chidori/rules.mk b/keyboards/kagizaraya/chidori/rules.mk similarity index 100% rename from keyboards/chidori/rules.mk rename to keyboards/kagizaraya/chidori/rules.mk diff --git a/keyboards/halberd/config.h b/keyboards/kagizaraya/halberd/config.h similarity index 100% rename from keyboards/halberd/config.h rename to keyboards/kagizaraya/halberd/config.h diff --git a/keyboards/halberd/halberd.c b/keyboards/kagizaraya/halberd/halberd.c similarity index 100% rename from keyboards/halberd/halberd.c rename to keyboards/kagizaraya/halberd/halberd.c diff --git a/keyboards/halberd/halberd.h b/keyboards/kagizaraya/halberd/halberd.h similarity index 100% rename from keyboards/halberd/halberd.h rename to keyboards/kagizaraya/halberd/halberd.h diff --git a/keyboards/halberd/info.json b/keyboards/kagizaraya/halberd/info.json similarity index 100% rename from keyboards/halberd/info.json rename to keyboards/kagizaraya/halberd/info.json diff --git a/keyboards/halberd/keymaps/default/keymap.c b/keyboards/kagizaraya/halberd/keymaps/default/keymap.c similarity index 100% rename from keyboards/halberd/keymaps/default/keymap.c rename to keyboards/kagizaraya/halberd/keymaps/default/keymap.c diff --git a/keyboards/halberd/keymaps/default/readme.md b/keyboards/kagizaraya/halberd/keymaps/default/readme.md similarity index 100% rename from keyboards/halberd/keymaps/default/readme.md rename to keyboards/kagizaraya/halberd/keymaps/default/readme.md diff --git a/keyboards/halberd/keymaps/right_modifiers/keymap.c b/keyboards/kagizaraya/halberd/keymaps/right_modifiers/keymap.c similarity index 100% rename from keyboards/halberd/keymaps/right_modifiers/keymap.c rename to keyboards/kagizaraya/halberd/keymaps/right_modifiers/keymap.c diff --git a/keyboards/halberd/keymaps/right_modifiers/readme.md b/keyboards/kagizaraya/halberd/keymaps/right_modifiers/readme.md similarity index 100% rename from keyboards/halberd/keymaps/right_modifiers/readme.md rename to keyboards/kagizaraya/halberd/keymaps/right_modifiers/readme.md diff --git a/keyboards/halberd/readme.md b/keyboards/kagizaraya/halberd/readme.md similarity index 94% rename from keyboards/halberd/readme.md rename to keyboards/kagizaraya/halberd/readme.md index 7fa0388fdaae..51c1736996f4 100644 --- a/keyboards/halberd/readme.md +++ b/keyboards/kagizaraya/halberd/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [@kagizaraya](https://twitter.com/kagizaraya) Make example for this keyboard (after setting up your build environment): - make halberd:default:dfu + make kagizaraya/halberd:default:dfu 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/halberd/rules.mk b/keyboards/kagizaraya/halberd/rules.mk similarity index 100% rename from keyboards/halberd/rules.mk rename to keyboards/kagizaraya/halberd/rules.mk diff --git a/keyboards/scythe/config.h b/keyboards/kagizaraya/scythe/config.h similarity index 100% rename from keyboards/scythe/config.h rename to keyboards/kagizaraya/scythe/config.h diff --git a/keyboards/scythe/info.json b/keyboards/kagizaraya/scythe/info.json similarity index 100% rename from keyboards/scythe/info.json rename to keyboards/kagizaraya/scythe/info.json diff --git a/keyboards/scythe/keymaps/default/keymap.c b/keyboards/kagizaraya/scythe/keymaps/default/keymap.c similarity index 100% rename from keyboards/scythe/keymaps/default/keymap.c rename to keyboards/kagizaraya/scythe/keymaps/default/keymap.c diff --git a/keyboards/scythe/keymaps/default/readme.md b/keyboards/kagizaraya/scythe/keymaps/default/readme.md similarity index 100% rename from keyboards/scythe/keymaps/default/readme.md rename to keyboards/kagizaraya/scythe/keymaps/default/readme.md diff --git a/keyboards/scythe/keymaps/forties/keymap.c b/keyboards/kagizaraya/scythe/keymaps/forties/keymap.c similarity index 100% rename from keyboards/scythe/keymaps/forties/keymap.c rename to keyboards/kagizaraya/scythe/keymaps/forties/keymap.c diff --git a/keyboards/scythe/keymaps/forties/readme.md b/keyboards/kagizaraya/scythe/keymaps/forties/readme.md similarity index 100% rename from keyboards/scythe/keymaps/forties/readme.md rename to keyboards/kagizaraya/scythe/keymaps/forties/readme.md diff --git a/keyboards/scythe/readme.md b/keyboards/kagizaraya/scythe/readme.md similarity index 94% rename from keyboards/scythe/readme.md rename to keyboards/kagizaraya/scythe/readme.md index fed4a77e2fde..d87b1f82bfe5 100644 --- a/keyboards/scythe/readme.md +++ b/keyboards/kagizaraya/scythe/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [@kagizaraya](https://twitter.com/kagizaraya) Make example for this keyboard (after setting up your build environment): - make scythe:default:dfu + make kagizaraya/scythe:default:dfu 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/scythe/rules.mk b/keyboards/kagizaraya/scythe/rules.mk similarity index 100% rename from keyboards/scythe/rules.mk rename to keyboards/kagizaraya/scythe/rules.mk diff --git a/keyboards/scythe/scythe.c b/keyboards/kagizaraya/scythe/scythe.c similarity index 100% rename from keyboards/scythe/scythe.c rename to keyboards/kagizaraya/scythe/scythe.c diff --git a/keyboards/scythe/scythe.h b/keyboards/kagizaraya/scythe/scythe.h similarity index 100% rename from keyboards/scythe/scythe.h rename to keyboards/kagizaraya/scythe/scythe.h diff --git a/keyboards/business_card/.noci b/keyboards/kakunpc/angel17/.noci similarity index 100% rename from keyboards/business_card/.noci rename to keyboards/kakunpc/angel17/.noci diff --git a/keyboards/business_card/alpha/.noci b/keyboards/kakunpc/angel17/alpha/.noci similarity index 100% rename from keyboards/business_card/alpha/.noci rename to keyboards/kakunpc/angel17/alpha/.noci diff --git a/keyboards/angel17/alpha/alpha.c b/keyboards/kakunpc/angel17/alpha/alpha.c similarity index 100% rename from keyboards/angel17/alpha/alpha.c rename to keyboards/kakunpc/angel17/alpha/alpha.c diff --git a/keyboards/angel17/alpha/alpha.h b/keyboards/kakunpc/angel17/alpha/alpha.h similarity index 100% rename from keyboards/angel17/alpha/alpha.h rename to keyboards/kakunpc/angel17/alpha/alpha.h diff --git a/keyboards/angel17/alpha/config.h b/keyboards/kakunpc/angel17/alpha/config.h similarity index 100% rename from keyboards/angel17/alpha/config.h rename to keyboards/kakunpc/angel17/alpha/config.h diff --git a/keyboards/angel17/alpha/rules.mk b/keyboards/kakunpc/angel17/alpha/rules.mk similarity index 100% rename from keyboards/angel17/alpha/rules.mk rename to keyboards/kakunpc/angel17/alpha/rules.mk diff --git a/keyboards/angel17/info.json b/keyboards/kakunpc/angel17/info.json similarity index 100% rename from keyboards/angel17/info.json rename to keyboards/kakunpc/angel17/info.json diff --git a/keyboards/angel17/keymaps/default/keymap.c b/keyboards/kakunpc/angel17/keymaps/default/keymap.c similarity index 100% rename from keyboards/angel17/keymaps/default/keymap.c rename to keyboards/kakunpc/angel17/keymaps/default/keymap.c diff --git a/keyboards/angel17/keymaps/default/readme.md b/keyboards/kakunpc/angel17/keymaps/default/readme.md similarity index 100% rename from keyboards/angel17/keymaps/default/readme.md rename to keyboards/kakunpc/angel17/keymaps/default/readme.md diff --git a/keyboards/angel17/readme.md b/keyboards/kakunpc/angel17/readme.md similarity index 94% rename from keyboards/angel17/readme.md rename to keyboards/kakunpc/angel17/readme.md index 8c9b80668558..16914887a635 100644 --- a/keyboards/angel17/readme.md +++ b/keyboards/kakunpc/angel17/readme.md @@ -10,6 +10,6 @@ Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) Make example for this keyboard (after setting up your build environment): - make angel17:default + make kakunpc/angel17/rev1: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/angel17/rev1/config.h b/keyboards/kakunpc/angel17/rev1/config.h similarity index 100% rename from keyboards/angel17/rev1/config.h rename to keyboards/kakunpc/angel17/rev1/config.h diff --git a/keyboards/angel17/rev1/rev1.c b/keyboards/kakunpc/angel17/rev1/rev1.c similarity index 100% rename from keyboards/angel17/rev1/rev1.c rename to keyboards/kakunpc/angel17/rev1/rev1.c diff --git a/keyboards/angel17/rev1/rev1.h b/keyboards/kakunpc/angel17/rev1/rev1.h similarity index 100% rename from keyboards/angel17/rev1/rev1.h rename to keyboards/kakunpc/angel17/rev1/rev1.h diff --git a/keyboards/angel17/rev1/rules.mk b/keyboards/kakunpc/angel17/rev1/rules.mk similarity index 100% rename from keyboards/angel17/rev1/rules.mk rename to keyboards/kakunpc/angel17/rev1/rules.mk diff --git a/keyboards/angel17/rules.mk b/keyboards/kakunpc/angel17/rules.mk similarity index 94% rename from keyboards/angel17/rules.mk rename to keyboards/kakunpc/angel17/rules.mk index 6c73399ec160..35c999d465b9 100644 --- a/keyboards/angel17/rules.mk +++ b/keyboards/kakunpc/angel17/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output LAYOUTS = numpad_5x4 -DEFAULT_FOLDER = angel17/rev1 +DEFAULT_FOLDER = kakunpc/angel17/rev1 diff --git a/keyboards/chidori/.noci b/keyboards/kakunpc/angel64/.noci similarity index 100% rename from keyboards/chidori/.noci rename to keyboards/kakunpc/angel64/.noci diff --git a/keyboards/choco60/rev1/.noci b/keyboards/kakunpc/angel64/alpha/.noci similarity index 100% rename from keyboards/choco60/rev1/.noci rename to keyboards/kakunpc/angel64/alpha/.noci diff --git a/keyboards/angel64/alpha/alpha.c b/keyboards/kakunpc/angel64/alpha/alpha.c similarity index 100% rename from keyboards/angel64/alpha/alpha.c rename to keyboards/kakunpc/angel64/alpha/alpha.c diff --git a/keyboards/angel64/alpha/alpha.h b/keyboards/kakunpc/angel64/alpha/alpha.h similarity index 100% rename from keyboards/angel64/alpha/alpha.h rename to keyboards/kakunpc/angel64/alpha/alpha.h diff --git a/keyboards/angel64/alpha/config.h b/keyboards/kakunpc/angel64/alpha/config.h similarity index 100% rename from keyboards/angel64/alpha/config.h rename to keyboards/kakunpc/angel64/alpha/config.h diff --git a/keyboards/angel64/alpha/info.json b/keyboards/kakunpc/angel64/alpha/info.json similarity index 100% rename from keyboards/angel64/alpha/info.json rename to keyboards/kakunpc/angel64/alpha/info.json diff --git a/keyboards/angel64/alpha/keymaps/default/keymap.c b/keyboards/kakunpc/angel64/alpha/keymaps/default/keymap.c similarity index 100% rename from keyboards/angel64/alpha/keymaps/default/keymap.c rename to keyboards/kakunpc/angel64/alpha/keymaps/default/keymap.c diff --git a/keyboards/angel64/alpha/keymaps/default/readme.md b/keyboards/kakunpc/angel64/alpha/keymaps/default/readme.md similarity index 100% rename from keyboards/angel64/alpha/keymaps/default/readme.md rename to keyboards/kakunpc/angel64/alpha/keymaps/default/readme.md diff --git a/keyboards/angel64/alpha/matrix.c b/keyboards/kakunpc/angel64/alpha/matrix.c similarity index 98% rename from keyboards/angel64/alpha/matrix.c rename to keyboards/kakunpc/angel64/alpha/matrix.c index 474fbec030c9..2851859cf261 100644 --- a/keyboards/angel64/alpha/matrix.c +++ b/keyboards/kakunpc/angel64/alpha/matrix.c @@ -90,13 +90,6 @@ uint8_t matrix_cols(void) { return MATRIX_COLS; } -//Deprecated. -bool matrix_is_modified(void) -{ - if (debounce_active()) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/angel64/alpha/readme.md b/keyboards/kakunpc/angel64/alpha/readme.md similarity index 94% rename from keyboards/angel64/alpha/readme.md rename to keyboards/kakunpc/angel64/alpha/readme.md index d646edeb7eee..4de66e670631 100644 --- a/keyboards/angel64/alpha/readme.md +++ b/keyboards/kakunpc/angel64/alpha/readme.md @@ -10,6 +10,6 @@ Keyboard for tablets. Make example for this keyboard (after setting up your build environment): - make angel64/alpha:default + make kakunpc/angel64/alpha: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/launchpad/rev1/rules.mk b/keyboards/kakunpc/angel64/alpha/rules.mk similarity index 100% rename from keyboards/launchpad/rev1/rules.mk rename to keyboards/kakunpc/angel64/alpha/rules.mk diff --git a/keyboards/angel64/readme.md b/keyboards/kakunpc/angel64/readme.md similarity index 94% rename from keyboards/angel64/readme.md rename to keyboards/kakunpc/angel64/readme.md index 791620144e24..41f8233afb67 100644 --- a/keyboards/angel64/readme.md +++ b/keyboards/kakunpc/angel64/readme.md @@ -10,6 +10,6 @@ Keyboard for tablets. Make example for this keyboard (after setting up your build environment): - make angel64:default + make kakunpc/angel64/rev1: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/angel64/rev1/config.h b/keyboards/kakunpc/angel64/rev1/config.h similarity index 100% rename from keyboards/angel64/rev1/config.h rename to keyboards/kakunpc/angel64/rev1/config.h diff --git a/keyboards/angel64/rev1/info.json b/keyboards/kakunpc/angel64/rev1/info.json similarity index 100% rename from keyboards/angel64/rev1/info.json rename to keyboards/kakunpc/angel64/rev1/info.json diff --git a/keyboards/angel64/rev1/keymaps/default/keymap.c b/keyboards/kakunpc/angel64/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/angel64/rev1/keymaps/default/keymap.c rename to keyboards/kakunpc/angel64/rev1/keymaps/default/keymap.c diff --git a/keyboards/angel64/rev1/keymaps/default/readme.md b/keyboards/kakunpc/angel64/rev1/keymaps/default/readme.md similarity index 100% rename from keyboards/angel64/rev1/keymaps/default/readme.md rename to keyboards/kakunpc/angel64/rev1/keymaps/default/readme.md diff --git a/keyboards/angel64/rev1/keymaps/kakunpc/config.h b/keyboards/kakunpc/angel64/rev1/keymaps/kakunpc/config.h similarity index 100% rename from keyboards/angel64/rev1/keymaps/kakunpc/config.h rename to keyboards/kakunpc/angel64/rev1/keymaps/kakunpc/config.h diff --git a/keyboards/angel64/rev1/keymaps/kakunpc/keymap.c b/keyboards/kakunpc/angel64/rev1/keymaps/kakunpc/keymap.c similarity index 100% rename from keyboards/angel64/rev1/keymaps/kakunpc/keymap.c rename to keyboards/kakunpc/angel64/rev1/keymaps/kakunpc/keymap.c diff --git a/keyboards/angel64/rev1/keymaps/kakunpc/readme.md b/keyboards/kakunpc/angel64/rev1/keymaps/kakunpc/readme.md similarity index 100% rename from keyboards/angel64/rev1/keymaps/kakunpc/readme.md rename to keyboards/kakunpc/angel64/rev1/keymaps/kakunpc/readme.md diff --git a/keyboards/thedogkeyboard/matrix.c b/keyboards/kakunpc/angel64/rev1/matrix.c similarity index 98% rename from keyboards/thedogkeyboard/matrix.c rename to keyboards/kakunpc/angel64/rev1/matrix.c index 474fbec030c9..2851859cf261 100644 --- a/keyboards/thedogkeyboard/matrix.c +++ b/keyboards/kakunpc/angel64/rev1/matrix.c @@ -90,13 +90,6 @@ uint8_t matrix_cols(void) { return MATRIX_COLS; } -//Deprecated. -bool matrix_is_modified(void) -{ - if (debounce_active()) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/angel64/rev1/readme.md b/keyboards/kakunpc/angel64/rev1/readme.md similarity index 94% rename from keyboards/angel64/rev1/readme.md rename to keyboards/kakunpc/angel64/rev1/readme.md index 4ce77807c903..4809710a43bd 100644 --- a/keyboards/angel64/rev1/readme.md +++ b/keyboards/kakunpc/angel64/rev1/readme.md @@ -10,6 +10,6 @@ Keyboard for tablets. Make example for this keyboard (after setting up your build environment): - make angel64/rev1:default + make kakunpc/angel64/rev1: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/angel64/rev1/rev1.c b/keyboards/kakunpc/angel64/rev1/rev1.c similarity index 100% rename from keyboards/angel64/rev1/rev1.c rename to keyboards/kakunpc/angel64/rev1/rev1.c diff --git a/keyboards/angel64/rev1/rev1.h b/keyboards/kakunpc/angel64/rev1/rev1.h similarity index 100% rename from keyboards/angel64/rev1/rev1.h rename to keyboards/kakunpc/angel64/rev1/rev1.h diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/rules.mk b/keyboards/kakunpc/angel64/rev1/rules.mk similarity index 100% rename from keyboards/lets_split_eh/keymaps/doxish_dvorak/rules.mk rename to keyboards/kakunpc/angel64/rev1/rules.mk diff --git a/keyboards/angel64/rules.mk b/keyboards/kakunpc/angel64/rules.mk similarity index 94% rename from keyboards/angel64/rules.mk rename to keyboards/kakunpc/angel64/rules.mk index 9bf41a18ccdd..ca4e93f35cb6 100644 --- a/keyboards/angel64/rules.mk +++ b/keyboards/kakunpc/angel64/rules.mk @@ -22,4 +22,4 @@ CUSTOM_MATRIX = yes SRC += matrix.c -DEFAULT_FOLDER = angel64/rev1 +DEFAULT_FOLDER = kakunpc/angel64/rev1 diff --git a/keyboards/christmas_tree/.noci b/keyboards/kakunpc/business_card/.noci similarity index 100% rename from keyboards/christmas_tree/.noci rename to keyboards/kakunpc/business_card/.noci diff --git a/keyboards/claw44/.noci b/keyboards/kakunpc/business_card/alpha/.noci similarity index 100% rename from keyboards/claw44/.noci rename to keyboards/kakunpc/business_card/alpha/.noci diff --git a/keyboards/business_card/alpha/alpha.c b/keyboards/kakunpc/business_card/alpha/alpha.c similarity index 100% rename from keyboards/business_card/alpha/alpha.c rename to keyboards/kakunpc/business_card/alpha/alpha.c diff --git a/keyboards/business_card/alpha/alpha.h b/keyboards/kakunpc/business_card/alpha/alpha.h similarity index 100% rename from keyboards/business_card/alpha/alpha.h rename to keyboards/kakunpc/business_card/alpha/alpha.h diff --git a/keyboards/business_card/alpha/config.h b/keyboards/kakunpc/business_card/alpha/config.h similarity index 100% rename from keyboards/business_card/alpha/config.h rename to keyboards/kakunpc/business_card/alpha/config.h diff --git a/keyboards/business_card/alpha/info.json b/keyboards/kakunpc/business_card/alpha/info.json similarity index 100% rename from keyboards/business_card/alpha/info.json rename to keyboards/kakunpc/business_card/alpha/info.json diff --git a/keyboards/business_card/alpha/keymaps/default/config.h b/keyboards/kakunpc/business_card/alpha/keymaps/default/config.h similarity index 100% rename from keyboards/business_card/alpha/keymaps/default/config.h rename to keyboards/kakunpc/business_card/alpha/keymaps/default/config.h diff --git a/keyboards/business_card/alpha/keymaps/default/keymap.c b/keyboards/kakunpc/business_card/alpha/keymaps/default/keymap.c similarity index 100% rename from keyboards/business_card/alpha/keymaps/default/keymap.c rename to keyboards/kakunpc/business_card/alpha/keymaps/default/keymap.c diff --git a/keyboards/business_card/alpha/keymaps/default/readme.md b/keyboards/kakunpc/business_card/alpha/keymaps/default/readme.md similarity index 100% rename from keyboards/business_card/alpha/keymaps/default/readme.md rename to keyboards/kakunpc/business_card/alpha/keymaps/default/readme.md diff --git a/keyboards/business_card/alpha/rules.mk b/keyboards/kakunpc/business_card/alpha/rules.mk similarity index 100% rename from keyboards/business_card/alpha/rules.mk rename to keyboards/kakunpc/business_card/alpha/rules.mk diff --git a/keyboards/business_card/beta/beta.c b/keyboards/kakunpc/business_card/beta/beta.c similarity index 100% rename from keyboards/business_card/beta/beta.c rename to keyboards/kakunpc/business_card/beta/beta.c diff --git a/keyboards/business_card/beta/beta.h b/keyboards/kakunpc/business_card/beta/beta.h similarity index 100% rename from keyboards/business_card/beta/beta.h rename to keyboards/kakunpc/business_card/beta/beta.h diff --git a/keyboards/business_card/beta/config.h b/keyboards/kakunpc/business_card/beta/config.h similarity index 100% rename from keyboards/business_card/beta/config.h rename to keyboards/kakunpc/business_card/beta/config.h diff --git a/keyboards/business_card/beta/info.json b/keyboards/kakunpc/business_card/beta/info.json similarity index 100% rename from keyboards/business_card/beta/info.json rename to keyboards/kakunpc/business_card/beta/info.json diff --git a/keyboards/business_card/beta/keymaps/default/config.h b/keyboards/kakunpc/business_card/beta/keymaps/default/config.h similarity index 100% rename from keyboards/business_card/beta/keymaps/default/config.h rename to keyboards/kakunpc/business_card/beta/keymaps/default/config.h diff --git a/keyboards/business_card/beta/keymaps/default/keymap.c b/keyboards/kakunpc/business_card/beta/keymaps/default/keymap.c similarity index 100% rename from keyboards/business_card/beta/keymaps/default/keymap.c rename to keyboards/kakunpc/business_card/beta/keymaps/default/keymap.c diff --git a/keyboards/business_card/beta/keymaps/default/readme.md b/keyboards/kakunpc/business_card/beta/keymaps/default/readme.md similarity index 100% rename from keyboards/business_card/beta/keymaps/default/readme.md rename to keyboards/kakunpc/business_card/beta/keymaps/default/readme.md diff --git a/keyboards/business_card/beta/rules.mk b/keyboards/kakunpc/business_card/beta/rules.mk similarity index 100% rename from keyboards/business_card/beta/rules.mk rename to keyboards/kakunpc/business_card/beta/rules.mk diff --git a/keyboards/business_card/business_card.c b/keyboards/kakunpc/business_card/business_card.c similarity index 100% rename from keyboards/business_card/business_card.c rename to keyboards/kakunpc/business_card/business_card.c diff --git a/keyboards/business_card/business_card.h b/keyboards/kakunpc/business_card/business_card.h similarity index 89% rename from keyboards/business_card/business_card.h rename to keyboards/kakunpc/business_card/business_card.h index f330a01822e7..125c3080d6e1 100644 --- a/keyboards/business_card/business_card.h +++ b/keyboards/kakunpc/business_card/business_card.h @@ -15,10 +15,10 @@ */ #pragma once -#ifdef KEYBOARD_business_card_alpha +#ifdef KEYBOARD_kakunpc_business_card_alpha #include "alpha.h" #endif -#ifdef KEYBOARD_business_card_beta +#ifdef KEYBOARD_kakunpc_business_card_beta #include "beta.h" #endif diff --git a/keyboards/business_card/config.h b/keyboards/kakunpc/business_card/config.h similarity index 100% rename from keyboards/business_card/config.h rename to keyboards/kakunpc/business_card/config.h diff --git a/keyboards/business_card/readme.md b/keyboards/kakunpc/business_card/readme.md similarity index 93% rename from keyboards/business_card/readme.md rename to keyboards/kakunpc/business_card/readme.md index c1bb32c9c3bb..cbd05af4108f 100644 --- a/keyboards/business_card/readme.md +++ b/keyboards/kakunpc/business_card/readme.md @@ -10,6 +10,6 @@ Hardware Availability: links to where you can find this hardware Make example for this keyboard (after setting up your build environment): - make business_card:default + make kakunpc/business_card/beta: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/business_card/rules.mk b/keyboards/kakunpc/business_card/rules.mk similarity index 93% rename from keyboards/business_card/rules.mk rename to keyboards/kakunpc/business_card/rules.mk index cda401220e04..ad9ea936af7e 100644 --- a/keyboards/business_card/rules.mk +++ b/keyboards/kakunpc/business_card/rules.mk @@ -17,4 +17,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -DEFAULT_FOLDER = business_card/beta +DEFAULT_FOLDER = kakunpc/business_card/beta diff --git a/keyboards/choc_taro/choc_taro.c b/keyboards/kakunpc/choc_taro/choc_taro.c similarity index 100% rename from keyboards/choc_taro/choc_taro.c rename to keyboards/kakunpc/choc_taro/choc_taro.c diff --git a/keyboards/choc_taro/choc_taro.h b/keyboards/kakunpc/choc_taro/choc_taro.h similarity index 100% rename from keyboards/choc_taro/choc_taro.h rename to keyboards/kakunpc/choc_taro/choc_taro.h diff --git a/keyboards/choc_taro/config.h b/keyboards/kakunpc/choc_taro/config.h similarity index 100% rename from keyboards/choc_taro/config.h rename to keyboards/kakunpc/choc_taro/config.h diff --git a/keyboards/choc_taro/info.json b/keyboards/kakunpc/choc_taro/info.json similarity index 100% rename from keyboards/choc_taro/info.json rename to keyboards/kakunpc/choc_taro/info.json diff --git a/keyboards/choc_taro/keymaps/default/keymap.c b/keyboards/kakunpc/choc_taro/keymaps/default/keymap.c similarity index 100% rename from keyboards/choc_taro/keymaps/default/keymap.c rename to keyboards/kakunpc/choc_taro/keymaps/default/keymap.c diff --git a/keyboards/choc_taro/keymaps/default/readme.md b/keyboards/kakunpc/choc_taro/keymaps/default/readme.md similarity index 100% rename from keyboards/choc_taro/keymaps/default/readme.md rename to keyboards/kakunpc/choc_taro/keymaps/default/readme.md diff --git a/keyboards/choc_taro/keymaps/via/keymap.c b/keyboards/kakunpc/choc_taro/keymaps/via/keymap.c similarity index 100% rename from keyboards/choc_taro/keymaps/via/keymap.c rename to keyboards/kakunpc/choc_taro/keymaps/via/keymap.c diff --git a/keyboards/choc_taro/keymaps/via/readme.md b/keyboards/kakunpc/choc_taro/keymaps/via/readme.md similarity index 100% rename from keyboards/choc_taro/keymaps/via/readme.md rename to keyboards/kakunpc/choc_taro/keymaps/via/readme.md diff --git a/keyboards/delilah/keymaps/via/rules.mk b/keyboards/kakunpc/choc_taro/keymaps/via/rules.mk similarity index 100% rename from keyboards/delilah/keymaps/via/rules.mk rename to keyboards/kakunpc/choc_taro/keymaps/via/rules.mk diff --git a/keyboards/choc_taro/matrix.c b/keyboards/kakunpc/choc_taro/matrix.c similarity index 100% rename from keyboards/choc_taro/matrix.c rename to keyboards/kakunpc/choc_taro/matrix.c diff --git a/keyboards/choc_taro/readme.md b/keyboards/kakunpc/choc_taro/readme.md similarity index 94% rename from keyboards/choc_taro/readme.md rename to keyboards/kakunpc/choc_taro/readme.md index f0900c2fe462..8e641c72b87b 100644 --- a/keyboards/choc_taro/readme.md +++ b/keyboards/kakunpc/choc_taro/readme.md @@ -10,6 +10,6 @@ gh60 compatible choc keyboard Make example for this keyboard (after setting up your build environment): - make choc_taro:default + make kakunpc/choc_taro: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/choc_taro/rules.mk b/keyboards/kakunpc/choc_taro/rules.mk similarity index 100% rename from keyboards/choc_taro/rules.mk rename to keyboards/kakunpc/choc_taro/rules.mk diff --git a/keyboards/rabbit_capture_plan/config.h b/keyboards/kakunpc/rabbit_capture_plan/config.h similarity index 100% rename from keyboards/rabbit_capture_plan/config.h rename to keyboards/kakunpc/rabbit_capture_plan/config.h diff --git a/keyboards/rabbit_capture_plan/info.json b/keyboards/kakunpc/rabbit_capture_plan/info.json similarity index 100% rename from keyboards/rabbit_capture_plan/info.json rename to keyboards/kakunpc/rabbit_capture_plan/info.json diff --git a/keyboards/rabbit_capture_plan/keymaps/default/keymap.c b/keyboards/kakunpc/rabbit_capture_plan/keymaps/default/keymap.c similarity index 100% rename from keyboards/rabbit_capture_plan/keymaps/default/keymap.c rename to keyboards/kakunpc/rabbit_capture_plan/keymaps/default/keymap.c diff --git a/keyboards/rabbit_capture_plan/keymaps/default/readme.md b/keyboards/kakunpc/rabbit_capture_plan/keymaps/default/readme.md similarity index 100% rename from keyboards/rabbit_capture_plan/keymaps/default/readme.md rename to keyboards/kakunpc/rabbit_capture_plan/keymaps/default/readme.md diff --git a/keyboards/rabbit_capture_plan/keymaps/via/keymap.c b/keyboards/kakunpc/rabbit_capture_plan/keymaps/via/keymap.c similarity index 100% rename from keyboards/rabbit_capture_plan/keymaps/via/keymap.c rename to keyboards/kakunpc/rabbit_capture_plan/keymaps/via/keymap.c diff --git a/keyboards/rabbit_capture_plan/keymaps/via/readme.md b/keyboards/kakunpc/rabbit_capture_plan/keymaps/via/readme.md similarity index 100% rename from keyboards/rabbit_capture_plan/keymaps/via/readme.md rename to keyboards/kakunpc/rabbit_capture_plan/keymaps/via/readme.md diff --git a/keyboards/dozen0/keymaps/via/rules.mk b/keyboards/kakunpc/rabbit_capture_plan/keymaps/via/rules.mk similarity index 100% rename from keyboards/dozen0/keymaps/via/rules.mk rename to keyboards/kakunpc/rabbit_capture_plan/keymaps/via/rules.mk diff --git a/keyboards/rabbit_capture_plan/rabbit_capture_plan.c b/keyboards/kakunpc/rabbit_capture_plan/rabbit_capture_plan.c similarity index 100% rename from keyboards/rabbit_capture_plan/rabbit_capture_plan.c rename to keyboards/kakunpc/rabbit_capture_plan/rabbit_capture_plan.c diff --git a/keyboards/rabbit_capture_plan/rabbit_capture_plan.h b/keyboards/kakunpc/rabbit_capture_plan/rabbit_capture_plan.h similarity index 100% rename from keyboards/rabbit_capture_plan/rabbit_capture_plan.h rename to keyboards/kakunpc/rabbit_capture_plan/rabbit_capture_plan.h diff --git a/keyboards/rabbit_capture_plan/readme.md b/keyboards/kakunpc/rabbit_capture_plan/readme.md similarity index 88% rename from keyboards/rabbit_capture_plan/readme.md rename to keyboards/kakunpc/rabbit_capture_plan/readme.md index bc6f9d5deabf..fa80367a1202 100644 --- a/keyboards/rabbit_capture_plan/readme.md +++ b/keyboards/kakunpc/rabbit_capture_plan/readme.md @@ -10,10 +10,10 @@ This is 70 keys split keyboard with trackball. Make example for this keyboard (after setting up your build environment): - make rabbit_capture_plan:default + make kakunpc/rabbit_capture_plan:default Flashing example for this keyboard: - make rabbit_capture_plan:default:flash + make kakunpc/rabbit_capture_plan: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/rabbit_capture_plan/rules.mk b/keyboards/kakunpc/rabbit_capture_plan/rules.mk similarity index 100% rename from keyboards/rabbit_capture_plan/rules.mk rename to keyboards/kakunpc/rabbit_capture_plan/rules.mk diff --git a/keyboards/suihankey/alpha/alpha.c b/keyboards/kakunpc/suihankey/alpha/alpha.c similarity index 100% rename from keyboards/suihankey/alpha/alpha.c rename to keyboards/kakunpc/suihankey/alpha/alpha.c diff --git a/keyboards/suihankey/alpha/alpha.h b/keyboards/kakunpc/suihankey/alpha/alpha.h similarity index 100% rename from keyboards/suihankey/alpha/alpha.h rename to keyboards/kakunpc/suihankey/alpha/alpha.h diff --git a/keyboards/suihankey/alpha/config.h b/keyboards/kakunpc/suihankey/alpha/config.h similarity index 100% rename from keyboards/suihankey/alpha/config.h rename to keyboards/kakunpc/suihankey/alpha/config.h diff --git a/keyboards/suihankey/alpha/info.json b/keyboards/kakunpc/suihankey/alpha/info.json similarity index 100% rename from keyboards/suihankey/alpha/info.json rename to keyboards/kakunpc/suihankey/alpha/info.json diff --git a/keyboards/suihankey/alpha/keymaps/default/keymap.c b/keyboards/kakunpc/suihankey/alpha/keymaps/default/keymap.c similarity index 100% rename from keyboards/suihankey/alpha/keymaps/default/keymap.c rename to keyboards/kakunpc/suihankey/alpha/keymaps/default/keymap.c diff --git a/keyboards/suihankey/alpha/keymaps/default/readme.md b/keyboards/kakunpc/suihankey/alpha/keymaps/default/readme.md similarity index 100% rename from keyboards/suihankey/alpha/keymaps/default/readme.md rename to keyboards/kakunpc/suihankey/alpha/keymaps/default/readme.md diff --git a/keyboards/suihankey/alpha/readme.md b/keyboards/kakunpc/suihankey/alpha/readme.md similarity index 100% rename from keyboards/suihankey/alpha/readme.md rename to keyboards/kakunpc/suihankey/alpha/readme.md diff --git a/keyboards/launchpad/keymaps/default_rgb/rules.mk b/keyboards/kakunpc/suihankey/alpha/rules.mk similarity index 100% rename from keyboards/launchpad/keymaps/default_rgb/rules.mk rename to keyboards/kakunpc/suihankey/alpha/rules.mk diff --git a/keyboards/suihankey/readme.md b/keyboards/kakunpc/suihankey/readme.md similarity index 94% rename from keyboards/suihankey/readme.md rename to keyboards/kakunpc/suihankey/readme.md index 29d82323d3fc..e8099dbca47b 100644 --- a/keyboards/suihankey/readme.md +++ b/keyboards/kakunpc/suihankey/readme.md @@ -13,6 +13,6 @@ Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) Make example for this keyboard (after setting up your build environment): - make suihankey:default + make kakunpc/suihankey/rev1: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/suihankey/rev1/config.h b/keyboards/kakunpc/suihankey/rev1/config.h similarity index 100% rename from keyboards/suihankey/rev1/config.h rename to keyboards/kakunpc/suihankey/rev1/config.h diff --git a/keyboards/suihankey/rev1/info.json b/keyboards/kakunpc/suihankey/rev1/info.json similarity index 100% rename from keyboards/suihankey/rev1/info.json rename to keyboards/kakunpc/suihankey/rev1/info.json diff --git a/keyboards/suihankey/rev1/keymaps/default/keymap.c b/keyboards/kakunpc/suihankey/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/suihankey/rev1/keymaps/default/keymap.c rename to keyboards/kakunpc/suihankey/rev1/keymaps/default/keymap.c diff --git a/keyboards/suihankey/rev1/keymaps/default/readme.md b/keyboards/kakunpc/suihankey/rev1/keymaps/default/readme.md similarity index 100% rename from keyboards/suihankey/rev1/keymaps/default/readme.md rename to keyboards/kakunpc/suihankey/rev1/keymaps/default/readme.md diff --git a/keyboards/suihankey/rev1/readme.md b/keyboards/kakunpc/suihankey/rev1/readme.md similarity index 100% rename from keyboards/suihankey/rev1/readme.md rename to keyboards/kakunpc/suihankey/rev1/readme.md diff --git a/keyboards/suihankey/rev1/rev1.c b/keyboards/kakunpc/suihankey/rev1/rev1.c similarity index 100% rename from keyboards/suihankey/rev1/rev1.c rename to keyboards/kakunpc/suihankey/rev1/rev1.c diff --git a/keyboards/suihankey/rev1/rev1.h b/keyboards/kakunpc/suihankey/rev1/rev1.h similarity index 100% rename from keyboards/suihankey/rev1/rev1.h rename to keyboards/kakunpc/suihankey/rev1/rev1.h diff --git a/keyboards/reviung34/keymaps/default_rgb/rules.mk b/keyboards/kakunpc/suihankey/rev1/rules.mk similarity index 100% rename from keyboards/reviung34/keymaps/default_rgb/rules.mk rename to keyboards/kakunpc/suihankey/rev1/rules.mk diff --git a/keyboards/suihankey/rules.mk b/keyboards/kakunpc/suihankey/rules.mk similarity index 94% rename from keyboards/suihankey/rules.mk rename to keyboards/kakunpc/suihankey/rules.mk index 8e1e7f7856b4..332c7d73551a 100644 --- a/keyboards/suihankey/rules.mk +++ b/keyboards/kakunpc/suihankey/rules.mk @@ -20,4 +20,4 @@ OLED_ENABLE = yes OLED_DRIVER = SSD1306 SPLIT_KEYBOARD = no -DEFAULT_FOLDER = suihankey/rev1 +DEFAULT_FOLDER = kakunpc/suihankey/rev1 diff --git a/keyboards/claw44/rev1/.noci b/keyboards/kakunpc/suihankey/split/.noci similarity index 100% rename from keyboards/claw44/rev1/.noci rename to keyboards/kakunpc/suihankey/split/.noci diff --git a/keyboards/cocoa40/.noci b/keyboards/kakunpc/suihankey/split/alpha/.noci similarity index 100% rename from keyboards/cocoa40/.noci rename to keyboards/kakunpc/suihankey/split/alpha/.noci diff --git a/keyboards/suihankey/split/alpha/alpha.c b/keyboards/kakunpc/suihankey/split/alpha/alpha.c similarity index 100% rename from keyboards/suihankey/split/alpha/alpha.c rename to keyboards/kakunpc/suihankey/split/alpha/alpha.c diff --git a/keyboards/suihankey/split/alpha/alpha.h b/keyboards/kakunpc/suihankey/split/alpha/alpha.h similarity index 100% rename from keyboards/suihankey/split/alpha/alpha.h rename to keyboards/kakunpc/suihankey/split/alpha/alpha.h diff --git a/keyboards/suihankey/split/alpha/config.h b/keyboards/kakunpc/suihankey/split/alpha/config.h similarity index 100% rename from keyboards/suihankey/split/alpha/config.h rename to keyboards/kakunpc/suihankey/split/alpha/config.h diff --git a/keyboards/suihankey/split/alpha/readme.md b/keyboards/kakunpc/suihankey/split/alpha/readme.md similarity index 94% rename from keyboards/suihankey/split/alpha/readme.md rename to keyboards/kakunpc/suihankey/split/alpha/readme.md index 2ea1503eb390..4a26a34b9707 100644 --- a/keyboards/suihankey/split/alpha/readme.md +++ b/keyboards/kakunpc/suihankey/split/alpha/readme.md @@ -13,6 +13,6 @@ Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) Make example for this keyboard (after setting up your build environment): - make suihankey/alpha:default + make kakunpc/suihankey/alpha: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/reviung34/keymaps/default_rgb2u/rules.mk b/keyboards/kakunpc/suihankey/split/alpha/rules.mk similarity index 100% rename from keyboards/reviung34/keymaps/default_rgb2u/rules.mk rename to keyboards/kakunpc/suihankey/split/alpha/rules.mk diff --git a/keyboards/suihankey/split/info.json b/keyboards/kakunpc/suihankey/split/info.json similarity index 100% rename from keyboards/suihankey/split/info.json rename to keyboards/kakunpc/suihankey/split/info.json diff --git a/keyboards/suihankey/split/keymaps/default/keymap.c b/keyboards/kakunpc/suihankey/split/keymaps/default/keymap.c similarity index 100% rename from keyboards/suihankey/split/keymaps/default/keymap.c rename to keyboards/kakunpc/suihankey/split/keymaps/default/keymap.c diff --git a/keyboards/suihankey/split/keymaps/default/readme.md b/keyboards/kakunpc/suihankey/split/keymaps/default/readme.md similarity index 100% rename from keyboards/suihankey/split/keymaps/default/readme.md rename to keyboards/kakunpc/suihankey/split/keymaps/default/readme.md diff --git a/keyboards/suihankey/split/readme.md b/keyboards/kakunpc/suihankey/split/readme.md similarity index 94% rename from keyboards/suihankey/split/readme.md rename to keyboards/kakunpc/suihankey/split/readme.md index 34d30580d121..ed2058290b92 100644 --- a/keyboards/suihankey/split/readme.md +++ b/keyboards/kakunpc/suihankey/split/readme.md @@ -13,6 +13,6 @@ Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) Make example for this keyboard (after setting up your build environment): - make suihankey/split:default + make kakunpc/suihankey/split: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/suihankey/split/rev1/config.h b/keyboards/kakunpc/suihankey/split/rev1/config.h similarity index 100% rename from keyboards/suihankey/split/rev1/config.h rename to keyboards/kakunpc/suihankey/split/rev1/config.h diff --git a/keyboards/suihankey/split/rev1/readme.md b/keyboards/kakunpc/suihankey/split/rev1/readme.md similarity index 94% rename from keyboards/suihankey/split/rev1/readme.md rename to keyboards/kakunpc/suihankey/split/rev1/readme.md index f7c4bce166dc..a4e60fe1b947 100644 --- a/keyboards/suihankey/split/rev1/readme.md +++ b/keyboards/kakunpc/suihankey/split/rev1/readme.md @@ -13,6 +13,6 @@ Hardware Availability: booth([@kakunpc](https://kakunpc.booth.pm/)) Make example for this keyboard (after setting up your build environment): - make suihankey/rev1:default + make kakunpc/suihankey/rev1: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/suihankey/split/rev1/rev1.c b/keyboards/kakunpc/suihankey/split/rev1/rev1.c similarity index 100% rename from keyboards/suihankey/split/rev1/rev1.c rename to keyboards/kakunpc/suihankey/split/rev1/rev1.c diff --git a/keyboards/suihankey/split/rev1/rev1.h b/keyboards/kakunpc/suihankey/split/rev1/rev1.h similarity index 100% rename from keyboards/suihankey/split/rev1/rev1.h rename to keyboards/kakunpc/suihankey/split/rev1/rev1.h diff --git a/keyboards/suihankey/split/rev1/rules.mk b/keyboards/kakunpc/suihankey/split/rev1/rules.mk similarity index 100% rename from keyboards/suihankey/split/rev1/rules.mk rename to keyboards/kakunpc/suihankey/split/rev1/rules.mk diff --git a/keyboards/kakunpc/suihankey/split/rules.mk b/keyboards/kakunpc/suihankey/split/rules.mk new file mode 100644 index 000000000000..6da41b20b820 --- /dev/null +++ b/keyboards/kakunpc/suihankey/split/rules.mk @@ -0,0 +1,4 @@ +OLED_ENABLE = no +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = kakunpc/suihankey/split/rev1 diff --git a/keyboards/thedogkeyboard/config.h b/keyboards/kakunpc/thedogkeyboard/config.h similarity index 100% rename from keyboards/thedogkeyboard/config.h rename to keyboards/kakunpc/thedogkeyboard/config.h diff --git a/keyboards/thedogkeyboard/info.json b/keyboards/kakunpc/thedogkeyboard/info.json similarity index 100% rename from keyboards/thedogkeyboard/info.json rename to keyboards/kakunpc/thedogkeyboard/info.json diff --git a/keyboards/thedogkeyboard/keymaps/default/keymap.c b/keyboards/kakunpc/thedogkeyboard/keymaps/default/keymap.c similarity index 100% rename from keyboards/thedogkeyboard/keymaps/default/keymap.c rename to keyboards/kakunpc/thedogkeyboard/keymaps/default/keymap.c diff --git a/keyboards/thedogkeyboard/keymaps/default/readme.md b/keyboards/kakunpc/thedogkeyboard/keymaps/default/readme.md similarity index 100% rename from keyboards/thedogkeyboard/keymaps/default/readme.md rename to keyboards/kakunpc/thedogkeyboard/keymaps/default/readme.md diff --git a/keyboards/thedogkeyboard/keymaps/kakunpc/keymap.c b/keyboards/kakunpc/thedogkeyboard/keymaps/kakunpc/keymap.c similarity index 100% rename from keyboards/thedogkeyboard/keymaps/kakunpc/keymap.c rename to keyboards/kakunpc/thedogkeyboard/keymaps/kakunpc/keymap.c diff --git a/keyboards/thedogkeyboard/keymaps/kakunpc/readme.md b/keyboards/kakunpc/thedogkeyboard/keymaps/kakunpc/readme.md similarity index 100% rename from keyboards/thedogkeyboard/keymaps/kakunpc/readme.md rename to keyboards/kakunpc/thedogkeyboard/keymaps/kakunpc/readme.md diff --git a/keyboards/angel64/rev1/matrix.c b/keyboards/kakunpc/thedogkeyboard/matrix.c similarity index 98% rename from keyboards/angel64/rev1/matrix.c rename to keyboards/kakunpc/thedogkeyboard/matrix.c index 474fbec030c9..2851859cf261 100644 --- a/keyboards/angel64/rev1/matrix.c +++ b/keyboards/kakunpc/thedogkeyboard/matrix.c @@ -90,13 +90,6 @@ uint8_t matrix_cols(void) { return MATRIX_COLS; } -//Deprecated. -bool matrix_is_modified(void) -{ - if (debounce_active()) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/thedogkeyboard/readme.md b/keyboards/kakunpc/thedogkeyboard/readme.md similarity index 94% rename from keyboards/thedogkeyboard/readme.md rename to keyboards/kakunpc/thedogkeyboard/readme.md index 789149ca8269..c3f73c530352 100644 --- a/keyboards/thedogkeyboard/readme.md +++ b/keyboards/kakunpc/thedogkeyboard/readme.md @@ -10,6 +10,6 @@ ProMicro 100% Keyboard. Make example for this keyboard (after setting up your build environment): - make thedogkeyboard:default + make kakunpc/thedogkeyboard: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/thedogkeyboard/rules.mk b/keyboards/kakunpc/thedogkeyboard/rules.mk similarity index 100% rename from keyboards/thedogkeyboard/rules.mk rename to keyboards/kakunpc/thedogkeyboard/rules.mk diff --git a/keyboards/thedogkeyboard/thedogkeyboard.c b/keyboards/kakunpc/thedogkeyboard/thedogkeyboard.c similarity index 100% rename from keyboards/thedogkeyboard/thedogkeyboard.c rename to keyboards/kakunpc/thedogkeyboard/thedogkeyboard.c diff --git a/keyboards/thedogkeyboard/thedogkeyboard.h b/keyboards/kakunpc/thedogkeyboard/thedogkeyboard.h similarity index 100% rename from keyboards/thedogkeyboard/thedogkeyboard.h rename to keyboards/kakunpc/thedogkeyboard/thedogkeyboard.h diff --git a/keyboards/niu_mini/config.h b/keyboards/kbdfans/niu_mini/config.h similarity index 100% rename from keyboards/niu_mini/config.h rename to keyboards/kbdfans/niu_mini/config.h diff --git a/keyboards/niu_mini/info.json b/keyboards/kbdfans/niu_mini/info.json similarity index 100% rename from keyboards/niu_mini/info.json rename to keyboards/kbdfans/niu_mini/info.json diff --git a/keyboards/niu_mini/keymaps/abhixec/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/abhixec/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/abhixec/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/abhixec/keymap.c diff --git a/keyboards/niu_mini/keymaps/abhixec/readme.md b/keyboards/kbdfans/niu_mini/keymaps/abhixec/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/abhixec/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/abhixec/readme.md diff --git a/keyboards/niu_mini/keymaps/abhixec/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/abhixec/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/abhixec/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/abhixec/rules.mk diff --git a/keyboards/niu_mini/keymaps/codecoffeecode/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/codecoffeecode/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/codecoffeecode/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/codecoffeecode/keymap.c diff --git a/keyboards/niu_mini/keymaps/codecoffeecode/readme.md b/keyboards/kbdfans/niu_mini/keymaps/codecoffeecode/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/codecoffeecode/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/codecoffeecode/readme.md diff --git a/keyboards/niu_mini/keymaps/default/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/default/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/default/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/default/keymap.c diff --git a/keyboards/niu_mini/keymaps/default/readme.md b/keyboards/kbdfans/niu_mini/keymaps/default/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/default/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/default/readme.md diff --git a/keyboards/niu_mini/keymaps/dyesub/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/dyesub/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/dyesub/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/dyesub/keymap.c diff --git a/keyboards/niu_mini/keymaps/dyesub/readme.md b/keyboards/kbdfans/niu_mini/keymaps/dyesub/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/dyesub/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/dyesub/readme.md diff --git a/keyboards/niu_mini/keymaps/dyesub/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/dyesub/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/dyesub/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/dyesub/rules.mk diff --git a/keyboards/niu_mini/keymaps/edvard/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/edvard/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/edvard/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/edvard/keymap.c diff --git a/keyboards/niu_mini/keymaps/edvard/readme.md b/keyboards/kbdfans/niu_mini/keymaps/edvard/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/edvard/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/edvard/readme.md diff --git a/keyboards/niu_mini/keymaps/framtava/config.h b/keyboards/kbdfans/niu_mini/keymaps/framtava/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/framtava/config.h rename to keyboards/kbdfans/niu_mini/keymaps/framtava/config.h diff --git a/keyboards/niu_mini/keymaps/framtava/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/framtava/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/framtava/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/framtava/keymap.c diff --git a/keyboards/niu_mini/keymaps/framtava/readme.md b/keyboards/kbdfans/niu_mini/keymaps/framtava/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/framtava/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/framtava/readme.md diff --git a/keyboards/niu_mini/keymaps/framtava/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/framtava/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/framtava/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/framtava/rules.mk diff --git a/keyboards/niu_mini/keymaps/mason/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/mason/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/mason/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/mason/keymap.c diff --git a/keyboards/niu_mini/keymaps/nosarthur/README.md b/keyboards/kbdfans/niu_mini/keymaps/nosarthur/README.md similarity index 100% rename from keyboards/niu_mini/keymaps/nosarthur/README.md rename to keyboards/kbdfans/niu_mini/keymaps/nosarthur/README.md diff --git a/keyboards/niu_mini/keymaps/nosarthur/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/nosarthur/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/nosarthur/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/nosarthur/keymap.c diff --git a/keyboards/niu_mini/keymaps/nosarthur/keymap_colemak_dh.json b/keyboards/kbdfans/niu_mini/keymaps/nosarthur/keymap_colemak_dh.json similarity index 100% rename from keyboards/niu_mini/keymaps/nosarthur/keymap_colemak_dh.json rename to keyboards/kbdfans/niu_mini/keymaps/nosarthur/keymap_colemak_dh.json diff --git a/keyboards/niu_mini/keymaps/nosarthur/keymap_qwerty.json b/keyboards/kbdfans/niu_mini/keymaps/nosarthur/keymap_qwerty.json similarity index 100% rename from keyboards/niu_mini/keymaps/nosarthur/keymap_qwerty.json rename to keyboards/kbdfans/niu_mini/keymaps/nosarthur/keymap_qwerty.json diff --git a/keyboards/niu_mini/keymaps/nosarthur/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/nosarthur/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/nosarthur/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/nosarthur/rules.mk diff --git a/keyboards/niu_mini/keymaps/planck/config.h b/keyboards/kbdfans/niu_mini/keymaps/planck/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/planck/config.h rename to keyboards/kbdfans/niu_mini/keymaps/planck/config.h diff --git a/keyboards/niu_mini/keymaps/planck/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/planck/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/planck/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/planck/keymap.c diff --git a/keyboards/niu_mini/keymaps/planck/readme.md b/keyboards/kbdfans/niu_mini/keymaps/planck/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/planck/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/planck/readme.md diff --git a/keyboards/diverge3/keymaps/workman/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/planck/rules.mk similarity index 100% rename from keyboards/diverge3/keymaps/workman/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/planck/rules.mk diff --git a/keyboards/niu_mini/keymaps/tobias/config.h b/keyboards/kbdfans/niu_mini/keymaps/tobias/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/tobias/config.h rename to keyboards/kbdfans/niu_mini/keymaps/tobias/config.h diff --git a/keyboards/niu_mini/keymaps/tobias/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/tobias/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/tobias/keymap.c diff --git a/keyboards/niu_mini/keymaps/tobias/readme.md b/keyboards/kbdfans/niu_mini/keymaps/tobias/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/tobias/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/tobias/readme.md diff --git a/keyboards/niu_mini/keymaps/tobias/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/tobias/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/tobias/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/tobias/rules.mk diff --git a/keyboards/niu_mini/keymaps/tucznak/config.h b/keyboards/kbdfans/niu_mini/keymaps/tucznak/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/tucznak/config.h rename to keyboards/kbdfans/niu_mini/keymaps/tucznak/config.h diff --git a/keyboards/niu_mini/keymaps/tucznak/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/tucznak/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/tucznak/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/tucznak/keymap.c diff --git a/keyboards/niu_mini/keymaps/tucznak/readme.md b/keyboards/kbdfans/niu_mini/keymaps/tucznak/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/tucznak/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/tucznak/readme.md diff --git a/keyboards/niu_mini/keymaps/tucznak/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/tucznak/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/tucznak/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/tucznak/rules.mk diff --git a/keyboards/niu_mini/keymaps/via/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/via/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/via/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/via/keymap.c diff --git a/keyboards/niu_mini/keymaps/via/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/via/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/via/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/via/rules.mk diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/config.h b/keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/xtonhasvim/config.h rename to keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/config.h diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/xtonhasvim/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/keymap.c diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/readme.md b/keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/readme.md similarity index 100% rename from keyboards/divergetm2/keymaps/xtonhasvim/readme.md rename to keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/readme.md diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/xtonhasvim/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/xtonhasvim/rules.mk diff --git a/keyboards/niu_mini/keymaps/yttyx/README.md b/keyboards/kbdfans/niu_mini/keymaps/yttyx/README.md similarity index 100% rename from keyboards/niu_mini/keymaps/yttyx/README.md rename to keyboards/kbdfans/niu_mini/keymaps/yttyx/README.md diff --git a/keyboards/niu_mini/keymaps/yttyx/config.h b/keyboards/kbdfans/niu_mini/keymaps/yttyx/config.h similarity index 100% rename from keyboards/niu_mini/keymaps/yttyx/config.h rename to keyboards/kbdfans/niu_mini/keymaps/yttyx/config.h diff --git a/keyboards/niu_mini/keymaps/yttyx/keymap.c b/keyboards/kbdfans/niu_mini/keymaps/yttyx/keymap.c similarity index 100% rename from keyboards/niu_mini/keymaps/yttyx/keymap.c rename to keyboards/kbdfans/niu_mini/keymaps/yttyx/keymap.c diff --git a/keyboards/niu_mini/keymaps/yttyx/rules.mk b/keyboards/kbdfans/niu_mini/keymaps/yttyx/rules.mk similarity index 100% rename from keyboards/niu_mini/keymaps/yttyx/rules.mk rename to keyboards/kbdfans/niu_mini/keymaps/yttyx/rules.mk diff --git a/keyboards/niu_mini/niu_mini.c b/keyboards/kbdfans/niu_mini/niu_mini.c similarity index 100% rename from keyboards/niu_mini/niu_mini.c rename to keyboards/kbdfans/niu_mini/niu_mini.c diff --git a/keyboards/niu_mini/niu_mini.h b/keyboards/kbdfans/niu_mini/niu_mini.h similarity index 100% rename from keyboards/niu_mini/niu_mini.h rename to keyboards/kbdfans/niu_mini/niu_mini.h diff --git a/keyboards/niu_mini/readme.md b/keyboards/kbdfans/niu_mini/readme.md similarity index 91% rename from keyboards/niu_mini/readme.md rename to keyboards/kbdfans/niu_mini/readme.md index f4863d8549e5..1a91ece94bff 100644 --- a/keyboards/niu_mini/readme.md +++ b/keyboards/kbdfans/niu_mini/readme.md @@ -10,10 +10,10 @@ Hardware Availability: [KBDFans](https://kbdfans.myshopify.com/products/niu-mini Make example for this keyboard (after setting up your build environment): - make niu_mini:default + make kbdfans/niu_mini:default Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): - make niu_mini:default:flash + make kbdfans/niu_mini: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/niu_mini/rules.mk b/keyboards/kbdfans/niu_mini/rules.mk similarity index 100% rename from keyboards/niu_mini/rules.mk rename to keyboards/kbdfans/niu_mini/rules.mk diff --git a/keyboards/keebio/bdn9/keymaps/lickel/keymap.c b/keyboards/keebio/bdn9/keymaps/lickel/keymap.c new file mode 100644 index 000000000000..7067b12d8799 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/lickel/keymap.c @@ -0,0 +1,157 @@ +/* Copyright 2022 @ Adam Lickel + * + * 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 QMK_KEYBOARD_H + +enum encoder_names { + _LEFT, + _RIGHT, + _MIDDLE, +}; + +enum bdn9_layers { + _MEDIA = 0, + _XCODE, + _CUST1, + _CUST2, +}; + +#define KC_XCRUN LGUI(KC_R) +#define KC_XCPAUSE LCTL(LGUI(KC_Y)) +#define KC_XCSTOP LGUI(KC_DOT) + +// clang-format off + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MEDIA] = LAYOUT( + TO(_XCODE), RGB_SPD, RGB_SPI, + RGB_MOD, KC_MPLY, KC_MSTP, + RGB_RMOD, KC_MNXT, KC_MPRV + ), + [_XCODE] = LAYOUT( + TG(_XCODE), KC_NO, KC_NO, + KC_XCRUN, KC_XCPAUSE, KC_XCSTOP, + KC_F6, KC_F7, KC_F8 + ), + [_CUST1] = LAYOUT( + TG(_CUST1), _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [_CUST2] = LAYOUT( + TG(_CUST2), _______, _______, + _______, _______, _______, + _______, _______, _______ + ), +}; + +// clang-format on + +layer_state_t layer_state_set_user(layer_state_t state) { +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + uint8_t layer = get_highest_layer(state); + + switch (layer) { + case _MEDIA: // Reset + rgblight_reload_from_eeprom(); + break; + + case _XCODE: + rgblight_sethsv_noeeprom(HSV_BLUE); +# if defined(RGB_MATRIX_ENABLE) && defined(ENABLE_RGB_MATRIX_BREATHING) + rgb_matrix_mode_noeeprom(RGB_MATRIX_BREATHING); +# elif defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_EFFECT_BREATHING) + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 1); +# endif + break; + + case _CUST1: + rgblight_sethsv_noeeprom(HSV_GREEN); +# if defined(RGB_MATRIX_ENABLE) && defined(ENABLE_RGB_MATRIX_BREATHING) + rgb_matrix_mode_noeeprom(RGB_MATRIX_BREATHING); +# elif defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_EFFECT_BREATHING) + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 1); +# endif + break; + + case _CUST2: + rgblight_sethsv_noeeprom(HSV_PURPLE); +# if defined(RGB_MATRIX_ENABLE) && defined(ENABLE_RGB_MATRIX_BREATHING) + rgb_matrix_mode_noeeprom(RGB_MATRIX_BREATHING); +# elif defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_EFFECT_BREATHING) + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 1); +# endif + break; + + default: + break; + } +#endif + return state; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + uint8_t layer = get_highest_layer(layer_state); + + switch (layer) { +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case 0: // Reset + if (index == _LEFT) { + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + } else if (index == _MIDDLE) { + if (clockwise) { + rgblight_increase_sat(); + } else { + rgblight_decrease_sat(); + } + } else if (index == _RIGHT) { + if (clockwise) { + rgblight_increase_val(); + } else { + rgblight_decrease_val(); + } + } + break; +#endif + + default: + if (index == _LEFT) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == _MIDDLE) { + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } else if (index == _RIGHT) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + break; + } + return true; +} diff --git a/keyboards/keebio/bdn9/keymaps/lickel/readme.md b/keyboards/keebio/bdn9/keymaps/lickel/readme.md new file mode 100644 index 000000000000..b729319b99c5 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/lickel/readme.md @@ -0,0 +1,17 @@ +# lickel's BDN9 keymap + +- Via support is enabled by default +- Changing layers to non-zero changes the RGBs to breathing colors +- Changing to layer 0 resets the RGBs to EEPROM settings +- Layer 0 encoders are: Hue, Saturation, Value +- Other layers are: Volume, Arrow, Pg up/down + +- Layer 0: Media Controls & RGB Effects +- Layer 1: Xcode Debugging +- Layers 2 and 3: Reserved for Via + +## Changelog + +### 1/17/2022 - 1.0 + +- Initial release diff --git a/keyboards/keebio/bdn9/keymaps/lickel/rules.mk b/keyboards/keebio/bdn9/keymaps/lickel/rules.mk new file mode 100644 index 000000000000..c44f74d53a50 --- /dev/null +++ b/keyboards/keebio/bdn9/keymaps/lickel/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes +MOUSEKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no diff --git a/keyboards/keebio/iris/keymaps/333fred/rules.mk b/keyboards/keebio/iris/keymaps/333fred/rules.mk index 995272e2f227..5ad63b02b703 100644 --- a/keyboards/keebio/iris/keymaps/333fred/rules.mk +++ b/keyboards/keebio/iris/keymaps/333fred/rules.mk @@ -1,4 +1,3 @@ KEY_LOCK_ENABLE = yes CONSOLE_ENABLE = no -EXTRAFLAGS += -flto - +LTO_ENABLE = yes diff --git a/keyboards/keychron/q2/rev_0110/rules.mk b/keyboards/keychron/q2/rev_0110/rules.mk index 957680ab110d..30394028b3c3 100644 --- a/keyboards/keychron/q2/rev_0110/rules.mk +++ b/keyboards/keychron/q2/rev_0110/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/keychron/q2/rev_0111/rules.mk b/keyboards/keychron/q2/rev_0111/rules.mk index 3b931ef9fe21..a295f48e1055 100644 --- a/keyboards/keychron/q2/rev_0111/rules.mk +++ b/keyboards/keychron/q2/rev_0111/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/keychron/q2/rev_0112/rules.mk b/keyboards/keychron/q2/rev_0112/rules.mk index 957680ab110d..30394028b3c3 100644 --- a/keyboards/keychron/q2/rev_0112/rules.mk +++ b/keyboards/keychron/q2/rev_0112/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/keychron/q2/rev_0113/rules.mk b/keyboards/keychron/q2/rev_0113/rules.mk index 3b931ef9fe21..a295f48e1055 100644 --- a/keyboards/keychron/q2/rev_0113/rules.mk +++ b/keyboards/keychron/q2/rev_0113/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/kinesis/alvicstep/matrix.c b/keyboards/kinesis/alvicstep/matrix.c index 71619f8167a1..9c0537451005 100644 --- a/keyboards/kinesis/alvicstep/matrix.c +++ b/keyboards/kinesis/alvicstep/matrix.c @@ -136,12 +136,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/bakeneko60/bakeneko60.c b/keyboards/kkatano/bakeneko60/bakeneko60.c similarity index 100% rename from keyboards/bakeneko60/bakeneko60.c rename to keyboards/kkatano/bakeneko60/bakeneko60.c diff --git a/keyboards/bakeneko60/bakeneko60.h b/keyboards/kkatano/bakeneko60/bakeneko60.h similarity index 100% rename from keyboards/bakeneko60/bakeneko60.h rename to keyboards/kkatano/bakeneko60/bakeneko60.h diff --git a/keyboards/bakeneko60/config.h b/keyboards/kkatano/bakeneko60/config.h similarity index 100% rename from keyboards/bakeneko60/config.h rename to keyboards/kkatano/bakeneko60/config.h diff --git a/keyboards/bakeneko60/info.json b/keyboards/kkatano/bakeneko60/info.json similarity index 100% rename from keyboards/bakeneko60/info.json rename to keyboards/kkatano/bakeneko60/info.json diff --git a/keyboards/bakeneko60/keymaps/default/keymap.c b/keyboards/kkatano/bakeneko60/keymaps/default/keymap.c similarity index 100% rename from keyboards/bakeneko60/keymaps/default/keymap.c rename to keyboards/kkatano/bakeneko60/keymaps/default/keymap.c diff --git a/keyboards/bakeneko60/keymaps/default/readme.md b/keyboards/kkatano/bakeneko60/keymaps/default/readme.md similarity index 100% rename from keyboards/bakeneko60/keymaps/default/readme.md rename to keyboards/kkatano/bakeneko60/keymaps/default/readme.md diff --git a/keyboards/bakeneko60/keymaps/via/keymap.c b/keyboards/kkatano/bakeneko60/keymaps/via/keymap.c similarity index 100% rename from keyboards/bakeneko60/keymaps/via/keymap.c rename to keyboards/kkatano/bakeneko60/keymaps/via/keymap.c diff --git a/keyboards/7splus/keymaps/via/rules.mk b/keyboards/kkatano/bakeneko60/keymaps/via/rules.mk similarity index 100% rename from keyboards/7splus/keymaps/via/rules.mk rename to keyboards/kkatano/bakeneko60/keymaps/via/rules.mk diff --git a/keyboards/bakeneko60/readme.md b/keyboards/kkatano/bakeneko60/readme.md similarity index 88% rename from keyboards/bakeneko60/readme.md rename to keyboards/kkatano/bakeneko60/readme.md index 18b9d3c4d21c..0e1c293f9019 100644 --- a/keyboards/bakeneko60/readme.md +++ b/keyboards/kkatano/bakeneko60/readme.md @@ -8,10 +8,10 @@ A simple 60% keyboard Make example for this keyboard (after setting up your build environment): - make bakeneko60:default + make kkatano/bakeneko60:default Flashing example for this keyboard: - make bakeneko60:default:flash + make kkatano/bakeneko60: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/bakeneko60/rules.mk b/keyboards/kkatano/bakeneko60/rules.mk similarity index 100% rename from keyboards/bakeneko60/rules.mk rename to keyboards/kkatano/bakeneko60/rules.mk diff --git a/keyboards/bakeneko65/rev2/config.h b/keyboards/kkatano/bakeneko65/rev2/config.h similarity index 100% rename from keyboards/bakeneko65/rev2/config.h rename to keyboards/kkatano/bakeneko65/rev2/config.h diff --git a/keyboards/bakeneko65/rev2/info.json b/keyboards/kkatano/bakeneko65/rev2/info.json similarity index 100% rename from keyboards/bakeneko65/rev2/info.json rename to keyboards/kkatano/bakeneko65/rev2/info.json diff --git a/keyboards/bakeneko65/rev2/keymaps/default/keymap.c b/keyboards/kkatano/bakeneko65/rev2/keymaps/default/keymap.c similarity index 100% rename from keyboards/bakeneko65/rev2/keymaps/default/keymap.c rename to keyboards/kkatano/bakeneko65/rev2/keymaps/default/keymap.c diff --git a/keyboards/bakeneko65/rev2/keymaps/default/readme.md b/keyboards/kkatano/bakeneko65/rev2/keymaps/default/readme.md similarity index 100% rename from keyboards/bakeneko65/rev2/keymaps/default/readme.md rename to keyboards/kkatano/bakeneko65/rev2/keymaps/default/readme.md diff --git a/keyboards/bakeneko65/rev2/keymaps/via/keymap.c b/keyboards/kkatano/bakeneko65/rev2/keymaps/via/keymap.c similarity index 100% rename from keyboards/bakeneko65/rev2/keymaps/via/keymap.c rename to keyboards/kkatano/bakeneko65/rev2/keymaps/via/keymap.c diff --git a/keyboards/geminate60/keymaps/via/rules.mk b/keyboards/kkatano/bakeneko65/rev2/keymaps/via/rules.mk similarity index 100% rename from keyboards/geminate60/keymaps/via/rules.mk rename to keyboards/kkatano/bakeneko65/rev2/keymaps/via/rules.mk diff --git a/keyboards/bakeneko65/rev2/readme.md b/keyboards/kkatano/bakeneko65/rev2/readme.md similarity index 87% rename from keyboards/bakeneko65/rev2/readme.md rename to keyboards/kkatano/bakeneko65/rev2/readme.md index 8d2fa6bc58fb..a12eded0db9b 100644 --- a/keyboards/bakeneko65/rev2/readme.md +++ b/keyboards/kkatano/bakeneko65/rev2/readme.md @@ -8,10 +8,10 @@ A simple 65% keyboard Make example for this keyboard (after setting up your build environment): - make bakeneko65/rev2:default + make kkatano/bakeneko65/rev2:default Flashing example for this keyboard: - make bakeneko65/rev2:default:flash + make kkatano/bakeneko65/rev2: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/bakeneko65/rev2/rev2.c b/keyboards/kkatano/bakeneko65/rev2/rev2.c similarity index 100% rename from keyboards/bakeneko65/rev2/rev2.c rename to keyboards/kkatano/bakeneko65/rev2/rev2.c diff --git a/keyboards/bakeneko65/rev2/rev2.h b/keyboards/kkatano/bakeneko65/rev2/rev2.h similarity index 100% rename from keyboards/bakeneko65/rev2/rev2.h rename to keyboards/kkatano/bakeneko65/rev2/rev2.h diff --git a/keyboards/bakeneko65/rev2/rules.mk b/keyboards/kkatano/bakeneko65/rev2/rules.mk similarity index 100% rename from keyboards/bakeneko65/rev2/rules.mk rename to keyboards/kkatano/bakeneko65/rev2/rules.mk diff --git a/keyboards/bakeneko65/rev3/config.h b/keyboards/kkatano/bakeneko65/rev3/config.h similarity index 100% rename from keyboards/bakeneko65/rev3/config.h rename to keyboards/kkatano/bakeneko65/rev3/config.h diff --git a/keyboards/bakeneko65/rev3/info.json b/keyboards/kkatano/bakeneko65/rev3/info.json similarity index 100% rename from keyboards/bakeneko65/rev3/info.json rename to keyboards/kkatano/bakeneko65/rev3/info.json diff --git a/keyboards/bakeneko65/rev3/keymaps/default/keymap.c b/keyboards/kkatano/bakeneko65/rev3/keymaps/default/keymap.c similarity index 100% rename from keyboards/bakeneko65/rev3/keymaps/default/keymap.c rename to keyboards/kkatano/bakeneko65/rev3/keymaps/default/keymap.c diff --git a/keyboards/bakeneko65/rev3/keymaps/default/readme.md b/keyboards/kkatano/bakeneko65/rev3/keymaps/default/readme.md similarity index 100% rename from keyboards/bakeneko65/rev3/keymaps/default/readme.md rename to keyboards/kkatano/bakeneko65/rev3/keymaps/default/readme.md diff --git a/keyboards/bakeneko65/rev3/keymaps/via/keymap.c b/keyboards/kkatano/bakeneko65/rev3/keymaps/via/keymap.c similarity index 100% rename from keyboards/bakeneko65/rev3/keymaps/via/keymap.c rename to keyboards/kkatano/bakeneko65/rev3/keymaps/via/keymap.c diff --git a/keyboards/gingham/keymaps/via/rules.mk b/keyboards/kkatano/bakeneko65/rev3/keymaps/via/rules.mk similarity index 100% rename from keyboards/gingham/keymaps/via/rules.mk rename to keyboards/kkatano/bakeneko65/rev3/keymaps/via/rules.mk diff --git a/keyboards/bakeneko65/rev3/readme.md b/keyboards/kkatano/bakeneko65/rev3/readme.md similarity index 87% rename from keyboards/bakeneko65/rev3/readme.md rename to keyboards/kkatano/bakeneko65/rev3/readme.md index e147b11e6fd3..18cd57732866 100644 --- a/keyboards/bakeneko65/rev3/readme.md +++ b/keyboards/kkatano/bakeneko65/rev3/readme.md @@ -8,10 +8,10 @@ A simple 65% keyboard Make example for this keyboard (after setting up your build environment): - make bakeneko65/rev3:default + make kkatano/bakeneko65/rev3:default Flashing example for this keyboard: - make bakeneko65/rev3:default:flash + make kkatano/bakeneko65/rev3: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/bakeneko65/rev3/rev3.c b/keyboards/kkatano/bakeneko65/rev3/rev3.c similarity index 100% rename from keyboards/bakeneko65/rev3/rev3.c rename to keyboards/kkatano/bakeneko65/rev3/rev3.c diff --git a/keyboards/bakeneko65/rev3/rev3.h b/keyboards/kkatano/bakeneko65/rev3/rev3.h similarity index 100% rename from keyboards/bakeneko65/rev3/rev3.h rename to keyboards/kkatano/bakeneko65/rev3/rev3.h diff --git a/data/templates/avr/rules.mk b/keyboards/kkatano/bakeneko65/rev3/rules.mk similarity index 100% rename from data/templates/avr/rules.mk rename to keyboards/kkatano/bakeneko65/rev3/rules.mk diff --git a/keyboards/bakeneko80/bakeneko80.c b/keyboards/kkatano/bakeneko80/bakeneko80.c similarity index 100% rename from keyboards/bakeneko80/bakeneko80.c rename to keyboards/kkatano/bakeneko80/bakeneko80.c diff --git a/keyboards/bakeneko80/bakeneko80.h b/keyboards/kkatano/bakeneko80/bakeneko80.h similarity index 100% rename from keyboards/bakeneko80/bakeneko80.h rename to keyboards/kkatano/bakeneko80/bakeneko80.h diff --git a/keyboards/bakeneko80/config.h b/keyboards/kkatano/bakeneko80/config.h similarity index 100% rename from keyboards/bakeneko80/config.h rename to keyboards/kkatano/bakeneko80/config.h diff --git a/keyboards/bakeneko80/info.json b/keyboards/kkatano/bakeneko80/info.json similarity index 100% rename from keyboards/bakeneko80/info.json rename to keyboards/kkatano/bakeneko80/info.json diff --git a/keyboards/bakeneko80/keymaps/default/keymap.c b/keyboards/kkatano/bakeneko80/keymaps/default/keymap.c similarity index 100% rename from keyboards/bakeneko80/keymaps/default/keymap.c rename to keyboards/kkatano/bakeneko80/keymaps/default/keymap.c diff --git a/keyboards/bakeneko80/keymaps/default/readme.md b/keyboards/kkatano/bakeneko80/keymaps/default/readme.md similarity index 100% rename from keyboards/bakeneko80/keymaps/default/readme.md rename to keyboards/kkatano/bakeneko80/keymaps/default/readme.md diff --git a/keyboards/bakeneko80/readme.md b/keyboards/kkatano/bakeneko80/readme.md similarity index 94% rename from keyboards/bakeneko80/readme.md rename to keyboards/kkatano/bakeneko80/readme.md index 30f1b3e608b8..cc04ab447bb1 100644 --- a/keyboards/bakeneko80/readme.md +++ b/keyboards/kkatano/bakeneko80/readme.md @@ -8,6 +8,6 @@ Open source tenkeyless keyboard for DIYers Make example for this keyboard (after setting up your build environment): - make bakeneko80:default + make kkatano/bakeneko80: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/bakeneko80/rules.mk b/keyboards/kkatano/bakeneko80/rules.mk similarity index 100% rename from keyboards/bakeneko80/rules.mk rename to keyboards/kkatano/bakeneko80/rules.mk diff --git a/keyboards/wallaby/config.h b/keyboards/kkatano/wallaby/config.h similarity index 100% rename from keyboards/wallaby/config.h rename to keyboards/kkatano/wallaby/config.h diff --git a/keyboards/wallaby/info.json b/keyboards/kkatano/wallaby/info.json similarity index 100% rename from keyboards/wallaby/info.json rename to keyboards/kkatano/wallaby/info.json diff --git a/keyboards/wallaby/keymaps/default/keymap.c b/keyboards/kkatano/wallaby/keymaps/default/keymap.c similarity index 100% rename from keyboards/wallaby/keymaps/default/keymap.c rename to keyboards/kkatano/wallaby/keymaps/default/keymap.c diff --git a/keyboards/wallaby/keymaps/default/readme.md b/keyboards/kkatano/wallaby/keymaps/default/readme.md similarity index 100% rename from keyboards/wallaby/keymaps/default/readme.md rename to keyboards/kkatano/wallaby/keymaps/default/readme.md diff --git a/keyboards/wallaby/readme.md b/keyboards/kkatano/wallaby/readme.md similarity index 94% rename from keyboards/wallaby/readme.md rename to keyboards/kkatano/wallaby/readme.md index 89c9f9c5670e..6be5a059fd18 100644 --- a/keyboards/wallaby/readme.md +++ b/keyboards/kkatano/wallaby/readme.md @@ -8,6 +8,6 @@ A Tenkeyless PCB for YMDK aluminium case compatible with Filco Make example for this keyboard (after setting up your build environment): - make wallaby:default + make kkatano/wallaby: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/wallaby/rules.mk b/keyboards/kkatano/wallaby/rules.mk similarity index 100% rename from keyboards/wallaby/rules.mk rename to keyboards/kkatano/wallaby/rules.mk diff --git a/keyboards/wallaby/wallaby.c b/keyboards/kkatano/wallaby/wallaby.c similarity index 100% rename from keyboards/wallaby/wallaby.c rename to keyboards/kkatano/wallaby/wallaby.c diff --git a/keyboards/wallaby/wallaby.h b/keyboards/kkatano/wallaby/wallaby.h similarity index 100% rename from keyboards/wallaby/wallaby.h rename to keyboards/kkatano/wallaby/wallaby.h diff --git a/keyboards/yurei/config.h b/keyboards/kkatano/yurei/config.h similarity index 100% rename from keyboards/yurei/config.h rename to keyboards/kkatano/yurei/config.h diff --git a/keyboards/yurei/info.json b/keyboards/kkatano/yurei/info.json similarity index 100% rename from keyboards/yurei/info.json rename to keyboards/kkatano/yurei/info.json diff --git a/keyboards/yurei/keymaps/default/keymap.c b/keyboards/kkatano/yurei/keymaps/default/keymap.c similarity index 100% rename from keyboards/yurei/keymaps/default/keymap.c rename to keyboards/kkatano/yurei/keymaps/default/keymap.c diff --git a/keyboards/yurei/keymaps/default/readme.md b/keyboards/kkatano/yurei/keymaps/default/readme.md similarity index 100% rename from keyboards/yurei/keymaps/default/readme.md rename to keyboards/kkatano/yurei/keymaps/default/readme.md diff --git a/keyboards/yurei/readme.md b/keyboards/kkatano/yurei/readme.md similarity index 95% rename from keyboards/yurei/readme.md rename to keyboards/kkatano/yurei/readme.md index fc5b3eb5c047..69bd3a7cbef3 100644 --- a/keyboards/yurei/readme.md +++ b/keyboards/kkatano/yurei/readme.md @@ -8,6 +8,6 @@ A Tenkeyless PCB inspired by Phantom, for customizing Filco Majestouch 2. Make example for this keyboard (after setting up your build environment): - make yurei:default + make kkatano/yurei: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/yurei/rules.mk b/keyboards/kkatano/yurei/rules.mk similarity index 100% rename from keyboards/yurei/rules.mk rename to keyboards/kkatano/yurei/rules.mk diff --git a/keyboards/yurei/yurei.c b/keyboards/kkatano/yurei/yurei.c similarity index 100% rename from keyboards/yurei/yurei.c rename to keyboards/kkatano/yurei/yurei.c diff --git a/keyboards/yurei/yurei.h b/keyboards/kkatano/yurei/yurei.h similarity index 100% rename from keyboards/yurei/yurei.h rename to keyboards/kkatano/yurei/yurei.h diff --git a/keyboards/kprepublic/bm65hsrgb_iso/config.h b/keyboards/kprepublic/bm65hsrgb_iso/rev1/config.h similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/config.h rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/config.h diff --git a/keyboards/kprepublic/bm65hsrgb_iso/info.json b/keyboards/kprepublic/bm65hsrgb_iso/rev1/info.json similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/info.json rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/info.json diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/config.h b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/config.h similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/config.h rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/config.h diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/keymap.c rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/keymap.h b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.h similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/keymap.h rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.h diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/readme.md b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/readme.md similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/readme.md rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/readme.md diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/rules.mk b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/rules.mk similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/deadolus/rules.mk rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/rules.mk diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/default/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/default/keymap.c rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/default/keymap.c diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/via/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/via/keymap.c similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/via/keymap.c rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/via/keymap.c diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/via/readme.md b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/via/readme.md similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/via/readme.md rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/via/readme.md diff --git a/keyboards/ajisai74/keymaps/via/rules.mk b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/via/rules.mk similarity index 100% rename from keyboards/ajisai74/keymaps/via/rules.mk rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/via/rules.mk diff --git a/keyboards/kprepublic/bm65hsrgb_iso/readme.md b/keyboards/kprepublic/bm65hsrgb_iso/rev1/readme.md similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/readme.md rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/readme.md diff --git a/keyboards/kprepublic/bm65hsrgb_iso/bm65hsrgb_iso.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c similarity index 99% rename from keyboards/kprepublic/bm65hsrgb_iso/bm65hsrgb_iso.c rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c index 3d7f586d76ce..6e0fd5711766 100644 --- a/keyboards/kprepublic/bm65hsrgb_iso/bm65hsrgb_iso.c +++ b/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "bm65hsrgb_iso.h" +#include "rev1.h" #ifdef RGB_MATRIX_ENABLE led_config_t g_led_config = { { diff --git a/keyboards/kprepublic/bm65hsrgb_iso/bm65hsrgb_iso.h b/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.h similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/bm65hsrgb_iso.h rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.h diff --git a/keyboards/kprepublic/bm65hsrgb_iso/rules.mk b/keyboards/kprepublic/bm65hsrgb_iso/rev1/rules.mk similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/rules.mk rename to keyboards/kprepublic/bm65hsrgb_iso/rev1/rules.mk diff --git a/keyboards/kprepublic/bm68hsrgb/config.h b/keyboards/kprepublic/bm68hsrgb/rev1/config.h similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/config.h rename to keyboards/kprepublic/bm68hsrgb/rev1/config.h diff --git a/keyboards/kprepublic/bm68hsrgb/info.json b/keyboards/kprepublic/bm68hsrgb/rev1/info.json similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/info.json rename to keyboards/kprepublic/bm68hsrgb/rev1/info.json diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/default/keymap.c b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/default/keymap.c rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/default/keymap.c diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/default/readme.md b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/default/readme.md similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/default/readme.md rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/default/readme.md diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/config.h b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/config.h similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/config.h rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/config.h diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/keymap.c b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/keymap.c rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/keymap.h b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.h similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/keymap.h rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.h diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/readme.md b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/readme.md similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/peepeetee/readme.md rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/readme.md diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/via/keymap.c b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/via/keymap.c similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/via/keymap.c rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/via/keymap.c diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/via/readme.md b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/via/readme.md similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/via/readme.md rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/via/readme.md diff --git a/keyboards/idobo/keymaps/via/rules.mk b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/via/rules.mk similarity index 100% rename from keyboards/idobo/keymaps/via/rules.mk rename to keyboards/kprepublic/bm68hsrgb/rev1/keymaps/via/rules.mk diff --git a/keyboards/kprepublic/bm68hsrgb/readme.md b/keyboards/kprepublic/bm68hsrgb/rev1/readme.md similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/readme.md rename to keyboards/kprepublic/bm68hsrgb/rev1/readme.md diff --git a/keyboards/kprepublic/bm68hsrgb/bm68hsrgb.c b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c similarity index 99% rename from keyboards/kprepublic/bm68hsrgb/bm68hsrgb.c rename to keyboards/kprepublic/bm68hsrgb/rev1/rev1.c index 734d2ee677b7..4634a662b61e 100644 --- a/keyboards/kprepublic/bm68hsrgb/bm68hsrgb.c +++ b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "bm68hsrgb.h" +#include "rev1.h" #ifdef RGB_MATRIX_ENABLE led_config_t g_led_config = { { diff --git a/keyboards/kprepublic/bm68hsrgb/bm68hsrgb.h b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.h similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/bm68hsrgb.h rename to keyboards/kprepublic/bm68hsrgb/rev1/rev1.h diff --git a/keyboards/kprepublic/bm68hsrgb/rules.mk b/keyboards/kprepublic/bm68hsrgb/rev1/rules.mk similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/rules.mk rename to keyboards/kprepublic/bm68hsrgb/rev1/rules.mk diff --git a/keyboards/latin17rgb/config.h b/keyboards/latincompass/latin17rgb/config.h similarity index 100% rename from keyboards/latin17rgb/config.h rename to keyboards/latincompass/latin17rgb/config.h diff --git a/keyboards/latin17rgb/info.json b/keyboards/latincompass/latin17rgb/info.json similarity index 100% rename from keyboards/latin17rgb/info.json rename to keyboards/latincompass/latin17rgb/info.json diff --git a/keyboards/latin17rgb/keymaps/default/keymap.c b/keyboards/latincompass/latin17rgb/keymaps/default/keymap.c similarity index 100% rename from keyboards/latin17rgb/keymaps/default/keymap.c rename to keyboards/latincompass/latin17rgb/keymaps/default/keymap.c diff --git a/keyboards/latin17rgb/keymaps/via/keymap.c b/keyboards/latincompass/latin17rgb/keymaps/via/keymap.c similarity index 100% rename from keyboards/latin17rgb/keymaps/via/keymap.c rename to keyboards/latincompass/latin17rgb/keymaps/via/keymap.c diff --git a/keyboards/choco60/keymaps/via/rules.mk b/keyboards/latincompass/latin17rgb/keymaps/via/rules.mk similarity index 100% rename from keyboards/choco60/keymaps/via/rules.mk rename to keyboards/latincompass/latin17rgb/keymaps/via/rules.mk diff --git a/keyboards/latin17rgb/latin17rgb.c b/keyboards/latincompass/latin17rgb/latin17rgb.c similarity index 100% rename from keyboards/latin17rgb/latin17rgb.c rename to keyboards/latincompass/latin17rgb/latin17rgb.c diff --git a/keyboards/latin17rgb/latin17rgb.h b/keyboards/latincompass/latin17rgb/latin17rgb.h similarity index 100% rename from keyboards/latin17rgb/latin17rgb.h rename to keyboards/latincompass/latin17rgb/latin17rgb.h diff --git a/keyboards/latin17rgb/readme.md b/keyboards/latincompass/latin17rgb/readme.md similarity index 89% rename from keyboards/latin17rgb/readme.md rename to keyboards/latincompass/latin17rgb/readme.md index 775055f27aae..aa7095b5d6e7 100644 --- a/keyboards/latin17rgb/readme.md +++ b/keyboards/latincompass/latin17rgb/readme.md @@ -9,11 +9,11 @@ Make example for this keyboard (after setting up your build environment): - make latin17rgb:default + make latincompass/latin17rgb:default Flashing example for this keyboard: - make latin17rgb:default:flash + make latincompass/latin17rgb:default:flash To reset the board into bootloader mode, hold the key at the top left of the keyboard while connecting the USB cable (also erases persistent settings). diff --git a/keyboards/latin17rgb/rules.mk b/keyboards/latincompass/latin17rgb/rules.mk similarity index 100% rename from keyboards/latin17rgb/rules.mk rename to keyboards/latincompass/latin17rgb/rules.mk diff --git a/keyboards/latin47ble/config.h b/keyboards/latincompass/latin47ble/config.h similarity index 100% rename from keyboards/latin47ble/config.h rename to keyboards/latincompass/latin47ble/config.h diff --git a/keyboards/latin47ble/info.json b/keyboards/latincompass/latin47ble/info.json similarity index 100% rename from keyboards/latin47ble/info.json rename to keyboards/latincompass/latin47ble/info.json diff --git a/keyboards/latin47ble/keymaps/default/keymap.c b/keyboards/latincompass/latin47ble/keymaps/default/keymap.c similarity index 100% rename from keyboards/latin47ble/keymaps/default/keymap.c rename to keyboards/latincompass/latin47ble/keymaps/default/keymap.c diff --git a/keyboards/latin47ble/keymaps/via/keymap.c b/keyboards/latincompass/latin47ble/keymaps/via/keymap.c similarity index 100% rename from keyboards/latin47ble/keymaps/via/keymap.c rename to keyboards/latincompass/latin47ble/keymaps/via/keymap.c diff --git a/keyboards/latin17rgb/keymaps/via/rules.mk b/keyboards/latincompass/latin47ble/keymaps/via/rules.mk similarity index 100% rename from keyboards/latin17rgb/keymaps/via/rules.mk rename to keyboards/latincompass/latin47ble/keymaps/via/rules.mk diff --git a/keyboards/latin47ble/latin47ble.c b/keyboards/latincompass/latin47ble/latin47ble.c similarity index 100% rename from keyboards/latin47ble/latin47ble.c rename to keyboards/latincompass/latin47ble/latin47ble.c diff --git a/keyboards/latin47ble/latin47ble.h b/keyboards/latincompass/latin47ble/latin47ble.h similarity index 100% rename from keyboards/latin47ble/latin47ble.h rename to keyboards/latincompass/latin47ble/latin47ble.h diff --git a/keyboards/latin47ble/readme.md b/keyboards/latincompass/latin47ble/readme.md similarity index 93% rename from keyboards/latin47ble/readme.md rename to keyboards/latincompass/latin47ble/readme.md index cc8e9e6a3441..f03a15d82684 100644 --- a/keyboards/latin47ble/readme.md +++ b/keyboards/latincompass/latin47ble/readme.md @@ -9,6 +9,6 @@ macro 47 ble 4.0 RGB keyboard Make example for this keyboard (after setting up your build environment): - make latin47ble:default + make latincompass/latin47ble: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/latin47ble/rules.mk b/keyboards/latincompass/latin47ble/rules.mk similarity index 95% rename from keyboards/latin47ble/rules.mk rename to keyboards/latincompass/latin47ble/rules.mk index 95044a18bd04..015c4547288a 100644 --- a/keyboards/latin47ble/rules.mk +++ b/keyboards/latincompass/latin47ble/rules.mk @@ -20,6 +20,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LAYOUTS = planck_mit diff --git a/keyboards/latin60rgb/config.h b/keyboards/latincompass/latin60rgb/config.h similarity index 100% rename from keyboards/latin60rgb/config.h rename to keyboards/latincompass/latin60rgb/config.h diff --git a/keyboards/latin60rgb/info.json b/keyboards/latincompass/latin60rgb/info.json similarity index 100% rename from keyboards/latin60rgb/info.json rename to keyboards/latincompass/latin60rgb/info.json diff --git a/keyboards/latin60rgb/keymaps/default/keymap.c b/keyboards/latincompass/latin60rgb/keymaps/default/keymap.c similarity index 100% rename from keyboards/latin60rgb/keymaps/default/keymap.c rename to keyboards/latincompass/latin60rgb/keymaps/default/keymap.c diff --git a/keyboards/latin60rgb/keymaps/via/keymap.c b/keyboards/latincompass/latin60rgb/keymaps/via/keymap.c similarity index 100% rename from keyboards/latin60rgb/keymaps/via/keymap.c rename to keyboards/latincompass/latin60rgb/keymaps/via/keymap.c diff --git a/keyboards/latin47ble/keymaps/via/rules.mk b/keyboards/latincompass/latin60rgb/keymaps/via/rules.mk similarity index 100% rename from keyboards/latin47ble/keymaps/via/rules.mk rename to keyboards/latincompass/latin60rgb/keymaps/via/rules.mk diff --git a/keyboards/latin60rgb/latin60rgb.c b/keyboards/latincompass/latin60rgb/latin60rgb.c similarity index 100% rename from keyboards/latin60rgb/latin60rgb.c rename to keyboards/latincompass/latin60rgb/latin60rgb.c diff --git a/keyboards/latin60rgb/latin60rgb.h b/keyboards/latincompass/latin60rgb/latin60rgb.h similarity index 100% rename from keyboards/latin60rgb/latin60rgb.h rename to keyboards/latincompass/latin60rgb/latin60rgb.h diff --git a/keyboards/latin60rgb/readme.md b/keyboards/latincompass/latin60rgb/readme.md similarity index 94% rename from keyboards/latin60rgb/readme.md rename to keyboards/latincompass/latin60rgb/readme.md index 3b5715c2daa1..ae855bc8c173 100644 --- a/keyboards/latin60rgb/readme.md +++ b/keyboards/latincompass/latin60rgb/readme.md @@ -9,6 +9,6 @@ Make example for this keyboard (after setting up your build environment): - make latin60rgb:default + make latincompass/latin60rgb: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/latin60rgb/rules.mk b/keyboards/latincompass/latin60rgb/rules.mk similarity index 100% rename from keyboards/latin60rgb/rules.mk rename to keyboards/latincompass/latin60rgb/rules.mk diff --git a/keyboards/latin64ble/config.h b/keyboards/latincompass/latin64ble/config.h similarity index 100% rename from keyboards/latin64ble/config.h rename to keyboards/latincompass/latin64ble/config.h diff --git a/keyboards/latin64ble/info.json b/keyboards/latincompass/latin64ble/info.json similarity index 100% rename from keyboards/latin64ble/info.json rename to keyboards/latincompass/latin64ble/info.json diff --git a/keyboards/latin64ble/keymaps/default/keymap.c b/keyboards/latincompass/latin64ble/keymaps/default/keymap.c similarity index 100% rename from keyboards/latin64ble/keymaps/default/keymap.c rename to keyboards/latincompass/latin64ble/keymaps/default/keymap.c diff --git a/keyboards/latin64ble/keymaps/via/keymap.c b/keyboards/latincompass/latin64ble/keymaps/via/keymap.c similarity index 100% rename from keyboards/latin64ble/keymaps/via/keymap.c rename to keyboards/latincompass/latin64ble/keymaps/via/keymap.c diff --git a/keyboards/latin60rgb/keymaps/via/rules.mk b/keyboards/latincompass/latin64ble/keymaps/via/rules.mk similarity index 100% rename from keyboards/latin60rgb/keymaps/via/rules.mk rename to keyboards/latincompass/latin64ble/keymaps/via/rules.mk diff --git a/keyboards/latin64ble/latin64ble.c b/keyboards/latincompass/latin64ble/latin64ble.c similarity index 100% rename from keyboards/latin64ble/latin64ble.c rename to keyboards/latincompass/latin64ble/latin64ble.c diff --git a/keyboards/latin64ble/latin64ble.h b/keyboards/latincompass/latin64ble/latin64ble.h similarity index 100% rename from keyboards/latin64ble/latin64ble.h rename to keyboards/latincompass/latin64ble/latin64ble.h diff --git a/keyboards/latin64ble/readme.md b/keyboards/latincompass/latin64ble/readme.md similarity index 93% rename from keyboards/latin64ble/readme.md rename to keyboards/latincompass/latin64ble/readme.md index 98f5e50a6917..d8ee92d16dbd 100644 --- a/keyboards/latin64ble/readme.md +++ b/keyboards/latincompass/latin64ble/readme.md @@ -9,6 +9,6 @@ macro 64 ble 4.0 RGB keyboard Make example for this keyboard (after setting up your build environment): - make latin64ble:default + make latincompass/latin64ble: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/latin64ble/rules.mk b/keyboards/latincompass/latin64ble/rules.mk similarity index 95% rename from keyboards/latin64ble/rules.mk rename to keyboards/latincompass/latin64ble/rules.mk index 30f105ef4908..97717333de74 100644 --- a/keyboards/latin64ble/rules.mk +++ b/keyboards/latincompass/latin64ble/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/latin6rgb/config.h b/keyboards/latincompass/latin6rgb/config.h similarity index 100% rename from keyboards/latin6rgb/config.h rename to keyboards/latincompass/latin6rgb/config.h diff --git a/keyboards/latin6rgb/info.json b/keyboards/latincompass/latin6rgb/info.json similarity index 100% rename from keyboards/latin6rgb/info.json rename to keyboards/latincompass/latin6rgb/info.json diff --git a/keyboards/latin6rgb/keymaps/default/keymap.c b/keyboards/latincompass/latin6rgb/keymaps/default/keymap.c similarity index 100% rename from keyboards/latin6rgb/keymaps/default/keymap.c rename to keyboards/latincompass/latin6rgb/keymaps/default/keymap.c diff --git a/keyboards/latin6rgb/keymaps/via/keymap.c b/keyboards/latincompass/latin6rgb/keymaps/via/keymap.c similarity index 100% rename from keyboards/latin6rgb/keymaps/via/keymap.c rename to keyboards/latincompass/latin6rgb/keymaps/via/keymap.c diff --git a/keyboards/latin64ble/keymaps/via/rules.mk b/keyboards/latincompass/latin6rgb/keymaps/via/rules.mk similarity index 100% rename from keyboards/latin64ble/keymaps/via/rules.mk rename to keyboards/latincompass/latin6rgb/keymaps/via/rules.mk diff --git a/keyboards/latin6rgb/latin6rgb.c b/keyboards/latincompass/latin6rgb/latin6rgb.c similarity index 100% rename from keyboards/latin6rgb/latin6rgb.c rename to keyboards/latincompass/latin6rgb/latin6rgb.c diff --git a/keyboards/latin6rgb/latin6rgb.h b/keyboards/latincompass/latin6rgb/latin6rgb.h similarity index 100% rename from keyboards/latin6rgb/latin6rgb.h rename to keyboards/latincompass/latin6rgb/latin6rgb.h diff --git a/keyboards/latin6rgb/readme.md b/keyboards/latincompass/latin6rgb/readme.md similarity index 93% rename from keyboards/latin6rgb/readme.md rename to keyboards/latincompass/latin6rgb/readme.md index 5338f1625cff..24d340a510c0 100644 --- a/keyboards/latin6rgb/readme.md +++ b/keyboards/latincompass/latin6rgb/readme.md @@ -9,6 +9,6 @@ Make example for this keyboard (after setting up your build environment): - make latin6rgb:default + make latincompass/latin6rgb: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/latin6rgb/rules.mk b/keyboards/latincompass/latin6rgb/rules.mk similarity index 100% rename from keyboards/latin6rgb/rules.mk rename to keyboards/latincompass/latin6rgb/rules.mk diff --git a/keyboards/latinpad/config.h b/keyboards/latincompass/latinpad/config.h similarity index 100% rename from keyboards/latinpad/config.h rename to keyboards/latincompass/latinpad/config.h diff --git a/keyboards/latinpad/info.json b/keyboards/latincompass/latinpad/info.json similarity index 100% rename from keyboards/latinpad/info.json rename to keyboards/latincompass/latinpad/info.json diff --git a/keyboards/latinpad/keymaps/default/keymap.c b/keyboards/latincompass/latinpad/keymaps/default/keymap.c similarity index 100% rename from keyboards/latinpad/keymaps/default/keymap.c rename to keyboards/latincompass/latinpad/keymaps/default/keymap.c diff --git a/keyboards/latinpad/keymaps/via/keymap.c b/keyboards/latincompass/latinpad/keymaps/via/keymap.c similarity index 100% rename from keyboards/latinpad/keymaps/via/keymap.c rename to keyboards/latincompass/latinpad/keymaps/via/keymap.c diff --git a/keyboards/latin6rgb/keymaps/via/rules.mk b/keyboards/latincompass/latinpad/keymaps/via/rules.mk similarity index 100% rename from keyboards/latin6rgb/keymaps/via/rules.mk rename to keyboards/latincompass/latinpad/keymaps/via/rules.mk diff --git a/keyboards/latinpad/latinpad.c b/keyboards/latincompass/latinpad/latinpad.c similarity index 100% rename from keyboards/latinpad/latinpad.c rename to keyboards/latincompass/latinpad/latinpad.c diff --git a/keyboards/latinpad/latinpad.h b/keyboards/latincompass/latinpad/latinpad.h similarity index 100% rename from keyboards/latinpad/latinpad.h rename to keyboards/latincompass/latinpad/latinpad.h diff --git a/keyboards/latinpad/lib/glcdfont.c b/keyboards/latincompass/latinpad/lib/glcdfont.c similarity index 100% rename from keyboards/latinpad/lib/glcdfont.c rename to keyboards/latincompass/latinpad/lib/glcdfont.c diff --git a/keyboards/latinpad/readme.md b/keyboards/latincompass/latinpad/readme.md similarity index 94% rename from keyboards/latinpad/readme.md rename to keyboards/latincompass/latinpad/readme.md index 620bf64301e6..6fcd0f3a011d 100644 --- a/keyboards/latinpad/readme.md +++ b/keyboards/latincompass/latinpad/readme.md @@ -9,6 +9,6 @@ macro 2 rotary encoder pad Make example for this keyboard (after setting up your build environment): - make latinpad:default + make latincompass/latinpad: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/latinpad/rules.mk b/keyboards/latincompass/latinpad/rules.mk similarity index 100% rename from keyboards/latinpad/rules.mk rename to keyboards/latincompass/latinpad/rules.mk diff --git a/keyboards/latinpadble/config.h b/keyboards/latincompass/latinpadble/config.h similarity index 100% rename from keyboards/latinpadble/config.h rename to keyboards/latincompass/latinpadble/config.h diff --git a/keyboards/latinpadble/info.json b/keyboards/latincompass/latinpadble/info.json similarity index 100% rename from keyboards/latinpadble/info.json rename to keyboards/latincompass/latinpadble/info.json diff --git a/keyboards/latinpadble/keymaps/default/keymap.c b/keyboards/latincompass/latinpadble/keymaps/default/keymap.c similarity index 100% rename from keyboards/latinpadble/keymaps/default/keymap.c rename to keyboards/latincompass/latinpadble/keymaps/default/keymap.c diff --git a/keyboards/latinpadble/keymaps/via/keymap.c b/keyboards/latincompass/latinpadble/keymaps/via/keymap.c similarity index 100% rename from keyboards/latinpadble/keymaps/via/keymap.c rename to keyboards/latincompass/latinpadble/keymaps/via/keymap.c diff --git a/keyboards/latinpad/keymaps/via/rules.mk b/keyboards/latincompass/latinpadble/keymaps/via/rules.mk similarity index 100% rename from keyboards/latinpad/keymaps/via/rules.mk rename to keyboards/latincompass/latinpadble/keymaps/via/rules.mk diff --git a/keyboards/latinpadble/latinpadble.c b/keyboards/latincompass/latinpadble/latinpadble.c similarity index 100% rename from keyboards/latinpadble/latinpadble.c rename to keyboards/latincompass/latinpadble/latinpadble.c diff --git a/keyboards/latinpadble/latinpadble.h b/keyboards/latincompass/latinpadble/latinpadble.h similarity index 100% rename from keyboards/latinpadble/latinpadble.h rename to keyboards/latincompass/latinpadble/latinpadble.h diff --git a/keyboards/latinpadble/lib/glcdfont.c b/keyboards/latincompass/latinpadble/lib/glcdfont.c similarity index 100% rename from keyboards/latinpadble/lib/glcdfont.c rename to keyboards/latincompass/latinpadble/lib/glcdfont.c diff --git a/keyboards/latinpadble/readme.md b/keyboards/latincompass/latinpadble/readme.md similarity index 94% rename from keyboards/latinpadble/readme.md rename to keyboards/latincompass/latinpadble/readme.md index 324a28febfcc..2e1e6dbb8cd0 100644 --- a/keyboards/latinpadble/readme.md +++ b/keyboards/latincompass/latinpadble/readme.md @@ -9,6 +9,6 @@ Panasonic rotary encoder BLE pad Make example for this keyboard (after setting up your build environment): - make latinpadble:default + make latincompass/latinpadble: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/latinpadble/rules.mk b/keyboards/latincompass/latinpadble/rules.mk similarity index 96% rename from keyboards/latinpadble/rules.mk rename to keyboards/latincompass/latinpadble/rules.mk index aac9dde15fa0..06816c2ef8c5 100644 --- a/keyboards/latinpadble/rules.mk +++ b/keyboards/latincompass/latinpadble/rules.mk @@ -21,7 +21,7 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE OLED_ENABLE = yes OLED_DRIVER = SSD1306 ENCODER_ENABLE = yes diff --git a/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c index cced607b0c56..8d8b4b751b1c 100644 --- a/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk65_hs/keymaps/default/keymap.c @@ -1,54 +1,50 @@ #include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS - enum keymap_layout { BASE = 0, FUNC, }; -// #define uint16_t int -// #define uint8_t int - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT_ansi( - /* Keymap VANILLA: (Base Layer) Default Layer - * ,------------------------------------------------------------.----. - * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| - * |------------------------------------------------------------|----| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del| - * |------------------------------------------------------------|----| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| - * |------------------------------------------------------------|----| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| - * |-----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | - * `-----------------------------------------------------------------' - */ - KC_GESC,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_INS, - 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del| + * |------------------------------------------------------------|----| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |------------------------------------------------------------|----| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + [BASE] = LAYOUT_ansi( + KC_GESC, 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_INS, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT + ), -[FUNC] = LAYOUT_ansi( - /*Keymap VANILLA: Function Layer - * ,------------------------------------------------------------.----. - * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| - * |------------------------------------------------------------|----| - * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| \| Del| - * |------------------------------------------------------------|----| - * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '|Return |PgUp| - * |------------------------------------------------------------|----| - * |ClickTgl|Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| - * |-----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | - * `-----------------------------------------------------------------' - */ - 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_F13, KC_F14, - MU_MOD, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_TOG, - AU_TOG, F(1),F(3), KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_MOD, - F(5), F(2),F(4), KC_TR, KC_TR, KC_TR, KC_TR, MU_TOG, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR, - KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI), + /* Keymap VANILLA: Function Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| \| Del| + * |------------------------------------------------------------|----| + * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |------------------------------------------------------------|----| + * |ClickTgl|Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + [FUNC] = LAYOUT_ansi( + 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_F13, KC_F14, + MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, + AU_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, + _______, _______, _______, _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI + ) }; diff --git a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c index 9e79a7355509..bd35bfbf229a 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/keymap.c @@ -15,108 +15,104 @@ enum { bool spam_space = false; - - // {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green - // {0x00000008, 0xFFFFFFF8, {0x07FF, 0x07FF, 0x0000}}, // CSGO layer - orange - // {0x00000010, 0xFFFFFFF0, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue - // {0x00000020, 0xFFFFFFE0, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta - // {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white - +// {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green +// {0x00000008, 0xFFFFFFF8, {0x07FF, 0x07FF, 0x0000}}, // CSGO layer - orange +// {0x00000010, 0xFFFFFFF0, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue +// {0x00000020, 0xFFFFFFE0, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta +// {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white // Colors of the layer indicator LED // This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer const Layer_Info layer_info[] = { - // Layer Mask Red Green Blue - {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green - {0x00000002, 0xFFFFFFFE, {0x07FF, 0x07FF, 0x0000}}, // CSGO layer - orange - {0x00000004, 0xFFFFFFFC, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue - {0x00000008, 0xFFFFFFE8, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta - {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green + {0x00000002, 0xFFFFFFFE, {0x07FF, 0x07FF, 0x0000}}, // CSGO layer - orange + {0x00000004, 0xFFFFFFFC, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue + {0x00000008, 0xFFFFFFE8, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap BASE: (Base Layer) Default Layer - * ,---------. ,------------------------------------------------------------. ,---------. - * |Vol-|Vol+| |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| | Ins|PgUp| - * |---------| |------------------------------------------------------------| |---------| - * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del|PgDn| - * |---------| |------------------------------------------------------------| `---------' - * | F5 | F6 | |Control | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |---------| |------------------------------------------------------------| ,----. - * | F7 | F8 | |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | | Up | - * |---------| |-------------------------------------------------------------------------. - * | F9 | F10| |Func|Alt |Cmd | Space |Cmd |Alt |Func | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_split_rshift( - KC_VOLD, KC_VOLU, KC_GESC, 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, LALT(KC_F5), KC_PGUP, \ - KC_F3, KC_F4, 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_PGDN, \ - KC_F5, KC_F6, TD(TD_ESC_FUNC), 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_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(CS_GO), KC_UP, \ - KC_F9, KC_F10, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - [CS_GO] = LAYOUT_split_rshift( - _______, _______, KC_GESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, F(0), _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - - /* Keymap FUNCTION: Function Layer - * ,---------. ,-------------------------------------------------------------. ,---------. - * | V- | V+ | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | Ins|Home| - * |---------| |-------------------------------------------------------------| |---------| - * | | | |Tab | |PgU| | | | | | Up| | | | | | | Del|End | - * |---------| |-------------------------------------------------------------| `---------' - * | | | |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |---------| |--------------------------------------------------------------------------. - * | | F10| |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT_split_rshift( - _______, _______, 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, TO(CS_GO), KC_HOME, \ - _______, _______, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, \ - _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, _______, _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), XXXXXXX, _______, \ - _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ \ - ), - - /* Keymap SETTINGS: Settings Layer - * ,---------. ,-----------------------------------------------------------. ,-------------. - * | | | |FN0 |BL0|BL1|BL2|BL3| | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |---------| |-----------------------------------------------------------| |-------------| - * | | | |Debug| | | | | | | | | | | | |RGBTst| |RGB Mode|Val-| - * |---------| |-----------------------------------------------------------| `-------------' - * | | | |LayrClr|Hz+|MS+| | | | | | | | | | RST | - * |---------| |-----------------------------------------------------------| ,----. - * | | | |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |---------| |------------------------------------------------------------------------. - * | | | | | | | Print Debug | | | | |Sat-|Hue-|Sat+| - * `---------' `------------------------------------------------------' `--------------' - */ - [SETTINGS] = LAYOUT_split_rshift( - XXXXXXX, XXXXXXX, F(0), F(3), F(4), F(5), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, \ - XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, \ - XXXXXXX, XXXXXXX, F(0), F(6), F(8), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ - XXXXXXX, XXXXXXX, F(10), F(7), F(9), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(0), XXXXXXX, RGB_HUI, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(12), XXXXXXX, XXXXXXX, F(0), RGB_SAD, RGB_HUD, RGB_SAI \ - ), + /* Keymap BASE: (Base Layer) Default Layer + * ,---------. ,------------------------------------------------------------. ,---------. + * |Vol-|Vol+| |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| | Ins|PgUp| + * |---------| |------------------------------------------------------------| |---------| + * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del|PgDn| + * |---------| |------------------------------------------------------------| `---------' + * | F5 | F6 | |Control | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |---------| |------------------------------------------------------------| ,----. + * | F7 | F8 | |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | | Up | + * |---------| |-------------------------------------------------------------------------. + * | F9 | F10| |Func|Alt |Cmd | Space |Cmd |Alt |Func | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_split_rshift( + KC_VOLD, KC_VOLU, KC_GESC, 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, LALT(KC_F5), KC_PGUP, + KC_F3, KC_F4, 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_PGDN, + KC_F5, KC_F6, TD(TD_ESC_FUNC), 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_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(CS_GO), KC_UP, + KC_F9, KC_F10, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT + ), + + [CS_GO] = LAYOUT_split_rshift( + _______, _______, KC_GESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, F(0), _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Keymap FUNCTION: Function Layer + * ,---------. ,-------------------------------------------------------------. ,---------. + * | V- | V+ | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | Ins|Home| + * |---------| |-------------------------------------------------------------| |---------| + * | | | |Tab | |PgU| | | | | | Up| | | | | | | Del|End | + * |---------| |-------------------------------------------------------------| `---------' + * | | | |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |---------| |--------------------------------------------------------------------------. + * | | F10| |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_split_rshift( + _______, _______, 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, TO(CS_GO), KC_HOME, + _______, _______, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, + _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), XXXXXXX, _______, + _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ + ), + + /* Keymap SETTINGS: Settings Layer + * ,---------. ,-----------------------------------------------------------. ,-------------. + * | | | |FN0 |BL0|BL1|BL2|BL3| | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |---------| |-----------------------------------------------------------| |-------------| + * | | | |Debug| | | | | | | | | | | | |RGBTst| |RGB Mode|Val-| + * |---------| |-----------------------------------------------------------| `-------------' + * | | | |LayrClr|Hz+|MS+| | | | | | | | | | RST | + * |---------| |-----------------------------------------------------------| ,----. + * | | | |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |---------| |------------------------------------------------------------------------. + * | | | | | | | Print Debug | | | | |Sat-|Hue-|Sat+| + * `---------' `------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT_split_rshift( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI + ) }; - void tap_space_spam_finished(qk_tap_dance_state_t *state, void *user_data) { - if(get_mods() & (MOD_BIT(KC_LGUI))){ + if (get_mods() & (MOD_BIT(KC_LGUI))) { return; } - if(state->pressed){ + if (state->pressed) { spam_space = true; } - register_code(KC_SPC); - unregister_code(KC_SPC); + tap_code(KC_SPC); } void tap_space_spam_reset(qk_tap_dance_state_t *state, void *user_data) { @@ -125,11 +121,10 @@ void tap_space_spam_reset(qk_tap_dance_state_t *state, void *user_data) { } void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) { - if(state->pressed){ + if (state->pressed) { layer_on(FUNC); - }else{ - register_code(KC_ESC); - unregister_code(KC_ESC); + } else { + tap_code(KC_ESC); } } @@ -138,40 +133,21 @@ void tap_esc_func_reset(qk_tap_dance_state_t *state, void *user_data) { } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ESC_FUNC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_esc_func_finished, tap_esc_func_reset), - [TD_SPC_SPAM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_space_spam_finished, tap_space_spam_reset), + [TD_ESC_FUNC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_esc_func_finished, tap_esc_func_reset), + [TD_SPC_SPAM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_space_spam_finished, tap_space_spam_reset), }; - -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape - ACTION_FUNCTION(LFK_LED_TEST), // FN2 - cycle through LEDs for testing - ACTION_FUNCTION_OPT(LFK_SET_DEFAULT_LAYER, VANILLA), // FN3 - set base layer to 0 and save - ACTION_FUNCTION_OPT(LFK_SET_DEFAULT_LAYER, VANILLA), // FN4 - set base layer to 1 and save - ACTION_FUNCTION_OPT(LFK_SET_DEFAULT_LAYER, VANILLA), // FN5 - set base layer to 2 and save - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN6 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN7 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN8 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN9 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN10 - Toggle audio click - ACTION_FUNCTION(LFK_LED_TEST), // FN11 - cycle through LEDs for testing - ACTION_FUNCTION(LFK_DEBUG_SETTINGS), // FN12 - prints LED and click settings to HID - }; - void matrix_scan_user(void) { - if(spam_space && !(get_mods() & (MOD_BIT(KC_LGUI)))){ - register_code(KC_SPC); - unregister_code(KC_SPC); + if (spam_space && !(get_mods() & (MOD_BIT(KC_LGUI)))) { + tap_code(KC_SPC); } } - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if((layer_state & (1 << CS_GO)) && (keycode == 44)){ - if(get_mods() & (MOD_BIT(KC_LGUI))){ - return false; + if ((layer_state & (1 << CS_GO)) && (keycode == 44)) { + if (get_mods() & (MOD_BIT(KC_LGUI))) { + return false; + } } - } - return true; + return true; } diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c index a92a506c1243..8faa099453f7 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c @@ -73,23 +73,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `---------' `--------------------------------------------------------' `--------------' */ [SETTINGS] = LAYOUT( - XXXXXXX, XXXXXXX, F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, - XXXXXXX, XXXXXXX, AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - XXXXXXX, XXXXXXX, F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI ) }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE) // FN5 - Toggle audio click -}; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if (eeconfig_read_default_layer() > 1) { diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c index 3dbc77557993..ec054b33e771 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c @@ -73,23 +73,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `---------' `--------------------------------------------------------' `--------------' */ [SETTINGS] = LAYOUT_iso( - XXXXXXX, XXXXXXX, F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, - XXXXXXX, XXXXXXX, AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - XXXXXXX, XXXXXXX, F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI ) }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE) // FN5 - Toggle audio click -}; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if (eeconfig_read_default_layer() > 1) { diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c index da7593d39c2c..0a9c2aa4f908 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c @@ -73,23 +73,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `---------' `--------------------------------------------------------' `--------------' */ [SETTINGS] = LAYOUT_split_bs( - XXXXXXX, XXXXXXX, F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_TOGG, RGB_MOD, RGB_VAD, - XXXXXXX, XXXXXXX, AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - XXXXXXX, XXXXXXX, F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI ) }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE) // FN5 - Toggle audio click -}; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed if (eeconfig_read_default_layer() > 1) { diff --git a/keyboards/lfkeyboards/lfk78/lfk78.c b/keyboards/lfkeyboards/lfk78/lfk78.c index 5b283f979df0..2f8f1b34efeb 100644 --- a/keyboards/lfkeyboards/lfk78/lfk78.c +++ b/keyboards/lfkeyboards/lfk78/lfk78.c @@ -134,73 +134,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return process_record_user(keycode, record); } -void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) { -#ifdef AUDIO_ENABLE - int8_t sign = 1; -#endif - - if (id == LFK_ESC_TILDE) { - // Send ~ on shift-esc - void (*method)(uint8_t) = (event->event.pressed) ? &add_key : &del_key; - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); - - if (layer_state == 0) { - method(shifted ? KC_GRAVE : KC_ESCAPE); - } else { - method(shifted ? KC_ESCAPE : KC_GRAVE); - } - - send_keyboard_report(); - } else if (event->event.pressed) { - switch (id) { - case LFK_SET_DEFAULT_LAYER: - // set/save the current base layer to eeprom, falls through to LFK_CLEAR - eeconfig_update_default_layer(1UL << opt); - default_layer_set(1UL << opt); - case LFK_CLEAR: - // Go back to default layer - layer_clear(); - break; -#ifdef ISSI_ENABLE - case LFK_LED_TEST: - led_test(); - break; -#endif -#ifdef AUDIO_ENABLE - case LFK_CLICK_FREQ_LOWER: - sign = -1; // continue to next statement - case LFK_CLICK_FREQ_HIGHER: - click_hz += sign * 100; - click(click_hz, click_time); - break; - case LFK_CLICK_TOGGLE: - if (click_toggle) { - click_toggle = 0; - click(4000, 100); - click(1000, 100); - } else { - click_toggle = 1; - click(1000, 100); - click(4000, 100); - } - break; - case LFK_CLICK_TIME_SHORTER: - sign = -1; // continue to next statement - case LFK_CLICK_TIME_LONGER: - click_time += sign; - click(click_hz, click_time); - break; -#endif - case LFK_DEBUG_SETTINGS: - dprintf("Click:\n"); - dprintf(" toggle: %d\n", click_toggle); - dprintf(" freq(hz): %d\n", click_hz); - dprintf(" duration(ms): %d\n", click_time); - break; - } - } -} - void reset_keyboard_kb() { #ifdef WATCHDOG_ENABLE MCUSR = 0; diff --git a/keyboards/lfkeyboards/lfk78/lfk78.h b/keyboards/lfkeyboards/lfk78/lfk78.h index 711baddeceac..ffa4894bbc59 100644 --- a/keyboards/lfkeyboards/lfk78/lfk78.h +++ b/keyboards/lfkeyboards/lfk78/lfk78.h @@ -25,19 +25,6 @@ typedef struct Layer_Info { extern const uint32_t layer_count; extern const Layer_Info layer_info[]; -enum action_functions { - LFK_CLEAR = 0, // Resets all layers - LFK_ESC_TILDE, // esc+lshift = ~ - LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom - LFK_CLICK_TOGGLE, // Adjusts click duration - LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency - LFK_CLICK_FREQ_LOWER, // Adjusts click frequency - LFK_CLICK_TIME_LONGER, // Adjusts click duration - LFK_CLICK_TIME_SHORTER, // Adjusts click duration - LFK_DEBUG_SETTINGS, // prints LED and click settings to HID - LFK_LED_TEST // cycles through switch and RGB LEDs -}; - #define CLICK_HZ 500 #define CLICK_MS 2 #define CLICK_ENABLED 0 diff --git a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c index c6799ea532e0..b62ea9344093 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/keymap.c @@ -13,156 +13,153 @@ enum { TD_ESC_FUNC = 0, }; - // Colors of the layer indicator LED // This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer const Layer_Info layer_info[] = { - // Layer Mask Red Green Blue - {0x00000000, 0xFFFFFFF8, {0x00, 0xFF, 0x00}}, // base layers (VANILLA, DEFAULT_WKL, DEFAULT_OSX) - green - {0x00000008, 0xFFFFFFF8, {0x07FF, 0x07FF, 0x0000}}, // CSGO layer - orange - {0x00000010, 0xFFFFFFF0, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue - {0x00000020, 0xFFFFFFE0, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta - {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFF8, {0x00, 0xFF, 0x00}}, // base layers (VANILLA, DEFAULT_WKL, DEFAULT_OSX) - green + {0x00000008, 0xFFFFFFF8, {0x07FF, 0x07FF, 0x0000}}, // CSGO layer - orange + {0x00000010, 0xFFFFFFF0, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue + {0x00000020, 0xFFFFFFE0, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |CTRL |Func| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_tkl_ansi( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, \ - 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_INS, KC_HOME, KC_PGUP, \ - 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_END, KC_PGDN, \ - 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - /* Keymap DEFAULT_TKL: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl| |Alt | Space |ALT | |CTRL |Func| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [DEFAULT_WKL] = LAYOUT_tkl_ansi( - 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_SLCK, KC_PAUS, \ - 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_INS, KC_HOME, KC_PGUP, \ - 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_END, KC_PGDN, \ - 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - /* Keymap DEFAULT_OSX: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl| Opt |Cmd | Space |Cmd |Opt |CTRL |Func| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [DEFAULT_OSX] = LAYOUT_tkl_ansi( - 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_SLCK, KC_PAUS, LALT(KC_F5), \ - 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_INS, KC_HOME, KC_PGUP, \ - 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_END, KC_PGDN, \ - TD(TD_ESC_FUNC), 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - - [CS_GO] = LAYOUT_tkl_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, F(0), _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT_tkl_ansi( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, TO(CS_GO), _______, _______, \ - XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ - _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \ - ), - - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |Debug| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AU_TOG |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |------------------------------------------------------------------------. - * | | | | Print Debug | | | | |Sat-|Hue-|Sat+| - * `------------------------------------------------------' `--------------' - */ - [SETTINGS] = LAYOUT_tkl_ansi( - F(13), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \ - F(0), F(3), F(4), F(5), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \ - MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(2), RGB_MOD, RGB_VAD, XXXXXXX, \ - AU_TOG, F(6), F(8), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ - F(10), F(7), F(9), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, F(0), RGB_HUI, \ - XXXXXXX, XXXXXXX, XXXXXXX, F(12), XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \ - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |CTRL |Func| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, + 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_INS, KC_HOME, KC_PGUP, + 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_END, KC_PGDN, + 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Keymap DEFAULT_TKL: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl| |Alt | Space |ALT | |CTRL |Func| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [DEFAULT_WKL] = LAYOUT_tkl_ansi( + 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_SLCK, KC_PAUS, + 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_INS, KC_HOME, KC_PGUP, + 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_END, KC_PGDN, + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Keymap DEFAULT_OSX: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl| Opt |Cmd | Space |Cmd |Opt |CTRL |Func| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [DEFAULT_OSX] = LAYOUT_tkl_ansi( + 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_SLCK, KC_PAUS, LALT(KC_F5), + 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_INS, KC_HOME, KC_PGUP, + 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_END, KC_PGDN, + TD(TD_ESC_FUNC), 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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT + ), + + [CS_GO] = LAYOUT_tkl_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_tkl_ansi( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, TO(CS_GO), _______, _______, + XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |Debug| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AU_TOG |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |------------------------------------------------------------------------. + * | | | | Print Debug | | | | |Sat-|Hue-|Sat+| + * `------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT_tkl_ansi( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, + AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI + ) }; void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) { - if(state->pressed){ + if (state->pressed) { layer_on(FUNC); - }else{ - register_code(KC_ESC); - unregister_code(KC_ESC); + } else { + tap_code(KC_ESC); } } @@ -171,32 +168,14 @@ void tap_esc_func_reset(qk_tap_dance_state_t *state, void *user_data) { } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ESC_FUNC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_esc_func_finished, tap_esc_func_reset), + [TD_ESC_FUNC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_esc_func_finished, tap_esc_func_reset), }; - -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape - ACTION_FUNCTION(LFK_LED_TEST), // FN2 - cycle through LEDs for testing - ACTION_FUNCTION_OPT(LFK_SET_DEFAULT_LAYER, VANILLA), // FN3 - set base layer to 0 and save - ACTION_FUNCTION_OPT(LFK_SET_DEFAULT_LAYER, DEFAULT_WKL), // FN4 - set base layer to 1 and save - ACTION_FUNCTION_OPT(LFK_SET_DEFAULT_LAYER, DEFAULT_OSX), // FN5 - set base layer to 2 and save - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN6 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN7 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN8 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN9 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN10 - Toggle audio click - ACTION_FUNCTION(LFK_LED_TEST), // FN11 - cycle through LEDs for testing - ACTION_FUNCTION(LFK_DEBUG_SETTINGS), // FN12 - prints LED and click settings to HID - ACTION_FUNCTION(LFK_PLAY_ONEUP), - }; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if((layer_state & (1 << CS_GO)) && (keycode == 44)){ - if(get_mods() & (MOD_BIT(KC_LGUI))){ - return false; + if ((layer_state & (1 << CS_GO)) && (keycode == 44)) { + if (get_mods() & (MOD_BIT(KC_LGUI))) { + return false; + } } - } - return true; + return true; } diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c index 3ee5399cd3b2..789a6f9737f1 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c @@ -16,93 +16,83 @@ const Layer_Info layer_info[] = { {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_tkl_ansi( - 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_SLCK, KC_PAUS, - 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_INS, KC_HOME, KC_PGUP, - 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_END, KC_PGDN, - 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), - - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT_tkl_ansi( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, - XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, - _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, - _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_ansi( + 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_SLCK, KC_PAUS, + 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_INS, KC_HOME, KC_PGUP, + 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_END, KC_PGDN, + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap SETTINGS: Settings Layer - * ,------------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl | |RGB Tog |Val+| - * |------------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |------------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |------------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |------------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `------------------------------------------------------------------------------' - */ - [SETTINGS] = LAYOUT_tkl_ansi( - F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, - F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, - MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(2), RGB_MOD, RGB_VAD, XXXXXXX, - AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, - XXXXXXX, XXXXXXX, XXXXXXX, F(12), XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI - ), -}; + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_tkl_ansi( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, + _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ + ), -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click + /* Keymap SETTINGS: Settings Layer + * ,------------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl | |RGB Tog |Val+| + * |------------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |------------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |------------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |------------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `------------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT_tkl_ansi( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, + AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI + ) }; void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } diff --git a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c index 4dfb0985389b..c946856dbe21 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/keymap.c @@ -16,93 +16,83 @@ const Layer_Info layer_info[] = { {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_tkl_ansi( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, LGUI(KC_D), KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, - 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_INS, KC_HOME, KC_PGUP, - 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_END, KC_PGDN, - 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, LGUI(KC_D), KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, + 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_INS, KC_HOME, KC_PGUP, + 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_END, KC_PGDN, + 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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT_tkl_ansi( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, - XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, - _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, - _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ - ), + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_tkl_ansi( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, + _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ - [SETTINGS] = LAYOUT_tkl_ansi( - F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, - F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, - MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(2), RGB_MOD, RGB_VAD, XXXXXXX, - AU_TOG, KC_F1, F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, - XXXXXXX, XXXXXXX, XXXXXXX, F(12), XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI - ), + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |--------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `----------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT_tkl_ansi( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, + AU_TOG, KC_F1, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI + ) }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } diff --git a/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c b/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c index 428277c33f85..b36de66c6a7e 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c @@ -9,100 +9,90 @@ enum keymap_layout { // Colors of the layer indicator LED // This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer const Layer_Info layer_info[] = { - // Layer Mask Red Green Blue - {0x00000000, 0xFFFFFFFF, {0x00, 0x00, 0x00}}, // base layer - off - {0x00000002, 0xFFFFFFFE, {0x00, 0x00, 0x7F}}, // function layer - blue - {0x00000004, 0xFFFFFFFC, {0x7F, 0x00, 0x00}}, // settings layer - red - {0xFFFFFFFF, 0xFFFFFFFF, {0x0F, 0x0F, 0x0F}}, // unknown layer - REQUIRED - white + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x00, 0x00, 0x00}}, // base layer - off + {0x00000002, 0xFFFFFFFE, {0x00, 0x00, 0x7F}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0x7F, 0x00, 0x00}}, // settings layer - red + {0xFFFFFFFF, 0xFFFFFFFF, {0x0F, 0x0F, 0x0F}}, // unknown layer - REQUIRED - white }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret| | Del| End|PgDn| - * |--------------------------------------------------------. | `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | | - * |-----------------------------------------------------------| ,----. - * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_tkl_iso( - 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_LSCR, KC_PAUS, - 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_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, - KC_LCAP, 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_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret| | Del| End|PgDn| + * |--------------------------------------------------------. | `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | | + * |-----------------------------------------------------------| ,----. + * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_tkl_iso( + 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_LSCR, KC_PAUS, + 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_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + KC_LCAP, 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_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * | |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | | - * |---------------------------------------------------------. | `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | | - * |-------------------------------------------------------------| ,----. - * |Shift| | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | - * `-------------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT_tkl_iso( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, - XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, - _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, - _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ - ), + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * | |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | | + * |---------------------------------------------------------. | `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | | + * |-------------------------------------------------------------| ,----. + * |Shift| | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |ALT |GUI | Func|CTRL| |Lft| Dn |Rig | + * `-------------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_tkl_iso( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, + XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, + _______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN3 |BL0|BL1|BL2|BL3| | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |Debug| | | | | | | | | | | | | RST | |RGB Mode|Val-| - * |--------------------------------------------------------. | `-------------' - * |LayrClr|Hz+|MS+| | | | | | | | | | | | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |------------------------------------------------------------------------. - * | | | | | | | | |Sat-|Hue-|Sat+| - * `------------------------------------------------------' `--------------' - */ - [SETTINGS] = LAYOUT_tkl_iso( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, - F(0), F(3), F(4), F(5), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, - MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, - AU_TOG, F(3), F(5), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - F(7), XXXXXXX, F(4), F(6), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, F(0), RGB_HUI, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(0), RGB_SAD, RGB_HUD, RGB_SAI - ), + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN3 |BL0|BL1|BL2|BL3| | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |Debug| | | | | | | | | | | | | RST | |RGB Mode|Val-| + * |--------------------------------------------------------. | `-------------' + * |LayrClr|Hz+|MS+| | | | | | | | | | | | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |------------------------------------------------------------------------. + * | | | | | | | | |Sat-|Hue-|Sat+| + * `------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT_tkl_iso( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, + AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI + ) }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - [3] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN3 - Increase Freq of audio click - [4] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN4 - Decrease Freq of audio click - [5] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN5 - Increase length of audio click - [6] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN6 - Decrease length of audio click - [7] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN7 - Toggle audio click - }; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } diff --git a/keyboards/lfkeyboards/lfk87/lfk87.c b/keyboards/lfkeyboards/lfk87/lfk87.c index 10fc14a8aa5d..17eeeeffe805 100644 --- a/keyboards/lfkeyboards/lfk87/lfk87.c +++ b/keyboards/lfkeyboards/lfk87/lfk87.c @@ -116,61 +116,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) return process_record_user(keycode, record); } -void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) -{ -#ifdef AUDIO_ENABLE - int8_t sign = 1; -#endif - if(id == LFK_ESC_TILDE){ - // Send ~ on shift-esc - void (*method)(uint8_t) = (event->event.pressed) ? &add_key : &del_key; - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); - method(shifted ? KC_GRAVE : KC_ESCAPE); - send_keyboard_report(); - }else if(event->event.pressed){ - switch(id){ - case LFK_SET_DEFAULT_LAYER: - // set/save the current base layer to eeprom, falls through to LFK_CLEAR - eeconfig_update_default_layer(1UL << opt); - default_layer_set(1UL << opt); - case LFK_CLEAR: - // Go back to default layer - layer_clear(); - break; -#ifdef ISSI_ENABLE - case LFK_LED_TEST: - led_test(); - break; -#endif -#ifdef AUDIO_ENABLE - case LFK_CLICK_FREQ_LOWER: - sign = -1; // continue to next statement - case LFK_CLICK_FREQ_HIGHER: - click_hz += sign * 100; - click(click_hz, click_time); - break; - case LFK_CLICK_TOGGLE: - if(click_toggle){ - click_toggle = 0; - click(4000, 100); - click(1000, 100); - }else{ - click_toggle = 1; - click(1000, 100); - click(4000, 100); - } - break; - case LFK_CLICK_TIME_SHORTER: - sign = -1; // continue to next statement - case LFK_CLICK_TIME_LONGER: - click_time += sign; - click(click_hz, click_time); - break; -#endif - } - } -} - void reset_keyboard_kb(){ #ifdef WATCHDOG_ENABLE MCUSR = 0; diff --git a/keyboards/lfkeyboards/lfk87/lfk87.h b/keyboards/lfkeyboards/lfk87/lfk87.h index 1b1368659ba8..5bd353a89ea8 100644 --- a/keyboards/lfkeyboards/lfk87/lfk87.h +++ b/keyboards/lfkeyboards/lfk87/lfk87.h @@ -19,20 +19,6 @@ typedef struct Layer_Info { extern const uint32_t layer_count; extern const Layer_Info layer_info[]; -enum action_functions { - LFK_CLEAR = 0, // Resets all layers - LFK_ESC_TILDE, // esc+lshift = ~ - LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom - LFK_CLICK_TOGGLE, // Adjusts click duration - LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency - LFK_CLICK_FREQ_LOWER, // Adjusts click frequency - LFK_CLICK_TIME_LONGER, // Adjusts click duration - LFK_CLICK_TIME_SHORTER, // Adjusts click duration - LFK_DEBUG_SETTINGS, // prints LED and click settings to HID - LFK_LED_TEST, // cycles through switch and RGB LEDs - LFK_PLAY_ONEUP -}; - #define CLICK_HZ 500 #define CLICK_MS 2 #define CLICK_ENABLED 0 diff --git a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c index 2a16bf4ccf65..f5faf7215aea 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c +++ b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/keymap.c @@ -22,84 +22,82 @@ const Layer_Info layer_info[] = { {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT( - KC_GESC, 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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - 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_P7, KC_P8, KC_P9, KC_PPLS, \ - TD(TD_ESC_FUNC), 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_P4, KC_P5, KC_P6, LALT(KC_F5), \ - 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_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT( + KC_GESC, 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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + 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_P7, KC_P8, KC_P9, KC_PPLS, + TD(TD_ESC_FUNC), 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_P4, KC_P5, KC_P6, LALT(KC_F5), + 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ - [FUNC] = 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_F12, KC_DEL, _______, _______, _______, _______, \ - XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, \ - _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, _______, _______, _______, _______, \ - _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = 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_F12, KC_DEL, _______, _______, _______, _______, + XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, _______, _______, _______, _______, + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ - [SETTINGS] = LAYOUT( - F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, \ - MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(2), RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, \ - AU_TOG, KC_F1, F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, F(12), XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX \ - ), + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |--------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `----------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, + AU_TOG, KC_F1, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX + ) }; void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) { - if(state->pressed){ + if (state->pressed) { layer_on(FUNC); - }else{ - register_code(KC_ESC); - unregister_code(KC_ESC); + } else { + tap_code(KC_ESC); } } @@ -108,21 +106,12 @@ void tap_esc_func_reset(qk_tap_dance_state_t *state, void *user_data) { } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ESC_FUNC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_esc_func_finished, tap_esc_func_reset), + [TD_ESC_FUNC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_esc_func_finished, tap_esc_func_reset), }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c b/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c index 1d29cb1c5625..13cb6c22f5da 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c @@ -1,8 +1,5 @@ #include QMK_KEYBOARD_H -//Define a shorter 'transparent' key code to make the keymaps more compact -#define KC_TR KC_TRNS - enum keymap_layout { VANILLA = 0, // matches MF68 layout FUNC, // 0x08 @@ -19,90 +16,80 @@ const Layer_Info layer_info[] = { {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white }; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT( - KC_GESC, 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_NLCK, KC_PSLS, KC_PAST, KC_PEQL, - 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_P7, KC_P8, KC_P9, KC_PMNS, - 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_P4, KC_P5, KC_P6, KC_PPLS, - 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_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT( + KC_GESC, 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_NLCK, KC_PSLS, KC_PAST, KC_PEQL, + 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_P7, KC_P8, KC_P9, KC_PMNS, + 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_P4, KC_P5, KC_P6, KC_PPLS, + 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT + ), - /* Keymap FUNCTION: Function Layer - * ,-------------------------------------------------------------. ,--------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | - * |-------------------------------------------------------------| |--------------| - * |Tab | |PgU| | | | | | Up| | | | | | | | | | - * |-------------------------------------------------------------| `--------------' - * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | - * |-------------------------------------------------------------| ,----. - * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |-------------------------------------------------------------' ,-------------. - * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | - * `------------------------------------------------------' `-------------' - */ - [FUNC] = 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_F12, KC_DEL, _______, _______, _______, _______, - XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, _______, _______, _______, _______, - _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______ - ), + /* Keymap FUNCTION: Function Layer + * ,-------------------------------------------------------------. ,--------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | | + * |-------------------------------------------------------------| |--------------| + * |Tab | |PgU| | | | | | Up| | | | | | | | | | + * |-------------------------------------------------------------| `--------------' + * |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | | + * |-------------------------------------------------------------| ,----. + * |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |-------------------------------------------------------------' ,-------------. + * |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig | + * `------------------------------------------------------' `-------------' + */ + [FUNC] = 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_F12, KC_DEL, _______, _______, _______, _______, + XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, _______, _______, _______, _______, + _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,-----------------------------------------------------------. ,-------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| - * |-------------------------------------------------------------| |--------------| - * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |-----------------------------------------------------------| |-------------| - * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |-----------------------------------------------------------| `-------------' - * |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |-----------------------------------------------------------| ,----. - * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| - * |--------------------------------------------------------------------------. - * | | | | | | | | | |Sat-|Hue-|Sat+| - * `----------------------------------------------------------------------------' - */ - [SETTINGS] = LAYOUT( - F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, - MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, F(2), RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, - AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, F(12), XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX - ), + /* Keymap SETTINGS: Settings Layer + * ,-----------------------------------------------------------. ,-------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus| + * |-------------------------------------------------------------| |--------------| + * |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |-----------------------------------------------------------| |-------------| + * |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |-----------------------------------------------------------| `-------------' + * |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |-----------------------------------------------------------| ,----. + * |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+| + * |--------------------------------------------------------------------------. + * | | | | | | | | | |Sat-|Hue-|Sat+| + * `----------------------------------------------------------------------------' + */ + [SETTINGS] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, + MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, + AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX + ) }; -const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; - void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } diff --git a/keyboards/lfkeyboards/mini1800/mini1800.c b/keyboards/lfkeyboards/mini1800/mini1800.c index 4c897ac69343..8819d3465aa9 100644 --- a/keyboards/lfkeyboards/mini1800/mini1800.c +++ b/keyboards/lfkeyboards/mini1800/mini1800.c @@ -122,64 +122,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) return process_record_user(keycode, record); } -void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) -{ -#ifdef AUDIO_ENABLE - int8_t sign = 1; -#endif - if(id == LFK_ESC_TILDE){ - // Send ~ on shift-esc - void (*method)(uint8_t) = (event->event.pressed) ? &add_key : &del_key; - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); - method(shifted ? KC_GRAVE : KC_ESCAPE); - send_keyboard_report(); - }else if(event->event.pressed){ - switch(id){ - case LFK_SET_DEFAULT_LAYER: - // set/save the current base layer to eeprom, falls through to LFK_CLEAR - eeconfig_update_default_layer(1UL << opt); - default_layer_set(1UL << opt); - case LFK_CLEAR: - // Go back to default layer - layer_clear(); - break; -#ifdef ISSI_ENABLE - case LFK_LED_TEST: - led_test(); - break; -#endif -#ifdef AUDIO_ENABLE - case LFK_CLICK_FREQ_LOWER: - sign = -1; // continue to next statement - case LFK_CLICK_FREQ_HIGHER: - click_hz += sign * 100; - click(click_hz, click_time); - break; - case LFK_CLICK_TOGGLE: - if(click_toggle){ - click_toggle = 0; - click(4000, 100); - click(1000, 100); - }else{ - click_toggle = 1; - click(1000, 100); - click(4000, 100); - } - break; - case LFK_CLICK_TIME_SHORTER: - sign = -1; // continue to next statement - case LFK_CLICK_TIME_LONGER: - click_time += sign; - click(click_hz, click_time); - break; -#endif - case LFK_PLAY_ONEUP: - PLAY_SONG(my_song); - break; - } - } -} - void reset_keyboard_kb(){ #ifdef WATCHDOG_ENABLE MCUSR = 0; diff --git a/keyboards/lfkeyboards/mini1800/mini1800.h b/keyboards/lfkeyboards/mini1800/mini1800.h index 3e460c8a11d3..3586c75221ba 100644 --- a/keyboards/lfkeyboards/mini1800/mini1800.h +++ b/keyboards/lfkeyboards/mini1800/mini1800.h @@ -19,20 +19,6 @@ typedef struct Layer_Info { extern const uint32_t layer_count; extern const Layer_Info layer_info[]; -enum action_functions { - LFK_CLEAR = 0, // Resets all layers - LFK_ESC_TILDE, // esc+lshift = ~ - LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom - LFK_CLICK_TOGGLE, // Adjusts click duration - LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency - LFK_CLICK_FREQ_LOWER, // Adjusts click frequency - LFK_CLICK_TIME_LONGER, // Adjusts click duration - LFK_CLICK_TIME_SHORTER, // Adjusts click duration - LFK_DEBUG_SETTINGS, // prints LED and click settings to HID - LFK_LED_TEST, // cycles through switch and RGB LEDs - LFK_PLAY_ONEUP -}; - #define CLICK_HZ 500 #define CLICK_MS 2 #define CLICK_ENABLED 0 diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c b/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c index 1470f95022f7..0e6b2820d0b3 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/smk65/keymaps/default/keymap.c @@ -21,55 +21,45 @@ enum layer_names { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,------------------------------------------------------------.----. - * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| - * |------------------------------------------------------------|----| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del| - * |------------------------------------------------------------|----| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| - * |------------------------------------------------------------|----| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| - * |-----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | - * `-----------------------------------------------------------------' - */ - [_BASE] = LAYOUT_65_ansi( - KC_GESC, 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_INS, - 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del| + * |------------------------------------------------------------|----| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |------------------------------------------------------------|----| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + [_BASE] = LAYOUT_65_ansi( + KC_GESC, 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_INS, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap VANILLA: Function Layer - * ,------------------------------------------------------------.----. - * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| - * |------------------------------------------------------------|----| - * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| \| Del| - * |------------------------------------------------------------|----| - * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '|Return |PgUp| - * |------------------------------------------------------------|----| - * |ClickTgl|Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| - * |-----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | - * `-----------------------------------------------------------------' - */ - [_FN] = LAYOUT_65_ansi( - 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_F13, KC_F14, - MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, - AU_TOG, F(1), F(3), _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, - F(5), F(2), F(4), _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, - _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI - ) + /* Keymap VANILLA: Function Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| \| Del| + * |------------------------------------------------------------|----| + * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |------------------------------------------------------------|----| + * |ClickTgl|Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + [_FN] = LAYOUT_65_ansi( + 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_F13, KC_F14, + MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, + AU_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, + _______, _______, _______, _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI + ) }; - -#ifndef NO_ACTION_FUNCTION -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - [2] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - [3] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - [4] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - [5] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click -}; -#endif diff --git a/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c b/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c index 3a1701ce8629..881ff99c9d8b 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c @@ -21,55 +21,45 @@ enum layer_names { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,------------------------------------------------------------.----. - * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| - * |------------------------------------------------------------|----| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | Del| - * |--------------------------------------------------------. |----| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | |PgUp| - * |------------------------------------------------------------|----| - * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | Up |PgDn| - * |-----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | - * `-----------------------------------------------------------------' - */ - [_BASE] = LAYOUT_65_iso( - KC_GESC, 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_INS, - 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_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_NUHS, KC_ENT, KC_PGUP, - 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_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | Del| + * |--------------------------------------------------------. |----| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | |PgUp| + * |------------------------------------------------------------|----| + * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + [_BASE] = LAYOUT_65_iso( + KC_GESC, 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_INS, + 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_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_NUHS, KC_ENT, KC_PGUP, + 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_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap VANILLA: Function Layer - * ,------------------------------------------------------------.----. - * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| - * |------------------------------------------------------------|----| - * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| RESET| Del| - * |--------------------------------------------------------. |----| - * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '| | |PgUp| - * |------------------------------------------------------------|----| - * |CTgl| |Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| - * |-----------------------------------------------------------------| - * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | - * `-----------------------------------------------------------------' - */ - [_FN] = LAYOUT_65_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_F13, KC_F14, - MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, - AU_TOG, F(1), F(3), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, - F(5), _______, F(2), F(4), _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, - _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI - ), + /* Keymap VANILLA: Function Layer + * ,------------------------------------------------------------.----. + * |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins| + * |------------------------------------------------------------|----| + * |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| RESET| Del| + * |--------------------------------------------------------. |----| + * |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '| | |PgUp| + * |------------------------------------------------------------|----| + * |CTgl| |Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn| + * |-----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig | + * `-----------------------------------------------------------------' + */ + [_FN] = LAYOUT_65_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_F13, KC_F14, + MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, + AU_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, RGB_MOD, + _______, _______, _______, _______, _______, _______, _______, _______, MU_TOG, RGB_VAD, RGB_VAI, _______, _______, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI + ) }; - -#ifndef NO_ACTION_FUNCTION -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - [2] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - [3] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - [4] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - [5] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click -}; -#endif diff --git a/keyboards/lfkeyboards/smk65/revb/revb.c b/keyboards/lfkeyboards/smk65/revb/revb.c index 01c339f06bbb..9b34eff1c335 100644 --- a/keyboards/lfkeyboards/smk65/revb/revb.c +++ b/keyboards/lfkeyboards/smk65/revb/revb.c @@ -81,62 +81,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) return process_record_user(keycode, record); } -void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) -{ -#ifdef AUDIO_ENABLE - int8_t sign = 1; -#endif - if(id == LFK_ESC_TILDE){ - // Send ~ on shift-esc - void (*method)(uint8_t) = (event->event.pressed) ? &add_key : &del_key; - uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); - method(shifted ? KC_GRAVE : KC_ESCAPE); - send_keyboard_report(); - }else if(event->event.pressed){ - switch(id){ - case LFK_SET_DEFAULT_LAYER: - // set/save the current base layer to eeprom, falls through to LFK_CLEAR - eeconfig_update_default_layer(1UL << opt); - default_layer_set(1UL << opt); - case LFK_CLEAR: - // Go back to default layer - layer_clear(); - break; -#ifdef AUDIO_ENABLE - case LFK_CLICK_FREQ_LOWER: - sign = -1; // continue to next statement - case LFK_CLICK_FREQ_HIGHER: - click_hz += sign * 100; - click(click_hz, click_time); - break; - case LFK_CLICK_TOGGLE: - if(click_toggle){ - click_toggle = 0; - click(4000, 100); - click(1000, 100); - }else{ - click_toggle = 1; - click(1000, 100); - click(4000, 100); - } - break; - case LFK_CLICK_TIME_SHORTER: - sign = -1; // continue to next statement - case LFK_CLICK_TIME_LONGER: - click_time += sign; - click(click_hz, click_time); - break; -#endif - case LFK_DEBUG_SETTINGS: - dprintf("Click:\n"); - dprintf(" toggle: %d\n", click_toggle); - dprintf(" freq(hz): %d\n", click_hz); - dprintf(" duration(ms): %d\n", click_time); - break; - } - } -} - void reset_keyboard_kb(){ #ifdef WATCHDOG_ENABLE MCUSR = 0; diff --git a/keyboards/lfkeyboards/smk65/revb/revb.h b/keyboards/lfkeyboards/smk65/revb/revb.h index dbb25b869a45..28fed40aa2b0 100644 --- a/keyboards/lfkeyboards/smk65/revb/revb.h +++ b/keyboards/lfkeyboards/smk65/revb/revb.h @@ -33,19 +33,6 @@ typedef struct Layer_Info { extern const uint32_t layer_count; extern const Layer_Info layer_info[]; -enum action_functions { - LFK_CLEAR = 0, // Resets all layers - LFK_ESC_TILDE, // esc+lshift = ~ - LFK_SET_DEFAULT_LAYER, // changes and saves current base layer to eeprom - LFK_CLICK_TOGGLE, // Adjusts click duration - LFK_CLICK_FREQ_HIGHER, // Adjusts click frequency - LFK_CLICK_FREQ_LOWER, // Adjusts click frequency - LFK_CLICK_TIME_LONGER, // Adjusts click duration - LFK_CLICK_TIME_SHORTER, // Adjusts click duration - LFK_DEBUG_SETTINGS, // prints LED and click settings to HID - LFK_LED_TEST // cycles through switch and RGB LEDs -}; - #define CLICK_HZ 500 #define CLICK_MS 2 #define CLICK_ENABLED 0 diff --git a/keyboards/lily58/keymaps/druotoni/rules.mk b/keyboards/lily58/keymaps/druotoni/rules.mk index c07761108eac..b3182cb46af4 100644 --- a/keyboards/lily58/keymaps/druotoni/rules.mk +++ b/keyboards/lily58/keymaps/druotoni/rules.mk @@ -9,7 +9,6 @@ BOOTLOADER = atmel-dfu # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# EXTRAFLAGS += -flto LTO_ENABLE = yes SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no diff --git a/keyboards/lck75/config.h b/keyboards/lyso1/lck75/config.h similarity index 100% rename from keyboards/lck75/config.h rename to keyboards/lyso1/lck75/config.h diff --git a/keyboards/lck75/info.json b/keyboards/lyso1/lck75/info.json similarity index 100% rename from keyboards/lck75/info.json rename to keyboards/lyso1/lck75/info.json diff --git a/keyboards/lck75/keymaps/7u/keymap.c b/keyboards/lyso1/lck75/keymaps/7u/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/7u/keymap.c rename to keyboards/lyso1/lck75/keymaps/7u/keymap.c diff --git a/keyboards/lck75/keymaps/7u_iso/keymap.c b/keyboards/lyso1/lck75/keymaps/7u_iso/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/7u_iso/keymap.c rename to keyboards/lyso1/lck75/keymaps/7u_iso/keymap.c diff --git a/keyboards/lck75/keymaps/7u_sbs/keymap.c b/keyboards/lyso1/lck75/keymaps/7u_sbs/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/7u_sbs/keymap.c rename to keyboards/lyso1/lck75/keymaps/7u_sbs/keymap.c diff --git a/keyboards/lck75/keymaps/default/keymap.c b/keyboards/lyso1/lck75/keymaps/default/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/default/keymap.c rename to keyboards/lyso1/lck75/keymaps/default/keymap.c diff --git a/keyboards/lck75/keymaps/iso/keymap.c b/keyboards/lyso1/lck75/keymaps/iso/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/iso/keymap.c rename to keyboards/lyso1/lck75/keymaps/iso/keymap.c diff --git a/keyboards/lck75/keymaps/iso_sbs/keymap.c b/keyboards/lyso1/lck75/keymaps/iso_sbs/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/iso_sbs/keymap.c rename to keyboards/lyso1/lck75/keymaps/iso_sbs/keymap.c diff --git a/keyboards/lck75/keymaps/sbs/keymap.c b/keyboards/lyso1/lck75/keymaps/sbs/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/sbs/keymap.c rename to keyboards/lyso1/lck75/keymaps/sbs/keymap.c diff --git a/keyboards/lck75/keymaps/via/keymap.c b/keyboards/lyso1/lck75/keymaps/via/keymap.c similarity index 100% rename from keyboards/lck75/keymaps/via/keymap.c rename to keyboards/lyso1/lck75/keymaps/via/keymap.c diff --git a/keyboards/lck75/keymaps/via/rules.mk b/keyboards/lyso1/lck75/keymaps/via/rules.mk similarity index 100% rename from keyboards/lck75/keymaps/via/rules.mk rename to keyboards/lyso1/lck75/keymaps/via/rules.mk diff --git a/keyboards/lck75/lck75.c b/keyboards/lyso1/lck75/lck75.c similarity index 100% rename from keyboards/lck75/lck75.c rename to keyboards/lyso1/lck75/lck75.c diff --git a/keyboards/lck75/lck75.h b/keyboards/lyso1/lck75/lck75.h similarity index 100% rename from keyboards/lck75/lck75.h rename to keyboards/lyso1/lck75/lck75.h diff --git a/keyboards/lck75/readme.md b/keyboards/lyso1/lck75/readme.md similarity index 90% rename from keyboards/lck75/readme.md rename to keyboards/lyso1/lck75/readme.md index 2ded56ebd2e6..bb3dd2626aa3 100644 --- a/keyboards/lck75/readme.md +++ b/keyboards/lyso1/lck75/readme.md @@ -8,10 +8,10 @@ A 75% keyboard that can be assembled with only through hole components, includin Make example for this keyboard (after setting up your build environment): - make lck75:default + make lyso1/lck75:default Flashing example for this keyboard: - make lck75:default:flash + make lyso1/lck75: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/lck75/rules.mk b/keyboards/lyso1/lck75/rules.mk similarity index 100% rename from keyboards/lck75/rules.mk rename to keyboards/lyso1/lck75/rules.mk diff --git a/keyboards/lefishe/config.h b/keyboards/lyso1/lefishe/config.h similarity index 100% rename from keyboards/lefishe/config.h rename to keyboards/lyso1/lefishe/config.h diff --git a/keyboards/lefishe/info.json b/keyboards/lyso1/lefishe/info.json similarity index 100% rename from keyboards/lefishe/info.json rename to keyboards/lyso1/lefishe/info.json diff --git a/keyboards/lefishe/keymaps/default/keymap.c b/keyboards/lyso1/lefishe/keymaps/default/keymap.c similarity index 100% rename from keyboards/lefishe/keymaps/default/keymap.c rename to keyboards/lyso1/lefishe/keymaps/default/keymap.c diff --git a/keyboards/lefishe/keymaps/wk_sbs/keymap.c b/keyboards/lyso1/lefishe/keymaps/wk_sbs/keymap.c similarity index 100% rename from keyboards/lefishe/keymaps/wk_sbs/keymap.c rename to keyboards/lyso1/lefishe/keymaps/wk_sbs/keymap.c diff --git a/keyboards/lefishe/keymaps/wkl/keymap.c b/keyboards/lyso1/lefishe/keymaps/wkl/keymap.c similarity index 100% rename from keyboards/lefishe/keymaps/wkl/keymap.c rename to keyboards/lyso1/lefishe/keymaps/wkl/keymap.c diff --git a/keyboards/lefishe/keymaps/wkl_sbs/keymap.c b/keyboards/lyso1/lefishe/keymaps/wkl_sbs/keymap.c similarity index 100% rename from keyboards/lefishe/keymaps/wkl_sbs/keymap.c rename to keyboards/lyso1/lefishe/keymaps/wkl_sbs/keymap.c diff --git a/keyboards/lefishe/lefishe.c b/keyboards/lyso1/lefishe/lefishe.c similarity index 100% rename from keyboards/lefishe/lefishe.c rename to keyboards/lyso1/lefishe/lefishe.c diff --git a/keyboards/lefishe/lefishe.h b/keyboards/lyso1/lefishe/lefishe.h similarity index 100% rename from keyboards/lefishe/lefishe.h rename to keyboards/lyso1/lefishe/lefishe.h diff --git a/keyboards/lefishe/readme.md b/keyboards/lyso1/lefishe/readme.md similarity index 94% rename from keyboards/lefishe/readme.md rename to keyboards/lyso1/lefishe/readme.md index ae6ab1322e98..eb8322b2df05 100644 --- a/keyboards/lefishe/readme.md +++ b/keyboards/lyso1/lefishe/readme.md @@ -9,7 +9,7 @@ This pcb cab also be used as a replacement pcb for the revoKmini/kmacmini with s Make example for this keyboard (after setting up your build environment): - make lefishe:default + make lyso1/lefishe:default Enter into the bootloader to flash new firmware in 3 ways: @@ -19,6 +19,6 @@ Enter into the bootloader to flash new firmware in 3 ways: Flashing example for this keyboard: - make lefishe:default:flash + make lyso1/lefishe: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/lefishe/rules.mk b/keyboards/lyso1/lefishe/rules.mk similarity index 100% rename from keyboards/lefishe/rules.mk rename to keyboards/lyso1/lefishe/rules.mk diff --git a/keyboards/6ball/6ball.c b/keyboards/maple_computing/6ball/6ball.c similarity index 100% rename from keyboards/6ball/6ball.c rename to keyboards/maple_computing/6ball/6ball.c diff --git a/keyboards/6ball/6ball.h b/keyboards/maple_computing/6ball/6ball.h similarity index 100% rename from keyboards/6ball/6ball.h rename to keyboards/maple_computing/6ball/6ball.h diff --git a/keyboards/6ball/config.h b/keyboards/maple_computing/6ball/config.h similarity index 100% rename from keyboards/6ball/config.h rename to keyboards/maple_computing/6ball/config.h diff --git a/keyboards/6ball/info.json b/keyboards/maple_computing/6ball/info.json similarity index 100% rename from keyboards/6ball/info.json rename to keyboards/maple_computing/6ball/info.json diff --git a/keyboards/6ball/keymaps/default/keymap.c b/keyboards/maple_computing/6ball/keymaps/default/keymap.c similarity index 100% rename from keyboards/6ball/keymaps/default/keymap.c rename to keyboards/maple_computing/6ball/keymaps/default/keymap.c diff --git a/keyboards/6ball/readme.md b/keyboards/maple_computing/6ball/readme.md similarity index 91% rename from keyboards/6ball/readme.md rename to keyboards/maple_computing/6ball/readme.md index c9548453a939..0b91c8aa28f4 100644 --- a/keyboards/6ball/readme.md +++ b/keyboards/maple_computing/6ball/readme.md @@ -9,6 +9,6 @@ Hardware Availability: ThatCanadian Make example for this keyboard (after setting up your build environment): - make 6ball:default + make maple_computing/6ball:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/6ball/rules.mk b/keyboards/maple_computing/6ball/rules.mk similarity index 100% rename from keyboards/6ball/rules.mk rename to keyboards/maple_computing/6ball/rules.mk diff --git a/keyboards/c39/c39.c b/keyboards/maple_computing/c39/c39.c similarity index 100% rename from keyboards/c39/c39.c rename to keyboards/maple_computing/c39/c39.c diff --git a/keyboards/c39/c39.h b/keyboards/maple_computing/c39/c39.h similarity index 100% rename from keyboards/c39/c39.h rename to keyboards/maple_computing/c39/c39.h diff --git a/keyboards/c39/config.h b/keyboards/maple_computing/c39/config.h similarity index 100% rename from keyboards/c39/config.h rename to keyboards/maple_computing/c39/config.h diff --git a/keyboards/c39/info.json b/keyboards/maple_computing/c39/info.json similarity index 100% rename from keyboards/c39/info.json rename to keyboards/maple_computing/c39/info.json diff --git a/keyboards/c39/keymaps/default/keymap.c b/keyboards/maple_computing/c39/keymaps/default/keymap.c similarity index 100% rename from keyboards/c39/keymaps/default/keymap.c rename to keyboards/maple_computing/c39/keymaps/default/keymap.c diff --git a/keyboards/c39/keymaps/default/readme.md b/keyboards/maple_computing/c39/keymaps/default/readme.md similarity index 100% rename from keyboards/c39/keymaps/default/readme.md rename to keyboards/maple_computing/c39/keymaps/default/readme.md diff --git a/keyboards/c39/keymaps/drashna/config.h b/keyboards/maple_computing/c39/keymaps/drashna/config.h similarity index 100% rename from keyboards/c39/keymaps/drashna/config.h rename to keyboards/maple_computing/c39/keymaps/drashna/config.h diff --git a/keyboards/c39/keymaps/drashna/keymap.c b/keyboards/maple_computing/c39/keymaps/drashna/keymap.c similarity index 100% rename from keyboards/c39/keymaps/drashna/keymap.c rename to keyboards/maple_computing/c39/keymaps/drashna/keymap.c diff --git a/keyboards/c39/keymaps/drashna/readme.md b/keyboards/maple_computing/c39/keymaps/drashna/readme.md similarity index 100% rename from keyboards/c39/keymaps/drashna/readme.md rename to keyboards/maple_computing/c39/keymaps/drashna/readme.md diff --git a/keyboards/c39/keymaps/drashna/rules.mk b/keyboards/maple_computing/c39/keymaps/drashna/rules.mk similarity index 100% rename from keyboards/c39/keymaps/drashna/rules.mk rename to keyboards/maple_computing/c39/keymaps/drashna/rules.mk diff --git a/keyboards/c39/keymaps/kuchosauronad0/config.h b/keyboards/maple_computing/c39/keymaps/kuchosauronad0/config.h similarity index 100% rename from keyboards/c39/keymaps/kuchosauronad0/config.h rename to keyboards/maple_computing/c39/keymaps/kuchosauronad0/config.h diff --git a/keyboards/c39/keymaps/kuchosauronad0/keymap.c b/keyboards/maple_computing/c39/keymaps/kuchosauronad0/keymap.c similarity index 100% rename from keyboards/c39/keymaps/kuchosauronad0/keymap.c rename to keyboards/maple_computing/c39/keymaps/kuchosauronad0/keymap.c diff --git a/keyboards/c39/keymaps/kuchosauronad0/readme.md b/keyboards/maple_computing/c39/keymaps/kuchosauronad0/readme.md similarity index 100% rename from keyboards/c39/keymaps/kuchosauronad0/readme.md rename to keyboards/maple_computing/c39/keymaps/kuchosauronad0/readme.md diff --git a/keyboards/c39/keymaps/kuchosauronad0/rules.mk b/keyboards/maple_computing/c39/keymaps/kuchosauronad0/rules.mk similarity index 100% rename from keyboards/c39/keymaps/kuchosauronad0/rules.mk rename to keyboards/maple_computing/c39/keymaps/kuchosauronad0/rules.mk diff --git a/keyboards/c39/readme.md b/keyboards/maple_computing/c39/readme.md similarity index 93% rename from keyboards/c39/readme.md rename to keyboards/maple_computing/c39/readme.md index 0454f1c12b02..c74294e30089 100755 --- a/keyboards/c39/readme.md +++ b/keyboards/maple_computing/c39/readme.md @@ -11,6 +11,6 @@ Hardware Availability: [SpaceCat.design](https://spacecat.design) Make example for this keyboard (after setting up your build environment): - make c39:default + make maple_computing/c39: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/c39/rules.mk b/keyboards/maple_computing/c39/rules.mk similarity index 100% rename from keyboards/c39/rules.mk rename to keyboards/maple_computing/c39/rules.mk diff --git a/keyboards/cu75/.noci b/keyboards/maple_computing/christmas_tree/.noci similarity index 100% rename from keyboards/cu75/.noci rename to keyboards/maple_computing/christmas_tree/.noci diff --git a/keyboards/christmas_tree/V2017/V2017.c b/keyboards/maple_computing/christmas_tree/V2017/V2017.c similarity index 100% rename from keyboards/christmas_tree/V2017/V2017.c rename to keyboards/maple_computing/christmas_tree/V2017/V2017.c diff --git a/keyboards/christmas_tree/V2017/V2017.h b/keyboards/maple_computing/christmas_tree/V2017/V2017.h similarity index 100% rename from keyboards/christmas_tree/V2017/V2017.h rename to keyboards/maple_computing/christmas_tree/V2017/V2017.h diff --git a/keyboards/christmas_tree/V2017/config.h b/keyboards/maple_computing/christmas_tree/V2017/config.h similarity index 100% rename from keyboards/christmas_tree/V2017/config.h rename to keyboards/maple_computing/christmas_tree/V2017/config.h diff --git a/keyboards/christmas_tree/V2017/rules.mk b/keyboards/maple_computing/christmas_tree/V2017/rules.mk similarity index 100% rename from keyboards/christmas_tree/V2017/rules.mk rename to keyboards/maple_computing/christmas_tree/V2017/rules.mk diff --git a/keyboards/christmas_tree/christmas_tree.c b/keyboards/maple_computing/christmas_tree/christmas_tree.c similarity index 100% rename from keyboards/christmas_tree/christmas_tree.c rename to keyboards/maple_computing/christmas_tree/christmas_tree.c diff --git a/keyboards/christmas_tree/christmas_tree.h b/keyboards/maple_computing/christmas_tree/christmas_tree.h similarity index 100% rename from keyboards/christmas_tree/christmas_tree.h rename to keyboards/maple_computing/christmas_tree/christmas_tree.h diff --git a/keyboards/christmas_tree/config.h b/keyboards/maple_computing/christmas_tree/config.h similarity index 100% rename from keyboards/christmas_tree/config.h rename to keyboards/maple_computing/christmas_tree/config.h diff --git a/keyboards/christmas_tree/info.json b/keyboards/maple_computing/christmas_tree/info.json similarity index 100% rename from keyboards/christmas_tree/info.json rename to keyboards/maple_computing/christmas_tree/info.json diff --git a/keyboards/christmas_tree/keymaps/default/keymap.c b/keyboards/maple_computing/christmas_tree/keymaps/default/keymap.c similarity index 100% rename from keyboards/christmas_tree/keymaps/default/keymap.c rename to keyboards/maple_computing/christmas_tree/keymaps/default/keymap.c diff --git a/keyboards/christmas_tree/keymaps/default/readme.md b/keyboards/maple_computing/christmas_tree/keymaps/default/readme.md similarity index 100% rename from keyboards/christmas_tree/keymaps/default/readme.md rename to keyboards/maple_computing/christmas_tree/keymaps/default/readme.md diff --git a/keyboards/christmas_tree/readme.md b/keyboards/maple_computing/christmas_tree/readme.md similarity index 80% rename from keyboards/christmas_tree/readme.md rename to keyboards/maple_computing/christmas_tree/readme.md index b3337dd5ba6a..3ba255a18c57 100644 --- a/keyboards/christmas_tree/readme.md +++ b/keyboards/maple_computing/christmas_tree/readme.md @@ -9,6 +9,6 @@ Keyboard Maintainer: [That-Canadian](https://github.com/That-Canadian) Make example for this keyboard (after setting up your build environment): - make christmas_tree/V2017:default + make maple_computing/christmas_tree/V2017:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/christmas_tree/rules.mk b/keyboards/maple_computing/christmas_tree/rules.mk similarity index 92% rename from keyboards/christmas_tree/rules.mk rename to keyboards/maple_computing/christmas_tree/rules.mk index dada70c309d0..45ac8831638c 100644 --- a/keyboards/christmas_tree/rules.mk +++ b/keyboards/maple_computing/christmas_tree/rules.mk @@ -17,4 +17,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -DEFAULT_FOLDER = christmas_tree/V2017 +DEFAULT_FOLDER = maple_computing/christmas_tree/V2017 diff --git a/keyboards/ergo42/.noci b/keyboards/maple_computing/ivy/.noci similarity index 100% rename from keyboards/ergo42/.noci rename to keyboards/maple_computing/ivy/.noci diff --git a/keyboards/ivy/config.h b/keyboards/maple_computing/ivy/config.h similarity index 100% rename from keyboards/ivy/config.h rename to keyboards/maple_computing/ivy/config.h diff --git a/keyboards/ivy/ivy.c b/keyboards/maple_computing/ivy/ivy.c similarity index 100% rename from keyboards/ivy/ivy.c rename to keyboards/maple_computing/ivy/ivy.c diff --git a/keyboards/ivy/ivy.h b/keyboards/maple_computing/ivy/ivy.h similarity index 61% rename from keyboards/ivy/ivy.h rename to keyboards/maple_computing/ivy/ivy.h index 2cba5f495627..645c5e0ef784 100644 --- a/keyboards/ivy/ivy.h +++ b/keyboards/maple_computing/ivy/ivy.h @@ -1,6 +1,6 @@ #pragma once -#ifdef KEYBOARD_ivy_rev1 +#ifdef KEYBOARD_maple_computing_ivy_rev1 #include "rev1.h" #endif diff --git a/keyboards/ivy/keymaps/default/keymap.c b/keyboards/maple_computing/ivy/keymaps/default/keymap.c similarity index 100% rename from keyboards/ivy/keymaps/default/keymap.c rename to keyboards/maple_computing/ivy/keymaps/default/keymap.c diff --git a/keyboards/ivy/readme.md b/keyboards/maple_computing/ivy/readme.md similarity index 82% rename from keyboards/ivy/readme.md rename to keyboards/maple_computing/ivy/readme.md index f70630b52b25..a3bc043b772b 100644 --- a/keyboards/ivy/readme.md +++ b/keyboards/maple_computing/ivy/readme.md @@ -5,11 +5,11 @@ IVY Make example for this keyboard (after setting up your build environment): - make ivy/rev1:default + make maple_computing/ivy/rev1:default Install examples: - make ivy/rev1:default:dfu + make maple_computing/ivy/rev1:default:dfu 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/ivy/rev1/config.h b/keyboards/maple_computing/ivy/rev1/config.h similarity index 100% rename from keyboards/ivy/rev1/config.h rename to keyboards/maple_computing/ivy/rev1/config.h diff --git a/keyboards/ivy/rev1/info.json b/keyboards/maple_computing/ivy/rev1/info.json similarity index 100% rename from keyboards/ivy/rev1/info.json rename to keyboards/maple_computing/ivy/rev1/info.json diff --git a/keyboards/ivy/rev1/rev1.c b/keyboards/maple_computing/ivy/rev1/rev1.c similarity index 100% rename from keyboards/ivy/rev1/rev1.c rename to keyboards/maple_computing/ivy/rev1/rev1.c diff --git a/keyboards/ivy/rev1/rev1.h b/keyboards/maple_computing/ivy/rev1/rev1.h similarity index 100% rename from keyboards/ivy/rev1/rev1.h rename to keyboards/maple_computing/ivy/rev1/rev1.h diff --git a/keyboards/lets_split_eh/keymaps/mikethetiger/rules.mk b/keyboards/maple_computing/ivy/rev1/rules.mk similarity index 100% rename from keyboards/lets_split_eh/keymaps/mikethetiger/rules.mk rename to keyboards/maple_computing/ivy/rev1/rules.mk diff --git a/keyboards/ivy/rules.mk b/keyboards/maple_computing/ivy/rules.mk similarity index 93% rename from keyboards/ivy/rules.mk rename to keyboards/maple_computing/ivy/rules.mk index 66812904cde6..c076565dfc09 100644 --- a/keyboards/ivy/rules.mk +++ b/keyboards/maple_computing/ivy/rules.mk @@ -17,4 +17,4 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -DEFAULT_FOLDER = ivy/rev1 +DEFAULT_FOLDER = maple_computing/ivy/rev1 diff --git a/keyboards/jnao/config.h b/keyboards/maple_computing/jnao/config.h similarity index 100% rename from keyboards/jnao/config.h rename to keyboards/maple_computing/jnao/config.h diff --git a/keyboards/jnao/info.json b/keyboards/maple_computing/jnao/info.json similarity index 100% rename from keyboards/jnao/info.json rename to keyboards/maple_computing/jnao/info.json diff --git a/keyboards/jnao/jnao.c b/keyboards/maple_computing/jnao/jnao.c similarity index 100% rename from keyboards/jnao/jnao.c rename to keyboards/maple_computing/jnao/jnao.c diff --git a/keyboards/jnao/jnao.h b/keyboards/maple_computing/jnao/jnao.h similarity index 100% rename from keyboards/jnao/jnao.h rename to keyboards/maple_computing/jnao/jnao.h diff --git a/keyboards/jnao/keymaps/default/keymap.c b/keyboards/maple_computing/jnao/keymaps/default/keymap.c similarity index 100% rename from keyboards/jnao/keymaps/default/keymap.c rename to keyboards/maple_computing/jnao/keymaps/default/keymap.c diff --git a/keyboards/jnao/keymaps/default_4x12/keymap.c b/keyboards/maple_computing/jnao/keymaps/default_4x12/keymap.c similarity index 100% rename from keyboards/jnao/keymaps/default_4x12/keymap.c rename to keyboards/maple_computing/jnao/keymaps/default_4x12/keymap.c diff --git a/keyboards/jnao/keymaps/via/keymap.c b/keyboards/maple_computing/jnao/keymaps/via/keymap.c similarity index 100% rename from keyboards/jnao/keymaps/via/keymap.c rename to keyboards/maple_computing/jnao/keymaps/via/keymap.c diff --git a/keyboards/jisplit89/keymaps/via/rules.mk b/keyboards/maple_computing/jnao/keymaps/via/rules.mk similarity index 100% rename from keyboards/jisplit89/keymaps/via/rules.mk rename to keyboards/maple_computing/jnao/keymaps/via/rules.mk diff --git a/keyboards/jnao/readme.md b/keyboards/maple_computing/jnao/readme.md similarity index 94% rename from keyboards/jnao/readme.md rename to keyboards/maple_computing/jnao/readme.md index 08cf10acaa64..dd7b280a0879 100644 --- a/keyboards/jnao/readme.md +++ b/keyboards/maple_computing/jnao/readme.md @@ -9,6 +9,6 @@ Hardware Availability: [SpaceCat](https://spacecat.design) and [Keebio](https:// Make example for this keyboard (after setting up your build environment): - make jnao:default + make maple_computing/jnao: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/jnao/rules.mk b/keyboards/maple_computing/jnao/rules.mk similarity index 100% rename from keyboards/jnao/rules.mk rename to keyboards/maple_computing/jnao/rules.mk diff --git a/keyboards/ergodash/.noci b/keyboards/maple_computing/launchpad/.noci similarity index 100% rename from keyboards/ergodash/.noci rename to keyboards/maple_computing/launchpad/.noci diff --git a/keyboards/launchpad/config.h b/keyboards/maple_computing/launchpad/config.h similarity index 100% rename from keyboards/launchpad/config.h rename to keyboards/maple_computing/launchpad/config.h diff --git a/keyboards/launchpad/keymaps/brandonschlack/config.h b/keyboards/maple_computing/launchpad/keymaps/brandonschlack/config.h similarity index 100% rename from keyboards/launchpad/keymaps/brandonschlack/config.h rename to keyboards/maple_computing/launchpad/keymaps/brandonschlack/config.h diff --git a/keyboards/launchpad/keymaps/brandonschlack/keymap.c b/keyboards/maple_computing/launchpad/keymaps/brandonschlack/keymap.c similarity index 100% rename from keyboards/launchpad/keymaps/brandonschlack/keymap.c rename to keyboards/maple_computing/launchpad/keymaps/brandonschlack/keymap.c diff --git a/keyboards/launchpad/keymaps/brandonschlack/readme.md b/keyboards/maple_computing/launchpad/keymaps/brandonschlack/readme.md similarity index 100% rename from keyboards/launchpad/keymaps/brandonschlack/readme.md rename to keyboards/maple_computing/launchpad/keymaps/brandonschlack/readme.md diff --git a/keyboards/launchpad/keymaps/brandonschlack/rules.mk b/keyboards/maple_computing/launchpad/keymaps/brandonschlack/rules.mk similarity index 100% rename from keyboards/launchpad/keymaps/brandonschlack/rules.mk rename to keyboards/maple_computing/launchpad/keymaps/brandonschlack/rules.mk diff --git a/keyboards/launchpad/keymaps/default/keymap.c b/keyboards/maple_computing/launchpad/keymaps/default/keymap.c similarity index 100% rename from keyboards/launchpad/keymaps/default/keymap.c rename to keyboards/maple_computing/launchpad/keymaps/default/keymap.c diff --git a/keyboards/launchpad/keymaps/default_rgb/config.h b/keyboards/maple_computing/launchpad/keymaps/default_rgb/config.h similarity index 100% rename from keyboards/launchpad/keymaps/default_rgb/config.h rename to keyboards/maple_computing/launchpad/keymaps/default_rgb/config.h diff --git a/keyboards/launchpad/keymaps/default_rgb/keymap.c b/keyboards/maple_computing/launchpad/keymaps/default_rgb/keymap.c similarity index 100% rename from keyboards/launchpad/keymaps/default_rgb/keymap.c rename to keyboards/maple_computing/launchpad/keymaps/default_rgb/keymap.c diff --git a/keyboards/launchpad/keymaps/default_rgb/readme.md b/keyboards/maple_computing/launchpad/keymaps/default_rgb/readme.md similarity index 100% rename from keyboards/launchpad/keymaps/default_rgb/readme.md rename to keyboards/maple_computing/launchpad/keymaps/default_rgb/readme.md diff --git a/keyboards/reviung39/keymaps/default/rules.mk b/keyboards/maple_computing/launchpad/keymaps/default_rgb/rules.mk similarity index 100% rename from keyboards/reviung39/keymaps/default/rules.mk rename to keyboards/maple_computing/launchpad/keymaps/default_rgb/rules.mk diff --git a/keyboards/launchpad/keymaps/drashna/config.h b/keyboards/maple_computing/launchpad/keymaps/drashna/config.h similarity index 100% rename from keyboards/launchpad/keymaps/drashna/config.h rename to keyboards/maple_computing/launchpad/keymaps/drashna/config.h diff --git a/keyboards/launchpad/keymaps/drashna/keymap.c b/keyboards/maple_computing/launchpad/keymaps/drashna/keymap.c similarity index 100% rename from keyboards/launchpad/keymaps/drashna/keymap.c rename to keyboards/maple_computing/launchpad/keymaps/drashna/keymap.c diff --git a/keyboards/launchpad/keymaps/drashna/rules.mk b/keyboards/maple_computing/launchpad/keymaps/drashna/rules.mk similarity index 100% rename from keyboards/launchpad/keymaps/drashna/rules.mk rename to keyboards/maple_computing/launchpad/keymaps/drashna/rules.mk diff --git a/keyboards/launchpad/keymaps/via/keymap.c b/keyboards/maple_computing/launchpad/keymaps/via/keymap.c similarity index 100% rename from keyboards/launchpad/keymaps/via/keymap.c rename to keyboards/maple_computing/launchpad/keymaps/via/keymap.c diff --git a/keyboards/launchpad/keymaps/via/rules.mk b/keyboards/maple_computing/launchpad/keymaps/via/rules.mk similarity index 100% rename from keyboards/launchpad/keymaps/via/rules.mk rename to keyboards/maple_computing/launchpad/keymaps/via/rules.mk diff --git a/keyboards/launchpad/launchpad.c b/keyboards/maple_computing/launchpad/launchpad.c similarity index 100% rename from keyboards/launchpad/launchpad.c rename to keyboards/maple_computing/launchpad/launchpad.c diff --git a/keyboards/launchpad/launchpad.h b/keyboards/maple_computing/launchpad/launchpad.h similarity index 55% rename from keyboards/launchpad/launchpad.h rename to keyboards/maple_computing/launchpad/launchpad.h index 59cf64afecc1..f2a1b4058833 100644 --- a/keyboards/launchpad/launchpad.h +++ b/keyboards/maple_computing/launchpad/launchpad.h @@ -1,6 +1,6 @@ #pragma once -#if defined(KEYBOARD_launchpad_rev1) +#if defined(KEYBOARD_maple_computing_launchpad_rev1) # include "rev1.h" #endif diff --git a/keyboards/launchpad/readme.md b/keyboards/maple_computing/launchpad/readme.md similarity index 94% rename from keyboards/launchpad/readme.md rename to keyboards/maple_computing/launchpad/readme.md index 81281219467e..1dc7a9b4cff5 100644 --- a/keyboards/launchpad/readme.md +++ b/keyboards/maple_computing/launchpad/readme.md @@ -21,7 +21,7 @@ A fantastic project for beginners to learn to solder, veteran's of the hobby who Make example for this keyboard (after setting up your build environment): - make launchpad/rev1:default + make maple_computing/launchpad/rev1:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. @@ -29,4 +29,4 @@ See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) Due to PCB tolerance issues outside of our control, the snap-apart legs included on the PCB may need extra padding to prevent a small amount of wobbling once placed properly. We have included small, clear, and semi-permanent "glue dots" in each order (PCB Only -and- Full Kit) to help with this. You may also use plastic wrap, tape, Elmer's glue, hot glue, rubber cement, etc. We advise against using anything more "permanent" in case you wish to make changes to your Launch Pad in the future. It is also best to attach legs after all of your soldering and building is finished, to get the most accurate feel for your Launch Pad. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- \ No newline at end of file +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/keyboards/launchpad/rev1/config.h b/keyboards/maple_computing/launchpad/rev1/config.h similarity index 100% rename from keyboards/launchpad/rev1/config.h rename to keyboards/maple_computing/launchpad/rev1/config.h diff --git a/keyboards/launchpad/rev1/info.json b/keyboards/maple_computing/launchpad/rev1/info.json similarity index 100% rename from keyboards/launchpad/rev1/info.json rename to keyboards/maple_computing/launchpad/rev1/info.json diff --git a/keyboards/launchpad/rev1/rev1.c b/keyboards/maple_computing/launchpad/rev1/rev1.c similarity index 100% rename from keyboards/launchpad/rev1/rev1.c rename to keyboards/maple_computing/launchpad/rev1/rev1.c diff --git a/keyboards/launchpad/rev1/rev1.h b/keyboards/maple_computing/launchpad/rev1/rev1.h similarity index 100% rename from keyboards/launchpad/rev1/rev1.h rename to keyboards/maple_computing/launchpad/rev1/rev1.h diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/rules.mk b/keyboards/maple_computing/launchpad/rev1/rules.mk similarity index 100% rename from keyboards/lets_split_eh/keymaps/that_canadian/rules.mk rename to keyboards/maple_computing/launchpad/rev1/rules.mk diff --git a/keyboards/launchpad/rules.mk b/keyboards/maple_computing/launchpad/rules.mk similarity index 92% rename from keyboards/launchpad/rules.mk rename to keyboards/maple_computing/launchpad/rules.mk index 3bfec5643224..67e76c62447d 100644 --- a/keyboards/launchpad/rules.mk +++ b/keyboards/maple_computing/launchpad/rules.mk @@ -17,4 +17,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -DEFAULT_FOLDER = launchpad/rev1 +DEFAULT_FOLDER = maple_computing/launchpad/rev1 diff --git a/keyboards/ergodash/mini/.noci b/keyboards/maple_computing/lets_split_eh/.noci similarity index 100% rename from keyboards/ergodash/mini/.noci rename to keyboards/maple_computing/lets_split_eh/.noci diff --git a/keyboards/lets_split_eh/config.h b/keyboards/maple_computing/lets_split_eh/config.h similarity index 97% rename from keyboards/lets_split_eh/config.h rename to keyboards/maple_computing/lets_split_eh/config.h index 7527c6b3d2bc..787b9783b8ad 100644 --- a/keyboards/lets_split_eh/config.h +++ b/keyboards/maple_computing/lets_split_eh/config.h @@ -22,7 +22,7 @@ along with this program. If not, see . /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0xE401 -#define DEVICE_VER 0x0E41 +#define DEVICE_VER 0x0100 #define MANUFACTURER That-Canadian #define PRODUCT Lets Split Eh? diff --git a/keyboards/lets_split_eh/eh/config.h b/keyboards/maple_computing/lets_split_eh/eh/config.h similarity index 100% rename from keyboards/lets_split_eh/eh/config.h rename to keyboards/maple_computing/lets_split_eh/eh/config.h diff --git a/keyboards/lets_split_eh/eh/eh.c b/keyboards/maple_computing/lets_split_eh/eh/eh.c similarity index 100% rename from keyboards/lets_split_eh/eh/eh.c rename to keyboards/maple_computing/lets_split_eh/eh/eh.c diff --git a/keyboards/lets_split_eh/eh/eh.h b/keyboards/maple_computing/lets_split_eh/eh/eh.h similarity index 100% rename from keyboards/lets_split_eh/eh/eh.h rename to keyboards/maple_computing/lets_split_eh/eh/eh.h diff --git a/keyboards/lets_split_eh/eh/info.json b/keyboards/maple_computing/lets_split_eh/eh/info.json similarity index 100% rename from keyboards/lets_split_eh/eh/info.json rename to keyboards/maple_computing/lets_split_eh/eh/info.json diff --git a/keyboards/lets_split_eh/eh/rules.mk b/keyboards/maple_computing/lets_split_eh/eh/rules.mk similarity index 100% rename from keyboards/lets_split_eh/eh/rules.mk rename to keyboards/maple_computing/lets_split_eh/eh/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/README.md b/keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/README.md similarity index 100% rename from keyboards/lets_split_eh/keymaps/bbaserdem/README.md rename to keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/README.md diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/config.h b/keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/config.h similarity index 100% rename from keyboards/lets_split_eh/keymaps/bbaserdem/config.h rename to keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/config.h diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/keymap.c diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk b/keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/rules.mk similarity index 100% rename from keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk rename to keyboards/maple_computing/lets_split_eh/keymaps/bbaserdem/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/default/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/default/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/default/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/default/keymap.c diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/config.h b/keyboards/maple_computing/lets_split_eh/keymaps/doxish_dvorak/config.h similarity index 100% rename from keyboards/lets_split_eh/keymaps/doxish_dvorak/config.h rename to keyboards/maple_computing/lets_split_eh/keymaps/doxish_dvorak/config.h diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/doxish_dvorak/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/doxish_dvorak/keymap.c diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/rules.mk b/keyboards/maple_computing/lets_split_eh/keymaps/doxish_dvorak/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_setta21/rules.mk rename to keyboards/maple_computing/lets_split_eh/keymaps/doxish_dvorak/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/mikethetiger/config.h b/keyboards/maple_computing/lets_split_eh/keymaps/mikethetiger/config.h similarity index 100% rename from keyboards/lets_split_eh/keymaps/mikethetiger/config.h rename to keyboards/maple_computing/lets_split_eh/keymaps/mikethetiger/config.h diff --git a/keyboards/lets_split_eh/keymaps/mikethetiger/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/mikethetiger/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/mikethetiger/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/mikethetiger/keymap.c diff --git a/keyboards/naked48/rev1/rules.mk b/keyboards/maple_computing/lets_split_eh/keymaps/mikethetiger/rules.mk similarity index 100% rename from keyboards/naked48/rev1/rules.mk rename to keyboards/maple_computing/lets_split_eh/keymaps/mikethetiger/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/msiu/config.h b/keyboards/maple_computing/lets_split_eh/keymaps/msiu/config.h similarity index 100% rename from keyboards/lets_split_eh/keymaps/msiu/config.h rename to keyboards/maple_computing/lets_split_eh/keymaps/msiu/config.h diff --git a/keyboards/lets_split_eh/keymaps/msiu/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/msiu/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/msiu/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/msiu/keymap.c diff --git a/keyboards/lets_split_eh/keymaps/resfury/config.h b/keyboards/maple_computing/lets_split_eh/keymaps/resfury/config.h similarity index 100% rename from keyboards/lets_split_eh/keymaps/resfury/config.h rename to keyboards/maple_computing/lets_split_eh/keymaps/resfury/config.h diff --git a/keyboards/lets_split_eh/keymaps/resfury/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/resfury/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/resfury/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/resfury/keymap.c diff --git a/keyboards/lets_split_eh/keymaps/resfury/readme.md b/keyboards/maple_computing/lets_split_eh/keymaps/resfury/readme.md similarity index 100% rename from keyboards/lets_split_eh/keymaps/resfury/readme.md rename to keyboards/maple_computing/lets_split_eh/keymaps/resfury/readme.md diff --git a/keyboards/lets_split_eh/keymaps/resfury/rules.mk b/keyboards/maple_computing/lets_split_eh/keymaps/resfury/rules.mk similarity index 100% rename from keyboards/lets_split_eh/keymaps/resfury/rules.mk rename to keyboards/maple_computing/lets_split_eh/keymaps/resfury/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/romus/README.md b/keyboards/maple_computing/lets_split_eh/keymaps/romus/README.md similarity index 100% rename from keyboards/lets_split_eh/keymaps/romus/README.md rename to keyboards/maple_computing/lets_split_eh/keymaps/romus/README.md diff --git a/keyboards/lets_split_eh/keymaps/romus/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/romus/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/romus/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/romus/keymap.c diff --git a/keyboards/lets_split_eh/keymaps/romus/rules.mk b/keyboards/maple_computing/lets_split_eh/keymaps/romus/rules.mk similarity index 100% rename from keyboards/lets_split_eh/keymaps/romus/rules.mk rename to keyboards/maple_computing/lets_split_eh/keymaps/romus/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/config.h b/keyboards/maple_computing/lets_split_eh/keymaps/that_canadian/config.h similarity index 100% rename from keyboards/lets_split_eh/keymaps/that_canadian/config.h rename to keyboards/maple_computing/lets_split_eh/keymaps/that_canadian/config.h diff --git a/keyboards/lets_split_eh/keymaps/that_canadian/keymap.c b/keyboards/maple_computing/lets_split_eh/keymaps/that_canadian/keymap.c similarity index 100% rename from keyboards/lets_split_eh/keymaps/that_canadian/keymap.c rename to keyboards/maple_computing/lets_split_eh/keymaps/that_canadian/keymap.c diff --git a/keyboards/naked60/rev1/rules.mk b/keyboards/maple_computing/lets_split_eh/keymaps/that_canadian/rules.mk similarity index 100% rename from keyboards/naked60/rev1/rules.mk rename to keyboards/maple_computing/lets_split_eh/keymaps/that_canadian/rules.mk diff --git a/keyboards/lets_split_eh/lets_split_eh.c b/keyboards/maple_computing/lets_split_eh/lets_split_eh.c similarity index 100% rename from keyboards/lets_split_eh/lets_split_eh.c rename to keyboards/maple_computing/lets_split_eh/lets_split_eh.c diff --git a/keyboards/lets_split_eh/lets_split_eh.h b/keyboards/maple_computing/lets_split_eh/lets_split_eh.h similarity index 56% rename from keyboards/lets_split_eh/lets_split_eh.h rename to keyboards/maple_computing/lets_split_eh/lets_split_eh.h index aa1f213b2042..aae072e0b695 100644 --- a/keyboards/lets_split_eh/lets_split_eh.h +++ b/keyboards/maple_computing/lets_split_eh/lets_split_eh.h @@ -2,6 +2,6 @@ #include "quantum.h" -#ifdef KEYBOARD_lets_split_eh_eh +#ifdef KEYBOARD_maple_computing_lets_split_eh_eh #include "eh.h" #endif diff --git a/keyboards/lets_split_eh/readme.md b/keyboards/maple_computing/lets_split_eh/readme.md similarity index 85% rename from keyboards/lets_split_eh/readme.md rename to keyboards/maple_computing/lets_split_eh/readme.md index 180cb33d73d0..90ae5393d1c5 100644 --- a/keyboards/lets_split_eh/readme.md +++ b/keyboards/maple_computing/lets_split_eh/readme.md @@ -8,6 +8,6 @@ Keyboard Maintainer: [Christopher Poole (That-Canadian)](https://github.com/That Make example for this keyboard (after setting up your build environment): - make lets_split_eh/eh:default + make maple_computing/lets_split_eh/eh:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/lets_split_eh/rules.mk b/keyboards/maple_computing/lets_split_eh/rules.mk similarity index 92% rename from keyboards/lets_split_eh/rules.mk rename to keyboards/maple_computing/lets_split_eh/rules.mk index 9662dfc60e44..325d4e278cb3 100644 --- a/keyboards/lets_split_eh/rules.mk +++ b/keyboards/maple_computing/lets_split_eh/rules.mk @@ -21,4 +21,4 @@ SPLIT_KEYBOARD = yes LAYOUTS = ortho_4x12 -DEFAULT_FOLDER = lets_split_eh/eh +DEFAULT_FOLDER = maple_computing/lets_split_eh/eh diff --git a/keyboards/ergodash/rev1/.noci b/keyboards/maple_computing/minidox/.noci similarity index 100% rename from keyboards/ergodash/rev1/.noci rename to keyboards/maple_computing/minidox/.noci diff --git a/keyboards/minidox/config.h b/keyboards/maple_computing/minidox/config.h similarity index 100% rename from keyboards/minidox/config.h rename to keyboards/maple_computing/minidox/config.h diff --git a/keyboards/minidox/keymaps/alairock/config.h b/keyboards/maple_computing/minidox/keymaps/alairock/config.h similarity index 100% rename from keyboards/minidox/keymaps/alairock/config.h rename to keyboards/maple_computing/minidox/keymaps/alairock/config.h diff --git a/keyboards/minidox/keymaps/alairock/keymap.c b/keyboards/maple_computing/minidox/keymaps/alairock/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/alairock/keymap.c rename to keyboards/maple_computing/minidox/keymaps/alairock/keymap.c diff --git a/keyboards/minidox/keymaps/alairock/rules.mk b/keyboards/maple_computing/minidox/keymaps/alairock/rules.mk similarity index 100% rename from keyboards/minidox/keymaps/alairock/rules.mk rename to keyboards/maple_computing/minidox/keymaps/alairock/rules.mk diff --git a/keyboards/minidox/keymaps/bepo/config.h b/keyboards/maple_computing/minidox/keymaps/bepo/config.h similarity index 100% rename from keyboards/minidox/keymaps/bepo/config.h rename to keyboards/maple_computing/minidox/keymaps/bepo/config.h diff --git a/keyboards/minidox/keymaps/bepo/keymap.c b/keyboards/maple_computing/minidox/keymaps/bepo/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/bepo/keymap.c rename to keyboards/maple_computing/minidox/keymaps/bepo/keymap.c diff --git a/keyboards/minidox/keymaps/bepo/readme.md b/keyboards/maple_computing/minidox/keymaps/bepo/readme.md similarity index 100% rename from keyboards/minidox/keymaps/bepo/readme.md rename to keyboards/maple_computing/minidox/keymaps/bepo/readme.md diff --git a/keyboards/minidox/keymaps/default/keymap.c b/keyboards/maple_computing/minidox/keymaps/default/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/default/keymap.c rename to keyboards/maple_computing/minidox/keymaps/default/keymap.c diff --git a/keyboards/minidox/keymaps/dustypomerleau/README.md b/keyboards/maple_computing/minidox/keymaps/dustypomerleau/README.md similarity index 100% rename from keyboards/minidox/keymaps/dustypomerleau/README.md rename to keyboards/maple_computing/minidox/keymaps/dustypomerleau/README.md diff --git a/keyboards/minidox/keymaps/dustypomerleau/config.h b/keyboards/maple_computing/minidox/keymaps/dustypomerleau/config.h similarity index 100% rename from keyboards/minidox/keymaps/dustypomerleau/config.h rename to keyboards/maple_computing/minidox/keymaps/dustypomerleau/config.h diff --git a/keyboards/minidox/keymaps/dustypomerleau/keymap.c b/keyboards/maple_computing/minidox/keymaps/dustypomerleau/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/dustypomerleau/keymap.c rename to keyboards/maple_computing/minidox/keymaps/dustypomerleau/keymap.c diff --git a/keyboards/minidox/keymaps/dustypomerleau/rules.mk b/keyboards/maple_computing/minidox/keymaps/dustypomerleau/rules.mk similarity index 100% rename from keyboards/minidox/keymaps/dustypomerleau/rules.mk rename to keyboards/maple_computing/minidox/keymaps/dustypomerleau/rules.mk diff --git a/keyboards/minidox/keymaps/haegin/keymap.c b/keyboards/maple_computing/minidox/keymaps/haegin/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/haegin/keymap.c rename to keyboards/maple_computing/minidox/keymaps/haegin/keymap.c diff --git a/keyboards/minidox/keymaps/khitsule/config.h b/keyboards/maple_computing/minidox/keymaps/khitsule/config.h similarity index 100% rename from keyboards/minidox/keymaps/khitsule/config.h rename to keyboards/maple_computing/minidox/keymaps/khitsule/config.h diff --git a/keyboards/minidox/keymaps/khitsule/keymap.c b/keyboards/maple_computing/minidox/keymaps/khitsule/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/khitsule/keymap.c rename to keyboards/maple_computing/minidox/keymaps/khitsule/keymap.c diff --git a/keyboards/minidox/keymaps/khitsule/readme.md b/keyboards/maple_computing/minidox/keymaps/khitsule/readme.md similarity index 100% rename from keyboards/minidox/keymaps/khitsule/readme.md rename to keyboards/maple_computing/minidox/keymaps/khitsule/readme.md diff --git a/keyboards/minidox/keymaps/norman/config.h b/keyboards/maple_computing/minidox/keymaps/norman/config.h similarity index 100% rename from keyboards/minidox/keymaps/norman/config.h rename to keyboards/maple_computing/minidox/keymaps/norman/config.h diff --git a/keyboards/minidox/keymaps/norman/keymap.c b/keyboards/maple_computing/minidox/keymaps/norman/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/norman/keymap.c rename to keyboards/maple_computing/minidox/keymaps/norman/keymap.c diff --git a/keyboards/minidox/keymaps/norman/readme.md b/keyboards/maple_computing/minidox/keymaps/norman/readme.md similarity index 100% rename from keyboards/minidox/keymaps/norman/readme.md rename to keyboards/maple_computing/minidox/keymaps/norman/readme.md diff --git a/keyboards/minidox/keymaps/rsthd_combos/config.h b/keyboards/maple_computing/minidox/keymaps/rsthd_combos/config.h similarity index 100% rename from keyboards/minidox/keymaps/rsthd_combos/config.h rename to keyboards/maple_computing/minidox/keymaps/rsthd_combos/config.h diff --git a/keyboards/minidox/keymaps/rsthd_combos/keymap.c b/keyboards/maple_computing/minidox/keymaps/rsthd_combos/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/rsthd_combos/keymap.c rename to keyboards/maple_computing/minidox/keymaps/rsthd_combos/keymap.c diff --git a/keyboards/minidox/keymaps/rsthd_combos/readme.md b/keyboards/maple_computing/minidox/keymaps/rsthd_combos/readme.md similarity index 100% rename from keyboards/minidox/keymaps/rsthd_combos/readme.md rename to keyboards/maple_computing/minidox/keymaps/rsthd_combos/readme.md diff --git a/keyboards/qaz/keymaps/default_big_space/rules.mk b/keyboards/maple_computing/minidox/keymaps/rsthd_combos/rules.mk similarity index 100% rename from keyboards/qaz/keymaps/default_big_space/rules.mk rename to keyboards/maple_computing/minidox/keymaps/rsthd_combos/rules.mk diff --git a/keyboards/minidox/keymaps/that_canadian/config.h b/keyboards/maple_computing/minidox/keymaps/that_canadian/config.h similarity index 100% rename from keyboards/minidox/keymaps/that_canadian/config.h rename to keyboards/maple_computing/minidox/keymaps/that_canadian/config.h diff --git a/keyboards/minidox/keymaps/that_canadian/keymap.c b/keyboards/maple_computing/minidox/keymaps/that_canadian/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/that_canadian/keymap.c rename to keyboards/maple_computing/minidox/keymaps/that_canadian/keymap.c diff --git a/keyboards/minidox/keymaps/that_canadian/rules.mk b/keyboards/maple_computing/minidox/keymaps/that_canadian/rules.mk similarity index 100% rename from keyboards/minidox/keymaps/that_canadian/rules.mk rename to keyboards/maple_computing/minidox/keymaps/that_canadian/rules.mk diff --git a/keyboards/minidox/keymaps/tomb0y/README.md b/keyboards/maple_computing/minidox/keymaps/tomb0y/README.md similarity index 100% rename from keyboards/minidox/keymaps/tomb0y/README.md rename to keyboards/maple_computing/minidox/keymaps/tomb0y/README.md diff --git a/keyboards/minidox/keymaps/tomb0y/keymap.c b/keyboards/maple_computing/minidox/keymaps/tomb0y/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/tomb0y/keymap.c rename to keyboards/maple_computing/minidox/keymaps/tomb0y/keymap.c diff --git a/keyboards/minidox/keymaps/tw1t611/keymap.c b/keyboards/maple_computing/minidox/keymaps/tw1t611/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/tw1t611/keymap.c rename to keyboards/maple_computing/minidox/keymaps/tw1t611/keymap.c diff --git a/keyboards/minidox/keymaps/tw1t611/readme.md b/keyboards/maple_computing/minidox/keymaps/tw1t611/readme.md similarity index 100% rename from keyboards/minidox/keymaps/tw1t611/readme.md rename to keyboards/maple_computing/minidox/keymaps/tw1t611/readme.md diff --git a/keyboards/minidox/keymaps/tw1t611/rules.mk b/keyboards/maple_computing/minidox/keymaps/tw1t611/rules.mk similarity index 100% rename from keyboards/minidox/keymaps/tw1t611/rules.mk rename to keyboards/maple_computing/minidox/keymaps/tw1t611/rules.mk diff --git a/keyboards/minidox/keymaps/xyverz/config.h b/keyboards/maple_computing/minidox/keymaps/xyverz/config.h similarity index 100% rename from keyboards/minidox/keymaps/xyverz/config.h rename to keyboards/maple_computing/minidox/keymaps/xyverz/config.h diff --git a/keyboards/minidox/keymaps/xyverz/keymap.c b/keyboards/maple_computing/minidox/keymaps/xyverz/keymap.c similarity index 100% rename from keyboards/minidox/keymaps/xyverz/keymap.c rename to keyboards/maple_computing/minidox/keymaps/xyverz/keymap.c diff --git a/keyboards/minidox/keymaps/xyverz/rules.mk b/keyboards/maple_computing/minidox/keymaps/xyverz/rules.mk similarity index 100% rename from keyboards/minidox/keymaps/xyverz/rules.mk rename to keyboards/maple_computing/minidox/keymaps/xyverz/rules.mk diff --git a/keyboards/minidox/minidox.c b/keyboards/maple_computing/minidox/minidox.c similarity index 100% rename from keyboards/minidox/minidox.c rename to keyboards/maple_computing/minidox/minidox.c diff --git a/keyboards/minidox/minidox.h b/keyboards/maple_computing/minidox/minidox.h similarity index 59% rename from keyboards/minidox/minidox.h rename to keyboards/maple_computing/minidox/minidox.h index 5d5ca9f5019e..bae36b55606b 100644 --- a/keyboards/minidox/minidox.h +++ b/keyboards/maple_computing/minidox/minidox.h @@ -1,6 +1,6 @@ #pragma once -#ifdef KEYBOARD_minidox_rev1 +#ifdef KEYBOARD_maple_computing_minidox_rev1 #include "rev1.h" #endif diff --git a/keyboards/minidox/readme.md b/keyboards/maple_computing/minidox/readme.md similarity index 92% rename from keyboards/minidox/readme.md rename to keyboards/maple_computing/minidox/readme.md index ec52e1f75793..934985348c3c 100644 --- a/keyboards/minidox/readme.md +++ b/keyboards/maple_computing/minidox/readme.md @@ -9,11 +9,11 @@ A compact version of the ErgoDox Make example for this keyboard (after setting up your build environment): - make minidox/rev1:default + make maple_computing/minidox/rev1:default Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): - make minidox/rev1:default:flash + make maple_computing/minidox/rev1:default:flash See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/minidox/rev1/config.h b/keyboards/maple_computing/minidox/rev1/config.h similarity index 100% rename from keyboards/minidox/rev1/config.h rename to keyboards/maple_computing/minidox/rev1/config.h diff --git a/keyboards/minidox/rev1/info.json b/keyboards/maple_computing/minidox/rev1/info.json similarity index 100% rename from keyboards/minidox/rev1/info.json rename to keyboards/maple_computing/minidox/rev1/info.json diff --git a/keyboards/minidox/rev1/rev1.c b/keyboards/maple_computing/minidox/rev1/rev1.c similarity index 100% rename from keyboards/minidox/rev1/rev1.c rename to keyboards/maple_computing/minidox/rev1/rev1.c diff --git a/keyboards/minidox/rev1/rev1.h b/keyboards/maple_computing/minidox/rev1/rev1.h similarity index 100% rename from keyboards/minidox/rev1/rev1.h rename to keyboards/maple_computing/minidox/rev1/rev1.h diff --git a/keyboards/minidox/rev1/rules.mk b/keyboards/maple_computing/minidox/rev1/rules.mk similarity index 100% rename from keyboards/minidox/rev1/rules.mk rename to keyboards/maple_computing/minidox/rev1/rules.mk diff --git a/keyboards/ergo42/rules.mk b/keyboards/maple_computing/minidox/rules.mk similarity index 93% rename from keyboards/ergo42/rules.mk rename to keyboards/maple_computing/minidox/rules.mk index 2225bdcb5999..175ed0f6be99 100644 --- a/keyboards/ergo42/rules.mk +++ b/keyboards/maple_computing/minidox/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = ergo42/rev1 +DEFAULT_FOLDER = maple_computing/minidox/rev1 diff --git a/keyboards/the_ruler/config.h b/keyboards/maple_computing/the_ruler/config.h similarity index 100% rename from keyboards/the_ruler/config.h rename to keyboards/maple_computing/the_ruler/config.h diff --git a/keyboards/the_ruler/info.json b/keyboards/maple_computing/the_ruler/info.json similarity index 100% rename from keyboards/the_ruler/info.json rename to keyboards/maple_computing/the_ruler/info.json diff --git a/keyboards/the_ruler/keymaps/default/keymap.c b/keyboards/maple_computing/the_ruler/keymaps/default/keymap.c similarity index 100% rename from keyboards/the_ruler/keymaps/default/keymap.c rename to keyboards/maple_computing/the_ruler/keymaps/default/keymap.c diff --git a/keyboards/the_ruler/keymaps/default/readme.md b/keyboards/maple_computing/the_ruler/keymaps/default/readme.md similarity index 100% rename from keyboards/the_ruler/keymaps/default/readme.md rename to keyboards/maple_computing/the_ruler/keymaps/default/readme.md diff --git a/keyboards/the_ruler/readme.md b/keyboards/maple_computing/the_ruler/readme.md similarity index 93% rename from keyboards/the_ruler/readme.md rename to keyboards/maple_computing/the_ruler/readme.md index 13ea61c9a7e5..ff958db0294b 100644 --- a/keyboards/the_ruler/readme.md +++ b/keyboards/maple_computing/the_ruler/readme.md @@ -8,6 +8,6 @@ Hardware Availability: [Bishop Keyboards](https://bishopkeyboards.com/product/pc Make example for this keyboard (after setting up your build environment): - make the_ruler:default + make maple_computing/the_ruler: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/the_ruler/rules.mk b/keyboards/maple_computing/the_ruler/rules.mk similarity index 100% rename from keyboards/the_ruler/rules.mk rename to keyboards/maple_computing/the_ruler/rules.mk diff --git a/keyboards/the_ruler/the_ruler.c b/keyboards/maple_computing/the_ruler/the_ruler.c similarity index 100% rename from keyboards/the_ruler/the_ruler.c rename to keyboards/maple_computing/the_ruler/the_ruler.c diff --git a/keyboards/the_ruler/the_ruler.h b/keyboards/maple_computing/the_ruler/the_ruler.h similarity index 100% rename from keyboards/the_ruler/the_ruler.h rename to keyboards/maple_computing/the_ruler/the_ruler.h diff --git a/keyboards/treadstone32/info.json b/keyboards/marksard/treadstone32/info.json similarity index 100% rename from keyboards/treadstone32/info.json rename to keyboards/marksard/treadstone32/info.json diff --git a/keyboards/treadstone32/keymaps/default/config.h b/keyboards/marksard/treadstone32/keymaps/default/config.h similarity index 100% rename from keyboards/treadstone32/keymaps/default/config.h rename to keyboards/marksard/treadstone32/keymaps/default/config.h diff --git a/keyboards/treadstone32/keymaps/default/keymap.c b/keyboards/marksard/treadstone32/keymaps/default/keymap.c similarity index 100% rename from keyboards/treadstone32/keymaps/default/keymap.c rename to keyboards/marksard/treadstone32/keymaps/default/keymap.c diff --git a/keyboards/treadstone32/keymaps/default/readme.md b/keyboards/marksard/treadstone32/keymaps/default/readme.md similarity index 100% rename from keyboards/treadstone32/keymaps/default/readme.md rename to keyboards/marksard/treadstone32/keymaps/default/readme.md diff --git a/keyboards/treadstone32/keymaps/default/readme_jp.md b/keyboards/marksard/treadstone32/keymaps/default/readme_jp.md similarity index 100% rename from keyboards/treadstone32/keymaps/default/readme_jp.md rename to keyboards/marksard/treadstone32/keymaps/default/readme_jp.md diff --git a/keyboards/treadstone32/keymaps/default/rules.mk b/keyboards/marksard/treadstone32/keymaps/default/rules.mk similarity index 100% rename from keyboards/treadstone32/keymaps/default/rules.mk rename to keyboards/marksard/treadstone32/keymaps/default/rules.mk diff --git a/keyboards/treadstone32/keymaps/like_jis/config.h b/keyboards/marksard/treadstone32/keymaps/like_jis/config.h similarity index 100% rename from keyboards/treadstone32/keymaps/like_jis/config.h rename to keyboards/marksard/treadstone32/keymaps/like_jis/config.h diff --git a/keyboards/treadstone32/keymaps/like_jis/keymap.c b/keyboards/marksard/treadstone32/keymaps/like_jis/keymap.c similarity index 100% rename from keyboards/treadstone32/keymaps/like_jis/keymap.c rename to keyboards/marksard/treadstone32/keymaps/like_jis/keymap.c diff --git a/keyboards/treadstone32/keymaps/like_jis/readme.md b/keyboards/marksard/treadstone32/keymaps/like_jis/readme.md similarity index 100% rename from keyboards/treadstone32/keymaps/like_jis/readme.md rename to keyboards/marksard/treadstone32/keymaps/like_jis/readme.md diff --git a/keyboards/treadstone32/keymaps/like_jis/readme_jp.md b/keyboards/marksard/treadstone32/keymaps/like_jis/readme_jp.md similarity index 100% rename from keyboards/treadstone32/keymaps/like_jis/readme_jp.md rename to keyboards/marksard/treadstone32/keymaps/like_jis/readme_jp.md diff --git a/keyboards/treadstone32/keymaps/like_jis/rules.mk b/keyboards/marksard/treadstone32/keymaps/like_jis/rules.mk similarity index 100% rename from keyboards/treadstone32/keymaps/like_jis/rules.mk rename to keyboards/marksard/treadstone32/keymaps/like_jis/rules.mk diff --git a/keyboards/getta25/.noci b/keyboards/marksard/treadstone32/lite/.noci similarity index 100% rename from keyboards/getta25/.noci rename to keyboards/marksard/treadstone32/lite/.noci diff --git a/keyboards/treadstone32/lite/config.h b/keyboards/marksard/treadstone32/lite/config.h similarity index 100% rename from keyboards/treadstone32/lite/config.h rename to keyboards/marksard/treadstone32/lite/config.h diff --git a/keyboards/treadstone32/lite/lite.c b/keyboards/marksard/treadstone32/lite/lite.c similarity index 100% rename from keyboards/treadstone32/lite/lite.c rename to keyboards/marksard/treadstone32/lite/lite.c diff --git a/keyboards/treadstone32/lite/lite.h b/keyboards/marksard/treadstone32/lite/lite.h similarity index 100% rename from keyboards/treadstone32/lite/lite.h rename to keyboards/marksard/treadstone32/lite/lite.h diff --git a/keyboards/treadstone32/lite/rules.mk b/keyboards/marksard/treadstone32/lite/rules.mk similarity index 100% rename from keyboards/treadstone32/lite/rules.mk rename to keyboards/marksard/treadstone32/lite/rules.mk diff --git a/keyboards/treadstone32/readme.md b/keyboards/marksard/treadstone32/readme.md similarity index 92% rename from keyboards/treadstone32/readme.md rename to keyboards/marksard/treadstone32/readme.md index 99cbe4e01454..170c6bc76184 100644 --- a/keyboards/treadstone32/readme.md +++ b/keyboards/marksard/treadstone32/readme.md @@ -10,9 +10,9 @@ Hardware Availability: links to where you can find this hardware Make example for this keyboard (after setting up your build environment): - make treadstone32:default + make marksard/treadstone32:default or - make treadstone32/lite:default + make marksard/treadstone32/lite: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/ivy/.noci b/keyboards/marksard/treadstone32/rev1/.noci similarity index 100% rename from keyboards/ivy/.noci rename to keyboards/marksard/treadstone32/rev1/.noci diff --git a/keyboards/treadstone32/rev1/config.h b/keyboards/marksard/treadstone32/rev1/config.h similarity index 100% rename from keyboards/treadstone32/rev1/config.h rename to keyboards/marksard/treadstone32/rev1/config.h diff --git a/keyboards/treadstone32/rev1/rev1.c b/keyboards/marksard/treadstone32/rev1/rev1.c similarity index 100% rename from keyboards/treadstone32/rev1/rev1.c rename to keyboards/marksard/treadstone32/rev1/rev1.c diff --git a/keyboards/treadstone32/rev1/rev1.h b/keyboards/marksard/treadstone32/rev1/rev1.h similarity index 100% rename from keyboards/treadstone32/rev1/rev1.h rename to keyboards/marksard/treadstone32/rev1/rev1.h diff --git a/keyboards/treadstone32/rev1/rules.mk b/keyboards/marksard/treadstone32/rev1/rules.mk similarity index 100% rename from keyboards/treadstone32/rev1/rules.mk rename to keyboards/marksard/treadstone32/rev1/rules.mk diff --git a/keyboards/treadstone32/rules.mk b/keyboards/marksard/treadstone32/rules.mk similarity index 93% rename from keyboards/treadstone32/rules.mk rename to keyboards/marksard/treadstone32/rules.mk index 096c25856e5e..a0b43873cc4e 100644 --- a/keyboards/treadstone32/rules.mk +++ b/keyboards/marksard/treadstone32/rules.mk @@ -15,4 +15,4 @@ AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. LEADER_ENABLE = no -DEFAULT_FOLDER = treadstone32/rev1 +DEFAULT_FOLDER = marksard/treadstone32/rev1 diff --git a/keyboards/jisplit89/.noci b/keyboards/marksard/treadstone48/.noci similarity index 100% rename from keyboards/jisplit89/.noci rename to keyboards/marksard/treadstone48/.noci diff --git a/keyboards/treadstone48/common/glcdfont.c b/keyboards/marksard/treadstone48/common/glcdfont.c similarity index 100% rename from keyboards/treadstone48/common/glcdfont.c rename to keyboards/marksard/treadstone48/common/glcdfont.c diff --git a/keyboards/treadstone48/common/oled_helper.c b/keyboards/marksard/treadstone48/common/oled_helper.c similarity index 100% rename from keyboards/treadstone48/common/oled_helper.c rename to keyboards/marksard/treadstone48/common/oled_helper.c diff --git a/keyboards/treadstone48/common/oled_helper.h b/keyboards/marksard/treadstone48/common/oled_helper.h similarity index 100% rename from keyboards/treadstone48/common/oled_helper.h rename to keyboards/marksard/treadstone48/common/oled_helper.h diff --git a/keyboards/treadstone48/keymaps/default/config.h b/keyboards/marksard/treadstone48/keymaps/default/config.h similarity index 94% rename from keyboards/treadstone48/keymaps/default/config.h rename to keyboards/marksard/treadstone48/keymaps/default/config.h index baa4ec84615f..a5f68e7a2b28 100644 --- a/keyboards/treadstone48/keymaps/default/config.h +++ b/keyboards/marksard/treadstone48/keymaps/default/config.h @@ -46,4 +46,4 @@ // If you plug in the USB on the right side, please enable MASTER_RIGHT // #define RHYMESTONE_RIGHTHAND -#define OLED_FONT_H "keyboards/treadstone48/common/glcdfont.c" +#define OLED_FONT_H "keyboards/marksard/treadstone48/common/glcdfont.c" diff --git a/keyboards/treadstone48/keymaps/default/keymap.c b/keyboards/marksard/treadstone48/keymaps/default/keymap.c similarity index 100% rename from keyboards/treadstone48/keymaps/default/keymap.c rename to keyboards/marksard/treadstone48/keymaps/default/keymap.c diff --git a/keyboards/treadstone48/keymaps/default/readme.md b/keyboards/marksard/treadstone48/keymaps/default/readme.md similarity index 100% rename from keyboards/treadstone48/keymaps/default/readme.md rename to keyboards/marksard/treadstone48/keymaps/default/readme.md diff --git a/keyboards/treadstone48/keymaps/default/readme_jp.md b/keyboards/marksard/treadstone48/keymaps/default/readme_jp.md similarity index 100% rename from keyboards/treadstone48/keymaps/default/readme_jp.md rename to keyboards/marksard/treadstone48/keymaps/default/readme_jp.md diff --git a/keyboards/treadstone48/keymaps/default/rules.mk b/keyboards/marksard/treadstone48/keymaps/default/rules.mk similarity index 100% rename from keyboards/treadstone48/keymaps/default/rules.mk rename to keyboards/marksard/treadstone48/keymaps/default/rules.mk diff --git a/keyboards/treadstone48/keymaps/like_jis/config.h b/keyboards/marksard/treadstone48/keymaps/like_jis/config.h similarity index 94% rename from keyboards/treadstone48/keymaps/like_jis/config.h rename to keyboards/marksard/treadstone48/keymaps/like_jis/config.h index baa4ec84615f..a5f68e7a2b28 100644 --- a/keyboards/treadstone48/keymaps/like_jis/config.h +++ b/keyboards/marksard/treadstone48/keymaps/like_jis/config.h @@ -46,4 +46,4 @@ // If you plug in the USB on the right side, please enable MASTER_RIGHT // #define RHYMESTONE_RIGHTHAND -#define OLED_FONT_H "keyboards/treadstone48/common/glcdfont.c" +#define OLED_FONT_H "keyboards/marksard/treadstone48/common/glcdfont.c" diff --git a/keyboards/treadstone48/keymaps/like_jis/keymap.c b/keyboards/marksard/treadstone48/keymaps/like_jis/keymap.c similarity index 100% rename from keyboards/treadstone48/keymaps/like_jis/keymap.c rename to keyboards/marksard/treadstone48/keymaps/like_jis/keymap.c diff --git a/keyboards/treadstone48/keymaps/like_jis/readme.md b/keyboards/marksard/treadstone48/keymaps/like_jis/readme.md similarity index 100% rename from keyboards/treadstone48/keymaps/like_jis/readme.md rename to keyboards/marksard/treadstone48/keymaps/like_jis/readme.md diff --git a/keyboards/treadstone48/keymaps/like_jis/readme_jp.md b/keyboards/marksard/treadstone48/keymaps/like_jis/readme_jp.md similarity index 100% rename from keyboards/treadstone48/keymaps/like_jis/readme_jp.md rename to keyboards/marksard/treadstone48/keymaps/like_jis/readme_jp.md diff --git a/keyboards/treadstone48/keymaps/like_jis/rules.mk b/keyboards/marksard/treadstone48/keymaps/like_jis/rules.mk similarity index 100% rename from keyboards/treadstone48/keymaps/like_jis/rules.mk rename to keyboards/marksard/treadstone48/keymaps/like_jis/rules.mk diff --git a/keyboards/treadstone48/readme.md b/keyboards/marksard/treadstone48/readme.md similarity index 92% rename from keyboards/treadstone48/readme.md rename to keyboards/marksard/treadstone48/readme.md index 432ef33fe91f..c5f6f8f73fec 100644 --- a/keyboards/treadstone48/readme.md +++ b/keyboards/marksard/treadstone48/readme.md @@ -10,9 +10,9 @@ Hardware Availability: links to where you can find this hardware Make example for this keyboard (after setting up your build environment): - make treadstone48:default + make marksard/treadstone48:default or - make treadstone48/rev2:default + make marksard/treadstone48/rev2: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/launchpad/.noci b/keyboards/marksard/treadstone48/rev1/.noci similarity index 100% rename from keyboards/launchpad/.noci rename to keyboards/marksard/treadstone48/rev1/.noci diff --git a/keyboards/treadstone48/rev1/config.h b/keyboards/marksard/treadstone48/rev1/config.h similarity index 100% rename from keyboards/treadstone48/rev1/config.h rename to keyboards/marksard/treadstone48/rev1/config.h diff --git a/keyboards/treadstone48/rev1/info.json b/keyboards/marksard/treadstone48/rev1/info.json similarity index 100% rename from keyboards/treadstone48/rev1/info.json rename to keyboards/marksard/treadstone48/rev1/info.json diff --git a/keyboards/treadstone48/rev1/keymaps/like_jis_rs/config.h b/keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/config.h similarity index 95% rename from keyboards/treadstone48/rev1/keymaps/like_jis_rs/config.h rename to keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/config.h index 95b58c23db4f..54ac1f2fce9a 100644 --- a/keyboards/treadstone48/rev1/keymaps/like_jis_rs/config.h +++ b/keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/config.h @@ -48,4 +48,4 @@ // If you plug in the USB on the right side, please enable MASTER_RIGHT // #define RHYMESTONE_RIGHTHAND -#define OLED_FONT_H "keyboards/treadstone48/common/glcdfont.c" +#define OLED_FONT_H "keyboards/marksard/treadstone48/common/glcdfont.c" diff --git a/keyboards/treadstone48/rev1/keymaps/like_jis_rs/keymap.c b/keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/keymap.c similarity index 100% rename from keyboards/treadstone48/rev1/keymaps/like_jis_rs/keymap.c rename to keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/keymap.c diff --git a/keyboards/treadstone48/rev1/keymaps/like_jis_rs/readme.md b/keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/readme.md similarity index 100% rename from keyboards/treadstone48/rev1/keymaps/like_jis_rs/readme.md rename to keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/readme.md diff --git a/keyboards/treadstone48/rev1/keymaps/like_jis_rs/readme_jp.md b/keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/readme_jp.md similarity index 100% rename from keyboards/treadstone48/rev1/keymaps/like_jis_rs/readme_jp.md rename to keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/readme_jp.md diff --git a/keyboards/treadstone48/rev1/keymaps/like_jis_rs/rules.mk b/keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/rules.mk similarity index 100% rename from keyboards/treadstone48/rev1/keymaps/like_jis_rs/rules.mk rename to keyboards/marksard/treadstone48/rev1/keymaps/like_jis_rs/rules.mk diff --git a/keyboards/treadstone48/rev1/rev1.c b/keyboards/marksard/treadstone48/rev1/rev1.c similarity index 100% rename from keyboards/treadstone48/rev1/rev1.c rename to keyboards/marksard/treadstone48/rev1/rev1.c diff --git a/keyboards/treadstone48/rev1/rev1.h b/keyboards/marksard/treadstone48/rev1/rev1.h similarity index 100% rename from keyboards/treadstone48/rev1/rev1.h rename to keyboards/marksard/treadstone48/rev1/rev1.h diff --git a/keyboards/getta25/rev1/rules.mk b/keyboards/marksard/treadstone48/rev1/rules.mk similarity index 100% rename from keyboards/getta25/rev1/rules.mk rename to keyboards/marksard/treadstone48/rev1/rules.mk diff --git a/keyboards/treadstone48/rev2/config.h b/keyboards/marksard/treadstone48/rev2/config.h similarity index 100% rename from keyboards/treadstone48/rev2/config.h rename to keyboards/marksard/treadstone48/rev2/config.h diff --git a/keyboards/treadstone48/rev2/info.json b/keyboards/marksard/treadstone48/rev2/info.json similarity index 100% rename from keyboards/treadstone48/rev2/info.json rename to keyboards/marksard/treadstone48/rev2/info.json diff --git a/keyboards/treadstone48/rev2/rev2.c b/keyboards/marksard/treadstone48/rev2/rev2.c similarity index 100% rename from keyboards/treadstone48/rev2/rev2.c rename to keyboards/marksard/treadstone48/rev2/rev2.c diff --git a/keyboards/treadstone48/rev2/rev2.h b/keyboards/marksard/treadstone48/rev2/rev2.h similarity index 100% rename from keyboards/treadstone48/rev2/rev2.h rename to keyboards/marksard/treadstone48/rev2/rev2.h diff --git a/keyboards/naked48/keymaps/default/rules.mk b/keyboards/marksard/treadstone48/rev2/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/default/rules.mk rename to keyboards/marksard/treadstone48/rev2/rules.mk diff --git a/keyboards/treadstone48/rules.mk b/keyboards/marksard/treadstone48/rules.mk similarity index 93% rename from keyboards/treadstone48/rules.mk rename to keyboards/marksard/treadstone48/rules.mk index 3bf42c85c64b..67c171a7b74a 100644 --- a/keyboards/treadstone48/rules.mk +++ b/keyboards/marksard/treadstone48/rules.mk @@ -22,4 +22,4 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow OLED_ENABLE = yes OLED_DRIVER = SSD1306 -DEFAULT_FOLDER = treadstone48/rev1 +DEFAULT_FOLDER = marksard/treadstone48/rev1 diff --git a/keyboards/massdrop/alt/rules.mk b/keyboards/massdrop/alt/rules.mk index 83d4fc590b92..f0ff36fa35bf 100644 --- a/keyboards/massdrop/alt/rules.mk +++ b/keyboards/massdrop/alt/rules.mk @@ -5,6 +5,9 @@ SRC += config_led.c ARM_ATSAM = SAMD51J18A MCU = cortex-m4 +# Bootloader selection +BOOTLOADER = md-boot + # Build Options # change yes to no to disable # diff --git a/keyboards/massdrop/ctrl/rules.mk b/keyboards/massdrop/ctrl/rules.mk index 667642f83d9b..a302c82d86ef 100644 --- a/keyboards/massdrop/ctrl/rules.mk +++ b/keyboards/massdrop/ctrl/rules.mk @@ -5,6 +5,9 @@ SRC += config_led.c ARM_ATSAM = SAMD51J18A MCU = cortex-m4 +# Bootloader selection +BOOTLOADER = md-boot + # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/abelx/abelx.c b/keyboards/matrix/abelx/abelx.c index 77e749ee4005..9585948e0cda 100644 --- a/keyboards/matrix/abelx/abelx.c +++ b/keyboards/matrix/abelx/abelx.c @@ -97,3 +97,8 @@ void shutdown_user(void) // set the magic number for resetting to the bootloader *(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC; } + +void bootloader_jump(void) { + shutdown_user(); + NVIC_SystemReset(); +} diff --git a/keyboards/matrix/abelx/boards/abelx_bd/board.c b/keyboards/matrix/abelx/boards/abelx_bd/board.c index 68cf23cddc4a..db40a8e37bac 100644 --- a/keyboards/matrix/abelx/boards/abelx_bd/board.c +++ b/keyboards/matrix/abelx/boards/abelx_bd/board.c @@ -208,9 +208,6 @@ static void stm32_gpio_init(void) { * else. */ void __early_init(void) { - extern void enter_bootloader_mode_if_requested(void); - enter_bootloader_mode_if_requested(); - stm32_gpio_init(); stm32_clock_init(); } diff --git a/keyboards/matrix/abelx/bootloader_defs.h b/keyboards/matrix/abelx/bootloader_defs.h deleted file mode 100644 index 20b8f73e6f7d..000000000000 --- a/keyboards/matrix/abelx/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/keyboards/matrix/abelx/rules.mk b/keyboards/matrix/abelx/rules.mk index 98b6cfa65ed4..7a5d01e5cb15 100644 --- a/keyboards/matrix/abelx/rules.mk +++ b/keyboards/matrix/abelx/rules.mk @@ -25,18 +25,13 @@ ARMV = 7 USE_FPU = yes -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -OPT_DEFS = - -# Options to pass to dfu-util when flashing -#DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave -#DFU_SUFFIX_ARGS = -p DF11 -v 0483 +# Bootloader selection +BOOTLOADER = custom # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug @@ -44,7 +39,6 @@ COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in diff --git a/keyboards/matrix/m12og/rev1/rev1.c b/keyboards/matrix/m12og/rev1/rev1.c index e3277bee2771..53183c7d2d2c 100644 --- a/keyboards/matrix/m12og/rev1/rev1.c +++ b/keyboards/matrix/m12og/rev1/rev1.c @@ -20,6 +20,11 @@ void board_init(void) { writePinLow(A8); } +void bootloader_jump(void) { + // This board doesn't use the standard DFU bootloader, and no information is available regarding how to enter bootloader mode. All we can do here is reset. + NVIC_SystemReset(); +} + void keyboard_post_init_kb(void) { rgblight_enable_noeeprom(); rgblight_sethsv_noeeprom(5, 255, 255); diff --git a/keyboards/matrix/m12og/rev1/rules.mk b/keyboards/matrix/m12og/rev1/rules.mk index 0e0584b8c967..d9733e8c5eb6 100644 --- a/keyboards/matrix/m12og/rev1/rules.mk +++ b/keyboards/matrix/m12og/rev1/rules.mk @@ -5,6 +5,9 @@ MCU_LDSCRIPT = m12og_v1 BOARD = m12og_v1 +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/m20add/bootloader_defs.h b/keyboards/matrix/m20add/bootloader_defs.h deleted file mode 100644 index 4da3d39a3268..000000000000 --- a/keyboards/matrix/m20add/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/keyboards/matrix/m20add/m20add.c b/keyboards/matrix/m20add/m20add.c index 21f4f9b1ba87..cdcafb97790c 100644 --- a/keyboards/matrix/m20add/m20add.c +++ b/keyboards/matrix/m20add/m20add.c @@ -53,28 +53,14 @@ bool led_update_kb(led_t led_state) { return res; } -// override the default implementation to avoid re-initialization -void i2c_init(void) -{ - static bool initialized = false; - if (initialized) { - return; - } else { - initialized = true; - } - - // Try releasing special pins for a short time - palSetLineMode(I2C1_SCL_PIN, PAL_MODE_INPUT); - palSetLineMode(I2C1_SDA_PIN, PAL_MODE_INPUT); - - chThdSleepMilliseconds(10); - palSetLineMode(I2C1_SCL_PIN, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); - palSetLineMode(I2C1_SDA_PIN, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); -} - #define REBOOT_MAGIC 0x41544B42 void shutdown_user(void) { // set the magic number for resetting to the bootloader *(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC; } + +void bootloader_jump(void) { + shutdown_user(); + NVIC_SystemReset(); +} diff --git a/keyboards/matrix/m20add/rules.mk b/keyboards/matrix/m20add/rules.mk index 1ecbd9d3082e..86bd6b937123 100644 --- a/keyboards/matrix/m20add/rules.mk +++ b/keyboards/matrix/m20add/rules.mk @@ -10,6 +10,9 @@ MCU_LDSCRIPT = m20add_boot # or /boards BOARD = ST_NUCLEO64_F411RE +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/noah/bootloader_defs.h b/keyboards/matrix/noah/bootloader_defs.h deleted file mode 100644 index 4da3d39a3268..000000000000 --- a/keyboards/matrix/noah/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/keyboards/matrix/noah/noah.c b/keyboards/matrix/noah/noah.c index 2143dee3be08..89c25707af25 100644 --- a/keyboards/matrix/noah/noah.c +++ b/keyboards/matrix/noah/noah.c @@ -4,6 +4,11 @@ #include "noah.h" +void bootloader_jump(void) { + // This board doesn't use the standard DFU bootloader, and no information is available regarding how to enter bootloader mode. All we can do here is reset. + NVIC_SystemReset(); +} + #ifdef RGBLIGHT_ENABLE #include #include "rgblight.h" diff --git a/keyboards/matrix/noah/rules.mk b/keyboards/matrix/noah/rules.mk index b9f642e8cdfd..7971d628d684 100644 --- a/keyboards/matrix/noah/rules.mk +++ b/keyboards/matrix/noah/rules.mk @@ -10,6 +10,9 @@ MCU_LDSCRIPT = noah_boot # or /boards BOARD = ST_NUCLEO64_F411RE +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/m3n3van/config.h b/keyboards/matthewdias/m3n3van/config.h similarity index 100% rename from keyboards/m3n3van/config.h rename to keyboards/matthewdias/m3n3van/config.h diff --git a/keyboards/m3n3van/info.json b/keyboards/matthewdias/m3n3van/info.json similarity index 100% rename from keyboards/m3n3van/info.json rename to keyboards/matthewdias/m3n3van/info.json diff --git a/keyboards/m3n3van/keymaps/default/keymap.json b/keyboards/matthewdias/m3n3van/keymaps/default/keymap.json similarity index 100% rename from keyboards/m3n3van/keymaps/default/keymap.json rename to keyboards/matthewdias/m3n3van/keymaps/default/keymap.json diff --git a/keyboards/m3n3van/keymaps/matthewdias/keymap.c b/keyboards/matthewdias/m3n3van/keymaps/matthewdias/keymap.c similarity index 100% rename from keyboards/m3n3van/keymaps/matthewdias/keymap.c rename to keyboards/matthewdias/m3n3van/keymaps/matthewdias/keymap.c diff --git a/keyboards/m3n3van/keymaps/via/keymap.c b/keyboards/matthewdias/m3n3van/keymaps/via/keymap.c similarity index 100% rename from keyboards/m3n3van/keymaps/via/keymap.c rename to keyboards/matthewdias/m3n3van/keymaps/via/keymap.c diff --git a/keyboards/jnao/keymaps/via/rules.mk b/keyboards/matthewdias/m3n3van/keymaps/via/rules.mk similarity index 100% rename from keyboards/jnao/keymaps/via/rules.mk rename to keyboards/matthewdias/m3n3van/keymaps/via/rules.mk diff --git a/keyboards/m3n3van/m3n3van.c b/keyboards/matthewdias/m3n3van/m3n3van.c similarity index 100% rename from keyboards/m3n3van/m3n3van.c rename to keyboards/matthewdias/m3n3van/m3n3van.c diff --git a/keyboards/m3n3van/m3n3van.h b/keyboards/matthewdias/m3n3van/m3n3van.h similarity index 100% rename from keyboards/m3n3van/m3n3van.h rename to keyboards/matthewdias/m3n3van/m3n3van.h diff --git a/keyboards/m3n3van/readme.md b/keyboards/matthewdias/m3n3van/readme.md similarity index 92% rename from keyboards/m3n3van/readme.md rename to keyboards/matthewdias/m3n3van/readme.md index 66f9d08042be..4a426cc22498 100644 --- a/keyboards/m3n3van/readme.md +++ b/keyboards/matthewdias/m3n3van/readme.md @@ -12,10 +12,10 @@ To reset the keyboard into bootloader mode, press the reset switch on the unders Make example for this keyboard (after setting up your build environment): - make m3n3van:default + make matthewdias/m3n3van:default Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): - make m3n3van:default:flash + make matthewdias/m3n3van: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/m3n3van/rules.mk b/keyboards/matthewdias/m3n3van/rules.mk similarity index 100% rename from keyboards/m3n3van/rules.mk rename to keyboards/matthewdias/m3n3van/rules.mk diff --git a/keyboards/minim/config.h b/keyboards/matthewdias/minim/config.h similarity index 100% rename from keyboards/minim/config.h rename to keyboards/matthewdias/minim/config.h diff --git a/keyboards/minim/info.json b/keyboards/matthewdias/minim/info.json similarity index 100% rename from keyboards/minim/info.json rename to keyboards/matthewdias/minim/info.json diff --git a/keyboards/minim/keymaps/default/keymap.json b/keyboards/matthewdias/minim/keymaps/default/keymap.json similarity index 100% rename from keyboards/minim/keymaps/default/keymap.json rename to keyboards/matthewdias/minim/keymaps/default/keymap.json diff --git a/keyboards/minim/minim.c b/keyboards/matthewdias/minim/minim.c similarity index 100% rename from keyboards/minim/minim.c rename to keyboards/matthewdias/minim/minim.c diff --git a/keyboards/minim/minim.h b/keyboards/matthewdias/minim/minim.h similarity index 100% rename from keyboards/minim/minim.h rename to keyboards/matthewdias/minim/minim.h diff --git a/keyboards/minim/readme.md b/keyboards/matthewdias/minim/readme.md similarity index 91% rename from keyboards/minim/readme.md rename to keyboards/matthewdias/minim/readme.md index 95820c4db9a4..e94e928ce5aa 100644 --- a/keyboards/minim/readme.md +++ b/keyboards/matthewdias/minim/readme.md @@ -12,10 +12,10 @@ To reset the keyboard into bootloader mode, press the reset switch on the unders Make example for this keyboard (after setting up your build environment): - make minim:default + make matthewdias/minim:default Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): - make minim:default:flash + make matthewdias/minim: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/minim/rules.mk b/keyboards/matthewdias/minim/rules.mk similarity index 100% rename from keyboards/minim/rules.mk rename to keyboards/matthewdias/minim/rules.mk diff --git a/keyboards/model_v/config.h b/keyboards/matthewdias/model_v/config.h similarity index 100% rename from keyboards/model_v/config.h rename to keyboards/matthewdias/model_v/config.h diff --git a/keyboards/model_v/info.json b/keyboards/matthewdias/model_v/info.json similarity index 100% rename from keyboards/model_v/info.json rename to keyboards/matthewdias/model_v/info.json diff --git a/keyboards/model_v/keymaps/default/keymap.c b/keyboards/matthewdias/model_v/keymaps/default/keymap.c similarity index 100% rename from keyboards/model_v/keymaps/default/keymap.c rename to keyboards/matthewdias/model_v/keymaps/default/keymap.c diff --git a/keyboards/model_v/keymaps/via/keymap.c b/keyboards/matthewdias/model_v/keymaps/via/keymap.c similarity index 100% rename from keyboards/model_v/keymaps/via/keymap.c rename to keyboards/matthewdias/model_v/keymaps/via/keymap.c diff --git a/keyboards/kelowna/rgb64/keymaps/via/rules.mk b/keyboards/matthewdias/model_v/keymaps/via/rules.mk similarity index 100% rename from keyboards/kelowna/rgb64/keymaps/via/rules.mk rename to keyboards/matthewdias/model_v/keymaps/via/rules.mk diff --git a/keyboards/model_v/model_v.c b/keyboards/matthewdias/model_v/model_v.c similarity index 100% rename from keyboards/model_v/model_v.c rename to keyboards/matthewdias/model_v/model_v.c diff --git a/keyboards/model_v/model_v.h b/keyboards/matthewdias/model_v/model_v.h similarity index 100% rename from keyboards/model_v/model_v.h rename to keyboards/matthewdias/model_v/model_v.h diff --git a/keyboards/model_v/readme.md b/keyboards/matthewdias/model_v/readme.md similarity index 90% rename from keyboards/model_v/readme.md rename to keyboards/matthewdias/model_v/readme.md index 17d12d810856..e73c131e29f2 100644 --- a/keyboards/model_v/readme.md +++ b/keyboards/matthewdias/model_v/readme.md @@ -11,10 +11,10 @@ To reset the keyboard into bootloader mode, press the reset switch on the unders Make example for this keyboard (after setting up your build environment): - make model_v:default + make matthewdias/model_v:default Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): - make model_v:default:flash + make matthewdias/model_v: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/model_v/rules.mk b/keyboards/matthewdias/model_v/rules.mk similarity index 100% rename from keyboards/model_v/rules.mk rename to keyboards/matthewdias/model_v/rules.mk diff --git a/keyboards/txuu/config.h b/keyboards/matthewdias/txuu/config.h similarity index 100% rename from keyboards/txuu/config.h rename to keyboards/matthewdias/txuu/config.h diff --git a/keyboards/txuu/info.json b/keyboards/matthewdias/txuu/info.json similarity index 100% rename from keyboards/txuu/info.json rename to keyboards/matthewdias/txuu/info.json diff --git a/keyboards/txuu/keymaps/default/keymap.c b/keyboards/matthewdias/txuu/keymaps/default/keymap.c similarity index 100% rename from keyboards/txuu/keymaps/default/keymap.c rename to keyboards/matthewdias/txuu/keymaps/default/keymap.c diff --git a/keyboards/txuu/keymaps/via/keymap.c b/keyboards/matthewdias/txuu/keymaps/via/keymap.c similarity index 100% rename from keyboards/txuu/keymaps/via/keymap.c rename to keyboards/matthewdias/txuu/keymaps/via/keymap.c diff --git a/keyboards/kprepublic/bm68hsrgb/keymaps/via/rules.mk b/keyboards/matthewdias/txuu/keymaps/via/rules.mk similarity index 100% rename from keyboards/kprepublic/bm68hsrgb/keymaps/via/rules.mk rename to keyboards/matthewdias/txuu/keymaps/via/rules.mk diff --git a/keyboards/txuu/readme.md b/keyboards/matthewdias/txuu/readme.md similarity index 90% rename from keyboards/txuu/readme.md rename to keyboards/matthewdias/txuu/readme.md index 1800d8a8ca9e..017cd23bb13e 100644 --- a/keyboards/txuu/readme.md +++ b/keyboards/matthewdias/txuu/readme.md @@ -9,10 +9,10 @@ To reset the keyboard into bootloader mode, press the reset switch on the unders Make example for this keyboard (after setting up your build environment): - make txuu:default + make matthewdias/txuu:default Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): - make txuu:default:flash + make matthewdias/txuu: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/txuu/rules.mk b/keyboards/matthewdias/txuu/rules.mk similarity index 100% rename from keyboards/txuu/rules.mk rename to keyboards/matthewdias/txuu/rules.mk diff --git a/keyboards/txuu/txuu.c b/keyboards/matthewdias/txuu/txuu.c similarity index 100% rename from keyboards/txuu/txuu.c rename to keyboards/matthewdias/txuu/txuu.c diff --git a/keyboards/txuu/txuu.h b/keyboards/matthewdias/txuu/txuu.h similarity index 100% rename from keyboards/txuu/txuu.h rename to keyboards/matthewdias/txuu/txuu.h diff --git a/keyboards/acr60/acr60.c b/keyboards/mechkeys/acr60/acr60.c similarity index 100% rename from keyboards/acr60/acr60.c rename to keyboards/mechkeys/acr60/acr60.c diff --git a/keyboards/acr60/acr60.h b/keyboards/mechkeys/acr60/acr60.h similarity index 100% rename from keyboards/acr60/acr60.h rename to keyboards/mechkeys/acr60/acr60.h diff --git a/keyboards/acr60/config.h b/keyboards/mechkeys/acr60/config.h similarity index 100% rename from keyboards/acr60/config.h rename to keyboards/mechkeys/acr60/config.h diff --git a/keyboards/acr60/info.json b/keyboards/mechkeys/acr60/info.json similarity index 100% rename from keyboards/acr60/info.json rename to keyboards/mechkeys/acr60/info.json diff --git a/keyboards/acr60/keymaps/default/keymap.c b/keyboards/mechkeys/acr60/keymaps/default/keymap.c similarity index 100% rename from keyboards/acr60/keymaps/default/keymap.c rename to keyboards/mechkeys/acr60/keymaps/default/keymap.c diff --git a/keyboards/acr60/keymaps/mitch/keymap.c b/keyboards/mechkeys/acr60/keymaps/mitch/keymap.c similarity index 100% rename from keyboards/acr60/keymaps/mitch/keymap.c rename to keyboards/mechkeys/acr60/keymaps/mitch/keymap.c diff --git a/keyboards/acr60/readme.md b/keyboards/mechkeys/acr60/readme.md similarity index 93% rename from keyboards/acr60/readme.md rename to keyboards/mechkeys/acr60/readme.md index 70b617dfdadf..4d8bffa36414 100644 --- a/keyboards/acr60/readme.md +++ b/keyboards/mechkeys/acr60/readme.md @@ -10,11 +10,11 @@ A customizable 60% keyboard made and sold by mechkeys.ca [More info on MECHKEYS] Make example for this keyboard (after setting up your build environment): - make acr60:default + make mechkeys/acr60:default Flashing example for this keyboard: - make acr60:default:flash + make mechkeys/acr60:default:flash To reset the board into bootloader mode, do one of the following: diff --git a/keyboards/acr60/rules.mk b/keyboards/mechkeys/acr60/rules.mk similarity index 100% rename from keyboards/acr60/rules.mk rename to keyboards/mechkeys/acr60/rules.mk diff --git a/keyboards/alu84/alu84.c b/keyboards/mechkeys/alu84/alu84.c similarity index 100% rename from keyboards/alu84/alu84.c rename to keyboards/mechkeys/alu84/alu84.c diff --git a/keyboards/alu84/alu84.h b/keyboards/mechkeys/alu84/alu84.h similarity index 100% rename from keyboards/alu84/alu84.h rename to keyboards/mechkeys/alu84/alu84.h diff --git a/keyboards/alu84/config.h b/keyboards/mechkeys/alu84/config.h similarity index 100% rename from keyboards/alu84/config.h rename to keyboards/mechkeys/alu84/config.h diff --git a/keyboards/alu84/info.json b/keyboards/mechkeys/alu84/info.json similarity index 100% rename from keyboards/alu84/info.json rename to keyboards/mechkeys/alu84/info.json diff --git a/keyboards/alu84/keymaps/default/keymap.c b/keyboards/mechkeys/alu84/keymaps/default/keymap.c similarity index 100% rename from keyboards/alu84/keymaps/default/keymap.c rename to keyboards/mechkeys/alu84/keymaps/default/keymap.c diff --git a/keyboards/alu84/keymaps/turbomech/config.h b/keyboards/mechkeys/alu84/keymaps/turbomech/config.h similarity index 100% rename from keyboards/alu84/keymaps/turbomech/config.h rename to keyboards/mechkeys/alu84/keymaps/turbomech/config.h diff --git a/keyboards/alu84/keymaps/turbomech/keymap.c b/keyboards/mechkeys/alu84/keymaps/turbomech/keymap.c similarity index 100% rename from keyboards/alu84/keymaps/turbomech/keymap.c rename to keyboards/mechkeys/alu84/keymaps/turbomech/keymap.c diff --git a/keyboards/alu84/keymaps/turbomech/readme.md b/keyboards/mechkeys/alu84/keymaps/turbomech/readme.md similarity index 100% rename from keyboards/alu84/keymaps/turbomech/readme.md rename to keyboards/mechkeys/alu84/keymaps/turbomech/readme.md diff --git a/keyboards/alu84/keymaps/turbomech/rules.mk b/keyboards/mechkeys/alu84/keymaps/turbomech/rules.mk similarity index 100% rename from keyboards/alu84/keymaps/turbomech/rules.mk rename to keyboards/mechkeys/alu84/keymaps/turbomech/rules.mk diff --git a/keyboards/alu84/readme.md b/keyboards/mechkeys/alu84/readme.md similarity index 91% rename from keyboards/alu84/readme.md rename to keyboards/mechkeys/alu84/readme.md index 12da1d8a8f0d..ca2afbe970b2 100644 --- a/keyboards/alu84/readme.md +++ b/keyboards/mechkeys/alu84/readme.md @@ -10,11 +10,11 @@ A 75% keyboard made and sold by MECHKEYS. Make example for this keyboard (after setting up your build environment): - make alu84:default + make mechkeys/alu84:default Flashing example for this keyboard: - make alu84:default:flash + make mechkeys/alu84:default:flash To reset the board into bootloader mode, hold Space+B while plugging the cable in. diff --git a/keyboards/alu84/rules.mk b/keyboards/mechkeys/alu84/rules.mk similarity index 100% rename from keyboards/alu84/rules.mk rename to keyboards/mechkeys/alu84/rules.mk diff --git a/keyboards/espectro/config.h b/keyboards/mechkeys/espectro/config.h similarity index 100% rename from keyboards/espectro/config.h rename to keyboards/mechkeys/espectro/config.h diff --git a/keyboards/espectro/espectro.c b/keyboards/mechkeys/espectro/espectro.c similarity index 100% rename from keyboards/espectro/espectro.c rename to keyboards/mechkeys/espectro/espectro.c diff --git a/keyboards/espectro/espectro.h b/keyboards/mechkeys/espectro/espectro.h similarity index 100% rename from keyboards/espectro/espectro.h rename to keyboards/mechkeys/espectro/espectro.h diff --git a/keyboards/espectro/info.json b/keyboards/mechkeys/espectro/info.json similarity index 100% rename from keyboards/espectro/info.json rename to keyboards/mechkeys/espectro/info.json diff --git a/keyboards/espectro/keymaps/default/keymap.c b/keyboards/mechkeys/espectro/keymaps/default/keymap.c similarity index 100% rename from keyboards/espectro/keymaps/default/keymap.c rename to keyboards/mechkeys/espectro/keymaps/default/keymap.c diff --git a/keyboards/espectro/keymaps/iso/keymap.c b/keyboards/mechkeys/espectro/keymaps/iso/keymap.c similarity index 100% rename from keyboards/espectro/keymaps/iso/keymap.c rename to keyboards/mechkeys/espectro/keymaps/iso/keymap.c diff --git a/keyboards/espectro/keymaps/mac/config.h b/keyboards/mechkeys/espectro/keymaps/mac/config.h similarity index 100% rename from keyboards/espectro/keymaps/mac/config.h rename to keyboards/mechkeys/espectro/keymaps/mac/config.h diff --git a/keyboards/espectro/keymaps/mac/keymap.c b/keyboards/mechkeys/espectro/keymaps/mac/keymap.c similarity index 100% rename from keyboards/espectro/keymaps/mac/keymap.c rename to keyboards/mechkeys/espectro/keymaps/mac/keymap.c diff --git a/keyboards/espectro/keymaps/mac/readme.md b/keyboards/mechkeys/espectro/keymaps/mac/readme.md similarity index 100% rename from keyboards/espectro/keymaps/mac/readme.md rename to keyboards/mechkeys/espectro/keymaps/mac/readme.md diff --git a/keyboards/espectro/keymaps/mapdev/keymap.c b/keyboards/mechkeys/espectro/keymaps/mapdev/keymap.c similarity index 100% rename from keyboards/espectro/keymaps/mapdev/keymap.c rename to keyboards/mechkeys/espectro/keymaps/mapdev/keymap.c diff --git a/keyboards/espectro/keymaps/mikethetiger/keymap.c b/keyboards/mechkeys/espectro/keymaps/mikethetiger/keymap.c similarity index 100% rename from keyboards/espectro/keymaps/mikethetiger/keymap.c rename to keyboards/mechkeys/espectro/keymaps/mikethetiger/keymap.c diff --git a/keyboards/espectro/readme.md b/keyboards/mechkeys/espectro/readme.md similarity index 95% rename from keyboards/espectro/readme.md rename to keyboards/mechkeys/espectro/readme.md index c4c0edc7f74c..fca7ad730894 100644 --- a/keyboards/espectro/readme.md +++ b/keyboards/mechkeys/espectro/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [MECHKEYS](https://mechkeys.ca) Make example for this keyboard (after setting up your build environment): - make espectro:default + make mechkeys/espectro: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/espectro/rules.mk b/keyboards/mechkeys/espectro/rules.mk similarity index 100% rename from keyboards/espectro/rules.mk rename to keyboards/mechkeys/espectro/rules.mk diff --git a/keyboards/mechmini/mechmini.c b/keyboards/mechkeys/mechmini/mechmini.c similarity index 100% rename from keyboards/mechmini/mechmini.c rename to keyboards/mechkeys/mechmini/mechmini.c diff --git a/keyboards/mechmini/mechmini.h b/keyboards/mechkeys/mechmini/mechmini.h similarity index 90% rename from keyboards/mechmini/mechmini.h rename to keyboards/mechkeys/mechmini/mechmini.h index cbd405285f35..9420b3e161ea 100644 --- a/keyboards/mechmini/mechmini.h +++ b/keyboards/mechkeys/mechmini/mechmini.h @@ -18,8 +18,8 @@ #include "quantum.h" -#if defined(KEYBOARD_mechmini_v1) +#if defined(KEYBOARD_mechkeys_mechmini_v1) # include "v1.h" -#elif defined(KEYBOARD_mechmini_v2) +#elif defined(KEYBOARD_mechkeys_mechmini_v2) # include "v2.h" #endif diff --git a/keyboards/mechmini/readme.md b/keyboards/mechkeys/mechmini/readme.md similarity index 97% rename from keyboards/mechmini/readme.md rename to keyboards/mechkeys/mechmini/readme.md index fc43eb124845..f9c026427355 100644 --- a/keyboards/mechmini/readme.md +++ b/keyboards/mechkeys/mechmini/readme.md @@ -17,7 +17,7 @@ Hardware Availability: [MECHKEYS](https://mechkeys.ca/collections/keyboards/prod Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space) - please see v1 readme for v1 make instructions: - make mechmini:default + make mechkeys/mechmini:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/mechkeys/mechmini/rules.mk b/keyboards/mechkeys/mechmini/rules.mk new file mode 100644 index 000000000000..9d63d875ebe8 --- /dev/null +++ b/keyboards/mechkeys/mechmini/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = mechkeys/mechmini/v2 diff --git a/keyboards/lets_split_eh/.noci b/keyboards/mechkeys/mechmini/v1/.noci similarity index 100% rename from keyboards/lets_split_eh/.noci rename to keyboards/mechkeys/mechmini/v1/.noci diff --git a/keyboards/mechmini/v1/config.h b/keyboards/mechkeys/mechmini/v1/config.h similarity index 100% rename from keyboards/mechmini/v1/config.h rename to keyboards/mechkeys/mechmini/v1/config.h diff --git a/keyboards/mechmini/v1/info.json b/keyboards/mechkeys/mechmini/v1/info.json similarity index 100% rename from keyboards/mechmini/v1/info.json rename to keyboards/mechkeys/mechmini/v1/info.json diff --git a/keyboards/mechmini/v1/keymaps/default/keymap.c b/keyboards/mechkeys/mechmini/v1/keymaps/default/keymap.c similarity index 100% rename from keyboards/mechmini/v1/keymaps/default/keymap.c rename to keyboards/mechkeys/mechmini/v1/keymaps/default/keymap.c diff --git a/keyboards/mechmini/v1/keymaps/pitty/keymap.c b/keyboards/mechkeys/mechmini/v1/keymaps/pitty/keymap.c similarity index 100% rename from keyboards/mechmini/v1/keymaps/pitty/keymap.c rename to keyboards/mechkeys/mechmini/v1/keymaps/pitty/keymap.c diff --git a/keyboards/mechmini/v1/readme.md b/keyboards/mechkeys/mechmini/v1/readme.md similarity index 92% rename from keyboards/mechmini/v1/readme.md rename to keyboards/mechkeys/mechmini/v1/readme.md index 902948c24dad..d6b88d9c0485 100644 --- a/keyboards/mechmini/v1/readme.md +++ b/keyboards/mechkeys/mechmini/v1/readme.md @@ -8,11 +8,11 @@ A 40% ortholinear/staggered keyboard, that was originally bootmapper and can be Make example for this keyboard (after setting up your build environment): - make mechmini/v1:default + make mechkeys/mechmini/v1:default Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) - make mechmini/v1:default:flash + make mechkeys/mechmini/v1:default:flash **Reset Key**: Hold down the key commonly programmed as *L_Ctrl* while plugging in the keyboard. diff --git a/keyboards/mechmini/v1/rules.mk b/keyboards/mechkeys/mechmini/v1/rules.mk similarity index 92% rename from keyboards/mechmini/v1/rules.mk rename to keyboards/mechkeys/mechmini/v1/rules.mk index 6905e73c2771..a7d4a67a166c 100644 --- a/keyboards/mechmini/v1/rules.mk +++ b/keyboards/mechkeys/mechmini/v1/rules.mk @@ -2,7 +2,7 @@ MCU = atmega32a # Bootloader selection -BOOTLOADER = atmel-dfu +BOOTLOADER = bootloadhid # Build Options # change yes to no to disable diff --git a/keyboards/mechmini/v1/v1.c b/keyboards/mechkeys/mechmini/v1/v1.c similarity index 100% rename from keyboards/mechmini/v1/v1.c rename to keyboards/mechkeys/mechmini/v1/v1.c diff --git a/keyboards/mechmini/v1/v1.h b/keyboards/mechkeys/mechmini/v1/v1.h similarity index 98% rename from keyboards/mechmini/v1/v1.h rename to keyboards/mechkeys/mechmini/v1/v1.h index 526f12e410a6..07d1e683f7d1 100644 --- a/keyboards/mechmini/v1/v1.h +++ b/keyboards/mechkeys/mechmini/v1/v1.h @@ -17,7 +17,7 @@ along with this program. If not, see . #pragma once -#include "mechmini.h" +#include "../mechmini.h" #define ___ KC_NO diff --git a/keyboards/mechmini/v2/config.h b/keyboards/mechkeys/mechmini/v2/config.h similarity index 100% rename from keyboards/mechmini/v2/config.h rename to keyboards/mechkeys/mechmini/v2/config.h diff --git a/keyboards/mechmini/v2/info.json b/keyboards/mechkeys/mechmini/v2/info.json similarity index 100% rename from keyboards/mechmini/v2/info.json rename to keyboards/mechkeys/mechmini/v2/info.json diff --git a/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/2u_space_ortho/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/2u_space_ortho/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/625_space/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/625_space/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/625_space/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/625_space/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/arkag/config.h b/keyboards/mechkeys/mechmini/v2/keymaps/arkag/config.h similarity index 100% rename from keyboards/mechmini/v2/keymaps/arkag/config.h rename to keyboards/mechkeys/mechmini/v2/keymaps/arkag/config.h diff --git a/keyboards/mechmini/v2/keymaps/arkag/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/arkag/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/arkag/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/arkag/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/arkag/rules.mk b/keyboards/mechkeys/mechmini/v2/keymaps/arkag/rules.mk similarity index 100% rename from keyboards/mechmini/v2/keymaps/arkag/rules.mk rename to keyboards/mechkeys/mechmini/v2/keymaps/arkag/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/default/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/default/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/default/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/default/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/default/readme.md b/keyboards/mechkeys/mechmini/v2/keymaps/default/readme.md similarity index 100% rename from keyboards/mechmini/v2/keymaps/default/readme.md rename to keyboards/mechkeys/mechmini/v2/keymaps/default/readme.md diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/config.h b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/config.h similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_625_space/config.h rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/config.h diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/readme.md b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/readme.md similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_625_space/readme.md rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/readme.md diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/rules.mk b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/rules.mk similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_625_space/rules.mk rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_625_space/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/config.h b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/config.h similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_split_space/config.h rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/config.h diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/readme.md b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/readme.md similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_split_space/readme.md rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/readme.md diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/rules.mk b/keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/rules.mk similarity index 100% rename from keyboards/mechmini/v2/keymaps/lbibass_split_space/rules.mk rename to keyboards/mechkeys/mechmini/v2/keymaps/lbibass_split_space/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/ortho/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/ortho/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/ortho/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/ortho/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/config.h b/keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/config.h similarity index 100% rename from keyboards/mechmini/v2/keymaps/spacebarracecar/config.h rename to keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/config.h diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/spacebarracecar/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/readme.md b/keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/readme.md similarity index 100% rename from keyboards/mechmini/v2/keymaps/spacebarracecar/readme.md rename to keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/readme.md diff --git a/keyboards/mechmini/v2/keymaps/spacebarracecar/rules.mk b/keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/rules.mk similarity index 100% rename from keyboards/mechmini/v2/keymaps/spacebarracecar/rules.mk rename to keyboards/mechkeys/mechmini/v2/keymaps/spacebarracecar/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/split_space/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/split_space/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/split_space/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/split_space/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/split_space/readme.md b/keyboards/mechkeys/mechmini/v2/keymaps/split_space/readme.md similarity index 100% rename from keyboards/mechmini/v2/keymaps/split_space/readme.md rename to keyboards/mechkeys/mechmini/v2/keymaps/split_space/readme.md diff --git a/keyboards/mechmini/v2/keymaps/via/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/via/keymap.c similarity index 93% rename from keyboards/mechmini/v2/keymaps/via/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/via/keymap.c index 7c7c2103c0e0..e77d9d885910 100644 --- a/keyboards/mechmini/v2/keymaps/via/keymap.c +++ b/keyboards/mechkeys/mechmini/v2/keymaps/via/keymap.c @@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_ortho( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, M(1), M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), [2] = LAYOUT_ortho( diff --git a/keyboards/bakeneko60/keymaps/via/rules.mk b/keyboards/mechkeys/mechmini/v2/keymaps/via/rules.mk similarity index 100% rename from keyboards/bakeneko60/keymaps/via/rules.mk rename to keyboards/mechkeys/mechmini/v2/keymaps/via/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/wsturgiss/config.h b/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/config.h similarity index 100% rename from keyboards/mechmini/v2/keymaps/wsturgiss/config.h rename to keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/config.h diff --git a/keyboards/mechmini/v2/keymaps/wsturgiss/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/keymap.c similarity index 100% rename from keyboards/mechmini/v2/keymaps/wsturgiss/keymap.c rename to keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/keymap.c diff --git a/keyboards/mechmini/v2/keymaps/wsturgiss/rules.mk b/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/rules.mk similarity index 100% rename from keyboards/mechmini/v2/keymaps/wsturgiss/rules.mk rename to keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/rules.mk diff --git a/keyboards/mechmini/v2/readme.md b/keyboards/mechkeys/mechmini/v2/readme.md similarity index 95% rename from keyboards/mechmini/v2/readme.md rename to keyboards/mechkeys/mechmini/v2/readme.md index fdc9fef9bf2b..8724f16a0ff2 100644 --- a/keyboards/mechmini/v2/readme.md +++ b/keyboards/mechkeys/mechmini/v2/readme.md @@ -13,7 +13,7 @@ Hardware Availability: [MECHKEYS Mechmini 2.0](https://mechkeys.ca/collections/k Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space): - make mechmini/v2:default + make mechkeys/mechmini/v2:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/mechmini/v2/rules.mk b/keyboards/mechkeys/mechmini/v2/rules.mk similarity index 100% rename from keyboards/mechmini/v2/rules.mk rename to keyboards/mechkeys/mechmini/v2/rules.mk diff --git a/keyboards/mechmini/v2/v2.c b/keyboards/mechkeys/mechmini/v2/v2.c similarity index 100% rename from keyboards/mechmini/v2/v2.c rename to keyboards/mechkeys/mechmini/v2/v2.c diff --git a/keyboards/mechmini/v2/v2.h b/keyboards/mechkeys/mechmini/v2/v2.h similarity index 100% rename from keyboards/mechmini/v2/v2.h rename to keyboards/mechkeys/mechmini/v2/v2.h diff --git a/keyboards/mechlovin/mechlovin9/rev1/rules.mk b/keyboards/mechlovin/mechlovin9/rev1/rules.mk index 1333470e5972..927204fc74ce 100644 --- a/keyboards/mechlovin/mechlovin9/rev1/rules.mk +++ b/keyboards/mechlovin/mechlovin9/rev1/rules.mk @@ -2,6 +2,9 @@ MCU = STM32F303 BOARD = QMK_PROTON_C +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/mechlovin/olly/jf/keymaps/via/config.h b/keyboards/mechlovin/olly/jf/keymaps/via/config.h index f330025a008f..82c2e51eb914 100644 --- a/keyboards/mechlovin/olly/jf/keymaps/via/config.h +++ b/keyboards/mechlovin/olly/jf/keymaps/via/config.h @@ -17,6 +17,4 @@ along with this program. If not, see . #pragma once -#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1607 -#define DYNAMIC_KEYMAP_LAYER_COUNT 6 - +#define DYNAMIC_KEYMAP_LAYER_COUNT 3 diff --git a/keyboards/mechlovin/olly/jf/keymaps/via/keymap.c b/keyboards/mechlovin/olly/jf/keymaps/via/keymap.c index c90eeb18307e..18ac685abc79 100644 --- a/keyboards/mechlovin/olly/jf/keymaps/via/keymap.c +++ b/keyboards/mechlovin/olly/jf/keymaps/via/keymap.c @@ -40,29 +40,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, 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 ), - [3] = LAYOUT_all( - 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, - 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, 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, 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, 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, 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 - ), - [4] = LAYOUT_all( - 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, - 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, 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, 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, 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, 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 - ), - [5] = LAYOUT_all( - 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, - 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, 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, 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, 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, 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 - ), - }; \ No newline at end of file diff --git a/keyboards/mechlovin/olly/jf/rules.mk b/keyboards/mechlovin/olly/jf/rules.mk index c0c9b2d7ea9c..2fafe64f12e8 100644 --- a/keyboards/mechlovin/olly/jf/rules.mk +++ b/keyboards/mechlovin/olly/jf/rules.mk @@ -5,7 +5,7 @@ MCU = atmega32a F_CPU = 16000000 # Bootloader selection -BOOTLOADER = USBasp +BOOTLOADER = usbasploader # Build Options # change yes to no to disable @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = lite -SRC += matrix.c \ No newline at end of file +SRC += matrix.c diff --git a/keyboards/mechmini/rules.mk b/keyboards/mechmini/rules.mk deleted file mode 100644 index 71dae51277b7..000000000000 --- a/keyboards/mechmini/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = mechmini/v2 diff --git a/keyboards/mitosis/config.h b/keyboards/mitosis/config.h index 94e84e680e74..2c72eed5f2d4 100644 --- a/keyboards/mitosis/config.h +++ b/keyboards/mitosis/config.h @@ -56,12 +56,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/mitosis/matrix.c b/keyboards/mitosis/matrix.c index 71c372a3ce80..a92c3e843108 100644 --- a/keyboards/mitosis/matrix.c +++ b/keyboards/mitosis/matrix.c @@ -15,80 +15,21 @@ 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 -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} -void matrix_init(void) { +#include "quantum.h" +#include "matrix.h" +#include "uart.h" - matrix_init_quantum(); - serial_init(); +void matrix_init_custom(void) { + uart_init(1000000); } -uint8_t matrix_scan(void) -{ +bool matrix_scan_custom(matrix_row_t current_matrix[]) { uint32_t timeout = 0; + bool changed = false; //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates entirely, erase the last data uint8_t uart_data[11] = {0}; @@ -98,58 +39,27 @@ uint8_t matrix_scan(void) //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while (!uart_available()) { timeout++; - if (timeout > 10000){ + if (timeout > 10000) { break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { + if (uart_data[10] == 0xE0) { //shifting and transferring the keystates to the QMK matrix variable for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5; + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 5; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; } } - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/nek_type_a/rules.mk b/keyboards/nek_type_a/rules.mk index ea79c962dae3..0a8adccb52e4 100644 --- a/keyboards/nek_type_a/rules.mk +++ b/keyboards/nek_type_a/rules.mk @@ -22,6 +22,6 @@ AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = yes DEBUG_ENABLE = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += matrix.c mcp23017.c diff --git a/keyboards/nomu30/rules.mk b/keyboards/nomu30/rules.mk deleted file mode 100644 index 8a7395940705..000000000000 --- a/keyboards/nomu30/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = nomu30/rev1 diff --git a/keyboards/nk1/config.h b/keyboards/novelkeys/nk1/config.h similarity index 100% rename from keyboards/nk1/config.h rename to keyboards/novelkeys/nk1/config.h diff --git a/keyboards/nk1/info.json b/keyboards/novelkeys/nk1/info.json similarity index 100% rename from keyboards/nk1/info.json rename to keyboards/novelkeys/nk1/info.json diff --git a/keyboards/nk1/keymaps/default/keymap.c b/keyboards/novelkeys/nk1/keymaps/default/keymap.c similarity index 100% rename from keyboards/nk1/keymaps/default/keymap.c rename to keyboards/novelkeys/nk1/keymaps/default/keymap.c diff --git a/keyboards/nk1/keymaps/default/readme.md b/keyboards/novelkeys/nk1/keymaps/default/readme.md similarity index 100% rename from keyboards/nk1/keymaps/default/readme.md rename to keyboards/novelkeys/nk1/keymaps/default/readme.md diff --git a/keyboards/nk1/keymaps/via/keymap.c b/keyboards/novelkeys/nk1/keymaps/via/keymap.c similarity index 100% rename from keyboards/nk1/keymaps/via/keymap.c rename to keyboards/novelkeys/nk1/keymaps/via/keymap.c diff --git a/keyboards/nk1/keymaps/via/readme.md b/keyboards/novelkeys/nk1/keymaps/via/readme.md similarity index 100% rename from keyboards/nk1/keymaps/via/readme.md rename to keyboards/novelkeys/nk1/keymaps/via/readme.md diff --git a/keyboards/ergoarrows/keymaps/via/rules.mk b/keyboards/novelkeys/nk1/keymaps/via/rules.mk similarity index 100% rename from keyboards/ergoarrows/keymaps/via/rules.mk rename to keyboards/novelkeys/nk1/keymaps/via/rules.mk diff --git a/keyboards/nk1/nk1.c b/keyboards/novelkeys/nk1/nk1.c similarity index 100% rename from keyboards/nk1/nk1.c rename to keyboards/novelkeys/nk1/nk1.c diff --git a/keyboards/nk1/nk1.h b/keyboards/novelkeys/nk1/nk1.h similarity index 100% rename from keyboards/nk1/nk1.h rename to keyboards/novelkeys/nk1/nk1.h diff --git a/keyboards/nk1/readme.md b/keyboards/novelkeys/nk1/readme.md similarity index 96% rename from keyboards/nk1/readme.md rename to keyboards/novelkeys/nk1/readme.md index bc668481b526..720d03adbcf0 100644 --- a/keyboards/nk1/readme.md +++ b/keyboards/novelkeys/nk1/readme.md @@ -12,7 +12,7 @@ A big switch keypad! Make example for this keyboard (after setting up your build environment): - make nk1:default + make novelkeys/nk1: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/nk1/rules.mk b/keyboards/novelkeys/nk1/rules.mk similarity index 100% rename from keyboards/nk1/rules.mk rename to keyboards/novelkeys/nk1/rules.mk diff --git a/keyboards/nk65/config.h b/keyboards/novelkeys/nk65/config.h similarity index 100% rename from keyboards/nk65/config.h rename to keyboards/novelkeys/nk65/config.h diff --git a/keyboards/nk65/halconf.h b/keyboards/novelkeys/nk65/halconf.h similarity index 100% rename from keyboards/nk65/halconf.h rename to keyboards/novelkeys/nk65/halconf.h diff --git a/keyboards/nk65/info.json b/keyboards/novelkeys/nk65/info.json similarity index 100% rename from keyboards/nk65/info.json rename to keyboards/novelkeys/nk65/info.json diff --git a/keyboards/nk65/keymaps/default/keymap.c b/keyboards/novelkeys/nk65/keymaps/default/keymap.c similarity index 100% rename from keyboards/nk65/keymaps/default/keymap.c rename to keyboards/novelkeys/nk65/keymaps/default/keymap.c diff --git a/keyboards/nk65/keymaps/default/readme.md b/keyboards/novelkeys/nk65/keymaps/default/readme.md similarity index 100% rename from keyboards/nk65/keymaps/default/readme.md rename to keyboards/novelkeys/nk65/keymaps/default/readme.md diff --git a/keyboards/nk65/keymaps/madhatter/keymap.c b/keyboards/novelkeys/nk65/keymaps/madhatter/keymap.c similarity index 100% rename from keyboards/nk65/keymaps/madhatter/keymap.c rename to keyboards/novelkeys/nk65/keymaps/madhatter/keymap.c diff --git a/keyboards/nk65/keymaps/via/keymap.c b/keyboards/novelkeys/nk65/keymaps/via/keymap.c similarity index 100% rename from keyboards/nk65/keymaps/via/keymap.c rename to keyboards/novelkeys/nk65/keymaps/via/keymap.c diff --git a/keyboards/nk65/keymaps/via/readme.md b/keyboards/novelkeys/nk65/keymaps/via/readme.md similarity index 100% rename from keyboards/nk65/keymaps/via/readme.md rename to keyboards/novelkeys/nk65/keymaps/via/readme.md diff --git a/keyboards/le_chiffre/keymaps/via/rules.mk b/keyboards/novelkeys/nk65/keymaps/via/rules.mk old mode 100644 new mode 100755 similarity index 100% rename from keyboards/le_chiffre/keymaps/via/rules.mk rename to keyboards/novelkeys/nk65/keymaps/via/rules.mk diff --git a/keyboards/nk65/mcuconf.h b/keyboards/novelkeys/nk65/mcuconf.h similarity index 100% rename from keyboards/nk65/mcuconf.h rename to keyboards/novelkeys/nk65/mcuconf.h diff --git a/keyboards/nk65/nk65.c b/keyboards/novelkeys/nk65/nk65.c similarity index 100% rename from keyboards/nk65/nk65.c rename to keyboards/novelkeys/nk65/nk65.c diff --git a/keyboards/nk65/nk65.h b/keyboards/novelkeys/nk65/nk65.h similarity index 100% rename from keyboards/nk65/nk65.h rename to keyboards/novelkeys/nk65/nk65.h diff --git a/keyboards/nk65/readme.md b/keyboards/novelkeys/nk65/readme.md similarity index 97% rename from keyboards/nk65/readme.md rename to keyboards/novelkeys/nk65/readme.md index 3bd04210d1b5..38f66500b911 100755 --- a/keyboards/nk65/readme.md +++ b/keyboards/novelkeys/nk65/readme.md @@ -19,7 +19,7 @@ NOTE: For PCBs with revision v1.4 or later please use nk65/v1_4 in the make comm Make example for this keyboard (after setting up your build environment): - make nk65:via + make novelkeys/nk65:via 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/nk65/rules.mk b/keyboards/novelkeys/nk65/rules.mk similarity index 100% rename from keyboards/nk65/rules.mk rename to keyboards/novelkeys/nk65/rules.mk diff --git a/keyboards/nk65/v1_4/config.h b/keyboards/novelkeys/nk65/v1_4/config.h similarity index 100% rename from keyboards/nk65/v1_4/config.h rename to keyboards/novelkeys/nk65/v1_4/config.h diff --git a/keyboards/nk65/v1_4/readme.md b/keyboards/novelkeys/nk65/v1_4/readme.md similarity index 100% rename from keyboards/nk65/v1_4/readme.md rename to keyboards/novelkeys/nk65/v1_4/readme.md diff --git a/keyboards/niu_mini/keymaps/planck/rules.mk b/keyboards/novelkeys/nk65/v1_4/rules.mk old mode 100644 new mode 100755 similarity index 100% rename from keyboards/niu_mini/keymaps/planck/rules.mk rename to keyboards/novelkeys/nk65/v1_4/rules.mk diff --git a/keyboards/nk87/config.h b/keyboards/novelkeys/nk87/config.h similarity index 100% rename from keyboards/nk87/config.h rename to keyboards/novelkeys/nk87/config.h diff --git a/keyboards/nk87/halconf.h b/keyboards/novelkeys/nk87/halconf.h similarity index 100% rename from keyboards/nk87/halconf.h rename to keyboards/novelkeys/nk87/halconf.h diff --git a/keyboards/nk87/info.json b/keyboards/novelkeys/nk87/info.json similarity index 100% rename from keyboards/nk87/info.json rename to keyboards/novelkeys/nk87/info.json diff --git a/keyboards/nk87/keymaps/default/keymap.c b/keyboards/novelkeys/nk87/keymaps/default/keymap.c similarity index 100% rename from keyboards/nk87/keymaps/default/keymap.c rename to keyboards/novelkeys/nk87/keymaps/default/keymap.c diff --git a/keyboards/nk87/keymaps/default/readme.md b/keyboards/novelkeys/nk87/keymaps/default/readme.md similarity index 100% rename from keyboards/nk87/keymaps/default/readme.md rename to keyboards/novelkeys/nk87/keymaps/default/readme.md diff --git a/keyboards/nk87/keymaps/via/keymap.c b/keyboards/novelkeys/nk87/keymaps/via/keymap.c similarity index 100% rename from keyboards/nk87/keymaps/via/keymap.c rename to keyboards/novelkeys/nk87/keymaps/via/keymap.c diff --git a/keyboards/nk87/keymaps/via/readme.md b/keyboards/novelkeys/nk87/keymaps/via/readme.md similarity index 100% rename from keyboards/nk87/keymaps/via/readme.md rename to keyboards/novelkeys/nk87/keymaps/via/readme.md diff --git a/keyboards/ls_60/keymaps/via/rules.mk b/keyboards/novelkeys/nk87/keymaps/via/rules.mk old mode 100644 new mode 100755 similarity index 100% rename from keyboards/ls_60/keymaps/via/rules.mk rename to keyboards/novelkeys/nk87/keymaps/via/rules.mk diff --git a/keyboards/nk87/mcuconf.h b/keyboards/novelkeys/nk87/mcuconf.h similarity index 100% rename from keyboards/nk87/mcuconf.h rename to keyboards/novelkeys/nk87/mcuconf.h diff --git a/keyboards/nk87/nk87.c b/keyboards/novelkeys/nk87/nk87.c similarity index 100% rename from keyboards/nk87/nk87.c rename to keyboards/novelkeys/nk87/nk87.c diff --git a/keyboards/nk87/nk87.h b/keyboards/novelkeys/nk87/nk87.h similarity index 100% rename from keyboards/nk87/nk87.h rename to keyboards/novelkeys/nk87/nk87.h diff --git a/keyboards/nk87/readme.md b/keyboards/novelkeys/nk87/readme.md similarity index 96% rename from keyboards/nk87/readme.md rename to keyboards/novelkeys/nk87/readme.md index 9ea4d9971889..0de3e08b401e 100755 --- a/keyboards/nk87/readme.md +++ b/keyboards/novelkeys/nk87/readme.md @@ -14,7 +14,7 @@ This is a standard fixed layout TKL PCB. It supports VIA and full per-key RGB. Make example for this keyboard (after setting up your build environment): - make nk87:default + make novelkeys/nk87: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/nk87/rules.mk b/keyboards/novelkeys/nk87/rules.mk similarity index 100% rename from keyboards/nk87/rules.mk rename to keyboards/novelkeys/nk87/rules.mk diff --git a/keyboards/novelpad/config.h b/keyboards/novelkeys/novelpad/config.h similarity index 100% rename from keyboards/novelpad/config.h rename to keyboards/novelkeys/novelpad/config.h diff --git a/keyboards/novelpad/info.json b/keyboards/novelkeys/novelpad/info.json similarity index 100% rename from keyboards/novelpad/info.json rename to keyboards/novelkeys/novelpad/info.json diff --git a/keyboards/novelpad/keymaps/0xdec/keymap.c b/keyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c similarity index 100% rename from keyboards/novelpad/keymaps/0xdec/keymap.c rename to keyboards/novelkeys/novelpad/keymaps/0xdec/keymap.c diff --git a/keyboards/novelpad/keymaps/default/keymap.c b/keyboards/novelkeys/novelpad/keymaps/default/keymap.c similarity index 100% rename from keyboards/novelpad/keymaps/default/keymap.c rename to keyboards/novelkeys/novelpad/keymaps/default/keymap.c diff --git a/keyboards/novelpad/novelpad.c b/keyboards/novelkeys/novelpad/novelpad.c similarity index 100% rename from keyboards/novelpad/novelpad.c rename to keyboards/novelkeys/novelpad/novelpad.c diff --git a/keyboards/novelpad/novelpad.h b/keyboards/novelkeys/novelpad/novelpad.h similarity index 100% rename from keyboards/novelpad/novelpad.h rename to keyboards/novelkeys/novelpad/novelpad.h diff --git a/keyboards/novelpad/readme.md b/keyboards/novelkeys/novelpad/readme.md similarity index 95% rename from keyboards/novelpad/readme.md rename to keyboards/novelkeys/novelpad/readme.md index 0cde8337ca0f..49773b8dc0f5 100644 --- a/keyboards/novelpad/readme.md +++ b/keyboards/novelkeys/novelpad/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [Novelkeys.xyz](https://novelkeys.xyz) Make example for this keyboard (after setting up your build environment): - make novelpad:default + make novelkeys/novelpad: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/novelpad/rules.mk b/keyboards/novelkeys/novelpad/rules.mk similarity index 100% rename from keyboards/novelpad/rules.mk rename to keyboards/novelkeys/novelpad/rules.mk diff --git a/keyboards/noxary/valhalla/rules.mk b/keyboards/noxary/valhalla/rules.mk index f7365adecf66..75490909f341 100644 --- a/keyboards/noxary/valhalla/rules.mk +++ b/keyboards/noxary/valhalla/rules.mk @@ -7,7 +7,7 @@ BOOTLOADER = stm32-dfu # Build options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug diff --git a/keyboards/arch_36/arch_36.c b/keyboards/obosob/arch_36/arch_36.c similarity index 100% rename from keyboards/arch_36/arch_36.c rename to keyboards/obosob/arch_36/arch_36.c diff --git a/keyboards/arch_36/arch_36.h b/keyboards/obosob/arch_36/arch_36.h similarity index 100% rename from keyboards/arch_36/arch_36.h rename to keyboards/obosob/arch_36/arch_36.h diff --git a/keyboards/arch_36/config.h b/keyboards/obosob/arch_36/config.h similarity index 100% rename from keyboards/arch_36/config.h rename to keyboards/obosob/arch_36/config.h diff --git a/keyboards/arch_36/info.json b/keyboards/obosob/arch_36/info.json similarity index 100% rename from keyboards/arch_36/info.json rename to keyboards/obosob/arch_36/info.json diff --git a/keyboards/arch_36/keymaps/default/keymap.c b/keyboards/obosob/arch_36/keymaps/default/keymap.c similarity index 100% rename from keyboards/arch_36/keymaps/default/keymap.c rename to keyboards/obosob/arch_36/keymaps/default/keymap.c diff --git a/keyboards/arch_36/keymaps/obosob/config.h b/keyboards/obosob/arch_36/keymaps/obosob/config.h similarity index 100% rename from keyboards/arch_36/keymaps/obosob/config.h rename to keyboards/obosob/arch_36/keymaps/obosob/config.h diff --git a/keyboards/arch_36/keymaps/obosob/keymap.c b/keyboards/obosob/arch_36/keymaps/obosob/keymap.c similarity index 100% rename from keyboards/arch_36/keymaps/obosob/keymap.c rename to keyboards/obosob/arch_36/keymaps/obosob/keymap.c diff --git a/keyboards/arch_36/keymaps/obosob/readme.md b/keyboards/obosob/arch_36/keymaps/obosob/readme.md similarity index 100% rename from keyboards/arch_36/keymaps/obosob/readme.md rename to keyboards/obosob/arch_36/keymaps/obosob/readme.md diff --git a/keyboards/arch_36/keymaps/obosob/rules.mk b/keyboards/obosob/arch_36/keymaps/obosob/rules.mk similarity index 100% rename from keyboards/arch_36/keymaps/obosob/rules.mk rename to keyboards/obosob/arch_36/keymaps/obosob/rules.mk diff --git a/keyboards/arch_36/readme.md b/keyboards/obosob/arch_36/readme.md similarity index 88% rename from keyboards/arch_36/readme.md rename to keyboards/obosob/arch_36/readme.md index d0e16434ee9f..77c07a2a3ba4 100644 --- a/keyboards/arch_36/readme.md +++ b/keyboards/obosob/arch_36/readme.md @@ -7,10 +7,10 @@ An ergonomic 30% split keyboard Make example for this keyboard (after setting up your build environment): - make arch_36:default + make obosob/arch_36:default Example of flashing this keyboard: - make arch_36:default:flash + make obosob/arch_36: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/arch_36/rules.mk b/keyboards/obosob/arch_36/rules.mk similarity index 100% rename from keyboards/arch_36/rules.mk rename to keyboards/obosob/arch_36/rules.mk diff --git a/keyboards/steal_this_keyboard/config.h b/keyboards/obosob/steal_this_keyboard/config.h similarity index 100% rename from keyboards/steal_this_keyboard/config.h rename to keyboards/obosob/steal_this_keyboard/config.h diff --git a/keyboards/steal_this_keyboard/info.json b/keyboards/obosob/steal_this_keyboard/info.json similarity index 100% rename from keyboards/steal_this_keyboard/info.json rename to keyboards/obosob/steal_this_keyboard/info.json diff --git a/keyboards/steal_this_keyboard/keymaps/default/config.h b/keyboards/obosob/steal_this_keyboard/keymaps/default/config.h similarity index 100% rename from keyboards/steal_this_keyboard/keymaps/default/config.h rename to keyboards/obosob/steal_this_keyboard/keymaps/default/config.h diff --git a/keyboards/steal_this_keyboard/keymaps/default/keymap.c b/keyboards/obosob/steal_this_keyboard/keymaps/default/keymap.c similarity index 100% rename from keyboards/steal_this_keyboard/keymaps/default/keymap.c rename to keyboards/obosob/steal_this_keyboard/keymaps/default/keymap.c diff --git a/keyboards/steal_this_keyboard/readme.md b/keyboards/obosob/steal_this_keyboard/readme.md similarity index 93% rename from keyboards/steal_this_keyboard/readme.md rename to keyboards/obosob/steal_this_keyboard/readme.md index 395487f7b302..55384a92340a 100644 --- a/keyboards/steal_this_keyboard/readme.md +++ b/keyboards/obosob/steal_this_keyboard/readme.md @@ -6,6 +6,6 @@ A split 34 keys column staggered keyboard named and decorated after the System o Make examples for this keyboard (after setting up your build environment): - make steal_this_keyboard:default + make obosob/steal_this_keyboard: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/steal_this_keyboard/rules.mk b/keyboards/obosob/steal_this_keyboard/rules.mk similarity index 100% rename from keyboards/steal_this_keyboard/rules.mk rename to keyboards/obosob/steal_this_keyboard/rules.mk diff --git a/keyboards/steal_this_keyboard/steal_this_keyboard.c b/keyboards/obosob/steal_this_keyboard/steal_this_keyboard.c similarity index 100% rename from keyboards/steal_this_keyboard/steal_this_keyboard.c rename to keyboards/obosob/steal_this_keyboard/steal_this_keyboard.c diff --git a/keyboards/steal_this_keyboard/steal_this_keyboard.h b/keyboards/obosob/steal_this_keyboard/steal_this_keyboard.h similarity index 100% rename from keyboards/steal_this_keyboard/steal_this_keyboard.h rename to keyboards/obosob/steal_this_keyboard/steal_this_keyboard.h diff --git a/keyboards/mechmini/v1/.noci b/keyboards/omkbd/ergodash/.noci similarity index 100% rename from keyboards/mechmini/v1/.noci rename to keyboards/omkbd/ergodash/.noci diff --git a/keyboards/getta25/config.h b/keyboards/omkbd/ergodash/config.h similarity index 100% rename from keyboards/getta25/config.h rename to keyboards/omkbd/ergodash/config.h diff --git a/keyboards/ergodash/ergodash.c b/keyboards/omkbd/ergodash/ergodash.c similarity index 100% rename from keyboards/ergodash/ergodash.c rename to keyboards/omkbd/ergodash/ergodash.c diff --git a/keyboards/ergodash/ergodash.h b/keyboards/omkbd/ergodash/ergodash.h similarity index 64% rename from keyboards/ergodash/ergodash.h rename to keyboards/omkbd/ergodash/ergodash.h index 5fba70e75d1e..8c8bd3cdc393 100644 --- a/keyboards/ergodash/ergodash.h +++ b/keyboards/omkbd/ergodash/ergodash.h @@ -2,10 +2,10 @@ #include "quantum.h" -#ifdef KEYBOARD_ergodash_rev1 +#ifdef KEYBOARD_omkbd_ergodash_rev1 #include "rev1.h" #endif // #ifdef KEYBOARD_ergodash_rev1 -#ifdef KEYBOARD_ergodash_mini +#ifdef KEYBOARD_omkbd_ergodash_mini #include "mini.h" #endif diff --git a/keyboards/minidox/.noci b/keyboards/omkbd/ergodash/mini/.noci similarity index 100% rename from keyboards/minidox/.noci rename to keyboards/omkbd/ergodash/mini/.noci diff --git a/keyboards/ergodash/mini/config.h b/keyboards/omkbd/ergodash/mini/config.h similarity index 100% rename from keyboards/ergodash/mini/config.h rename to keyboards/omkbd/ergodash/mini/config.h diff --git a/keyboards/ergodash/mini/info.json b/keyboards/omkbd/ergodash/mini/info.json similarity index 100% rename from keyboards/ergodash/mini/info.json rename to keyboards/omkbd/ergodash/mini/info.json diff --git a/keyboards/ergodash/mini/keymaps/default/config.h b/keyboards/omkbd/ergodash/mini/keymaps/default/config.h similarity index 100% rename from keyboards/ergodash/mini/keymaps/default/config.h rename to keyboards/omkbd/ergodash/mini/keymaps/default/config.h diff --git a/keyboards/ergodash/mini/keymaps/default/keymap.c b/keyboards/omkbd/ergodash/mini/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergodash/mini/keymaps/default/keymap.c rename to keyboards/omkbd/ergodash/mini/keymaps/default/keymap.c diff --git a/keyboards/ergodash/mini/keymaps/default/rules.mk b/keyboards/omkbd/ergodash/mini/keymaps/default/rules.mk similarity index 100% rename from keyboards/ergodash/mini/keymaps/default/rules.mk rename to keyboards/omkbd/ergodash/mini/keymaps/default/rules.mk diff --git a/keyboards/ergodash/mini/keymaps/toyoshimahidenori/config.h b/keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/config.h similarity index 100% rename from keyboards/ergodash/mini/keymaps/toyoshimahidenori/config.h rename to keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/config.h diff --git a/keyboards/ergodash/mini/keymaps/toyoshimahidenori/keymap.c b/keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/keymap.c similarity index 100% rename from keyboards/ergodash/mini/keymaps/toyoshimahidenori/keymap.c rename to keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/keymap.c diff --git a/keyboards/ergodash/mini/keymaps/toyoshimahidenori/readme.md b/keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/readme.md similarity index 100% rename from keyboards/ergodash/mini/keymaps/toyoshimahidenori/readme.md rename to keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/readme.md diff --git a/keyboards/ergodash/mini/keymaps/toyoshimahidenori/rules.mk b/keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/rules.mk similarity index 100% rename from keyboards/ergodash/mini/keymaps/toyoshimahidenori/rules.mk rename to keyboards/omkbd/ergodash/mini/keymaps/toyoshimahidenori/rules.mk diff --git a/keyboards/ergodash/mini/keymaps/yoshimaru46/config.h b/keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/config.h similarity index 100% rename from keyboards/ergodash/mini/keymaps/yoshimaru46/config.h rename to keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/config.h diff --git a/keyboards/ergodash/mini/keymaps/yoshimaru46/keymap.c b/keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/keymap.c similarity index 100% rename from keyboards/ergodash/mini/keymaps/yoshimaru46/keymap.c rename to keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/keymap.c diff --git a/keyboards/ergodash/mini/keymaps/yoshimaru46/readme.md b/keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/readme.md similarity index 100% rename from keyboards/ergodash/mini/keymaps/yoshimaru46/readme.md rename to keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/readme.md diff --git a/keyboards/ergodash/mini/keymaps/yoshimaru46/rules.mk b/keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/rules.mk similarity index 100% rename from keyboards/ergodash/mini/keymaps/yoshimaru46/rules.mk rename to keyboards/omkbd/ergodash/mini/keymaps/yoshimaru46/rules.mk diff --git a/keyboards/ergodash/mini/mini.c b/keyboards/omkbd/ergodash/mini/mini.c similarity index 100% rename from keyboards/ergodash/mini/mini.c rename to keyboards/omkbd/ergodash/mini/mini.c diff --git a/keyboards/ergodash/mini/mini.h b/keyboards/omkbd/ergodash/mini/mini.h similarity index 100% rename from keyboards/ergodash/mini/mini.h rename to keyboards/omkbd/ergodash/mini/mini.h diff --git a/keyboards/ergodash/mini/readme.md b/keyboards/omkbd/ergodash/mini/readme.md similarity index 95% rename from keyboards/ergodash/mini/readme.md rename to keyboards/omkbd/ergodash/mini/readme.md index f830f3f1d993..273935f3e37d 100644 --- a/keyboards/ergodash/mini/readme.md +++ b/keyboards/omkbd/ergodash/mini/readme.md @@ -9,7 +9,7 @@ Hardware Availability: Order your own [yourself](https://github.com/omkbd/ErgoDa Make example for this keyboard (after setting up your build environment): - make ergodash/mini:default + make omkbd/ergodash/mini:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/ergodash/mini/rules.mk b/keyboards/omkbd/ergodash/mini/rules.mk similarity index 100% rename from keyboards/ergodash/mini/rules.mk rename to keyboards/omkbd/ergodash/mini/rules.mk diff --git a/keyboards/ergodash/readme.md b/keyboards/omkbd/ergodash/readme.md similarity index 93% rename from keyboards/ergodash/readme.md rename to keyboards/omkbd/ergodash/readme.md index 27672c3ecf37..4260397a9902 100644 --- a/keyboards/ergodash/readme.md +++ b/keyboards/omkbd/ergodash/readme.md @@ -9,12 +9,12 @@ Hardware Availability: Order your own [yourself](https://github.com/omkbd/ErgoDa Make example for this keyboard (after setting up your build environment): - make ergodash/rev1:default + make omkbd/ergodash/rev1:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Install Example: (for pro micro) - `make ergodash/rev1:default:avrdude` + `make omkbd/ergodash/rev1:default:avrdude` Note: "rev1" is for PCB ver 1.0,1.1,1.2 diff --git a/keyboards/naked48/.noci b/keyboards/omkbd/ergodash/rev1/.noci similarity index 100% rename from keyboards/naked48/.noci rename to keyboards/omkbd/ergodash/rev1/.noci diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/omkbd/ergodash/rev1/config.h similarity index 100% rename from keyboards/ergodash/rev1/config.h rename to keyboards/omkbd/ergodash/rev1/config.h diff --git a/keyboards/ergodash/rev1/info.json b/keyboards/omkbd/ergodash/rev1/info.json similarity index 100% rename from keyboards/ergodash/rev1/info.json rename to keyboards/omkbd/ergodash/rev1/info.json diff --git a/keyboards/ergodash/rev1/keymaps/333fred/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/333fred/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/333fred/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/333fred/config.h diff --git a/keyboards/ergodash/rev1/keymaps/333fred/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/333fred/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/333fred/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/333fred/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/333fred/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/333fred/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/333fred/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/333fred/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/default/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/default/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/default/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/default/config.h diff --git a/keyboards/ergodash/rev1/keymaps/default/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/default/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/default/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/default/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/default/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/default/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/default/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/config.h diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json b/keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json similarity index 100% rename from keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json rename to keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/greenshadowmaker/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/ifohancroft/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/ifohancroft/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/config.h diff --git a/keyboards/ergodash/rev1/keymaps/ifohancroft/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/ifohancroft/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/ifohancroft/readme.md b/keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/readme.md similarity index 100% rename from keyboards/ergodash/rev1/keymaps/ifohancroft/readme.md rename to keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/readme.md diff --git a/keyboards/ergodash/rev1/keymaps/ifohancroft/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/ifohancroft/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/ifohancroft/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/m47ch4n/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/m47ch4n/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/config.h diff --git a/keyboards/ergodash/rev1/keymaps/m47ch4n/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/m47ch4n/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/m47ch4n/m47ch4ns_keymap.json b/keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/m47ch4ns_keymap.json similarity index 100% rename from keyboards/ergodash/rev1/keymaps/m47ch4n/m47ch4ns_keymap.json rename to keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/m47ch4ns_keymap.json diff --git a/keyboards/ergodash/rev1/keymaps/m47ch4n/readme.md b/keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/readme.md similarity index 100% rename from keyboards/ergodash/rev1/keymaps/m47ch4n/readme.md rename to keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/readme.md diff --git a/keyboards/ergodash/rev1/keymaps/m47ch4n/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/m47ch4n/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/m47ch4n/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/nopunin10did/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/config.h diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/layers.json b/keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/layers.json similarity index 100% rename from keyboards/ergodash/rev1/keymaps/nopunin10did/layers.json rename to keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/layers.json diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md b/keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/readme.md similarity index 100% rename from keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md rename to keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/readme.md diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/nopunin10did/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/nopunin10did/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/shadowprogr/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/shadowprogr/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/config.h diff --git a/keyboards/ergodash/rev1/keymaps/shadowprogr/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/shadowprogr/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/shadowprogr/readme.md b/keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/readme.md similarity index 100% rename from keyboards/ergodash/rev1/keymaps/shadowprogr/readme.md rename to keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/readme.md diff --git a/keyboards/ergodash/rev1/keymaps/shadowprogr/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/shadowprogr/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/shadowprogr/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/tw1t611/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/tw1t611/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/config.h diff --git a/keyboards/ergodash/rev1/keymaps/tw1t611/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/tw1t611/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/tw1t611/readme.md b/keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/readme.md similarity index 100% rename from keyboards/ergodash/rev1/keymaps/tw1t611/readme.md rename to keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/readme.md diff --git a/keyboards/ergodash/rev1/keymaps/tw1t611/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/tw1t611/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/tw1t611/rules.mk diff --git a/keyboards/ergodash/rev1/keymaps/yet-another-developer/config.h b/keyboards/omkbd/ergodash/rev1/keymaps/yet-another-developer/config.h similarity index 100% rename from keyboards/ergodash/rev1/keymaps/yet-another-developer/config.h rename to keyboards/omkbd/ergodash/rev1/keymaps/yet-another-developer/config.h diff --git a/keyboards/ergodash/rev1/keymaps/yet-another-developer/keymap.c b/keyboards/omkbd/ergodash/rev1/keymaps/yet-another-developer/keymap.c similarity index 100% rename from keyboards/ergodash/rev1/keymaps/yet-another-developer/keymap.c rename to keyboards/omkbd/ergodash/rev1/keymaps/yet-another-developer/keymap.c diff --git a/keyboards/ergodash/rev1/keymaps/yet-another-developer/rules.mk b/keyboards/omkbd/ergodash/rev1/keymaps/yet-another-developer/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/keymaps/yet-another-developer/rules.mk rename to keyboards/omkbd/ergodash/rev1/keymaps/yet-another-developer/rules.mk diff --git a/keyboards/ergodash/rev1/rev1.c b/keyboards/omkbd/ergodash/rev1/rev1.c similarity index 100% rename from keyboards/ergodash/rev1/rev1.c rename to keyboards/omkbd/ergodash/rev1/rev1.c diff --git a/keyboards/ergodash/rev1/rev1.h b/keyboards/omkbd/ergodash/rev1/rev1.h similarity index 100% rename from keyboards/ergodash/rev1/rev1.h rename to keyboards/omkbd/ergodash/rev1/rev1.h diff --git a/keyboards/ergodash/rev1/rules.mk b/keyboards/omkbd/ergodash/rev1/rules.mk similarity index 100% rename from keyboards/ergodash/rev1/rules.mk rename to keyboards/omkbd/ergodash/rev1/rules.mk diff --git a/keyboards/ergodash/rules.mk b/keyboards/omkbd/ergodash/rules.mk similarity index 94% rename from keyboards/ergodash/rules.mk rename to keyboards/omkbd/ergodash/rules.mk index de097dfbb3ec..5c44a744339a 100644 --- a/keyboards/ergodash/rules.mk +++ b/keyboards/omkbd/ergodash/rules.mk @@ -19,4 +19,4 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes # Enables split keyboard support -DEFAULT_FOLDER = ergodash/rev1 +DEFAULT_FOLDER = omkbd/ergodash/rev1 diff --git a/keyboards/naked64/.noci b/keyboards/omkbd/runner3680/3x6/.noci similarity index 100% rename from keyboards/naked64/.noci rename to keyboards/omkbd/runner3680/3x6/.noci diff --git a/keyboards/runner3680/3x6/3x6.c b/keyboards/omkbd/runner3680/3x6/3x6.c similarity index 100% rename from keyboards/runner3680/3x6/3x6.c rename to keyboards/omkbd/runner3680/3x6/3x6.c diff --git a/keyboards/runner3680/3x6/3x6.h b/keyboards/omkbd/runner3680/3x6/3x6.h similarity index 100% rename from keyboards/runner3680/3x6/3x6.h rename to keyboards/omkbd/runner3680/3x6/3x6.h diff --git a/keyboards/runner3680/3x6/config.h b/keyboards/omkbd/runner3680/3x6/config.h similarity index 100% rename from keyboards/runner3680/3x6/config.h rename to keyboards/omkbd/runner3680/3x6/config.h diff --git a/keyboards/runner3680/3x6/info.json b/keyboards/omkbd/runner3680/3x6/info.json similarity index 100% rename from keyboards/runner3680/3x6/info.json rename to keyboards/omkbd/runner3680/3x6/info.json diff --git a/keyboards/runner3680/3x6/keymaps/default/config.h b/keyboards/omkbd/runner3680/3x6/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/3x6/keymaps/default/config.h rename to keyboards/omkbd/runner3680/3x6/keymaps/default/config.h diff --git a/keyboards/runner3680/3x6/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/3x6/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/3x6/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/3x6/keymaps/default/keymap.c diff --git a/keyboards/naked64/keymaps/default/rules.mk b/keyboards/omkbd/runner3680/3x6/rules.mk similarity index 100% rename from keyboards/naked64/keymaps/default/rules.mk rename to keyboards/omkbd/runner3680/3x6/rules.mk diff --git a/keyboards/namecard2x4/.noci b/keyboards/omkbd/runner3680/3x7/.noci similarity index 100% rename from keyboards/namecard2x4/.noci rename to keyboards/omkbd/runner3680/3x7/.noci diff --git a/keyboards/runner3680/3x7/3x7.c b/keyboards/omkbd/runner3680/3x7/3x7.c similarity index 100% rename from keyboards/runner3680/3x7/3x7.c rename to keyboards/omkbd/runner3680/3x7/3x7.c diff --git a/keyboards/runner3680/3x7/3x7.h b/keyboards/omkbd/runner3680/3x7/3x7.h similarity index 100% rename from keyboards/runner3680/3x7/3x7.h rename to keyboards/omkbd/runner3680/3x7/3x7.h diff --git a/keyboards/runner3680/3x7/config.h b/keyboards/omkbd/runner3680/3x7/config.h similarity index 100% rename from keyboards/runner3680/3x7/config.h rename to keyboards/omkbd/runner3680/3x7/config.h diff --git a/keyboards/runner3680/3x7/info.json b/keyboards/omkbd/runner3680/3x7/info.json similarity index 100% rename from keyboards/runner3680/3x7/info.json rename to keyboards/omkbd/runner3680/3x7/info.json diff --git a/keyboards/runner3680/3x7/keymaps/default/config.h b/keyboards/omkbd/runner3680/3x7/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/3x7/keymaps/default/config.h rename to keyboards/omkbd/runner3680/3x7/keymaps/default/config.h diff --git a/keyboards/runner3680/3x7/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/3x7/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/3x7/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/3x7/keymaps/default/keymap.c diff --git a/keyboards/naked64/keymaps/default_with_setta21/rules.mk b/keyboards/omkbd/runner3680/3x7/rules.mk similarity index 100% rename from keyboards/naked64/keymaps/default_with_setta21/rules.mk rename to keyboards/omkbd/runner3680/3x7/rules.mk diff --git a/keyboards/namecard2x4/rev1/.noci b/keyboards/omkbd/runner3680/3x8/.noci similarity index 100% rename from keyboards/namecard2x4/rev1/.noci rename to keyboards/omkbd/runner3680/3x8/.noci diff --git a/keyboards/runner3680/3x8/3x8.c b/keyboards/omkbd/runner3680/3x8/3x8.c similarity index 100% rename from keyboards/runner3680/3x8/3x8.c rename to keyboards/omkbd/runner3680/3x8/3x8.c diff --git a/keyboards/runner3680/3x8/3x8.h b/keyboards/omkbd/runner3680/3x8/3x8.h similarity index 100% rename from keyboards/runner3680/3x8/3x8.h rename to keyboards/omkbd/runner3680/3x8/3x8.h diff --git a/keyboards/runner3680/3x8/config.h b/keyboards/omkbd/runner3680/3x8/config.h similarity index 100% rename from keyboards/runner3680/3x8/config.h rename to keyboards/omkbd/runner3680/3x8/config.h diff --git a/keyboards/runner3680/3x8/info.json b/keyboards/omkbd/runner3680/3x8/info.json similarity index 100% rename from keyboards/runner3680/3x8/info.json rename to keyboards/omkbd/runner3680/3x8/info.json diff --git a/keyboards/runner3680/3x8/keymaps/default/config.h b/keyboards/omkbd/runner3680/3x8/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/3x8/keymaps/default/config.h rename to keyboards/omkbd/runner3680/3x8/keymaps/default/config.h diff --git a/keyboards/runner3680/3x8/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/3x8/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/3x8/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/3x8/keymaps/default/keymap.c diff --git a/keyboards/naked64/rev1/rules.mk b/keyboards/omkbd/runner3680/3x8/rules.mk similarity index 100% rename from keyboards/naked64/rev1/rules.mk rename to keyboards/omkbd/runner3680/3x8/rules.mk diff --git a/keyboards/nomu30/.noci b/keyboards/omkbd/runner3680/4x6/.noci similarity index 100% rename from keyboards/nomu30/.noci rename to keyboards/omkbd/runner3680/4x6/.noci diff --git a/keyboards/runner3680/4x6/4x6.c b/keyboards/omkbd/runner3680/4x6/4x6.c similarity index 100% rename from keyboards/runner3680/4x6/4x6.c rename to keyboards/omkbd/runner3680/4x6/4x6.c diff --git a/keyboards/runner3680/4x6/4x6.h b/keyboards/omkbd/runner3680/4x6/4x6.h similarity index 100% rename from keyboards/runner3680/4x6/4x6.h rename to keyboards/omkbd/runner3680/4x6/4x6.h diff --git a/keyboards/runner3680/4x6/config.h b/keyboards/omkbd/runner3680/4x6/config.h similarity index 100% rename from keyboards/runner3680/4x6/config.h rename to keyboards/omkbd/runner3680/4x6/config.h diff --git a/keyboards/runner3680/4x6/info.json b/keyboards/omkbd/runner3680/4x6/info.json similarity index 100% rename from keyboards/runner3680/4x6/info.json rename to keyboards/omkbd/runner3680/4x6/info.json diff --git a/keyboards/runner3680/4x6/keymaps/default/config.h b/keyboards/omkbd/runner3680/4x6/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/4x6/keymaps/default/config.h rename to keyboards/omkbd/runner3680/4x6/keymaps/default/config.h diff --git a/keyboards/runner3680/4x6/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/4x6/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/4x6/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/4x6/keymaps/default/keymap.c diff --git a/keyboards/namecard2x4/rev1/rules.mk b/keyboards/omkbd/runner3680/4x6/rules.mk similarity index 100% rename from keyboards/namecard2x4/rev1/rules.mk rename to keyboards/omkbd/runner3680/4x6/rules.mk diff --git a/keyboards/nomu30/rev1/.noci b/keyboards/omkbd/runner3680/4x7/.noci similarity index 100% rename from keyboards/nomu30/rev1/.noci rename to keyboards/omkbd/runner3680/4x7/.noci diff --git a/keyboards/runner3680/4x7/4x7.c b/keyboards/omkbd/runner3680/4x7/4x7.c similarity index 100% rename from keyboards/runner3680/4x7/4x7.c rename to keyboards/omkbd/runner3680/4x7/4x7.c diff --git a/keyboards/runner3680/4x7/4x7.h b/keyboards/omkbd/runner3680/4x7/4x7.h similarity index 100% rename from keyboards/runner3680/4x7/4x7.h rename to keyboards/omkbd/runner3680/4x7/4x7.h diff --git a/keyboards/runner3680/4x7/config.h b/keyboards/omkbd/runner3680/4x7/config.h similarity index 100% rename from keyboards/runner3680/4x7/config.h rename to keyboards/omkbd/runner3680/4x7/config.h diff --git a/keyboards/runner3680/4x7/info.json b/keyboards/omkbd/runner3680/4x7/info.json similarity index 100% rename from keyboards/runner3680/4x7/info.json rename to keyboards/omkbd/runner3680/4x7/info.json diff --git a/keyboards/runner3680/4x7/keymaps/default/config.h b/keyboards/omkbd/runner3680/4x7/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/4x7/keymaps/default/config.h rename to keyboards/omkbd/runner3680/4x7/keymaps/default/config.h diff --git a/keyboards/runner3680/4x7/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/4x7/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/4x7/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/4x7/keymaps/default/keymap.c diff --git a/keyboards/namecard2x4/rev2/rules.mk b/keyboards/omkbd/runner3680/4x7/rules.mk similarity index 100% rename from keyboards/namecard2x4/rev2/rules.mk rename to keyboards/omkbd/runner3680/4x7/rules.mk diff --git a/keyboards/nomu30/rev2/.noci b/keyboards/omkbd/runner3680/4x8/.noci similarity index 100% rename from keyboards/nomu30/rev2/.noci rename to keyboards/omkbd/runner3680/4x8/.noci diff --git a/keyboards/runner3680/4x8/4x8.c b/keyboards/omkbd/runner3680/4x8/4x8.c similarity index 100% rename from keyboards/runner3680/4x8/4x8.c rename to keyboards/omkbd/runner3680/4x8/4x8.c diff --git a/keyboards/runner3680/4x8/4x8.h b/keyboards/omkbd/runner3680/4x8/4x8.h similarity index 100% rename from keyboards/runner3680/4x8/4x8.h rename to keyboards/omkbd/runner3680/4x8/4x8.h diff --git a/keyboards/runner3680/4x8/config.h b/keyboards/omkbd/runner3680/4x8/config.h similarity index 100% rename from keyboards/runner3680/4x8/config.h rename to keyboards/omkbd/runner3680/4x8/config.h diff --git a/keyboards/runner3680/4x8/info.json b/keyboards/omkbd/runner3680/4x8/info.json similarity index 100% rename from keyboards/runner3680/4x8/info.json rename to keyboards/omkbd/runner3680/4x8/info.json diff --git a/keyboards/runner3680/4x8/keymaps/default/config.h b/keyboards/omkbd/runner3680/4x8/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/4x8/keymaps/default/config.h rename to keyboards/omkbd/runner3680/4x8/keymaps/default/config.h diff --git a/keyboards/runner3680/4x8/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/4x8/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/4x8/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/4x8/keymaps/default/keymap.c diff --git a/keyboards/ogurec/left_pm/rules.mk b/keyboards/omkbd/runner3680/4x8/rules.mk similarity index 100% rename from keyboards/ogurec/left_pm/rules.mk rename to keyboards/omkbd/runner3680/4x8/rules.mk diff --git a/keyboards/otaku_split/rev0/.noci b/keyboards/omkbd/runner3680/5x6/.noci similarity index 100% rename from keyboards/otaku_split/rev0/.noci rename to keyboards/omkbd/runner3680/5x6/.noci diff --git a/keyboards/runner3680/5x6/5x6.c b/keyboards/omkbd/runner3680/5x6/5x6.c similarity index 100% rename from keyboards/runner3680/5x6/5x6.c rename to keyboards/omkbd/runner3680/5x6/5x6.c diff --git a/keyboards/runner3680/5x6/5x6.h b/keyboards/omkbd/runner3680/5x6/5x6.h similarity index 100% rename from keyboards/runner3680/5x6/5x6.h rename to keyboards/omkbd/runner3680/5x6/5x6.h diff --git a/keyboards/runner3680/5x6/config.h b/keyboards/omkbd/runner3680/5x6/config.h similarity index 100% rename from keyboards/runner3680/5x6/config.h rename to keyboards/omkbd/runner3680/5x6/config.h diff --git a/keyboards/runner3680/5x6/info.json b/keyboards/omkbd/runner3680/5x6/info.json similarity index 100% rename from keyboards/runner3680/5x6/info.json rename to keyboards/omkbd/runner3680/5x6/info.json diff --git a/keyboards/runner3680/5x6/keymaps/default/config.h b/keyboards/omkbd/runner3680/5x6/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/5x6/keymaps/default/config.h rename to keyboards/omkbd/runner3680/5x6/keymaps/default/config.h diff --git a/keyboards/runner3680/5x6/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/5x6/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/5x6/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/5x6/keymaps/default/keymap.c diff --git a/keyboards/ogurec/right_pm/rules.mk b/keyboards/omkbd/runner3680/5x6/rules.mk similarity index 100% rename from keyboards/ogurec/right_pm/rules.mk rename to keyboards/omkbd/runner3680/5x6/rules.mk diff --git a/keyboards/reviung33/.noci b/keyboards/omkbd/runner3680/5x6_5x8/.noci similarity index 100% rename from keyboards/reviung33/.noci rename to keyboards/omkbd/runner3680/5x6_5x8/.noci diff --git a/keyboards/runner3680/5x6_5x8/5x6_5x8.c b/keyboards/omkbd/runner3680/5x6_5x8/5x6_5x8.c similarity index 100% rename from keyboards/runner3680/5x6_5x8/5x6_5x8.c rename to keyboards/omkbd/runner3680/5x6_5x8/5x6_5x8.c diff --git a/keyboards/runner3680/5x6_5x8/5x6_5x8.h b/keyboards/omkbd/runner3680/5x6_5x8/5x6_5x8.h similarity index 100% rename from keyboards/runner3680/5x6_5x8/5x6_5x8.h rename to keyboards/omkbd/runner3680/5x6_5x8/5x6_5x8.h diff --git a/keyboards/runner3680/5x6_5x8/config.h b/keyboards/omkbd/runner3680/5x6_5x8/config.h similarity index 100% rename from keyboards/runner3680/5x6_5x8/config.h rename to keyboards/omkbd/runner3680/5x6_5x8/config.h diff --git a/keyboards/runner3680/5x6_5x8/info.json b/keyboards/omkbd/runner3680/5x6_5x8/info.json similarity index 100% rename from keyboards/runner3680/5x6_5x8/info.json rename to keyboards/omkbd/runner3680/5x6_5x8/info.json diff --git a/keyboards/runner3680/5x6_5x8/keymaps/default/config.h b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/default/config.h rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/default/config.h diff --git a/keyboards/runner3680/5x6_5x8/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/default/keymap.c diff --git a/keyboards/runner3680/5x6_5x8/keymaps/derekhsu/config.h b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/derekhsu/config.h similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/derekhsu/config.h rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/derekhsu/config.h diff --git a/keyboards/runner3680/5x6_5x8/keymaps/derekhsu/keymap.c b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/derekhsu/keymap.c similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/derekhsu/keymap.c rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/derekhsu/keymap.c diff --git a/keyboards/runner3680/5x6_5x8/keymaps/derekhsu/rules.mk b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/derekhsu/rules.mk similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/derekhsu/rules.mk rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/derekhsu/rules.mk diff --git a/keyboards/runner3680/5x6_5x8/keymaps/jis/config.h b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/jis/config.h similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/jis/config.h rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/jis/config.h diff --git a/keyboards/runner3680/5x6_5x8/keymaps/jis/keymap.c b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/jis/keymap.c similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/jis/keymap.c rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/jis/keymap.c diff --git a/keyboards/runner3680/5x6_5x8/keymaps/via/config.h b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/via/config.h similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/via/config.h rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/via/config.h diff --git a/keyboards/runner3680/5x6_5x8/keymaps/via/keymap.c b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/via/keymap.c similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/via/keymap.c rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/via/keymap.c diff --git a/keyboards/m3n3van/keymaps/via/rules.mk b/keyboards/omkbd/runner3680/5x6_5x8/keymaps/via/rules.mk similarity index 100% rename from keyboards/m3n3van/keymaps/via/rules.mk rename to keyboards/omkbd/runner3680/5x6_5x8/keymaps/via/rules.mk diff --git a/keyboards/runner3680/5x6_5x8/rules.mk b/keyboards/omkbd/runner3680/5x6_5x8/rules.mk similarity index 100% rename from keyboards/runner3680/5x6_5x8/rules.mk rename to keyboards/omkbd/runner3680/5x6_5x8/rules.mk diff --git a/keyboards/reviung61/.noci b/keyboards/omkbd/runner3680/5x7/.noci similarity index 100% rename from keyboards/reviung61/.noci rename to keyboards/omkbd/runner3680/5x7/.noci diff --git a/keyboards/runner3680/5x7/5x7.c b/keyboards/omkbd/runner3680/5x7/5x7.c similarity index 100% rename from keyboards/runner3680/5x7/5x7.c rename to keyboards/omkbd/runner3680/5x7/5x7.c diff --git a/keyboards/runner3680/5x7/5x7.h b/keyboards/omkbd/runner3680/5x7/5x7.h similarity index 100% rename from keyboards/runner3680/5x7/5x7.h rename to keyboards/omkbd/runner3680/5x7/5x7.h diff --git a/keyboards/runner3680/5x7/config.h b/keyboards/omkbd/runner3680/5x7/config.h similarity index 100% rename from keyboards/runner3680/5x7/config.h rename to keyboards/omkbd/runner3680/5x7/config.h diff --git a/keyboards/runner3680/5x7/info.json b/keyboards/omkbd/runner3680/5x7/info.json similarity index 100% rename from keyboards/runner3680/5x7/info.json rename to keyboards/omkbd/runner3680/5x7/info.json diff --git a/keyboards/runner3680/5x7/keymaps/default/config.h b/keyboards/omkbd/runner3680/5x7/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/5x7/keymaps/default/config.h rename to keyboards/omkbd/runner3680/5x7/keymaps/default/config.h diff --git a/keyboards/runner3680/5x7/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/5x7/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/5x7/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/5x7/keymaps/default/keymap.c diff --git a/keyboards/runner3680/3x6/rules.mk b/keyboards/omkbd/runner3680/5x7/rules.mk similarity index 100% rename from keyboards/runner3680/3x6/rules.mk rename to keyboards/omkbd/runner3680/5x7/rules.mk diff --git a/keyboards/runner3680/3x6/.noci b/keyboards/omkbd/runner3680/5x8/.noci similarity index 100% rename from keyboards/runner3680/3x6/.noci rename to keyboards/omkbd/runner3680/5x8/.noci diff --git a/keyboards/runner3680/5x8/5x8.c b/keyboards/omkbd/runner3680/5x8/5x8.c similarity index 100% rename from keyboards/runner3680/5x8/5x8.c rename to keyboards/omkbd/runner3680/5x8/5x8.c diff --git a/keyboards/runner3680/5x8/5x8.h b/keyboards/omkbd/runner3680/5x8/5x8.h similarity index 100% rename from keyboards/runner3680/5x8/5x8.h rename to keyboards/omkbd/runner3680/5x8/5x8.h diff --git a/keyboards/runner3680/5x8/config.h b/keyboards/omkbd/runner3680/5x8/config.h similarity index 100% rename from keyboards/runner3680/5x8/config.h rename to keyboards/omkbd/runner3680/5x8/config.h diff --git a/keyboards/runner3680/5x8/info.json b/keyboards/omkbd/runner3680/5x8/info.json similarity index 100% rename from keyboards/runner3680/5x8/info.json rename to keyboards/omkbd/runner3680/5x8/info.json diff --git a/keyboards/runner3680/5x8/keymaps/JIS/config.h b/keyboards/omkbd/runner3680/5x8/keymaps/JIS/config.h similarity index 100% rename from keyboards/runner3680/5x8/keymaps/JIS/config.h rename to keyboards/omkbd/runner3680/5x8/keymaps/JIS/config.h diff --git a/keyboards/runner3680/5x8/keymaps/JIS/keymap.c b/keyboards/omkbd/runner3680/5x8/keymaps/JIS/keymap.c similarity index 100% rename from keyboards/runner3680/5x8/keymaps/JIS/keymap.c rename to keyboards/omkbd/runner3680/5x8/keymaps/JIS/keymap.c diff --git a/keyboards/runner3680/5x8/keymaps/default/config.h b/keyboards/omkbd/runner3680/5x8/keymaps/default/config.h similarity index 100% rename from keyboards/runner3680/5x8/keymaps/default/config.h rename to keyboards/omkbd/runner3680/5x8/keymaps/default/config.h diff --git a/keyboards/runner3680/5x8/keymaps/default/keymap.c b/keyboards/omkbd/runner3680/5x8/keymaps/default/keymap.c similarity index 100% rename from keyboards/runner3680/5x8/keymaps/default/keymap.c rename to keyboards/omkbd/runner3680/5x8/keymaps/default/keymap.c diff --git a/keyboards/runner3680/3x7/rules.mk b/keyboards/omkbd/runner3680/5x8/rules.mk similarity index 100% rename from keyboards/runner3680/3x7/rules.mk rename to keyboards/omkbd/runner3680/5x8/rules.mk diff --git a/keyboards/runner3680/config.h b/keyboards/omkbd/runner3680/config.h similarity index 100% rename from keyboards/runner3680/config.h rename to keyboards/omkbd/runner3680/config.h diff --git a/keyboards/runner3680/readme.md b/keyboards/omkbd/runner3680/readme.md similarity index 95% rename from keyboards/runner3680/readme.md rename to keyboards/omkbd/runner3680/readme.md index b32ead412bf3..9dd15495a9c9 100644 --- a/keyboards/runner3680/readme.md +++ b/keyboards/omkbd/runner3680/readme.md @@ -10,6 +10,6 @@ Hardware Availability: Order your own [yourself](https://github.com/omkbd/Runner Make example for this keyboard (after setting up your build environment): - make runner3680/5x8:default + make omkbd/runner3680/5x8: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/runner3680/rules.mk b/keyboards/omkbd/runner3680/rules.mk similarity index 94% rename from keyboards/runner3680/rules.mk rename to keyboards/omkbd/runner3680/rules.mk index 2d0ea406eb19..1be171295da6 100644 --- a/keyboards/runner3680/rules.mk +++ b/keyboards/omkbd/runner3680/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes # Enables split keyboard support -DEFAULT_FOLDER = runner3680/5x8 +DEFAULT_FOLDER = omkbd/runner3680/5x8 diff --git a/keyboards/runner3680/runner3680.c b/keyboards/omkbd/runner3680/runner3680.c similarity index 100% rename from keyboards/runner3680/runner3680.c rename to keyboards/omkbd/runner3680/runner3680.c diff --git a/keyboards/omkbd/runner3680/runner3680.h b/keyboards/omkbd/runner3680/runner3680.h new file mode 100644 index 000000000000..59afecfcfaaf --- /dev/null +++ b/keyboards/omkbd/runner3680/runner3680.h @@ -0,0 +1,43 @@ +#pragma once + +#include "quantum.h" + +#ifdef KEYBOARD_omkbd_runner3680_5x8 + #include "5x8.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_5x7 + #include "5x7.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_5x6 + #include "5x6.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_5x6_5x8 + #include "5x6_5x8.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_4x8 + #include "4x8.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_4x7 + #include "4x7.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_4x6 + #include "4x6.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_3x8 + #include "3x8.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_3x7 + #include "3x7.h" +#endif + +#ifdef KEYBOARD_omkbd_runner3680_3x6 + #include "3x6.h" +#endif diff --git a/keyboards/paprikman/albacore/rules.mk b/keyboards/paprikman/albacore/rules.mk index baf1b10f2844..cbfd971b0f7f 100644 --- a/keyboards/paprikman/albacore/rules.mk +++ b/keyboards/paprikman/albacore/rules.mk @@ -12,10 +12,7 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/peej/rosaline/rules.mk b/keyboards/peej/rosaline/rules.mk index d8133b74ab54..d1dde8af62f9 100644 --- a/keyboards/peej/rosaline/rules.mk +++ b/keyboards/peej/rosaline/rules.mk @@ -2,7 +2,7 @@ MCU = atmega328p # Bootloader selection -BOOTLOADER = USBasp +BOOTLOADER = usbasploader # Build Options # change yes to no to disable diff --git a/keyboards/pistachio/rules.mk b/keyboards/pistachio/rules.mk deleted file mode 100644 index 93ae534be943..000000000000 --- a/keyboards/pistachio/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = pistachio/rev2 \ No newline at end of file diff --git a/keyboards/planck/keymaps/thermal_printer/config.h b/keyboards/planck/keymaps/thermal_printer/config.h index 4ae9ced2581f..dd9d6a9d2591 100644 --- a/keyboards/planck/keymaps/thermal_printer/config.h +++ b/keyboards/planck/keymaps/thermal_printer/config.h @@ -1,9 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define SERIAL_UART_BAUD 19200 +#pragma once /* * MIDI options @@ -21,8 +16,3 @@ - etc. */ //#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - - #endif \ No newline at end of file diff --git a/keyboards/ploopyco/mouse/readme.md b/keyboards/ploopyco/mouse/readme.md index f7f072928b76..af3cb3520fe6 100644 --- a/keyboards/ploopyco/mouse/readme.md +++ b/keyboards/ploopyco/mouse/readme.md @@ -39,7 +39,7 @@ This should allow you to more heavily customize the behavior. Alternatively, the `process_wheel` and `process_mouse` functions can both be replaced too, to allow for even more functionality. -Additionally, you can change the DPI/CPI or speed of the krackball by calling `pmw_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 1200, 1600, and 2400, but can be changed. 1600 is also set to the default. +Additionally, you can change the DPI/CPI or speed of the trackball by calling `pointing_device_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 1200, 1600, and 2400, but can be changed. 1600 is also set to the default. To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIONS` to set the array, and `PLOOPY_DPI_DEFAULT`. diff --git a/keyboards/ploopyco/trackball/readme.md b/keyboards/ploopyco/trackball/readme.md index e1885d149a45..1648bd20f9b6 100644 --- a/keyboards/ploopyco/trackball/readme.md +++ b/keyboards/ploopyco/trackball/readme.md @@ -19,7 +19,7 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to ## Revisions -There are two main revisions for the PloopyCo Tracball, everything up to 1.004, and 1.005-1.006. +There are two main revisions for the PloopyCo Trackball, everything up to 1.004, and 1.005-1.006. 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. @@ -47,7 +47,7 @@ This should allow you to more heavily customize the behavior. Alternatively, the `process_wheel` and `process_mouse` functions can both be replaced too, to allow for even more functionality. -Additionally, you can change the DPI/CPI or speed of the trackball by calling `pmw_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 1200, 1600, and 2400, but can be changed. 1600 is also set to the default. +Additionally, you can change the DPI/CPI or speed of the trackball by calling `pointing_device_set_cpi` at any time. Additionally, there is a `DPI_CONFIG` macro that will cycle through an array of options for the DPI. This is set to 1200, 1600, and 2400, but can be changed. 1600 is also set to the default. To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIONS` to set the array, and `PLOOPY_DPI_DEFAULT`. diff --git a/keyboards/ploopyco/trackball/trackball.c b/keyboards/ploopyco/trackball/trackball.c index 25b36574a5d8..f8199587344c 100644 --- a/keyboards/ploopyco/trackball/trackball.c +++ b/keyboards/ploopyco/trackball/trackball.c @@ -218,7 +218,7 @@ void keyboard_pre_init_kb(void) { } void pointing_device_init_kb(void) { - pmw3360_set_cpi(dpi_array[keyboard_config.dpi_config]); + pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]); // initialize the scroll wheel's optical encoder opt_encoder_init(); } diff --git a/keyboards/allison/allison.c b/keyboards/prototypist/allison/allison.c similarity index 100% rename from keyboards/allison/allison.c rename to keyboards/prototypist/allison/allison.c diff --git a/keyboards/allison/allison.h b/keyboards/prototypist/allison/allison.h similarity index 100% rename from keyboards/allison/allison.h rename to keyboards/prototypist/allison/allison.h diff --git a/keyboards/allison/config.h b/keyboards/prototypist/allison/config.h similarity index 100% rename from keyboards/allison/config.h rename to keyboards/prototypist/allison/config.h diff --git a/keyboards/allison/info.json b/keyboards/prototypist/allison/info.json similarity index 100% rename from keyboards/allison/info.json rename to keyboards/prototypist/allison/info.json diff --git a/keyboards/allison/keymaps/default/keymap.c b/keyboards/prototypist/allison/keymaps/default/keymap.c similarity index 100% rename from keyboards/allison/keymaps/default/keymap.c rename to keyboards/prototypist/allison/keymaps/default/keymap.c diff --git a/keyboards/allison/keymaps/default/readme.md b/keyboards/prototypist/allison/keymaps/default/readme.md similarity index 100% rename from keyboards/allison/keymaps/default/readme.md rename to keyboards/prototypist/allison/keymaps/default/readme.md diff --git a/keyboards/allison/keymaps/via/keymap.c b/keyboards/prototypist/allison/keymaps/via/keymap.c similarity index 100% rename from keyboards/allison/keymaps/via/keymap.c rename to keyboards/prototypist/allison/keymaps/via/keymap.c diff --git a/keyboards/allison/keymaps/via/readme.md b/keyboards/prototypist/allison/keymaps/via/readme.md similarity index 100% rename from keyboards/allison/keymaps/via/readme.md rename to keyboards/prototypist/allison/keymaps/via/readme.md diff --git a/keyboards/model_v/keymaps/via/rules.mk b/keyboards/prototypist/allison/keymaps/via/rules.mk similarity index 100% rename from keyboards/model_v/keymaps/via/rules.mk rename to keyboards/prototypist/allison/keymaps/via/rules.mk diff --git a/keyboards/allison/readme.md b/keyboards/prototypist/allison/readme.md similarity index 94% rename from keyboards/allison/readme.md rename to keyboards/prototypist/allison/readme.md index 60670cbad8dc..8101c3c715e6 100644 --- a/keyboards/allison/readme.md +++ b/keyboards/prototypist/allison/readme.md @@ -10,6 +10,6 @@ A custom luxurious 60 with F-row and Macro Make example for this keyboard (after setting up your build environment): - make allison:default + make prototypist/allison: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/allison/rules.mk b/keyboards/prototypist/allison/rules.mk similarity index 100% rename from keyboards/allison/rules.mk rename to keyboards/prototypist/allison/rules.mk diff --git a/keyboards/allison_numpad/allison_numpad.c b/keyboards/prototypist/allison_numpad/allison_numpad.c similarity index 100% rename from keyboards/allison_numpad/allison_numpad.c rename to keyboards/prototypist/allison_numpad/allison_numpad.c diff --git a/keyboards/allison_numpad/allison_numpad.h b/keyboards/prototypist/allison_numpad/allison_numpad.h similarity index 100% rename from keyboards/allison_numpad/allison_numpad.h rename to keyboards/prototypist/allison_numpad/allison_numpad.h diff --git a/keyboards/allison_numpad/config.h b/keyboards/prototypist/allison_numpad/config.h similarity index 100% rename from keyboards/allison_numpad/config.h rename to keyboards/prototypist/allison_numpad/config.h diff --git a/keyboards/allison_numpad/info.json b/keyboards/prototypist/allison_numpad/info.json similarity index 100% rename from keyboards/allison_numpad/info.json rename to keyboards/prototypist/allison_numpad/info.json diff --git a/keyboards/allison_numpad/keymaps/default/keymap.c b/keyboards/prototypist/allison_numpad/keymaps/default/keymap.c similarity index 100% rename from keyboards/allison_numpad/keymaps/default/keymap.c rename to keyboards/prototypist/allison_numpad/keymaps/default/keymap.c diff --git a/keyboards/allison_numpad/keymaps/default/readme.md b/keyboards/prototypist/allison_numpad/keymaps/default/readme.md similarity index 100% rename from keyboards/allison_numpad/keymaps/default/readme.md rename to keyboards/prototypist/allison_numpad/keymaps/default/readme.md diff --git a/keyboards/allison_numpad/keymaps/via/keymap.c b/keyboards/prototypist/allison_numpad/keymaps/via/keymap.c similarity index 100% rename from keyboards/allison_numpad/keymaps/via/keymap.c rename to keyboards/prototypist/allison_numpad/keymaps/via/keymap.c diff --git a/keyboards/allison_numpad/keymaps/via/readme.md b/keyboards/prototypist/allison_numpad/keymaps/via/readme.md similarity index 100% rename from keyboards/allison_numpad/keymaps/via/readme.md rename to keyboards/prototypist/allison_numpad/keymaps/via/readme.md diff --git a/keyboards/naiping/np64/keymaps/via/rules.mk b/keyboards/prototypist/allison_numpad/keymaps/via/rules.mk similarity index 100% rename from keyboards/naiping/np64/keymaps/via/rules.mk rename to keyboards/prototypist/allison_numpad/keymaps/via/rules.mk diff --git a/keyboards/allison_numpad/readme.md b/keyboards/prototypist/allison_numpad/readme.md similarity index 94% rename from keyboards/allison_numpad/readme.md rename to keyboards/prototypist/allison_numpad/readme.md index 82992339e1ab..ea5e449b03bc 100644 --- a/keyboards/allison_numpad/readme.md +++ b/keyboards/prototypist/allison_numpad/readme.md @@ -10,6 +10,6 @@ A custom luxurious numpad to match Allison Make example for this keyboard (after setting up your build environment): - make allison_numpad:default + make prototypist/allison_numpad: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/allison_numpad/rules.mk b/keyboards/prototypist/allison_numpad/rules.mk similarity index 100% rename from keyboards/allison_numpad/rules.mk rename to keyboards/prototypist/allison_numpad/rules.mk diff --git a/keyboards/eggman/config.h b/keyboards/qpockets/eggman/config.h similarity index 100% rename from keyboards/eggman/config.h rename to keyboards/qpockets/eggman/config.h diff --git a/keyboards/eggman/eggman.c b/keyboards/qpockets/eggman/eggman.c similarity index 100% rename from keyboards/eggman/eggman.c rename to keyboards/qpockets/eggman/eggman.c diff --git a/keyboards/eggman/eggman.h b/keyboards/qpockets/eggman/eggman.h similarity index 100% rename from keyboards/eggman/eggman.h rename to keyboards/qpockets/eggman/eggman.h diff --git a/keyboards/eggman/info.json b/keyboards/qpockets/eggman/info.json similarity index 100% rename from keyboards/eggman/info.json rename to keyboards/qpockets/eggman/info.json diff --git a/keyboards/eggman/keymaps/default/config.h b/keyboards/qpockets/eggman/keymaps/default/config.h similarity index 100% rename from keyboards/eggman/keymaps/default/config.h rename to keyboards/qpockets/eggman/keymaps/default/config.h diff --git a/keyboards/eggman/keymaps/default/keymap.c b/keyboards/qpockets/eggman/keymaps/default/keymap.c similarity index 100% rename from keyboards/eggman/keymaps/default/keymap.c rename to keyboards/qpockets/eggman/keymaps/default/keymap.c diff --git a/keyboards/space_space/rev2/keymaps/default/rules.mk b/keyboards/qpockets/eggman/keymaps/default/rules.mk similarity index 100% rename from keyboards/space_space/rev2/keymaps/default/rules.mk rename to keyboards/qpockets/eggman/keymaps/default/rules.mk diff --git a/keyboards/eggman/readme.md b/keyboards/qpockets/eggman/readme.md similarity index 88% rename from keyboards/eggman/readme.md rename to keyboards/qpockets/eggman/readme.md index 156b4086faf0..e0066fbe1f21 100644 --- a/keyboards/eggman/readme.md +++ b/keyboards/qpockets/eggman/readme.md @@ -9,10 +9,10 @@ i am he and you are me Make example for this keyboard (after setting up your build environment): - make eggman:default + make qpockets/eggman:default Flashing example for this keyboard: - make eggman:default:flash + make qpockets/eggman: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/eggman/rules.mk b/keyboards/qpockets/eggman/rules.mk similarity index 100% rename from keyboards/eggman/rules.mk rename to keyboards/qpockets/eggman/rules.mk diff --git a/keyboards/space_space/readme.md b/keyboards/qpockets/space_space/readme.md similarity index 88% rename from keyboards/space_space/readme.md rename to keyboards/qpockets/space_space/readme.md index 08fa640f222d..c84a5832674c 100644 --- a/keyboards/space_space/readme.md +++ b/keyboards/qpockets/space_space/readme.md @@ -9,10 +9,10 @@ Give your space some space Make example for this keyboard (after setting up your build environment): - make space_space/rev2:default + make qpockets/space_space/rev2:default Flashing example for this keyboard: - make space_space/rev2:default:flash + make qpockets/space_space/rev2: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/space_space/rev1/config.h b/keyboards/qpockets/space_space/rev1/config.h similarity index 100% rename from keyboards/space_space/rev1/config.h rename to keyboards/qpockets/space_space/rev1/config.h diff --git a/keyboards/space_space/rev1/info.json b/keyboards/qpockets/space_space/rev1/info.json similarity index 100% rename from keyboards/space_space/rev1/info.json rename to keyboards/qpockets/space_space/rev1/info.json diff --git a/keyboards/space_space/rev1/keymaps/big_space/config.h b/keyboards/qpockets/space_space/rev1/keymaps/big_space/config.h similarity index 100% rename from keyboards/space_space/rev1/keymaps/big_space/config.h rename to keyboards/qpockets/space_space/rev1/keymaps/big_space/config.h diff --git a/keyboards/space_space/rev1/keymaps/big_space/keymap.c b/keyboards/qpockets/space_space/rev1/keymaps/big_space/keymap.c similarity index 100% rename from keyboards/space_space/rev1/keymaps/big_space/keymap.c rename to keyboards/qpockets/space_space/rev1/keymaps/big_space/keymap.c diff --git a/keyboards/space_space/rev1/keymaps/big_space/rules.mk b/keyboards/qpockets/space_space/rev1/keymaps/big_space/rules.mk similarity index 100% rename from keyboards/space_space/rev1/keymaps/big_space/rules.mk rename to keyboards/qpockets/space_space/rev1/keymaps/big_space/rules.mk diff --git a/keyboards/space_space/rev1/keymaps/default/config.h b/keyboards/qpockets/space_space/rev1/keymaps/default/config.h similarity index 100% rename from keyboards/space_space/rev1/keymaps/default/config.h rename to keyboards/qpockets/space_space/rev1/keymaps/default/config.h diff --git a/keyboards/space_space/rev1/keymaps/default/keymap.c b/keyboards/qpockets/space_space/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/space_space/rev1/keymaps/default/keymap.c rename to keyboards/qpockets/space_space/rev1/keymaps/default/keymap.c diff --git a/keyboards/space_space/rev1/keymaps/default/rules.mk b/keyboards/qpockets/space_space/rev1/keymaps/default/rules.mk similarity index 100% rename from keyboards/space_space/rev1/keymaps/default/rules.mk rename to keyboards/qpockets/space_space/rev1/keymaps/default/rules.mk diff --git a/keyboards/space_space/rev1/keymaps/readme.md b/keyboards/qpockets/space_space/rev1/keymaps/readme.md similarity index 100% rename from keyboards/space_space/rev1/keymaps/readme.md rename to keyboards/qpockets/space_space/rev1/keymaps/readme.md diff --git a/keyboards/space_space/rev1/readme.md b/keyboards/qpockets/space_space/rev1/readme.md similarity index 100% rename from keyboards/space_space/rev1/readme.md rename to keyboards/qpockets/space_space/rev1/readme.md diff --git a/keyboards/space_space/rev1/rev1.c b/keyboards/qpockets/space_space/rev1/rev1.c similarity index 100% rename from keyboards/space_space/rev1/rev1.c rename to keyboards/qpockets/space_space/rev1/rev1.c diff --git a/keyboards/space_space/rev1/rev1.h b/keyboards/qpockets/space_space/rev1/rev1.h similarity index 100% rename from keyboards/space_space/rev1/rev1.h rename to keyboards/qpockets/space_space/rev1/rev1.h diff --git a/keyboards/space_space/rev1/rules.mk b/keyboards/qpockets/space_space/rev1/rules.mk similarity index 100% rename from keyboards/space_space/rev1/rules.mk rename to keyboards/qpockets/space_space/rev1/rules.mk diff --git a/keyboards/space_space/rev2/config.h b/keyboards/qpockets/space_space/rev2/config.h similarity index 100% rename from keyboards/space_space/rev2/config.h rename to keyboards/qpockets/space_space/rev2/config.h diff --git a/keyboards/space_space/rev2/info.json b/keyboards/qpockets/space_space/rev2/info.json similarity index 100% rename from keyboards/space_space/rev2/info.json rename to keyboards/qpockets/space_space/rev2/info.json diff --git a/keyboards/space_space/rev2/keymaps/big_space/config.h b/keyboards/qpockets/space_space/rev2/keymaps/big_space/config.h similarity index 100% rename from keyboards/space_space/rev2/keymaps/big_space/config.h rename to keyboards/qpockets/space_space/rev2/keymaps/big_space/config.h diff --git a/keyboards/space_space/rev2/keymaps/big_space/keymap.c b/keyboards/qpockets/space_space/rev2/keymaps/big_space/keymap.c similarity index 100% rename from keyboards/space_space/rev2/keymaps/big_space/keymap.c rename to keyboards/qpockets/space_space/rev2/keymaps/big_space/keymap.c diff --git a/keyboards/space_space/rev2/keymaps/big_space/rules.mk b/keyboards/qpockets/space_space/rev2/keymaps/big_space/rules.mk similarity index 100% rename from keyboards/space_space/rev2/keymaps/big_space/rules.mk rename to keyboards/qpockets/space_space/rev2/keymaps/big_space/rules.mk diff --git a/keyboards/space_space/rev2/keymaps/default/config.h b/keyboards/qpockets/space_space/rev2/keymaps/default/config.h similarity index 100% rename from keyboards/space_space/rev2/keymaps/default/config.h rename to keyboards/qpockets/space_space/rev2/keymaps/default/config.h diff --git a/keyboards/space_space/rev2/keymaps/default/keymap.c b/keyboards/qpockets/space_space/rev2/keymaps/default/keymap.c similarity index 100% rename from keyboards/space_space/rev2/keymaps/default/keymap.c rename to keyboards/qpockets/space_space/rev2/keymaps/default/keymap.c diff --git a/keyboards/squiggle/keymaps/default/rules.mk b/keyboards/qpockets/space_space/rev2/keymaps/default/rules.mk similarity index 100% rename from keyboards/squiggle/keymaps/default/rules.mk rename to keyboards/qpockets/space_space/rev2/keymaps/default/rules.mk diff --git a/keyboards/space_space/rev2/keymaps/qpockets/config.h b/keyboards/qpockets/space_space/rev2/keymaps/qpockets/config.h similarity index 100% rename from keyboards/space_space/rev2/keymaps/qpockets/config.h rename to keyboards/qpockets/space_space/rev2/keymaps/qpockets/config.h diff --git a/keyboards/space_space/rev2/keymaps/qpockets/keymap.c b/keyboards/qpockets/space_space/rev2/keymaps/qpockets/keymap.c similarity index 100% rename from keyboards/space_space/rev2/keymaps/qpockets/keymap.c rename to keyboards/qpockets/space_space/rev2/keymaps/qpockets/keymap.c diff --git a/keyboards/space_space/rev2/keymaps/qpockets/rules.mk b/keyboards/qpockets/space_space/rev2/keymaps/qpockets/rules.mk similarity index 100% rename from keyboards/space_space/rev2/keymaps/qpockets/rules.mk rename to keyboards/qpockets/space_space/rev2/keymaps/qpockets/rules.mk diff --git a/keyboards/space_space/rev2/readme.md b/keyboards/qpockets/space_space/rev2/readme.md similarity index 100% rename from keyboards/space_space/rev2/readme.md rename to keyboards/qpockets/space_space/rev2/readme.md diff --git a/keyboards/space_space/rev2/rev2.c b/keyboards/qpockets/space_space/rev2/rev2.c similarity index 100% rename from keyboards/space_space/rev2/rev2.c rename to keyboards/qpockets/space_space/rev2/rev2.c diff --git a/keyboards/space_space/rev2/rev2.h b/keyboards/qpockets/space_space/rev2/rev2.h similarity index 100% rename from keyboards/space_space/rev2/rev2.h rename to keyboards/qpockets/space_space/rev2/rev2.h diff --git a/keyboards/space_space/rev2/rules.mk b/keyboards/qpockets/space_space/rev2/rules.mk similarity index 100% rename from keyboards/space_space/rev2/rules.mk rename to keyboards/qpockets/space_space/rev2/rules.mk diff --git a/keyboards/qpockets/space_space/rules.mk b/keyboards/qpockets/space_space/rules.mk new file mode 100644 index 000000000000..0ffe2efbf25e --- /dev/null +++ b/keyboards/qpockets/space_space/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = qpockets/space_space/rev2 diff --git a/keyboards/wanten/config.h b/keyboards/qpockets/wanten/config.h similarity index 100% rename from keyboards/wanten/config.h rename to keyboards/qpockets/wanten/config.h diff --git a/keyboards/wanten/info.json b/keyboards/qpockets/wanten/info.json similarity index 100% rename from keyboards/wanten/info.json rename to keyboards/qpockets/wanten/info.json diff --git a/keyboards/wanten/keymaps/2u_bars/config.h b/keyboards/qpockets/wanten/keymaps/2u_bars/config.h similarity index 100% rename from keyboards/wanten/keymaps/2u_bars/config.h rename to keyboards/qpockets/wanten/keymaps/2u_bars/config.h diff --git a/keyboards/wanten/keymaps/2u_bars/keymap.c b/keyboards/qpockets/wanten/keymaps/2u_bars/keymap.c similarity index 100% rename from keyboards/wanten/keymaps/2u_bars/keymap.c rename to keyboards/qpockets/wanten/keymaps/2u_bars/keymap.c diff --git a/keyboards/squiggle/keymaps/default38/rules.mk b/keyboards/qpockets/wanten/keymaps/2u_bars/rules.mk similarity index 100% rename from keyboards/squiggle/keymaps/default38/rules.mk rename to keyboards/qpockets/wanten/keymaps/2u_bars/rules.mk diff --git a/keyboards/wanten/keymaps/625_bar/config.h b/keyboards/qpockets/wanten/keymaps/625_bar/config.h similarity index 100% rename from keyboards/wanten/keymaps/625_bar/config.h rename to keyboards/qpockets/wanten/keymaps/625_bar/config.h diff --git a/keyboards/wanten/keymaps/625_bar/keymap.c b/keyboards/qpockets/wanten/keymaps/625_bar/keymap.c similarity index 100% rename from keyboards/wanten/keymaps/625_bar/keymap.c rename to keyboards/qpockets/wanten/keymaps/625_bar/keymap.c diff --git a/keyboards/squiggle/keymaps/defaultfull/rules.mk b/keyboards/qpockets/wanten/keymaps/625_bar/rules.mk similarity index 100% rename from keyboards/squiggle/keymaps/defaultfull/rules.mk rename to keyboards/qpockets/wanten/keymaps/625_bar/rules.mk diff --git a/keyboards/wanten/keymaps/default/config.h b/keyboards/qpockets/wanten/keymaps/default/config.h similarity index 100% rename from keyboards/wanten/keymaps/default/config.h rename to keyboards/qpockets/wanten/keymaps/default/config.h diff --git a/keyboards/wanten/keymaps/default/keymap.c b/keyboards/qpockets/wanten/keymaps/default/keymap.c similarity index 100% rename from keyboards/wanten/keymaps/default/keymap.c rename to keyboards/qpockets/wanten/keymaps/default/keymap.c diff --git a/keyboards/wanten/keymaps/default/readme.md b/keyboards/qpockets/wanten/keymaps/default/readme.md similarity index 100% rename from keyboards/wanten/keymaps/default/readme.md rename to keyboards/qpockets/wanten/keymaps/default/readme.md diff --git a/keyboards/squiggle/keymaps/defaultminidox/rules.mk b/keyboards/qpockets/wanten/keymaps/default/rules.mk similarity index 100% rename from keyboards/squiggle/keymaps/defaultminidox/rules.mk rename to keyboards/qpockets/wanten/keymaps/default/rules.mk diff --git a/keyboards/wanten/readme.md b/keyboards/qpockets/wanten/readme.md similarity index 93% rename from keyboards/wanten/readme.md rename to keyboards/qpockets/wanten/readme.md index 90dd1ae132cf..243e949f3440 100644 --- a/keyboards/wanten/readme.md +++ b/keyboards/qpockets/wanten/readme.md @@ -10,11 +10,11 @@ an ortho drop in PCB for Van cases Make example for this keyboard (after setting up your build environment): - make wanten:default + make qpockets/wanten:default Flashing example for this keyboard: - make wanten:default:flash + make qpockets/wanten: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/wanten/rules.mk b/keyboards/qpockets/wanten/rules.mk similarity index 100% rename from keyboards/wanten/rules.mk rename to keyboards/qpockets/wanten/rules.mk diff --git a/keyboards/wanten/wanten.c b/keyboards/qpockets/wanten/wanten.c similarity index 100% rename from keyboards/wanten/wanten.c rename to keyboards/qpockets/wanten/wanten.c diff --git a/keyboards/wanten/wanten.h b/keyboards/qpockets/wanten/wanten.h similarity index 100% rename from keyboards/wanten/wanten.h rename to keyboards/qpockets/wanten/wanten.h diff --git a/keyboards/delilah/config.h b/keyboards/rainkeebs/delilah/config.h similarity index 100% rename from keyboards/delilah/config.h rename to keyboards/rainkeebs/delilah/config.h diff --git a/keyboards/delilah/delilah.c b/keyboards/rainkeebs/delilah/delilah.c similarity index 100% rename from keyboards/delilah/delilah.c rename to keyboards/rainkeebs/delilah/delilah.c diff --git a/keyboards/delilah/delilah.h b/keyboards/rainkeebs/delilah/delilah.h similarity index 100% rename from keyboards/delilah/delilah.h rename to keyboards/rainkeebs/delilah/delilah.h diff --git a/keyboards/delilah/info.json b/keyboards/rainkeebs/delilah/info.json similarity index 100% rename from keyboards/delilah/info.json rename to keyboards/rainkeebs/delilah/info.json diff --git a/keyboards/delilah/keymaps/default/keymap.c b/keyboards/rainkeebs/delilah/keymaps/default/keymap.c similarity index 100% rename from keyboards/delilah/keymaps/default/keymap.c rename to keyboards/rainkeebs/delilah/keymaps/default/keymap.c diff --git a/keyboards/delilah/keymaps/via/keymap.c b/keyboards/rainkeebs/delilah/keymaps/via/keymap.c similarity index 100% rename from keyboards/delilah/keymaps/via/keymap.c rename to keyboards/rainkeebs/delilah/keymaps/via/keymap.c diff --git a/keyboards/naiping/nphhkb/keymaps/via/rules.mk b/keyboards/rainkeebs/delilah/keymaps/via/rules.mk similarity index 100% rename from keyboards/naiping/nphhkb/keymaps/via/rules.mk rename to keyboards/rainkeebs/delilah/keymaps/via/rules.mk diff --git a/keyboards/delilah/readme.md b/keyboards/rainkeebs/delilah/readme.md similarity index 89% rename from keyboards/delilah/readme.md rename to keyboards/rainkeebs/delilah/readme.md index 8ba9d8318867..cc8ad40d62cf 100644 --- a/keyboards/delilah/readme.md +++ b/keyboards/rainkeebs/delilah/readme.md @@ -11,12 +11,12 @@ A 12.25u, traditional stagger, 40% keyboard. Designed to keep another punctuatio Make example for this keyboard (after setting up your build environment): - qmk compile -kb delilah -kb default + qmk compile -kb rainkeebs/delilah -km default To reset the keyboard, hold the top left key while plugging in, or hit the reset button near the USB port Install example for this keyboard: - qmk flash -kb delilah -km default + qmk flash -kb rainkeebs/delilah -km 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/delilah/rules.mk b/keyboards/rainkeebs/delilah/rules.mk similarity index 100% rename from keyboards/delilah/rules.mk rename to keyboards/rainkeebs/delilah/rules.mk diff --git a/keyboards/rainkeeb/config.h b/keyboards/rainkeebs/rainkeeb/config.h similarity index 100% rename from keyboards/rainkeeb/config.h rename to keyboards/rainkeebs/rainkeeb/config.h diff --git a/keyboards/rainkeeb/info.json b/keyboards/rainkeebs/rainkeeb/info.json similarity index 100% rename from keyboards/rainkeeb/info.json rename to keyboards/rainkeebs/rainkeeb/info.json diff --git a/keyboards/rainkeeb/keymaps/default/keymap.c b/keyboards/rainkeebs/rainkeeb/keymaps/default/keymap.c similarity index 100% rename from keyboards/rainkeeb/keymaps/default/keymap.c rename to keyboards/rainkeebs/rainkeeb/keymaps/default/keymap.c diff --git a/keyboards/rainkeeb/keymaps/via/keymap.c b/keyboards/rainkeebs/rainkeeb/keymaps/via/keymap.c similarity index 100% rename from keyboards/rainkeeb/keymaps/via/keymap.c rename to keyboards/rainkeebs/rainkeeb/keymaps/via/keymap.c diff --git a/keyboards/gurindam/keymaps/via/rules.mk b/keyboards/rainkeebs/rainkeeb/keymaps/via/rules.mk similarity index 100% rename from keyboards/gurindam/keymaps/via/rules.mk rename to keyboards/rainkeebs/rainkeeb/keymaps/via/rules.mk diff --git a/keyboards/rainkeeb/rainkeeb.c b/keyboards/rainkeebs/rainkeeb/rainkeeb.c similarity index 100% rename from keyboards/rainkeeb/rainkeeb.c rename to keyboards/rainkeebs/rainkeeb/rainkeeb.c diff --git a/keyboards/rainkeeb/rainkeeb.h b/keyboards/rainkeebs/rainkeeb/rainkeeb.h similarity index 100% rename from keyboards/rainkeeb/rainkeeb.h rename to keyboards/rainkeebs/rainkeeb/rainkeeb.h diff --git a/keyboards/rainkeeb/readme.md b/keyboards/rainkeebs/rainkeeb/readme.md similarity index 95% rename from keyboards/rainkeeb/readme.md rename to keyboards/rainkeebs/rainkeeb/readme.md index f2c759ebeb99..6d82df0283c1 100644 --- a/keyboards/rainkeeb/readme.md +++ b/keyboards/rainkeebs/rainkeeb/readme.md @@ -13,12 +13,12 @@ This is the default layout, at least the base layer. By default the OLED display Make example for this keyboard (after setting up your build environment): - make rainkeeb:default + make rainkeebs/rainkeeb:default To put reset into bootloader mode just push the reset button from the left side of the board using a pair of tweezers or similar object. Install example for this keyboard: - make rainkeeb:default:flash + make rainkeebs/rainkeeb: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/rainkeeb/rules.mk b/keyboards/rainkeebs/rainkeeb/rules.mk similarity index 100% rename from keyboards/rainkeeb/rules.mk rename to keyboards/rainkeebs/rainkeeb/rules.mk diff --git a/keyboards/yasui/config.h b/keyboards/rainkeebs/yasui/config.h similarity index 100% rename from keyboards/yasui/config.h rename to keyboards/rainkeebs/yasui/config.h diff --git a/keyboards/yasui/info.json b/keyboards/rainkeebs/yasui/info.json similarity index 100% rename from keyboards/yasui/info.json rename to keyboards/rainkeebs/yasui/info.json diff --git a/keyboards/yasui/keymaps/default/keymap.c b/keyboards/rainkeebs/yasui/keymaps/default/keymap.c similarity index 100% rename from keyboards/yasui/keymaps/default/keymap.c rename to keyboards/rainkeebs/yasui/keymaps/default/keymap.c diff --git a/keyboards/yasui/keymaps/via/keymap.c b/keyboards/rainkeebs/yasui/keymaps/via/keymap.c similarity index 100% rename from keyboards/yasui/keymaps/via/keymap.c rename to keyboards/rainkeebs/yasui/keymaps/via/keymap.c diff --git a/keyboards/naiping/npminila/keymaps/via/rules.mk b/keyboards/rainkeebs/yasui/keymaps/via/rules.mk similarity index 100% rename from keyboards/naiping/npminila/keymaps/via/rules.mk rename to keyboards/rainkeebs/yasui/keymaps/via/rules.mk diff --git a/keyboards/yasui/readme.md b/keyboards/rainkeebs/yasui/readme.md similarity index 88% rename from keyboards/yasui/readme.md rename to keyboards/rainkeebs/yasui/readme.md index dfc20bbe6b30..c167abf4a05a 100644 --- a/keyboards/yasui/readme.md +++ b/keyboards/rainkeebs/yasui/readme.md @@ -11,12 +11,12 @@ A 10u ortho kit. Make example for this keyboard (after setting up your build environment): - qmk compile -kb yasui -kb default + qmk compile -kb rainkeebs/yasui -km default To reset the keyboard, hold the top left key while plugging in, or hit the reset button near the USB port Install example for this keyboard: - qmk flash -kb yasui -km default + qmk flash -kb rainkeebs/yasui -km 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/yasui/rules.mk b/keyboards/rainkeebs/yasui/rules.mk similarity index 100% rename from keyboards/yasui/rules.mk rename to keyboards/rainkeebs/yasui/rules.mk diff --git a/keyboards/yasui/yasui.c b/keyboards/rainkeebs/yasui/yasui.c similarity index 100% rename from keyboards/yasui/yasui.c rename to keyboards/rainkeebs/yasui/yasui.c diff --git a/keyboards/yasui/yasui.h b/keyboards/rainkeebs/yasui/yasui.h similarity index 100% rename from keyboards/yasui/yasui.h rename to keyboards/rainkeebs/yasui/yasui.h diff --git a/keyboards/ramonimbao/mona/v32a/rules.mk b/keyboards/ramonimbao/mona/v32a/rules.mk index 0ed896250405..fe2be33f8295 100644 --- a/keyboards/ramonimbao/mona/v32a/rules.mk +++ b/keyboards/ramonimbao/mona/v32a/rules.mk @@ -15,8 +15,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/ramonimbao/squishytkl/config.h b/keyboards/ramonimbao/squishytkl/config.h index 3e0812bb12be..ebebc35bb4b1 100644 --- a/keyboards/ramonimbao/squishytkl/config.h +++ b/keyboards/ramonimbao/squishytkl/config.h @@ -22,7 +22,7 @@ along with this program. If not, see . /* USB Device descriptor parameter */ #define VENDOR_ID 0xB16B #define PRODUCT_ID 0x00B1 -#define DEVICE_VER 0xE500 +#define DEVICE_VER 0x0100 #define MANUFACTURER Ramon Imbao #define PRODUCT SquishyTKL diff --git a/keyboards/pistachio/config.h b/keyboards/rate/pistachio/config.h similarity index 100% rename from keyboards/pistachio/config.h rename to keyboards/rate/pistachio/config.h diff --git a/keyboards/pistachio/info.json b/keyboards/rate/pistachio/info.json similarity index 100% rename from keyboards/pistachio/info.json rename to keyboards/rate/pistachio/info.json diff --git a/keyboards/pistachio/keymaps/default/keymap.c b/keyboards/rate/pistachio/keymaps/default/keymap.c similarity index 100% rename from keyboards/pistachio/keymaps/default/keymap.c rename to keyboards/rate/pistachio/keymaps/default/keymap.c diff --git a/keyboards/pistachio/keymaps/rate/keymap.c b/keyboards/rate/pistachio/keymaps/rate/keymap.c similarity index 100% rename from keyboards/pistachio/keymaps/rate/keymap.c rename to keyboards/rate/pistachio/keymaps/rate/keymap.c diff --git a/keyboards/pistachio/keymaps/via/keymap.c b/keyboards/rate/pistachio/keymaps/via/keymap.c similarity index 100% rename from keyboards/pistachio/keymaps/via/keymap.c rename to keyboards/rate/pistachio/keymaps/via/keymap.c diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/via/rules.mk b/keyboards/rate/pistachio/keymaps/via/rules.mk similarity index 100% rename from keyboards/kprepublic/bm65hsrgb_iso/keymaps/via/rules.mk rename to keyboards/rate/pistachio/keymaps/via/rules.mk diff --git a/keyboards/pistachio/pistachio.c b/keyboards/rate/pistachio/pistachio.c similarity index 100% rename from keyboards/pistachio/pistachio.c rename to keyboards/rate/pistachio/pistachio.c diff --git a/keyboards/pistachio/pistachio.h b/keyboards/rate/pistachio/pistachio.h similarity index 89% rename from keyboards/pistachio/pistachio.h rename to keyboards/rate/pistachio/pistachio.h index 8cbb967f4938..7bf2c59ad6c0 100644 --- a/keyboards/pistachio/pistachio.h +++ b/keyboards/rate/pistachio/pistachio.h @@ -18,8 +18,8 @@ #include "quantum.h" -#if defined(KEYBOARD_pistachio_rev1) +#if defined(KEYBOARD_rate_pistachio_rev1) # include "rev1.h" -#elif defined(KEYBOARD_pistachio_rev2) +#elif defined(KEYBOARD_rate_pistachio_rev2) # include "rev2.h" #endif diff --git a/keyboards/pistachio/readme.md b/keyboards/rate/pistachio/readme.md similarity index 85% rename from keyboards/pistachio/readme.md rename to keyboards/rate/pistachio/readme.md index 8ff5933f4f1c..dc989bbe6c96 100644 --- a/keyboards/pistachio/readme.md +++ b/keyboards/rate/pistachio/readme.md @@ -10,9 +10,9 @@ This is a 92-key split keyboard with JIS layout and spare keys. Make example for this keyboard (after setting up your build environment): - make pistachio/rev1:default - make pistachio/rev2:default + make rate/pistachio/rev1:default + make rate/pistachio/rev2: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). -[Build guide](https://ratelog.net/pistachio-build-guide/) \ No newline at end of file +[Build guide](https://ratelog.net/pistachio-build-guide/) diff --git a/keyboards/pistachio/rev1/config.h b/keyboards/rate/pistachio/rev1/config.h similarity index 100% rename from keyboards/pistachio/rev1/config.h rename to keyboards/rate/pistachio/rev1/config.h diff --git a/keyboards/pistachio/rev1/readme.md b/keyboards/rate/pistachio/rev1/readme.md similarity index 100% rename from keyboards/pistachio/rev1/readme.md rename to keyboards/rate/pistachio/rev1/readme.md diff --git a/keyboards/pistachio/rev1/rev1.c b/keyboards/rate/pistachio/rev1/rev1.c similarity index 100% rename from keyboards/pistachio/rev1/rev1.c rename to keyboards/rate/pistachio/rev1/rev1.c diff --git a/keyboards/pistachio/rev1/rev1.h b/keyboards/rate/pistachio/rev1/rev1.h similarity index 100% rename from keyboards/pistachio/rev1/rev1.h rename to keyboards/rate/pistachio/rev1/rev1.h diff --git a/keyboards/pistachio/rev1/rules.mk b/keyboards/rate/pistachio/rev1/rules.mk similarity index 100% rename from keyboards/pistachio/rev1/rules.mk rename to keyboards/rate/pistachio/rev1/rules.mk diff --git a/keyboards/pistachio/rev2/config.h b/keyboards/rate/pistachio/rev2/config.h similarity index 100% rename from keyboards/pistachio/rev2/config.h rename to keyboards/rate/pistachio/rev2/config.h diff --git a/keyboards/pistachio/rev2/readme.md b/keyboards/rate/pistachio/rev2/readme.md similarity index 100% rename from keyboards/pistachio/rev2/readme.md rename to keyboards/rate/pistachio/rev2/readme.md diff --git a/keyboards/pistachio/rev2/rev2.c b/keyboards/rate/pistachio/rev2/rev2.c similarity index 100% rename from keyboards/pistachio/rev2/rev2.c rename to keyboards/rate/pistachio/rev2/rev2.c diff --git a/keyboards/pistachio/rev2/rev2.h b/keyboards/rate/pistachio/rev2/rev2.h similarity index 100% rename from keyboards/pistachio/rev2/rev2.h rename to keyboards/rate/pistachio/rev2/rev2.h diff --git a/keyboards/pistachio/rev2/rules.mk b/keyboards/rate/pistachio/rev2/rules.mk similarity index 100% rename from keyboards/pistachio/rev2/rules.mk rename to keyboards/rate/pistachio/rev2/rules.mk diff --git a/keyboards/rate/pistachio/rules.mk b/keyboards/rate/pistachio/rules.mk new file mode 100644 index 000000000000..a5f44853163a --- /dev/null +++ b/keyboards/rate/pistachio/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = rate/pistachio/rev2 diff --git a/keyboards/pistachio_mp/config.h b/keyboards/rate/pistachio_mp/config.h similarity index 100% rename from keyboards/pistachio_mp/config.h rename to keyboards/rate/pistachio_mp/config.h diff --git a/keyboards/pistachio_mp/info.json b/keyboards/rate/pistachio_mp/info.json similarity index 100% rename from keyboards/pistachio_mp/info.json rename to keyboards/rate/pistachio_mp/info.json diff --git a/keyboards/pistachio_mp/keymaps/default/keymap.c b/keyboards/rate/pistachio_mp/keymaps/default/keymap.c similarity index 100% rename from keyboards/pistachio_mp/keymaps/default/keymap.c rename to keyboards/rate/pistachio_mp/keymaps/default/keymap.c diff --git a/keyboards/pistachio_mp/keymaps/default/readme.md b/keyboards/rate/pistachio_mp/keymaps/default/readme.md similarity index 100% rename from keyboards/pistachio_mp/keymaps/default/readme.md rename to keyboards/rate/pistachio_mp/keymaps/default/readme.md diff --git a/keyboards/pistachio_mp/keymaps/via/keymap.c b/keyboards/rate/pistachio_mp/keymaps/via/keymap.c similarity index 100% rename from keyboards/pistachio_mp/keymaps/via/keymap.c rename to keyboards/rate/pistachio_mp/keymaps/via/keymap.c diff --git a/keyboards/pistachio_mp/keymaps/via/readme.md b/keyboards/rate/pistachio_mp/keymaps/via/readme.md similarity index 100% rename from keyboards/pistachio_mp/keymaps/via/readme.md rename to keyboards/rate/pistachio_mp/keymaps/via/readme.md diff --git a/keyboards/mechmini/v2/keymaps/via/rules.mk b/keyboards/rate/pistachio_mp/keymaps/via/rules.mk similarity index 100% rename from keyboards/mechmini/v2/keymaps/via/rules.mk rename to keyboards/rate/pistachio_mp/keymaps/via/rules.mk diff --git a/keyboards/pistachio_mp/pistachio_mp.c b/keyboards/rate/pistachio_mp/pistachio_mp.c similarity index 100% rename from keyboards/pistachio_mp/pistachio_mp.c rename to keyboards/rate/pistachio_mp/pistachio_mp.c diff --git a/keyboards/pistachio_mp/pistachio_mp.h b/keyboards/rate/pistachio_mp/pistachio_mp.h similarity index 100% rename from keyboards/pistachio_mp/pistachio_mp.h rename to keyboards/rate/pistachio_mp/pistachio_mp.h diff --git a/keyboards/pistachio_mp/readme.md b/keyboards/rate/pistachio_mp/readme.md similarity index 92% rename from keyboards/pistachio_mp/readme.md rename to keyboards/rate/pistachio_mp/readme.md index 0e5b030a6e7d..b8ea088a4a76 100644 --- a/keyboards/pistachio_mp/readme.md +++ b/keyboards/rate/pistachio_mp/readme.md @@ -10,12 +10,12 @@ This is a numeric keypad with a rotary encoder that uses a stainless steel plate Make example for this keyboard (after setting up your build environment): - make pistachio_mp:default + make rate/pistachio_mp:default Flashing example for this keyboard: - make pistachio_mp:default:flash + make rate/pistachio_mp: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). -[Build guide](https://ratelog.net/pistachiomacropad-build-guide/) \ No newline at end of file +[Build guide](https://ratelog.net/pistachiomacropad-build-guide/) diff --git a/keyboards/pistachio_mp/rules.mk b/keyboards/rate/pistachio_mp/rules.mk similarity index 100% rename from keyboards/pistachio_mp/rules.mk rename to keyboards/rate/pistachio_mp/rules.mk diff --git a/keyboards/pistachio_pro/config.h b/keyboards/rate/pistachio_pro/config.h similarity index 97% rename from keyboards/pistachio_pro/config.h rename to keyboards/rate/pistachio_pro/config.h index c3cb58496287..f268967f6e5f 100644 --- a/keyboards/pistachio_pro/config.h +++ b/keyboards/rate/pistachio_pro/config.h @@ -96,7 +96,7 @@ along with this program. If not, see . /* OLED */ #define OLED_DISPLAY_128X64 -#define OLED_FONT_H "keyboards/pistachio_pro/lib/glcdfont.c" +#define OLED_FONT_H "keyboards/rate/pistachio_pro/lib/glcdfont.c" #define OLED_FONT_WIDTH 6 #define OLED_FONT_HEIGHT 6 diff --git a/keyboards/pistachio_pro/info.json b/keyboards/rate/pistachio_pro/info.json similarity index 100% rename from keyboards/pistachio_pro/info.json rename to keyboards/rate/pistachio_pro/info.json diff --git a/keyboards/pistachio_pro/keymaps/default/keymap.c b/keyboards/rate/pistachio_pro/keymaps/default/keymap.c similarity index 100% rename from keyboards/pistachio_pro/keymaps/default/keymap.c rename to keyboards/rate/pistachio_pro/keymaps/default/keymap.c diff --git a/keyboards/pistachio_pro/keymaps/default/readme.md b/keyboards/rate/pistachio_pro/keymaps/default/readme.md similarity index 100% rename from keyboards/pistachio_pro/keymaps/default/readme.md rename to keyboards/rate/pistachio_pro/keymaps/default/readme.md diff --git a/keyboards/pistachio_pro/keymaps/rate/keymap.c b/keyboards/rate/pistachio_pro/keymaps/rate/keymap.c similarity index 100% rename from keyboards/pistachio_pro/keymaps/rate/keymap.c rename to keyboards/rate/pistachio_pro/keymaps/rate/keymap.c diff --git a/keyboards/pistachio_pro/keymaps/rate/readme.md b/keyboards/rate/pistachio_pro/keymaps/rate/readme.md similarity index 100% rename from keyboards/pistachio_pro/keymaps/rate/readme.md rename to keyboards/rate/pistachio_pro/keymaps/rate/readme.md diff --git a/keyboards/pistachio_pro/keymaps/via/keymap.c b/keyboards/rate/pistachio_pro/keymaps/via/keymap.c similarity index 100% rename from keyboards/pistachio_pro/keymaps/via/keymap.c rename to keyboards/rate/pistachio_pro/keymaps/via/keymap.c diff --git a/keyboards/pistachio_pro/keymaps/via/readme.md b/keyboards/rate/pistachio_pro/keymaps/via/readme.md similarity index 100% rename from keyboards/pistachio_pro/keymaps/via/readme.md rename to keyboards/rate/pistachio_pro/keymaps/via/readme.md diff --git a/keyboards/latinpadble/keymaps/via/rules.mk b/keyboards/rate/pistachio_pro/keymaps/via/rules.mk similarity index 100% rename from keyboards/latinpadble/keymaps/via/rules.mk rename to keyboards/rate/pistachio_pro/keymaps/via/rules.mk diff --git a/keyboards/pistachio_pro/lib/bme280.c b/keyboards/rate/pistachio_pro/lib/bme280.c similarity index 100% rename from keyboards/pistachio_pro/lib/bme280.c rename to keyboards/rate/pistachio_pro/lib/bme280.c diff --git a/keyboards/pistachio_pro/lib/bme280.h b/keyboards/rate/pistachio_pro/lib/bme280.h similarity index 100% rename from keyboards/pistachio_pro/lib/bme280.h rename to keyboards/rate/pistachio_pro/lib/bme280.h diff --git a/keyboards/pistachio_pro/lib/glcdfont.c b/keyboards/rate/pistachio_pro/lib/glcdfont.c similarity index 100% rename from keyboards/pistachio_pro/lib/glcdfont.c rename to keyboards/rate/pistachio_pro/lib/glcdfont.c diff --git a/keyboards/pistachio_pro/matrix.c b/keyboards/rate/pistachio_pro/matrix.c similarity index 100% rename from keyboards/pistachio_pro/matrix.c rename to keyboards/rate/pistachio_pro/matrix.c diff --git a/keyboards/pistachio_pro/pistachio_pro.c b/keyboards/rate/pistachio_pro/pistachio_pro.c similarity index 100% rename from keyboards/pistachio_pro/pistachio_pro.c rename to keyboards/rate/pistachio_pro/pistachio_pro.c diff --git a/keyboards/pistachio_pro/pistachio_pro.h b/keyboards/rate/pistachio_pro/pistachio_pro.h similarity index 100% rename from keyboards/pistachio_pro/pistachio_pro.h rename to keyboards/rate/pistachio_pro/pistachio_pro.h diff --git a/keyboards/pistachio_pro/readme.md b/keyboards/rate/pistachio_pro/readme.md similarity index 91% rename from keyboards/pistachio_pro/readme.md rename to keyboards/rate/pistachio_pro/readme.md index b224c874e61e..752f98b73bee 100644 --- a/keyboards/pistachio_pro/readme.md +++ b/keyboards/rate/pistachio_pro/readme.md @@ -10,11 +10,11 @@ This is a JIS layout TKL keyboard with 89 keys, encoder and OLED. Make example for this keyboard (after setting up your build environment): - make pistachio_pro:default + make rate/pistachio_pro:default Flashing example for this keyboard: - make pistachio_pro:default:flash + make rate/pistachio_pro:default:flash To reset the keyboard into bootloader mode, press the reset switch on the underside. diff --git a/keyboards/pistachio_pro/rules.mk b/keyboards/rate/pistachio_pro/rules.mk similarity index 100% rename from keyboards/pistachio_pro/rules.mk rename to keyboards/rate/pistachio_pro/rules.mk diff --git a/keyboards/choco60/choco60.c b/keyboards/recompile_keys/choco60/choco60.c similarity index 100% rename from keyboards/choco60/choco60.c rename to keyboards/recompile_keys/choco60/choco60.c diff --git a/keyboards/choco60/choco60.h b/keyboards/recompile_keys/choco60/choco60.h similarity index 100% rename from keyboards/choco60/choco60.h rename to keyboards/recompile_keys/choco60/choco60.h diff --git a/keyboards/choco60/config.h b/keyboards/recompile_keys/choco60/config.h similarity index 100% rename from keyboards/choco60/config.h rename to keyboards/recompile_keys/choco60/config.h diff --git a/keyboards/choco60/info.json b/keyboards/recompile_keys/choco60/info.json similarity index 100% rename from keyboards/choco60/info.json rename to keyboards/recompile_keys/choco60/info.json diff --git a/keyboards/choco60/keymaps/default/keymap.c b/keyboards/recompile_keys/choco60/keymaps/default/keymap.c similarity index 100% rename from keyboards/choco60/keymaps/default/keymap.c rename to keyboards/recompile_keys/choco60/keymaps/default/keymap.c diff --git a/keyboards/choco60/keymaps/default/readme.md b/keyboards/recompile_keys/choco60/keymaps/default/readme.md similarity index 100% rename from keyboards/choco60/keymaps/default/readme.md rename to keyboards/recompile_keys/choco60/keymaps/default/readme.md diff --git a/keyboards/choco60/keymaps/via/keymap.c b/keyboards/recompile_keys/choco60/keymaps/via/keymap.c similarity index 100% rename from keyboards/choco60/keymaps/via/keymap.c rename to keyboards/recompile_keys/choco60/keymaps/via/keymap.c diff --git a/keyboards/mio/keymaps/via/rules.mk b/keyboards/recompile_keys/choco60/keymaps/via/rules.mk similarity index 100% rename from keyboards/mio/keymaps/via/rules.mk rename to keyboards/recompile_keys/choco60/keymaps/via/rules.mk diff --git a/keyboards/choco60/readme.md b/keyboards/recompile_keys/choco60/readme.md similarity index 88% rename from keyboards/choco60/readme.md rename to keyboards/recompile_keys/choco60/readme.md index 0290f95d2819..187c3c894295 100644 --- a/keyboards/choco60/readme.md +++ b/keyboards/recompile_keys/choco60/readme.md @@ -11,7 +11,7 @@ A 60% split keyboard for programmers. Make example for this keyboard (after setting up your build environment): - make choco60/rev1:default - make choco60/rev2:default + make recompile_keys/choco60/rev1:default + make recompile_keys/choco60/rev2: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/runner3680/3x7/.noci b/keyboards/recompile_keys/choco60/rev1/.noci similarity index 100% rename from keyboards/runner3680/3x7/.noci rename to keyboards/recompile_keys/choco60/rev1/.noci diff --git a/keyboards/choco60/rev1/config.h b/keyboards/recompile_keys/choco60/rev1/config.h similarity index 100% rename from keyboards/choco60/rev1/config.h rename to keyboards/recompile_keys/choco60/rev1/config.h diff --git a/keyboards/choco60/rev1/readme.md b/keyboards/recompile_keys/choco60/rev1/readme.md similarity index 100% rename from keyboards/choco60/rev1/readme.md rename to keyboards/recompile_keys/choco60/rev1/readme.md diff --git a/keyboards/choco60/rev1/rev1.c b/keyboards/recompile_keys/choco60/rev1/rev1.c similarity index 100% rename from keyboards/choco60/rev1/rev1.c rename to keyboards/recompile_keys/choco60/rev1/rev1.c diff --git a/keyboards/choco60/rev1/rev1.h b/keyboards/recompile_keys/choco60/rev1/rev1.h similarity index 100% rename from keyboards/choco60/rev1/rev1.h rename to keyboards/recompile_keys/choco60/rev1/rev1.h diff --git a/keyboards/choco60/rev1/rules.mk b/keyboards/recompile_keys/choco60/rev1/rules.mk similarity index 100% rename from keyboards/choco60/rev1/rules.mk rename to keyboards/recompile_keys/choco60/rev1/rules.mk diff --git a/keyboards/choco60/rev2/config.h b/keyboards/recompile_keys/choco60/rev2/config.h similarity index 100% rename from keyboards/choco60/rev2/config.h rename to keyboards/recompile_keys/choco60/rev2/config.h diff --git a/keyboards/choco60/rev2/readme.md b/keyboards/recompile_keys/choco60/rev2/readme.md similarity index 100% rename from keyboards/choco60/rev2/readme.md rename to keyboards/recompile_keys/choco60/rev2/readme.md diff --git a/keyboards/choco60/rev2/rev2.c b/keyboards/recompile_keys/choco60/rev2/rev2.c similarity index 100% rename from keyboards/choco60/rev2/rev2.c rename to keyboards/recompile_keys/choco60/rev2/rev2.c diff --git a/keyboards/choco60/rev2/rev2.h b/keyboards/recompile_keys/choco60/rev2/rev2.h similarity index 100% rename from keyboards/choco60/rev2/rev2.h rename to keyboards/recompile_keys/choco60/rev2/rev2.h diff --git a/keyboards/choco60/rev2/rules.mk b/keyboards/recompile_keys/choco60/rev2/rules.mk similarity index 100% rename from keyboards/choco60/rev2/rules.mk rename to keyboards/recompile_keys/choco60/rev2/rules.mk diff --git a/keyboards/recompile_keys/choco60/rules.mk b/keyboards/recompile_keys/choco60/rules.mk new file mode 100644 index 000000000000..6abfd34d4730 --- /dev/null +++ b/keyboards/recompile_keys/choco60/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = recompile_keys/choco60/rev1 diff --git a/keyboards/runner3680/3x8/.noci b/keyboards/recompile_keys/cocoa40/.noci similarity index 100% rename from keyboards/runner3680/3x8/.noci rename to keyboards/recompile_keys/cocoa40/.noci diff --git a/keyboards/cocoa40/cocoa40.c b/keyboards/recompile_keys/cocoa40/cocoa40.c similarity index 100% rename from keyboards/cocoa40/cocoa40.c rename to keyboards/recompile_keys/cocoa40/cocoa40.c diff --git a/keyboards/cocoa40/cocoa40.h b/keyboards/recompile_keys/cocoa40/cocoa40.h similarity index 100% rename from keyboards/cocoa40/cocoa40.h rename to keyboards/recompile_keys/cocoa40/cocoa40.h diff --git a/keyboards/cocoa40/config.h b/keyboards/recompile_keys/cocoa40/config.h similarity index 100% rename from keyboards/cocoa40/config.h rename to keyboards/recompile_keys/cocoa40/config.h diff --git a/keyboards/cocoa40/info.json b/keyboards/recompile_keys/cocoa40/info.json similarity index 100% rename from keyboards/cocoa40/info.json rename to keyboards/recompile_keys/cocoa40/info.json diff --git a/keyboards/cocoa40/keymaps/default/keymap.c b/keyboards/recompile_keys/cocoa40/keymaps/default/keymap.c similarity index 100% rename from keyboards/cocoa40/keymaps/default/keymap.c rename to keyboards/recompile_keys/cocoa40/keymaps/default/keymap.c diff --git a/keyboards/cocoa40/keymaps/default/readme.md b/keyboards/recompile_keys/cocoa40/keymaps/default/readme.md similarity index 100% rename from keyboards/cocoa40/keymaps/default/readme.md rename to keyboards/recompile_keys/cocoa40/keymaps/default/readme.md diff --git a/keyboards/cocoa40/readme.md b/keyboards/recompile_keys/cocoa40/readme.md similarity index 94% rename from keyboards/cocoa40/readme.md rename to keyboards/recompile_keys/cocoa40/readme.md index e05caaba9c19..2690628940cf 100644 --- a/keyboards/cocoa40/readme.md +++ b/keyboards/recompile_keys/cocoa40/readme.md @@ -10,6 +10,6 @@ Hardware Availability: https://keys.recompile.net/projects/cocoa40/ Make example for this keyboard (after setting up your build environment): - make cocoa40:default + make recompile_keys/cocoa40: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/cocoa40/rules.mk b/keyboards/recompile_keys/cocoa40/rules.mk similarity index 100% rename from keyboards/cocoa40/rules.mk rename to keyboards/recompile_keys/cocoa40/rules.mk diff --git a/keyboards/mio/config.h b/keyboards/recompile_keys/mio/config.h similarity index 100% rename from keyboards/mio/config.h rename to keyboards/recompile_keys/mio/config.h diff --git a/keyboards/mio/info.json b/keyboards/recompile_keys/mio/info.json similarity index 100% rename from keyboards/mio/info.json rename to keyboards/recompile_keys/mio/info.json diff --git a/keyboards/mio/keymaps/default/keymap.c b/keyboards/recompile_keys/mio/keymaps/default/keymap.c similarity index 100% rename from keyboards/mio/keymaps/default/keymap.c rename to keyboards/recompile_keys/mio/keymaps/default/keymap.c diff --git a/keyboards/mio/keymaps/default/readme.md b/keyboards/recompile_keys/mio/keymaps/default/readme.md similarity index 100% rename from keyboards/mio/keymaps/default/readme.md rename to keyboards/recompile_keys/mio/keymaps/default/readme.md diff --git a/keyboards/mio/keymaps/via/keymap.c b/keyboards/recompile_keys/mio/keymaps/via/keymap.c similarity index 100% rename from keyboards/mio/keymaps/via/keymap.c rename to keyboards/recompile_keys/mio/keymaps/via/keymap.c diff --git a/keyboards/nomu30/keymaps/via/rules.mk b/keyboards/recompile_keys/mio/keymaps/via/rules.mk similarity index 100% rename from keyboards/nomu30/keymaps/via/rules.mk rename to keyboards/recompile_keys/mio/keymaps/via/rules.mk diff --git a/keyboards/mio/mio.c b/keyboards/recompile_keys/mio/mio.c similarity index 100% rename from keyboards/mio/mio.c rename to keyboards/recompile_keys/mio/mio.c diff --git a/keyboards/mio/mio.h b/keyboards/recompile_keys/mio/mio.h similarity index 100% rename from keyboards/mio/mio.h rename to keyboards/recompile_keys/mio/mio.h diff --git a/keyboards/mio/readme.md b/keyboards/recompile_keys/mio/readme.md similarity index 91% rename from keyboards/mio/readme.md rename to keyboards/recompile_keys/mio/readme.md index 6ae4fd049ffc..2703c39e6950 100644 --- a/keyboards/mio/readme.md +++ b/keyboards/recompile_keys/mio/readme.md @@ -10,11 +10,11 @@ High-end custom gaming keyboard. Make example for this keyboard (after setting up your build environment): - make mio:default + make recompile_keys/mio:default Flashing example for this keyboard: - make mio:default:flash + make recompile_keys/mio: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/mio/rules.mk b/keyboards/recompile_keys/mio/rules.mk similarity index 100% rename from keyboards/mio/rules.mk rename to keyboards/recompile_keys/mio/rules.mk diff --git a/keyboards/runner3680/4x6/.noci b/keyboards/recompile_keys/nomu30/.noci similarity index 100% rename from keyboards/runner3680/4x6/.noci rename to keyboards/recompile_keys/nomu30/.noci diff --git a/keyboards/nomu30/config.h b/keyboards/recompile_keys/nomu30/config.h similarity index 100% rename from keyboards/nomu30/config.h rename to keyboards/recompile_keys/nomu30/config.h diff --git a/keyboards/nomu30/info.json b/keyboards/recompile_keys/nomu30/info.json similarity index 100% rename from keyboards/nomu30/info.json rename to keyboards/recompile_keys/nomu30/info.json diff --git a/keyboards/nomu30/keymaps/center_sprit/config.h b/keyboards/recompile_keys/nomu30/keymaps/center_sprit/config.h similarity index 100% rename from keyboards/nomu30/keymaps/center_sprit/config.h rename to keyboards/recompile_keys/nomu30/keymaps/center_sprit/config.h diff --git a/keyboards/nomu30/keymaps/center_sprit/keymap.c b/keyboards/recompile_keys/nomu30/keymaps/center_sprit/keymap.c similarity index 100% rename from keyboards/nomu30/keymaps/center_sprit/keymap.c rename to keyboards/recompile_keys/nomu30/keymaps/center_sprit/keymap.c diff --git a/keyboards/nomu30/keymaps/center_sprit/readme.md b/keyboards/recompile_keys/nomu30/keymaps/center_sprit/readme.md similarity index 100% rename from keyboards/nomu30/keymaps/center_sprit/readme.md rename to keyboards/recompile_keys/nomu30/keymaps/center_sprit/readme.md diff --git a/keyboards/nomu30/keymaps/center_sprit/rules.mk b/keyboards/recompile_keys/nomu30/keymaps/center_sprit/rules.mk similarity index 100% rename from keyboards/nomu30/keymaps/center_sprit/rules.mk rename to keyboards/recompile_keys/nomu30/keymaps/center_sprit/rules.mk diff --git a/keyboards/nomu30/keymaps/default/config.h b/keyboards/recompile_keys/nomu30/keymaps/default/config.h similarity index 100% rename from keyboards/nomu30/keymaps/default/config.h rename to keyboards/recompile_keys/nomu30/keymaps/default/config.h diff --git a/keyboards/nomu30/keymaps/default/keymap.c b/keyboards/recompile_keys/nomu30/keymaps/default/keymap.c similarity index 100% rename from keyboards/nomu30/keymaps/default/keymap.c rename to keyboards/recompile_keys/nomu30/keymaps/default/keymap.c diff --git a/keyboards/nomu30/keymaps/default/readme.md b/keyboards/recompile_keys/nomu30/keymaps/default/readme.md similarity index 100% rename from keyboards/nomu30/keymaps/default/readme.md rename to keyboards/recompile_keys/nomu30/keymaps/default/readme.md diff --git a/keyboards/nomu30/keymaps/like_jis/config.h b/keyboards/recompile_keys/nomu30/keymaps/like_jis/config.h similarity index 100% rename from keyboards/nomu30/keymaps/like_jis/config.h rename to keyboards/recompile_keys/nomu30/keymaps/like_jis/config.h diff --git a/keyboards/nomu30/keymaps/like_jis/keymap.c b/keyboards/recompile_keys/nomu30/keymaps/like_jis/keymap.c similarity index 100% rename from keyboards/nomu30/keymaps/like_jis/keymap.c rename to keyboards/recompile_keys/nomu30/keymaps/like_jis/keymap.c diff --git a/keyboards/nomu30/keymaps/like_jis/readme.md b/keyboards/recompile_keys/nomu30/keymaps/like_jis/readme.md similarity index 100% rename from keyboards/nomu30/keymaps/like_jis/readme.md rename to keyboards/recompile_keys/nomu30/keymaps/like_jis/readme.md diff --git a/keyboards/nomu30/keymaps/like_jis/rules.mk b/keyboards/recompile_keys/nomu30/keymaps/like_jis/rules.mk similarity index 100% rename from keyboards/nomu30/keymaps/like_jis/rules.mk rename to keyboards/recompile_keys/nomu30/keymaps/like_jis/rules.mk diff --git a/keyboards/nomu30/keymaps/via/keymap.c b/keyboards/recompile_keys/nomu30/keymaps/via/keymap.c similarity index 100% rename from keyboards/nomu30/keymaps/via/keymap.c rename to keyboards/recompile_keys/nomu30/keymaps/via/keymap.c diff --git a/keyboards/pistachio_pro/keymaps/via/rules.mk b/keyboards/recompile_keys/nomu30/keymaps/via/rules.mk similarity index 100% rename from keyboards/pistachio_pro/keymaps/via/rules.mk rename to keyboards/recompile_keys/nomu30/keymaps/via/rules.mk diff --git a/keyboards/nomu30/nomu30.c b/keyboards/recompile_keys/nomu30/nomu30.c similarity index 100% rename from keyboards/nomu30/nomu30.c rename to keyboards/recompile_keys/nomu30/nomu30.c diff --git a/keyboards/nomu30/nomu30.h b/keyboards/recompile_keys/nomu30/nomu30.h similarity index 93% rename from keyboards/nomu30/nomu30.h rename to keyboards/recompile_keys/nomu30/nomu30.h index cf724ac6e4c9..964eb2a65fd7 100644 --- a/keyboards/nomu30/nomu30.h +++ b/keyboards/recompile_keys/nomu30/nomu30.h @@ -16,9 +16,9 @@ #pragma once #include "quantum.h" -#ifdef KEYBOARD_nomu30_rev1 +#ifdef KEYBOARD_recompile_keys_nomu30_rev1 #include "rev1.h" -#elif KEYBOARD_nomu30_rev2 +#elif KEYBOARD_recompile_keys_nomu30_rev2 #include "rev2.h" #endif diff --git a/keyboards/nomu30/readme.md b/keyboards/recompile_keys/nomu30/readme.md similarity index 94% rename from keyboards/nomu30/readme.md rename to keyboards/recompile_keys/nomu30/readme.md index 95577164a110..e0551d0002ef 100644 --- a/keyboards/nomu30/readme.md +++ b/keyboards/recompile_keys/nomu30/readme.md @@ -10,6 +10,6 @@ Hardware Availability: https://keys.recompile.net/projects/nomu30/ Make example for this keyboard (after setting up your build environment): - make nomu30:default + make recompile_keys/nomu30: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/runner3680/4x7/.noci b/keyboards/recompile_keys/nomu30/rev1/.noci similarity index 100% rename from keyboards/runner3680/4x7/.noci rename to keyboards/recompile_keys/nomu30/rev1/.noci diff --git a/keyboards/nomu30/rev1/config.h b/keyboards/recompile_keys/nomu30/rev1/config.h similarity index 100% rename from keyboards/nomu30/rev1/config.h rename to keyboards/recompile_keys/nomu30/rev1/config.h diff --git a/keyboards/nomu30/rev1/rev1.c b/keyboards/recompile_keys/nomu30/rev1/rev1.c similarity index 100% rename from keyboards/nomu30/rev1/rev1.c rename to keyboards/recompile_keys/nomu30/rev1/rev1.c diff --git a/keyboards/nomu30/rev1/rev1.h b/keyboards/recompile_keys/nomu30/rev1/rev1.h similarity index 100% rename from keyboards/nomu30/rev1/rev1.h rename to keyboards/recompile_keys/nomu30/rev1/rev1.h diff --git a/keyboards/nomu30/rev1/rules.mk b/keyboards/recompile_keys/nomu30/rev1/rules.mk similarity index 100% rename from keyboards/nomu30/rev1/rules.mk rename to keyboards/recompile_keys/nomu30/rev1/rules.mk diff --git a/keyboards/runner3680/4x8/.noci b/keyboards/recompile_keys/nomu30/rev2/.noci similarity index 100% rename from keyboards/runner3680/4x8/.noci rename to keyboards/recompile_keys/nomu30/rev2/.noci diff --git a/keyboards/nomu30/rev2/config.h b/keyboards/recompile_keys/nomu30/rev2/config.h similarity index 100% rename from keyboards/nomu30/rev2/config.h rename to keyboards/recompile_keys/nomu30/rev2/config.h diff --git a/keyboards/nomu30/rev2/rev2.c b/keyboards/recompile_keys/nomu30/rev2/rev2.c similarity index 100% rename from keyboards/nomu30/rev2/rev2.c rename to keyboards/recompile_keys/nomu30/rev2/rev2.c diff --git a/keyboards/nomu30/rev2/rev2.h b/keyboards/recompile_keys/nomu30/rev2/rev2.h similarity index 100% rename from keyboards/nomu30/rev2/rev2.h rename to keyboards/recompile_keys/nomu30/rev2/rev2.h diff --git a/keyboards/nomu30/rev2/rules.mk b/keyboards/recompile_keys/nomu30/rev2/rules.mk similarity index 100% rename from keyboards/nomu30/rev2/rules.mk rename to keyboards/recompile_keys/nomu30/rev2/rules.mk diff --git a/keyboards/recompile_keys/nomu30/rules.mk b/keyboards/recompile_keys/nomu30/rules.mk new file mode 100644 index 000000000000..431b619249b4 --- /dev/null +++ b/keyboards/recompile_keys/nomu30/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = recompile_keys/nomu30/rev1 diff --git a/keyboards/redox_w/config.h b/keyboards/redox_w/config.h index b480b072f99a..c4aeb32d5857 100644 --- a/keyboards/redox_w/config.h +++ b/keyboards/redox_w/config.h @@ -55,12 +55,3 @@ //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/redox_w/matrix.c b/keyboards/redox_w/matrix.c index 703987a93967..fd25231d9e3c 100644 --- a/keyboards/redox_w/matrix.c +++ b/keyboards/redox_w/matrix.c @@ -13,89 +13,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { +#include "quantum.h" +#include "matrix.h" +#include "uart.h" - matrix_init_quantum(); - serial_init(); +void matrix_init_custom(void) { + uart_init(1000000); } -uint8_t matrix_scan(void) -{ +bool matrix_scan_custom(matrix_row_t current_matrix[]) { uint32_t timeout = 0; + bool changed = false; //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates entirely, erase the last data uint8_t uart_data[11] = {0}; @@ -105,58 +37,27 @@ uint8_t matrix_scan(void) //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while (!uart_available()) { timeout++; - if (timeout > 10000){ + if (timeout > 10000) { break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { + if (uart_data[10] == 0xE0) { //shifting and transferring the keystates to the QMK matrix variable for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 7; + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 7; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; } } - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3535 +#define PRODUCT_ID 0x3510 +#define MANUFACTURER RGBKB +#define PRODUCT Sol 3 + +#define USB_POLLING_INTERVAL_MS 1 + +/* Matrix Configuration - Rows are doubled up */ +#define MATRIX_ROWS 12 +// Last pins reserved for encoder / touch encoder support +#define MATRIX_ROW_PINS { B15, A8, A15, B12, A3, NO_PIN } +#define MATRIX_ROW_PINS_RIGHT { B15, B14, A8, A13, A7, NO_PIN } +#define MATRIX_COLS 8 +// Empty matrix entries used for encoder / touch encoder support +#define MATRIX_COL_PINS { A6, A7, B0, B2, B1, B9, B3, B4 } +#define MATRIX_COL_PINS_RIGHT { B9, B8, B4, A6, A3, B10, B12, B11 } +#define MATRIX_IO_DELAY 5 + +#define BUSY_WAIT +#define BUSY_WAIT_INSTRUCTIONS 35 // Increase if two rows are pressed at the same time. +#define GPIO_INPUT_PIN_DELAY 10 + +/* Touchbar adjustments */ +#define TOUCH_DEADZONE 50 // width of a "button", wider inputs will be interpreted as a swipe +#define TOUCH_TERM 350 // time of a "button" touch, longer inputs will be a swipe +#define TOUCH_RESOLUTION 25 // sensitivity of swipes, lower=faster +#define TOUCH_SEGMENTS 3 + +/* Encoder Configuration */ +// Matrix Entries k36/k35(E1SW>B13), k33/k32, k7/k28 +#define ENCODERS_PAD_A { A1, B10, A13 } +#define ENCODERS_PAD_B { A2, B11, B14 } +// Matrix Entries k72/k71(E5SW>B0), k69/k68, k43/k64 +#define ENCODERS_PAD_A_RIGHT { A1, C15, B3 } +#define ENCODERS_PAD_B_RIGHT { A2, C14, B13 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* CRC Configuration */ +#define CRC8_OPTIMIZE_SPEED +#define CRC8_USE_TABLE + +/* Split Keyboard Configuration */ +#define SPLIT_HAND_PIN C13 +#define SPLIT_USB_DETECT +// also handles the SERIAL_USART_TX_PIN define +#define SOFT_SERIAL_PIN A9 +#define SERIAL_USART_TX_PAL_MODE 7 +#define SERIAL_USART_TIMEOUT 5 +#define SERIAL_USART_DRIVER SD1 +//#define SERIAL_USART_FULL_DUPLEX - Waiting on reunification pr +#if SERIAL_USART_FULL_DUPLEX + #define SERIAL_USART_RX_PIN A10 + #define SERIAL_USART_RX_PAL_MODE 7 + // Mun connects TX to TX and RX to RX as we were planning on i2c split, so we need pin swap for full duplex + #define SERIAL_USART_PIN_SWAP + #define SERIAL_USART_SPEED (2 * 1024 * 1024) +#else + #define SERIAL_USART_SPEED (1 * 1024 * 1024) +#endif + +/* Split Transport Features */ +#define SPLIT_TRANSPORT_MIRROR +#define SPLIT_LAYER_STATE_ENABLE +#define SPLIT_LED_STATE_ENABLE +#define SPLIT_TRANSACTION_IDS_KB TOUCH_ENCODER_SYNC, RGB_MENU_SYNC + +/* LED Turbo DIP Switch */ +#define DIP_SWITCH_PINS { A14, B13 } +#define DIP_SWITCH_PINS_RIGHT { A14, B0 } + +/* RGB LED Configuration */ +#define RGB_DI_PIN B5 +#define RGBLED_NUM 156 +#define RGBLED_SPLIT { 78, 78 } +#define RGBLIGHT_LIMIT_VAL 255 + +// RGB Lighting Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgblight?id=effect-and-animation-toggles +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE + +#define DRIVER_LED_TOTAL RGBLED_NUM +#define RGB_MATRIX_SPLIT RGBLED_SPLIT +#define RGB_MATRIX_CENTER { 81, 28 } +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS RGBLIGHT_LIMIT_VAL +#define RGB_MATRIX_LED_FLUSH_LIMIT 33 +#define RGB_MATRIX_LED_PROCESS_LIMIT 10 +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define RGB_MATRIX_KEYPRESSES +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define WS2812_PWM_DRIVER PWMD3 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM3 +#define WS2812_DMA_CHANNEL 3 + +#define TOUCH_UPDATE_INTERVAL 33 +#define OLED_UPDATE_INTERVAL 33 +#define TAP_CODE_DELAY 5 + +/* Audio Configuration */ +#define AUDIO_PIN A4 +#define AUDIO_PIN_ALT A5 +#define AUDIO_PIN_ALT_AS_NEGATIVE +#define AUDIO_CLICKY +#define AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE +#define AUDIO_DAC_OFF_VALUE 0 diff --git a/keyboards/rgbkb/sol3/halconf.h b/keyboards/rgbkb/sol3/halconf.h new file mode 100644 index 000000000000..f882cef08559 --- /dev/null +++ b/keyboards/rgbkb/sol3/halconf.h @@ -0,0 +1,22 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +#define HAL_USE_DAC TRUE + +#define HAL_USE_GPT TRUE + +#define HAL_USE_I2C TRUE + +#define HAL_USE_PWM TRUE + +#define HAL_USE_SERIAL TRUE + +#include_next diff --git a/keyboards/rgbkb/sol3/keymaps/default/config.h b/keyboards/rgbkb/sol3/keymaps/default/config.h new file mode 100644 index 000000000000..b239f5bb8038 --- /dev/null +++ b/keyboards/rgbkb/sol3/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +// No need for the single versions when multi performance isn't a problem =D +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#undef ENABLE_RGB_MATRIX_SPLASH +#undef ENABLE_RGB_MATRIX_SOLID_SPLASH + +// 20m timeout (20m * 60s * 1000mil) +// #define RGB_DISABLE_TIMEOUT 1200000 +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +#define STM32_ONBOARD_EEPROM_SIZE 2048 + diff --git a/keyboards/rgbkb/sol3/keymaps/default/keymap.c b/keyboards/rgbkb/sol3/keymaps/default/keymap.c new file mode 100644 index 000000000000..c1d1a04d79d0 --- /dev/null +++ b/keyboards/rgbkb/sol3/keymaps/default/keymap.c @@ -0,0 +1,173 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#include QMK_KEYBOARD_H + +/* Qwerty + * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ + * │ GESC │ 1 │ 2 │ 3 │ 4 │ 5 │ - │ │ = │ 6 │ 7 │ 8 │ 9 │ 0 │ BkSp │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Tab │ Q │ W │ E │ R │ T │ [ │ │ ] │ Y │ U │ I │ O │ P │ \ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │FNCAPS│ A │ S │ D │ F │ G │ ( │ │ ) │ H │ J │ K │ L │ ; │ ' │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │Shift │ Z │ X │ C │ V │ B │ { │ │ } │ N │ M │ , │ . │ / │Enter │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Ctrl │ Win │ Alt │ RGB │ ADJ │ │ DEL │ │ Enter│ │ FN │ Left │ Down │ Up │Right │ + * └──────┴──────┴──────┴──────┴──────┤ Space├──────┤ ├──────┤ Space├──────┴──────┴──────┴──────┴──────┘ + * │ │ DEL │ │ Enter│ │ + * └──────┴──────┘ └──────┴──────┘ + * ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│ │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + * ┌──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┐ + * │Vol Dn│Vol Up│ Prev │ Play │ Next │ │Vol Dn│Vol Up│ Prev │ Play │ Next │ + * └──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┘ + */ + +enum sol_layers { + _QWERTY, + _COLEMAK, + _GAME, + _FN, + _ADJUST +}; + +enum sol_keycodes { + // Disables touch processing + TCH_TOG = SAFE_RANGE, + MENU_BTN, + MENU_UP, + MENU_DN, + RGB_RST +}; + +#define FN MO(_FN) +#define ADJUST MO(_ADJUST) +#define COLEMAK DF(_COLEMAK) +#define GAME DF(_GAME) +#define QWERTY DF(_QWERTY) +#define FN_CAPS LT(_FN, KC_CAPS) +//#define RGB_ADJ LT(_ADJUST, RGB_TOG) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + KC_GESC, 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_BSLS, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, 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_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTENT, + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJUST, KC_SPC, KC_PGDN, KC_DEL, KC_ENT, KC_PGUP, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL, + + KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, + KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV + ), + + [_COLEMAK] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, + _______, KC_A, KC_R, KC_S, KC_T, KC_D, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, KC_F1, KC_F5, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_F2, KC_F6, KC_Y, KC_U, KC_I, KC_O, KC_P, _______, + _______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F3, KC_F7, KC_H, KC_J, KC_K, KC_L, KC_SCLN, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F4, KC_F8, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PSCR, KC_PGUP, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_PGDN, + _______, AU_TOG, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, CK_TOGG, CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGB_RST, _______, DM_REC1, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, + _______, RGB_SPD, _______, RGB_SPI, _______, _______, DM_RSTP, _______, _______, KC_P1, KC_P2, KC_P3, _______, GAME, + _______, RGB_RMOD,RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_NLCK, QWERTY, COLEMAK, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) + { + case MENU_BTN: + if (record->event.pressed) { + rgb_menu_selection(); + } + return false; + case MENU_UP: + if (record->event.pressed) { + rgb_menu_action(true); + } + return false; + case MENU_DN: + if (record->event.pressed) { + rgb_menu_action(false); + } + return false; + case RGB_RST: + if (record->event.pressed) { + eeconfig_update_rgb_matrix_default(); + } + return false; + case TCH_TOG: + if (record->event.pressed) { + touch_encoder_toggle(); + } + return false; // Skip all further processing of this key + default: + return true; + } +} + +void render_layer_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer"), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("QWRTY"), false); + break; + case _COLEMAK: + oled_write_ln_P(PSTR("Colemk"), false); + break; + case _GAME: + oled_write_ln_P(PSTR("Game "), false); + break; + case _FN: + oled_write_ln_P(PSTR("FN "), false); + break; + case _ADJUST: + oled_write_ln_P(PSTR("Adjst"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } +} diff --git a/keyboards/rgbkb/sol3/keymaps/kageurufu/config.h b/keyboards/rgbkb/sol3/keymaps/kageurufu/config.h new file mode 100644 index 000000000000..400848aa355d --- /dev/null +++ b/keyboards/rgbkb/sol3/keymaps/kageurufu/config.h @@ -0,0 +1,32 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. Frank Tackitt + * ---------------------------------------------------------------------------- + */ + +#pragma once + +// No need for the single versions when multi performance isn't a problem =D +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH + +// 20m timeout (20m * 60s * 1000mil) +// #define RGB_DISABLE_TIMEOUT 1200000 +#define RGB_DISABLE_WHEN_USB_SUSPENDED + + +#define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2 +// 224B per layer right now +#define DYNAMIC_KEYMAP_LAYER_COUNT 8 +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 + +#define VIA_QMK_RGBLIGHT_ENABLE + +#define STM32_ONBOARD_EEPROM_SIZE 2048 + diff --git a/keyboards/rgbkb/sol3/keymaps/kageurufu/keymap.c b/keyboards/rgbkb/sol3/keymaps/kageurufu/keymap.c new file mode 100644 index 000000000000..90773203b5ff --- /dev/null +++ b/keyboards/rgbkb/sol3/keymaps/kageurufu/keymap.c @@ -0,0 +1,61 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. Frank Tackitt + * ---------------------------------------------------------------------------- + */ + +#include QMK_KEYBOARD_H +#include "kageurufu.h" + +extern keymap_config_t keymap_config; + +/* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | | | | | | | | | | | | | | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | | | | | | | | | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Esc | | | | | | | | | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Sft( | | | | | | | | | | | | | | Sft) | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Win | Alt | FN | Space| RGB | | FN | FN | - | = | Down | PgUp | PgDn | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Space| Bksp | | Enter| Space| + * `-------------' `--------=----' + */ +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__, \ + KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, \ + KC_MNXT, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU ) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = EXPAND_LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, RGB_MOD, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, _________________QWERTY_L1_________________, KC_LBRC, KC_RBRC, _________________QWERTY_R1_________________, KC_BSLS, + FN_ESC, _________________QWERTY_L2_________________, RGB_SAI, RGB_VAI, _________________QWERTY_R2_________________, KC_QUOT, + KC_LSPO, _________________QWERTY_L3_________________, RGB_SAD, RGB_VAD, _________________QWERTY_R3_________________, KC_RSPC, + KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, KC_MUTE, KC_BSPC, KC_ENT, FN, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN + ), + + [_FN] = EXPAND_LAYOUT( + ________________FUNCTION_L1________________, _______, KC_PSCR, ________________FUNCTION_R1________________, + ________________FUNCTION_L2________________, _______, _______, ________________FUNCTION_R2________________, + ________________FUNCTION_L3________________, _______, _______, ________________FUNCTION_R3________________, + ________________FUNCTION_L4________________, _______, _______, ________________FUNCTION_R4________________, + ________________FUNCTION_L5________________, ADJ, KC_DEL, _______, ADJ, ________________FUNCTION_R5________________ + ), + + [_ADJ] = EXPAND_LAYOUT( + _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, + _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, + _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, + _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, + _________________ADJUST_L5_________________, _______, _______, _______, _______, _________________ADJUST_R5_________________ + + ) + +}; diff --git a/keyboards/nebula12/keymaps/via/rules.mk b/keyboards/rgbkb/sol3/keymaps/kageurufu/rules.mk old mode 100755 new mode 100644 similarity index 100% rename from keyboards/nebula12/keymaps/via/rules.mk rename to keyboards/rgbkb/sol3/keymaps/kageurufu/rules.mk diff --git a/keyboards/rgbkb/sol3/keymaps/via/config.h b/keyboards/rgbkb/sol3/keymaps/via/config.h new file mode 100644 index 000000000000..3934e6c49162 --- /dev/null +++ b/keyboards/rgbkb/sol3/keymaps/via/config.h @@ -0,0 +1,32 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +// No need for the single versions when multi performance isn't a problem =D +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#undef ENABLE_RGB_MATRIX_SPLASH +#undef ENABLE_RGB_MATRIX_SOLID_SPLASH + +// 20m timeout (20m * 60s * 1000mil) +// #define RGB_DISABLE_TIMEOUT 1200000 +#define RGB_DISABLE_WHEN_USB_SUSPENDED + + +#define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2 +// 224B per layer right now +#define DYNAMIC_KEYMAP_LAYER_COUNT 8 +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 + +#define VIA_QMK_RGBLIGHT_ENABLE + +#define STM32_ONBOARD_EEPROM_SIZE 2048 + diff --git a/keyboards/rgbkb/sol3/keymaps/via/keymap.c b/keyboards/rgbkb/sol3/keymaps/via/keymap.c new file mode 100644 index 000000000000..740d3cc084c4 --- /dev/null +++ b/keyboards/rgbkb/sol3/keymaps/via/keymap.c @@ -0,0 +1,218 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#include QMK_KEYBOARD_H + +/* Qwerty + * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ + * │ GESC │ 1 │ 2 │ 3 │ 4 │ 5 │ - │ │ = │ 6 │ 7 │ 8 │ 9 │ 0 │ BkSp │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Tab │ Q │ W │ E │ R │ T │ [ │ │ ] │ Y │ U │ I │ O │ P │ \ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │FNCAPS│ A │ S │ D │ F │ G │ ( │ │ ) │ H │ J │ K │ L │ ; │ ' │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │Shift │ Z │ X │ C │ V │ B │ { │ │ } │ N │ M │ , │ . │ / │Enter │ + * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ + * │ Ctrl │ Win │ Alt │ RGB │ ADJ │ │ DEL │ │ Enter│ │ FN │ Left │ Down │ Up │Right │ + * └──────┴──────┴──────┴──────┴──────┤ Space├──────┤ ├──────┤ Space├──────┴──────┴──────┴──────┴──────┘ + * │ │ DEL │ │ Enter│ │ + * └──────┴──────┘ └──────┴──────┘ + * ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│ │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + * ┌──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┐ + * │Vol Dn│Vol Up│ Prev │ Play │ Next │ │Vol Dn│Vol Up│ Prev │ Play │ Next │ + * └──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┘ + */ + +enum sol_layers { + _QWERTY, + _COLEMAK, + _GAME, + _FN, + _ADJUST, + _VIA1, + _VIA2, + _VIA3 +}; + +enum sol_keycodes { + // Disables touch processing + TCH_TOG = SAFE_RANGE, + MENU_BTN, + MENU_UP, + MENU_DN, + RGB_RST +}; + +#define FN MO(_FN) +#define ADJUST MO(_ADJUST) +#define COLEMAK DF(_COLEMAK) +#define GAME DF(_GAME) +#define QWERTY DF(_QWERTY) +#define FN_CAPS LT(_FN, KC_CAPS) +//#define RGB_ADJ LT(_ADJUST, RGB_TOG) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + KC_GESC, 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_BSLS, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, 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_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTENT, + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJUST, KC_SPC, KC_PGDN, KC_DEL, KC_ENT, KC_PGUP, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL, + + KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, + KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV + ), + + [_COLEMAK] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, + _______, KC_A, KC_R, KC_S, KC_T, KC_D, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, KC_F1, KC_F5, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_F2, KC_F6, KC_Y, KC_U, KC_I, KC_O, KC_P, _______, + _______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F3, KC_F7, KC_H, KC_J, KC_K, KC_L, KC_SCLN, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F4, KC_F8, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PSCR, KC_PGUP, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_PGDN, + _______, AU_TOG, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, CK_TOGG, CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGB_RST, _______, DM_REC1, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, + _______, RGB_SPD, _______, RGB_SPI, _______, _______, DM_RSTP, _______, _______, KC_P1, KC_P2, KC_P3, _______, GAME, + _______, RGB_RMOD,RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_NLCK, QWERTY, COLEMAK, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_VIA1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_VIA2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_VIA3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) + { + case MENU_BTN: + if (record->event.pressed) { + rgb_menu_selection(); + } + return false; + case MENU_UP: + if (record->event.pressed) { + rgb_menu_action(true); + } + return false; + case MENU_DN: + if (record->event.pressed) { + rgb_menu_action(false); + } + return false; + case RGB_RST: + if (record->event.pressed) { + eeconfig_update_rgb_matrix_default(); + } + return false; + case TCH_TOG: + if (record->event.pressed) { + touch_encoder_toggle(); + } + return false; // Skip all further processing of this key + default: + return true; + } +} + +void render_layer_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer"), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("QWRTY"), false); + break; + case _COLEMAK: + oled_write_ln_P(PSTR("Colemk"), false); + break; + case _GAME: + oled_write_ln_P(PSTR("Game "), false); + break; + case _FN: + oled_write_ln_P(PSTR("FN "), false); + break; + case _ADJUST: + oled_write_ln_P(PSTR("Adjst"), false); + break; + case _VIA1: + oled_write_ln_P(PSTR("VIA1 "), false); + break; + case _VIA2: + oled_write_ln_P(PSTR("VIA2 "), false); + break; + case _VIA3: + oled_write_ln_P(PSTR("VIA3 "), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } +} diff --git a/keyboards/nebula68/keymaps/via/rules.mk b/keyboards/rgbkb/sol3/keymaps/via/rules.mk old mode 100755 new mode 100644 similarity index 100% rename from keyboards/nebula68/keymaps/via/rules.mk rename to keyboards/rgbkb/sol3/keymaps/via/rules.mk diff --git a/keyboards/rgbkb/sol3/mcuconf.h b/keyboards/rgbkb/sol3/mcuconf.h new file mode 100644 index 000000000000..e68a680f48ed --- /dev/null +++ b/keyboards/rgbkb/sol3/mcuconf.h @@ -0,0 +1,30 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +#include_next + +#undef STM32_DAC_USE_DAC1_CH1 +#define STM32_DAC_USE_DAC1_CH1 TRUE + +#undef STM32_DAC_USE_DAC1_CH2 +#define STM32_DAC_USE_DAC1_CH2 TRUE + +#undef STM32_GPT_USE_TIM6 +#define STM32_GPT_USE_TIM6 TRUE + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE + +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/rgbkb/sol3/rev1/config.h b/keyboards/rgbkb/sol3/rev1/config.h new file mode 100644 index 000000000000..7ff0b54903ee --- /dev/null +++ b/keyboards/rgbkb/sol3/rev1/config.h @@ -0,0 +1,12 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +#define DEVICE_VER 0x0001 diff --git a/keyboards/rgbkb/sol3/rev1/rev1.c b/keyboards/rgbkb/sol3/rev1/rev1.c new file mode 100644 index 000000000000..5dc156c94d1d --- /dev/null +++ b/keyboards/rgbkb/sol3/rev1/rev1.c @@ -0,0 +1,287 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#include "rev1.h" +#include "split_util.h" + +#define NUMBER_OF_TOUCH_ENCODERS 2 +#define TOUCH_ENCODER_OPTIONS TOUCH_SEGMENTS + 2 + +#define NUMBER_OF_ENCODERS 6 +#define ENCODER_OPTIONS 2 + +typedef struct PACKED { + uint8_t r; + uint8_t c; +} encodermap_t; + +// this maps encoders and then touch encoders to their respective electrical matrix entry +// mapping is row (y) then column (x) when looking at the electrical layout +const encodermap_t encoder_map[NUMBER_OF_ENCODERS][ENCODER_OPTIONS] = +{ + { { 5, 0 }, { 5, 1 } }, // Encoder 0 matrix entries + { { 5, 2 }, { 5, 3 } }, // Encoder 1 matrix entries + { { 5, 4 }, { 5, 5 } }, // Encoder 2 matrix entries + { { 11, 0 }, { 11, 1 } }, // Encoder 3 matrix entries + { { 11, 2 }, { 11, 3 } }, // Encoder 4 matrix entries + { { 11, 4 }, { 11, 5 } } // Encoder 5 matrix entries +}; + +const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] = +{ + { { 1, 7 }, { 0, 7 }, { 2, 7 }, { 5, 6 }, { 5, 7 }, }, // Touch Encoder 0 matrix entries + { { 7, 7 }, { 6, 7 }, { 8, 7 }, { 11, 6 }, { 11, 7 }, } // Touch Encoder 1 matrix entries +}; + +static bool limit_lightning = true; + +RGB rgb_matrix_hsv_to_rgb(HSV hsv) { + if (limit_lightning) hsv.v /= 2; + return hsv_to_rgb(hsv); +} + +bool dip_switch_update_kb(uint8_t index, bool active) { + if (!dip_switch_update_user(index, active)) + return false; + + switch(index) { + case 0: { + limit_lightning = active; + break; + } + case 1: { + // Handle RGB Encoder switch press + action_exec((keyevent_t){ + .key = (keypos_t){.row = isLeftHand ? 4 : 10, .col = 6}, + .pressed = active, .time = (timer_read() | 1) /* time should not be 0 */ + }); + break; + } + } + return false; +} + +static void process_encoder_matrix(encodermap_t pos) { + action_exec((keyevent_t){ + .key = (keypos_t){.row = pos.r, .col = pos.c}, .pressed = true, .time = (timer_read() | 1) /* time should not be 0 */ + }); +#if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); +#endif + action_exec((keyevent_t){ + .key = (keypos_t){.row = pos.r, .col = pos.c}, .pressed = false, .time = (timer_read() | 1) /* time should not be 0 */ + }); +} + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) + return false; + + // Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1 + process_encoder_matrix(encoder_map[index][clockwise ? 0 : 1]); + return false; +} + +bool touch_encoder_update_kb(uint8_t index, bool clockwise) { + if (!touch_encoder_update_user(index, clockwise)) + return false; + + // Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1 + process_encoder_matrix(touch_encoder_map[index][clockwise ? 0 : 1]); + return false; +} + +bool touch_encoder_tapped_kb(uint8_t index, uint8_t section) { + if (!touch_encoder_tapped_user(index, section)) + return false; + + process_encoder_matrix(touch_encoder_map[index][section + 2]); + return false; +} + +void matrix_slave_scan_kb() { + dip_switch_read(false); + matrix_slave_scan_user(); +} + +#ifdef RGB_MATRIX_ENABLE +// clang-format off +led_config_t g_led_config = { { + { 41, 42, 43, 44, 45, 46, 47 }, + { 54, 53, 52, 51, 50, 49, 48 }, + { 55, 56, 57, 58, 59, 60, 61 }, + { 68, 67, 66, 65, 64, 63, 62 }, + { 69, 70, 71, 72, 73, 74, 75, 76 }, + { 119, 120, 121, 122, 123, 124, 125 }, + { 132, 131, 130, 129, 128, 127, 126 }, + { 133, 134, 135, 136, 137, 138, 139 }, + { 146, 145, 144, 143, 142, 141, 140 }, + { 147, 148, 149, 150, 151, 152, 153 } +}, { // ALL XY VALUES DIVIDE BY 2, THEN ADD 5 + { 1, 6 }, { 1, 13 }, { 1, 19 }, { 1, 25 }, { 1, 31 }, { 1, 37 }, { 1, 43 }, { 1, 49 }, { 4, 52 }, { 11, 52 }, + { 17, 52 }, { 23, 52 }, { 29, 52 }, { 35, 52 }, { 41, 54 }, { 46, 57 }, { 52, 60 }, { 57, 63 }, { 62, 66 }, { 68, 69 }, + { 73, 67 }, { 76, 62 }, { 79, 57 }, { 78, 51 }, { 77, 45 }, { 76, 39 }, { 76, 33 }, { 76, 27 }, { 76, 21 }, { 76, 14 }, + { 76, 8 }, { 72, 3 }, { 59, 3 }, { 53, 3 }, { 46, 3 }, { 40, 3 }, { 34, 3 }, { 28, 3 }, { 22, 3 }, { 10, 3 }, { 3, 3 }, + { 9, 6 }, { 21, 6 }, { 30, 6 }, { 40, 6 }, { 49, 6 }, { 59, 6 }, { 71, 6 }, + { 71, 16 }, { 59, 16 }, { 49, 16 }, { 40, 16 }, { 30, 16 }, { 21, 16 }, { 9, 16 }, + { 9, 25 }, { 21, 25 }, { 30, 25 }, { 40, 25 }, { 49, 25 }, { 59, 25 }, { 71, 25 }, + { 71, 35 }, { 59, 35 }, { 49, 35 }, { 40, 35 }, { 30, 35 }, { 21, 35 }, { 9, 35 }, + { 9, 44 }, { 21, 44 }, { 30, 44 }, { 40, 44 }, { 49, 44 }, { 66, 50 }, { 75, 54 }, { 70, 62 }, { 60, 60 }, + + { 160, 6 }, { 160, 13 }, { 160, 19 }, { 160, 25 }, { 160, 31 }, { 160, 37 }, { 160, 43 }, { 160, 49 }, { 157, 52 }, { 151, 52 }, + { 145, 52 }, { 138, 52 }, { 132, 52 }, { 126, 52 }, { 120, 54 }, { 115, 57 }, { 110, 60 }, { 105, 63 }, { 99, 66 }, { 94, 69 }, + { 89, 67 }, { 86, 62 }, { 83, 57 }, { 83, 51 }, { 85, 45 }, { 86, 39 }, { 86, 33 }, { 86, 27 }, { 86, 21 }, { 86, 14 }, + { 86, 8 }, { 90, 3 }, { 103, 3 }, { 109, 3 }, { 115, 3 }, { 121, 3 }, { 127, 3 }, { 133, 3 }, { 140, 3 }, { 152, 3 }, { 158, 3 }, + { 153, 6 }, { 141, 6 }, { 131, 6 }, { 122, 6 }, { 112, 6 }, { 103, 6 }, { 91, 6 }, + { 91, 16 }, { 103, 16 }, { 112, 16 }, { 122, 16 }, { 131, 16 }, { 141, 16 }, { 153, 16 }, + { 153, 25 }, { 141, 25 }, { 131, 25 }, { 122, 25 }, { 112, 25 }, { 103, 25 }, { 91, 25 }, + { 91, 35 }, { 103, 35 }, { 112, 35 }, { 122, 35 }, { 131, 35 }, { 141, 35 }, { 153, 35 }, + { 153, 44 }, { 141, 44 }, { 131, 44 }, { 122, 44 }, { 112, 44 }, { 96, 50 }, { 87, 54 }, { 92, 62 }, { 102, 60 }, +}, { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1 +} }; +// clang-format on + +void rgb_matrix_increase_flags(void) +{ + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } +} +#endif + + +__attribute__((weak)) +void render_layer_status(void) { + // Keymap specific, expected to be overridden + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer"), false); + oled_write_ln_P(PSTR("Undef"), false); +} + +__attribute__((weak)) +void render_leds_status(void) +{ + // Host Keyboard LED Status + static const char PROGMEM led_icon[] = { + 0x0F,0x3A,0 + }; + oled_write_P(led_icon, false); + led_t led_state = host_keyboard_led_state(); + oled_write_P( led_state.num_lock ? PSTR("N") : PSTR(" "), false); + oled_write_P( led_state.caps_lock ? PSTR("C") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("S") : PSTR(" "), false); +} + +__attribute__((weak)) +void render_touch_status(void) +{ + // Host Touch LED Status + static const char PROGMEM touch_icon[] = { + 0x12,0x3A,0 + }; + oled_write_P(touch_icon, false); + oled_write_P( touch_encoder_is_on() ? PSTR("T") : PSTR(" "), false); + oled_write_P(touch_encoder_is_calibrating() ? PSTR("C") : PSTR(" "), false); + oled_write_P(PSTR(" "), false); +} + +__attribute__((weak)) +void render_audio_status(void) +{ + // Host Audio Status + static const char PROGMEM audio_icon[] = { + 0x0E,0x3A,0 + }; + oled_write_P(audio_icon, false); + oled_write_P( audio_is_on() ? PSTR("A") : PSTR(" "), false); + oled_write_P(is_clicky_on() ? PSTR("C") : PSTR(" "), false); + oled_write_P( is_music_on() ? PSTR("M") : PSTR(" "), false); +} + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + // Sol 3 uses OLED_ROTATION_270 for default rotation on both halves + return oled_init_user(OLED_ROTATION_270); +} + +bool oled_task_kb(void) { + if (!oled_task_user()) + return false; + + if (is_keyboard_left()) { + render_icon(); + oled_write_P(PSTR(" "), false); + render_layer_status(); + oled_write_P(PSTR(" "), false); + render_leds_status(); + oled_write_P(PSTR(" "), false); + render_touch_status(); + oled_write_P(PSTR(" "), false); + render_audio_status(); + } + else { + render_icon(); + oled_write_P(PSTR(" "), false); + render_rgb_menu(); + } + return false; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) + return false; + + switch(keycode) { +#ifdef RGB_MATRIX_ENABLE + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_increase_flags(); + } + return false; +#endif + } + return true; +}; \ No newline at end of file diff --git a/keyboards/rgbkb/sol3/rev1/rev1.h b/keyboards/rgbkb/sol3/rev1/rev1.h new file mode 100644 index 000000000000..e80f8c298d37 --- /dev/null +++ b/keyboards/rgbkb/sol3/rev1/rev1.h @@ -0,0 +1,74 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +#include "sol3.h" + +// clang-format off +/* Blank ascii map to reuse, with labeled possible encoder positions, *rgb encoder only +┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ +│ │ │ │ │ │ │ E2 │ │ E5 │ │ │ │ │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ │ │ │ E2 │ │ E5 │ │ │ │ │ │ │ +├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ +│ │ │ │ E1 │ E1 │ │ E0* │ │ E3* │ │ E4 │ E4 │ │ │ │ +└──────┴──────┴──────┴──────┴──────┤ ├──────┤ ├──────┤ ├──────┴──────┴──────┴──────┴──────┘ + │ │ E0 │ │ E3 │ │ + └──────┴──────┘ └──────┴──────┘ +┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ +│ E0↑ │ E0↓ │ E1↑ │ E1↓ │ E2↑ │ E2↓ │ │ E3↑ │ E3↓ │ E4↑ │ E4↓ │ E5↑ │ E5↓ │ +└──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ +┌──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┐ +│ │ │ │ │ │ │ │ │ │ │ │ +└──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┘ +*/ + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ + L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \ + \ + E0L, E0R, E1L, E1R, E2L, E2R, E3L, E3R, E4L, E4R, E5L, E5R, \ + LT0, LT1, LT2, LSL, LSR, RT0, RT1, RT2, RSL, RSR \ +) \ +{ \ + /* Left Half */ \ + { L00, L01, L02, L03, L04, L05, L06, LT0 }, \ + { L10, L11, L12, L13, L14, L15, L16, LT1 }, \ + { L20, L21, L22, L23, L24, L25, L26, LT2 }, \ + { L30, L31, L32, L33, L34, L35, L36, KC_NO }, \ + { L40, L41, L42, L43, L44, L45, L46, L47 }, \ + { E0L, E0R, E1L, E1R, E2L, E2R, LSL, LSR }, \ + /* Right Half */ \ + { R06, R05, R04, R03, R02, R01, R00, RT0 }, \ + { R16, R15, R14, R13, R12, R11, R10, RT1 }, \ + { R26, R25, R24, R23, R22, R21, R20, RT2 }, \ + { R36, R35, R34, R33, R32, R31, R30, KC_NO }, \ + { R47, R46, R45, R44, R43, R42, R41, R40 }, \ + { E3L, E3R, E4L, E4R, E5L, E5R, RSL, RSR } \ +} +// clang-format on + +// weak functions overridable by the user +void render_layer_status(void); +void render_leds_status(void); +void render_touch_status(void); +void render_audio_status(void); + +#ifdef RGB_MATRIX_ENABLE +// utility function to cycle active led zones +void rgb_matrix_increase_flags(void); +#endif \ No newline at end of file diff --git a/keyboards/runner3680/3x8/rules.mk b/keyboards/rgbkb/sol3/rev1/rules.mk similarity index 100% rename from keyboards/runner3680/3x8/rules.mk rename to keyboards/rgbkb/sol3/rev1/rules.mk diff --git a/keyboards/rgbkb/sol3/rules.mk b/keyboards/rgbkb/sol3/rules.mk new file mode 100644 index 000000000000..e30330d3330c --- /dev/null +++ b/keyboards/rgbkb/sol3/rules.mk @@ -0,0 +1,49 @@ +# MCU name +MCU = STM32F303 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Touch encoder needs +VPATH += keyboards/rgbkb/common +SRC += touch_encoder.c +SRC += common_oled.c +QUANTUM_LIB_SRC += i2c_master.c + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +AUDIO_ENABLE = yes # Audio output +AUDIO_DRIVER = dac_additive + +DYNAMIC_MACRO_ENABLE = yes +DIP_SWITCH_ENABLE = yes + +WS2812_DRIVER = pwm +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 + +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Enable the OLED Driver + +ENCODER_ENABLE = yes + +SPLIT_KEYBOARD = yes +SERIAL_DRIVER = usart +LTO_ENABLE = yes +OPT = 3 + +OPT_DEFS += -DOLED_FONT_H=\"keyboards/rgbkb/common/glcdfont.c\" + +# TODO: Implement fast matrix scanning +# matrix optimisations +# SRC += matrix.c + +DEFAULT_FOLDER = rgbkb/sol3/rev1 diff --git a/keyboards/rgbkb/sol3/sol3.c b/keyboards/rgbkb/sol3/sol3.c new file mode 100644 index 000000000000..97ae5bc5de32 --- /dev/null +++ b/keyboards/rgbkb/sol3/sol3.c @@ -0,0 +1,38 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#include "sol3.h" +#include "eeconfig.h" +#include "audio.h" +#include + +extern audio_config_t audio_config; + +void keyboard_post_init_kb(void) { + touch_encoder_init(); + transaction_register_rpc(TOUCH_ENCODER_SYNC, touch_encoder_slave_sync); + transaction_register_rpc(RGB_MENU_SYNC, rgb_menu_slave_sync); + keyboard_post_init_user(); +} + +void eeconfig_init_kb(void) { + // Reset Keyboard EEPROM value to blank, rather than to a set value + eeconfig_update_kb(0); + + audio_config.raw = eeconfig_read_audio(); + audio_config.clicky_enable = false; + eeconfig_update_audio(audio_config.raw); + + eeconfig_init_user(); +} + +void housekeeping_task_kb(void) { + touch_encoder_update(TOUCH_ENCODER_SYNC); + rgb_menu_update(RGB_MENU_SYNC); +} diff --git a/keyboards/rgbkb/sol3/sol3.h b/keyboards/rgbkb/sol3/sol3.h new file mode 100644 index 000000000000..06d5dcdea0c7 --- /dev/null +++ b/keyboards/rgbkb/sol3/sol3.h @@ -0,0 +1,18 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this + * notice you can do whatever you want with this stuff. If we meet some day, and + * you think this stuff is worth it, you can buy me a beer in return. David Rauseo + * ---------------------------------------------------------------------------- + */ + +#pragma once + +#if defined(KEYBOARD_rgbkb_sol3_rev1) +# include "rev1.h" +#endif + +#include "quantum.h" +#include "touch_encoder.h" +#include "common_oled.h" diff --git a/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk index f858bbe3daa1..a5b445407367 100644 --- a/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk +++ b/keyboards/rgbkb/zen/rev1/keymaps/333fred/rules.mk @@ -1,4 +1,4 @@ RGBLIGHT_ENABLE = yes KEY_LOCK_ENABLE = yes CONSOLE_ENABLE = no -EXTRAFLAGS += -flto +LTO_ENABLE = yes diff --git a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk index d484c4736694..c5cc34d89893 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk +++ b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk @@ -41,4 +41,4 @@ ifeq ($(strip $(RGBLIGHT_SPLIT_ENABLE)), yes) endif # Link time optimization, should save on firmware size -EXTRAFLAGS += -flto +LTO_ENABLE = yes diff --git a/keyboards/rocketboard_16/keycode_lookup.c b/keyboards/rocketboard_16/keycode_lookup.c index 9e1c5f92afea..d967a03c316d 100644 --- a/keyboards/rocketboard_16/keycode_lookup.c +++ b/keyboards/rocketboard_16/keycode_lookup.c @@ -55,7 +55,7 @@ char* translate_keycode_to_string(uint16_t code) return (return_p); } -lookup_table_t lookup_table[366] = +lookup_table_t lookup_table[334] = { {"KC_NO", KC_NO}, {"KC_TRNS", KC_TRNS}, @@ -243,38 +243,6 @@ lookup_table_t lookup_table[366] = {"KC_MRWD", KC_MRWD}, {"KC_BRIU", KC_BRIU}, {"KC_BRID", KC_BRID}, - {"KC_FN0", KC_FN0}, - {"KC_FN1", KC_FN1}, - {"KC_FN2", KC_FN2}, - {"KC_FN3", KC_FN3}, - {"KC_FN4", KC_FN4}, - {"KC_FN5", KC_FN5}, - {"KC_FN6", KC_FN6}, - {"KC_FN7", KC_FN7}, - {"KC_FN8", KC_FN8}, - {"KC_FN9", KC_FN9}, - {"KC_FN10", KC_FN10}, - {"KC_FN11", KC_FN11}, - {"KC_FN12", KC_FN12}, - {"KC_FN13", KC_FN13}, - {"KC_FN14", KC_FN14}, - {"KC_FN15", KC_FN15}, - {"KC_FN16", KC_FN16}, - {"KC_FN17", KC_FN17}, - {"KC_FN18", KC_FN18}, - {"KC_FN19", KC_FN19}, - {"KC_FN20", KC_FN20}, - {"KC_FN21", KC_FN21}, - {"KC_FN22", KC_FN22}, - {"KC_FN23", KC_FN23}, - {"KC_FN24", KC_FN24}, - {"KC_FN25", KC_FN25}, - {"KC_FN26", KC_FN26}, - {"KC_FN27", KC_FN27}, - {"KC_FN28", KC_FN28}, - {"KC_FN29", KC_FN29}, - {"KC_FN30", KC_FN30}, - {"KC_FN31", KC_FN31}, {"KC_LCTL", KC_LCTL}, {"KC_LSFT", KC_LSFT}, {"KC_LALT", KC_LALT}, diff --git a/keyboards/rocketboard_16/keycode_lookup.h b/keyboards/rocketboard_16/keycode_lookup.h index f51dcfd52a13..218b709b47d5 100644 --- a/keyboards/rocketboard_16/keycode_lookup.h +++ b/keyboards/rocketboard_16/keycode_lookup.h @@ -26,4 +26,4 @@ typedef struct char* translate_keycode_to_string(uint16_t code); -extern lookup_table_t lookup_table[366]; +extern lookup_table_t lookup_table[334]; diff --git a/keyboards/rocketboard_16/rules.mk b/keyboards/rocketboard_16/rules.mk index d27da2c22615..c07ebff42720 100644 --- a/keyboards/rocketboard_16/rules.mk +++ b/keyboards/rocketboard_16/rules.mk @@ -8,7 +8,7 @@ MCU = STM32F103 MCU_LDSCRIPT = STM32F103xB_stm32duino_bootloader OPT_DEFS += -DBOOTLOADER_STM32DUINO BOARD = STM32_F103_STM32DUINO -STM32_BOOTLOADER_ADDRESS = 0x80000000 +BOOTLOADER_TYPE = stm32duino DFU_ARGS = -d 1EAF:0003 -a 2 -R DFU_SUFFIX_ARGS = -v 1EAF -p 0003 diff --git a/keyboards/runner3680/runner3680.h b/keyboards/runner3680/runner3680.h deleted file mode 100644 index 39a498e90a04..000000000000 --- a/keyboards/runner3680/runner3680.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include "quantum.h" - -#ifdef KEYBOARD_runner3680_5x8 - #include "5x8.h" -#endif - -#ifdef KEYBOARD_runner3680_5x7 - #include "5x7.h" -#endif - -#ifdef KEYBOARD_runner3680_5x6 - #include "5x6.h" -#endif - -#ifdef KEYBOARD_runner3680_5x6_5x8 - #include "5x6_5x8.h" -#endif - -#ifdef KEYBOARD_runner3680_4x8 - #include "4x8.h" -#endif - -#ifdef KEYBOARD_runner3680_4x7 - #include "4x7.h" -#endif - -#ifdef KEYBOARD_runner3680_4x6 - #include "4x6.h" -#endif - -#ifdef KEYBOARD_runner3680_3x8 - #include "3x8.h" -#endif - -#ifdef KEYBOARD_runner3680_3x7 - #include "3x7.h" -#endif - -#ifdef KEYBOARD_runner3680_3x6 - #include "3x6.h" -#endif diff --git a/keyboards/runner3680/5x8/.noci b/keyboards/salicylic_acid3/7skb/.noci similarity index 100% rename from keyboards/runner3680/5x8/.noci rename to keyboards/salicylic_acid3/7skb/.noci diff --git a/keyboards/7skb/7skb.c b/keyboards/salicylic_acid3/7skb/7skb.c similarity index 100% rename from keyboards/7skb/7skb.c rename to keyboards/salicylic_acid3/7skb/7skb.c diff --git a/keyboards/7skb/7skb.h b/keyboards/salicylic_acid3/7skb/7skb.h similarity index 60% rename from keyboards/7skb/7skb.h rename to keyboards/salicylic_acid3/7skb/7skb.h index 9e23d0ad3c5e..5043a467478b 100644 --- a/keyboards/7skb/7skb.h +++ b/keyboards/salicylic_acid3/7skb/7skb.h @@ -2,6 +2,6 @@ #include "quantum.h" -#ifdef KEYBOARD_7skb_rev1 +#ifdef KEYBOARD_salicylic_acid3_7skb_rev1 #include "rev1.h" #endif diff --git a/keyboards/naked64/config.h b/keyboards/salicylic_acid3/7skb/config.h similarity index 100% rename from keyboards/naked64/config.h rename to keyboards/salicylic_acid3/7skb/config.h diff --git a/keyboards/7skb/info.json b/keyboards/salicylic_acid3/7skb/info.json similarity index 100% rename from keyboards/7skb/info.json rename to keyboards/salicylic_acid3/7skb/info.json diff --git a/keyboards/7skb/keymaps/default/config.h b/keyboards/salicylic_acid3/7skb/keymaps/default/config.h similarity index 100% rename from keyboards/7skb/keymaps/default/config.h rename to keyboards/salicylic_acid3/7skb/keymaps/default/config.h diff --git a/keyboards/7skb/keymaps/default/keymap.c b/keyboards/salicylic_acid3/7skb/keymaps/default/keymap.c similarity index 100% rename from keyboards/7skb/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/7skb/keymaps/default/keymap.c diff --git a/keyboards/7skb/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/7skb/keymaps/salicylic/config.h similarity index 100% rename from keyboards/7skb/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/7skb/keymaps/salicylic/config.h diff --git a/keyboards/7skb/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/7skb/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/7skb/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/7skb/keymaps/salicylic/keymap.c diff --git a/keyboards/7skb/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/7skb/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/7skb/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/7skb/keymaps/salicylic/rules.mk diff --git a/keyboards/7skb/keymaps/via/keymap.c b/keyboards/salicylic_acid3/7skb/keymaps/via/keymap.c similarity index 100% rename from keyboards/7skb/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/7skb/keymaps/via/keymap.c diff --git a/keyboards/7skb/keymaps/via/readme.md b/keyboards/salicylic_acid3/7skb/keymaps/via/readme.md similarity index 100% rename from keyboards/7skb/keymaps/via/readme.md rename to keyboards/salicylic_acid3/7skb/keymaps/via/readme.md diff --git a/keyboards/nk1/keymaps/via/rules.mk b/keyboards/salicylic_acid3/7skb/keymaps/via/rules.mk similarity index 100% rename from keyboards/nk1/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/7skb/keymaps/via/rules.mk diff --git a/keyboards/7skb/readme.md b/keyboards/salicylic_acid3/7skb/readme.md similarity index 95% rename from keyboards/7skb/readme.md rename to keyboards/salicylic_acid3/7skb/readme.md index 18e4eef3ea80..a3077f068a6f 100644 --- a/keyboards/7skb/readme.md +++ b/keyboards/salicylic_acid3/7skb/readme.md @@ -10,7 +10,7 @@ This is 63 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make 7skb:default + make salicylic_acid3/7skb/rev1: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/7skb/rev1/config.h b/keyboards/salicylic_acid3/7skb/rev1/config.h similarity index 100% rename from keyboards/7skb/rev1/config.h rename to keyboards/salicylic_acid3/7skb/rev1/config.h diff --git a/keyboards/getta25/rev1/rev1.c b/keyboards/salicylic_acid3/7skb/rev1/rev1.c similarity index 100% rename from keyboards/getta25/rev1/rev1.c rename to keyboards/salicylic_acid3/7skb/rev1/rev1.c diff --git a/keyboards/7skb/rev1/rev1.h b/keyboards/salicylic_acid3/7skb/rev1/rev1.h similarity index 100% rename from keyboards/7skb/rev1/rev1.h rename to keyboards/salicylic_acid3/7skb/rev1/rev1.h diff --git a/keyboards/runner3680/4x6/rules.mk b/keyboards/salicylic_acid3/7skb/rev1/rules.mk similarity index 100% rename from keyboards/runner3680/4x6/rules.mk rename to keyboards/salicylic_acid3/7skb/rev1/rules.mk diff --git a/keyboards/7skb/rules.mk b/keyboards/salicylic_acid3/7skb/rules.mk similarity index 85% rename from keyboards/7skb/rules.mk rename to keyboards/salicylic_acid3/7skb/rules.mk index ea7399dc7560..3ae2e899ca29 100644 --- a/keyboards/7skb/rules.mk +++ b/keyboards/salicylic_acid3/7skb/rules.mk @@ -15,8 +15,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = 7skb/rev1 +DEFAULT_FOLDER = salicylic_acid3/7skb/rev1 diff --git a/keyboards/7splus/7splus.c b/keyboards/salicylic_acid3/7splus/7splus.c similarity index 100% rename from keyboards/7splus/7splus.c rename to keyboards/salicylic_acid3/7splus/7splus.c diff --git a/keyboards/7splus/7splus.h b/keyboards/salicylic_acid3/7splus/7splus.h similarity index 100% rename from keyboards/7splus/7splus.h rename to keyboards/salicylic_acid3/7splus/7splus.h diff --git a/keyboards/7splus/config.h b/keyboards/salicylic_acid3/7splus/config.h similarity index 100% rename from keyboards/7splus/config.h rename to keyboards/salicylic_acid3/7splus/config.h diff --git a/keyboards/7splus/info.json b/keyboards/salicylic_acid3/7splus/info.json similarity index 100% rename from keyboards/7splus/info.json rename to keyboards/salicylic_acid3/7splus/info.json diff --git a/keyboards/7splus/keymaps/default/keymap.c b/keyboards/salicylic_acid3/7splus/keymaps/default/keymap.c similarity index 100% rename from keyboards/7splus/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/7splus/keymaps/default/keymap.c diff --git a/keyboards/7splus/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/7splus/keymaps/salicylic/config.h similarity index 100% rename from keyboards/7splus/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/7splus/keymaps/salicylic/config.h diff --git a/keyboards/7splus/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/7splus/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/7splus/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/7splus/keymaps/salicylic/keymap.c diff --git a/keyboards/7splus/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/7splus/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/7splus/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/7splus/keymaps/salicylic/rules.mk diff --git a/keyboards/7splus/keymaps/via/config.h b/keyboards/salicylic_acid3/7splus/keymaps/via/config.h similarity index 100% rename from keyboards/7splus/keymaps/via/config.h rename to keyboards/salicylic_acid3/7splus/keymaps/via/config.h diff --git a/keyboards/7splus/keymaps/via/keymap.c b/keyboards/salicylic_acid3/7splus/keymaps/via/keymap.c similarity index 100% rename from keyboards/7splus/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/7splus/keymaps/via/keymap.c diff --git a/keyboards/nknl7en/keymaps/via/rules.mk b/keyboards/salicylic_acid3/7splus/keymaps/via/rules.mk similarity index 100% rename from keyboards/nknl7en/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/7splus/keymaps/via/rules.mk diff --git a/keyboards/7splus/readme.md b/keyboards/salicylic_acid3/7splus/readme.md similarity index 95% rename from keyboards/7splus/readme.md rename to keyboards/salicylic_acid3/7splus/readme.md index a73359524969..ef6820a18835 100644 --- a/keyboards/7splus/readme.md +++ b/keyboards/salicylic_acid3/7splus/readme.md @@ -10,7 +10,7 @@ This is 85 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make 7splus:default + make salicylic_acid3/7splus: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/7splus/rules.mk b/keyboards/salicylic_acid3/7splus/rules.mk similarity index 100% rename from keyboards/7splus/rules.mk rename to keyboards/salicylic_acid3/7splus/rules.mk diff --git a/keyboards/ajisai74/ajisai74.c b/keyboards/salicylic_acid3/ajisai74/ajisai74.c similarity index 100% rename from keyboards/ajisai74/ajisai74.c rename to keyboards/salicylic_acid3/ajisai74/ajisai74.c diff --git a/keyboards/ajisai74/ajisai74.h b/keyboards/salicylic_acid3/ajisai74/ajisai74.h similarity index 100% rename from keyboards/ajisai74/ajisai74.h rename to keyboards/salicylic_acid3/ajisai74/ajisai74.h diff --git a/keyboards/ajisai74/config.h b/keyboards/salicylic_acid3/ajisai74/config.h similarity index 100% rename from keyboards/ajisai74/config.h rename to keyboards/salicylic_acid3/ajisai74/config.h diff --git a/keyboards/ajisai74/info.json b/keyboards/salicylic_acid3/ajisai74/info.json similarity index 100% rename from keyboards/ajisai74/info.json rename to keyboards/salicylic_acid3/ajisai74/info.json diff --git a/keyboards/ajisai74/keymaps/default/config.h b/keyboards/salicylic_acid3/ajisai74/keymaps/default/config.h similarity index 100% rename from keyboards/ajisai74/keymaps/default/config.h rename to keyboards/salicylic_acid3/ajisai74/keymaps/default/config.h diff --git a/keyboards/ajisai74/keymaps/default/keymap.c b/keyboards/salicylic_acid3/ajisai74/keymaps/default/keymap.c similarity index 100% rename from keyboards/ajisai74/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/ajisai74/keymaps/default/keymap.c diff --git a/keyboards/ajisai74/keymaps/jis/config.h b/keyboards/salicylic_acid3/ajisai74/keymaps/jis/config.h similarity index 100% rename from keyboards/ajisai74/keymaps/jis/config.h rename to keyboards/salicylic_acid3/ajisai74/keymaps/jis/config.h diff --git a/keyboards/ajisai74/keymaps/jis/keymap.c b/keyboards/salicylic_acid3/ajisai74/keymaps/jis/keymap.c similarity index 100% rename from keyboards/ajisai74/keymaps/jis/keymap.c rename to keyboards/salicylic_acid3/ajisai74/keymaps/jis/keymap.c diff --git a/keyboards/ajisai74/keymaps/jis/rules.mk b/keyboards/salicylic_acid3/ajisai74/keymaps/jis/rules.mk similarity index 100% rename from keyboards/ajisai74/keymaps/jis/rules.mk rename to keyboards/salicylic_acid3/ajisai74/keymaps/jis/rules.mk diff --git a/keyboards/ajisai74/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/ajisai74/keymaps/salicylic/config.h similarity index 100% rename from keyboards/ajisai74/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/ajisai74/keymaps/salicylic/config.h diff --git a/keyboards/ajisai74/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/ajisai74/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/ajisai74/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/ajisai74/keymaps/salicylic/keymap.c diff --git a/keyboards/ajisai74/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/ajisai74/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/ajisai74/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/ajisai74/keymaps/salicylic/rules.mk diff --git a/keyboards/ajisai74/keymaps/via/config.h b/keyboards/salicylic_acid3/ajisai74/keymaps/via/config.h similarity index 100% rename from keyboards/ajisai74/keymaps/via/config.h rename to keyboards/salicylic_acid3/ajisai74/keymaps/via/config.h diff --git a/keyboards/ajisai74/keymaps/via/keymap.c b/keyboards/salicylic_acid3/ajisai74/keymaps/via/keymap.c similarity index 100% rename from keyboards/ajisai74/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/ajisai74/keymaps/via/keymap.c diff --git a/keyboards/nknl7jp/keymaps/via/rules.mk b/keyboards/salicylic_acid3/ajisai74/keymaps/via/rules.mk similarity index 100% rename from keyboards/nknl7jp/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/ajisai74/keymaps/via/rules.mk diff --git a/keyboards/ajisai74/readme.md b/keyboards/salicylic_acid3/ajisai74/readme.md similarity index 95% rename from keyboards/ajisai74/readme.md rename to keyboards/salicylic_acid3/ajisai74/readme.md index af66ce0fc5b4..e274eb0ac4d7 100644 --- a/keyboards/ajisai74/readme.md +++ b/keyboards/salicylic_acid3/ajisai74/readme.md @@ -10,7 +10,7 @@ This is 74 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make ajisai74:default + make salicylic_acid3/ajisai74: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/ajisai74/rules.mk b/keyboards/salicylic_acid3/ajisai74/rules.mk similarity index 100% rename from keyboards/ajisai74/rules.mk rename to keyboards/salicylic_acid3/ajisai74/rules.mk diff --git a/keyboards/ergoarrows/config.h b/keyboards/salicylic_acid3/ergoarrows/config.h similarity index 100% rename from keyboards/ergoarrows/config.h rename to keyboards/salicylic_acid3/ergoarrows/config.h diff --git a/keyboards/ergoarrows/ergoarrows.c b/keyboards/salicylic_acid3/ergoarrows/ergoarrows.c similarity index 100% rename from keyboards/ergoarrows/ergoarrows.c rename to keyboards/salicylic_acid3/ergoarrows/ergoarrows.c diff --git a/keyboards/ergoarrows/ergoarrows.h b/keyboards/salicylic_acid3/ergoarrows/ergoarrows.h similarity index 100% rename from keyboards/ergoarrows/ergoarrows.h rename to keyboards/salicylic_acid3/ergoarrows/ergoarrows.h diff --git a/keyboards/ergoarrows/info.json b/keyboards/salicylic_acid3/ergoarrows/info.json similarity index 100% rename from keyboards/ergoarrows/info.json rename to keyboards/salicylic_acid3/ergoarrows/info.json diff --git a/keyboards/ergoarrows/keymaps/default/config.h b/keyboards/salicylic_acid3/ergoarrows/keymaps/default/config.h similarity index 100% rename from keyboards/ergoarrows/keymaps/default/config.h rename to keyboards/salicylic_acid3/ergoarrows/keymaps/default/config.h diff --git a/keyboards/ergoarrows/keymaps/default/keymap.c b/keyboards/salicylic_acid3/ergoarrows/keymaps/default/keymap.c similarity index 100% rename from keyboards/ergoarrows/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/ergoarrows/keymaps/default/keymap.c diff --git a/keyboards/ergoarrows/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/ergoarrows/keymaps/salicylic/config.h similarity index 100% rename from keyboards/ergoarrows/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/ergoarrows/keymaps/salicylic/config.h diff --git a/keyboards/ergoarrows/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/ergoarrows/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/ergoarrows/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/ergoarrows/keymaps/salicylic/keymap.c diff --git a/keyboards/ergoarrows/keymaps/via/config.h b/keyboards/salicylic_acid3/ergoarrows/keymaps/via/config.h similarity index 100% rename from keyboards/ergoarrows/keymaps/via/config.h rename to keyboards/salicylic_acid3/ergoarrows/keymaps/via/config.h diff --git a/keyboards/ergoarrows/keymaps/via/keymap.c b/keyboards/salicylic_acid3/ergoarrows/keymaps/via/keymap.c similarity index 100% rename from keyboards/ergoarrows/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/ergoarrows/keymaps/via/keymap.c diff --git a/keyboards/pistachio/keymaps/via/rules.mk b/keyboards/salicylic_acid3/ergoarrows/keymaps/via/rules.mk similarity index 100% rename from keyboards/pistachio/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/ergoarrows/keymaps/via/rules.mk diff --git a/keyboards/ergoarrows/readme.md b/keyboards/salicylic_acid3/ergoarrows/readme.md similarity index 95% rename from keyboards/ergoarrows/readme.md rename to keyboards/salicylic_acid3/ergoarrows/readme.md index 00932548d17f..93ad98941535 100644 --- a/keyboards/ergoarrows/readme.md +++ b/keyboards/salicylic_acid3/ergoarrows/readme.md @@ -10,7 +10,7 @@ This is 76 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make ergoarrows:default + make salicylic_acid3/ergoarrows: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/ergoarrows/rules.mk b/keyboards/salicylic_acid3/ergoarrows/rules.mk similarity index 100% rename from keyboards/ergoarrows/rules.mk rename to keyboards/salicylic_acid3/ergoarrows/rules.mk diff --git a/keyboards/setta21/rev1/.noci b/keyboards/salicylic_acid3/getta25/.noci similarity index 100% rename from keyboards/setta21/rev1/.noci rename to keyboards/salicylic_acid3/getta25/.noci diff --git a/keyboards/setta21/config.h b/keyboards/salicylic_acid3/getta25/config.h similarity index 100% rename from keyboards/setta21/config.h rename to keyboards/salicylic_acid3/getta25/config.h diff --git a/keyboards/getta25/getta25.c b/keyboards/salicylic_acid3/getta25/getta25.c similarity index 100% rename from keyboards/getta25/getta25.c rename to keyboards/salicylic_acid3/getta25/getta25.c diff --git a/keyboards/getta25/getta25.h b/keyboards/salicylic_acid3/getta25/getta25.h similarity index 58% rename from keyboards/getta25/getta25.h rename to keyboards/salicylic_acid3/getta25/getta25.h index ff448201738b..67632bba4d98 100644 --- a/keyboards/getta25/getta25.h +++ b/keyboards/salicylic_acid3/getta25/getta25.h @@ -2,6 +2,6 @@ #include "quantum.h" -#ifdef KEYBOARD_getta25_rev1 +#ifdef KEYBOARD_salicylic_acid3_getta25_rev1 #include "rev1.h" #endif diff --git a/keyboards/getta25/info.json b/keyboards/salicylic_acid3/getta25/info.json similarity index 100% rename from keyboards/getta25/info.json rename to keyboards/salicylic_acid3/getta25/info.json diff --git a/keyboards/getta25/keymaps/default/config.h b/keyboards/salicylic_acid3/getta25/keymaps/default/config.h similarity index 100% rename from keyboards/getta25/keymaps/default/config.h rename to keyboards/salicylic_acid3/getta25/keymaps/default/config.h diff --git a/keyboards/getta25/keymaps/default/keymap.c b/keyboards/salicylic_acid3/getta25/keymaps/default/keymap.c similarity index 100% rename from keyboards/getta25/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/getta25/keymaps/default/keymap.c diff --git a/keyboards/getta25/keymaps/oled/config.h b/keyboards/salicylic_acid3/getta25/keymaps/oled/config.h similarity index 100% rename from keyboards/getta25/keymaps/oled/config.h rename to keyboards/salicylic_acid3/getta25/keymaps/oled/config.h diff --git a/keyboards/getta25/keymaps/oled/glcdfont.c b/keyboards/salicylic_acid3/getta25/keymaps/oled/glcdfont.c similarity index 100% rename from keyboards/getta25/keymaps/oled/glcdfont.c rename to keyboards/salicylic_acid3/getta25/keymaps/oled/glcdfont.c diff --git a/keyboards/getta25/keymaps/oled/keymap.c b/keyboards/salicylic_acid3/getta25/keymaps/oled/keymap.c similarity index 100% rename from keyboards/getta25/keymaps/oled/keymap.c rename to keyboards/salicylic_acid3/getta25/keymaps/oled/keymap.c diff --git a/keyboards/getta25/keymaps/oled/rules.mk b/keyboards/salicylic_acid3/getta25/keymaps/oled/rules.mk similarity index 100% rename from keyboards/getta25/keymaps/oled/rules.mk rename to keyboards/salicylic_acid3/getta25/keymaps/oled/rules.mk diff --git a/keyboards/getta25/readme.md b/keyboards/salicylic_acid3/getta25/readme.md similarity index 94% rename from keyboards/getta25/readme.md rename to keyboards/salicylic_acid3/getta25/readme.md index 886e52a2ea11..2f3e9d1f1b3d 100644 --- a/keyboards/getta25/readme.md +++ b/keyboards/salicylic_acid3/getta25/readme.md @@ -10,7 +10,7 @@ This is 25 keys tenkeypad. Make example for this keyboard (after setting up your build environment): - make getta25:default + make salicylic_acid3/getta25/rev1: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/getta25/rev1/config.h b/keyboards/salicylic_acid3/getta25/rev1/config.h similarity index 100% rename from keyboards/getta25/rev1/config.h rename to keyboards/salicylic_acid3/getta25/rev1/config.h diff --git a/keyboards/naked64/rev1/rev1.c b/keyboards/salicylic_acid3/getta25/rev1/rev1.c similarity index 100% rename from keyboards/naked64/rev1/rev1.c rename to keyboards/salicylic_acid3/getta25/rev1/rev1.c diff --git a/keyboards/getta25/rev1/rev1.h b/keyboards/salicylic_acid3/getta25/rev1/rev1.h similarity index 100% rename from keyboards/getta25/rev1/rev1.h rename to keyboards/salicylic_acid3/getta25/rev1/rev1.h diff --git a/keyboards/treadstone48/rev1/rules.mk b/keyboards/salicylic_acid3/getta25/rev1/rules.mk similarity index 100% rename from keyboards/treadstone48/rev1/rules.mk rename to keyboards/salicylic_acid3/getta25/rev1/rules.mk diff --git a/keyboards/getta25/rules.mk b/keyboards/salicylic_acid3/getta25/rules.mk similarity index 93% rename from keyboards/getta25/rules.mk rename to keyboards/salicylic_acid3/getta25/rules.mk index 54265d228528..977ef5bb1d3c 100644 --- a/keyboards/getta25/rules.mk +++ b/keyboards/salicylic_acid3/getta25/rules.mk @@ -18,4 +18,4 @@ AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. OLED_ENABLE = no -DEFAULT_FOLDER = getta25/rev1 +DEFAULT_FOLDER = salicylic_acid3/getta25/rev1 diff --git a/keyboards/squiggle/rev1/.noci b/keyboards/salicylic_acid3/jisplit89/.noci similarity index 100% rename from keyboards/squiggle/rev1/.noci rename to keyboards/salicylic_acid3/jisplit89/.noci diff --git a/keyboards/jisplit89/config.h b/keyboards/salicylic_acid3/jisplit89/config.h similarity index 100% rename from keyboards/jisplit89/config.h rename to keyboards/salicylic_acid3/jisplit89/config.h diff --git a/keyboards/jisplit89/info.json b/keyboards/salicylic_acid3/jisplit89/info.json similarity index 100% rename from keyboards/jisplit89/info.json rename to keyboards/salicylic_acid3/jisplit89/info.json diff --git a/keyboards/jisplit89/jisplit89.c b/keyboards/salicylic_acid3/jisplit89/jisplit89.c similarity index 100% rename from keyboards/jisplit89/jisplit89.c rename to keyboards/salicylic_acid3/jisplit89/jisplit89.c diff --git a/keyboards/jisplit89/jisplit89.h b/keyboards/salicylic_acid3/jisplit89/jisplit89.h similarity index 93% rename from keyboards/jisplit89/jisplit89.h rename to keyboards/salicylic_acid3/jisplit89/jisplit89.h index b59b5a66a2bf..8de2326de658 100644 --- a/keyboards/jisplit89/jisplit89.h +++ b/keyboards/salicylic_acid3/jisplit89/jisplit89.h @@ -17,6 +17,6 @@ along with this program. If not, see . #pragma once -#ifdef KEYBOARD_jisplit89_rev1 +#ifdef KEYBOARD_salicylic_acid3_jisplit89_rev1 #include "rev1.h" #endif diff --git a/keyboards/jisplit89/keymaps/default/keymap.c b/keyboards/salicylic_acid3/jisplit89/keymaps/default/keymap.c similarity index 100% rename from keyboards/jisplit89/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/jisplit89/keymaps/default/keymap.c diff --git a/keyboards/jisplit89/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/jisplit89/keymaps/salicylic/config.h similarity index 100% rename from keyboards/jisplit89/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/jisplit89/keymaps/salicylic/config.h diff --git a/keyboards/jisplit89/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/jisplit89/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/jisplit89/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/jisplit89/keymaps/salicylic/keymap.c diff --git a/keyboards/jisplit89/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/jisplit89/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/jisplit89/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/jisplit89/keymaps/salicylic/rules.mk diff --git a/keyboards/jisplit89/keymaps/via/config.h b/keyboards/salicylic_acid3/jisplit89/keymaps/via/config.h similarity index 100% rename from keyboards/jisplit89/keymaps/via/config.h rename to keyboards/salicylic_acid3/jisplit89/keymaps/via/config.h diff --git a/keyboards/jisplit89/keymaps/via/keymap.c b/keyboards/salicylic_acid3/jisplit89/keymaps/via/keymap.c similarity index 100% rename from keyboards/jisplit89/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/jisplit89/keymaps/via/keymap.c diff --git a/keyboards/nebula68b/keymaps/via/rules.mk b/keyboards/salicylic_acid3/jisplit89/keymaps/via/rules.mk old mode 100755 new mode 100644 similarity index 100% rename from keyboards/nebula68b/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/jisplit89/keymaps/via/rules.mk diff --git a/keyboards/jisplit89/readme.md b/keyboards/salicylic_acid3/jisplit89/readme.md similarity index 94% rename from keyboards/jisplit89/readme.md rename to keyboards/salicylic_acid3/jisplit89/readme.md index d2228745774d..df0994e1091e 100644 --- a/keyboards/jisplit89/readme.md +++ b/keyboards/salicylic_acid3/jisplit89/readme.md @@ -10,7 +10,7 @@ This is 89 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make jisplit89:default + make salicylic_acid3/jisplit89/rev1: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/jisplit89/rev1/config.h b/keyboards/salicylic_acid3/jisplit89/rev1/config.h similarity index 100% rename from keyboards/jisplit89/rev1/config.h rename to keyboards/salicylic_acid3/jisplit89/rev1/config.h diff --git a/keyboards/jisplit89/rev1/rev1.c b/keyboards/salicylic_acid3/jisplit89/rev1/rev1.c similarity index 100% rename from keyboards/jisplit89/rev1/rev1.c rename to keyboards/salicylic_acid3/jisplit89/rev1/rev1.c diff --git a/keyboards/jisplit89/rev1/rev1.h b/keyboards/salicylic_acid3/jisplit89/rev1/rev1.h similarity index 100% rename from keyboards/jisplit89/rev1/rev1.h rename to keyboards/salicylic_acid3/jisplit89/rev1/rev1.h diff --git a/keyboards/runner3680/4x7/rules.mk b/keyboards/salicylic_acid3/jisplit89/rev1/rules.mk similarity index 100% rename from keyboards/runner3680/4x7/rules.mk rename to keyboards/salicylic_acid3/jisplit89/rev1/rules.mk diff --git a/keyboards/jisplit89/rules.mk b/keyboards/salicylic_acid3/jisplit89/rules.mk similarity index 93% rename from keyboards/jisplit89/rules.mk rename to keyboards/salicylic_acid3/jisplit89/rules.mk index 5427cabfa212..a6a85106751b 100644 --- a/keyboards/jisplit89/rules.mk +++ b/keyboards/salicylic_acid3/jisplit89/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = jisplit89/rev1 +DEFAULT_FOLDER = salicylic_acid3/jisplit89/rev1 diff --git a/keyboards/nafuda/config.h b/keyboards/salicylic_acid3/nafuda/config.h similarity index 100% rename from keyboards/nafuda/config.h rename to keyboards/salicylic_acid3/nafuda/config.h diff --git a/keyboards/nafuda/info.json b/keyboards/salicylic_acid3/nafuda/info.json similarity index 100% rename from keyboards/nafuda/info.json rename to keyboards/salicylic_acid3/nafuda/info.json diff --git a/keyboards/nafuda/keymaps/default/config.h b/keyboards/salicylic_acid3/nafuda/keymaps/default/config.h similarity index 100% rename from keyboards/nafuda/keymaps/default/config.h rename to keyboards/salicylic_acid3/nafuda/keymaps/default/config.h diff --git a/keyboards/nafuda/keymaps/default/keymap.c b/keyboards/salicylic_acid3/nafuda/keymaps/default/keymap.c similarity index 100% rename from keyboards/nafuda/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/nafuda/keymaps/default/keymap.c diff --git a/keyboards/nafuda/keymaps/default/readme.md b/keyboards/salicylic_acid3/nafuda/keymaps/default/readme.md similarity index 100% rename from keyboards/nafuda/keymaps/default/readme.md rename to keyboards/salicylic_acid3/nafuda/keymaps/default/readme.md diff --git a/keyboards/nafuda/nafuda.c b/keyboards/salicylic_acid3/nafuda/nafuda.c similarity index 100% rename from keyboards/nafuda/nafuda.c rename to keyboards/salicylic_acid3/nafuda/nafuda.c diff --git a/keyboards/nafuda/nafuda.h b/keyboards/salicylic_acid3/nafuda/nafuda.h similarity index 100% rename from keyboards/nafuda/nafuda.h rename to keyboards/salicylic_acid3/nafuda/nafuda.h diff --git a/keyboards/nafuda/readme.md b/keyboards/salicylic_acid3/nafuda/readme.md similarity index 95% rename from keyboards/nafuda/readme.md rename to keyboards/salicylic_acid3/nafuda/readme.md index 73007ed01e62..5df9b5df0f88 100644 --- a/keyboards/nafuda/readme.md +++ b/keyboards/salicylic_acid3/nafuda/readme.md @@ -10,7 +10,7 @@ This is 7 keys cursor macropad. Make example for this keyboard (after setting up your build environment): - make nafuda:default + make salicylic_acid3/nafuda: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/nafuda/rules.mk b/keyboards/salicylic_acid3/nafuda/rules.mk similarity index 100% rename from keyboards/nafuda/rules.mk rename to keyboards/salicylic_acid3/nafuda/rules.mk diff --git a/keyboards/suihankey/split/.noci b/keyboards/salicylic_acid3/naked48/.noci similarity index 100% rename from keyboards/suihankey/split/.noci rename to keyboards/salicylic_acid3/naked48/.noci diff --git a/keyboards/naked48/config.h b/keyboards/salicylic_acid3/naked48/config.h similarity index 100% rename from keyboards/naked48/config.h rename to keyboards/salicylic_acid3/naked48/config.h diff --git a/keyboards/naked48/info.json b/keyboards/salicylic_acid3/naked48/info.json similarity index 100% rename from keyboards/naked48/info.json rename to keyboards/salicylic_acid3/naked48/info.json diff --git a/keyboards/naked48/keymaps/default/config.h b/keyboards/salicylic_acid3/naked48/keymaps/default/config.h similarity index 100% rename from keyboards/naked48/keymaps/default/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/default/config.h diff --git a/keyboards/naked48/keymaps/default/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/default/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/default/keymap.c diff --git a/keyboards/naked48/keymaps/default/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/default/readme.md similarity index 100% rename from keyboards/naked48/keymaps/default/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/default/readme.md diff --git a/keyboards/treadstone48/rev2/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/default/rules.mk similarity index 100% rename from keyboards/treadstone48/rev2/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/default/rules.mk diff --git a/keyboards/naked48/keymaps/default_with_nafuda/config.h b/keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/config.h similarity index 100% rename from keyboards/naked48/keymaps/default_with_nafuda/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/config.h diff --git a/keyboards/naked48/keymaps/default_with_nafuda/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/default_with_nafuda/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/keymap.c diff --git a/keyboards/naked48/keymaps/default_with_nafuda/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/readme.md similarity index 100% rename from keyboards/naked48/keymaps/default_with_nafuda/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/readme.md diff --git a/keyboards/quark/keymaps/ajp10304/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/rules.mk similarity index 100% rename from keyboards/quark/keymaps/ajp10304/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_nafuda/rules.mk diff --git a/keyboards/naked48/keymaps/default_with_setta21/config.h b/keyboards/salicylic_acid3/naked48/keymaps/default_with_setta21/config.h similarity index 100% rename from keyboards/naked48/keymaps/default_with_setta21/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_setta21/config.h diff --git a/keyboards/naked48/keymaps/default_with_setta21/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/default_with_setta21/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/default_with_setta21/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_setta21/keymap.c diff --git a/keyboards/naked48/keymaps/default_with_setta21/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/default_with_setta21/readme.md similarity index 100% rename from keyboards/naked48/keymaps/default_with_setta21/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/default_with_setta21/readme.md diff --git a/keyboards/naked48/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/naked48/keymaps/salicylic/config.h similarity index 100% rename from keyboards/naked48/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic/config.h diff --git a/keyboards/naked48/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic/keymap.c diff --git a/keyboards/naked48/keymaps/salicylic/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/salicylic/readme.md similarity index 100% rename from keyboards/naked48/keymaps/salicylic/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic/readme.md diff --git a/keyboards/naked48/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic/rules.mk diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/config.h b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/config.h similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_nafuda/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/config.h diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_nafuda/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/keymap.c diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/readme.md similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_nafuda/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/readme.md diff --git a/keyboards/naked48/keymaps/salicylic_with_nafuda/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_nafuda/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_nafuda/rules.mk diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/config.h b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/config.h similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_setta21/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/config.h diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_setta21/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/keymap.c diff --git a/keyboards/naked48/keymaps/salicylic_with_setta21/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/readme.md similarity index 100% rename from keyboards/naked48/keymaps/salicylic_with_setta21/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/readme.md diff --git a/keyboards/runner3680/4x8/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/rules.mk similarity index 100% rename from keyboards/runner3680/4x8/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/salicylic_with_setta21/rules.mk diff --git a/keyboards/naked48/keymaps/scheiklp/config.h b/keyboards/salicylic_acid3/naked48/keymaps/scheiklp/config.h similarity index 100% rename from keyboards/naked48/keymaps/scheiklp/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/scheiklp/config.h diff --git a/keyboards/naked48/keymaps/scheiklp/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/scheiklp/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/scheiklp/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/scheiklp/keymap.c diff --git a/keyboards/naked48/keymaps/scheiklp/readme.md b/keyboards/salicylic_acid3/naked48/keymaps/scheiklp/readme.md similarity index 100% rename from keyboards/naked48/keymaps/scheiklp/readme.md rename to keyboards/salicylic_acid3/naked48/keymaps/scheiklp/readme.md diff --git a/keyboards/naked48/keymaps/scheiklp/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/scheiklp/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/scheiklp/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/scheiklp/rules.mk diff --git a/keyboards/naked48/keymaps/via/config.h b/keyboards/salicylic_acid3/naked48/keymaps/via/config.h similarity index 100% rename from keyboards/naked48/keymaps/via/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/via/config.h diff --git a/keyboards/naked48/keymaps/via/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/via/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/via/keymap.c diff --git a/keyboards/naked48/keymaps/via/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/via/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/via/rules.mk diff --git a/keyboards/naked48/keymaps/via_rgb_matrix/config.h b/keyboards/salicylic_acid3/naked48/keymaps/via_rgb_matrix/config.h similarity index 100% rename from keyboards/naked48/keymaps/via_rgb_matrix/config.h rename to keyboards/salicylic_acid3/naked48/keymaps/via_rgb_matrix/config.h diff --git a/keyboards/naked48/keymaps/via_rgb_matrix/keymap.c b/keyboards/salicylic_acid3/naked48/keymaps/via_rgb_matrix/keymap.c similarity index 100% rename from keyboards/naked48/keymaps/via_rgb_matrix/keymap.c rename to keyboards/salicylic_acid3/naked48/keymaps/via_rgb_matrix/keymap.c diff --git a/keyboards/naked48/keymaps/via_rgb_matrix/rules.mk b/keyboards/salicylic_acid3/naked48/keymaps/via_rgb_matrix/rules.mk similarity index 100% rename from keyboards/naked48/keymaps/via_rgb_matrix/rules.mk rename to keyboards/salicylic_acid3/naked48/keymaps/via_rgb_matrix/rules.mk diff --git a/keyboards/naked48/naked48.c b/keyboards/salicylic_acid3/naked48/naked48.c similarity index 100% rename from keyboards/naked48/naked48.c rename to keyboards/salicylic_acid3/naked48/naked48.c diff --git a/keyboards/naked48/naked48.h b/keyboards/salicylic_acid3/naked48/naked48.h similarity index 94% rename from keyboards/naked48/naked48.h rename to keyboards/salicylic_acid3/naked48/naked48.h index e210cf0f576b..bbfa6d2e84f4 100644 --- a/keyboards/naked48/naked48.h +++ b/keyboards/salicylic_acid3/naked48/naked48.h @@ -19,6 +19,6 @@ along with this program. If not, see . #include "quantum.h" -#ifdef KEYBOARD_naked48_rev1 +#ifdef KEYBOARD_salicylic_acid3_naked48_rev1 #include "rev1.h" #endif diff --git a/keyboards/naked48/readme.md b/keyboards/salicylic_acid3/naked48/readme.md similarity index 94% rename from keyboards/naked48/readme.md rename to keyboards/salicylic_acid3/naked48/readme.md index bb16571efde3..c3a826f13e0a 100644 --- a/keyboards/naked48/readme.md +++ b/keyboards/salicylic_acid3/naked48/readme.md @@ -10,7 +10,7 @@ Hardware Availability: [PCB & Case Data](https://github.com/Salicylic-acid3/PCB_ Make example for this keyboard (after setting up your build environment): - make naked48:default:avrdude + make salicylic_acid3/naked48/rev1:default:avrdude 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/naked48/rev1/config.h b/keyboards/salicylic_acid3/naked48/rev1/config.h similarity index 100% rename from keyboards/naked48/rev1/config.h rename to keyboards/salicylic_acid3/naked48/rev1/config.h diff --git a/keyboards/naked48/rev1/rev1.c b/keyboards/salicylic_acid3/naked48/rev1/rev1.c similarity index 100% rename from keyboards/naked48/rev1/rev1.c rename to keyboards/salicylic_acid3/naked48/rev1/rev1.c diff --git a/keyboards/naked48/rev1/rev1.h b/keyboards/salicylic_acid3/naked48/rev1/rev1.h similarity index 100% rename from keyboards/naked48/rev1/rev1.h rename to keyboards/salicylic_acid3/naked48/rev1/rev1.h diff --git a/keyboards/runner3680/5x6/rules.mk b/keyboards/salicylic_acid3/naked48/rev1/rules.mk similarity index 100% rename from keyboards/runner3680/5x6/rules.mk rename to keyboards/salicylic_acid3/naked48/rev1/rules.mk diff --git a/keyboards/naked48/rules.mk b/keyboards/salicylic_acid3/naked48/rules.mk similarity index 93% rename from keyboards/naked48/rules.mk rename to keyboards/salicylic_acid3/naked48/rules.mk index 6e848a281506..0e297ebf6006 100644 --- a/keyboards/naked48/rules.mk +++ b/keyboards/salicylic_acid3/naked48/rules.mk @@ -21,4 +21,4 @@ RGB_MATRIX_DRIVER = WS2812 SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = naked48/rev1 +DEFAULT_FOLDER = salicylic_acid3/naked48/rev1 diff --git a/keyboards/naked60/config.h b/keyboards/salicylic_acid3/naked60/config.h similarity index 100% rename from keyboards/naked60/config.h rename to keyboards/salicylic_acid3/naked60/config.h diff --git a/keyboards/naked60/info.json b/keyboards/salicylic_acid3/naked60/info.json similarity index 100% rename from keyboards/naked60/info.json rename to keyboards/salicylic_acid3/naked60/info.json diff --git a/keyboards/naked60/keymaps/333fred/config.h b/keyboards/salicylic_acid3/naked60/keymaps/333fred/config.h similarity index 100% rename from keyboards/naked60/keymaps/333fred/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/333fred/config.h diff --git a/keyboards/naked60/keymaps/333fred/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/333fred/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/333fred/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/333fred/keymap.c diff --git a/keyboards/naked60/keymaps/default/config.h b/keyboards/salicylic_acid3/naked60/keymaps/default/config.h similarity index 100% rename from keyboards/naked60/keymaps/default/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/default/config.h diff --git a/keyboards/naked60/keymaps/default/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/default/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/default/keymap.c diff --git a/keyboards/naked60/keymaps/default/readme.md b/keyboards/salicylic_acid3/naked60/keymaps/default/readme.md similarity index 100% rename from keyboards/naked60/keymaps/default/readme.md rename to keyboards/salicylic_acid3/naked60/keymaps/default/readme.md diff --git a/keyboards/naked60/keymaps/default_with_nafuda/config.h b/keyboards/salicylic_acid3/naked60/keymaps/default_with_nafuda/config.h similarity index 100% rename from keyboards/naked60/keymaps/default_with_nafuda/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/default_with_nafuda/config.h diff --git a/keyboards/naked60/keymaps/default_with_nafuda/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/default_with_nafuda/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/default_with_nafuda/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/default_with_nafuda/keymap.c diff --git a/keyboards/naked60/keymaps/default_with_nafuda/readme.md b/keyboards/salicylic_acid3/naked60/keymaps/default_with_nafuda/readme.md similarity index 100% rename from keyboards/naked60/keymaps/default_with_nafuda/readme.md rename to keyboards/salicylic_acid3/naked60/keymaps/default_with_nafuda/readme.md diff --git a/keyboards/naked60/keymaps/default_with_setta21/config.h b/keyboards/salicylic_acid3/naked60/keymaps/default_with_setta21/config.h similarity index 100% rename from keyboards/naked60/keymaps/default_with_setta21/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/default_with_setta21/config.h diff --git a/keyboards/naked60/keymaps/default_with_setta21/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/default_with_setta21/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/default_with_setta21/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/default_with_setta21/keymap.c diff --git a/keyboards/naked60/keymaps/default_with_setta21/readme.md b/keyboards/salicylic_acid3/naked60/keymaps/default_with_setta21/readme.md similarity index 100% rename from keyboards/naked60/keymaps/default_with_setta21/readme.md rename to keyboards/salicylic_acid3/naked60/keymaps/default_with_setta21/readme.md diff --git a/keyboards/naked60/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/naked60/keymaps/salicylic/config.h similarity index 100% rename from keyboards/naked60/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic/config.h diff --git a/keyboards/naked60/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic/keymap.c diff --git a/keyboards/naked60/keymaps/salicylic/readme.md b/keyboards/salicylic_acid3/naked60/keymaps/salicylic/readme.md similarity index 100% rename from keyboards/naked60/keymaps/salicylic/readme.md rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic/readme.md diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/rules.mk b/keyboards/salicylic_acid3/naked60/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/bigseries/1key/keymaps/dudeofawesome/rules.mk rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic/rules.mk diff --git a/keyboards/naked60/keymaps/salicylic_with_nafuda/config.h b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/config.h similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_nafuda/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/config.h diff --git a/keyboards/naked60/keymaps/salicylic_with_nafuda/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_nafuda/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/keymap.c diff --git a/keyboards/naked60/keymaps/salicylic_with_nafuda/readme.md b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/readme.md similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_nafuda/readme.md rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/readme.md diff --git a/keyboards/diverge3/keymaps/default/rules.mk b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/rules.mk similarity index 100% rename from keyboards/diverge3/keymaps/default/rules.mk rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_nafuda/rules.mk diff --git a/keyboards/naked60/keymaps/salicylic_with_setta21/config.h b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/config.h similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_setta21/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/config.h diff --git a/keyboards/naked60/keymaps/salicylic_with_setta21/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_setta21/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/keymap.c diff --git a/keyboards/naked60/keymaps/salicylic_with_setta21/readme.md b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/readme.md similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_setta21/readme.md rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/readme.md diff --git a/keyboards/naked60/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/rules.mk similarity index 100% rename from keyboards/naked60/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/naked60/keymaps/salicylic_with_setta21/rules.mk diff --git a/keyboards/naked60/keymaps/via/config.h b/keyboards/salicylic_acid3/naked60/keymaps/via/config.h similarity index 100% rename from keyboards/naked60/keymaps/via/config.h rename to keyboards/salicylic_acid3/naked60/keymaps/via/config.h diff --git a/keyboards/naked60/keymaps/via/keymap.c b/keyboards/salicylic_acid3/naked60/keymaps/via/keymap.c similarity index 100% rename from keyboards/naked60/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/naked60/keymaps/via/keymap.c diff --git a/keyboards/nk65/keymaps/via/rules.mk b/keyboards/salicylic_acid3/naked60/keymaps/via/rules.mk old mode 100755 new mode 100644 similarity index 100% rename from keyboards/nk65/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/naked60/keymaps/via/rules.mk diff --git a/keyboards/naked60/naked60.c b/keyboards/salicylic_acid3/naked60/naked60.c similarity index 100% rename from keyboards/naked60/naked60.c rename to keyboards/salicylic_acid3/naked60/naked60.c diff --git a/keyboards/naked60/naked60.h b/keyboards/salicylic_acid3/naked60/naked60.h similarity index 94% rename from keyboards/naked60/naked60.h rename to keyboards/salicylic_acid3/naked60/naked60.h index 4952b6b076d5..9ad73df67f65 100644 --- a/keyboards/naked60/naked60.h +++ b/keyboards/salicylic_acid3/naked60/naked60.h @@ -19,6 +19,6 @@ along with this program. If not, see . #include "quantum.h" -#ifdef KEYBOARD_naked60_rev1 +#ifdef KEYBOARD_salicylic_acid3_naked60_rev1 #include "rev1.h" #endif diff --git a/keyboards/naked60/readme.md b/keyboards/salicylic_acid3/naked60/readme.md similarity index 94% rename from keyboards/naked60/readme.md rename to keyboards/salicylic_acid3/naked60/readme.md index 60bb1643772f..e44aa64a4418 100644 --- a/keyboards/naked60/readme.md +++ b/keyboards/salicylic_acid3/naked60/readme.md @@ -10,7 +10,7 @@ Hardware Availability: [PCB & Case Data](https://github.com/Salicylic-acid3/PCB_ Make example for this keyboard (after setting up your build environment): - make naked60:default:avrdude + make salicylic_acid3/naked60/rev1:default:avrdude 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/naked60/rev1/config.h b/keyboards/salicylic_acid3/naked60/rev1/config.h similarity index 100% rename from keyboards/naked60/rev1/config.h rename to keyboards/salicylic_acid3/naked60/rev1/config.h diff --git a/keyboards/naked60/rev1/rev1.c b/keyboards/salicylic_acid3/naked60/rev1/rev1.c similarity index 100% rename from keyboards/naked60/rev1/rev1.c rename to keyboards/salicylic_acid3/naked60/rev1/rev1.c diff --git a/keyboards/naked60/rev1/rev1.h b/keyboards/salicylic_acid3/naked60/rev1/rev1.h similarity index 100% rename from keyboards/naked60/rev1/rev1.h rename to keyboards/salicylic_acid3/naked60/rev1/rev1.h diff --git a/keyboards/runner3680/5x7/rules.mk b/keyboards/salicylic_acid3/naked60/rev1/rules.mk similarity index 100% rename from keyboards/runner3680/5x7/rules.mk rename to keyboards/salicylic_acid3/naked60/rev1/rules.mk diff --git a/keyboards/naked60/rules.mk b/keyboards/salicylic_acid3/naked60/rules.mk similarity index 93% rename from keyboards/naked60/rules.mk rename to keyboards/salicylic_acid3/naked60/rules.mk index 46aef17c7aa3..1aefc7b5953f 100644 --- a/keyboards/naked60/rules.mk +++ b/keyboards/salicylic_acid3/naked60/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = naked60/rev1 +DEFAULT_FOLDER = salicylic_acid3/naked60/rev1 diff --git a/keyboards/suihankey/split/alpha/.noci b/keyboards/salicylic_acid3/naked64/.noci similarity index 100% rename from keyboards/suihankey/split/alpha/.noci rename to keyboards/salicylic_acid3/naked64/.noci diff --git a/keyboards/wings42/config.h b/keyboards/salicylic_acid3/naked64/config.h similarity index 100% rename from keyboards/wings42/config.h rename to keyboards/salicylic_acid3/naked64/config.h diff --git a/keyboards/naked64/info.json b/keyboards/salicylic_acid3/naked64/info.json similarity index 100% rename from keyboards/naked64/info.json rename to keyboards/salicylic_acid3/naked64/info.json diff --git a/keyboards/naked64/keymaps/default/config.h b/keyboards/salicylic_acid3/naked64/keymaps/default/config.h similarity index 100% rename from keyboards/naked64/keymaps/default/config.h rename to keyboards/salicylic_acid3/naked64/keymaps/default/config.h diff --git a/keyboards/naked64/keymaps/default/keymap.c b/keyboards/salicylic_acid3/naked64/keymaps/default/keymap.c similarity index 100% rename from keyboards/naked64/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/naked64/keymaps/default/keymap.c diff --git a/keyboards/naked64/keymaps/default/readme.md b/keyboards/salicylic_acid3/naked64/keymaps/default/readme.md similarity index 100% rename from keyboards/naked64/keymaps/default/readme.md rename to keyboards/salicylic_acid3/naked64/keymaps/default/readme.md diff --git a/keyboards/runner3680/5x8/rules.mk b/keyboards/salicylic_acid3/naked64/keymaps/default/rules.mk similarity index 100% rename from keyboards/runner3680/5x8/rules.mk rename to keyboards/salicylic_acid3/naked64/keymaps/default/rules.mk diff --git a/keyboards/naked64/keymaps/default_with_setta21/config.h b/keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/config.h similarity index 100% rename from keyboards/naked64/keymaps/default_with_setta21/config.h rename to keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/config.h diff --git a/keyboards/naked64/keymaps/default_with_setta21/keymap.c b/keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/keymap.c similarity index 100% rename from keyboards/naked64/keymaps/default_with_setta21/keymap.c rename to keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/keymap.c diff --git a/keyboards/naked64/keymaps/default_with_setta21/readme.md b/keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/readme.md similarity index 100% rename from keyboards/naked64/keymaps/default_with_setta21/readme.md rename to keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/readme.md diff --git a/keyboards/setta21/rev1/rules.mk b/keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/rules.mk similarity index 100% rename from keyboards/setta21/rev1/rules.mk rename to keyboards/salicylic_acid3/naked64/keymaps/default_with_setta21/rules.mk diff --git a/keyboards/naked64/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/naked64/keymaps/salicylic/config.h similarity index 100% rename from keyboards/naked64/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic/config.h diff --git a/keyboards/naked64/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/naked64/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/naked64/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic/keymap.c diff --git a/keyboards/naked64/keymaps/salicylic/readme.md b/keyboards/salicylic_acid3/naked64/keymaps/salicylic/readme.md similarity index 100% rename from keyboards/naked64/keymaps/salicylic/readme.md rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic/readme.md diff --git a/keyboards/naked60/keymaps/salicylic_with_nafuda/rules.mk b/keyboards/salicylic_acid3/naked64/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_nafuda/rules.mk rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic/rules.mk diff --git a/keyboards/naked64/keymaps/salicylic_with_setta21/config.h b/keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/config.h similarity index 100% rename from keyboards/naked64/keymaps/salicylic_with_setta21/config.h rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/config.h diff --git a/keyboards/naked64/keymaps/salicylic_with_setta21/keymap.c b/keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/keymap.c similarity index 100% rename from keyboards/naked64/keymaps/salicylic_with_setta21/keymap.c rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/keymap.c diff --git a/keyboards/naked64/keymaps/salicylic_with_setta21/readme.md b/keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/readme.md similarity index 100% rename from keyboards/naked64/keymaps/salicylic_with_setta21/readme.md rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/readme.md diff --git a/keyboards/naked60/keymaps/salicylic_with_setta21/rules.mk b/keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/rules.mk similarity index 100% rename from keyboards/naked60/keymaps/salicylic_with_setta21/rules.mk rename to keyboards/salicylic_acid3/naked64/keymaps/salicylic_with_setta21/rules.mk diff --git a/keyboards/naked64/naked64.c b/keyboards/salicylic_acid3/naked64/naked64.c similarity index 100% rename from keyboards/naked64/naked64.c rename to keyboards/salicylic_acid3/naked64/naked64.c diff --git a/keyboards/naked64/naked64.h b/keyboards/salicylic_acid3/naked64/naked64.h similarity index 58% rename from keyboards/naked64/naked64.h rename to keyboards/salicylic_acid3/naked64/naked64.h index a13144011825..cb73e2142d20 100644 --- a/keyboards/naked64/naked64.h +++ b/keyboards/salicylic_acid3/naked64/naked64.h @@ -2,6 +2,6 @@ #include "quantum.h" -#ifdef KEYBOARD_naked64_rev1 +#ifdef KEYBOARD_salicylic_acid3_naked64_rev1 #include "rev1.h" #endif diff --git a/keyboards/naked64/readme.md b/keyboards/salicylic_acid3/naked64/readme.md similarity index 95% rename from keyboards/naked64/readme.md rename to keyboards/salicylic_acid3/naked64/readme.md index 403e5cf4aeb4..ab02be74f50d 100644 --- a/keyboards/naked64/readme.md +++ b/keyboards/salicylic_acid3/naked64/readme.md @@ -10,7 +10,7 @@ Hardware Availability: [PCB & Case Data](https://github.com/Salicylic-acid3/PCB_ Make example for this keyboard (after setting up your build environment): - make naked64:default:flash + make salicylic_acid3/naked64/rev1: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/naked64/rev1/config.h b/keyboards/salicylic_acid3/naked64/rev1/config.h similarity index 100% rename from keyboards/naked64/rev1/config.h rename to keyboards/salicylic_acid3/naked64/rev1/config.h diff --git a/keyboards/squiggle/rev1/rev1.c b/keyboards/salicylic_acid3/naked64/rev1/rev1.c similarity index 100% rename from keyboards/squiggle/rev1/rev1.c rename to keyboards/salicylic_acid3/naked64/rev1/rev1.c diff --git a/keyboards/naked64/rev1/rev1.h b/keyboards/salicylic_acid3/naked64/rev1/rev1.h similarity index 100% rename from keyboards/naked64/rev1/rev1.h rename to keyboards/salicylic_acid3/naked64/rev1/rev1.h diff --git a/keyboards/wings42/rev1/rules.mk b/keyboards/salicylic_acid3/naked64/rev1/rules.mk similarity index 100% rename from keyboards/wings42/rev1/rules.mk rename to keyboards/salicylic_acid3/naked64/rev1/rules.mk diff --git a/keyboards/naked64/rules.mk b/keyboards/salicylic_acid3/naked64/rules.mk similarity index 93% rename from keyboards/naked64/rules.mk rename to keyboards/salicylic_acid3/naked64/rules.mk index 7de80383e1bc..db027e3bda5d 100644 --- a/keyboards/naked64/rules.mk +++ b/keyboards/salicylic_acid3/naked64/rules.mk @@ -21,4 +21,4 @@ USE_I2C = no SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = naked64/rev1 +DEFAULT_FOLDER = salicylic_acid3/naked64/rev1 diff --git a/keyboards/nknl7en/config.h b/keyboards/salicylic_acid3/nknl7en/config.h similarity index 100% rename from keyboards/nknl7en/config.h rename to keyboards/salicylic_acid3/nknl7en/config.h diff --git a/keyboards/nknl7en/info.json b/keyboards/salicylic_acid3/nknl7en/info.json similarity index 100% rename from keyboards/nknl7en/info.json rename to keyboards/salicylic_acid3/nknl7en/info.json diff --git a/keyboards/nknl7en/keymaps/default/config.h b/keyboards/salicylic_acid3/nknl7en/keymaps/default/config.h similarity index 100% rename from keyboards/nknl7en/keymaps/default/config.h rename to keyboards/salicylic_acid3/nknl7en/keymaps/default/config.h diff --git a/keyboards/nknl7en/keymaps/default/keymap.c b/keyboards/salicylic_acid3/nknl7en/keymaps/default/keymap.c similarity index 100% rename from keyboards/nknl7en/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/nknl7en/keymaps/default/keymap.c diff --git a/keyboards/nknl7en/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/nknl7en/keymaps/salicylic/config.h similarity index 100% rename from keyboards/nknl7en/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/nknl7en/keymaps/salicylic/config.h diff --git a/keyboards/nknl7en/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/nknl7en/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/nknl7en/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/nknl7en/keymaps/salicylic/keymap.c diff --git a/keyboards/nknl7en/keymaps/via/config.h b/keyboards/salicylic_acid3/nknl7en/keymaps/via/config.h similarity index 100% rename from keyboards/nknl7en/keymaps/via/config.h rename to keyboards/salicylic_acid3/nknl7en/keymaps/via/config.h diff --git a/keyboards/nknl7en/keymaps/via/keymap.c b/keyboards/salicylic_acid3/nknl7en/keymaps/via/keymap.c similarity index 100% rename from keyboards/nknl7en/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/nknl7en/keymaps/via/keymap.c diff --git a/keyboards/pistachio_mp/keymaps/via/rules.mk b/keyboards/salicylic_acid3/nknl7en/keymaps/via/rules.mk similarity index 100% rename from keyboards/pistachio_mp/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/nknl7en/keymaps/via/rules.mk diff --git a/keyboards/nknl7en/nknl7en.c b/keyboards/salicylic_acid3/nknl7en/nknl7en.c similarity index 100% rename from keyboards/nknl7en/nknl7en.c rename to keyboards/salicylic_acid3/nknl7en/nknl7en.c diff --git a/keyboards/nknl7en/nknl7en.h b/keyboards/salicylic_acid3/nknl7en/nknl7en.h similarity index 100% rename from keyboards/nknl7en/nknl7en.h rename to keyboards/salicylic_acid3/nknl7en/nknl7en.h diff --git a/keyboards/nknl7en/readme.md b/keyboards/salicylic_acid3/nknl7en/readme.md similarity index 95% rename from keyboards/nknl7en/readme.md rename to keyboards/salicylic_acid3/nknl7en/readme.md index 5cbffae30c0a..07f87e3e5e4b 100644 --- a/keyboards/nknl7en/readme.md +++ b/keyboards/salicylic_acid3/nknl7en/readme.md @@ -10,7 +10,7 @@ This is 70 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make nknl7en:default + make salicylic_acid3/nknl7en: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/nknl7en/rules.mk b/keyboards/salicylic_acid3/nknl7en/rules.mk similarity index 100% rename from keyboards/nknl7en/rules.mk rename to keyboards/salicylic_acid3/nknl7en/rules.mk diff --git a/keyboards/nknl7jp/config.h b/keyboards/salicylic_acid3/nknl7jp/config.h similarity index 100% rename from keyboards/nknl7jp/config.h rename to keyboards/salicylic_acid3/nknl7jp/config.h diff --git a/keyboards/nknl7jp/info.json b/keyboards/salicylic_acid3/nknl7jp/info.json similarity index 100% rename from keyboards/nknl7jp/info.json rename to keyboards/salicylic_acid3/nknl7jp/info.json diff --git a/keyboards/nknl7jp/keymaps/default/config.h b/keyboards/salicylic_acid3/nknl7jp/keymaps/default/config.h similarity index 100% rename from keyboards/nknl7jp/keymaps/default/config.h rename to keyboards/salicylic_acid3/nknl7jp/keymaps/default/config.h diff --git a/keyboards/nknl7jp/keymaps/default/keymap.c b/keyboards/salicylic_acid3/nknl7jp/keymaps/default/keymap.c similarity index 100% rename from keyboards/nknl7jp/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/nknl7jp/keymaps/default/keymap.c diff --git a/keyboards/nknl7jp/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/nknl7jp/keymaps/salicylic/config.h similarity index 100% rename from keyboards/nknl7jp/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/nknl7jp/keymaps/salicylic/config.h diff --git a/keyboards/nknl7jp/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/nknl7jp/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/nknl7jp/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/nknl7jp/keymaps/salicylic/keymap.c diff --git a/keyboards/nknl7jp/keymaps/via/config.h b/keyboards/salicylic_acid3/nknl7jp/keymaps/via/config.h similarity index 100% rename from keyboards/nknl7jp/keymaps/via/config.h rename to keyboards/salicylic_acid3/nknl7jp/keymaps/via/config.h diff --git a/keyboards/nknl7jp/keymaps/via/keymap.c b/keyboards/salicylic_acid3/nknl7jp/keymaps/via/keymap.c similarity index 100% rename from keyboards/nknl7jp/keymaps/via/keymap.c rename to keyboards/salicylic_acid3/nknl7jp/keymaps/via/keymap.c diff --git a/keyboards/rainkeeb/keymaps/via/rules.mk b/keyboards/salicylic_acid3/nknl7jp/keymaps/via/rules.mk similarity index 100% rename from keyboards/rainkeeb/keymaps/via/rules.mk rename to keyboards/salicylic_acid3/nknl7jp/keymaps/via/rules.mk diff --git a/keyboards/nknl7jp/nknl7jp.c b/keyboards/salicylic_acid3/nknl7jp/nknl7jp.c similarity index 100% rename from keyboards/nknl7jp/nknl7jp.c rename to keyboards/salicylic_acid3/nknl7jp/nknl7jp.c diff --git a/keyboards/nknl7jp/nknl7jp.h b/keyboards/salicylic_acid3/nknl7jp/nknl7jp.h similarity index 100% rename from keyboards/nknl7jp/nknl7jp.h rename to keyboards/salicylic_acid3/nknl7jp/nknl7jp.h diff --git a/keyboards/nknl7jp/readme.md b/keyboards/salicylic_acid3/nknl7jp/readme.md similarity index 95% rename from keyboards/nknl7jp/readme.md rename to keyboards/salicylic_acid3/nknl7jp/readme.md index 9d0ccba4e8cf..b2f375aef872 100644 --- a/keyboards/nknl7jp/readme.md +++ b/keyboards/salicylic_acid3/nknl7jp/readme.md @@ -10,7 +10,7 @@ This is 73 keys Custom keyboard. Make example for this keyboard (after setting up your build environment): - make nknl7jp:default + make salicylic_acid3/nknl7jp: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/nknl7jp/rules.mk b/keyboards/salicylic_acid3/nknl7jp/rules.mk similarity index 100% rename from keyboards/nknl7jp/rules.mk rename to keyboards/salicylic_acid3/nknl7jp/rules.mk diff --git a/keyboards/zinc/config.h b/keyboards/salicylic_acid3/setta21/config.h similarity index 100% rename from keyboards/zinc/config.h rename to keyboards/salicylic_acid3/setta21/config.h diff --git a/keyboards/setta21/info.json b/keyboards/salicylic_acid3/setta21/info.json similarity index 100% rename from keyboards/setta21/info.json rename to keyboards/salicylic_acid3/setta21/info.json diff --git a/keyboards/setta21/keymaps/default/config.h b/keyboards/salicylic_acid3/setta21/keymaps/default/config.h similarity index 100% rename from keyboards/setta21/keymaps/default/config.h rename to keyboards/salicylic_acid3/setta21/keymaps/default/config.h diff --git a/keyboards/setta21/keymaps/default/keymap.c b/keyboards/salicylic_acid3/setta21/keymaps/default/keymap.c similarity index 100% rename from keyboards/setta21/keymaps/default/keymap.c rename to keyboards/salicylic_acid3/setta21/keymaps/default/keymap.c diff --git a/keyboards/setta21/keymaps/default/readme.md b/keyboards/salicylic_acid3/setta21/keymaps/default/readme.md similarity index 100% rename from keyboards/setta21/keymaps/default/readme.md rename to keyboards/salicylic_acid3/setta21/keymaps/default/readme.md diff --git a/keyboards/setta21/keymaps/salicylic/config.h b/keyboards/salicylic_acid3/setta21/keymaps/salicylic/config.h similarity index 100% rename from keyboards/setta21/keymaps/salicylic/config.h rename to keyboards/salicylic_acid3/setta21/keymaps/salicylic/config.h diff --git a/keyboards/setta21/keymaps/salicylic/keymap.c b/keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c similarity index 100% rename from keyboards/setta21/keymaps/salicylic/keymap.c rename to keyboards/salicylic_acid3/setta21/keymaps/salicylic/keymap.c diff --git a/keyboards/setta21/keymaps/salicylic/readme.md b/keyboards/salicylic_acid3/setta21/keymaps/salicylic/readme.md similarity index 100% rename from keyboards/setta21/keymaps/salicylic/readme.md rename to keyboards/salicylic_acid3/setta21/keymaps/salicylic/readme.md diff --git a/keyboards/setta21/keymaps/salicylic/rules.mk b/keyboards/salicylic_acid3/setta21/keymaps/salicylic/rules.mk similarity index 100% rename from keyboards/setta21/keymaps/salicylic/rules.mk rename to keyboards/salicylic_acid3/setta21/keymaps/salicylic/rules.mk diff --git a/keyboards/setta21/readme.md b/keyboards/salicylic_acid3/setta21/readme.md similarity index 94% rename from keyboards/setta21/readme.md rename to keyboards/salicylic_acid3/setta21/readme.md index c940079997f4..25027b728129 100644 --- a/keyboards/setta21/readme.md +++ b/keyboards/salicylic_acid3/setta21/readme.md @@ -10,7 +10,7 @@ This is 21 keys tenkeypad. Make example for this keyboard (after setting up your build environment): - make setta21:default + make salicylic_acid3/setta21/rev1: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/treadstone32/lite/.noci b/keyboards/salicylic_acid3/setta21/rev1/.noci similarity index 100% rename from keyboards/treadstone32/lite/.noci rename to keyboards/salicylic_acid3/setta21/rev1/.noci diff --git a/keyboards/setta21/rev1/config.h b/keyboards/salicylic_acid3/setta21/rev1/config.h similarity index 100% rename from keyboards/setta21/rev1/config.h rename to keyboards/salicylic_acid3/setta21/rev1/config.h diff --git a/keyboards/setta21/rev1/rev1.c b/keyboards/salicylic_acid3/setta21/rev1/rev1.c similarity index 100% rename from keyboards/setta21/rev1/rev1.c rename to keyboards/salicylic_acid3/setta21/rev1/rev1.c diff --git a/keyboards/setta21/rev1/rev1.h b/keyboards/salicylic_acid3/setta21/rev1/rev1.h similarity index 100% rename from keyboards/setta21/rev1/rev1.h rename to keyboards/salicylic_acid3/setta21/rev1/rev1.h diff --git a/keyboards/wings42/rev1_extkeys/rules.mk b/keyboards/salicylic_acid3/setta21/rev1/rules.mk similarity index 100% rename from keyboards/wings42/rev1_extkeys/rules.mk rename to keyboards/salicylic_acid3/setta21/rev1/rules.mk diff --git a/keyboards/setta21/rules.mk b/keyboards/salicylic_acid3/setta21/rules.mk similarity index 94% rename from keyboards/setta21/rules.mk rename to keyboards/salicylic_acid3/setta21/rules.mk index e31a7b5c7aab..c7920fdfe8a7 100644 --- a/keyboards/setta21/rules.mk +++ b/keyboards/salicylic_acid3/setta21/rules.mk @@ -21,6 +21,6 @@ USE_I2C = no RGB_MATRIX_ENABLE = no RGB_MATRIX_DRIVER = WS2812 -DEFAULT_FOLDER = setta21/rev1 +DEFAULT_FOLDER = salicylic_acid3/setta21/rev1 LAYOUTS = numpad_6x4 diff --git a/keyboards/setta21/setta21.c b/keyboards/salicylic_acid3/setta21/setta21.c similarity index 100% rename from keyboards/setta21/setta21.c rename to keyboards/salicylic_acid3/setta21/setta21.c diff --git a/keyboards/setta21/setta21.h b/keyboards/salicylic_acid3/setta21/setta21.h similarity index 58% rename from keyboards/setta21/setta21.h rename to keyboards/salicylic_acid3/setta21/setta21.h index 0409f6cbc289..9e5b17e2c30c 100644 --- a/keyboards/setta21/setta21.h +++ b/keyboards/salicylic_acid3/setta21/setta21.h @@ -2,6 +2,6 @@ #include "quantum.h" -#ifdef KEYBOARD_setta21_rev1 +#ifdef KEYBOARD_salicylic_acid3_setta21_rev1 #include "rev1.h" #endif diff --git a/keyboards/comet46/comet46.c b/keyboards/satt/comet46/comet46.c similarity index 100% rename from keyboards/comet46/comet46.c rename to keyboards/satt/comet46/comet46.c diff --git a/keyboards/comet46/comet46.h b/keyboards/satt/comet46/comet46.h similarity index 100% rename from keyboards/comet46/comet46.h rename to keyboards/satt/comet46/comet46.h diff --git a/keyboards/comet46/config.h b/keyboards/satt/comet46/config.h similarity index 83% rename from keyboards/comet46/config.h rename to keyboards/satt/comet46/config.h index 067dabb1036a..5ea40c14c592 100644 --- a/keyboards/comet46/config.h +++ b/keyboards/satt/comet46/config.h @@ -62,12 +62,3 @@ along with this program. If not, see . #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/comet46/i2c.c b/keyboards/satt/comet46/i2c.c similarity index 100% rename from keyboards/comet46/i2c.c rename to keyboards/satt/comet46/i2c.c diff --git a/keyboards/comet46/i2c.h b/keyboards/satt/comet46/i2c.h similarity index 100% rename from keyboards/comet46/i2c.h rename to keyboards/satt/comet46/i2c.h diff --git a/keyboards/comet46/info.json b/keyboards/satt/comet46/info.json similarity index 100% rename from keyboards/comet46/info.json rename to keyboards/satt/comet46/info.json diff --git a/keyboards/comet46/keymaps/default-rgbled/keymap.c b/keyboards/satt/comet46/keymaps/default-rgbled/keymap.c similarity index 100% rename from keyboards/comet46/keymaps/default-rgbled/keymap.c rename to keyboards/satt/comet46/keymaps/default-rgbled/keymap.c diff --git a/keyboards/comet46/keymaps/default-rgbled/readme.md b/keyboards/satt/comet46/keymaps/default-rgbled/readme.md similarity index 100% rename from keyboards/comet46/keymaps/default-rgbled/readme.md rename to keyboards/satt/comet46/keymaps/default-rgbled/readme.md diff --git a/keyboards/comet46/keymaps/default/config.h b/keyboards/satt/comet46/keymaps/default/config.h similarity index 100% rename from keyboards/comet46/keymaps/default/config.h rename to keyboards/satt/comet46/keymaps/default/config.h diff --git a/keyboards/comet46/keymaps/default/keymap.c b/keyboards/satt/comet46/keymaps/default/keymap.c similarity index 100% rename from keyboards/comet46/keymaps/default/keymap.c rename to keyboards/satt/comet46/keymaps/default/keymap.c diff --git a/keyboards/comet46/keymaps/default/readme.md b/keyboards/satt/comet46/keymaps/default/readme.md similarity index 100% rename from keyboards/comet46/keymaps/default/readme.md rename to keyboards/satt/comet46/keymaps/default/readme.md diff --git a/keyboards/comet46/keymaps/default/rules.mk b/keyboards/satt/comet46/keymaps/default/rules.mk similarity index 100% rename from keyboards/comet46/keymaps/default/rules.mk rename to keyboards/satt/comet46/keymaps/default/rules.mk diff --git a/keyboards/comet46/keymaps/satt/action_pseudo_lut.c b/keyboards/satt/comet46/keymaps/satt/action_pseudo_lut.c similarity index 100% rename from keyboards/comet46/keymaps/satt/action_pseudo_lut.c rename to keyboards/satt/comet46/keymaps/satt/action_pseudo_lut.c diff --git a/keyboards/comet46/keymaps/satt/action_pseudo_lut.h b/keyboards/satt/comet46/keymaps/satt/action_pseudo_lut.h similarity index 100% rename from keyboards/comet46/keymaps/satt/action_pseudo_lut.h rename to keyboards/satt/comet46/keymaps/satt/action_pseudo_lut.h diff --git a/keyboards/comet46/keymaps/satt/config.h b/keyboards/satt/comet46/keymaps/satt/config.h similarity index 100% rename from keyboards/comet46/keymaps/satt/config.h rename to keyboards/satt/comet46/keymaps/satt/config.h diff --git a/keyboards/comet46/keymaps/satt/keymap.c b/keyboards/satt/comet46/keymaps/satt/keymap.c similarity index 100% rename from keyboards/comet46/keymaps/satt/keymap.c rename to keyboards/satt/comet46/keymaps/satt/keymap.c diff --git a/keyboards/comet46/keymaps/satt/keymap_jis2us.h b/keyboards/satt/comet46/keymaps/satt/keymap_jis2us.h similarity index 100% rename from keyboards/comet46/keymaps/satt/keymap_jis2us.h rename to keyboards/satt/comet46/keymaps/satt/keymap_jis2us.h diff --git a/keyboards/comet46/keymaps/satt/readme.md b/keyboards/satt/comet46/keymaps/satt/readme.md similarity index 100% rename from keyboards/comet46/keymaps/satt/readme.md rename to keyboards/satt/comet46/keymaps/satt/readme.md diff --git a/keyboards/comet46/keymaps/satt/rules.mk b/keyboards/satt/comet46/keymaps/satt/rules.mk similarity index 100% rename from keyboards/comet46/keymaps/satt/rules.mk rename to keyboards/satt/comet46/keymaps/satt/rules.mk diff --git a/keyboards/comet46/lib/glcdfont.c b/keyboards/satt/comet46/lib/glcdfont.c similarity index 100% rename from keyboards/comet46/lib/glcdfont.c rename to keyboards/satt/comet46/lib/glcdfont.c diff --git a/keyboards/comet46/lib/host_led_state_reader.c b/keyboards/satt/comet46/lib/host_led_state_reader.c similarity index 100% rename from keyboards/comet46/lib/host_led_state_reader.c rename to keyboards/satt/comet46/lib/host_led_state_reader.c diff --git a/keyboards/comet46/lib/keylogger.c b/keyboards/satt/comet46/lib/keylogger.c similarity index 100% rename from keyboards/comet46/lib/keylogger.c rename to keyboards/satt/comet46/lib/keylogger.c diff --git a/keyboards/comet46/lib/modifier_state_reader.c b/keyboards/satt/comet46/lib/modifier_state_reader.c similarity index 100% rename from keyboards/comet46/lib/modifier_state_reader.c rename to keyboards/satt/comet46/lib/modifier_state_reader.c diff --git a/keyboards/satt/comet46/matrix.c b/keyboards/satt/comet46/matrix.c new file mode 100644 index 000000000000..a92c3e843108 --- /dev/null +++ b/keyboards/satt/comet46/matrix.c @@ -0,0 +1,65 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 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 . +*/ + +#include "quantum.h" +#include "matrix.h" +#include "uart.h" + +void matrix_init_custom(void) { + uart_init(1000000); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + uint32_t timeout = 0; + bool changed = false; + + //the s character requests the RF slave to send the matrix + uart_write('s'); + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[11] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 11; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while (!uart_available()) { + timeout++; + if (timeout > 10000) { + break; + } + } + uart_data[i] = uart_read(); + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[10] == 0xE0) { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 5; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; + } + } + + return changed; +} diff --git a/keyboards/comet46/readme.md b/keyboards/satt/comet46/readme.md similarity index 96% rename from keyboards/comet46/readme.md rename to keyboards/satt/comet46/readme.md index 3db64d291ba6..60cb432a481a 100644 --- a/keyboards/comet46/readme.md +++ b/keyboards/satt/comet46/readme.md @@ -11,7 +11,7 @@ Firmware for nordic MCUs: [SRC and precompiled](https://github.com/satt99/comet4 Make example for this keyboard (after setting up your build environment): - make comet46:default + make satt/comet46:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. diff --git a/keyboards/satt/comet46/rules.mk b/keyboards/satt/comet46/rules.mk new file mode 100644 index 000000000000..e177fc644165 --- /dev/null +++ b/keyboards/satt/comet46/rules.mk @@ -0,0 +1,25 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = no # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +CUSTOM_MATRIX = lite + +# project specific files +SRC += matrix.c \ + i2c.c \ + ssd1306.c +QUANTUM_LIB_SRC += uart.c diff --git a/keyboards/comet46/ssd1306.c b/keyboards/satt/comet46/ssd1306.c similarity index 100% rename from keyboards/comet46/ssd1306.c rename to keyboards/satt/comet46/ssd1306.c diff --git a/keyboards/comet46/ssd1306.h b/keyboards/satt/comet46/ssd1306.h similarity index 100% rename from keyboards/comet46/ssd1306.h rename to keyboards/satt/comet46/ssd1306.h diff --git a/keyboards/sekigon/grs_70ec/matrix.c b/keyboards/sekigon/grs_70ec/matrix.c index 98b234793711..926ed6f81302 100644 --- a/keyboards/sekigon/grs_70ec/matrix.c +++ b/keyboards/sekigon/grs_70ec/matrix.c @@ -70,50 +70,3 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { return updated; } - -bool matrix_post_scan(void) { - bool changed = false; - if (is_keyboard_master()) { - static uint8_t error_count; - - matrix_row_t slave_matrix[ROWS_PER_HAND] = {0}; - if (!transport_master(matrix + thatHand, slave_matrix)) { - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - dprintf("Error: disconnect split half\n"); - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[thatHand + i] = 0; - slave_matrix[i] = 0; - } - - changed = true; - } - } else { - error_count = 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - if (matrix[thatHand + i] != slave_matrix[i]) { - matrix[thatHand + i] = slave_matrix[i]; - changed = true; - } - } - } - - matrix_scan_quantum(); - } else { - transport_slave(matrix + thatHand, matrix + thisHand); - - matrix_slave_scan_user(); - } - return changed; -} - -uint8_t matrix_scan(void) { - bool changed = matrix_scan_custom(raw_matrix) || matrix_post_scan(); - - debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); - - return changed; -} diff --git a/keyboards/senselessclay/gos65/rules.mk b/keyboards/senselessclay/gos65/rules.mk index 08b268c04170..b5761555d400 100644 --- a/keyboards/senselessclay/gos65/rules.mk +++ b/keyboards/senselessclay/gos65/rules.mk @@ -7,15 +7,12 @@ BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output \ No newline at end of file +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output diff --git a/keyboards/sirius/uni660/rev1/config.h b/keyboards/sirius/uni660/rev1/config.h index 91d7c5d7a3ab..f9815844cb2a 100644 --- a/keyboards/sirius/uni660/rev1/config.h +++ b/keyboards/sirius/uni660/rev1/config.h @@ -57,13 +57,4 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 diff --git a/keyboards/sirius/uni660/rev1/matrix.c b/keyboards/sirius/uni660/rev1/matrix.c index 2db6767a46f6..919db5c80d5d 100644 --- a/keyboards/sirius/uni660/rev1/matrix.c +++ b/keyboards/sirius/uni660/rev1/matrix.c @@ -15,83 +15,21 @@ 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 -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "debounce.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} +#include "quantum.h" +#include "matrix.h" +#include "uart.h" -void matrix_init(void) { - debounce_init(MATRIX_ROWS); - matrix_init_quantum(); - serial_init(); +void matrix_init_custom(void) { + uart_init(1000000); } -uint8_t matrix_scan(void) -{ - bool matrix_has_changed = false; - +bool matrix_scan_custom(matrix_row_t current_matrix[]) { uint32_t timeout = 0; + bool changed = false; //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates entirely, erase the last data uint8_t uart_data[17] = {0}; @@ -101,60 +39,27 @@ uint8_t matrix_scan(void) //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while (!uart_available()) { timeout++; - if (timeout > 10000){ + if (timeout > 10000) { break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { + if (uart_data[10] == 0xE0) { //shifting and transferring the keystates to the QMK matrix variable for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 8; + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 8; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; } } - debounce(matrix, matrix, MATRIX_ROWS, matrix_has_changed); - - matrix_scan_quantum(); - - return matrix_has_changed; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 diff --git a/keyboards/sirius/uni660/rev2/iso/config.h b/keyboards/sirius/uni660/rev2/iso/config.h index 3283f0cd6772..763230dca818 100644 --- a/keyboards/sirius/uni660/rev2/iso/config.h +++ b/keyboards/sirius/uni660/rev2/iso/config.h @@ -57,13 +57,4 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 diff --git a/keyboards/sirius/uni660/rev2/matrix.c b/keyboards/sirius/uni660/rev2/matrix.c index 2db6767a46f6..919db5c80d5d 100644 --- a/keyboards/sirius/uni660/rev2/matrix.c +++ b/keyboards/sirius/uni660/rev2/matrix.c @@ -15,83 +15,21 @@ 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 -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" -#include "debounce.h" -#include "protocol/serial.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} +#include "quantum.h" +#include "matrix.h" +#include "uart.h" -void matrix_init(void) { - debounce_init(MATRIX_ROWS); - matrix_init_quantum(); - serial_init(); +void matrix_init_custom(void) { + uart_init(1000000); } -uint8_t matrix_scan(void) -{ - bool matrix_has_changed = false; - +bool matrix_scan_custom(matrix_row_t current_matrix[]) { uint32_t timeout = 0; + bool changed = false; //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates entirely, erase the last data uint8_t uart_data[17] = {0}; @@ -101,60 +39,27 @@ uint8_t matrix_scan(void) //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ + while (!uart_available()) { timeout++; - if (timeout > 10000){ + if (timeout > 10000) { break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 //will only show up here if the correct bytes were recieved - if (uart_data[10] == 0xE0) - { + if (uart_data[10] == 0xE0) { //shifting and transferring the keystates to the QMK matrix variable for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 8; + matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 8; + if (current_matrix[i] != current_row) { + changed = true; + } + current_matrix[i] = current_row; } } - debounce(matrix, matrix, MATRIX_ROWS, matrix_has_changed); - - matrix_scan_quantum(); - - return matrix_has_changed; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<. /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x4A1F +#define DEVICE_VER 0x0100 #define MANUFACTURER Kyle Terry #define PRODUCT spacetime diff --git a/keyboards/splitkb/kyria/keymaps/gotham/rules.mk b/keyboards/splitkb/kyria/keymaps/gotham/rules.mk index 81b7123ba56d..be3789ce9b0e 100644 --- a/keyboards/splitkb/kyria/keymaps/gotham/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/gotham/rules.mk @@ -16,6 +16,7 @@ endif ifeq ($(strip $(THUMBSTICK_ENABLE)), yes) POINTING_DEVICE_ENABLE = yes + POINTING_DEVICE_DRIVER = custom OPT_DEFS += -DTHUMBSTICK_ENABLE SRC += analog.c SRC += thumbstick.c diff --git a/keyboards/squiggle/rules.mk b/keyboards/squiggle/rules.mk deleted file mode 100644 index 4f44ddbb73fa..000000000000 --- a/keyboards/squiggle/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = squiggle/rev1 diff --git a/keyboards/suihankey/split/rules.mk b/keyboards/suihankey/split/rules.mk deleted file mode 100644 index f0bdf744eebe..000000000000 --- a/keyboards/suihankey/split/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -OLED_ENABLE = no -SPLIT_KEYBOARD = yes - -DEFAULT_FOLDER = suihankey/split/rev1 diff --git a/keyboards/switchplate/southpaw_65/matrix.c b/keyboards/switchplate/southpaw_65/matrix.c index e701d274f03f..5895750f890b 100644 --- a/keyboards/switchplate/southpaw_65/matrix.c +++ b/keyboards/switchplate/southpaw_65/matrix.c @@ -51,11 +51,14 @@ static void select_row(uint8_t row) { static uint32_t read_cols(void) { //Read column inputs. Pins 13-31 are used. Split across both ICs but they are sequential - uint32_t state_1 = pca9555_readPins(IC1, PCA9555_PORT1); - uint32_t state_2 = pca9555_readPins(IC2, PCA9555_PORT0); - uint32_t state_3 = pca9555_readPins(IC2, PCA9555_PORT1); - - uint32_t state = (((state_3 & 0b01111111) << 12) | (state_2 << 4) | ((state_1 & 0b11110000) >> 4)); + uint8_t state_1 = 0; + uint8_t state_2 = 0; + uint8_t state_3 = 0; + pca9555_readPins(IC2, PCA9555_PORT0, &state_1); + pca9555_readPins(IC2, PCA9555_PORT1, &state_2); + pca9555_readPins(IC1, PCA9555_PORT1, &state_3); + + uint32_t state = ((((uint32_t)state_3 & 0b01111111) << 12) | ((uint32_t)state_2 << 4) | (((uint32_t)state_1 & 0b11110000) >> 4)); return ~state; } diff --git a/keyboards/sx60/matrix.c b/keyboards/sx60/matrix.c index b7dc25425ded..231e1c8836e1 100644 --- a/keyboards/sx60/matrix.c +++ b/keyboards/sx60/matrix.c @@ -172,14 +172,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/hecomi/alpha/config.h b/keyboards/takashiski/hecomi/alpha/config.h similarity index 100% rename from keyboards/hecomi/alpha/config.h rename to keyboards/takashiski/hecomi/alpha/config.h diff --git a/keyboards/hecomi/alpha/info.json b/keyboards/takashiski/hecomi/alpha/info.json similarity index 100% rename from keyboards/hecomi/alpha/info.json rename to keyboards/takashiski/hecomi/alpha/info.json diff --git a/keyboards/hecomi/alpha/readme.md b/keyboards/takashiski/hecomi/alpha/readme.md similarity index 100% rename from keyboards/hecomi/alpha/readme.md rename to keyboards/takashiski/hecomi/alpha/readme.md diff --git a/keyboards/hecomi/alpha/rules.mk b/keyboards/takashiski/hecomi/alpha/rules.mk similarity index 100% rename from keyboards/hecomi/alpha/rules.mk rename to keyboards/takashiski/hecomi/alpha/rules.mk diff --git a/keyboards/hecomi/hecomi.c b/keyboards/takashiski/hecomi/hecomi.c similarity index 100% rename from keyboards/hecomi/hecomi.c rename to keyboards/takashiski/hecomi/hecomi.c diff --git a/keyboards/hecomi/hecomi.h b/keyboards/takashiski/hecomi/hecomi.h similarity index 100% rename from keyboards/hecomi/hecomi.h rename to keyboards/takashiski/hecomi/hecomi.h diff --git a/keyboards/hecomi/keymaps/default/keymap.c b/keyboards/takashiski/hecomi/keymaps/default/keymap.c similarity index 100% rename from keyboards/hecomi/keymaps/default/keymap.c rename to keyboards/takashiski/hecomi/keymaps/default/keymap.c diff --git a/keyboards/hecomi/keymaps/default/readme.md b/keyboards/takashiski/hecomi/keymaps/default/readme.md similarity index 100% rename from keyboards/hecomi/keymaps/default/readme.md rename to keyboards/takashiski/hecomi/keymaps/default/readme.md diff --git a/keyboards/hecomi/keymaps/kakunpc/config.h b/keyboards/takashiski/hecomi/keymaps/kakunpc/config.h similarity index 100% rename from keyboards/hecomi/keymaps/kakunpc/config.h rename to keyboards/takashiski/hecomi/keymaps/kakunpc/config.h diff --git a/keyboards/hecomi/keymaps/kakunpc/keymap.c b/keyboards/takashiski/hecomi/keymaps/kakunpc/keymap.c similarity index 100% rename from keyboards/hecomi/keymaps/kakunpc/keymap.c rename to keyboards/takashiski/hecomi/keymaps/kakunpc/keymap.c diff --git a/keyboards/hecomi/keymaps/kakunpc/readme.md b/keyboards/takashiski/hecomi/keymaps/kakunpc/readme.md similarity index 100% rename from keyboards/hecomi/keymaps/kakunpc/readme.md rename to keyboards/takashiski/hecomi/keymaps/kakunpc/readme.md diff --git a/keyboards/hecomi/readme.md b/keyboards/takashiski/hecomi/readme.md similarity index 94% rename from keyboards/hecomi/readme.md rename to keyboards/takashiski/hecomi/readme.md index 79a80f35e53f..3d061659d5f1 100644 --- a/keyboards/hecomi/readme.md +++ b/keyboards/takashiski/hecomi/readme.md @@ -12,6 +12,6 @@ Hardware Availability: booth(@skyhigh_works) Make example for this keyboard (after setting up your build environment): - make hecomi/alpha:default + make takashiski/hecomi/alpha: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/hecomi/rules.mk b/keyboards/takashiski/hecomi/rules.mk similarity index 94% rename from keyboards/hecomi/rules.mk rename to keyboards/takashiski/hecomi/rules.mk index b570db0d065e..c46100f19e05 100644 --- a/keyboards/hecomi/rules.mk +++ b/keyboards/takashiski/hecomi/rules.mk @@ -18,4 +18,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD = yes -DEFAULT_FOLDER = hecomi/alpha +DEFAULT_FOLDER = takashiski/hecomi/alpha diff --git a/keyboards/treadstone32/rev1/.noci b/keyboards/takashiski/namecard2x4/.noci similarity index 100% rename from keyboards/treadstone32/rev1/.noci rename to keyboards/takashiski/namecard2x4/.noci diff --git a/keyboards/namecard2x4/info.json b/keyboards/takashiski/namecard2x4/info.json similarity index 100% rename from keyboards/namecard2x4/info.json rename to keyboards/takashiski/namecard2x4/info.json diff --git a/keyboards/namecard2x4/keymaps/brainfuck/config.h b/keyboards/takashiski/namecard2x4/keymaps/brainfuck/config.h similarity index 100% rename from keyboards/namecard2x4/keymaps/brainfuck/config.h rename to keyboards/takashiski/namecard2x4/keymaps/brainfuck/config.h diff --git a/keyboards/namecard2x4/keymaps/brainfuck/keymap.c b/keyboards/takashiski/namecard2x4/keymaps/brainfuck/keymap.c similarity index 100% rename from keyboards/namecard2x4/keymaps/brainfuck/keymap.c rename to keyboards/takashiski/namecard2x4/keymaps/brainfuck/keymap.c diff --git a/keyboards/namecard2x4/keymaps/brainfuck/readme.md b/keyboards/takashiski/namecard2x4/keymaps/brainfuck/readme.md similarity index 100% rename from keyboards/namecard2x4/keymaps/brainfuck/readme.md rename to keyboards/takashiski/namecard2x4/keymaps/brainfuck/readme.md diff --git a/keyboards/namecard2x4/keymaps/default/keymap.c b/keyboards/takashiski/namecard2x4/keymaps/default/keymap.c similarity index 100% rename from keyboards/namecard2x4/keymaps/default/keymap.c rename to keyboards/takashiski/namecard2x4/keymaps/default/keymap.c diff --git a/keyboards/namecard2x4/keymaps/default/readme.md b/keyboards/takashiski/namecard2x4/keymaps/default/readme.md similarity index 100% rename from keyboards/namecard2x4/keymaps/default/readme.md rename to keyboards/takashiski/namecard2x4/keymaps/default/readme.md diff --git a/keyboards/namecard2x4/namecard2x4.c b/keyboards/takashiski/namecard2x4/namecard2x4.c similarity index 100% rename from keyboards/namecard2x4/namecard2x4.c rename to keyboards/takashiski/namecard2x4/namecard2x4.c diff --git a/keyboards/namecard2x4/namecard2x4.h b/keyboards/takashiski/namecard2x4/namecard2x4.h similarity index 100% rename from keyboards/namecard2x4/namecard2x4.h rename to keyboards/takashiski/namecard2x4/namecard2x4.h diff --git a/keyboards/namecard2x4/readme.md b/keyboards/takashiski/namecard2x4/readme.md similarity index 95% rename from keyboards/namecard2x4/readme.md rename to keyboards/takashiski/namecard2x4/readme.md index ec98bc6736c7..165940bceb94 100644 --- a/keyboards/namecard2x4/readme.md +++ b/keyboards/takashiski/namecard2x4/readme.md @@ -18,7 +18,7 @@ Keyboard Maintainer: [takashiski](https://github.com/takashiski) Make example for this keyboard (after setting up your build environment): - make namecard2x4:default + make takashiski/namecard2x4: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/treadstone48/.noci b/keyboards/takashiski/namecard2x4/rev1/.noci similarity index 100% rename from keyboards/treadstone48/.noci rename to keyboards/takashiski/namecard2x4/rev1/.noci diff --git a/keyboards/namecard2x4/rev1/config.h b/keyboards/takashiski/namecard2x4/rev1/config.h similarity index 100% rename from keyboards/namecard2x4/rev1/config.h rename to keyboards/takashiski/namecard2x4/rev1/config.h diff --git a/keyboards/wings42/rev2/rules.mk b/keyboards/takashiski/namecard2x4/rev1/rules.mk similarity index 100% rename from keyboards/wings42/rev2/rules.mk rename to keyboards/takashiski/namecard2x4/rev1/rules.mk diff --git a/keyboards/namecard2x4/rev2/config.h b/keyboards/takashiski/namecard2x4/rev2/config.h similarity index 100% rename from keyboards/namecard2x4/rev2/config.h rename to keyboards/takashiski/namecard2x4/rev2/config.h diff --git a/keyboards/yd60mq/12led/rules.mk b/keyboards/takashiski/namecard2x4/rev2/rules.mk similarity index 100% rename from keyboards/yd60mq/12led/rules.mk rename to keyboards/takashiski/namecard2x4/rev2/rules.mk diff --git a/keyboards/namecard2x4/rules.mk b/keyboards/takashiski/namecard2x4/rules.mk similarity index 93% rename from keyboards/namecard2x4/rules.mk rename to keyboards/takashiski/namecard2x4/rules.mk index b1f04b15ec3c..e0f4e62f042c 100644 --- a/keyboards/namecard2x4/rules.mk +++ b/keyboards/takashiski/namecard2x4/rules.mk @@ -18,4 +18,4 @@ AUDIO_ENABLE = no # Audio output #RGBLIGHT_ENABLE = yes # uncomment if you want addressable led strips -DEFAULT_FOLDER = namecard2x4/rev2 +DEFAULT_FOLDER = takashiski/namecard2x4/rev2 diff --git a/keyboards/treadstone48/rev1/.noci b/keyboards/takashiski/otaku_split/rev0/.noci similarity index 100% rename from keyboards/treadstone48/rev1/.noci rename to keyboards/takashiski/otaku_split/rev0/.noci diff --git a/keyboards/otaku_split/rev0/config.h b/keyboards/takashiski/otaku_split/rev0/config.h similarity index 100% rename from keyboards/otaku_split/rev0/config.h rename to keyboards/takashiski/otaku_split/rev0/config.h diff --git a/keyboards/otaku_split/rev0/info.json b/keyboards/takashiski/otaku_split/rev0/info.json similarity index 100% rename from keyboards/otaku_split/rev0/info.json rename to keyboards/takashiski/otaku_split/rev0/info.json diff --git a/keyboards/otaku_split/rev0/keymaps/default/keymap.c b/keyboards/takashiski/otaku_split/rev0/keymaps/default/keymap.c similarity index 100% rename from keyboards/otaku_split/rev0/keymaps/default/keymap.c rename to keyboards/takashiski/otaku_split/rev0/keymaps/default/keymap.c diff --git a/keyboards/otaku_split/rev0/keymaps/default/readme.md b/keyboards/takashiski/otaku_split/rev0/keymaps/default/readme.md similarity index 100% rename from keyboards/otaku_split/rev0/keymaps/default/readme.md rename to keyboards/takashiski/otaku_split/rev0/keymaps/default/readme.md diff --git a/keyboards/otaku_split/rev0/keymaps/sample/keymap.c b/keyboards/takashiski/otaku_split/rev0/keymaps/sample/keymap.c similarity index 100% rename from keyboards/otaku_split/rev0/keymaps/sample/keymap.c rename to keyboards/takashiski/otaku_split/rev0/keymaps/sample/keymap.c diff --git a/keyboards/otaku_split/rev0/keymaps/sample/readme.md b/keyboards/takashiski/otaku_split/rev0/keymaps/sample/readme.md similarity index 100% rename from keyboards/otaku_split/rev0/keymaps/sample/readme.md rename to keyboards/takashiski/otaku_split/rev0/keymaps/sample/readme.md diff --git a/keyboards/otaku_split/rev0/readme.md b/keyboards/takashiski/otaku_split/rev0/readme.md similarity index 94% rename from keyboards/otaku_split/rev0/readme.md rename to keyboards/takashiski/otaku_split/rev0/readme.md index 9103843d5df8..53efbd85f899 100644 --- a/keyboards/otaku_split/rev0/readme.md +++ b/keyboards/takashiski/otaku_split/rev0/readme.md @@ -11,6 +11,6 @@ Hardware Availability: https://skyhigh-works.booth.pm/items/1365150 Make example for this keyboard (after setting up your build environment): - make otaku_split/rev0:default + make takashiski/otaku_split/rev0: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/otaku_split/rev0/rev0.c b/keyboards/takashiski/otaku_split/rev0/rev0.c similarity index 100% rename from keyboards/otaku_split/rev0/rev0.c rename to keyboards/takashiski/otaku_split/rev0/rev0.c diff --git a/keyboards/otaku_split/rev0/rev0.h b/keyboards/takashiski/otaku_split/rev0/rev0.h similarity index 100% rename from keyboards/otaku_split/rev0/rev0.h rename to keyboards/takashiski/otaku_split/rev0/rev0.h diff --git a/keyboards/otaku_split/rev0/rules.mk b/keyboards/takashiski/otaku_split/rev0/rules.mk similarity index 100% rename from keyboards/otaku_split/rev0/rules.mk rename to keyboards/takashiski/otaku_split/rev0/rules.mk diff --git a/keyboards/otaku_split/rev1/config.h b/keyboards/takashiski/otaku_split/rev1/config.h similarity index 100% rename from keyboards/otaku_split/rev1/config.h rename to keyboards/takashiski/otaku_split/rev1/config.h diff --git a/keyboards/otaku_split/rev1/info.json b/keyboards/takashiski/otaku_split/rev1/info.json similarity index 100% rename from keyboards/otaku_split/rev1/info.json rename to keyboards/takashiski/otaku_split/rev1/info.json diff --git a/keyboards/otaku_split/rev1/keymaps/default/keymap.c b/keyboards/takashiski/otaku_split/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/otaku_split/rev1/keymaps/default/keymap.c rename to keyboards/takashiski/otaku_split/rev1/keymaps/default/keymap.c diff --git a/keyboards/otaku_split/rev1/keymaps/default/readme.md b/keyboards/takashiski/otaku_split/rev1/keymaps/default/readme.md similarity index 100% rename from keyboards/otaku_split/rev1/keymaps/default/readme.md rename to keyboards/takashiski/otaku_split/rev1/keymaps/default/readme.md diff --git a/keyboards/otaku_split/rev1/keymaps/sample/keymap.c b/keyboards/takashiski/otaku_split/rev1/keymaps/sample/keymap.c similarity index 100% rename from keyboards/otaku_split/rev1/keymaps/sample/keymap.c rename to keyboards/takashiski/otaku_split/rev1/keymaps/sample/keymap.c diff --git a/keyboards/otaku_split/rev1/keymaps/sample/readme.md b/keyboards/takashiski/otaku_split/rev1/keymaps/sample/readme.md similarity index 100% rename from keyboards/otaku_split/rev1/keymaps/sample/readme.md rename to keyboards/takashiski/otaku_split/rev1/keymaps/sample/readme.md diff --git a/keyboards/otaku_split/rev1/readme.md b/keyboards/takashiski/otaku_split/rev1/readme.md similarity index 95% rename from keyboards/otaku_split/rev1/readme.md rename to keyboards/takashiski/otaku_split/rev1/readme.md index 592c82641e4b..1c1ff5656aa5 100644 --- a/keyboards/otaku_split/rev1/readme.md +++ b/keyboards/takashiski/otaku_split/rev1/readme.md @@ -14,6 +14,6 @@ Hardware Availability: https://skyhigh-works.booth.pm/items/1398595 Make example for this keyboard (after setting up your build environment): - make otaku_split/rev1:default + make takashiski/otaku_split/rev1: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/otaku_split/rev1/rev1.c b/keyboards/takashiski/otaku_split/rev1/rev1.c similarity index 100% rename from keyboards/otaku_split/rev1/rev1.c rename to keyboards/takashiski/otaku_split/rev1/rev1.c diff --git a/keyboards/otaku_split/rev1/rev1.h b/keyboards/takashiski/otaku_split/rev1/rev1.h similarity index 100% rename from keyboards/otaku_split/rev1/rev1.h rename to keyboards/takashiski/otaku_split/rev1/rev1.h diff --git a/keyboards/otaku_split/rev1/rules.mk b/keyboards/takashiski/otaku_split/rev1/rules.mk similarity index 100% rename from keyboards/otaku_split/rev1/rules.mk rename to keyboards/takashiski/otaku_split/rev1/rules.mk diff --git a/keyboards/telophase/config.h b/keyboards/telophase/config.h index 51718da9d4c1..837bb8ab9b49 100644 --- a/keyboards/telophase/config.h +++ b/keyboards/telophase/config.h @@ -72,12 +72,3 @@ along with this program. If not, see . /* disable these deprecated features by default */ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION - -// UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT_CUSTOM \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); diff --git a/keyboards/telophase/matrix.c b/keyboards/telophase/matrix.c index a153dd4bf140..44b7e4c9e9b3 100644 --- a/keyboards/telophase/matrix.c +++ b/keyboards/telophase/matrix.c @@ -18,10 +18,10 @@ along with this program. If not, see . #include "quantum.h" #include "matrix.h" -#include "protocol/serial.h" +#include "uart.h" void matrix_init_custom(void) { - serial_init(); + uart_init(1000000); } bool matrix_scan_custom(matrix_row_t current_matrix[]) { @@ -29,7 +29,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { bool changed = false; //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; + uart_write('s'); //trust the external keystates entirely, erase the last data uint8_t uart_data[13] = {0}; @@ -39,13 +39,13 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { //wait for the serial data, timeout if it's been too long //this only happened in testing with a loose wire, but does no //harm to leave it in here - while (!SERIAL_UART_RXD_PRESENT) { + while (!uart_available()) { timeout++; if (timeout > 10000) { break; } } - uart_data[i] = SERIAL_UART_DATA; + uart_data[i] = uart_read(); } //check for the end packet, the key state bytes use the LSBs, so 0xE0 diff --git a/keyboards/telophase/rules.mk b/keyboards/telophase/rules.mk index c3a8aaf79f33..41a6ee25f5c8 100644 --- a/keyboards/telophase/rules.mk +++ b/keyboards/telophase/rules.mk @@ -19,7 +19,8 @@ AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = lite # project specific files -SRC += matrix.c serial_uart.c +SRC += matrix.c +QUANTUM_LIB_SRC += uart.c # Disable unsupported hardware RGBLIGHT_SUPPORTED = no diff --git a/keyboards/tempo_turtle/bradpad/info.json b/keyboards/tempo_turtle/bradpad/info.json index d32cc2c665fe..e1caeeeb880a 100644 --- a/keyboards/tempo_turtle/bradpad/info.json +++ b/keyboards/tempo_turtle/bradpad/info.json @@ -10,7 +10,7 @@ "usb":{ "vid":"0x7474", "pid":"0x6270", - "device_ver":"0x0001" + "device_version":"0.0.1" }, "layouts": { "LAYOUT": { diff --git a/keyboards/tgr/jane/v2ce/rules.mk b/keyboards/tgr/jane/v2ce/rules.mk index 0a865321a64e..8fcc8d911f20 100644 --- a/keyboards/tgr/jane/v2ce/rules.mk +++ b/keyboards/tgr/jane/v2ce/rules.mk @@ -2,7 +2,7 @@ MCU = atmega32a # Bootloader selection -BOOTLOADER = bootloadHID +BOOTLOADER = bootloadhid # Build Options # change yes to no to disable diff --git a/keyboards/tokyokeyboard/alix40/rules.mk b/keyboards/tokyokeyboard/alix40/rules.mk index f9e5e2485a3f..358de97c5a3c 100644 --- a/keyboards/tokyokeyboard/alix40/rules.mk +++ b/keyboards/tokyokeyboard/alix40/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/adalyn/adalyn.c b/keyboards/tominabox1/adalyn/adalyn.c similarity index 100% rename from keyboards/adalyn/adalyn.c rename to keyboards/tominabox1/adalyn/adalyn.c diff --git a/keyboards/adalyn/adalyn.h b/keyboards/tominabox1/adalyn/adalyn.h similarity index 100% rename from keyboards/adalyn/adalyn.h rename to keyboards/tominabox1/adalyn/adalyn.h diff --git a/keyboards/adalyn/config.h b/keyboards/tominabox1/adalyn/config.h similarity index 100% rename from keyboards/adalyn/config.h rename to keyboards/tominabox1/adalyn/config.h diff --git a/keyboards/adalyn/info.json b/keyboards/tominabox1/adalyn/info.json similarity index 100% rename from keyboards/adalyn/info.json rename to keyboards/tominabox1/adalyn/info.json diff --git a/keyboards/adalyn/keymaps/default/config.h b/keyboards/tominabox1/adalyn/keymaps/default/config.h similarity index 100% rename from keyboards/adalyn/keymaps/default/config.h rename to keyboards/tominabox1/adalyn/keymaps/default/config.h diff --git a/keyboards/adalyn/keymaps/default/keymap.c b/keyboards/tominabox1/adalyn/keymaps/default/keymap.c similarity index 100% rename from keyboards/adalyn/keymaps/default/keymap.c rename to keyboards/tominabox1/adalyn/keymaps/default/keymap.c diff --git a/keyboards/adalyn/keymaps/default/readme.md b/keyboards/tominabox1/adalyn/keymaps/default/readme.md similarity index 100% rename from keyboards/adalyn/keymaps/default/readme.md rename to keyboards/tominabox1/adalyn/keymaps/default/readme.md diff --git a/keyboards/squiggle/keymaps/rick/rules.mk b/keyboards/tominabox1/adalyn/keymaps/default/rules.mk similarity index 100% rename from keyboards/squiggle/keymaps/rick/rules.mk rename to keyboards/tominabox1/adalyn/keymaps/default/rules.mk diff --git a/keyboards/adalyn/readme.md b/keyboards/tominabox1/adalyn/readme.md similarity index 93% rename from keyboards/adalyn/readme.md rename to keyboards/tominabox1/adalyn/readme.md index ee24bead6113..d6292b5cad19 100644 --- a/keyboards/adalyn/readme.md +++ b/keyboards/tominabox1/adalyn/readme.md @@ -8,9 +8,9 @@ * Hardware Availability: Open source on @tominabox1 GitHub Make example for this keyboard (after setting up your build environment): - make adalyn:default + make tominabox1/adalyn:default Flashing example for this keyboard: - make adalyn:default:flash + make tominabox1/adalyn: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: diff --git a/keyboards/bakeneko65/rev3/rules.mk b/keyboards/tominabox1/adalyn/rules.mk similarity index 89% rename from keyboards/bakeneko65/rev3/rules.mk rename to keyboards/tominabox1/adalyn/rules.mk index 1275531ef6d6..4574cfd83a7b 100644 --- a/keyboards/bakeneko65/rev3/rules.mk +++ b/keyboards/tominabox1/adalyn/rules.mk @@ -12,7 +12,8 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Enable N-Key Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output +COMBO_ENABLE = no diff --git a/keyboards/le_chiffre/config.h b/keyboards/tominabox1/le_chiffre/config.h similarity index 100% rename from keyboards/le_chiffre/config.h rename to keyboards/tominabox1/le_chiffre/config.h diff --git a/keyboards/le_chiffre/info.json b/keyboards/tominabox1/le_chiffre/info.json similarity index 100% rename from keyboards/le_chiffre/info.json rename to keyboards/tominabox1/le_chiffre/info.json diff --git a/keyboards/le_chiffre/keymaps/default/config.h b/keyboards/tominabox1/le_chiffre/keymaps/default/config.h similarity index 100% rename from keyboards/le_chiffre/keymaps/default/config.h rename to keyboards/tominabox1/le_chiffre/keymaps/default/config.h diff --git a/keyboards/le_chiffre/keymaps/default/keymap.c b/keyboards/tominabox1/le_chiffre/keymaps/default/keymap.c similarity index 100% rename from keyboards/le_chiffre/keymaps/default/keymap.c rename to keyboards/tominabox1/le_chiffre/keymaps/default/keymap.c diff --git a/keyboards/le_chiffre/keymaps/default/readme.md b/keyboards/tominabox1/le_chiffre/keymaps/default/readme.md similarity index 100% rename from keyboards/le_chiffre/keymaps/default/readme.md rename to keyboards/tominabox1/le_chiffre/keymaps/default/readme.md diff --git a/keyboards/underscore33/rev1/keymaps/default/rules.mk b/keyboards/tominabox1/le_chiffre/keymaps/default/rules.mk similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default/rules.mk rename to keyboards/tominabox1/le_chiffre/keymaps/default/rules.mk diff --git a/keyboards/le_chiffre/keymaps/via/keymap.c b/keyboards/tominabox1/le_chiffre/keymaps/via/keymap.c similarity index 100% rename from keyboards/le_chiffre/keymaps/via/keymap.c rename to keyboards/tominabox1/le_chiffre/keymaps/via/keymap.c diff --git a/keyboards/pursuit40/keymaps/via/rules.mk b/keyboards/tominabox1/le_chiffre/keymaps/via/rules.mk similarity index 100% rename from keyboards/pursuit40/keymaps/via/rules.mk rename to keyboards/tominabox1/le_chiffre/keymaps/via/rules.mk diff --git a/keyboards/le_chiffre/le_chiffre.c b/keyboards/tominabox1/le_chiffre/le_chiffre.c similarity index 100% rename from keyboards/le_chiffre/le_chiffre.c rename to keyboards/tominabox1/le_chiffre/le_chiffre.c diff --git a/keyboards/le_chiffre/le_chiffre.h b/keyboards/tominabox1/le_chiffre/le_chiffre.h similarity index 100% rename from keyboards/le_chiffre/le_chiffre.h rename to keyboards/tominabox1/le_chiffre/le_chiffre.h diff --git a/keyboards/le_chiffre/readme.md b/keyboards/tominabox1/le_chiffre/readme.md similarity index 96% rename from keyboards/le_chiffre/readme.md rename to keyboards/tominabox1/le_chiffre/readme.md index ead6d88b3e7b..ea18546c615b 100644 --- a/keyboards/le_chiffre/readme.md +++ b/keyboards/tominabox1/le_chiffre/readme.md @@ -10,6 +10,6 @@ Le Chiffre (ironically, "the number" in French is a 30% keyboard designed by tom Make example for this keyboard (after setting up your build environment): - make le_chiffre:default + make tominabox1/le_chiffre: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/le_chiffre/rules.mk b/keyboards/tominabox1/le_chiffre/rules.mk similarity index 100% rename from keyboards/le_chiffre/rules.mk rename to keyboards/tominabox1/le_chiffre/rules.mk diff --git a/keyboards/qaz/config.h b/keyboards/tominabox1/qaz/config.h similarity index 100% rename from keyboards/qaz/config.h rename to keyboards/tominabox1/qaz/config.h diff --git a/keyboards/qaz/info.json b/keyboards/tominabox1/qaz/info.json similarity index 100% rename from keyboards/qaz/info.json rename to keyboards/tominabox1/qaz/info.json diff --git a/keyboards/qaz/keymaps/default/config.h b/keyboards/tominabox1/qaz/keymaps/default/config.h similarity index 100% rename from keyboards/qaz/keymaps/default/config.h rename to keyboards/tominabox1/qaz/keymaps/default/config.h diff --git a/keyboards/qaz/keymaps/default/keymap.c b/keyboards/tominabox1/qaz/keymaps/default/keymap.c similarity index 100% rename from keyboards/qaz/keymaps/default/keymap.c rename to keyboards/tominabox1/qaz/keymaps/default/keymap.c diff --git a/keyboards/qaz/keymaps/default/readme.md b/keyboards/tominabox1/qaz/keymaps/default/readme.md similarity index 100% rename from keyboards/qaz/keymaps/default/readme.md rename to keyboards/tominabox1/qaz/keymaps/default/readme.md diff --git a/keyboards/underscore33/rev1/keymaps/default_big_space/rules.mk b/keyboards/tominabox1/qaz/keymaps/default/rules.mk similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default_big_space/rules.mk rename to keyboards/tominabox1/qaz/keymaps/default/rules.mk diff --git a/keyboards/qaz/keymaps/default_big_space/config.h b/keyboards/tominabox1/qaz/keymaps/default_big_space/config.h similarity index 100% rename from keyboards/qaz/keymaps/default_big_space/config.h rename to keyboards/tominabox1/qaz/keymaps/default_big_space/config.h diff --git a/keyboards/qaz/keymaps/default_big_space/keymap.c b/keyboards/tominabox1/qaz/keymaps/default_big_space/keymap.c similarity index 100% rename from keyboards/qaz/keymaps/default_big_space/keymap.c rename to keyboards/tominabox1/qaz/keymaps/default_big_space/keymap.c diff --git a/keyboards/qaz/keymaps/default_big_space/readme.md b/keyboards/tominabox1/qaz/keymaps/default_big_space/readme.md similarity index 100% rename from keyboards/qaz/keymaps/default_big_space/readme.md rename to keyboards/tominabox1/qaz/keymaps/default_big_space/readme.md diff --git a/keyboards/underscore33/rev2/keymaps/default/rules.mk b/keyboards/tominabox1/qaz/keymaps/default_big_space/rules.mk similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default/rules.mk rename to keyboards/tominabox1/qaz/keymaps/default_big_space/rules.mk diff --git a/keyboards/qaz/keymaps/via/keymap.c b/keyboards/tominabox1/qaz/keymaps/via/keymap.c similarity index 100% rename from keyboards/qaz/keymaps/via/keymap.c rename to keyboards/tominabox1/qaz/keymaps/via/keymap.c diff --git a/keyboards/qaz/keymaps/via/rules.mk b/keyboards/tominabox1/qaz/keymaps/via/rules.mk similarity index 100% rename from keyboards/qaz/keymaps/via/rules.mk rename to keyboards/tominabox1/qaz/keymaps/via/rules.mk diff --git a/keyboards/qaz/qaz.c b/keyboards/tominabox1/qaz/qaz.c similarity index 100% rename from keyboards/qaz/qaz.c rename to keyboards/tominabox1/qaz/qaz.c diff --git a/keyboards/qaz/qaz.h b/keyboards/tominabox1/qaz/qaz.h similarity index 100% rename from keyboards/qaz/qaz.h rename to keyboards/tominabox1/qaz/qaz.h diff --git a/keyboards/qaz/readme.md b/keyboards/tominabox1/qaz/readme.md similarity index 95% rename from keyboards/qaz/readme.md rename to keyboards/tominabox1/qaz/readme.md index 2f1e7fcc9a98..13940e7c253e 100644 --- a/keyboards/qaz/readme.md +++ b/keyboards/tominabox1/qaz/readme.md @@ -10,6 +10,6 @@ Throw it in your fanny pack and hop on your fixed gear and away you go. QAZ is c Make example for this keyboard (after setting up your build environment): - qmk compile -kb qaz -km default + qmk compile -kb tominabox1/qaz -km 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/qaz/rules.mk b/keyboards/tominabox1/qaz/rules.mk similarity index 100% rename from keyboards/qaz/rules.mk rename to keyboards/tominabox1/qaz/rules.mk diff --git a/keyboards/underscore33/.noci b/keyboards/tominabox1/underscore33/.noci similarity index 100% rename from keyboards/underscore33/.noci rename to keyboards/tominabox1/underscore33/.noci diff --git a/keyboards/underscore33/readme.md b/keyboards/tominabox1/underscore33/readme.md similarity index 91% rename from keyboards/underscore33/readme.md rename to keyboards/tominabox1/underscore33/readme.md index 7cc2f9f4110f..273786dce02b 100644 --- a/keyboards/underscore33/readme.md +++ b/keyboards/tominabox1/underscore33/readme.md @@ -10,10 +10,10 @@ A little bitty 30% (10x4) ortholinear keyboard designed by tominabox1. The R1 v Make example for this keyboard (after setting up your build environment): - make underscore33/rev2:default + make tominabox1/underscore33/rev2:default Flashing example for this keyboard: - make underscore33/rev2:default:flash + make tominabox1/underscore33/rev2: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/underscore33/rev1/.noci b/keyboards/tominabox1/underscore33/rev1/.noci similarity index 100% rename from keyboards/underscore33/rev1/.noci rename to keyboards/tominabox1/underscore33/rev1/.noci diff --git a/keyboards/underscore33/rev1/config.h b/keyboards/tominabox1/underscore33/rev1/config.h similarity index 100% rename from keyboards/underscore33/rev1/config.h rename to keyboards/tominabox1/underscore33/rev1/config.h diff --git a/keyboards/underscore33/rev1/info.json b/keyboards/tominabox1/underscore33/rev1/info.json similarity index 100% rename from keyboards/underscore33/rev1/info.json rename to keyboards/tominabox1/underscore33/rev1/info.json diff --git a/keyboards/underscore33/rev1/keymaps/default/config.h b/keyboards/tominabox1/underscore33/rev1/keymaps/default/config.h similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default/config.h rename to keyboards/tominabox1/underscore33/rev1/keymaps/default/config.h diff --git a/keyboards/underscore33/rev1/keymaps/default/keymap.c b/keyboards/tominabox1/underscore33/rev1/keymaps/default/keymap.c similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default/keymap.c rename to keyboards/tominabox1/underscore33/rev1/keymaps/default/keymap.c diff --git a/keyboards/underscore33/rev1/keymaps/default/readme.md b/keyboards/tominabox1/underscore33/rev1/keymaps/default/readme.md similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default/readme.md rename to keyboards/tominabox1/underscore33/rev1/keymaps/default/readme.md diff --git a/keyboards/underscore33/rev2/keymaps/default_big_space/rules.mk b/keyboards/tominabox1/underscore33/rev1/keymaps/default/rules.mk similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default_big_space/rules.mk rename to keyboards/tominabox1/underscore33/rev1/keymaps/default/rules.mk diff --git a/keyboards/underscore33/rev1/keymaps/default_big_space/config.h b/keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/config.h similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default_big_space/config.h rename to keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/config.h diff --git a/keyboards/underscore33/rev1/keymaps/default_big_space/keymap.c b/keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/keymap.c similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default_big_space/keymap.c rename to keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/keymap.c diff --git a/keyboards/underscore33/rev1/keymaps/default_big_space/readme.md b/keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/readme.md similarity index 100% rename from keyboards/underscore33/rev1/keymaps/default_big_space/readme.md rename to keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/readme.md diff --git a/keyboards/wanten/keymaps/2u_bars/rules.mk b/keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/rules.mk similarity index 100% rename from keyboards/wanten/keymaps/2u_bars/rules.mk rename to keyboards/tominabox1/underscore33/rev1/keymaps/default_big_space/rules.mk diff --git a/keyboards/underscore33/rev1/keymaps/via/keymap.c b/keyboards/tominabox1/underscore33/rev1/keymaps/via/keymap.c similarity index 100% rename from keyboards/underscore33/rev1/keymaps/via/keymap.c rename to keyboards/tominabox1/underscore33/rev1/keymaps/via/keymap.c diff --git a/keyboards/underscore33/rev1/keymaps/via/readme.md b/keyboards/tominabox1/underscore33/rev1/keymaps/via/readme.md similarity index 100% rename from keyboards/underscore33/rev1/keymaps/via/readme.md rename to keyboards/tominabox1/underscore33/rev1/keymaps/via/readme.md diff --git a/keyboards/quark/keymaps/via/rules.mk b/keyboards/tominabox1/underscore33/rev1/keymaps/via/rules.mk similarity index 100% rename from keyboards/quark/keymaps/via/rules.mk rename to keyboards/tominabox1/underscore33/rev1/keymaps/via/rules.mk diff --git a/keyboards/underscore33/rev1/rev1.c b/keyboards/tominabox1/underscore33/rev1/rev1.c similarity index 100% rename from keyboards/underscore33/rev1/rev1.c rename to keyboards/tominabox1/underscore33/rev1/rev1.c diff --git a/keyboards/underscore33/rev1/rev1.h b/keyboards/tominabox1/underscore33/rev1/rev1.h similarity index 100% rename from keyboards/underscore33/rev1/rev1.h rename to keyboards/tominabox1/underscore33/rev1/rev1.h diff --git a/keyboards/underscore33/rev1/rules.mk b/keyboards/tominabox1/underscore33/rev1/rules.mk similarity index 100% rename from keyboards/underscore33/rev1/rules.mk rename to keyboards/tominabox1/underscore33/rev1/rules.mk diff --git a/keyboards/underscore33/rev2/config.h b/keyboards/tominabox1/underscore33/rev2/config.h similarity index 100% rename from keyboards/underscore33/rev2/config.h rename to keyboards/tominabox1/underscore33/rev2/config.h diff --git a/keyboards/underscore33/rev2/info.json b/keyboards/tominabox1/underscore33/rev2/info.json similarity index 100% rename from keyboards/underscore33/rev2/info.json rename to keyboards/tominabox1/underscore33/rev2/info.json diff --git a/keyboards/underscore33/rev2/keymaps/default/config.h b/keyboards/tominabox1/underscore33/rev2/keymaps/default/config.h similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default/config.h rename to keyboards/tominabox1/underscore33/rev2/keymaps/default/config.h diff --git a/keyboards/underscore33/rev2/keymaps/default/keymap.c b/keyboards/tominabox1/underscore33/rev2/keymaps/default/keymap.c similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default/keymap.c rename to keyboards/tominabox1/underscore33/rev2/keymaps/default/keymap.c diff --git a/keyboards/underscore33/rev2/keymaps/default/readme.md b/keyboards/tominabox1/underscore33/rev2/keymaps/default/readme.md similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default/readme.md rename to keyboards/tominabox1/underscore33/rev2/keymaps/default/readme.md diff --git a/keyboards/wanten/keymaps/625_bar/rules.mk b/keyboards/tominabox1/underscore33/rev2/keymaps/default/rules.mk similarity index 100% rename from keyboards/wanten/keymaps/625_bar/rules.mk rename to keyboards/tominabox1/underscore33/rev2/keymaps/default/rules.mk diff --git a/keyboards/underscore33/rev2/keymaps/default_big_space/config.h b/keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/config.h similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default_big_space/config.h rename to keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/config.h diff --git a/keyboards/underscore33/rev2/keymaps/default_big_space/keymap.c b/keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/keymap.c similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default_big_space/keymap.c rename to keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/keymap.c diff --git a/keyboards/underscore33/rev2/keymaps/default_big_space/readme.md b/keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/readme.md similarity index 100% rename from keyboards/underscore33/rev2/keymaps/default_big_space/readme.md rename to keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/readme.md diff --git a/keyboards/wanten/keymaps/default/rules.mk b/keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/rules.mk similarity index 100% rename from keyboards/wanten/keymaps/default/rules.mk rename to keyboards/tominabox1/underscore33/rev2/keymaps/default_big_space/rules.mk diff --git a/keyboards/underscore33/rev2/keymaps/via/keymap.c b/keyboards/tominabox1/underscore33/rev2/keymaps/via/keymap.c similarity index 100% rename from keyboards/underscore33/rev2/keymaps/via/keymap.c rename to keyboards/tominabox1/underscore33/rev2/keymaps/via/keymap.c diff --git a/keyboards/underscore33/rev2/keymaps/via/readme.md b/keyboards/tominabox1/underscore33/rev2/keymaps/via/readme.md similarity index 100% rename from keyboards/underscore33/rev2/keymaps/via/readme.md rename to keyboards/tominabox1/underscore33/rev2/keymaps/via/readme.md diff --git a/keyboards/underscore33/rev2/keymaps/via/rules.mk b/keyboards/tominabox1/underscore33/rev2/keymaps/via/rules.mk similarity index 100% rename from keyboards/underscore33/rev2/keymaps/via/rules.mk rename to keyboards/tominabox1/underscore33/rev2/keymaps/via/rules.mk diff --git a/keyboards/underscore33/rev2/rev2.c b/keyboards/tominabox1/underscore33/rev2/rev2.c similarity index 100% rename from keyboards/underscore33/rev2/rev2.c rename to keyboards/tominabox1/underscore33/rev2/rev2.c diff --git a/keyboards/underscore33/rev2/rev2.h b/keyboards/tominabox1/underscore33/rev2/rev2.h similarity index 100% rename from keyboards/underscore33/rev2/rev2.h rename to keyboards/tominabox1/underscore33/rev2/rev2.h diff --git a/keyboards/underscore33/rev2/rules.mk b/keyboards/tominabox1/underscore33/rev2/rules.mk similarity index 100% rename from keyboards/underscore33/rev2/rules.mk rename to keyboards/tominabox1/underscore33/rev2/rules.mk diff --git a/keyboards/tominabox1/underscore33/rules.mk b/keyboards/tominabox1/underscore33/rules.mk new file mode 100644 index 000000000000..b5e13fd4208d --- /dev/null +++ b/keyboards/tominabox1/underscore33/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = tominabox1/underscore33/rev1 diff --git a/keyboards/underscore33/rules.mk b/keyboards/underscore33/rules.mk deleted file mode 100644 index b86f18e114fa..000000000000 --- a/keyboards/underscore33/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = underscore33/rev1 diff --git a/keyboards/diverge3/config.h b/keyboards/unikeyboard/diverge3/config.h similarity index 100% rename from keyboards/diverge3/config.h rename to keyboards/unikeyboard/diverge3/config.h diff --git a/keyboards/diverge3/diverge3.c b/keyboards/unikeyboard/diverge3/diverge3.c similarity index 100% rename from keyboards/diverge3/diverge3.c rename to keyboards/unikeyboard/diverge3/diverge3.c diff --git a/keyboards/diverge3/diverge3.h b/keyboards/unikeyboard/diverge3/diverge3.h similarity index 100% rename from keyboards/diverge3/diverge3.h rename to keyboards/unikeyboard/diverge3/diverge3.h diff --git a/keyboards/diverge3/info.json b/keyboards/unikeyboard/diverge3/info.json similarity index 100% rename from keyboards/diverge3/info.json rename to keyboards/unikeyboard/diverge3/info.json diff --git a/keyboards/diverge3/keymaps/default/config.h b/keyboards/unikeyboard/diverge3/keymaps/default/config.h similarity index 100% rename from keyboards/diverge3/keymaps/default/config.h rename to keyboards/unikeyboard/diverge3/keymaps/default/config.h diff --git a/keyboards/diverge3/keymaps/default/keymap.c b/keyboards/unikeyboard/diverge3/keymaps/default/keymap.c similarity index 100% rename from keyboards/diverge3/keymaps/default/keymap.c rename to keyboards/unikeyboard/diverge3/keymaps/default/keymap.c diff --git a/keyboards/diverge3/keymaps/default/readme.md b/keyboards/unikeyboard/diverge3/keymaps/default/readme.md similarity index 100% rename from keyboards/diverge3/keymaps/default/readme.md rename to keyboards/unikeyboard/diverge3/keymaps/default/readme.md diff --git a/keyboards/naked64/keymaps/salicylic/rules.mk b/keyboards/unikeyboard/diverge3/keymaps/default/rules.mk similarity index 100% rename from keyboards/naked64/keymaps/salicylic/rules.mk rename to keyboards/unikeyboard/diverge3/keymaps/default/rules.mk diff --git a/keyboards/diverge3/keymaps/iso_uk/config.h b/keyboards/unikeyboard/diverge3/keymaps/iso_uk/config.h similarity index 100% rename from keyboards/diverge3/keymaps/iso_uk/config.h rename to keyboards/unikeyboard/diverge3/keymaps/iso_uk/config.h diff --git a/keyboards/diverge3/keymaps/iso_uk/keymap.c b/keyboards/unikeyboard/diverge3/keymaps/iso_uk/keymap.c similarity index 100% rename from keyboards/diverge3/keymaps/iso_uk/keymap.c rename to keyboards/unikeyboard/diverge3/keymaps/iso_uk/keymap.c diff --git a/keyboards/diverge3/keymaps/iso_uk/readme.md b/keyboards/unikeyboard/diverge3/keymaps/iso_uk/readme.md similarity index 100% rename from keyboards/diverge3/keymaps/iso_uk/readme.md rename to keyboards/unikeyboard/diverge3/keymaps/iso_uk/readme.md diff --git a/keyboards/diverge3/keymaps/iso_uk/rules.mk b/keyboards/unikeyboard/diverge3/keymaps/iso_uk/rules.mk similarity index 100% rename from keyboards/diverge3/keymaps/iso_uk/rules.mk rename to keyboards/unikeyboard/diverge3/keymaps/iso_uk/rules.mk diff --git a/keyboards/diverge3/keymaps/workman/config.h b/keyboards/unikeyboard/diverge3/keymaps/workman/config.h similarity index 100% rename from keyboards/diverge3/keymaps/workman/config.h rename to keyboards/unikeyboard/diverge3/keymaps/workman/config.h diff --git a/keyboards/diverge3/keymaps/workman/keymap.c b/keyboards/unikeyboard/diverge3/keymaps/workman/keymap.c similarity index 100% rename from keyboards/diverge3/keymaps/workman/keymap.c rename to keyboards/unikeyboard/diverge3/keymaps/workman/keymap.c diff --git a/keyboards/diverge3/keymaps/workman/readme.md b/keyboards/unikeyboard/diverge3/keymaps/workman/readme.md similarity index 100% rename from keyboards/diverge3/keymaps/workman/readme.md rename to keyboards/unikeyboard/diverge3/keymaps/workman/readme.md diff --git a/keyboards/nk65/v1_4/rules.mk b/keyboards/unikeyboard/diverge3/keymaps/workman/rules.mk old mode 100755 new mode 100644 similarity index 100% rename from keyboards/nk65/v1_4/rules.mk rename to keyboards/unikeyboard/diverge3/keymaps/workman/rules.mk diff --git a/keyboards/diverge3/readme.md b/keyboards/unikeyboard/diverge3/readme.md similarity index 90% rename from keyboards/diverge3/readme.md rename to keyboards/unikeyboard/diverge3/readme.md index 45ddaa64cfd0..6e4cf3d78187 100644 --- a/keyboards/diverge3/readme.md +++ b/keyboards/unikeyboard/diverge3/readme.md @@ -8,13 +8,13 @@ Hardware Availability: [Diverge 3](https://unikeyboard.io/product/diverge/) Make example for this keyboard (after setting up your build environment): - make diverge3:default + make unikeyboard/diverge3:default Or for the [Workman](https://github.com/ojbucao/workman) layout: - make diverge3:workman + make unikeyboard/diverge3:workman See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. # Reflashing Animus -Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST pins) during the upload step. Then reapply your keymap through Arbites. \ No newline at end of file +Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST pins) during the upload step. Then reapply your keymap through Arbites. diff --git a/keyboards/diverge3/rules.mk b/keyboards/unikeyboard/diverge3/rules.mk similarity index 100% rename from keyboards/diverge3/rules.mk rename to keyboards/unikeyboard/diverge3/rules.mk diff --git a/keyboards/divergetm2/config.h b/keyboards/unikeyboard/divergetm2/config.h similarity index 100% rename from keyboards/divergetm2/config.h rename to keyboards/unikeyboard/divergetm2/config.h diff --git a/keyboards/divergetm2/divergetm2.c b/keyboards/unikeyboard/divergetm2/divergetm2.c similarity index 100% rename from keyboards/divergetm2/divergetm2.c rename to keyboards/unikeyboard/divergetm2/divergetm2.c diff --git a/keyboards/divergetm2/divergetm2.h b/keyboards/unikeyboard/divergetm2/divergetm2.h similarity index 100% rename from keyboards/divergetm2/divergetm2.h rename to keyboards/unikeyboard/divergetm2/divergetm2.h diff --git a/keyboards/divergetm2/info.json b/keyboards/unikeyboard/divergetm2/info.json similarity index 100% rename from keyboards/divergetm2/info.json rename to keyboards/unikeyboard/divergetm2/info.json diff --git a/keyboards/divergetm2/keymaps/default/config.h b/keyboards/unikeyboard/divergetm2/keymaps/default/config.h similarity index 100% rename from keyboards/divergetm2/keymaps/default/config.h rename to keyboards/unikeyboard/divergetm2/keymaps/default/config.h diff --git a/keyboards/divergetm2/keymaps/default/keymap.c b/keyboards/unikeyboard/divergetm2/keymaps/default/keymap.c similarity index 100% rename from keyboards/divergetm2/keymaps/default/keymap.c rename to keyboards/unikeyboard/divergetm2/keymaps/default/keymap.c diff --git a/keyboards/divergetm2/keymaps/default/readme.md b/keyboards/unikeyboard/divergetm2/keymaps/default/readme.md similarity index 100% rename from keyboards/divergetm2/keymaps/default/readme.md rename to keyboards/unikeyboard/divergetm2/keymaps/default/readme.md diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/config.h b/keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/config.h similarity index 100% rename from keyboards/divergetm2/keymaps/xtonhasvim/config.h rename to keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/config.h diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c b/keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/keymap.c similarity index 100% rename from keyboards/divergetm2/keymaps/xtonhasvim/keymap.c rename to keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/keymap.c diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/readme.md b/keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/readme.md similarity index 100% rename from keyboards/niu_mini/keymaps/xtonhasvim/readme.md rename to keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/readme.md diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk b/keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/rules.mk similarity index 100% rename from keyboards/divergetm2/keymaps/xtonhasvim/rules.mk rename to keyboards/unikeyboard/divergetm2/keymaps/xtonhasvim/rules.mk diff --git a/keyboards/divergetm2/readme.md b/keyboards/unikeyboard/divergetm2/readme.md similarity index 96% rename from keyboards/divergetm2/readme.md rename to keyboards/unikeyboard/divergetm2/readme.md index 893b82cb5cd0..5bff74389f92 100644 --- a/keyboards/divergetm2/readme.md +++ b/keyboards/unikeyboard/divergetm2/readme.md @@ -8,7 +8,7 @@ Hardware Availability: [Diverge TM2](https://unikeyboard.io/product/diverge-tm/) Make example for this keyboard (after setting up your build environment): - make divergetm2:default + make unikeyboard/divergetm2: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/divergetm2/rules.mk b/keyboards/unikeyboard/divergetm2/rules.mk similarity index 100% rename from keyboards/divergetm2/rules.mk rename to keyboards/unikeyboard/divergetm2/rules.mk diff --git a/keyboards/felix/config.h b/keyboards/unikeyboard/felix/config.h similarity index 100% rename from keyboards/felix/config.h rename to keyboards/unikeyboard/felix/config.h diff --git a/keyboards/felix/felix.c b/keyboards/unikeyboard/felix/felix.c similarity index 100% rename from keyboards/felix/felix.c rename to keyboards/unikeyboard/felix/felix.c diff --git a/keyboards/felix/felix.h b/keyboards/unikeyboard/felix/felix.h similarity index 100% rename from keyboards/felix/felix.h rename to keyboards/unikeyboard/felix/felix.h diff --git a/keyboards/felix/info.json b/keyboards/unikeyboard/felix/info.json similarity index 100% rename from keyboards/felix/info.json rename to keyboards/unikeyboard/felix/info.json diff --git a/keyboards/felix/keymaps/default/keymap.c b/keyboards/unikeyboard/felix/keymaps/default/keymap.c similarity index 100% rename from keyboards/felix/keymaps/default/keymap.c rename to keyboards/unikeyboard/felix/keymaps/default/keymap.c diff --git a/keyboards/felix/readme.md b/keyboards/unikeyboard/felix/readme.md similarity index 94% rename from keyboards/felix/readme.md rename to keyboards/unikeyboard/felix/readme.md index 0a3fe10a6ec2..2ea41d382f90 100644 --- a/keyboards/felix/readme.md +++ b/keyboards/unikeyboard/felix/readme.md @@ -8,6 +8,6 @@ Hardware Availability: [Unikeyboard](https://unikeyboard.io/product/felix/) Make example for this keyboard (after setting up your build environment): - make felix:default + make unikeyboard/felix: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/felix/rules.mk b/keyboards/unikeyboard/felix/rules.mk similarity index 100% rename from keyboards/felix/rules.mk rename to keyboards/unikeyboard/felix/rules.mk diff --git a/keyboards/viktus/smolka/rules.mk b/keyboards/viktus/smolka/rules.mk index 04821bd6e78c..5f58c5684bfc 100644 --- a/keyboards/viktus/smolka/rules.mk +++ b/keyboards/viktus/smolka/rules.mk @@ -12,8 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/viktus/sp111/rules.mk b/keyboards/viktus/sp111/rules.mk index b779ef4cb2af..fab90d4a881f 100644 --- a/keyboards/viktus/sp111/rules.mk +++ b/keyboards/viktus/sp111/rules.mk @@ -22,5 +22,6 @@ LTO_ENABLE = yes # Smaller (and slightly faster) firmware # custom matrix setup CUSTOM_MATRIX = lite +VPATH += drivers/gpio SRC += mcp23018.c matrix.c QUANTUM_LIB_SRC += i2c_master.c diff --git a/keyboards/geminate60/chconf.h b/keyboards/weirdo/geminate60/chconf.h similarity index 100% rename from keyboards/geminate60/chconf.h rename to keyboards/weirdo/geminate60/chconf.h diff --git a/keyboards/geminate60/config.h b/keyboards/weirdo/geminate60/config.h similarity index 100% rename from keyboards/geminate60/config.h rename to keyboards/weirdo/geminate60/config.h diff --git a/keyboards/geminate60/geminate60.c b/keyboards/weirdo/geminate60/geminate60.c similarity index 100% rename from keyboards/geminate60/geminate60.c rename to keyboards/weirdo/geminate60/geminate60.c diff --git a/keyboards/geminate60/geminate60.h b/keyboards/weirdo/geminate60/geminate60.h similarity index 100% rename from keyboards/geminate60/geminate60.h rename to keyboards/weirdo/geminate60/geminate60.h diff --git a/keyboards/geminate60/info.json b/keyboards/weirdo/geminate60/info.json similarity index 100% rename from keyboards/geminate60/info.json rename to keyboards/weirdo/geminate60/info.json diff --git a/keyboards/geminate60/keymaps/default/keymap.c b/keyboards/weirdo/geminate60/keymaps/default/keymap.c similarity index 100% rename from keyboards/geminate60/keymaps/default/keymap.c rename to keyboards/weirdo/geminate60/keymaps/default/keymap.c diff --git a/keyboards/geminate60/keymaps/via/keymap.c b/keyboards/weirdo/geminate60/keymaps/via/keymap.c similarity index 100% rename from keyboards/geminate60/keymaps/via/keymap.c rename to keyboards/weirdo/geminate60/keymaps/via/keymap.c diff --git a/keyboards/rabbit_capture_plan/keymaps/via/rules.mk b/keyboards/weirdo/geminate60/keymaps/via/rules.mk similarity index 100% rename from keyboards/rabbit_capture_plan/keymaps/via/rules.mk rename to keyboards/weirdo/geminate60/keymaps/via/rules.mk diff --git a/keyboards/geminate60/readme.md b/keyboards/weirdo/geminate60/readme.md similarity index 95% rename from keyboards/geminate60/readme.md rename to keyboards/weirdo/geminate60/readme.md index 7fab7d7df6a8..ca865c8cff8b 100644 --- a/keyboards/geminate60/readme.md +++ b/keyboards/weirdo/geminate60/readme.md @@ -10,7 +10,7 @@ A 60% keyboard based on STM32F303. Make example for this keyboard (after setting up your build environment): - make geminate60:default + make weirdo/geminate60:default The RST pin and GND pin on the board can be quickly shortened twice to enter DFU mode, and then the program can be written. 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/geminate60/rules.mk b/keyboards/weirdo/geminate60/rules.mk similarity index 100% rename from keyboards/geminate60/rules.mk rename to keyboards/weirdo/geminate60/rules.mk diff --git a/keyboards/kelowna/rgb64/config.h b/keyboards/weirdo/kelowna/rgb64/config.h similarity index 100% rename from keyboards/kelowna/rgb64/config.h rename to keyboards/weirdo/kelowna/rgb64/config.h diff --git a/keyboards/kelowna/rgb64/info.json b/keyboards/weirdo/kelowna/rgb64/info.json similarity index 100% rename from keyboards/kelowna/rgb64/info.json rename to keyboards/weirdo/kelowna/rgb64/info.json diff --git a/keyboards/kelowna/rgb64/keymaps/default/keymap.c b/keyboards/weirdo/kelowna/rgb64/keymaps/default/keymap.c similarity index 100% rename from keyboards/kelowna/rgb64/keymaps/default/keymap.c rename to keyboards/weirdo/kelowna/rgb64/keymaps/default/keymap.c diff --git a/keyboards/kelowna/rgb64/keymaps/via/keymap.c b/keyboards/weirdo/kelowna/rgb64/keymaps/via/keymap.c similarity index 100% rename from keyboards/kelowna/rgb64/keymaps/via/keymap.c rename to keyboards/weirdo/kelowna/rgb64/keymaps/via/keymap.c diff --git a/keyboards/reviung53/keymaps/via/rules.mk b/keyboards/weirdo/kelowna/rgb64/keymaps/via/rules.mk similarity index 100% rename from keyboards/reviung53/keymaps/via/rules.mk rename to keyboards/weirdo/kelowna/rgb64/keymaps/via/rules.mk diff --git a/keyboards/kelowna/rgb64/readme.md b/keyboards/weirdo/kelowna/rgb64/readme.md similarity index 95% rename from keyboards/kelowna/rgb64/readme.md rename to keyboards/weirdo/kelowna/rgb64/readme.md index 9300b8281981..f12e155c8a9c 100644 --- a/keyboards/kelowna/rgb64/readme.md +++ b/keyboards/weirdo/kelowna/rgb64/readme.md @@ -10,7 +10,7 @@ A 60% keyboard based on STM32f303 Make example for this keyboard (after setting up your build environment): - make kelowna/rgb64:default + make weirdo/kelowna/rgb64:default Use the SWD interface on the board to connect to the STlink (JLink) to directly burn firmware without entering the bootloader. diff --git a/keyboards/kelowna/rgb64/rgb64.c b/keyboards/weirdo/kelowna/rgb64/rgb64.c similarity index 100% rename from keyboards/kelowna/rgb64/rgb64.c rename to keyboards/weirdo/kelowna/rgb64/rgb64.c diff --git a/keyboards/kelowna/rgb64/rgb64.h b/keyboards/weirdo/kelowna/rgb64/rgb64.h similarity index 100% rename from keyboards/kelowna/rgb64/rgb64.h rename to keyboards/weirdo/kelowna/rgb64/rgb64.h diff --git a/keyboards/kelowna/rgb64/rules.mk b/keyboards/weirdo/kelowna/rgb64/rules.mk similarity index 100% rename from keyboards/kelowna/rgb64/rules.mk rename to keyboards/weirdo/kelowna/rgb64/rules.mk diff --git a/keyboards/ls_60/chconf.h b/keyboards/weirdo/ls_60/chconf.h similarity index 100% rename from keyboards/ls_60/chconf.h rename to keyboards/weirdo/ls_60/chconf.h diff --git a/keyboards/ls_60/config.h b/keyboards/weirdo/ls_60/config.h similarity index 100% rename from keyboards/ls_60/config.h rename to keyboards/weirdo/ls_60/config.h diff --git a/keyboards/ls_60/info.json b/keyboards/weirdo/ls_60/info.json similarity index 100% rename from keyboards/ls_60/info.json rename to keyboards/weirdo/ls_60/info.json diff --git a/keyboards/ls_60/keymaps/default/keymap.c b/keyboards/weirdo/ls_60/keymaps/default/keymap.c similarity index 100% rename from keyboards/ls_60/keymaps/default/keymap.c rename to keyboards/weirdo/ls_60/keymaps/default/keymap.c diff --git a/keyboards/ls_60/keymaps/via/keymap.c b/keyboards/weirdo/ls_60/keymaps/via/keymap.c similarity index 100% rename from keyboards/ls_60/keymaps/via/keymap.c rename to keyboards/weirdo/ls_60/keymaps/via/keymap.c diff --git a/keyboards/runner3680/5x6_5x8/keymaps/via/rules.mk b/keyboards/weirdo/ls_60/keymaps/via/rules.mk similarity index 100% rename from keyboards/runner3680/5x6_5x8/keymaps/via/rules.mk rename to keyboards/weirdo/ls_60/keymaps/via/rules.mk diff --git a/keyboards/ls_60/ls_60.c b/keyboards/weirdo/ls_60/ls_60.c similarity index 100% rename from keyboards/ls_60/ls_60.c rename to keyboards/weirdo/ls_60/ls_60.c diff --git a/keyboards/ls_60/ls_60.h b/keyboards/weirdo/ls_60/ls_60.h similarity index 100% rename from keyboards/ls_60/ls_60.h rename to keyboards/weirdo/ls_60/ls_60.h diff --git a/keyboards/ls_60/readme.md b/keyboards/weirdo/ls_60/readme.md similarity index 95% rename from keyboards/ls_60/readme.md rename to keyboards/weirdo/ls_60/readme.md index e0efdfd9b500..cb289b8ad67a 100644 --- a/keyboards/ls_60/readme.md +++ b/keyboards/weirdo/ls_60/readme.md @@ -10,7 +10,7 @@ A 60% keyboard based on STM32f303 Make example for this keyboard (after setting up your build environment): - make ls_60:default + make weirdo/ls_60:default The RST pin and GND pin on the board can be quickly shortened twice to enter DFU mode, and then the program can be written. diff --git a/keyboards/ls_60/rules.mk b/keyboards/weirdo/ls_60/rules.mk similarity index 100% rename from keyboards/ls_60/rules.mk rename to keyboards/weirdo/ls_60/rules.mk diff --git a/keyboards/naiping/np64/chconf.h b/keyboards/weirdo/naiping/np64/chconf.h similarity index 100% rename from keyboards/naiping/np64/chconf.h rename to keyboards/weirdo/naiping/np64/chconf.h diff --git a/keyboards/naiping/np64/config.h b/keyboards/weirdo/naiping/np64/config.h similarity index 100% rename from keyboards/naiping/np64/config.h rename to keyboards/weirdo/naiping/np64/config.h diff --git a/keyboards/naiping/np64/info.json b/keyboards/weirdo/naiping/np64/info.json similarity index 100% rename from keyboards/naiping/np64/info.json rename to keyboards/weirdo/naiping/np64/info.json diff --git a/keyboards/naiping/np64/keymaps/default/keymap.c b/keyboards/weirdo/naiping/np64/keymaps/default/keymap.c similarity index 100% rename from keyboards/naiping/np64/keymaps/default/keymap.c rename to keyboards/weirdo/naiping/np64/keymaps/default/keymap.c diff --git a/keyboards/naiping/np64/keymaps/via/keymap.c b/keyboards/weirdo/naiping/np64/keymaps/via/keymap.c similarity index 100% rename from keyboards/naiping/np64/keymaps/via/keymap.c rename to keyboards/weirdo/naiping/np64/keymaps/via/keymap.c diff --git a/keyboards/seigaiha/keymaps/via/rules.mk b/keyboards/weirdo/naiping/np64/keymaps/via/rules.mk similarity index 100% rename from keyboards/seigaiha/keymaps/via/rules.mk rename to keyboards/weirdo/naiping/np64/keymaps/via/rules.mk diff --git a/keyboards/naiping/np64/np64.c b/keyboards/weirdo/naiping/np64/np64.c similarity index 100% rename from keyboards/naiping/np64/np64.c rename to keyboards/weirdo/naiping/np64/np64.c diff --git a/keyboards/naiping/np64/np64.h b/keyboards/weirdo/naiping/np64/np64.h similarity index 100% rename from keyboards/naiping/np64/np64.h rename to keyboards/weirdo/naiping/np64/np64.h diff --git a/keyboards/naiping/np64/readme.md b/keyboards/weirdo/naiping/np64/readme.md similarity index 95% rename from keyboards/naiping/np64/readme.md rename to keyboards/weirdo/naiping/np64/readme.md index 8e85d79de3ab..a5b4c89f010c 100644 --- a/keyboards/naiping/np64/readme.md +++ b/keyboards/weirdo/naiping/np64/readme.md @@ -10,7 +10,7 @@ A 60% keyboard based on STM32f303 Make example for this keyboard (after setting up your build environment): - make naiping/np64:default + make weirdo/naiping/np64:default The RST pin and GND pin on the board can be quickly shortened twice to enter DFU mode, and then the program can be written. diff --git a/keyboards/naiping/np64/rules.mk b/keyboards/weirdo/naiping/np64/rules.mk similarity index 100% rename from keyboards/naiping/np64/rules.mk rename to keyboards/weirdo/naiping/np64/rules.mk diff --git a/keyboards/naiping/nphhkb/chconf.h b/keyboards/weirdo/naiping/nphhkb/chconf.h similarity index 100% rename from keyboards/naiping/nphhkb/chconf.h rename to keyboards/weirdo/naiping/nphhkb/chconf.h diff --git a/keyboards/naiping/nphhkb/config.h b/keyboards/weirdo/naiping/nphhkb/config.h similarity index 100% rename from keyboards/naiping/nphhkb/config.h rename to keyboards/weirdo/naiping/nphhkb/config.h diff --git a/keyboards/naiping/nphhkb/info.json b/keyboards/weirdo/naiping/nphhkb/info.json similarity index 100% rename from keyboards/naiping/nphhkb/info.json rename to keyboards/weirdo/naiping/nphhkb/info.json diff --git a/keyboards/naiping/nphhkb/keymaps/default/keymap.c b/keyboards/weirdo/naiping/nphhkb/keymaps/default/keymap.c similarity index 100% rename from keyboards/naiping/nphhkb/keymaps/default/keymap.c rename to keyboards/weirdo/naiping/nphhkb/keymaps/default/keymap.c diff --git a/keyboards/naiping/nphhkb/keymaps/via/keymap.c b/keyboards/weirdo/naiping/nphhkb/keymaps/via/keymap.c similarity index 100% rename from keyboards/naiping/nphhkb/keymaps/via/keymap.c rename to keyboards/weirdo/naiping/nphhkb/keymaps/via/keymap.c diff --git a/keyboards/txuu/keymaps/via/rules.mk b/keyboards/weirdo/naiping/nphhkb/keymaps/via/rules.mk similarity index 100% rename from keyboards/txuu/keymaps/via/rules.mk rename to keyboards/weirdo/naiping/nphhkb/keymaps/via/rules.mk diff --git a/keyboards/naiping/nphhkb/nphhkb.c b/keyboards/weirdo/naiping/nphhkb/nphhkb.c similarity index 100% rename from keyboards/naiping/nphhkb/nphhkb.c rename to keyboards/weirdo/naiping/nphhkb/nphhkb.c diff --git a/keyboards/naiping/nphhkb/nphhkb.h b/keyboards/weirdo/naiping/nphhkb/nphhkb.h similarity index 100% rename from keyboards/naiping/nphhkb/nphhkb.h rename to keyboards/weirdo/naiping/nphhkb/nphhkb.h diff --git a/keyboards/naiping/nphhkb/readme.md b/keyboards/weirdo/naiping/nphhkb/readme.md similarity index 94% rename from keyboards/naiping/nphhkb/readme.md rename to keyboards/weirdo/naiping/nphhkb/readme.md index 47ad9dafc338..1ed6d46effed 100644 --- a/keyboards/naiping/nphhkb/readme.md +++ b/keyboards/weirdo/naiping/nphhkb/readme.md @@ -10,7 +10,7 @@ A 60% keyboard based on STM32f303 Make example for this keyboard (after setting up your build environment): - make naiping/nphhkb:default + make weirdo/naiping/nphhkb:default The RST pin and GND pin on the board can be quickly shortened twice to enter DFU mode, and then the program can be written. diff --git a/keyboards/naiping/nphhkb/rules.mk b/keyboards/weirdo/naiping/nphhkb/rules.mk similarity index 100% rename from keyboards/naiping/nphhkb/rules.mk rename to keyboards/weirdo/naiping/nphhkb/rules.mk diff --git a/keyboards/naiping/npminila/chconf.h b/keyboards/weirdo/naiping/npminila/chconf.h similarity index 100% rename from keyboards/naiping/npminila/chconf.h rename to keyboards/weirdo/naiping/npminila/chconf.h diff --git a/keyboards/naiping/npminila/config.h b/keyboards/weirdo/naiping/npminila/config.h similarity index 100% rename from keyboards/naiping/npminila/config.h rename to keyboards/weirdo/naiping/npminila/config.h diff --git a/keyboards/naiping/npminila/info.json b/keyboards/weirdo/naiping/npminila/info.json similarity index 100% rename from keyboards/naiping/npminila/info.json rename to keyboards/weirdo/naiping/npminila/info.json diff --git a/keyboards/naiping/npminila/keymaps/default/keymap.c b/keyboards/weirdo/naiping/npminila/keymaps/default/keymap.c similarity index 100% rename from keyboards/naiping/npminila/keymaps/default/keymap.c rename to keyboards/weirdo/naiping/npminila/keymaps/default/keymap.c diff --git a/keyboards/naiping/npminila/keymaps/via/keymap.c b/keyboards/weirdo/naiping/npminila/keymaps/via/keymap.c similarity index 100% rename from keyboards/naiping/npminila/keymaps/via/keymap.c rename to keyboards/weirdo/naiping/npminila/keymaps/via/keymap.c diff --git a/keyboards/underscore33/rev1/keymaps/via/rules.mk b/keyboards/weirdo/naiping/npminila/keymaps/via/rules.mk similarity index 100% rename from keyboards/underscore33/rev1/keymaps/via/rules.mk rename to keyboards/weirdo/naiping/npminila/keymaps/via/rules.mk diff --git a/keyboards/naiping/npminila/npminila.c b/keyboards/weirdo/naiping/npminila/npminila.c similarity index 100% rename from keyboards/naiping/npminila/npminila.c rename to keyboards/weirdo/naiping/npminila/npminila.c diff --git a/keyboards/naiping/npminila/npminila.h b/keyboards/weirdo/naiping/npminila/npminila.h similarity index 100% rename from keyboards/naiping/npminila/npminila.h rename to keyboards/weirdo/naiping/npminila/npminila.h diff --git a/keyboards/naiping/npminila/readme.md b/keyboards/weirdo/naiping/npminila/readme.md similarity index 94% rename from keyboards/naiping/npminila/readme.md rename to keyboards/weirdo/naiping/npminila/readme.md index 335e12508db8..35d5a2e5ecb7 100644 --- a/keyboards/naiping/npminila/readme.md +++ b/keyboards/weirdo/naiping/npminila/readme.md @@ -10,7 +10,7 @@ A 60% keyboard based on STM32f303 Make example for this keyboard (after setting up your build environment): - make naiping/npminila:default + make weirdo/naiping/npminila:default The RST pin and GND pin on the board can be quickly shortened twice to enter DFU mode, and then the program can be written. diff --git a/keyboards/naiping/npminila/rules.mk b/keyboards/weirdo/naiping/npminila/rules.mk similarity index 100% rename from keyboards/naiping/npminila/rules.mk rename to keyboards/weirdo/naiping/npminila/rules.mk diff --git a/keyboards/tiger910/config.h b/keyboards/weirdo/tiger910/config.h similarity index 100% rename from keyboards/tiger910/config.h rename to keyboards/weirdo/tiger910/config.h diff --git a/keyboards/tiger910/info.json b/keyboards/weirdo/tiger910/info.json similarity index 100% rename from keyboards/tiger910/info.json rename to keyboards/weirdo/tiger910/info.json diff --git a/keyboards/tiger910/keymaps/default/keymap.c b/keyboards/weirdo/tiger910/keymaps/default/keymap.c similarity index 100% rename from keyboards/tiger910/keymaps/default/keymap.c rename to keyboards/weirdo/tiger910/keymaps/default/keymap.c diff --git a/keyboards/tiger910/keymaps/via/keymap.c b/keyboards/weirdo/tiger910/keymaps/via/keymap.c similarity index 100% rename from keyboards/tiger910/keymaps/via/keymap.c rename to keyboards/weirdo/tiger910/keymaps/via/keymap.c diff --git a/keyboards/tiger910/keymaps/via/rules.mk b/keyboards/weirdo/tiger910/keymaps/via/rules.mk similarity index 100% rename from keyboards/tiger910/keymaps/via/rules.mk rename to keyboards/weirdo/tiger910/keymaps/via/rules.mk diff --git a/keyboards/tiger910/readme.md b/keyboards/weirdo/tiger910/readme.md similarity index 94% rename from keyboards/tiger910/readme.md rename to keyboards/weirdo/tiger910/readme.md index ed14a307d357..a47b84db8764 100644 --- a/keyboards/tiger910/readme.md +++ b/keyboards/weirdo/tiger910/readme.md @@ -10,6 +10,6 @@ A 65% keyboard Make example for this keyboard (after setting up your build environment): - make tiger910:default + make weirdo/tiger910: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/tiger910/rules.mk b/keyboards/weirdo/tiger910/rules.mk similarity index 100% rename from keyboards/tiger910/rules.mk rename to keyboards/weirdo/tiger910/rules.mk diff --git a/keyboards/tiger910/tiger910.c b/keyboards/weirdo/tiger910/tiger910.c similarity index 100% rename from keyboards/tiger910/tiger910.c rename to keyboards/weirdo/tiger910/tiger910.c diff --git a/keyboards/tiger910/tiger910.h b/keyboards/weirdo/tiger910/tiger910.h similarity index 100% rename from keyboards/tiger910/tiger910.h rename to keyboards/weirdo/tiger910/tiger910.h diff --git a/keyboards/spiderisland/winry25tc/config.h b/keyboards/winry/winry25tc/config.h similarity index 100% rename from keyboards/spiderisland/winry25tc/config.h rename to keyboards/winry/winry25tc/config.h diff --git a/keyboards/spiderisland/winry25tc/info.json b/keyboards/winry/winry25tc/info.json similarity index 100% rename from keyboards/spiderisland/winry25tc/info.json rename to keyboards/winry/winry25tc/info.json diff --git a/keyboards/spiderisland/winry25tc/keymaps/default/keymap.c b/keyboards/winry/winry25tc/keymaps/default/keymap.c similarity index 100% rename from keyboards/spiderisland/winry25tc/keymaps/default/keymap.c rename to keyboards/winry/winry25tc/keymaps/default/keymap.c diff --git a/keyboards/spiderisland/winry25tc/readme.md b/keyboards/winry/winry25tc/readme.md similarity index 52% rename from keyboards/spiderisland/winry25tc/readme.md rename to keyboards/winry/winry25tc/readme.md index 45ba0bd5a42a..9507aef74b93 100644 --- a/keyboards/spiderisland/winry25tc/readme.md +++ b/keyboards/winry/winry25tc/readme.md @@ -1,14 +1,19 @@ -# SpiderIsland 25-key RGB Backlight Hot Swap Mechanical Keyboard +# Winry 25-key RGB Backlight Hot Swap Mechanical Keyboard + +Keyboard from +* [SpiderIsland on AliExpress(reseller)](https://a.aliexpress.com/_dVJsSpR). Seller provides [kbfirmware](https://kbfirmware.com/) JSON config that was converted to QMK. + -Keyboard from [SpiderIsland on AliExpress](https://a.aliexpress.com/_dVJsSpR). Seller provides [kbfirmware](https://kbfirmware.com/) JSON config that was converted to QMK. * Keyboard Maintainer: [andrzejressel](https://github.com/andrzejressel) -* Hardware Availability: https://aliexpress.com/item/1005001523579896.html +* Hardware Availability: +https://aliexpress.com/item/1005001523579896.html +https://item.taobao.com/item.htm?id=599731303104 Make example for this keyboard (after setting up your build environment): - make spiderisland/winry25tc:default + make winry/winry25tc:default **Reset Key**: Located on the other side of the keyboard. -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). \ No newline at end of file +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/spiderisland/winry25tc/rules.mk b/keyboards/winry/winry25tc/rules.mk similarity index 100% rename from keyboards/spiderisland/winry25tc/rules.mk rename to keyboards/winry/winry25tc/rules.mk diff --git a/keyboards/spiderisland/winry25tc/winry25tc.c b/keyboards/winry/winry25tc/winry25tc.c similarity index 100% rename from keyboards/spiderisland/winry25tc/winry25tc.c rename to keyboards/winry/winry25tc/winry25tc.c diff --git a/keyboards/spiderisland/winry25tc/winry25tc.h b/keyboards/winry/winry25tc/winry25tc.h similarity index 100% rename from keyboards/spiderisland/winry25tc/winry25tc.h rename to keyboards/winry/winry25tc/winry25tc.h diff --git a/keyboards/wolfmarkclub/wm1/rules.mk b/keyboards/wolfmarkclub/wm1/rules.mk index 2782d497ce21..a712747048a6 100644 --- a/keyboards/wolfmarkclub/wm1/rules.mk +++ b/keyboards/wolfmarkclub/wm1/rules.mk @@ -5,6 +5,9 @@ MCU = STM32F103 MCU_LDSCRIPT = wm1_f103 BOARD = STM32_F103_STM32DUINO +# Bootloader selection +BOOTLOADER = custom + PROGRAM_CMD = echo 'CLI flashing not supported' >&2 # Build Options diff --git a/keyboards/wolfmarkclub/wm1/wm1.c b/keyboards/wolfmarkclub/wm1/wm1.c index d199546f8906..0ad1ade4cc3f 100644 --- a/keyboards/wolfmarkclub/wm1/wm1.c +++ b/keyboards/wolfmarkclub/wm1/wm1.c @@ -1,5 +1,10 @@ #include "wm1.h" +void bootloader_jump(void) { + // This board doesn't use the "standard" stm32duino bootloader, and no information is available regarding how to enter bootloader mode. All we can do here is reset. + NVIC_SystemReset(); +} + void matrix_init_kb(void) { setPinOutput(B1); // Top Indicator LED setPinOutput(B0); // Middle Indicator LED diff --git a/keyboards/ymd75/.noci b/keyboards/woodkeys/bigseries/1key/.noci similarity index 100% rename from keyboards/ymd75/.noci rename to keyboards/woodkeys/bigseries/1key/.noci diff --git a/keyboards/bigseries/1key/1key.c b/keyboards/woodkeys/bigseries/1key/1key.c similarity index 100% rename from keyboards/bigseries/1key/1key.c rename to keyboards/woodkeys/bigseries/1key/1key.c diff --git a/keyboards/bigseries/1key/1key.h b/keyboards/woodkeys/bigseries/1key/1key.h similarity index 100% rename from keyboards/bigseries/1key/1key.h rename to keyboards/woodkeys/bigseries/1key/1key.h diff --git a/keyboards/bigseries/1key/config.h b/keyboards/woodkeys/bigseries/1key/config.h similarity index 100% rename from keyboards/bigseries/1key/config.h rename to keyboards/woodkeys/bigseries/1key/config.h diff --git a/keyboards/bigseries/1key/info.json b/keyboards/woodkeys/bigseries/1key/info.json similarity index 100% rename from keyboards/bigseries/1key/info.json rename to keyboards/woodkeys/bigseries/1key/info.json diff --git a/keyboards/bigseries/1key/keymaps/8ball/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/8ball/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/8ball/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/8ball/keymap.c diff --git a/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/ctrl-alt-del/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/ctrl-alt-del/keymap.c diff --git a/keyboards/bigseries/1key/keymaps/default/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/default/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/default/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/default/keymap.c diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/README.md b/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/README.md similarity index 100% rename from keyboards/bigseries/1key/keymaps/dudeofawesome/README.md rename to keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/README.md diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/config.h b/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h similarity index 100% rename from keyboards/bigseries/1key/keymaps/dudeofawesome/config.h rename to keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/dudeofawesome/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/keymap.c diff --git a/keyboards/naked64/keymaps/salicylic_with_setta21/rules.mk b/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/rules.mk similarity index 100% rename from keyboards/naked64/keymaps/salicylic_with_setta21/rules.mk rename to keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/leddance/config.h b/keyboards/woodkeys/bigseries/1key/keymaps/leddance/config.h similarity index 100% rename from keyboards/bigseries/1key/keymaps/leddance/config.h rename to keyboards/woodkeys/bigseries/1key/keymaps/leddance/config.h diff --git a/keyboards/bigseries/1key/keymaps/leddance/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/leddance/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/leddance/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/leddance/keymap.c diff --git a/keyboards/bigseries/1key/keymaps/leddance/rules.mk b/keyboards/woodkeys/bigseries/1key/keymaps/leddance/rules.mk similarity index 100% rename from keyboards/bigseries/1key/keymaps/leddance/rules.mk rename to keyboards/woodkeys/bigseries/1key/keymaps/leddance/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/lock/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/lock/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/lock/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/lock/keymap.c diff --git a/keyboards/bigseries/1key/keymaps/tester/keymap.c b/keyboards/woodkeys/bigseries/1key/keymaps/tester/keymap.c similarity index 100% rename from keyboards/bigseries/1key/keymaps/tester/keymap.c rename to keyboards/woodkeys/bigseries/1key/keymaps/tester/keymap.c diff --git a/keyboards/bigseries/1key/readme.md b/keyboards/woodkeys/bigseries/1key/readme.md similarity index 95% rename from keyboards/bigseries/1key/readme.md rename to keyboards/woodkeys/bigseries/1key/readme.md index ad3ee28b14fe..3d019c65d3ad 100644 --- a/keyboards/bigseries/1key/readme.md +++ b/keyboards/woodkeys/bigseries/1key/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](ht Make example for this keyboard (after setting up your build environment): - make bigseries/1key:default + make woodkeys/bigseries/1key:default See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/1key/rules.mk b/keyboards/woodkeys/bigseries/1key/rules.mk similarity index 100% rename from keyboards/bigseries/1key/rules.mk rename to keyboards/woodkeys/bigseries/1key/rules.mk diff --git a/keyboards/ymd75/rev1/.noci b/keyboards/woodkeys/bigseries/2key/.noci similarity index 100% rename from keyboards/ymd75/rev1/.noci rename to keyboards/woodkeys/bigseries/2key/.noci diff --git a/keyboards/bigseries/2key/2key.c b/keyboards/woodkeys/bigseries/2key/2key.c similarity index 100% rename from keyboards/bigseries/2key/2key.c rename to keyboards/woodkeys/bigseries/2key/2key.c diff --git a/keyboards/bigseries/2key/2key.h b/keyboards/woodkeys/bigseries/2key/2key.h similarity index 100% rename from keyboards/bigseries/2key/2key.h rename to keyboards/woodkeys/bigseries/2key/2key.h diff --git a/keyboards/bigseries/2key/config.h b/keyboards/woodkeys/bigseries/2key/config.h similarity index 100% rename from keyboards/bigseries/2key/config.h rename to keyboards/woodkeys/bigseries/2key/config.h diff --git a/keyboards/bigseries/2key/info.json b/keyboards/woodkeys/bigseries/2key/info.json similarity index 100% rename from keyboards/bigseries/2key/info.json rename to keyboards/woodkeys/bigseries/2key/info.json diff --git a/keyboards/bigseries/2key/keymaps/default/keymap.c b/keyboards/woodkeys/bigseries/2key/keymaps/default/keymap.c similarity index 100% rename from keyboards/bigseries/2key/keymaps/default/keymap.c rename to keyboards/woodkeys/bigseries/2key/keymaps/default/keymap.c diff --git a/keyboards/bigseries/2key/keymaps/lock/keymap.c b/keyboards/woodkeys/bigseries/2key/keymaps/lock/keymap.c similarity index 100% rename from keyboards/bigseries/2key/keymaps/lock/keymap.c rename to keyboards/woodkeys/bigseries/2key/keymaps/lock/keymap.c diff --git a/keyboards/bigseries/2key/keymaps/tester/keymap.c b/keyboards/woodkeys/bigseries/2key/keymaps/tester/keymap.c similarity index 100% rename from keyboards/bigseries/2key/keymaps/tester/keymap.c rename to keyboards/woodkeys/bigseries/2key/keymaps/tester/keymap.c diff --git a/keyboards/bigseries/2key/readme.md b/keyboards/woodkeys/bigseries/2key/readme.md similarity index 95% rename from keyboards/bigseries/2key/readme.md rename to keyboards/woodkeys/bigseries/2key/readme.md index e882433017dc..f6bcc5efbbc9 100644 --- a/keyboards/bigseries/2key/readme.md +++ b/keyboards/woodkeys/bigseries/2key/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](ht Make example for this keyboard (after setting up your build environment): - make bigseries/2key:default + make woodkeys/bigseries/2key:default See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/2key/rules.mk b/keyboards/woodkeys/bigseries/2key/rules.mk similarity index 100% rename from keyboards/bigseries/2key/rules.mk rename to keyboards/woodkeys/bigseries/2key/rules.mk diff --git a/keyboards/ymd75/rev2/.noci b/keyboards/woodkeys/bigseries/3key/.noci similarity index 100% rename from keyboards/ymd75/rev2/.noci rename to keyboards/woodkeys/bigseries/3key/.noci diff --git a/keyboards/bigseries/3key/3key.c b/keyboards/woodkeys/bigseries/3key/3key.c similarity index 100% rename from keyboards/bigseries/3key/3key.c rename to keyboards/woodkeys/bigseries/3key/3key.c diff --git a/keyboards/bigseries/3key/3key.h b/keyboards/woodkeys/bigseries/3key/3key.h similarity index 100% rename from keyboards/bigseries/3key/3key.h rename to keyboards/woodkeys/bigseries/3key/3key.h diff --git a/keyboards/bigseries/3key/config.h b/keyboards/woodkeys/bigseries/3key/config.h similarity index 100% rename from keyboards/bigseries/3key/config.h rename to keyboards/woodkeys/bigseries/3key/config.h diff --git a/keyboards/bigseries/3key/info.json b/keyboards/woodkeys/bigseries/3key/info.json similarity index 100% rename from keyboards/bigseries/3key/info.json rename to keyboards/woodkeys/bigseries/3key/info.json diff --git a/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c b/keyboards/woodkeys/bigseries/3key/keymaps/ctrl-alt-del/keymap.c similarity index 100% rename from keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c rename to keyboards/woodkeys/bigseries/3key/keymaps/ctrl-alt-del/keymap.c diff --git a/keyboards/bigseries/3key/keymaps/default/keymap.c b/keyboards/woodkeys/bigseries/3key/keymaps/default/keymap.c similarity index 100% rename from keyboards/bigseries/3key/keymaps/default/keymap.c rename to keyboards/woodkeys/bigseries/3key/keymaps/default/keymap.c diff --git a/keyboards/bigseries/3key/keymaps/tester/keymap.c b/keyboards/woodkeys/bigseries/3key/keymaps/tester/keymap.c similarity index 100% rename from keyboards/bigseries/3key/keymaps/tester/keymap.c rename to keyboards/woodkeys/bigseries/3key/keymaps/tester/keymap.c diff --git a/keyboards/bigseries/3key/readme.md b/keyboards/woodkeys/bigseries/3key/readme.md similarity index 95% rename from keyboards/bigseries/3key/readme.md rename to keyboards/woodkeys/bigseries/3key/readme.md index d32ec486a04d..c8d0275b870f 100644 --- a/keyboards/bigseries/3key/readme.md +++ b/keyboards/woodkeys/bigseries/3key/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](ht Make example for this keyboard (after setting up your build environment): - make bigseries/3key:default + make woodkeys/bigseries/3key:default See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/3key/rules.mk b/keyboards/woodkeys/bigseries/3key/rules.mk similarity index 100% rename from keyboards/bigseries/3key/rules.mk rename to keyboards/woodkeys/bigseries/3key/rules.mk diff --git a/keyboards/bigseries/4key/4key.c b/keyboards/woodkeys/bigseries/4key/4key.c similarity index 100% rename from keyboards/bigseries/4key/4key.c rename to keyboards/woodkeys/bigseries/4key/4key.c diff --git a/keyboards/bigseries/4key/4key.h b/keyboards/woodkeys/bigseries/4key/4key.h similarity index 100% rename from keyboards/bigseries/4key/4key.h rename to keyboards/woodkeys/bigseries/4key/4key.h diff --git a/keyboards/bigseries/4key/config.h b/keyboards/woodkeys/bigseries/4key/config.h similarity index 100% rename from keyboards/bigseries/4key/config.h rename to keyboards/woodkeys/bigseries/4key/config.h diff --git a/keyboards/bigseries/4key/info.json b/keyboards/woodkeys/bigseries/4key/info.json similarity index 100% rename from keyboards/bigseries/4key/info.json rename to keyboards/woodkeys/bigseries/4key/info.json diff --git a/keyboards/bigseries/4key/keymaps/default/keymap.c b/keyboards/woodkeys/bigseries/4key/keymaps/default/keymap.c similarity index 100% rename from keyboards/bigseries/4key/keymaps/default/keymap.c rename to keyboards/woodkeys/bigseries/4key/keymaps/default/keymap.c diff --git a/keyboards/bigseries/4key/keymaps/tester/keymap.c b/keyboards/woodkeys/bigseries/4key/keymaps/tester/keymap.c similarity index 100% rename from keyboards/bigseries/4key/keymaps/tester/keymap.c rename to keyboards/woodkeys/bigseries/4key/keymaps/tester/keymap.c diff --git a/keyboards/bigseries/4key/readme.md b/keyboards/woodkeys/bigseries/4key/readme.md similarity index 95% rename from keyboards/bigseries/4key/readme.md rename to keyboards/woodkeys/bigseries/4key/readme.md index ec40e83f2cd2..2ac56a25c702 100644 --- a/keyboards/bigseries/4key/readme.md +++ b/keyboards/woodkeys/bigseries/4key/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](ht Make example for this keyboard (after setting up your build environment): - make bigseries/4key:default + make woodkeys/bigseries/4key:default See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/4key/rules.mk b/keyboards/woodkeys/bigseries/4key/rules.mk similarity index 100% rename from keyboards/bigseries/4key/rules.mk rename to keyboards/woodkeys/bigseries/4key/rules.mk diff --git a/keyboards/bigseries/readme.md b/keyboards/woodkeys/bigseries/readme.md similarity index 91% rename from keyboards/bigseries/readme.md rename to keyboards/woodkeys/bigseries/readme.md index 0b406673537c..5f7a1235084a 100644 --- a/keyboards/bigseries/readme.md +++ b/keyboards/woodkeys/bigseries/readme.md @@ -10,7 +10,7 @@ Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](ht Make example for these keyboards (after setting up your build environment): - make bigseries/1key:default - make bigseries/3key:ctrl-alt-del + make woodkeys/bigseries/1key:default + make woodkeys/bigseries/3key:ctrl-alt-del See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/meira/TWIlib.c b/keyboards/woodkeys/meira/TWIlib.c similarity index 100% rename from keyboards/meira/TWIlib.c rename to keyboards/woodkeys/meira/TWIlib.c diff --git a/keyboards/meira/TWIlib.h b/keyboards/woodkeys/meira/TWIlib.h similarity index 100% rename from keyboards/meira/TWIlib.h rename to keyboards/woodkeys/meira/TWIlib.h diff --git a/keyboards/meira/config.h b/keyboards/woodkeys/meira/config.h similarity index 100% rename from keyboards/meira/config.h rename to keyboards/woodkeys/meira/config.h diff --git a/keyboards/meira/featherble/config.h b/keyboards/woodkeys/meira/featherble/config.h similarity index 100% rename from keyboards/meira/featherble/config.h rename to keyboards/woodkeys/meira/featherble/config.h diff --git a/keyboards/meira/featherble/featherble.c b/keyboards/woodkeys/meira/featherble/featherble.c similarity index 100% rename from keyboards/meira/featherble/featherble.c rename to keyboards/woodkeys/meira/featherble/featherble.c diff --git a/keyboards/meira/featherble/featherble.h b/keyboards/woodkeys/meira/featherble/featherble.h similarity index 100% rename from keyboards/meira/featherble/featherble.h rename to keyboards/woodkeys/meira/featherble/featherble.h diff --git a/keyboards/meira/featherble/rules.mk b/keyboards/woodkeys/meira/featherble/rules.mk similarity index 66% rename from keyboards/meira/featherble/rules.mk rename to keyboards/woodkeys/meira/featherble/rules.mk index d3e985e8c239..01f1af1ae8af 100644 --- a/keyboards/meira/featherble/rules.mk +++ b/keyboards/woodkeys/meira/featherble/rules.mk @@ -2,4 +2,4 @@ F_CPU = 8000000 BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/meira/info.json b/keyboards/woodkeys/meira/info.json similarity index 100% rename from keyboards/meira/info.json rename to keyboards/woodkeys/meira/info.json diff --git a/keyboards/meira/issi.c b/keyboards/woodkeys/meira/issi.c similarity index 100% rename from keyboards/meira/issi.c rename to keyboards/woodkeys/meira/issi.c diff --git a/keyboards/meira/issi.h b/keyboards/woodkeys/meira/issi.h similarity index 100% rename from keyboards/meira/issi.h rename to keyboards/woodkeys/meira/issi.h diff --git a/keyboards/meira/keymaps/cole/config.h b/keyboards/woodkeys/meira/keymaps/cole/config.h similarity index 100% rename from keyboards/meira/keymaps/cole/config.h rename to keyboards/woodkeys/meira/keymaps/cole/config.h diff --git a/keyboards/meira/keymaps/cole/keymap.c b/keyboards/woodkeys/meira/keymaps/cole/keymap.c similarity index 100% rename from keyboards/meira/keymaps/cole/keymap.c rename to keyboards/woodkeys/meira/keymaps/cole/keymap.c diff --git a/keyboards/meira/keymaps/cole/readme.md b/keyboards/woodkeys/meira/keymaps/cole/readme.md similarity index 100% rename from keyboards/meira/keymaps/cole/readme.md rename to keyboards/woodkeys/meira/keymaps/cole/readme.md diff --git a/keyboards/meira/keymaps/cole/rules.mk b/keyboards/woodkeys/meira/keymaps/cole/rules.mk similarity index 68% rename from keyboards/meira/keymaps/cole/rules.mk rename to keyboards/woodkeys/meira/keymaps/cole/rules.mk index 8f8d53e57a5c..eed6b9c11903 100644 --- a/keyboards/meira/keymaps/cole/rules.mk +++ b/keyboards/woodkeys/meira/keymaps/cole/rules.mk @@ -1,2 +1,2 @@ AUDIO_ENABLE = yes # Audio output on port C6 -EXTRAFLAGS+=-flto # -4-7k \ No newline at end of file +LTO_ENABLE = yes # -4-7k diff --git a/keyboards/meira/keymaps/default/config.h b/keyboards/woodkeys/meira/keymaps/default/config.h similarity index 100% rename from keyboards/meira/keymaps/default/config.h rename to keyboards/woodkeys/meira/keymaps/default/config.h diff --git a/keyboards/meira/keymaps/default/keymap.c b/keyboards/woodkeys/meira/keymaps/default/keymap.c similarity index 100% rename from keyboards/meira/keymaps/default/keymap.c rename to keyboards/woodkeys/meira/keymaps/default/keymap.c diff --git a/keyboards/meira/keymaps/default/readme.md b/keyboards/woodkeys/meira/keymaps/default/readme.md similarity index 100% rename from keyboards/meira/keymaps/default/readme.md rename to keyboards/woodkeys/meira/keymaps/default/readme.md diff --git a/keyboards/meira/keymaps/grahampheath/config.h b/keyboards/woodkeys/meira/keymaps/grahampheath/config.h similarity index 100% rename from keyboards/meira/keymaps/grahampheath/config.h rename to keyboards/woodkeys/meira/keymaps/grahampheath/config.h diff --git a/keyboards/meira/keymaps/grahampheath/keymap.c b/keyboards/woodkeys/meira/keymaps/grahampheath/keymap.c similarity index 100% rename from keyboards/meira/keymaps/grahampheath/keymap.c rename to keyboards/woodkeys/meira/keymaps/grahampheath/keymap.c diff --git a/keyboards/meira/keymaps/grahampheath/readme.md b/keyboards/woodkeys/meira/keymaps/grahampheath/readme.md similarity index 100% rename from keyboards/meira/keymaps/grahampheath/readme.md rename to keyboards/woodkeys/meira/keymaps/grahampheath/readme.md diff --git a/keyboards/meira/keymaps/grahampheath/rules.mk b/keyboards/woodkeys/meira/keymaps/grahampheath/rules.mk similarity index 84% rename from keyboards/meira/keymaps/grahampheath/rules.mk rename to keyboards/woodkeys/meira/keymaps/grahampheath/rules.mk index b3b1980eb151..1c61fe1c12b4 100644 --- a/keyboards/meira/keymaps/grahampheath/rules.mk +++ b/keyboards/woodkeys/meira/keymaps/grahampheath/rules.mk @@ -1,5 +1,5 @@ AUDIO_ENABLE = yes # Audio output on port C6 -EXTRAFLAGS+=-flto # -4-7k +LTO_ENABLE = yes # -4-7k MOUSEKEY_ENABLE = no # Mouse keys(-47kb) ISSI_ENABLE = no BACKLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/meira/keymaps/takmiya/config.h b/keyboards/woodkeys/meira/keymaps/takmiya/config.h similarity index 100% rename from keyboards/meira/keymaps/takmiya/config.h rename to keyboards/woodkeys/meira/keymaps/takmiya/config.h diff --git a/keyboards/meira/keymaps/takmiya/keymap.c b/keyboards/woodkeys/meira/keymaps/takmiya/keymap.c similarity index 100% rename from keyboards/meira/keymaps/takmiya/keymap.c rename to keyboards/woodkeys/meira/keymaps/takmiya/keymap.c diff --git a/keyboards/meira/keymaps/takmiya/readme.md b/keyboards/woodkeys/meira/keymaps/takmiya/readme.md similarity index 100% rename from keyboards/meira/keymaps/takmiya/readme.md rename to keyboards/woodkeys/meira/keymaps/takmiya/readme.md diff --git a/keyboards/meira/lighting.c b/keyboards/woodkeys/meira/lighting.c similarity index 100% rename from keyboards/meira/lighting.c rename to keyboards/woodkeys/meira/lighting.c diff --git a/keyboards/meira/lighting.h b/keyboards/woodkeys/meira/lighting.h similarity index 100% rename from keyboards/meira/lighting.h rename to keyboards/woodkeys/meira/lighting.h diff --git a/keyboards/meira/matrix.c b/keyboards/woodkeys/meira/matrix.c similarity index 98% rename from keyboards/meira/matrix.c rename to keyboards/woodkeys/meira/matrix.c index ae1ae5ce9d4e..8e8e9485b482 100644 --- a/keyboards/meira/matrix.c +++ b/keyboards/woodkeys/meira/matrix.c @@ -161,12 +161,6 @@ uint8_t matrix_scan(void) return ret; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/meira/meira.c b/keyboards/woodkeys/meira/meira.c similarity index 100% rename from keyboards/meira/meira.c rename to keyboards/woodkeys/meira/meira.c diff --git a/keyboards/meira/meira.h b/keyboards/woodkeys/meira/meira.h similarity index 100% rename from keyboards/meira/meira.h rename to keyboards/woodkeys/meira/meira.h diff --git a/keyboards/meira/promicro/config.h b/keyboards/woodkeys/meira/promicro/config.h similarity index 100% rename from keyboards/meira/promicro/config.h rename to keyboards/woodkeys/meira/promicro/config.h diff --git a/keyboards/meira/promicro/promicro.c b/keyboards/woodkeys/meira/promicro/promicro.c similarity index 100% rename from keyboards/meira/promicro/promicro.c rename to keyboards/woodkeys/meira/promicro/promicro.c diff --git a/keyboards/meira/promicro/promicro.h b/keyboards/woodkeys/meira/promicro/promicro.h similarity index 100% rename from keyboards/meira/promicro/promicro.h rename to keyboards/woodkeys/meira/promicro/promicro.h diff --git a/keyboards/meira/promicro/rules.mk b/keyboards/woodkeys/meira/promicro/rules.mk similarity index 100% rename from keyboards/meira/promicro/rules.mk rename to keyboards/woodkeys/meira/promicro/rules.mk diff --git a/keyboards/meira/readme.md b/keyboards/woodkeys/meira/readme.md similarity index 91% rename from keyboards/meira/readme.md rename to keyboards/woodkeys/meira/readme.md index 716eb7445d76..f0fb02b69e64 100644 --- a/keyboards/meira/readme.md +++ b/keyboards/woodkeys/meira/readme.md @@ -12,8 +12,8 @@ Two controllers are supported: the Pro Micro, and the Adafruit Feather BLE 32u4. Make examples for this keyboard (after setting up your build environment): - make meira/featherble:default # for Feather BLE 32u4 controllers - make meira/promicro:default # for Pro Micro controllers + make woodkeys/meira/featherble:default # for Feather BLE 32u4 controllers + make woodkeys/meira/promicro:default # for Pro Micro controllers 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/meira/rules.mk b/keyboards/woodkeys/meira/rules.mk similarity index 96% rename from keyboards/meira/rules.mk rename to keyboards/woodkeys/meira/rules.mk index cdd0acb8246c..6b5025500c65 100644 --- a/keyboards/meira/rules.mk +++ b/keyboards/woodkeys/meira/rules.mk @@ -30,5 +30,5 @@ CUSTOM_MATRIX = yes #endif SRC += matrix.c TWIlib.c issi.c lighting.c -DEFAULT_FOLDER = meira/promicro +DEFAULT_FOLDER = woodkeys/meira/promicro LAYOUTS = ortho_4x12 diff --git a/keyboards/scarletbandana/config.h b/keyboards/woodkeys/scarletbandana/config.h similarity index 100% rename from keyboards/scarletbandana/config.h rename to keyboards/woodkeys/scarletbandana/config.h diff --git a/keyboards/scarletbandana/info.json b/keyboards/woodkeys/scarletbandana/info.json similarity index 100% rename from keyboards/scarletbandana/info.json rename to keyboards/woodkeys/scarletbandana/info.json diff --git a/keyboards/scarletbandana/keymaps/default/keymap.c b/keyboards/woodkeys/scarletbandana/keymaps/default/keymap.c similarity index 100% rename from keyboards/scarletbandana/keymaps/default/keymap.c rename to keyboards/woodkeys/scarletbandana/keymaps/default/keymap.c diff --git a/keyboards/scarletbandana/keymaps/default/readme.md b/keyboards/woodkeys/scarletbandana/keymaps/default/readme.md similarity index 100% rename from keyboards/scarletbandana/keymaps/default/readme.md rename to keyboards/woodkeys/scarletbandana/keymaps/default/readme.md diff --git a/keyboards/scarletbandana/readme.md b/keyboards/woodkeys/scarletbandana/readme.md similarity index 93% rename from keyboards/scarletbandana/readme.md rename to keyboards/woodkeys/scarletbandana/readme.md index 83281bae36c7..4505fd05738d 100644 --- a/keyboards/scarletbandana/readme.md +++ b/keyboards/woodkeys/scarletbandana/readme.md @@ -6,6 +6,6 @@ Hardware Availability: [WoodKeys.click](https://woodkeys.click/product/scarlet-b Make example for this keyboard (after setting up your build environment): - make scarletbandana:default + make woodkeys/scarletbandana: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/scarletbandana/rules.mk b/keyboards/woodkeys/scarletbandana/rules.mk similarity index 100% rename from keyboards/scarletbandana/rules.mk rename to keyboards/woodkeys/scarletbandana/rules.mk diff --git a/keyboards/scarletbandana/scarletbandana.c b/keyboards/woodkeys/scarletbandana/scarletbandana.c similarity index 100% rename from keyboards/scarletbandana/scarletbandana.c rename to keyboards/woodkeys/scarletbandana/scarletbandana.c diff --git a/keyboards/scarletbandana/scarletbandana.h b/keyboards/woodkeys/scarletbandana/scarletbandana.h similarity index 100% rename from keyboards/scarletbandana/scarletbandana.h rename to keyboards/woodkeys/scarletbandana/scarletbandana.h diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c index 7a8edc1a9ea5..d25ea0cdbaf4 100644 --- a/keyboards/work_louder/work_board/work_board.c +++ b/keyboards/work_louder/work_board/work_board.c @@ -100,15 +100,15 @@ led_config_t g_led_config = { { } }; // clang-format on +# ifdef VIA_ENABLE +bool via_layout_2u = false; + +void via_set_layout_options_kb(uint32_t value) { via_layout_2u = (bool)value; } +# endif // VIA_ENABLE + __attribute__((weak)) void rgb_matrix_indicators_user(void) { # ifdef VIA_ENABLE - static bool layout_2u = false; - static uint16_t timer = 0; - if (timer_elapsed(timer) > 500) { - timer = timer_read(); - layout_2u = (bool)via_get_layout_options(); - } - if (layout_2u) { + if (via_layout_2u) { rgb_matrix_set_color(5, 0, 0, 0); rgb_matrix_set_color(7, 0, 0, 0); } else { diff --git a/keyboards/wren/rules.mk b/keyboards/wren/rules.mk index 76e0fdf55dd6..7fa6b51f4bef 100644 --- a/keyboards/wren/rules.mk +++ b/keyboards/wren/rules.mk @@ -12,10 +12,9 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes # Enables the use of one or more encoders -SPLIT_KEYBOARD = yes # Enables split keyboard +ENCODER_ENABLE = yes # Enables the use of one or more encoders +SPLIT_KEYBOARD = yes # Enables split keyboard diff --git a/keyboards/xiaomi/mk02/rules.mk b/keyboards/xiaomi/mk02/rules.mk index 9d6d62c39408..c20d67dd89d9 100644 --- a/keyboards/xiaomi/mk02/rules.mk +++ b/keyboards/xiaomi/mk02/rules.mk @@ -3,6 +3,9 @@ MCU = STM32F072 BOARD = ST_STM32F072B_DISCOVERY MCU_LDSCRIPT = STM32F072_0x2000_bootloader +# Bootloader selection +BOOTLOADER = custom + DFU_ARGS = -d 0483:df11 -a 0 -s 0x08002000:leave DFU_SUFFIX_ARGS = -v 0483 -p DF11 diff --git a/keyboards/xiudi/xd002/rules.mk b/keyboards/xiudi/xd002/rules.mk index 77dd994783ef..70c620c8f06a 100644 --- a/keyboards/xiudi/xd002/rules.mk +++ b/keyboards/xiudi/xd002/rules.mk @@ -2,7 +2,7 @@ MCU = attiny85 # Bootloader selection -BOOTLOADER = micronucleus +BOOTLOADER = custom OPT_DEFS += -DBOOTLOADER_SIZE=1862 PROGRAM_CMD = micronucleus --run $(BUILD_DIR)/$(TARGET).hex diff --git a/keyboards/xiudi/xd84/matrix.c b/keyboards/xiudi/xd84/matrix.c index 92b8ff854670..04128561eef1 100644 --- a/keyboards/xiudi/xd84/matrix.c +++ b/keyboards/xiudi/xd84/matrix.c @@ -53,7 +53,8 @@ static void select_row(uint8_t row) { static uint16_t read_cols(void) { // uint16_t state_1 = pca9555_readPins(IC2, PCA9555_PORT0); // uint16_t state_2 = pca9555_readPins(IC2, PCA9555_PORT1); - uint16_t state = pca9555_readAllPins(IC2); + uint16_t state = 0; + pca9555_readPins_all(IC2, &state); // For the XD84 all cols are on the same IC and mapped sequentially // while this technically gives 16 column reads, diff --git a/keyboards/xiudi/xd96/matrix.c b/keyboards/xiudi/xd96/matrix.c index 8cecc79c2660..beef7fae126f 100644 --- a/keyboards/xiudi/xd96/matrix.c +++ b/keyboards/xiudi/xd96/matrix.c @@ -50,13 +50,16 @@ static void select_row(uint8_t row) { } static uint32_t read_cols(void) { - uint32_t state_1 = pca9555_readPins(IC2, PCA9555_PORT0); - uint32_t state_2 = pca9555_readPins(IC2, PCA9555_PORT1); - uint32_t state_3 = pca9555_readPins(IC1, PCA9555_PORT1); + uint8_t state_1 = 0; + uint8_t state_2 = 0; + uint8_t state_3 = 0; + pca9555_readPins(IC2, PCA9555_PORT0, &state_1); + pca9555_readPins(IC2, PCA9555_PORT1, &state_2); + pca9555_readPins(IC1, PCA9555_PORT1, &state_3); // For the XD96 the pins are mapped to port expanders as follows: // all 8 pins port 0 IC2, first 6 pins port 1 IC2, first 4 pins port 1 IC1 - uint32_t state = (((state_3 & 0b00001111) << 14) | ((state_2 & 0b00111111) << 8) | state_1); + uint32_t state = ((((uint32_t)state_3 & 0b00001111) << 14) | (((uint32_t)state_2 & 0b00111111) << 8) | (uint32_t)state_1); return (~state) & 0b111111111111111111; } diff --git a/keyboards/yanghu/unicorne/config.h b/keyboards/yanghu/unicorne/config.h index 652afeb3b473..27d21c790626 100644 --- a/keyboards/yanghu/unicorne/config.h +++ b/keyboards/yanghu/unicorne/config.h @@ -42,6 +42,12 @@ #define ENCODERS_PAD_B \ { B12, B0 } +/* I2C - required for custom i2c_init */ +#define I2C1_SCL_PIN B6 +#define I2C1_SDA_PIN B7 +#define I2C1_SCL_PAL_MODE 4 +#define I2C1_SDA_PAL_MODE 4 + /* Audio */ #define AUDIO_PIN A8 #define AUDIO_PWM_PAL_MODE 1 diff --git a/keyboards/chili/chili.c b/keyboards/ydkb/chili/chili.c similarity index 100% rename from keyboards/chili/chili.c rename to keyboards/ydkb/chili/chili.c diff --git a/keyboards/chili/chili.h b/keyboards/ydkb/chili/chili.h similarity index 100% rename from keyboards/chili/chili.h rename to keyboards/ydkb/chili/chili.h diff --git a/keyboards/chili/config.h b/keyboards/ydkb/chili/config.h similarity index 100% rename from keyboards/chili/config.h rename to keyboards/ydkb/chili/config.h diff --git a/keyboards/chili/info.json b/keyboards/ydkb/chili/info.json similarity index 100% rename from keyboards/chili/info.json rename to keyboards/ydkb/chili/info.json diff --git a/keyboards/chili/keymaps/default/keymap.c b/keyboards/ydkb/chili/keymaps/default/keymap.c similarity index 100% rename from keyboards/chili/keymaps/default/keymap.c rename to keyboards/ydkb/chili/keymaps/default/keymap.c diff --git a/keyboards/chili/keymaps/via/keymap.c b/keyboards/ydkb/chili/keymaps/via/keymap.c similarity index 100% rename from keyboards/chili/keymaps/via/keymap.c rename to keyboards/ydkb/chili/keymaps/via/keymap.c diff --git a/keyboards/wings42/rev1/keymaps/via/rules.mk b/keyboards/ydkb/chili/keymaps/via/rules.mk similarity index 100% rename from keyboards/wings42/rev1/keymaps/via/rules.mk rename to keyboards/ydkb/chili/keymaps/via/rules.mk diff --git a/keyboards/chili/readme.md b/keyboards/ydkb/chili/readme.md similarity index 95% rename from keyboards/chili/readme.md rename to keyboards/ydkb/chili/readme.md index a383f98fb0a5..c7be92b9e5c6 100644 --- a/keyboards/chili/readme.md +++ b/keyboards/ydkb/chili/readme.md @@ -10,6 +10,6 @@ The YDKB Chili is a Cherry G80-3000 replacement PCB utilizing the ATmega32U4 mic Make example for this keyboard (after setting up your build environment): - make chili:default + make ydkb/chili: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/chili/rules.mk b/keyboards/ydkb/chili/rules.mk similarity index 100% rename from keyboards/chili/rules.mk rename to keyboards/ydkb/chili/rules.mk diff --git a/keyboards/just60/config.h b/keyboards/ydkb/just60/config.h similarity index 100% rename from keyboards/just60/config.h rename to keyboards/ydkb/just60/config.h diff --git a/keyboards/just60/info.json b/keyboards/ydkb/just60/info.json similarity index 100% rename from keyboards/just60/info.json rename to keyboards/ydkb/just60/info.json diff --git a/keyboards/just60/just60.h b/keyboards/ydkb/just60/just60.h similarity index 100% rename from keyboards/just60/just60.h rename to keyboards/ydkb/just60/just60.h diff --git a/keyboards/just60/keymaps/default/keymap.c b/keyboards/ydkb/just60/keymaps/default/keymap.c similarity index 100% rename from keyboards/just60/keymaps/default/keymap.c rename to keyboards/ydkb/just60/keymaps/default/keymap.c diff --git a/keyboards/just60/keymaps/default/readme.md b/keyboards/ydkb/just60/keymaps/default/readme.md similarity index 100% rename from keyboards/just60/keymaps/default/readme.md rename to keyboards/ydkb/just60/keymaps/default/readme.md diff --git a/keyboards/just60/keymaps/thinxer/keymap.c b/keyboards/ydkb/just60/keymaps/thinxer/keymap.c similarity index 100% rename from keyboards/just60/keymaps/thinxer/keymap.c rename to keyboards/ydkb/just60/keymaps/thinxer/keymap.c diff --git a/keyboards/just60/keymaps/thinxer/readme.md b/keyboards/ydkb/just60/keymaps/thinxer/readme.md similarity index 100% rename from keyboards/just60/keymaps/thinxer/readme.md rename to keyboards/ydkb/just60/keymaps/thinxer/readme.md diff --git a/keyboards/just60/keymaps/thinxer/rules.mk b/keyboards/ydkb/just60/keymaps/thinxer/rules.mk similarity index 100% rename from keyboards/just60/keymaps/thinxer/rules.mk rename to keyboards/ydkb/just60/keymaps/thinxer/rules.mk diff --git a/keyboards/just60/readme.md b/keyboards/ydkb/just60/readme.md similarity index 97% rename from keyboards/just60/readme.md rename to keyboards/ydkb/just60/readme.md index f78adcd5294c..1fe05bd3eaac 100644 --- a/keyboards/just60/readme.md +++ b/keyboards/ydkb/just60/readme.md @@ -12,6 +12,6 @@ Backlight LEDs and Bluetooth are not working yet. Make example for this keyboard (after setting up your build environment): - make just60:default + make ydkb/just60: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/just60/rules.mk b/keyboards/ydkb/just60/rules.mk similarity index 100% rename from keyboards/just60/rules.mk rename to keyboards/ydkb/just60/rules.mk diff --git a/keyboards/yd68/config.h b/keyboards/ydkb/yd68/config.h similarity index 100% rename from keyboards/yd68/config.h rename to keyboards/ydkb/yd68/config.h diff --git a/keyboards/yd68/info.json b/keyboards/ydkb/yd68/info.json similarity index 100% rename from keyboards/yd68/info.json rename to keyboards/ydkb/yd68/info.json diff --git a/keyboards/yd68/keymaps/default/keymap.c b/keyboards/ydkb/yd68/keymaps/default/keymap.c similarity index 100% rename from keyboards/yd68/keymaps/default/keymap.c rename to keyboards/ydkb/yd68/keymaps/default/keymap.c diff --git a/keyboards/yd68/keymaps/default/readme.md b/keyboards/ydkb/yd68/keymaps/default/readme.md similarity index 100% rename from keyboards/yd68/keymaps/default/readme.md rename to keyboards/ydkb/yd68/keymaps/default/readme.md diff --git a/keyboards/yd68/readme.md b/keyboards/ydkb/yd68/readme.md similarity index 96% rename from keyboards/yd68/readme.md rename to keyboards/ydkb/yd68/readme.md index 7e5e83bcc9d8..2632e8e9f82b 100644 --- a/keyboards/yd68/readme.md +++ b/keyboards/ydkb/yd68/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [KBDFans](https://kbdfans.cn/collections/diy-kit/products Make example for this keyboard (after setting up your build environment): - make yd68:default + make ydkb/yd68: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/yd68/rules.mk b/keyboards/ydkb/yd68/rules.mk similarity index 100% rename from keyboards/yd68/rules.mk rename to keyboards/ydkb/yd68/rules.mk diff --git a/keyboards/yd68/yd68.c b/keyboards/ydkb/yd68/yd68.c similarity index 100% rename from keyboards/yd68/yd68.c rename to keyboards/ydkb/yd68/yd68.c diff --git a/keyboards/yd68/yd68.h b/keyboards/ydkb/yd68/yd68.h similarity index 100% rename from keyboards/yd68/yd68.h rename to keyboards/ydkb/yd68/yd68.h diff --git a/keyboards/barleycorn/barleycorn.c b/keyboards/yiancardesigns/barleycorn/barleycorn.c similarity index 100% rename from keyboards/barleycorn/barleycorn.c rename to keyboards/yiancardesigns/barleycorn/barleycorn.c diff --git a/keyboards/barleycorn/barleycorn.h b/keyboards/yiancardesigns/barleycorn/barleycorn.h similarity index 100% rename from keyboards/barleycorn/barleycorn.h rename to keyboards/yiancardesigns/barleycorn/barleycorn.h diff --git a/keyboards/barleycorn/config.h b/keyboards/yiancardesigns/barleycorn/config.h similarity index 100% rename from keyboards/barleycorn/config.h rename to keyboards/yiancardesigns/barleycorn/config.h diff --git a/keyboards/barleycorn/info.json b/keyboards/yiancardesigns/barleycorn/info.json similarity index 100% rename from keyboards/barleycorn/info.json rename to keyboards/yiancardesigns/barleycorn/info.json diff --git a/keyboards/barleycorn/keymaps/default/keymap.c b/keyboards/yiancardesigns/barleycorn/keymaps/default/keymap.c similarity index 100% rename from keyboards/barleycorn/keymaps/default/keymap.c rename to keyboards/yiancardesigns/barleycorn/keymaps/default/keymap.c diff --git a/keyboards/barleycorn/keymaps/default/readme.md b/keyboards/yiancardesigns/barleycorn/keymaps/default/readme.md similarity index 100% rename from keyboards/barleycorn/keymaps/default/readme.md rename to keyboards/yiancardesigns/barleycorn/keymaps/default/readme.md diff --git a/keyboards/barleycorn/keymaps/iso/keymap.c b/keyboards/yiancardesigns/barleycorn/keymaps/iso/keymap.c similarity index 100% rename from keyboards/barleycorn/keymaps/iso/keymap.c rename to keyboards/yiancardesigns/barleycorn/keymaps/iso/keymap.c diff --git a/keyboards/barleycorn/keymaps/iso/readme.md b/keyboards/yiancardesigns/barleycorn/keymaps/iso/readme.md similarity index 100% rename from keyboards/barleycorn/keymaps/iso/readme.md rename to keyboards/yiancardesigns/barleycorn/keymaps/iso/readme.md diff --git a/keyboards/barleycorn/keymaps/via/keymap.c b/keyboards/yiancardesigns/barleycorn/keymaps/via/keymap.c similarity index 100% rename from keyboards/barleycorn/keymaps/via/keymap.c rename to keyboards/yiancardesigns/barleycorn/keymaps/via/keymap.c diff --git a/keyboards/barleycorn/keymaps/via/readme.md b/keyboards/yiancardesigns/barleycorn/keymaps/via/readme.md similarity index 100% rename from keyboards/barleycorn/keymaps/via/readme.md rename to keyboards/yiancardesigns/barleycorn/keymaps/via/readme.md diff --git a/keyboards/wings42/rev1_extkeys/keymaps/via/rules.mk b/keyboards/yiancardesigns/barleycorn/keymaps/via/rules.mk similarity index 100% rename from keyboards/wings42/rev1_extkeys/keymaps/via/rules.mk rename to keyboards/yiancardesigns/barleycorn/keymaps/via/rules.mk diff --git a/keyboards/barleycorn/matrix.c b/keyboards/yiancardesigns/barleycorn/matrix.c similarity index 100% rename from keyboards/barleycorn/matrix.c rename to keyboards/yiancardesigns/barleycorn/matrix.c diff --git a/keyboards/barleycorn/readme.md b/keyboards/yiancardesigns/barleycorn/readme.md similarity index 90% rename from keyboards/barleycorn/readme.md rename to keyboards/yiancardesigns/barleycorn/readme.md index dd96c69e9a80..c98be3e04242 100644 --- a/keyboards/barleycorn/readme.md +++ b/keyboards/yiancardesigns/barleycorn/readme.md @@ -10,11 +10,11 @@ An f-row less compact 1800 kit with only through hole components. Make example for this keyboard (after setting up your build environment): - make barleycorn:default + make yiancardesigns/barleycorn:default Flashing example for this keyboard: - make barleycorn:default:flash + make yiancardesigns/barleycorn:default:flash Bootloader: use usbasploader from HSGW's repository. diff --git a/keyboards/barleycorn/rules.mk b/keyboards/yiancardesigns/barleycorn/rules.mk similarity index 100% rename from keyboards/barleycorn/rules.mk rename to keyboards/yiancardesigns/barleycorn/rules.mk diff --git a/keyboards/gingham/config.h b/keyboards/yiancardesigns/gingham/config.h similarity index 100% rename from keyboards/gingham/config.h rename to keyboards/yiancardesigns/gingham/config.h diff --git a/keyboards/gingham/gingham.c b/keyboards/yiancardesigns/gingham/gingham.c similarity index 100% rename from keyboards/gingham/gingham.c rename to keyboards/yiancardesigns/gingham/gingham.c diff --git a/keyboards/gingham/gingham.h b/keyboards/yiancardesigns/gingham/gingham.h similarity index 100% rename from keyboards/gingham/gingham.h rename to keyboards/yiancardesigns/gingham/gingham.h diff --git a/keyboards/gingham/info.json b/keyboards/yiancardesigns/gingham/info.json similarity index 100% rename from keyboards/gingham/info.json rename to keyboards/yiancardesigns/gingham/info.json diff --git a/keyboards/gingham/keymaps/codecoffeecode/keymap.c b/keyboards/yiancardesigns/gingham/keymaps/codecoffeecode/keymap.c similarity index 100% rename from keyboards/gingham/keymaps/codecoffeecode/keymap.c rename to keyboards/yiancardesigns/gingham/keymaps/codecoffeecode/keymap.c diff --git a/keyboards/gingham/keymaps/codecoffeecode/readme.md b/keyboards/yiancardesigns/gingham/keymaps/codecoffeecode/readme.md similarity index 100% rename from keyboards/gingham/keymaps/codecoffeecode/readme.md rename to keyboards/yiancardesigns/gingham/keymaps/codecoffeecode/readme.md diff --git a/keyboards/gingham/keymaps/default/keymap.c b/keyboards/yiancardesigns/gingham/keymaps/default/keymap.c similarity index 100% rename from keyboards/gingham/keymaps/default/keymap.c rename to keyboards/yiancardesigns/gingham/keymaps/default/keymap.c diff --git a/keyboards/gingham/keymaps/default/readme.md b/keyboards/yiancardesigns/gingham/keymaps/default/readme.md similarity index 100% rename from keyboards/gingham/keymaps/default/readme.md rename to keyboards/yiancardesigns/gingham/keymaps/default/readme.md diff --git a/keyboards/gingham/keymaps/iso/keymap.c b/keyboards/yiancardesigns/gingham/keymaps/iso/keymap.c similarity index 100% rename from keyboards/gingham/keymaps/iso/keymap.c rename to keyboards/yiancardesigns/gingham/keymaps/iso/keymap.c diff --git a/keyboards/gingham/keymaps/iso/readme.md b/keyboards/yiancardesigns/gingham/keymaps/iso/readme.md similarity index 100% rename from keyboards/gingham/keymaps/iso/readme.md rename to keyboards/yiancardesigns/gingham/keymaps/iso/readme.md diff --git a/keyboards/gingham/keymaps/via/keymap.c b/keyboards/yiancardesigns/gingham/keymaps/via/keymap.c similarity index 100% rename from keyboards/gingham/keymaps/via/keymap.c rename to keyboards/yiancardesigns/gingham/keymaps/via/keymap.c diff --git a/keyboards/gingham/keymaps/via/readme.md b/keyboards/yiancardesigns/gingham/keymaps/via/readme.md similarity index 100% rename from keyboards/gingham/keymaps/via/readme.md rename to keyboards/yiancardesigns/gingham/keymaps/via/readme.md diff --git a/keyboards/yasui/keymaps/via/rules.mk b/keyboards/yiancardesigns/gingham/keymaps/via/rules.mk similarity index 100% rename from keyboards/yasui/keymaps/via/rules.mk rename to keyboards/yiancardesigns/gingham/keymaps/via/rules.mk diff --git a/keyboards/gingham/matrix.c b/keyboards/yiancardesigns/gingham/matrix.c similarity index 100% rename from keyboards/gingham/matrix.c rename to keyboards/yiancardesigns/gingham/matrix.c diff --git a/keyboards/gingham/readme.md b/keyboards/yiancardesigns/gingham/readme.md similarity index 91% rename from keyboards/gingham/readme.md rename to keyboards/yiancardesigns/gingham/readme.md index 089af1cf5eef..994fcaac5565 100644 --- a/keyboards/gingham/readme.md +++ b/keyboards/yiancardesigns/gingham/readme.md @@ -10,11 +10,11 @@ Hardware Availability: https://yiancar-designs.com/, https://novelkeys.xyz, http Make example for this keyboard (after setting up your build environment): - make gingham:default + make yiancardesigns/gingham:default Flashing example for this keyboard: - make gingham:default:flash + make yiancardesigns/gingham:default:flash Bootloader: use usbasploader HSGW's my repository. diff --git a/keyboards/gingham/rules.mk b/keyboards/yiancardesigns/gingham/rules.mk similarity index 100% rename from keyboards/gingham/rules.mk rename to keyboards/yiancardesigns/gingham/rules.mk diff --git a/keyboards/seigaiha/config.h b/keyboards/yiancardesigns/seigaiha/config.h similarity index 100% rename from keyboards/seigaiha/config.h rename to keyboards/yiancardesigns/seigaiha/config.h diff --git a/keyboards/seigaiha/info.json b/keyboards/yiancardesigns/seigaiha/info.json similarity index 100% rename from keyboards/seigaiha/info.json rename to keyboards/yiancardesigns/seigaiha/info.json diff --git a/keyboards/seigaiha/keymaps/default/keymap.c b/keyboards/yiancardesigns/seigaiha/keymaps/default/keymap.c similarity index 100% rename from keyboards/seigaiha/keymaps/default/keymap.c rename to keyboards/yiancardesigns/seigaiha/keymaps/default/keymap.c diff --git a/keyboards/seigaiha/keymaps/default/readme.md b/keyboards/yiancardesigns/seigaiha/keymaps/default/readme.md similarity index 100% rename from keyboards/seigaiha/keymaps/default/readme.md rename to keyboards/yiancardesigns/seigaiha/keymaps/default/readme.md diff --git a/keyboards/seigaiha/keymaps/via/keymap.c b/keyboards/yiancardesigns/seigaiha/keymaps/via/keymap.c similarity index 100% rename from keyboards/seigaiha/keymaps/via/keymap.c rename to keyboards/yiancardesigns/seigaiha/keymaps/via/keymap.c diff --git a/keyboards/seigaiha/keymaps/via/readme.md b/keyboards/yiancardesigns/seigaiha/keymaps/via/readme.md similarity index 100% rename from keyboards/seigaiha/keymaps/via/readme.md rename to keyboards/yiancardesigns/seigaiha/keymaps/via/readme.md diff --git a/keyboards/yiancardesigns/seigaiha/keymaps/via/rules.mk b/keyboards/yiancardesigns/seigaiha/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/yiancardesigns/seigaiha/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/seigaiha/matrix.c b/keyboards/yiancardesigns/seigaiha/matrix.c similarity index 100% rename from keyboards/seigaiha/matrix.c rename to keyboards/yiancardesigns/seigaiha/matrix.c diff --git a/keyboards/seigaiha/readme.md b/keyboards/yiancardesigns/seigaiha/readme.md similarity index 90% rename from keyboards/seigaiha/readme.md rename to keyboards/yiancardesigns/seigaiha/readme.md index fb0e8571ae68..8c8172356389 100644 --- a/keyboards/seigaiha/readme.md +++ b/keyboards/yiancardesigns/seigaiha/readme.md @@ -10,11 +10,11 @@ An alice layout kit with only through hole components. Make example for this keyboard (after setting up your build environment): - make seigaiha:default + make yiancardesigns/seigaiha:default Flashing example for this keyboard: - make seigaiha:default:flash + make yiancardesigns/seigaiha:default:flash Bootloader: use usbasploader from HSGW's repository. diff --git a/keyboards/seigaiha/rules.mk b/keyboards/yiancardesigns/seigaiha/rules.mk similarity index 100% rename from keyboards/seigaiha/rules.mk rename to keyboards/yiancardesigns/seigaiha/rules.mk diff --git a/keyboards/seigaiha/seigaiha.c b/keyboards/yiancardesigns/seigaiha/seigaiha.c similarity index 100% rename from keyboards/seigaiha/seigaiha.c rename to keyboards/yiancardesigns/seigaiha/seigaiha.c diff --git a/keyboards/seigaiha/seigaiha.h b/keyboards/yiancardesigns/seigaiha/seigaiha.h similarity index 100% rename from keyboards/seigaiha/seigaiha.h rename to keyboards/yiancardesigns/seigaiha/seigaiha.h diff --git a/keyboards/ymd75/rules.mk b/keyboards/ymd75/rules.mk deleted file mode 100644 index 756d20c54c15..000000000000 --- a/keyboards/ymd75/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = ymd75/rev1 diff --git a/keyboards/ymd75/ymd75.h b/keyboards/ymd75/ymd75.h deleted file mode 100644 index 134f08060f57..000000000000 --- a/keyboards/ymd75/ymd75.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "quantum.h" - -#if defined(KEYBOARD_ymd75_rev1) - #include "rev1.h" -#elif defined(KEYBOARD_ymd75_rev2) - #include "rev2.h" -#elif defined(KEYBOARD_ymd75_rev3) - #include "rev3.h" -#endif diff --git a/keyboards/ymdk_np21/config.h b/keyboards/ymdk/np21/config.h similarity index 100% rename from keyboards/ymdk_np21/config.h rename to keyboards/ymdk/np21/config.h diff --git a/keyboards/ymdk_np21/info.json b/keyboards/ymdk/np21/info.json similarity index 100% rename from keyboards/ymdk_np21/info.json rename to keyboards/ymdk/np21/info.json diff --git a/keyboards/ymdk_np21/keymaps/default/keymap.c b/keyboards/ymdk/np21/keymaps/default/keymap.c similarity index 100% rename from keyboards/ymdk_np21/keymaps/default/keymap.c rename to keyboards/ymdk/np21/keymaps/default/keymap.c diff --git a/keyboards/ymdk_np21/keymaps/default/readme.md b/keyboards/ymdk/np21/keymaps/default/readme.md similarity index 100% rename from keyboards/ymdk_np21/keymaps/default/readme.md rename to keyboards/ymdk/np21/keymaps/default/readme.md diff --git a/keyboards/ymdk_np21/keymaps/via/keymap.c b/keyboards/ymdk/np21/keymaps/via/keymap.c similarity index 100% rename from keyboards/ymdk_np21/keymaps/via/keymap.c rename to keyboards/ymdk/np21/keymaps/via/keymap.c diff --git a/keyboards/yd60mq/keymaps/via/rules.mk b/keyboards/ymdk/np21/keymaps/via/rules.mk similarity index 100% rename from keyboards/yd60mq/keymaps/via/rules.mk rename to keyboards/ymdk/np21/keymaps/via/rules.mk diff --git a/keyboards/ymdk_np21/ymdk_np21.c b/keyboards/ymdk/np21/np21.c similarity index 96% rename from keyboards/ymdk_np21/ymdk_np21.c rename to keyboards/ymdk/np21/np21.c index 3ca0e8baa04a..824cfb0d1a6e 100644 --- a/keyboards/ymdk_np21/ymdk_np21.c +++ b/keyboards/ymdk/np21/np21.c @@ -16,4 +16,4 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "ymdk_np21.h" +#include "np21.h" diff --git a/keyboards/ymdk_np21/ymdk_np21.h b/keyboards/ymdk/np21/np21.h similarity index 100% rename from keyboards/ymdk_np21/ymdk_np21.h rename to keyboards/ymdk/np21/np21.h diff --git a/keyboards/ymdk_np21/readme.md b/keyboards/ymdk/np21/readme.md similarity index 94% rename from keyboards/ymdk_np21/readme.md rename to keyboards/ymdk/np21/readme.md index decd30b27577..e9eaad9b7be1 100644 --- a/keyboards/ymdk_np21/readme.md +++ b/keyboards/ymdk/np21/readme.md @@ -10,11 +10,11 @@ ps2avrGB based number-pad sold fully assembled by YMDK on Aliexpress. Make example for this keyboard (after setting up your build environment): - make ymdk_np21:default + make ymdk/np21:default Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) - make ymdk_np21:default:flash + make ymdk/np21:default:flash **Reset Key**: Hold down the 'Top Left Key' (USB on top) while plugging in the keyboard. diff --git a/keyboards/ymdk_np21/rules.mk b/keyboards/ymdk/np21/rules.mk similarity index 100% rename from keyboards/ymdk_np21/rules.mk rename to keyboards/ymdk/np21/rules.mk diff --git a/keyboards/yd60mq/12led/config.h b/keyboards/ymdk/yd60mq/12led/config.h similarity index 100% rename from keyboards/yd60mq/12led/config.h rename to keyboards/ymdk/yd60mq/12led/config.h diff --git a/keyboards/yd60mq/12led/readme.md b/keyboards/ymdk/yd60mq/12led/readme.md similarity index 100% rename from keyboards/yd60mq/12led/readme.md rename to keyboards/ymdk/yd60mq/12led/readme.md diff --git a/keyboards/yd60mq/16led/rules.mk b/keyboards/ymdk/yd60mq/12led/rules.mk similarity index 100% rename from keyboards/yd60mq/16led/rules.mk rename to keyboards/ymdk/yd60mq/12led/rules.mk diff --git a/keyboards/yd60mq/16led/config.h b/keyboards/ymdk/yd60mq/16led/config.h similarity index 100% rename from keyboards/yd60mq/16led/config.h rename to keyboards/ymdk/yd60mq/16led/config.h diff --git a/keyboards/yd60mq/16led/readme.md b/keyboards/ymdk/yd60mq/16led/readme.md similarity index 100% rename from keyboards/yd60mq/16led/readme.md rename to keyboards/ymdk/yd60mq/16led/readme.md diff --git a/keyboards/zinc/.noci b/keyboards/ymdk/yd60mq/16led/rules.mk similarity index 100% rename from keyboards/zinc/.noci rename to keyboards/ymdk/yd60mq/16led/rules.mk diff --git a/keyboards/yd60mq/config.h b/keyboards/ymdk/yd60mq/config.h similarity index 100% rename from keyboards/yd60mq/config.h rename to keyboards/ymdk/yd60mq/config.h diff --git a/keyboards/yd60mq/info.json b/keyboards/ymdk/yd60mq/info.json similarity index 100% rename from keyboards/yd60mq/info.json rename to keyboards/ymdk/yd60mq/info.json diff --git a/keyboards/yd60mq/keymaps/64key/keymap.c b/keyboards/ymdk/yd60mq/keymaps/64key/keymap.c similarity index 100% rename from keyboards/yd60mq/keymaps/64key/keymap.c rename to keyboards/ymdk/yd60mq/keymaps/64key/keymap.c diff --git a/keyboards/yd60mq/keymaps/default/keymap.c b/keyboards/ymdk/yd60mq/keymaps/default/keymap.c similarity index 100% rename from keyboards/yd60mq/keymaps/default/keymap.c rename to keyboards/ymdk/yd60mq/keymaps/default/keymap.c diff --git a/keyboards/yd60mq/keymaps/iso/keymap.c b/keyboards/ymdk/yd60mq/keymaps/iso/keymap.c similarity index 100% rename from keyboards/yd60mq/keymaps/iso/keymap.c rename to keyboards/ymdk/yd60mq/keymaps/iso/keymap.c diff --git a/keyboards/yd60mq/keymaps/krusli/keymap.c b/keyboards/ymdk/yd60mq/keymaps/krusli/keymap.c similarity index 100% rename from keyboards/yd60mq/keymaps/krusli/keymap.c rename to keyboards/ymdk/yd60mq/keymaps/krusli/keymap.c diff --git a/keyboards/yd60mq/keymaps/via/keymap.c b/keyboards/ymdk/yd60mq/keymaps/via/keymap.c similarity index 100% rename from keyboards/yd60mq/keymaps/via/keymap.c rename to keyboards/ymdk/yd60mq/keymaps/via/keymap.c diff --git a/keyboards/ymdk_np21/keymaps/via/rules.mk b/keyboards/ymdk/yd60mq/keymaps/via/rules.mk similarity index 100% rename from keyboards/ymdk_np21/keymaps/via/rules.mk rename to keyboards/ymdk/yd60mq/keymaps/via/rules.mk diff --git a/keyboards/yd60mq/readme.md b/keyboards/ymdk/yd60mq/readme.md similarity index 70% rename from keyboards/yd60mq/readme.md rename to keyboards/ymdk/yd60mq/readme.md index 32073da63153..9a8dece4dadb 100644 --- a/keyboards/yd60mq/readme.md +++ b/keyboards/ymdk/yd60mq/readme.md @@ -13,17 +13,17 @@ Customizable 60% PCB by [YMDK](https://ymdk.aliexpress.com/store/429151?spm=2114 Make example for this keyboard (after setting up your build environment): ```sh -make yd60mq:default # builds the 12 LED variant -make yd60mq/12led:default # also builds the 12 LED variant -make yd60mq/16led:default # builds the 16 LED variant +make ymdk/yd60mq:default # builds the 12 LED variant +make ymdk/yd60mq/12led:default # also builds the 12 LED variant +make ymdk/yd60mq/16led:default # builds the 16 LED variant ``` The keyboard uses a DFU bootloader. To make a keymap and use dfu to flash it: ```sh -make yd60mq:default:flash # builds and flashes the 12 LED variant -make yd60mq/12led:default:flash # also builds and flashes the 12 LED variant -make yd60mq/16led:default:flash # builds and flashes the 16 LED variant +make ymdk/yd60mq:default:flash # builds and flashes the 12 LED variant +make ymdk/yd60mq/12led:default:flash # also builds and flashes the 12 LED variant +make ymdk/yd60mq/16led:default:flash # builds and flashes the 16 LED variant ``` 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/yd60mq/rules.mk b/keyboards/ymdk/yd60mq/rules.mk similarity index 95% rename from keyboards/yd60mq/rules.mk rename to keyboards/ymdk/yd60mq/rules.mk index 824b053a88d3..5161d11ac17a 100644 --- a/keyboards/yd60mq/rules.mk +++ b/keyboards/ymdk/yd60mq/rules.mk @@ -19,4 +19,4 @@ AUDIO_ENABLE = no # Audio output LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_ansi_tsangan 60_hhkb 60_iso 60_iso_split_bs_rshift 60_iso_tsangan -DEFAULT_FOLDER = yd60mq/12led +DEFAULT_FOLDER = ymdk/yd60mq/12led diff --git a/keyboards/yd60mq/yd60mq.c b/keyboards/ymdk/yd60mq/yd60mq.c similarity index 100% rename from keyboards/yd60mq/yd60mq.c rename to keyboards/ymdk/yd60mq/yd60mq.c diff --git a/keyboards/yd60mq/yd60mq.h b/keyboards/ymdk/yd60mq/yd60mq.h similarity index 100% rename from keyboards/yd60mq/yd60mq.h rename to keyboards/ymdk/yd60mq/yd60mq.h diff --git a/keyboards/zinc/rev1/.noci b/keyboards/ymdk/ymd75/.noci similarity index 100% rename from keyboards/zinc/rev1/.noci rename to keyboards/ymdk/ymd75/.noci diff --git a/keyboards/ymd75/config.h b/keyboards/ymdk/ymd75/config.h similarity index 100% rename from keyboards/ymd75/config.h rename to keyboards/ymdk/ymd75/config.h diff --git a/keyboards/ymd75/info.json b/keyboards/ymdk/ymd75/info.json similarity index 100% rename from keyboards/ymd75/info.json rename to keyboards/ymdk/ymd75/info.json diff --git a/keyboards/ymd75/keymaps/default/keymap.c b/keyboards/ymdk/ymd75/keymaps/default/keymap.c similarity index 100% rename from keyboards/ymd75/keymaps/default/keymap.c rename to keyboards/ymdk/ymd75/keymaps/default/keymap.c diff --git a/keyboards/ymd75/keymaps/default_iso/keymap.c b/keyboards/ymdk/ymd75/keymaps/default_iso/keymap.c similarity index 100% rename from keyboards/ymd75/keymaps/default_iso/keymap.c rename to keyboards/ymdk/ymd75/keymaps/default_iso/keymap.c diff --git a/keyboards/ymd75/keymaps/default_iso_rwkl/keymap.c b/keyboards/ymdk/ymd75/keymaps/default_iso_rwkl/keymap.c similarity index 100% rename from keyboards/ymd75/keymaps/default_iso_rwkl/keymap.c rename to keyboards/ymdk/ymd75/keymaps/default_iso_rwkl/keymap.c diff --git a/keyboards/ymd75/keymaps/via/keymap.c b/keyboards/ymdk/ymd75/keymaps/via/keymap.c similarity index 100% rename from keyboards/ymd75/keymaps/via/keymap.c rename to keyboards/ymdk/ymd75/keymaps/via/keymap.c diff --git a/keyboards/ymd75/keymaps/via/rules.mk b/keyboards/ymdk/ymd75/keymaps/via/rules.mk similarity index 100% rename from keyboards/ymd75/keymaps/via/rules.mk rename to keyboards/ymdk/ymd75/keymaps/via/rules.mk diff --git a/keyboards/ymd75/readme.md b/keyboards/ymdk/ymd75/readme.md similarity index 94% rename from keyboards/ymd75/readme.md rename to keyboards/ymdk/ymd75/readme.md index 99e9f656c07e..78b4d089af33 100644 --- a/keyboards/ymd75/readme.md +++ b/keyboards/ymdk/ymd75/readme.md @@ -13,11 +13,11 @@ This firmware can also be flashed onto the KBDFans KBD75 Round 2 Bootmapper Clie Make example for this keyboard (after setting up your build environment): - make ymd75/rev1:default + make ymdk/ymd75/rev1:default Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) - make ymd75/rev1:default:flash + make ymdk/ymd75/rev1:default:flash **Reset Key**: Hold down the key located at *Key below the top right key*, commonly programmed as *Backspace* while plugging in the keyboard. On PCB revision 2, enter the bootloader by holding `L_CTRL` while plugging in the keyboard. diff --git a/keyboards/zinc/reva/.noci b/keyboards/ymdk/ymd75/rev1/.noci similarity index 100% rename from keyboards/zinc/reva/.noci rename to keyboards/ymdk/ymd75/rev1/.noci diff --git a/keyboards/ymd75/rev1/config.h b/keyboards/ymdk/ymd75/rev1/config.h similarity index 100% rename from keyboards/ymd75/rev1/config.h rename to keyboards/ymdk/ymd75/rev1/config.h diff --git a/keyboards/ymd75/rev1/rev1.c b/keyboards/ymdk/ymd75/rev1/rev1.c similarity index 100% rename from keyboards/ymd75/rev1/rev1.c rename to keyboards/ymdk/ymd75/rev1/rev1.c diff --git a/keyboards/ymd75/rev1/rev1.h b/keyboards/ymdk/ymd75/rev1/rev1.h similarity index 100% rename from keyboards/ymd75/rev1/rev1.h rename to keyboards/ymdk/ymd75/rev1/rev1.h diff --git a/keyboards/ymd75/rev1/rules.mk b/keyboards/ymdk/ymd75/rev1/rules.mk similarity index 100% rename from keyboards/ymd75/rev1/rules.mk rename to keyboards/ymdk/ymd75/rev1/rules.mk diff --git a/keyboards/ymdk/ymd75/rev2/.noci b/keyboards/ymdk/ymd75/rev2/.noci new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/keyboards/ymd75/rev2/config.h b/keyboards/ymdk/ymd75/rev2/config.h similarity index 100% rename from keyboards/ymd75/rev2/config.h rename to keyboards/ymdk/ymd75/rev2/config.h diff --git a/keyboards/ymd75/rev2/rev2.c b/keyboards/ymdk/ymd75/rev2/rev2.c similarity index 100% rename from keyboards/ymd75/rev2/rev2.c rename to keyboards/ymdk/ymd75/rev2/rev2.c diff --git a/keyboards/ymd75/rev2/rev2.h b/keyboards/ymdk/ymd75/rev2/rev2.h similarity index 100% rename from keyboards/ymd75/rev2/rev2.h rename to keyboards/ymdk/ymd75/rev2/rev2.h diff --git a/keyboards/ymd75/rev2/rules.mk b/keyboards/ymdk/ymd75/rev2/rules.mk similarity index 100% rename from keyboards/ymd75/rev2/rules.mk rename to keyboards/ymdk/ymd75/rev2/rules.mk diff --git a/keyboards/ymd75/rev3/config.h b/keyboards/ymdk/ymd75/rev3/config.h similarity index 100% rename from keyboards/ymd75/rev3/config.h rename to keyboards/ymdk/ymd75/rev3/config.h diff --git a/keyboards/ymd75/rev3/rev3.c b/keyboards/ymdk/ymd75/rev3/rev3.c similarity index 100% rename from keyboards/ymd75/rev3/rev3.c rename to keyboards/ymdk/ymd75/rev3/rev3.c diff --git a/keyboards/ymd75/rev3/rev3.h b/keyboards/ymdk/ymd75/rev3/rev3.h similarity index 100% rename from keyboards/ymd75/rev3/rev3.h rename to keyboards/ymdk/ymd75/rev3/rev3.h diff --git a/keyboards/ymd75/rev3/rules.mk b/keyboards/ymdk/ymd75/rev3/rules.mk similarity index 100% rename from keyboards/ymd75/rev3/rules.mk rename to keyboards/ymdk/ymd75/rev3/rules.mk diff --git a/keyboards/ymdk/ymd75/rules.mk b/keyboards/ymdk/ymd75/rules.mk new file mode 100644 index 000000000000..ec66e0734a6a --- /dev/null +++ b/keyboards/ymdk/ymd75/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = ymdk/ymd75/rev1 diff --git a/keyboards/ymd75/ymd75.c b/keyboards/ymdk/ymd75/ymd75.c similarity index 100% rename from keyboards/ymd75/ymd75.c rename to keyboards/ymdk/ymd75/ymd75.c diff --git a/keyboards/ymdk/ymd75/ymd75.h b/keyboards/ymdk/ymd75/ymd75.h new file mode 100644 index 000000000000..dbaf93e7db22 --- /dev/null +++ b/keyboards/ymdk/ymd75/ymd75.h @@ -0,0 +1,11 @@ +#pragma once + +#include "quantum.h" + +#if defined(KEYBOARD_ymdk_ymd75_rev1) + #include "rev1.h" +#elif defined(KEYBOARD_ymdk_ymd75_rev2) + #include "rev2.h" +#elif defined(KEYBOARD_ymdk_ymd75_rev3) + #include "rev3.h" +#endif diff --git a/keyboards/ymd96/config.h b/keyboards/ymdk/ymd96/config.h similarity index 100% rename from keyboards/ymd96/config.h rename to keyboards/ymdk/ymd96/config.h diff --git a/keyboards/ymd96/info.json b/keyboards/ymdk/ymd96/info.json similarity index 100% rename from keyboards/ymd96/info.json rename to keyboards/ymdk/ymd96/info.json diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/README.md b/keyboards/ymdk/ymd96/keymaps/AnthonyWharton/README.md similarity index 100% rename from keyboards/ymd96/keymaps/AnthonyWharton/README.md rename to keyboards/ymdk/ymd96/keymaps/AnthonyWharton/README.md diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/config.h b/keyboards/ymdk/ymd96/keymaps/AnthonyWharton/config.h similarity index 100% rename from keyboards/ymd96/keymaps/AnthonyWharton/config.h rename to keyboards/ymdk/ymd96/keymaps/AnthonyWharton/config.h diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymdk/ymd96/keymaps/AnthonyWharton/keymap.c similarity index 100% rename from keyboards/ymd96/keymaps/AnthonyWharton/keymap.c rename to keyboards/ymdk/ymd96/keymaps/AnthonyWharton/keymap.c diff --git a/keyboards/ymd96/keymaps/default/keymap.c b/keyboards/ymdk/ymd96/keymaps/default/keymap.c similarity index 100% rename from keyboards/ymd96/keymaps/default/keymap.c rename to keyboards/ymdk/ymd96/keymaps/default/keymap.c diff --git a/keyboards/ymd96/keymaps/epx/keymap.c b/keyboards/ymdk/ymd96/keymaps/epx/keymap.c similarity index 100% rename from keyboards/ymd96/keymaps/epx/keymap.c rename to keyboards/ymdk/ymd96/keymaps/epx/keymap.c diff --git a/keyboards/ymd96/keymaps/hgoel89/config.h b/keyboards/ymdk/ymd96/keymaps/hgoel89/config.h similarity index 100% rename from keyboards/ymd96/keymaps/hgoel89/config.h rename to keyboards/ymdk/ymd96/keymaps/hgoel89/config.h diff --git a/keyboards/ymd96/keymaps/hgoel89/keymap.c b/keyboards/ymdk/ymd96/keymaps/hgoel89/keymap.c similarity index 100% rename from keyboards/ymd96/keymaps/hgoel89/keymap.c rename to keyboards/ymdk/ymd96/keymaps/hgoel89/keymap.c diff --git a/keyboards/ymd96/keymaps/hgoel89/readme.md b/keyboards/ymdk/ymd96/keymaps/hgoel89/readme.md similarity index 100% rename from keyboards/ymd96/keymaps/hgoel89/readme.md rename to keyboards/ymdk/ymd96/keymaps/hgoel89/readme.md diff --git a/keyboards/ymd96/keymaps/hgoel89/rules.mk b/keyboards/ymdk/ymd96/keymaps/hgoel89/rules.mk similarity index 100% rename from keyboards/ymd96/keymaps/hgoel89/rules.mk rename to keyboards/ymdk/ymd96/keymaps/hgoel89/rules.mk diff --git a/keyboards/ymd96/readme.md b/keyboards/ymdk/ymd96/readme.md similarity index 94% rename from keyboards/ymd96/readme.md rename to keyboards/ymdk/ymd96/readme.md index 59d6b733790b..6a967a49c258 100644 --- a/keyboards/ymd96/readme.md +++ b/keyboards/ymdk/ymd96/readme.md @@ -8,11 +8,11 @@ A 96-keyboard which supports both ANSI and ISO along with many different layout Make example for this keyboard (after setting up your build environment): - make ymd96:default + make ymdk/ymd96:default Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) - make ymd96:default:flash + make ymdk/ymd96:default:flash **Reset Key**: Hold down the key commonly programmed as *L_Ctrl* while plugging in the keyboard. diff --git a/keyboards/ymd96/rules.mk b/keyboards/ymdk/ymd96/rules.mk similarity index 100% rename from keyboards/ymd96/rules.mk rename to keyboards/ymdk/ymd96/rules.mk diff --git a/keyboards/ymd96/ymd96.c b/keyboards/ymdk/ymd96/ymd96.c similarity index 100% rename from keyboards/ymd96/ymd96.c rename to keyboards/ymdk/ymd96/ymd96.c diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymdk/ymd96/ymd96.h similarity index 100% rename from keyboards/ymd96/ymd96.h rename to keyboards/ymdk/ymd96/ymd96.h diff --git a/keyboards/yoichiro/lunakey_mini/keymaps/via/rules.mk b/keyboards/yoichiro/lunakey_mini/keymaps/via/rules.mk index 8b55a3b731fb..989d0d173c5e 100644 --- a/keyboards/yoichiro/lunakey_mini/keymaps/via/rules.mk +++ b/keyboards/yoichiro/lunakey_mini/keymaps/via/rules.mk @@ -2,4 +2,4 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB Underglow AUDIO_ENABLE = no # Enable Audio output OLED_ENABLE = no # Enable OLED Display VIA_ENABLE = yes # Enable VIA support -LTO_ENABLE = yes # CFLAGS=flto +LTO_ENABLE = yes # Reduce firmware size diff --git a/keyboards/yosino58/rev1/matrix.c b/keyboards/yosino58/rev1/matrix.c index 3db40b3829da..e2be7113bf6d 100644 --- a/keyboards/yosino58/rev1/matrix.c +++ b/keyboards/yosino58/rev1/matrix.c @@ -289,12 +289,6 @@ void matrix_slave_scan(void) { #endif } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/dozen0/config.h b/keyboards/yynmt/dozen0/config.h similarity index 100% rename from keyboards/dozen0/config.h rename to keyboards/yynmt/dozen0/config.h diff --git a/keyboards/dozen0/dozen0.c b/keyboards/yynmt/dozen0/dozen0.c similarity index 100% rename from keyboards/dozen0/dozen0.c rename to keyboards/yynmt/dozen0/dozen0.c diff --git a/keyboards/dozen0/dozen0.h b/keyboards/yynmt/dozen0/dozen0.h similarity index 100% rename from keyboards/dozen0/dozen0.h rename to keyboards/yynmt/dozen0/dozen0.h diff --git a/keyboards/dozen0/info.json b/keyboards/yynmt/dozen0/info.json similarity index 100% rename from keyboards/dozen0/info.json rename to keyboards/yynmt/dozen0/info.json diff --git a/keyboards/dozen0/keymaps/default/keymap.c b/keyboards/yynmt/dozen0/keymaps/default/keymap.c similarity index 100% rename from keyboards/dozen0/keymaps/default/keymap.c rename to keyboards/yynmt/dozen0/keymaps/default/keymap.c diff --git a/keyboards/dozen0/keymaps/default/readme.md b/keyboards/yynmt/dozen0/keymaps/default/readme.md similarity index 100% rename from keyboards/dozen0/keymaps/default/readme.md rename to keyboards/yynmt/dozen0/keymaps/default/readme.md diff --git a/keyboards/dozen0/keymaps/f12/keymap.c b/keyboards/yynmt/dozen0/keymaps/f12/keymap.c similarity index 100% rename from keyboards/dozen0/keymaps/f12/keymap.c rename to keyboards/yynmt/dozen0/keymaps/f12/keymap.c diff --git a/keyboards/dozen0/keymaps/via/keymap.c b/keyboards/yynmt/dozen0/keymaps/via/keymap.c similarity index 100% rename from keyboards/dozen0/keymaps/via/keymap.c rename to keyboards/yynmt/dozen0/keymaps/via/keymap.c diff --git a/keyboards/yynmt/dozen0/keymaps/via/rules.mk b/keyboards/yynmt/dozen0/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/yynmt/dozen0/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/dozen0/readme.md b/keyboards/yynmt/dozen0/readme.md similarity index 95% rename from keyboards/dozen0/readme.md rename to keyboards/yynmt/dozen0/readme.md index 7ef119246199..c215e96e4c96 100644 --- a/keyboards/dozen0/readme.md +++ b/keyboards/yynmt/dozen0/readme.md @@ -10,6 +10,6 @@ Hardware Availability: links to where you can find this hardware Make example for this keyboard (after setting up your build environment): - make dozen0:default + make yynmt/dozen0: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/dozen0/rules.mk b/keyboards/yynmt/dozen0/rules.mk similarity index 100% rename from keyboards/dozen0/rules.mk rename to keyboards/yynmt/dozen0/rules.mk diff --git a/keyboards/kagamidget/config.h b/keyboards/yynmt/kagamidget/config.h similarity index 100% rename from keyboards/kagamidget/config.h rename to keyboards/yynmt/kagamidget/config.h diff --git a/keyboards/kagamidget/info.json b/keyboards/yynmt/kagamidget/info.json similarity index 100% rename from keyboards/kagamidget/info.json rename to keyboards/yynmt/kagamidget/info.json diff --git a/keyboards/kagamidget/kagamidget.c b/keyboards/yynmt/kagamidget/kagamidget.c similarity index 100% rename from keyboards/kagamidget/kagamidget.c rename to keyboards/yynmt/kagamidget/kagamidget.c diff --git a/keyboards/kagamidget/kagamidget.h b/keyboards/yynmt/kagamidget/kagamidget.h similarity index 100% rename from keyboards/kagamidget/kagamidget.h rename to keyboards/yynmt/kagamidget/kagamidget.h diff --git a/keyboards/kagamidget/keymaps/default/keymap.c b/keyboards/yynmt/kagamidget/keymaps/default/keymap.c similarity index 100% rename from keyboards/kagamidget/keymaps/default/keymap.c rename to keyboards/yynmt/kagamidget/keymaps/default/keymap.c diff --git a/keyboards/kagamidget/keymaps/default/readme.md b/keyboards/yynmt/kagamidget/keymaps/default/readme.md similarity index 100% rename from keyboards/kagamidget/keymaps/default/readme.md rename to keyboards/yynmt/kagamidget/keymaps/default/readme.md diff --git a/keyboards/kagamidget/readme.md b/keyboards/yynmt/kagamidget/readme.md similarity index 94% rename from keyboards/kagamidget/readme.md rename to keyboards/yynmt/kagamidget/readme.md index af38fdd8589d..78ec4f3c7bf3 100644 --- a/keyboards/kagamidget/readme.md +++ b/keyboards/yynmt/kagamidget/readme.md @@ -9,6 +9,6 @@ Hardware Supported: KagaMidget PCBs, ProMicro supported Make example for this keyboard (after setting up your build environment): - make kagamidget:default + make yynmt/kagamidget: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/kagamidget/rules.mk b/keyboards/yynmt/kagamidget/rules.mk similarity index 100% rename from keyboards/kagamidget/rules.mk rename to keyboards/yynmt/kagamidget/rules.mk diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index f16dca1de8b9..6b1012fae7aa 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -108,6 +108,12 @@ def generate_config_items(kb_info_json, config_h_lines): config_h_lines.append(f'#ifndef {key}') config_h_lines.append(f'# define {key} {value}') config_h_lines.append(f'#endif // {key}') + elif key_type == 'bcd_version': + (major, minor, revision) = config_value.split('.') + config_h_lines.append('') + config_h_lines.append(f'#ifndef {config_key}') + config_h_lines.append(f'# define {config_key} 0x{major.zfill(2)}{minor}{revision}') + config_h_lines.append(f'#endif // {config_key}') else: config_h_lines.append('') config_h_lines.append(f'#ifndef {config_key}') diff --git a/lib/python/qmk/cli/generate/develop_pr_list.py b/lib/python/qmk/cli/generate/develop_pr_list.py index 07e46752a6da..549db5b185fd 100755 --- a/lib/python/qmk/cli/generate/develop_pr_list.py +++ b/lib/python/qmk/cli/generate/develop_pr_list.py @@ -12,6 +12,15 @@ clean1_expr = re.compile(r'\[(develop|keyboard|keymap|core|cli|bug|docs|feature)\]', flags=re.IGNORECASE) clean2_expr = re.compile(r'^(develop|keyboard|keymap|core|cli|bug|docs|feature):', flags=re.IGNORECASE) +ignored_titles = ["Format code according to conventions"] + + +def _is_ignored(title): + for ignore in ignored_titles: + if ignore in title: + return True + return False + def _get_pr_info(cache, gh, pr_num): pull = cache.get(f'pull:{pr_num}') @@ -81,7 +90,9 @@ def fix_or_normal(info, fixes_collection, normal_collection): else: normal_collection.append(info) - if "dependencies" in commit_info['pr_labels']: + if _is_ignored(commit_info['title']): + return + elif "dependencies" in commit_info['pr_labels']: fix_or_normal(commit_info, pr_list_bugs, pr_list_dependencies) elif "core" in commit_info['pr_labels']: fix_or_normal(commit_info, pr_list_bugs, pr_list_core) @@ -97,7 +108,7 @@ def fix_or_normal(info, fixes_collection, normal_collection): match = git_expr.search(line) if match: pr_info = _get_pr_info(cache, gh, match.group("pr")) - commit_info = {'hash': match.group("hash"), 'title': match.group("title"), 'pr_num': int(match.group("pr")), 'pr_labels': [label.name for label in pr_info.labels.items]} + commit_info = {'hash': match.group("hash"), 'title': pr_info['title'], 'pr_num': int(match.group("pr")), 'pr_labels': [label.name for label in pr_info.labels.items]} _categorise_commit(commit_info) def _dump_commit_list(name, collection): diff --git a/lib/python/qmk/cli/generate/version_h.py b/lib/python/qmk/cli/generate/version_h.py index b8e52588c454..69341e36f084 100644 --- a/lib/python/qmk/cli/generate/version_h.py +++ b/lib/python/qmk/cli/generate/version_h.py @@ -20,6 +20,9 @@ def generate_version_h(cli): version_h = create_version_h(cli.args.skip_git, cli.args.skip_all) if cli.args.output: + cli.args.output.parent.mkdir(parents=True, exist_ok=True) + if cli.args.output.exists(): + cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) cli.args.output.write_text(version_h) if not cli.args.quiet: diff --git a/lib/python/qmk/cli/multibuild.py b/lib/python/qmk/cli/multibuild.py index 85ed0fa1e98f..dff8c8842218 100755 --- a/lib/python/qmk/cli/multibuild.py +++ b/lib/python/qmk/cli/multibuild.py @@ -32,6 +32,7 @@ def _is_split(keyboard_name): @cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") @cli.argument('-f', '--filter', arg_only=True, action='append', default=[], help="Filter the list of keyboards based on the supplied value in rules.mk. Supported format is 'SPLIT_KEYBOARD=yes'. May be passed multiple times.") @cli.argument('-km', '--keymap', type=str, default='default', help="The keymap name to build. Default is 'default'.") +@cli.argument('-e', '--env', arg_only=True, action='append', default=[], help="Set a variable to be passed to make. May be passed multiple times.") @cli.subcommand('Compile QMK Firmware for all keyboards.', hidden=False if cli.config.user.developer else True) def multibuild(cli): """Compile QMK Firmware against all keyboards. @@ -68,7 +69,7 @@ def multibuild(cli): all: {keyboard_safe}_binary {keyboard_safe}_binary: @rm -f "{QMK_FIRMWARE}/.build/failed.log.{keyboard_safe}" || true - +@$(MAKE) -C "{QMK_FIRMWARE}" -f "{QMK_FIRMWARE}/build_keyboard.mk" KEYBOARD="{keyboard_name}" KEYMAP="{cli.args.keymap}" REQUIRE_PLATFORM_KEY= COLOR=true SILENT=false \\ + +@$(MAKE) -C "{QMK_FIRMWARE}" -f "{QMK_FIRMWARE}/builddefs/build_keyboard.mk" KEYBOARD="{keyboard_name}" KEYMAP="{cli.args.keymap}" REQUIRE_PLATFORM_KEY= COLOR=true SILENT=false {' '.join(cli.args.env)} \\ >>"{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" 2>&1 \\ || cp "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" "{QMK_FIRMWARE}/.build/failed.log.{os.getpid()}.{keyboard_safe}" @{{ grep '\[ERRORS\]' "{QMK_FIRMWARE}/.build/build.log.{os.getpid()}.{keyboard_safe}" >/dev/null 2>&1 && printf "Build %-64s \e[1;31m[ERRORS]\e[0m\\n" "{keyboard_name}:{cli.args.keymap}" ; }} \\ diff --git a/lib/python/qmk/cli/new/keyboard.py b/lib/python/qmk/cli/new/keyboard.py index 4093b8c90d06..6fa9ad5b2c44 100644 --- a/lib/python/qmk/cli/new/keyboard.py +++ b/lib/python/qmk/cli/new/keyboard.py @@ -1,15 +1,45 @@ """This script automates the creation of new keyboard directories using a starter template. """ +import re +import json +import shutil from datetime import date from pathlib import Path -import re +from dotty_dict import dotty -from qmk.commands import git_get_username -import qmk.path from milc import cli from milc.questions import choice, question -KEYBOARD_TYPES = ['avr', 'ps2avrgb'] +from qmk.commands import git_get_username +from qmk.json_schema import load_jsonschema +from qmk.path import keyboard +from qmk.json_encoders import InfoJSONEncoder +from qmk.json_schema import deep_update +from qmk.constants import MCU2BOOTLOADER + +COMMUNITY = Path('layouts/default/') +TEMPLATE = Path('data/templates/keyboard/') + +# defaults +schema = dotty(load_jsonschema('keyboard')) +mcu_types = sorted(schema["properties.processor.enum"], key=str.casefold) +available_layouts = sorted([x.name for x in COMMUNITY.iterdir() if x.is_dir()]) + + +def mcu_type(mcu): + """Callable for argparse validation. + """ + if mcu not in mcu_types: + raise ValueError + return mcu + + +def layout_type(layout): + """Callable for argparse validation. + """ + if layout not in available_layouts: + raise ValueError + return layout def keyboard_name(name): @@ -27,113 +57,193 @@ def validate_keyboard_name(name): return bool(regex.match(name)) -@cli.argument('-kb', '--keyboard', help='Specify the name for the new keyboard directory', arg_only=True, type=keyboard_name) -@cli.argument('-t', '--type', help='Specify the keyboard type', arg_only=True, choices=KEYBOARD_TYPES) -@cli.argument('-u', '--username', help='Specify your username (default from Git config)', arg_only=True) -@cli.argument('-n', '--realname', help='Specify your real name if you want to use that. Defaults to username', arg_only=True) -@cli.subcommand('Creates a new keyboard directory') -def new_keyboard(cli): - """Creates a new keyboard. +def select_default_bootloader(mcu): + """Provide sane defaults for bootloader """ - cli.log.info('{style_bright}Generating a new QMK keyboard directory{style_normal}') - cli.echo('') + return MCU2BOOTLOADER.get(mcu, "custom") - # Get keyboard name - new_keyboard_name = None - while not new_keyboard_name: - new_keyboard_name = cli.args.keyboard if cli.args.keyboard else question('Keyboard Name:') - if not validate_keyboard_name(new_keyboard_name): - cli.log.error('Keyboard names must contain only {fg_cyan}lowercase a-z{fg_reset}, {fg_cyan}0-9{fg_reset}, and {fg_cyan}_{fg_reset}! Please choose a different name.') - # Exit if passed by arg - if cli.args.keyboard: - return False +def replace_placeholders(src, dest, tokens): + """Replaces the given placeholders in each template file. + """ + content = src.read_text() + for key, value in tokens.items(): + content = content.replace(f'%{key}%', value) - new_keyboard_name = None - continue + dest.write_text(content) - keyboard_path = qmk.path.keyboard(new_keyboard_name) - if keyboard_path.exists(): - cli.log.error(f'Keyboard {{fg_cyan}}{new_keyboard_name}{{fg_reset}} already exists! Please choose a different name.') - # Exit if passed by arg - if cli.args.keyboard: - return False +def augment_community_info(src, dest): + """Splice in any additional data into info.json + """ + info = json.loads(src.read_text()) + template = json.loads(dest.read_text()) - new_keyboard_name = None + # merge community with template + deep_update(info, template) - # Get keyboard type - keyboard_type = cli.args.type if cli.args.type else choice('Keyboard Type:', KEYBOARD_TYPES, default=0) + # avoid assumptions on macro name by using the first available + first_layout = next(iter(info["layouts"].values()))["layout"] - # Get username - user_name = None - while not user_name: - user_name = question('Your GitHub User Name:', default=find_user_name()) + # guess at width and height now its optional + width, height = (0, 0) + for item in first_layout: + width = max(width, int(item["x"]) + 1) + height = max(height, int(item["y"]) + 1) - if not user_name: - cli.log.error('You didn\'t provide a username, and we couldn\'t find one set in your QMK or Git configs. Please try again.') + info["matrix_pins"] = { + "cols": ["C2"] * width, + "rows": ["D1"] * height, + } - # Exit if passed by arg - if cli.args.username: - return False + # assume a 1:1 mapping on matrix to electrical + for item in first_layout: + item["matrix"] = [int(item["y"]), int(item["x"])] - real_name = None - while not real_name: - real_name = question('Your real name:', default=user_name) + # finally write out the updated info.json + dest.write_text(json.dumps(info, cls=InfoJSONEncoder)) - keyboard_basename = keyboard_path.name - replacements = { - "YEAR": str(date.today().year), - "KEYBOARD": keyboard_basename, - "USER_NAME": user_name, - "YOUR_NAME": real_name, - } - template_dir = Path('data/templates') - template_tree(template_dir / 'base', keyboard_path, replacements) - template_tree(template_dir / keyboard_type, keyboard_path, replacements) +def _question(*args, **kwargs): + """Ugly workaround until 'milc' learns to display a repromt msg + """ + # TODO: Remove this once milc.questions.question handles reprompt messages - cli.echo('') - cli.log.info(f'{{fg_green}}Created a new keyboard called {{fg_cyan}}{new_keyboard_name}{{fg_green}}.{{fg_reset}}') - cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}{keyboard_path}{{fg_reset}},') - cli.log.info('or open the directory in your preferred text editor.') + reprompt = kwargs["reprompt"] + del kwargs["reprompt"] + validate = kwargs["validate"] + del kwargs["validate"] + prompt = args[0] + ret = None + while not ret: + ret = question(prompt, **kwargs) + if not validate(ret): + ret = None + prompt = reprompt -def find_user_name(): - if cli.args.username: - return cli.args.username - elif cli.config.user.name: - return cli.config.user.name - else: - return git_get_username() + return ret -def template_tree(src: Path, dst: Path, replacements: dict): - """Recursively copy template and replace placeholders +def prompt_keyboard(): + prompt = """{fg_yellow}Name Your Keyboard Project{style_reset_all} +For more infomation, see: +https://docs.qmk.fm/#/hardware_keyboard_guidelines?id=naming-your-keyboardproject - Args: - src (Path) - The source folder to copy from - dst (Path) - The destination folder to copy to - replacements (dict) - a dictionary with "key":"value" pairs to replace. +Keyboard Name? """ - Raises: - FileExistsError - When trying to overwrite existing files + errmsg = 'Keyboard already exists! Please choose a different name:' + + return _question(prompt, reprompt=errmsg, validate=lambda x: not keyboard(x).exists()) + + +def prompt_user(): + prompt = """ +{fg_yellow}Attribution{style_reset_all} +Used for maintainer, copyright, etc + +Your GitHub Username? """ + return question(prompt, default=git_get_username()) + + +def prompt_name(def_name): + prompt = """ +{fg_yellow}More Attribution{style_reset_all} +Used for maintainer, copyright, etc + +Your Real Name? """ + return question(prompt, default=def_name) + + +def prompt_layout(): + prompt = """ +{fg_yellow}Pick Base Layout{style_reset_all} +As a starting point, one of the common layouts can be used to bootstrap the process + +Default Layout? """ + # avoid overwhelming user - remove some? + filtered_layouts = [x for x in available_layouts if not any(xs in x for xs in ['_split', '_blocker', '_tsangan', '_f13'])] + filtered_layouts.append("none of the above") + + return choice(prompt, filtered_layouts, default=len(filtered_layouts) - 1) + + +def prompt_mcu(): + prompt = """ +{fg_yellow}What Powers Your Project{style_reset_all} +For more infomation, see: +https://docs.qmk.fm/#/compatible_microcontrollers + +MCU? """ + # remove any options strictly used for compatibility + filtered_mcu = [x for x in mcu_types if not any(xs in x for xs in ['cortex', 'unknown'])] + + return choice(prompt, filtered_mcu, default=filtered_mcu.index("atmega32u4")) + + +@cli.argument('-kb', '--keyboard', help='Specify the name for the new keyboard directory', arg_only=True, type=keyboard_name) +@cli.argument('-l', '--layout', help='Community layout to bootstrap with', arg_only=True, type=layout_type) +@cli.argument('-t', '--type', help='Specify the keyboard MCU type', arg_only=True, type=mcu_type) +@cli.argument('-u', '--username', help='Specify your username (default from Git config)', dest='name') +@cli.argument('-n', '--realname', help='Specify your real name if you want to use that. Defaults to username', arg_only=True) +@cli.subcommand('Creates a new keyboard directory') +def new_keyboard(cli): + """Creates a new keyboard. """ + cli.log.info('{style_bright}Generating a new QMK keyboard directory{style_normal}') + cli.echo('') + + kb_name = cli.args.keyboard if cli.args.keyboard else prompt_keyboard() + user_name = cli.config.new_keyboard.name if cli.config.new_keyboard.name else prompt_user() + real_name = cli.args.realname or cli.config.new_keyboard.name if cli.args.realname or cli.config.new_keyboard.name else prompt_name(user_name) + default_layout = cli.args.layout if cli.args.layout else prompt_layout() + mcu = cli.args.type if cli.args.type else prompt_mcu() + bootloader = select_default_bootloader(mcu) + + if not validate_keyboard_name(kb_name): + cli.log.error('Keyboard names must contain only {fg_cyan}lowercase a-z{fg_reset}, {fg_cyan}0-9{fg_reset}, and {fg_cyan}_{fg_reset}! Please choose a different name.') + return 1 + + if keyboard(kb_name).exists(): + cli.log.error(f'Keyboard {{fg_cyan}}{kb_name}{{fg_reset}} already exists! Please choose a different name.') + return 1 + + tokens = { # Comment here is to force multiline formatting + 'YEAR': str(date.today().year), + 'KEYBOARD': kb_name, + 'USER_NAME': user_name, + 'REAL_NAME': real_name, + 'LAYOUT': default_layout, + 'MCU': mcu, + 'BOOTLOADER': bootloader + } + + if cli.config.general.verbose: + cli.log.info("Creating keyboard with:") + for key, value in tokens.items(): + cli.echo(f" {key.ljust(10)}: {value}") - dst.mkdir(parents=True, exist_ok=True) + # TODO: detach community layout and rename to just "LAYOUT" + if default_layout == 'none of the above': + default_layout = "ortho_4x4" - for child in src.iterdir(): - if child.is_dir(): - template_tree(child, dst / child.name, replacements=replacements) + # begin with making the deepest folder in the tree + keymaps_path = keyboard(kb_name) / 'keymaps/' + keymaps_path.mkdir(parents=True) - if child.is_file(): - file_name = dst / (child.name % replacements) + # copy in keymap.c or keymap.json + community_keymap = Path(COMMUNITY / f'{default_layout}/default_{default_layout}/') + shutil.copytree(community_keymap, keymaps_path / 'default') - with file_name.open(mode='x') as dst_f: - with child.open() as src_f: - template = src_f.read() - dst_f.write(template % replacements) + # process template files + for file in list(TEMPLATE.iterdir()): + replace_placeholders(file, keyboard(kb_name) / file.name, tokens) + + # merge in infos + community_info = Path(COMMUNITY / f'{default_layout}/info.json') + augment_community_info(community_info, keyboard(kb_name) / community_info.name) + + cli.log.info(f'{{fg_green}}Created a new keyboard called {{fg_cyan}}{kb_name}{{fg_green}}.{{fg_reset}}') + cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}{{fg_reset}},') + cli.log.info('or open the directory in your preferred text editor.') + cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index 90a68ca3cd46..275cd72e5cd4 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -213,7 +213,7 @@ def compile_configurator_json(user_keymap, bootloader=None, parallel=1, **env_va '-r', '-R', '-f', - 'build_keyboard.mk', + 'builddefs/build_keyboard.mk', ]) if bootloader: diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py index 433b110523fa..e4b699cdb110 100644 --- a/lib/python/qmk/constants.py +++ b/lib/python/qmk/constants.py @@ -13,10 +13,49 @@ MAX_KEYBOARD_SUBFOLDERS = 5 # Supported processor types -CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK66FX1M0', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32L412', 'STM32L422', 'STM32L433', 'STM32L443', 'GD32VF103', 'WB32F3G71' +CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK66FX1M0', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71' LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85' +# Bootloaders of the supported processors +MCU2BOOTLOADER = { + "MKL26Z64": "halfkay", + "MK20DX128": "halfkay", + "MK20DX256": "halfkay", + "MK66FX1M0": "halfkay", + "STM32F042": "stm32-dfu", + "STM32F072": "stm32-dfu", + "STM32F103": "stm32duino", + "STM32F303": "stm32-dfu", + "STM32F401": "stm32-dfu", + "STM32F405": "stm32-dfu", + "STM32F407": "stm32-dfu", + "STM32F411": "stm32-dfu", + "STM32F446": "stm32-dfu", + "STM32G431": "stm32-dfu", + "STM32G474": "stm32-dfu", + "STM32L412": "stm32-dfu", + "STM32L422": "stm32-dfu", + "STM32L432": "stm32-dfu", + "STM32L433": "stm32-dfu", + "STM32L442": "stm32-dfu", + "STM32L443": "stm32-dfu", + "GD32VF103": "gd32v-dfu", + "WB32F3G71": "wb32-dfu", + "atmega16u2": "atmel-dfu", + "atmega32u2": "atmel-dfu", + "atmega16u4": "atmel-dfu", + "atmega32u4": "atmel-dfu", + "at90usb162": "atmel-dfu", + "at90usb646": "atmel-dfu", + "at90usb647": "atmel-dfu", + "at90usb1286": "atmel-dfu", + "at90usb1287": "atmel-dfu", + "atmega32a": "bootloadhid", + "atmega328p": "usbasploader", + "atmega328": "usbasploader", +} + # Common format strings DATE_FORMAT = '%Y-%m-%d' DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z' diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 9a07fc842fb3..7e6f531f9c47 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -49,6 +49,7 @@ def info_json(keyboard): 'parse_errors': [], 'parse_warnings': [], 'maintainer': 'qmk', + 'manufacturer': 'qmk', } # Populate the list of JSON keymaps @@ -387,6 +388,19 @@ def _extract_matrix_info(info_data, config_c): return info_data +# TODO: kill off usb.device_ver in favor of usb.device_version +def _extract_device_version(info_data): + if info_data.get('usb'): + if info_data['usb'].get('device_version') and not info_data['usb'].get('device_ver'): + (major, minor, revision) = info_data['usb']['device_version'].split('.', 3) + info_data['usb']['device_ver'] = f'0x{major.zfill(2)}{minor}{revision}' + if not info_data['usb'].get('device_version') and info_data['usb'].get('device_ver'): + major = int(info_data['usb']['device_ver'][2:4]) + minor = int(info_data['usb']['device_ver'][4]) + revision = int(info_data['usb']['device_ver'][5]) + info_data['usb']['device_version'] = f'{major}.{minor}.{revision}' + + def _extract_config_h(info_data): """Pull some keyboard information from existing config.h files """ @@ -430,6 +444,13 @@ def _extract_config_h(info_data): elif key_type == 'int': dotty_info[info_key] = int(config_c[config_key]) + elif key_type == 'bcd_version': + major = int(config_c[config_key][2:4]) + minor = int(config_c[config_key][4]) + revision = int(config_c[config_key][5]) + + dotty_info[info_key] = f'{major}.{minor}.{revision}' + else: dotty_info[info_key] = config_c[config_key] @@ -444,6 +465,7 @@ def _extract_config_h(info_data): _extract_split_main(info_data, config_c) _extract_split_transport(info_data, config_c) _extract_split_right_pins(info_data, config_c) + _extract_device_version(info_data) return info_data @@ -622,12 +644,7 @@ def arm_processor_rules(info_data, rules): info_data['protocol'] = 'ChibiOS' if 'bootloader' not in info_data: - if 'STM32' in info_data['processor']: - info_data['bootloader'] = 'stm32-dfu' - elif 'WB32' in info_data['processor']: - info_data['bootloader'] = 'wb32-dfu' - else: - info_data['bootloader'] = 'unknown' + info_data['bootloader'] = 'unknown' if 'STM32' in info_data['processor']: info_data['platform'] = 'STM32' diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py index 72bae5927341..dfb8371f8450 100644 --- a/lib/python/qmk/path.py +++ b/lib/python/qmk/path.py @@ -46,7 +46,7 @@ def keymap(keyboard_name): """ keyboard_folder = keyboard(keyboard_name) - for i in range(MAX_KEYBOARD_SUBFOLDERS): + for _ in range(MAX_KEYBOARD_SUBFOLDERS): if (keyboard_folder / 'keymaps').exists(): return (keyboard_folder / 'keymaps').resolve() diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index 2973f817022e..54b143c64fe2 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py @@ -113,7 +113,7 @@ def test_list_keymaps_community(): def test_list_keymaps_kb_only(): - result = check_subcommand('list-keymaps', '-kb', 'niu_mini') + result = check_subcommand('list-keymaps', '-kb', 'contra') check_returncode(result) assert 'default' and 'via' in result.stdout diff --git a/paths.mk b/paths.mk index 5a39d00ecd73..85ccfa07964b 100644 --- a/paths.mk +++ b/paths.mk @@ -2,7 +2,9 @@ TOP_DIR = . TMK_DIR = tmk_core TMK_PATH = $(TMK_DIR) -LIB_PATH = lib + +LIB_DIR = lib +LIB_PATH = $(LIB_DIR) QUANTUM_DIR = quantum QUANTUM_PATH = $(QUANTUM_DIR) diff --git a/platforms/arm_atsam/bootloader.c b/platforms/arm_atsam/bootloader.c deleted file mode 100644 index 9015b00aab1a..000000000000 --- a/platforms/arm_atsam/bootloader.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright 2017 Fred Sundvik - * - * 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 "bootloader.h" -#include "samd51j18a.h" -#include "md_bootloader.h" - -// Set watchdog timer to reset. Directs the bootloader to stay in programming mode. -void bootloader_jump(void) { -#ifdef KEYBOARD_massdrop_ctrl - // CTRL keyboards released with bootloader version below must use RAM method. Otherwise use WDT method. - uint8_t ver_ram_method[] = "v2.18Jun 22 2018 17:28:08"; // The version to match (NULL terminated by compiler) - uint8_t *ver_check = ver_ram_method; // Pointer to version match string for traversal - uint8_t *ver_rom = (uint8_t *)0x21A0; // Pointer to address in ROM where this specific bootloader version would exist - - while (*ver_check && *ver_rom == *ver_check) { // While there are check version characters to match and bootloader's version matches check's version - ver_check++; // Move check version pointer to next character - ver_rom++; // Move ROM version pointer to next character - } - - if (!*ver_check) { // If check version pointer is NULL, all characters have matched - *MAGIC_ADDR = BOOTLOADER_MAGIC; // Set magic number into RAM - NVIC_SystemReset(); // Perform system reset - while (1) { - } // Won't get here - } -#endif - - WDT->CTRLA.bit.ENABLE = 0; - while (WDT->SYNCBUSY.bit.ENABLE) { - } - while (WDT->CTRLA.bit.ENABLE) { - } - WDT->CONFIG.bit.WINDOW = 0; - WDT->CONFIG.bit.PER = 0; - WDT->EWCTRL.bit.EWOFFSET = 0; - WDT->CTRLA.bit.ENABLE = 1; - while (WDT->SYNCBUSY.bit.ENABLE) { - } - while (!WDT->CTRLA.bit.ENABLE) { - } - while (1) { - } // Wait on timeout -} diff --git a/platforms/arm_atsam/bootloaders/md_boot.c b/platforms/arm_atsam/bootloaders/md_boot.c new file mode 100644 index 000000000000..32cf850448ea --- /dev/null +++ b/platforms/arm_atsam/bootloaders/md_boot.c @@ -0,0 +1,65 @@ +/* Copyright 2017 Fred Sundvik + * + * 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 "bootloader.h" + +#include "samd51j18a.h" + +// WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support +extern uint32_t _eram; +#define BOOTLOADER_MAGIC 0x3B9ACA00 +#define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4) + +// CTRL keyboards released with bootloader version below must use RAM method. Otherwise use WDT method. +void bootloader_jump(void) { +#ifdef KEYBOARD_massdrop_ctrl + uint8_t ver_ram_method[] = "v2.18Jun 22 2018 17:28:08"; // The version to match (NULL terminated by compiler) + uint8_t *ver_check = ver_ram_method; // Pointer to version match string for traversal + uint8_t *ver_rom = (uint8_t *)0x21A0; // Pointer to address in ROM where this specific bootloader version would exist + + while (*ver_check && *ver_rom == *ver_check) { // While there are check version characters to match and bootloader's version matches check's version + ver_check++; // Move check version pointer to next character + ver_rom++; // Move ROM version pointer to next character + } + + if (!*ver_check) { // If check version pointer is NULL, all characters have matched + *MAGIC_ADDR = BOOTLOADER_MAGIC; // Set magic number into RAM + NVIC_SystemReset(); // Perform system reset + while (1) + ; // Won't get here + } +#endif + + // Set watchdog timer to reset. Directs the bootloader to stay in programming mode. + WDT->CTRLA.bit.ENABLE = 0; + + while (WDT->SYNCBUSY.bit.ENABLE) + ; + while (WDT->CTRLA.bit.ENABLE) + ; + + WDT->CONFIG.bit.WINDOW = 0; + WDT->CONFIG.bit.PER = 0; + WDT->EWCTRL.bit.EWOFFSET = 0; + WDT->CTRLA.bit.ENABLE = 1; + + while (WDT->SYNCBUSY.bit.ENABLE) + ; + while (!WDT->CTRLA.bit.ENABLE) + ; + while (1) + ; // Wait on timeout +} diff --git a/platforms/arm_atsam/eeprom.c b/platforms/arm_atsam/eeprom_samd.c similarity index 95% rename from platforms/arm_atsam/eeprom.c rename to platforms/arm_atsam/eeprom_samd.c index ff1a692623a1..1c1e031e5da3 100644 --- a/platforms/arm_atsam/eeprom.c +++ b/platforms/arm_atsam/eeprom_samd.c @@ -18,11 +18,7 @@ #include "samd51j18a.h" #include "core_cm4.h" #include "component/nvmctrl.h" - -#ifndef EEPROM_SIZE -# include "eeconfig.h" -# define EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO -#endif +#include "eeprom_samd.h" #ifndef MAX # define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) @@ -159,7 +155,9 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { } } -void eeprom_update_byte(uint8_t *addr, uint8_t value) { eeprom_write_byte(addr, value); } +void eeprom_update_byte(uint8_t *addr, uint8_t value) { + eeprom_write_byte(addr, value); +} void eeprom_update_word(uint16_t *addr, uint16_t value) { uint8_t *p = (uint8_t *)addr; diff --git a/platforms/arm_atsam/eeprom_samd.h b/platforms/arm_atsam/eeprom_samd.h new file mode 100644 index 000000000000..878e72865cf4 --- /dev/null +++ b/platforms/arm_atsam/eeprom_samd.h @@ -0,0 +1,8 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#ifndef EEPROM_SIZE +# include "eeconfig.h" +# define EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO +#endif diff --git a/platforms/arm_atsam/gpio.h b/platforms/arm_atsam/gpio.h index 915ed0ef4f74..a42aaff54d65 100644 --- a/platforms/arm_atsam/gpio.h +++ b/platforms/arm_atsam/gpio.h @@ -22,9 +22,9 @@ typedef uint8_t pin_t; -#define SAMD_PORT(pin) ((pin & 0x20) >> 5) -#define SAMD_PIN(pin) (pin & 0x1f) -#define SAMD_PIN_MASK(pin) (1 << (pin & 0x1f)) +#define SAMD_PORT(pin) (((pin)&0x20) >> 5) +#define SAMD_PIN(pin) ((pin)&0x1f) +#define SAMD_PIN_MASK(pin) (1 << ((pin)&0x1f)) #define setPinInput(pin) \ do { \ @@ -48,12 +48,16 @@ typedef uint8_t pin_t; PORT->Group[SAMD_PORT(pin)].PINCFG[SAMD_PIN(pin)].bit.PULLEN = 1; \ } while (0) -#define setPinOutput(pin) \ +#define setPinOutputPushPull(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].DIRSET.reg = SAMD_PIN_MASK(pin); \ PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \ } while (0) +#define setPinOutputOpenDrain(pin) _Static_assert(0, "arm_atsam platform does not implement an open-drain output") + +#define setPinOutput(pin) setPinOutputPushPull(pin) + #define writePinHigh(pin) \ do { \ PORT->Group[SAMD_PORT(pin)].OUTSET.reg = SAMD_PIN_MASK(pin); \ diff --git a/platforms/arm_atsam/suspend.c b/platforms/arm_atsam/suspend.c index e51426128d85..242e9c91a2fa 100644 --- a/platforms/arm_atsam/suspend.c +++ b/platforms/arm_atsam/suspend.c @@ -3,61 +3,18 @@ #include "md_rgb_matrix.h" #include "suspend.h" -/** \brief Suspend idle - * - * FIXME: needs doc - */ -void suspend_idle(uint8_t time) { /* Note: Not used anywhere currently */ -} - -/** \brief Run user level Power down - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_power_down_user(void) {} - -/** \brief Run keyboard level Power down - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_power_down_kb(void) { suspend_power_down_user(); } - /** \brief Suspend power down * * FIXME: needs doc */ void suspend_power_down(void) { #ifdef RGB_MATRIX_ENABLE - I2C3733_Control_Set(0); // Disable LED driver + I2C3733_Control_Set(0); // Disable LED driver #endif suspend_power_down_kb(); } -__attribute__((weak)) void matrix_power_up(void) {} -__attribute__((weak)) void matrix_power_down(void) {} -bool suspend_wakeup_condition(void) { - matrix_power_up(); - matrix_scan(); - matrix_power_down(); - for (uint8_t r = 0; r < MATRIX_ROWS; r++) { - if (matrix_get_row(r)) return true; - } - return false; -} - -/** \brief run user level code immediately after wakeup - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_wakeup_init_user(void) {} - -/** \brief run keyboard level code immediately after wakeup - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); } - /** \brief run immediately after wakeup * * FIXME: needs doc diff --git a/platforms/arm_atsam/timer.c b/platforms/arm_atsam/timer.c index b835dd5e753f..cf01e3625e4a 100644 --- a/platforms/arm_atsam/timer.c +++ b/platforms/arm_atsam/timer.c @@ -2,18 +2,34 @@ #include "timer.h" #include "tmk_core/protocol/arm_atsam/clks.h" -void set_time(uint64_t tset) { ms_clk = tset; } +void set_time(uint64_t tset) { + ms_clk = tset; +} -void timer_init(void) { timer_clear(); } +void timer_init(void) { + timer_clear(); +} -uint16_t timer_read(void) { return (uint16_t)ms_clk; } +uint16_t timer_read(void) { + return (uint16_t)ms_clk; +} -uint32_t timer_read32(void) { return (uint32_t)ms_clk; } +uint32_t timer_read32(void) { + return (uint32_t)ms_clk; +} -uint64_t timer_read64(void) { return ms_clk; } +uint64_t timer_read64(void) { + return ms_clk; +} -uint16_t timer_elapsed(uint16_t tlast) { return TIMER_DIFF_16(timer_read(), tlast); } +uint16_t timer_elapsed(uint16_t tlast) { + return TIMER_DIFF_16(timer_read(), tlast); +} -uint32_t timer_elapsed32(uint32_t tlast) { return TIMER_DIFF_32(timer_read32(), tlast); } +uint32_t timer_elapsed32(uint32_t tlast) { + return TIMER_DIFF_32(timer_read32(), tlast); +} -void timer_clear(void) { set_time(0); } +void timer_clear(void) { + set_time(0); +} diff --git a/platforms/avr/bootloader.c b/platforms/avr/bootloader.c deleted file mode 100644 index c0272903b83d..000000000000 --- a/platforms/avr/bootloader.c +++ /dev/null @@ -1,293 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "bootloader.h" -#include - -#ifdef PROTOCOL_LUFA -# include -#endif - -/** \brief Bootloader Size in *bytes* - * - * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet. - * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'. - * - * Size of Bootloaders in bytes: - * Atmel DFU loader(ATmega32U4) 4096 - * Atmel DFU loader(AT90USB128) 8192 - * LUFA bootloader(ATmega32U4) 4096 - * Arduino Caterina(ATmega32U4) 4096 - * USBaspLoader(ATmega***) 2048 - * Teensy halfKay(ATmega32U4) 512 - * Teensy++ halfKay(AT90USB128) 1024 - * - * AVR Boot section is located at the end of Flash memory like the followings. - * - * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128) - * 0x0000 +---------------+ 0x00000 +---------------+ - * | | | | - * | | | | - * | Application | | Application | - * | | | | - * = = = = - * | | 32KB-4KB | | 128KB-8KB - * 0x7000 +---------------+ 0x1E000 +---------------+ - * | Bootloader | 4KB | Bootloader | 8KB - * 0x7FFF +---------------+ 0x1FFFF +---------------+ - * - * - * byte Teensy(ATMega32u4) byte Teensy++(AT90SUB128) - * 0x0000 +---------------+ 0x00000 +---------------+ - * | | | | - * | | | | - * | Application | | Application | - * | | | | - * = = = = - * | | 32KB-512B | | 128KB-1KB - * 0x7E00 +---------------+ 0x1FC00 +---------------+ - * | Bootloader | 512B | Bootloader | 1KB - * 0x7FFF +---------------+ 0x1FFFF +---------------+ - */ -#define FLASH_SIZE (FLASHEND + 1L) - -#if !defined(BOOTLOADER_SIZE) -uint16_t bootloader_start; -#endif - -// compatibility between ATMega8 and ATMega88 -#if !defined(MCUCSR) -# if defined(MCUSR) -# define MCUCSR MCUSR -# endif -#endif - -/** \brief Entering the Bootloader via Software - * - * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html - */ -#define BOOTLOADER_RESET_KEY 0xB007B007 -uint32_t reset_key __attribute__((section(".noinit,\"aw\",@nobits;"))); - -/** \brief initialize MCU status by watchdog reset - * - * FIXME: needs doc - */ -__attribute__((weak)) void bootloader_jump(void) { -#if !defined(BOOTLOADER_SIZE) - uint8_t high_fuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS); - - if (high_fuse & ~(FUSE_BOOTSZ0 & FUSE_BOOTSZ1)) { - bootloader_start = (FLASH_SIZE - 512) >> 1; - } else if (high_fuse & ~(FUSE_BOOTSZ1)) { - bootloader_start = (FLASH_SIZE - 1024) >> 1; - } else if (high_fuse & ~(FUSE_BOOTSZ0)) { - bootloader_start = (FLASH_SIZE - 2048) >> 1; - } else { - bootloader_start = (FLASH_SIZE - 4096) >> 1; - } -#endif - - // Something like this might work, but it compiled larger than the block above - // bootloader_start = FLASH_SIZE - (256 << (~high_fuse & 0b110 >> 1)); - -#if defined(BOOTLOADER_HALFKAY) - // http://www.pjrc.com/teensy/jump_to_bootloader.html - cli(); - // disable watchdog, if enabled (it's not) - // disable all peripherals - // a shutdown call might make sense here - UDCON = 1; - USBCON = (1 << FRZCLK); // disable USB - UCSR1B = 0; - _delay_ms(5); -# if defined(__AVR_AT90USB162__) // Teensy 1.0 - EIMSK = 0; - PCICR = 0; - SPCR = 0; - ACSR = 0; - EECR = 0; - TIMSK0 = 0; - TIMSK1 = 0; - UCSR1B = 0; - DDRB = 0; - DDRC = 0; - DDRD = 0; - PORTB = 0; - PORTC = 0; - PORTD = 0; - asm volatile("jmp 0x3E00"); -# elif defined(__AVR_ATmega32U4__) // Teensy 2.0 - EIMSK = 0; - PCICR = 0; - SPCR = 0; - ACSR = 0; - EECR = 0; - ADCSRA = 0; - TIMSK0 = 0; - TIMSK1 = 0; - TIMSK3 = 0; - TIMSK4 = 0; - UCSR1B = 0; - TWCR = 0; - DDRB = 0; - DDRC = 0; - DDRD = 0; - DDRE = 0; - DDRF = 0; - TWCR = 0; - PORTB = 0; - PORTC = 0; - PORTD = 0; - PORTE = 0; - PORTF = 0; - asm volatile("jmp 0x7E00"); -# elif defined(__AVR_AT90USB646__) // Teensy++ 1.0 - EIMSK = 0; - PCICR = 0; - SPCR = 0; - ACSR = 0; - EECR = 0; - ADCSRA = 0; - TIMSK0 = 0; - TIMSK1 = 0; - TIMSK2 = 0; - TIMSK3 = 0; - UCSR1B = 0; - TWCR = 0; - DDRA = 0; - DDRB = 0; - DDRC = 0; - DDRD = 0; - DDRE = 0; - DDRF = 0; - PORTA = 0; - PORTB = 0; - PORTC = 0; - PORTD = 0; - PORTE = 0; - PORTF = 0; - asm volatile("jmp 0xFC00"); -# elif defined(__AVR_AT90USB1286__) // Teensy++ 2.0 - EIMSK = 0; - PCICR = 0; - SPCR = 0; - ACSR = 0; - EECR = 0; - ADCSRA = 0; - TIMSK0 = 0; - TIMSK1 = 0; - TIMSK2 = 0; - TIMSK3 = 0; - UCSR1B = 0; - TWCR = 0; - DDRA = 0; - DDRB = 0; - DDRC = 0; - DDRD = 0; - DDRE = 0; - DDRF = 0; - PORTA = 0; - PORTB = 0; - PORTC = 0; - PORTD = 0; - PORTE = 0; - PORTF = 0; - asm volatile("jmp 0x1FC00"); -# endif - -#elif defined(BOOTLOADER_CATERINA) - // this block may be optional - // TODO: figure it out - - uint16_t *const bootKeyPtr = (uint16_t *)0x0800; - - // Value used by Caterina bootloader use to determine whether to run the - // sketch or the bootloader programmer. - uint16_t bootKey = 0x7777; - - *bootKeyPtr = bootKey; - - // setup watchdog timeout - wdt_enable(WDTO_60MS); - - while (1) { - } // wait for watchdog timer to trigger - -#elif defined(BOOTLOADER_USBASP) - // Taken with permission of Stephan Baerwolf from https://github.com/tinyusbboard/API/blob/master/apipage.c - wdt_enable(WDTO_15MS); - wdt_reset(); - asm volatile("cli \n\t" - "ldi r29 , %[ramendhi] \n\t" - "ldi r28 , %[ramendlo] \n\t" -# if (FLASHEND > 131071) - "ldi r18 , %[bootaddrhi] \n\t" - "st Y+, r18 \n\t" -# endif - "ldi r18 , %[bootaddrme] \n\t" - "st Y+, r18 \n\t" - "ldi r18 , %[bootaddrlo] \n\t" - "st Y+, r18 \n\t" - "out %[mcucsrio], __zero_reg__ \n\t" - "bootloader_startup_loop%=: \n\t" - "rjmp bootloader_startup_loop%= \n\t" - : - : [mcucsrio] "I"(_SFR_IO_ADDR(MCUCSR)), -# if (FLASHEND > 131071) - [ramendhi] "M"(((RAMEND - 2) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 2) >> 0) & 0xff), [bootaddrhi] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 16) & 0xff), -# else - [ramendhi] "M"(((RAMEND - 1) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 1) >> 0) & 0xff), -# endif - [bootaddrme] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [bootaddrlo] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff)); - -#else // Assume remaining boards are DFU, even if the flag isn't set - -# if !(defined(__AVR_ATmega32A__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) || defined(__AVR_ATtiny85__)) // no USB - maybe BOOTLOADER_BOOTLOADHID instead though? - UDCON = 1; - USBCON = (1 << FRZCLK); // disable USB - UCSR1B = 0; - _delay_ms(5); // 5 seems to work fine -# endif - -# ifdef BOOTLOADER_BOOTLOADHID - // force bootloadHID to stay in bootloader mode, so that it waits - // for a new firmware to be flashed - eeprom_write_byte((uint8_t *)1, 0x00); -# endif - - // watchdog reset - reset_key = BOOTLOADER_RESET_KEY; - wdt_enable(WDTO_250MS); - for (;;) - ; -#endif -} - -/* this runs before main() */ -void bootloader_jump_after_watchdog_reset(void) __attribute__((used, naked, section(".init3"))); -void bootloader_jump_after_watchdog_reset(void) { -#ifndef BOOTLOADER_HALFKAY - if ((MCUCSR & (1 << WDRF)) && reset_key == BOOTLOADER_RESET_KEY) { - reset_key = 0; - - // My custom USBasploader requires this to come up. - MCUCSR = 0; - - // Seems like Teensy halfkay loader requires clearing WDRF and disabling watchdog. - MCUCSR &= ~(1 << WDRF); - wdt_disable(); - -// This is compled into 'icall', address should be in word unit, not byte. -# ifdef BOOTLOADER_SIZE - ((void (*)(void))((FLASH_SIZE - BOOTLOADER_SIZE) >> 1))(); -# else - asm("ijmp" ::"z"(bootloader_start)); -# endif - } -#endif -} diff --git a/platforms/avr/bootloaders/bootloadhid.c b/platforms/avr/bootloaders/bootloadhid.c new file mode 100644 index 000000000000..ae58760d7daa --- /dev/null +++ b/platforms/avr/bootloaders/bootloadhid.c @@ -0,0 +1,33 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include +#include + +__attribute__((weak)) void bootloader_jump(void) { + // force bootloadHID to stay in bootloader mode, so that it waits + // for a new firmware to be flashed + // NOTE: this byte is part of QMK's "magic number" - changing it causes the EEPROM to be re-initialized + // thus every time the device is flashed the EEPROM will be wiped + eeprom_write_byte((uint8_t *)1, 0x00); + + // watchdog reset + wdt_enable(WDTO_250MS); + for (;;) + ; +} diff --git a/platforms/avr/bootloaders/caterina.c b/platforms/avr/bootloaders/caterina.c new file mode 100644 index 000000000000..82a16a3765f4 --- /dev/null +++ b/platforms/avr/bootloaders/caterina.c @@ -0,0 +1,39 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include + +__attribute__((weak)) void bootloader_jump(void) { + // this block may be optional + // TODO: figure it out + + uint16_t *const bootKeyPtr = (uint16_t *)0x0800; + + // Value used by Caterina bootloader use to determine whether to run the + // sketch or the bootloader programmer. + uint16_t bootKey = 0x7777; + + *bootKeyPtr = bootKey; + + // setup watchdog timeout + wdt_enable(WDTO_60MS); + + // wait for watchdog timer to trigger + while (1) { + } +} diff --git a/platforms/avr/bootloaders/custom.c b/platforms/avr/bootloaders/custom.c new file mode 100644 index 000000000000..624fbe242a35 --- /dev/null +++ b/platforms/avr/bootloaders/custom.c @@ -0,0 +1,19 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +__attribute__((weak)) void bootloader_jump(void) {} diff --git a/platforms/avr/bootloaders/dfu.c b/platforms/avr/bootloaders/dfu.c new file mode 100644 index 000000000000..06b2c8963ac3 --- /dev/null +++ b/platforms/avr/bootloaders/dfu.c @@ -0,0 +1,52 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include +#include + +#define FLASH_SIZE (FLASHEND + 1L) + +/** \brief Entering the Bootloader via Software + * + * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html + */ +#define BOOTLOADER_RESET_KEY 0xB007B007 +uint32_t reset_key __attribute__((section(".noinit,\"aw\",@nobits;"))); + +__attribute__((weak)) void bootloader_jump(void) { + UDCON = 1; + USBCON = (1 << FRZCLK); // disable USB + UCSR1B = 0; + _delay_ms(5); // 5 seems to work fine + + // watchdog reset + reset_key = BOOTLOADER_RESET_KEY; + wdt_enable(WDTO_250MS); + for (;;) + ; +} + +/* this runs before main() */ +void bootloader_jump_after_watchdog_reset(void) __attribute__((used, naked, section(".init3"))); +void bootloader_jump_after_watchdog_reset(void) { + if ((MCUSR & (1 << WDRF)) && reset_key == BOOTLOADER_RESET_KEY) { + reset_key = 0; + + ((void (*)(void))((FLASH_SIZE - BOOTLOADER_SIZE) >> 1))(); + } +} diff --git a/platforms/avr/bootloaders/halfkay.c b/platforms/avr/bootloaders/halfkay.c new file mode 100644 index 000000000000..651696f9881d --- /dev/null +++ b/platforms/avr/bootloaders/halfkay.c @@ -0,0 +1,128 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include +#include + +__attribute__((weak)) void bootloader_jump(void) { + // http://www.pjrc.com/teensy/jump_to_bootloader.html + + cli(); + // disable watchdog, if enabled (it's not) + // disable all peripherals + // a shutdown call might make sense here + UDCON = 1; + USBCON = (1 << FRZCLK); // disable USB + UCSR1B = 0; + _delay_ms(5); + +#if defined(__AVR_AT90USB162__) // Teensy 1.0 + EIMSK = 0; + PCICR = 0; + SPCR = 0; + ACSR = 0; + EECR = 0; + TIMSK0 = 0; + TIMSK1 = 0; + UCSR1B = 0; + DDRB = 0; + DDRC = 0; + DDRD = 0; + PORTB = 0; + PORTC = 0; + PORTD = 0; + asm volatile("jmp 0x3E00"); +#elif defined(__AVR_ATmega32U4__) // Teensy 2.0 + EIMSK = 0; + PCICR = 0; + SPCR = 0; + ACSR = 0; + EECR = 0; + ADCSRA = 0; + TIMSK0 = 0; + TIMSK1 = 0; + TIMSK3 = 0; + TIMSK4 = 0; + UCSR1B = 0; + TWCR = 0; + DDRB = 0; + DDRC = 0; + DDRD = 0; + DDRE = 0; + DDRF = 0; + TWCR = 0; + PORTB = 0; + PORTC = 0; + PORTD = 0; + PORTE = 0; + PORTF = 0; + asm volatile("jmp 0x7E00"); +#elif defined(__AVR_AT90USB646__) // Teensy++ 1.0 + EIMSK = 0; + PCICR = 0; + SPCR = 0; + ACSR = 0; + EECR = 0; + ADCSRA = 0; + TIMSK0 = 0; + TIMSK1 = 0; + TIMSK2 = 0; + TIMSK3 = 0; + UCSR1B = 0; + TWCR = 0; + DDRA = 0; + DDRB = 0; + DDRC = 0; + DDRD = 0; + DDRE = 0; + DDRF = 0; + PORTA = 0; + PORTB = 0; + PORTC = 0; + PORTD = 0; + PORTE = 0; + PORTF = 0; + asm volatile("jmp 0xFC00"); +#elif defined(__AVR_AT90USB1286__) // Teensy++ 2.0 + EIMSK = 0; + PCICR = 0; + SPCR = 0; + ACSR = 0; + EECR = 0; + ADCSRA = 0; + TIMSK0 = 0; + TIMSK1 = 0; + TIMSK2 = 0; + TIMSK3 = 0; + UCSR1B = 0; + TWCR = 0; + DDRA = 0; + DDRB = 0; + DDRC = 0; + DDRD = 0; + DDRE = 0; + DDRF = 0; + PORTA = 0; + PORTB = 0; + PORTC = 0; + PORTD = 0; + PORTE = 0; + PORTF = 0; + asm volatile("jmp 0x1FC00"); +#endif +} diff --git a/platforms/avr/bootloaders/usbasploader.c b/platforms/avr/bootloaders/usbasploader.c new file mode 100644 index 000000000000..008bd16069f4 --- /dev/null +++ b/platforms/avr/bootloaders/usbasploader.c @@ -0,0 +1,56 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include + +#define FLASH_SIZE (FLASHEND + 1L) + +#if !defined(MCUCSR) +# if defined(MCUSR) +# define MCUCSR MCUSR +# endif +#endif + +__attribute__((weak)) void bootloader_jump(void) { + // Taken with permission of Stephan Baerwolf from https://github.com/tinyusbboard/API/blob/master/apipage.c + + wdt_enable(WDTO_15MS); + wdt_reset(); + asm volatile("cli \n\t" + "ldi r29 , %[ramendhi] \n\t" + "ldi r28 , %[ramendlo] \n\t" +#if (FLASHEND > 131071) + "ldi r18 , %[bootaddrhi] \n\t" + "st Y+, r18 \n\t" +#endif + "ldi r18 , %[bootaddrme] \n\t" + "st Y+, r18 \n\t" + "ldi r18 , %[bootaddrlo] \n\t" + "st Y+, r18 \n\t" + "out %[mcucsrio], __zero_reg__ \n\t" + "bootloader_startup_loop%=: \n\t" + "rjmp bootloader_startup_loop%= \n\t" + : + : [mcucsrio] "I"(_SFR_IO_ADDR(MCUCSR)), +#if (FLASHEND > 131071) + [ramendhi] "M"(((RAMEND - 2) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 2) >> 0) & 0xff), [bootaddrhi] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 16) & 0xff), +#else + [ramendhi] "M"(((RAMEND - 1) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 1) >> 0) & 0xff), +#endif + [bootaddrme] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [bootaddrlo] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff)); +} diff --git a/platforms/avr/drivers/analog.c b/platforms/avr/drivers/analog.c index 628835ccef0f..ed4d56360908 100644 --- a/platforms/avr/drivers/analog.c +++ b/platforms/avr/drivers/analog.c @@ -21,9 +21,13 @@ static uint8_t aref = ADC_REF_POWER; -void analogReference(uint8_t mode) { aref = mode & (_BV(REFS1) | _BV(REFS0)); } +void analogReference(uint8_t mode) { + aref = mode & (_BV(REFS1) | _BV(REFS0)); +} -int16_t analogReadPin(pin_t pin) { return adc_read(pinToMux(pin)); } +int16_t analogReadPin(pin_t pin) { + return adc_read(pinToMux(pin)); +} uint8_t pinToMux(pin_t pin) { switch (pin) { diff --git a/platforms/avr/drivers/analog.h b/platforms/avr/drivers/analog.h index fa2fb0d89b8d..fb13e106ff1c 100644 --- a/platforms/avr/drivers/analog.h +++ b/platforms/avr/drivers/analog.h @@ -32,21 +32,21 @@ int16_t adc_read(uint8_t mux); } #endif -#define ADC_REF_EXTERNAL 0 // AREF, Internal Vref turned off -#define ADC_REF_POWER _BV(REFS0) // AVCC with external capacitor on AREF pin -#define ADC_REF_INTERNAL (_BV(REFS1) | _BV(REFS0)) // Internal 2.56V Voltage Reference with external capacitor on AREF pin (1.1V for 328P) +#define ADC_REF_EXTERNAL 0 // AREF, Internal Vref turned off +#define ADC_REF_POWER _BV(REFS0) // AVCC with external capacitor on AREF pin +#define ADC_REF_INTERNAL (_BV(REFS1) | _BV(REFS0)) // Internal 2.56V Voltage Reference with external capacitor on AREF pin (1.1V for 328P) // These prescaler values are for high speed mode, ADHSM = 1 #if F_CPU == 16000000L || F_CPU == 12000000L -# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS1)) // /64 +# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS1)) // /64 #elif F_CPU == 8000000L -# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS0)) // /32 +# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS0)) // /32 #elif F_CPU == 4000000L -# define ADC_PRESCALER (_BV(ADPS2)) // /16 +# define ADC_PRESCALER (_BV(ADPS2)) // /16 #elif F_CPU == 2000000L -# define ADC_PRESCALER (_BV(ADPS1) | _BV(ADPS0)) // /8 +# define ADC_PRESCALER (_BV(ADPS1) | _BV(ADPS0)) // /8 #elif F_CPU == 1000000L -# define ADC_PRESCALER _BV(ADPS1) // /4 +# define ADC_PRESCALER _BV(ADPS1) // /4 #else -# define ADC_PRESCALER _BV(ADPS0) // /2 +# define ADC_PRESCALER _BV(ADPS0) // /2 #endif diff --git a/platforms/avr/drivers/audio_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c index df03a4558cad..78776ee48a9f 100644 --- a/platforms/avr/drivers/audio_pwm_hardware.c +++ b/platforms/avr/drivers/audio_pwm_hardware.c @@ -152,7 +152,7 @@ extern uint8_t note_timbre; #ifdef AUDIO1_PIN_SET static float channel_1_frequency = 0.0f; void channel_1_set_frequency(float freq) { - if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0 + if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0 { // disable the output, but keep the pwm-ISR going (with the previous // frequency) so the audio-state keeps getting updated @@ -160,7 +160,7 @@ void channel_1_set_frequency(float freq) { AUDIO1_TCCRxA &= ~(_BV(AUDIO1_COMxy1) | _BV(AUDIO1_COMxy0)); return; } else { - AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode + AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode } channel_1_frequency = freq; @@ -202,7 +202,9 @@ void channel_2_set_frequency(float freq) { AUDIO2_OCRxy = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre / 100); } -float channel_2_get_frequency(void) { return channel_2_frequency; } +float channel_2_get_frequency(void) { + return channel_2_frequency; +} void channel_2_start(void) { AUDIO2_TIMSKx |= _BV(AUDIO2_OCIExy); diff --git a/platforms/avr/drivers/glcdfont.c b/platforms/avr/drivers/glcdfont.c index 5e763b054f89..57a21965de63 100644 --- a/platforms/avr/drivers/glcdfont.c +++ b/platforms/avr/drivers/glcdfont.c @@ -10,14 +10,14 @@ static const unsigned char font[] PROGMEM = { 0x30, 0x38, 0x3E, 0x38, 0x30, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x23, 0x13, 0x08, 0x64, 0x62, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x80, 0x70, 0x30, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x60, 0x60, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x72, 0x49, 0x49, 0x49, 0x46, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x27, 0x45, 0x45, 0x45, 0x39, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x41, 0x21, 0x11, 0x09, 0x07, 0x36, 0x49, 0x49, 0x49, 0x36, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x41, 0x22, 0x14, 0x08, 0x02, 0x01, 0x59, 0x09, 0x06, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x7F, 0x08, 0x14, 0x22, 0x41, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x26, 0x49, 0x49, 0x49, 0x32, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x63, 0x14, 0x08, 0x14, 0x63, 0x03, 0x04, 0x78, 0x04, 0x03, 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x04, 0x02, 0x01, 0x02, 0x04, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x03, 0x07, 0x08, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x38, 0x44, 0x44, 0x44, 0x28, 0x38, 0x44, 0x44, 0x28, 0x7F, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x38, 0x44, 0x44, 0x44, 0x38, 0xFC, 0x18, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x18, 0xFC, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x48, 0x54, 0x54, 0x54, 0x24, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x3C, 0x40, 0x30, 0x40, 0x3C, - 0x44, 0x28, 0x10, 0x28, 0x44, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x1E, 0xA1, 0xA1, 0x61, 0x12, 0x3A, 0x40, 0x40, 0x20, 0x7A, 0x38, 0x54, 0x54, 0x55, 0x59, 0x21, 0x55, 0x55, 0x79, 0x41, 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut - 0x21, 0x55, 0x54, 0x78, 0x40, 0x20, 0x54, 0x55, 0x79, 0x40, 0x0C, 0x1E, 0x52, 0x72, 0x12, 0x39, 0x55, 0x55, 0x55, 0x59, 0x39, 0x54, 0x54, 0x54, 0x59, 0x39, 0x55, 0x54, 0x54, 0x58, 0x00, 0x00, 0x45, 0x7C, 0x41, 0x00, 0x02, 0x45, 0x7D, 0x42, 0x00, 0x01, 0x45, 0x7C, 0x40, 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut - 0xF0, 0x28, 0x25, 0x28, 0xF0, 0x7C, 0x54, 0x55, 0x45, 0x00, 0x20, 0x54, 0x54, 0x7C, 0x54, 0x7C, 0x0A, 0x09, 0x7F, 0x49, 0x32, 0x49, 0x49, 0x49, 0x32, 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut - 0x32, 0x4A, 0x48, 0x48, 0x30, 0x3A, 0x41, 0x41, 0x21, 0x7A, 0x3A, 0x42, 0x40, 0x20, 0x78, 0x00, 0x9D, 0xA0, 0xA0, 0x7D, 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut - 0x3D, 0x40, 0x40, 0x40, 0x3D, 0x3C, 0x24, 0xFF, 0x24, 0x24, 0x48, 0x7E, 0x49, 0x43, 0x66, 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, 0xFF, 0x09, 0x29, 0xF6, 0x20, 0xC0, 0x88, 0x7E, 0x09, 0x03, 0x20, 0x54, 0x54, 0x79, 0x41, 0x00, 0x00, 0x44, 0x7D, 0x41, 0x30, 0x48, 0x48, 0x4A, 0x32, 0x38, 0x40, 0x40, 0x22, 0x7A, 0x00, 0x7A, 0x0A, 0x0A, 0x72, 0x7D, 0x0D, 0x19, 0x31, 0x7D, 0x26, 0x29, 0x29, 0x2F, 0x28, 0x26, 0x29, 0x29, 0x29, 0x26, 0x30, 0x48, 0x4D, 0x40, 0x20, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x2F, 0x10, 0xC8, 0xAC, 0xBA, 0x2F, 0x10, 0x28, 0x34, 0xFA, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x08, 0x14, 0x2A, 0x14, 0x22, 0x22, 0x14, 0x2A, 0x14, 0x08, 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code - 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block - 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block + 0x44, 0x28, 0x10, 0x28, 0x44, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x1E, 0xA1, 0xA1, 0x61, 0x12, 0x3A, 0x40, 0x40, 0x20, 0x7A, 0x38, 0x54, 0x54, 0x55, 0x59, 0x21, 0x55, 0x55, 0x79, 0x41, 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut + 0x21, 0x55, 0x54, 0x78, 0x40, 0x20, 0x54, 0x55, 0x79, 0x40, 0x0C, 0x1E, 0x52, 0x72, 0x12, 0x39, 0x55, 0x55, 0x55, 0x59, 0x39, 0x54, 0x54, 0x54, 0x59, 0x39, 0x55, 0x54, 0x54, 0x58, 0x00, 0x00, 0x45, 0x7C, 0x41, 0x00, 0x02, 0x45, 0x7D, 0x42, 0x00, 0x01, 0x45, 0x7C, 0x40, 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut + 0xF0, 0x28, 0x25, 0x28, 0xF0, 0x7C, 0x54, 0x55, 0x45, 0x00, 0x20, 0x54, 0x54, 0x7C, 0x54, 0x7C, 0x0A, 0x09, 0x7F, 0x49, 0x32, 0x49, 0x49, 0x49, 0x32, 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut + 0x32, 0x4A, 0x48, 0x48, 0x30, 0x3A, 0x41, 0x41, 0x21, 0x7A, 0x3A, 0x42, 0x40, 0x20, 0x78, 0x00, 0x9D, 0xA0, 0xA0, 0x7D, 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut + 0x3D, 0x40, 0x40, 0x40, 0x3D, 0x3C, 0x24, 0xFF, 0x24, 0x24, 0x48, 0x7E, 0x49, 0x43, 0x66, 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, 0xFF, 0x09, 0x29, 0xF6, 0x20, 0xC0, 0x88, 0x7E, 0x09, 0x03, 0x20, 0x54, 0x54, 0x79, 0x41, 0x00, 0x00, 0x44, 0x7D, 0x41, 0x30, 0x48, 0x48, 0x4A, 0x32, 0x38, 0x40, 0x40, 0x22, 0x7A, 0x00, 0x7A, 0x0A, 0x0A, 0x72, 0x7D, 0x0D, 0x19, 0x31, 0x7D, 0x26, 0x29, 0x29, 0x2F, 0x28, 0x26, 0x29, 0x29, 0x29, 0x26, 0x30, 0x48, 0x4D, 0x40, 0x20, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x2F, 0x10, 0xC8, 0xAC, 0xBA, 0x2F, 0x10, 0x28, 0x34, 0xFA, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x08, 0x14, 0x2A, 0x14, 0x22, 0x22, 0x14, 0x2A, 0x14, 0x08, 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code + 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block + 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block 0x00, 0x00, 0x00, 0xFF, 0x00, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x14, 0x14, 0x14, 0xFF, 0x00, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x14, 0x14, 0x14, 0xFC, 0x00, 0x14, 0x14, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x14, 0x14, 0xF4, 0x04, 0xFC, 0x14, 0x14, 0x17, 0x10, 0x1F, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x14, 0x14, 0x14, 0x1F, 0x00, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x14, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x1F, 0x10, 0x17, 0x00, 0x00, 0xFC, 0x04, 0xF4, 0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14, 0xF4, 0x04, 0xF4, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x17, 0x14, 0x10, 0x10, 0x1F, 0x10, 0x1F, - 0x14, 0x14, 0x14, 0xF4, 0x14, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x38, 0x44, 0x44, 0x38, 0x44, 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta - 0x7E, 0x02, 0x02, 0x06, 0x06, 0x02, 0x7E, 0x02, 0x7E, 0x02, 0x63, 0x55, 0x49, 0x41, 0x63, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x40, 0x7E, 0x20, 0x1E, 0x20, 0x06, 0x02, 0x7E, 0x02, 0x02, 0x99, 0xA5, 0xE7, 0xA5, 0x99, 0x1C, 0x2A, 0x49, 0x2A, 0x1C, 0x4C, 0x72, 0x01, 0x72, 0x4C, 0x30, 0x4A, 0x4D, 0x4D, 0x30, 0x30, 0x48, 0x78, 0x48, 0x30, 0xBC, 0x62, 0x5A, 0x46, 0x3D, 0x3E, 0x49, 0x49, 0x49, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x44, 0x44, 0x5F, 0x44, 0x44, 0x40, 0x51, 0x4A, 0x44, 0x40, 0x40, 0x44, 0x4A, 0x51, 0x40, 0x00, 0x00, 0xFF, 0x01, 0x03, 0xE0, 0x80, 0xFF, 0x00, 0x00, 0x08, 0x08, 0x6B, 0x6B, 0x08, 0x36, 0x12, 0x36, 0x24, 0x36, 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x30, 0x40, 0xFF, 0x01, 0x01, 0x00, 0x1F, 0x01, 0x01, 0x1E, 0x00, 0x19, 0x1D, 0x17, 0x12, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP + 0x14, 0x14, 0x14, 0xF4, 0x14, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x38, 0x44, 0x44, 0x38, 0x44, 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta + 0x7E, 0x02, 0x02, 0x06, 0x06, 0x02, 0x7E, 0x02, 0x7E, 0x02, 0x63, 0x55, 0x49, 0x41, 0x63, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x40, 0x7E, 0x20, 0x1E, 0x20, 0x06, 0x02, 0x7E, 0x02, 0x02, 0x99, 0xA5, 0xE7, 0xA5, 0x99, 0x1C, 0x2A, 0x49, 0x2A, 0x1C, 0x4C, 0x72, 0x01, 0x72, 0x4C, 0x30, 0x4A, 0x4D, 0x4D, 0x30, 0x30, 0x48, 0x78, 0x48, 0x30, 0xBC, 0x62, 0x5A, 0x46, 0x3D, 0x3E, 0x49, 0x49, 0x49, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x44, 0x44, 0x5F, 0x44, 0x44, 0x40, 0x51, 0x4A, 0x44, 0x40, 0x40, 0x44, 0x4A, 0x51, 0x40, 0x00, 0x00, 0xFF, 0x01, 0x03, 0xE0, 0x80, 0xFF, 0x00, 0x00, 0x08, 0x08, 0x6B, 0x6B, 0x08, 0x36, 0x12, 0x36, 0x24, 0x36, 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x30, 0x40, 0xFF, 0x01, 0x01, 0x00, 0x1F, 0x01, 0x01, 0x1E, 0x00, 0x19, 0x1D, 0x17, 0x12, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP }; diff --git a/platforms/avr/drivers/hd44780.c b/platforms/avr/drivers/hd44780.c index f71069dece74..f15d7d0da832 100644 --- a/platforms/avr/drivers/hd44780.c +++ b/platforms/avr/drivers/hd44780.c @@ -262,7 +262,7 @@ static uint8_t lcd_waitbusy(void) delay(LCD_DELAY_BUSY_FLAG); /* now read the address counter */ - return (lcd_read(0)); // return address counter + return (lcd_read(0)); // return address counter } /* lcd_waitbusy */ @@ -362,17 +362,23 @@ void lcd_gotoxy(uint8_t x, uint8_t y) { /************************************************************************* *************************************************************************/ -int lcd_getxy(void) { return lcd_waitbusy(); } +int lcd_getxy(void) { + return lcd_waitbusy(); +} /************************************************************************* Clear display and set cursor to home position *************************************************************************/ -void lcd_clrscr(void) { lcd_command(1 << LCD_CLR); } +void lcd_clrscr(void) { + lcd_command(1 << LCD_CLR); +} /************************************************************************* Set cursor to home position *************************************************************************/ -void lcd_home(void) { lcd_command(1 << LCD_HOME); } +void lcd_home(void) { + lcd_command(1 << LCD_HOME); +} /************************************************************************* Display character at current cursor position @@ -382,7 +388,7 @@ Returns: none void lcd_putc(char c) { uint8_t pos; - pos = lcd_waitbusy(); // read busy-flag and address counter + pos = lcd_waitbusy(); // read busy-flag and address counter if (c == '\n') { lcd_newline(pos); } else { @@ -483,8 +489,8 @@ void lcd_init(uint8_t dispAttr) { delay(LCD_DELAY_BOOTUP); /* wait 16ms or more after power-on */ /* initial write to lcd is 8bit */ - LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); // LCD_FUNCTION>>4; - LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // LCD_FUNCTION_8BIT>>4; + LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); // LCD_FUNCTION>>4; + LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // LCD_FUNCTION_8BIT>>4; lcd_e_toggle(); delay(LCD_DELAY_INIT); /* delay, busy flag can't be checked here */ @@ -497,7 +503,7 @@ void lcd_init(uint8_t dispAttr) { delay(LCD_DELAY_INIT_REP); /* delay, busy flag can't be checked here */ /* now configure for 4bit mode */ - LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4 + LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4 lcd_e_toggle(); delay(LCD_DELAY_INIT_4BIT); /* some displays need this additional delay */ diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c index 111b55d6b0d3..c1a7b5f72d9d 100644 --- a/platforms/avr/drivers/i2c_master.c +++ b/platforms/avr/drivers/i2c_master.c @@ -25,12 +25,15 @@ #include "wait.h" #ifndef F_SCL -# define F_SCL 400000UL // SCL frequency +# define F_SCL 400000UL // SCL frequency #endif #ifndef I2C_START_RETRY_COUNT # define I2C_START_RETRY_COUNT 20 -#endif // I2C_START_RETRY_COUNT +#endif // I2C_START_RETRY_COUNT + +#define I2C_ACTION_READ 0x01 +#define I2C_ACTION_WRITE 0x00 #define TWBR_val (((F_CPU / F_SCL) - 16) / 2) @@ -95,7 +98,7 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) { i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { // Retry i2c_start_impl a bunch times in case the remote side has interrupts disabled. uint16_t timeout_timer = timer_read(); - uint16_t time_slice = MAX(1, (timeout == (I2C_TIMEOUT_INFINITE)) ? 5 : (timeout / (I2C_START_RETRY_COUNT))); // if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries + uint16_t time_slice = MAX(1, (timeout == (I2C_TIMEOUT_INFINITE)) ? 5 : (timeout / (I2C_START_RETRY_COUNT))); // if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries i2c_status_t status; do { status = i2c_start_impl(address, time_slice); @@ -154,7 +157,7 @@ int16_t i2c_read_nack(uint16_t timeout) { } i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); + i2c_status_t status = i2c_start(address | I2C_ACTION_WRITE, timeout); for (uint16_t i = 0; i < length && status >= 0; i++) { status = i2c_write(data[i], timeout); @@ -166,7 +169,7 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, } i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { - i2c_status_t status = i2c_start(address | I2C_READ, timeout); + i2c_status_t status = i2c_start(address | I2C_ACTION_READ, timeout); for (uint16_t i = 0; i < (length - 1) && status >= 0; i++) { status = i2c_read_ack(timeout); diff --git a/platforms/avr/drivers/i2c_slave.c b/platforms/avr/drivers/i2c_slave.c index 2907f164c07d..660d271be2ba 100644 --- a/platforms/avr/drivers/i2c_slave.c +++ b/platforms/avr/drivers/i2c_slave.c @@ -29,7 +29,7 @@ # include "transactions.h" static volatile bool is_callback_executor = false; -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; @@ -57,7 +57,7 @@ ISR(TWI_vect) { slave_has_register_set = false; #if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) is_callback_executor = false; -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) break; case TW_SR_DATA_ACK: @@ -66,16 +66,16 @@ ISR(TWI_vect) { if (!slave_has_register_set) { buffer_address = TWDR; - if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack + if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack ack = 0; buffer_address = 0; } - slave_has_register_set = true; // address has been received now fill in buffer + slave_has_register_set = true; // address has been received now fill in buffer #if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) // Work out if we're attempting to execute a callback is_callback_executor = buffer_address == split_transaction_table[I2C_EXECUTE_CALLBACK].initiator2target_offset; -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) } else { i2c_slave_reg[buffer_address] = TWDR; buffer_address++; @@ -88,7 +88,7 @@ ISR(TWI_vect) { trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans)); } } -#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) } break; diff --git a/platforms/avr/drivers/i2c_slave.h b/platforms/avr/drivers/i2c_slave.h index a8647c9da3e3..178b6a29dfac 100644 --- a/platforms/avr/drivers/i2c_slave.h +++ b/platforms/avr/drivers/i2c_slave.h @@ -27,11 +27,11 @@ # if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) # include "transport.h" # define I2C_SLAVE_REG_COUNT sizeof(split_shared_memory_t) -# else // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +# else // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) # define I2C_SLAVE_REG_COUNT 30 -# endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) +# endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS) -#endif // I2C_SLAVE_REG_COUNT +#endif // I2C_SLAVE_REG_COUNT _Static_assert(I2C_SLAVE_REG_COUNT < 256, "I2C target registers must be single byte"); diff --git a/platforms/avr/drivers/ps2/ps2_io.c b/platforms/avr/drivers/ps2/ps2_io.c index 7c826fbf1aac..b75a1ab0bec7 100644 --- a/platforms/avr/drivers/ps2/ps2_io.c +++ b/platforms/avr/drivers/ps2/ps2_io.c @@ -23,7 +23,9 @@ void clock_lo(void) { setPinOutput(PS2_CLOCK_PIN); } -void clock_hi(void) { setPinInputHigh(PS2_CLOCK_PIN); } +void clock_hi(void) { + setPinInputHigh(PS2_CLOCK_PIN); +} bool clock_in(void) { setPinInputHigh(PS2_CLOCK_PIN); @@ -42,7 +44,9 @@ void data_lo(void) { setPinOutput(PS2_DATA_PIN); } -void data_hi(void) { setPinInputHigh(PS2_DATA_PIN); } +void data_hi(void) { + setPinInputHigh(PS2_DATA_PIN); +} bool data_in(void) { setPinInputHigh(PS2_DATA_PIN); diff --git a/platforms/avr/drivers/ps2/ps2_usart.c b/platforms/avr/drivers/ps2/ps2_usart.c index 151cfcd68f3a..39ec930d4aa1 100644 --- a/platforms/avr/drivers/ps2/ps2_usart.c +++ b/platforms/avr/drivers/ps2/ps2_usart.c @@ -76,7 +76,7 @@ static inline bool pbuf_has_data(void); static inline void pbuf_clear(void); void ps2_host_init(void) { - idle(); // without this many USART errors occur when cable is disconnected + idle(); // without this many USART errors occur when cable is disconnected PS2_USART_INIT(); PS2_USART_RX_INT_ON(); // POR(150-2000ms) plus BAT(300-500ms) may take 2.5sec([3]p.20) @@ -91,12 +91,12 @@ uint8_t ps2_host_send(uint8_t data) { /* terminate a transmission if we have */ inhibit(); - _delay_us(100); // [4]p.13 + _delay_us(100); // [4]p.13 /* 'Request to Send' and Start bit */ data_lo(); clock_hi(); - WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 + WAIT(clock_lo, 10000, 10); // 10ms [5]p.50 /* Data bit[2-9] */ for (uint8_t i = 0; i < 8; i++) { @@ -165,7 +165,7 @@ uint8_t ps2_host_recv(void) { ISR(PS2_USART_RX_VECT) { // TODO: request RESEND when error occurs? - uint8_t error = PS2_USART_ERROR; // USART error should be read before data + uint8_t error = PS2_USART_ERROR; // USART error should be read before data uint8_t data = PS2_USART_RX_DATA; if (!error) { pbuf_enqueue(data); diff --git a/platforms/avr/drivers/serial.c b/platforms/avr/drivers/serial.c index 9a7345a53df4..6a36aa5f7f15 100644 --- a/platforms/avr/drivers/serial.c +++ b/platforms/avr/drivers/serial.c @@ -16,6 +16,7 @@ #include #include #include +#include "gpio.h" #include "serial.h" #ifdef SOFT_SERIAL_PIN @@ -119,12 +120,6 @@ # error invalid SOFT_SERIAL_PIN value # endif -# define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) -# define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) -# define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) -# define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) -# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) - # define ALWAYS_INLINE __attribute__((always_inline)) # define NO_INLINE __attribute__((noinline)) # define _delay_sub_us(x) __builtin_avr_delay_cycles(x) @@ -161,59 +156,59 @@ # if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed -# define SERIAL_DELAY 4 // micro sec +# define SERIAL_DELAY 4 // micro sec # if __GNUC__ < 6 -# define READ_WRITE_START_ADJUST 33 // cycles -# define READ_WRITE_WIDTH_ADJUST 3 // cycles +# define READ_WRITE_START_ADJUST 33 // cycles +# define READ_WRITE_WIDTH_ADJUST 3 // cycles # else -# define READ_WRITE_START_ADJUST 34 // cycles -# define READ_WRITE_WIDTH_ADJUST 7 // cycles +# define READ_WRITE_START_ADJUST 34 // cycles +# define READ_WRITE_WIDTH_ADJUST 7 // cycles # endif # elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed -# define SERIAL_DELAY 6 // micro sec +# define SERIAL_DELAY 6 // micro sec # if __GNUC__ < 6 -# define READ_WRITE_START_ADJUST 30 // cycles -# define READ_WRITE_WIDTH_ADJUST 3 // cycles +# define READ_WRITE_START_ADJUST 30 // cycles +# define READ_WRITE_WIDTH_ADJUST 3 // cycles # else -# define READ_WRITE_START_ADJUST 33 // cycles -# define READ_WRITE_WIDTH_ADJUST 7 // cycles +# define READ_WRITE_START_ADJUST 33 // cycles +# define READ_WRITE_WIDTH_ADJUST 7 // cycles # endif # elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed -# define SERIAL_DELAY 12 // micro sec -# define READ_WRITE_START_ADJUST 30 // cycles +# define SERIAL_DELAY 12 // micro sec +# define READ_WRITE_START_ADJUST 30 // cycles # if __GNUC__ < 6 -# define READ_WRITE_WIDTH_ADJUST 3 // cycles +# define READ_WRITE_WIDTH_ADJUST 3 // cycles # else -# define READ_WRITE_WIDTH_ADJUST 7 // cycles +# define READ_WRITE_WIDTH_ADJUST 7 // cycles # endif # elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed -# define SERIAL_DELAY 24 // micro sec -# define READ_WRITE_START_ADJUST 30 // cycles +# define SERIAL_DELAY 24 // micro sec +# define READ_WRITE_START_ADJUST 30 // cycles # if __GNUC__ < 6 -# define READ_WRITE_WIDTH_ADJUST 3 // cycles +# define READ_WRITE_WIDTH_ADJUST 3 // cycles # else -# define READ_WRITE_WIDTH_ADJUST 7 // cycles +# define READ_WRITE_WIDTH_ADJUST 7 // cycles # endif # elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed -# define SERIAL_DELAY 36 // micro sec -# define READ_WRITE_START_ADJUST 30 // cycles +# define SERIAL_DELAY 36 // micro sec +# define READ_WRITE_START_ADJUST 30 // cycles # if __GNUC__ < 6 -# define READ_WRITE_WIDTH_ADJUST 3 // cycles +# define READ_WRITE_WIDTH_ADJUST 3 // cycles # else -# define READ_WRITE_WIDTH_ADJUST 7 // cycles +# define READ_WRITE_WIDTH_ADJUST 7 // cycles # endif # elif SELECT_SOFT_SERIAL_SPEED == 5 // Ultra Low speed -# define SERIAL_DELAY 48 // micro sec -# define READ_WRITE_START_ADJUST 30 // cycles +# define SERIAL_DELAY 48 // micro sec +# define READ_WRITE_START_ADJUST 30 // cycles # if __GNUC__ < 6 -# define READ_WRITE_WIDTH_ADJUST 3 // cycles +# define READ_WRITE_WIDTH_ADJUST 3 // cycles # else -# define READ_WRITE_WIDTH_ADJUST 7 // cycles +# define READ_WRITE_WIDTH_ADJUST 7 // cycles # endif # else # error invalid SELECT_SOFT_SERIAL_SPEED value @@ -228,29 +223,45 @@ # define SLAVE_INT_ACK_WIDTH 4 inline static void serial_delay(void) ALWAYS_INLINE; -inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} inline static void serial_delay_half1(void) ALWAYS_INLINE; -inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} inline static void serial_delay_half2(void) ALWAYS_INLINE; -inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); } +inline static void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} inline static void serial_output(void) ALWAYS_INLINE; -inline static void serial_output(void) { setPinOutput(SOFT_SERIAL_PIN); } +inline static void serial_output(void) { + setPinOutput(SOFT_SERIAL_PIN); +} // make the serial pin an input with pull-up resistor inline static void serial_input_with_pullup(void) ALWAYS_INLINE; -inline static void serial_input_with_pullup(void) { setPinInputHigh(SOFT_SERIAL_PIN); } +inline static void serial_input_with_pullup(void) { + setPinInputHigh(SOFT_SERIAL_PIN); +} inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; -inline static uint8_t serial_read_pin(void) { return !!readPin(SOFT_SERIAL_PIN); } +inline static uint8_t serial_read_pin(void) { + return !!readPin(SOFT_SERIAL_PIN); +} inline static void serial_low(void) ALWAYS_INLINE; -inline static void serial_low(void) { writePinLow(SOFT_SERIAL_PIN); } +inline static void serial_low(void) { + writePinLow(SOFT_SERIAL_PIN); +} inline static void serial_high(void) ALWAYS_INLINE; -inline static void serial_high(void) { writePinHigh(SOFT_SERIAL_PIN); } +inline static void serial_high(void) { + writePinHigh(SOFT_SERIAL_PIN); +} void soft_serial_initiator_init(void) { serial_output(); @@ -291,7 +302,7 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { _delay_sub_us(READ_WRITE_START_ADJUST); for (i = 0, byte = 0, p = PARITY; i < bit; i++) { - serial_delay_half1(); // read the middle of pulses + serial_delay_half1(); // read the middle of pulses if (serial_read_pin()) { byte = (byte << 1) | 1; p ^= 1; @@ -303,7 +314,7 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { serial_delay_half2(); } /* recive parity bit */ - serial_delay_half1(); // read the middle of pulses + serial_delay_half1(); // read the middle of pulses pb = serial_read_pin(); _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -335,7 +346,7 @@ void serial_write_chunk(uint8_t data, uint8_t bit) { } serial_delay(); - serial_low(); // sync_send() / senc_recv() need raise edge + serial_low(); // sync_send() / senc_recv() need raise edge } static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; @@ -361,19 +372,19 @@ static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { } inline static void change_sender2reciver(void) { - sync_send(); // 0 - serial_delay_half1(); // 1 - serial_low(); // 2 - serial_input_with_pullup(); // 2 - serial_delay_half1(); // 3 + sync_send(); // 0 + serial_delay_half1(); // 1 + serial_low(); // 2 + serial_input_with_pullup(); // 2 + serial_delay_half1(); // 3 } inline static void change_reciver2sender(void) { - sync_recv(); // 0 - serial_delay(); // 1 - serial_low(); // 3 - serial_output(); // 3 - serial_delay_half1(); // 4 + sync_recv(); // 0 + serial_delay(); // 1 + serial_low(); // 3 + serial_output(); // 3 + serial_delay_half1(); // 4 } static inline uint8_t nibble_bits_count(uint8_t bits) { @@ -396,11 +407,11 @@ ISR(SERIAL_PIN_INTERRUPT) { } serial_delay_half1(); - serial_high(); // response step1 low->high + serial_high(); // response step1 low->high serial_output(); _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT * SLAVE_INT_ACK_WIDTH); split_transaction_desc_t *trans = &split_transaction_table[tid]; - serial_low(); // response step2 ack high->low + serial_low(); // response step2 ack high->low // If the transaction has a callback, we can execute it now if (trans->slave_callback) { @@ -414,34 +425,22 @@ ISR(SERIAL_PIN_INTERRUPT) { // target recive phase if (trans->initiator2target_buffer_size > 0) { - if (serial_recive_packet((uint8_t *)split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size)) { - *trans->status = TRANSACTION_ACCEPTED; - } else { - *trans->status = TRANSACTION_DATA_ERROR; - } - } else { - *trans->status = TRANSACTION_ACCEPTED; + serial_recive_packet((uint8_t *)split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size); } - sync_recv(); // weit initiator output to high + sync_recv(); // weit initiator output to high } ///////// // start transaction by initiator // -// int soft_serial_transaction(int sstd_index) +// bool soft_serial_transaction(int sstd_index) // -// Returns: -// TRANSACTION_END -// TRANSACTION_NO_RESPONSE -// TRANSACTION_DATA_ERROR // this code is very time dependent, so we need to disable interrupts -int soft_serial_transaction(int sstd_index) { - if (sstd_index > NUM_TOTAL_TRANSACTIONS) return TRANSACTION_TYPE_ERROR; +bool soft_serial_transaction(int sstd_index) { + if (sstd_index > NUM_TOTAL_TRANSACTIONS) return false; split_transaction_desc_t *trans = &split_transaction_table[sstd_index]; - if (!trans->status) return TRANSACTION_TYPE_ERROR; // not registered - cli(); // signal to the target that we want to start a transaction @@ -468,9 +467,8 @@ int soft_serial_transaction(int sstd_index) { // slave failed to pull the line low, assume not present serial_output(); serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; sei(); - return TRANSACTION_NO_RESPONSE; + return false; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -481,9 +479,8 @@ int soft_serial_transaction(int sstd_index) { if (!serial_recive_packet((uint8_t *)split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size)) { serial_output(); serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; sei(); - return TRANSACTION_DATA_ERROR; + return false; } } @@ -498,19 +495,8 @@ int soft_serial_transaction(int sstd_index) { // always, release the line when not in use sync_send(); - *trans->status = TRANSACTION_END; - sei(); - return TRANSACTION_END; -} - -int soft_serial_get_and_clean_status(int sstd_index) { - split_transaction_desc_t *trans = &split_transaction_table[sstd_index]; - cli(); - int retval = *trans->status; - *trans->status = 0; - ; sei(); - return retval; + return true; } #endif diff --git a/platforms/avr/drivers/spi_master.c b/platforms/avr/drivers/spi_master.c index 4e8fd3bcdfb1..ae9df03c02dc 100644 --- a/platforms/avr/drivers/spi_master.c +++ b/platforms/avr/drivers/spi_master.c @@ -125,7 +125,7 @@ spi_status_t spi_write(uint8_t data) { } spi_status_t spi_read() { - SPDR = 0x00; // Dummy + SPDR = 0x00; // Dummy uint16_t timeout_timer = timer_read(); while (!(SPSR & _BV(SPIF))) { diff --git a/platforms/avr/drivers/ssd1306.c b/platforms/avr/drivers/ssd1306.c index 1a09a2bcb789..7afbc09f0015 100644 --- a/platforms/avr/drivers/ssd1306.c +++ b/platforms/avr/drivers/ssd1306.c @@ -161,7 +161,7 @@ bool iota_gfx_init(void) { send_cmd1(DeActivateScroll); send_cmd1(DisplayOn); - send_cmd2(SetContrast, 0); // Dim + send_cmd2(SetContrast, 0); // Dim clear_display(); @@ -226,7 +226,9 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { matrix_write_char_inner(matrix, c); } -void iota_gfx_write_char(uint8_t c) { matrix_write_char(&display, c); } +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} void matrix_write(struct CharacterMatrix *matrix, const char *data) { const char *end = data + strlen(data); @@ -236,7 +238,9 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data) { } } -void iota_gfx_write(const char *data) { matrix_write(&display, data); } +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { while (true) { @@ -249,7 +253,9 @@ void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { } } -void iota_gfx_write_P(const char *data) { matrix_write_P(&display, data); } +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} void matrix_clear(struct CharacterMatrix *matrix) { memset(matrix->display, ' ', sizeof(matrix->display)); @@ -257,7 +263,9 @@ void matrix_clear(struct CharacterMatrix *matrix) { matrix->dirty = true; } -void iota_gfx_clear_screen(void) { matrix_clear(&display); } +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} void matrix_render(struct CharacterMatrix *matrix) { last_flush = timer_read(); @@ -301,7 +309,9 @@ void matrix_render(struct CharacterMatrix *matrix) { # endif } -void iota_gfx_flush(void) { matrix_render(&display); } +void iota_gfx_flush(void) { + matrix_render(&display); +} __attribute__((weak)) void iota_gfx_task_user(void) {} diff --git a/platforms/avr/drivers/uart.c b/platforms/avr/drivers/uart.c index 01cf6b1fb8db..fd5caf9a78a3 100644 --- a/platforms/avr/drivers/uart.c +++ b/platforms/avr/drivers/uart.c @@ -108,7 +108,7 @@ void uart_write(uint8_t data) { // return immediately to avoid deadlock when interrupt is disabled(called from ISR) if (tx_buffer_tail == i && (SREG & (1 << SREG_I)) == 0) return; while (tx_buffer_tail == i) - ; // wait until space in buffer + ; // wait until space in buffer // cli(); tx_buffer[i] = data; tx_buffer_head = i; @@ -121,7 +121,7 @@ uint8_t uart_read(void) { uint8_t data, i; while (rx_buffer_head == rx_buffer_tail) - ; // wait for character + ; // wait for character i = rx_buffer_tail + 1; if (i >= RX_BUFFER_SIZE) i = 0; data = rx_buffer[i]; diff --git a/platforms/avr/drivers/ws2812.c b/platforms/avr/drivers/ws2812.c index 9150b3c520ca..c461ab3ba791 100644 --- a/platforms/avr/drivers/ws2812.c +++ b/platforms/avr/drivers/ws2812.c @@ -110,7 +110,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t asm volatile(" ldi %0,8 \n\t" "loop%=: \n\t" - " out %2,%3 \n\t" // '1' [01] '0' [01] - re + " out %2,%3 \n\t" // '1' [01] '0' [01] - re #if (w1_nops & 1) w_nop1 #endif @@ -126,9 +126,9 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t #if (w1_nops & 16) w_nop16 #endif - " sbrs %1,7 \n\t" // '1' [03] '0' [02] - " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low - " lsl %1 \n\t" // '1' [04] '0' [04] + " sbrs %1,7 \n\t" // '1' [03] '0' [02] + " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low + " lsl %1 \n\t" // '1' [04] '0' [04] #if (w2_nops & 1) w_nop1 #endif @@ -144,7 +144,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t #if (w2_nops & 16) w_nop16 #endif - " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high + " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high #if (w3_nops & 1) w_nop1 #endif @@ -161,8 +161,8 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t w_nop16 #endif - " dec %0 \n\t" // '1' [+2] '0' [+2] - " brne loop%=\n\t" // '1' [+3] '0' [+4] + " dec %0 \n\t" // '1' [+2] '0' [+2] + " brne loop%=\n\t" // '1' [+3] '0' [+4] : "=&d"(ctr) : "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(RGB_DI_PIN))), "r"(maskhi), "r"(masklo)); } diff --git a/platforms/avr/drivers/ws2812_i2c.c b/platforms/avr/drivers/ws2812_i2c.c index 1c332e24b602..709f3822547f 100644 --- a/platforms/avr/drivers/ws2812_i2c.c +++ b/platforms/avr/drivers/ws2812_i2c.c @@ -13,7 +13,9 @@ # define WS2812_TIMEOUT 100 #endif -void ws2812_init(void) { i2c_init(); } +void ws2812_init(void) { + i2c_init(); +} // Setleds for standard RGB void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { diff --git a/platforms/avr/gpio.h b/platforms/avr/gpio.h index e9be68491d7c..95f15c28dcd2 100644 --- a/platforms/avr/gpio.h +++ b/platforms/avr/gpio.h @@ -25,7 +25,9 @@ typedef uint8_t pin_t; #define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) #define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) #define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") -#define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) +#define setPinOutputPushPull(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) +#define setPinOutputOpenDrain(pin) _Static_assert(0, "AVR platform does not implement an open-drain output") +#define setPinOutput(pin) setPinOutputPushPull(pin) #define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) #define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) @@ -34,16 +36,3 @@ typedef uint8_t pin_t; #define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) #define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) - -/* Operation of GPIO by port. */ - -typedef uint8_t port_data_t; - -#define readPort(port) PINx_ADDRESS(port) - -#define setPortBitInput(port, bit) (DDRx_ADDRESS(port) &= ~_BV((bit)&0xF), PORTx_ADDRESS(port) &= ~_BV((bit)&0xF)) -#define setPortBitInputHigh(port, bit) (DDRx_ADDRESS(port) &= ~_BV((bit)&0xF), PORTx_ADDRESS(port) |= _BV((bit)&0xF)) -#define setPortBitOutput(port, bit) (DDRx_ADDRESS(port) |= _BV((bit)&0xF)) - -#define writePortBitLow(port, bit) (PORTx_ADDRESS(port) &= ~_BV((bit)&0xF)) -#define writePortBitHigh(port, bit) (PORTx_ADDRESS(port) |= _BV((bit)&0xF)) diff --git a/platforms/avr/pin_defs.h b/platforms/avr/pin_defs.h index 23d948041d3b..3889704a8785 100644 --- a/platforms/avr/pin_defs.h +++ b/platforms/avr/pin_defs.h @@ -17,7 +17,7 @@ #include -#define PORT_SHIFTER 4 // this may be 4 for all AVR chips +#define PORT_SHIFTER 4 // this may be 4 for all AVR chips // If you want to add more to this list, reference the PINx definitions in these header // files: https://github.com/vancegroup-mirrors/avr-libc/tree/master/avr-libc/include/avr diff --git a/platforms/avr/platform.mk b/platforms/avr/platform.mk index b45108736f10..4d9cafaeef4a 100644 --- a/platforms/avr/platform.mk +++ b/platforms/avr/platform.mk @@ -159,7 +159,7 @@ endif bootloader: ifeq ($(strip $(QMK_BOOTLOADER_TYPE)),) - $(error Please set BOOTLOADER to "qmk-dfu" or "qmk-hid" first!) + $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Please set BOOTLOADER to "qmk-dfu" or "qmk-hid" first!) else make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean $(QMK_BIN) generate-dfu-header --quiet --keyboard $(KEYBOARD) --output lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Keyboard.h diff --git a/platforms/avr/printf.c b/platforms/avr/printf.c index 9ad7a38693c5..062f70fa0bb0 100644 --- a/platforms/avr/printf.c +++ b/platforms/avr/printf.c @@ -17,4 +17,6 @@ along with this program. If not, see . #include "xprintf.h" #include "sendchar.h" -void print_set_sendchar(sendchar_func_t func) { xdev_out(func); } +void print_set_sendchar(sendchar_func_t func) { + xdev_out(func); +} diff --git a/platforms/avr/sleep_led.c b/platforms/avr/sleep_led.c index 9a3b52abe54c..b05431633ba3 100644 --- a/platforms/avr/sleep_led.c +++ b/platforms/avr/sleep_led.c @@ -12,7 +12,7 @@ #if SLEEP_LED_TIMER == 1 # define TCCRxB TCCR1B # define TIMERx_COMPA_vect TIMER1_COMPA_vect -# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register +# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register # define TIMSKx TIMSK # else # define TIMSKx TIMSK1 diff --git a/platforms/avr/suspend.c b/platforms/avr/suspend.c index b614746e6cd8..1a7cd3b4ab8d 100644 --- a/platforms/avr/suspend.c +++ b/platforms/avr/suspend.c @@ -2,12 +2,9 @@ #include #include #include -#include "matrix.h" -#include "action.h" #include "suspend.h" +#include "action.h" #include "timer.h" -#include "led.h" -#include "host.h" #ifdef PROTOCOL_LUFA # include "lufa.h" @@ -16,19 +13,6 @@ # include "vusb.h" #endif -/** \brief Suspend idle - * - * FIXME: needs doc - */ -void suspend_idle(uint8_t time) { - cli(); - set_sleep_mode(SLEEP_MODE_IDLE); - sleep_enable(); - sei(); - sleep_cpu(); - sleep_disable(); -} - // TODO: This needs some cleanup #if !defined(NO_SUSPEND_POWER_DOWN) && defined(WDT_vect) @@ -91,6 +75,18 @@ static void power_down(uint8_t wdto) { // Disable watchdog after sleep wdt_disable(); } + +/* watchdog timeout */ +ISR(WDT_vect) { + // compensate timer for sleep + switch (wdt_timeout) { + case WDTO_15MS: + timer_count += 15 + 2; // WDTO_15MS + 2(from observation) + break; + default:; + } +} + #endif /** \brief Suspend power down @@ -115,18 +111,6 @@ void suspend_power_down(void) { #endif } -__attribute__((weak)) void matrix_power_up(void) {} -__attribute__((weak)) void matrix_power_down(void) {} -bool suspend_wakeup_condition(void) { - matrix_power_up(); - matrix_scan(); - matrix_power_down(); - for (uint8_t r = 0; r < MATRIX_ROWS; r++) { - if (matrix_get_row(r)) return true; - } - return false; -} - /** \brief run immediately after wakeup * * FIXME: needs doc @@ -137,16 +121,3 @@ void suspend_wakeup_init(void) { suspend_wakeup_init_quantum(); } - -#if !defined(NO_SUSPEND_POWER_DOWN) && defined(WDT_vect) -/* watchdog timeout */ -ISR(WDT_vect) { - // compensate timer for sleep - switch (wdt_timeout) { - case WDTO_15MS: - timer_count += 15 + 2; // WDTO_15MS + 2(from observation) - break; - default:; - } -} -#endif diff --git a/platforms/avr/timer.c b/platforms/avr/timer.c index c2e6c6e08125..9fb671ae8d88 100644 --- a/platforms/avr/timer.c +++ b/platforms/avr/timer.c @@ -73,7 +73,9 @@ void timer_init(void) { * FIXME: needs doc */ inline void timer_clear(void) { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { timer_count = 0; } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + timer_count = 0; + } } /** \brief timer read @@ -83,7 +85,9 @@ inline void timer_clear(void) { inline uint16_t timer_read(void) { uint32_t t; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { t = timer_count; } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + t = timer_count; + } return (t & 0xFFFF); } @@ -95,7 +99,9 @@ inline uint16_t timer_read(void) { inline uint32_t timer_read32(void) { uint32_t t; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { t = timer_count; } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + t = timer_count; + } return t; } @@ -107,7 +113,9 @@ inline uint32_t timer_read32(void) { inline uint16_t timer_elapsed(uint16_t last) { uint32_t t; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { t = timer_count; } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + t = timer_count; + } return TIMER_DIFF_16((t & 0xFFFF), last); } @@ -119,7 +127,9 @@ inline uint16_t timer_elapsed(uint16_t last) { inline uint32_t timer_elapsed32(uint32_t last) { uint32_t t; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { t = timer_count; } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + t = timer_count; + } return TIMER_DIFF_32(t, last); } @@ -130,4 +140,6 @@ inline uint32_t timer_elapsed32(uint32_t last) { #else # define TIMER_INTERRUPT_VECTOR TIMER0_COMP_vect #endif -ISR(TIMER_INTERRUPT_VECTOR, ISR_NOBLOCK) { timer_count++; } +ISR(TIMER_INTERRUPT_VECTOR, ISR_NOBLOCK) { + timer_count++; +} diff --git a/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/bootloader_defs.h b/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/bootloader_defs.h deleted file mode 100644 index 4da3d39a3268..000000000000 --- a/platforms/chibios/boards/BLACKPILL_STM32_F401/configs/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/bootloader_defs.h b/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/bootloader_defs.h deleted file mode 100644 index 4da3d39a3268..000000000000 --- a/platforms/chibios/boards/BLACKPILL_STM32_F411/configs/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/platforms/chibios/boards/GENERIC_STM32_F042X6/configs/bootloader_defs.h b/platforms/chibios/boards/GENERIC_STM32_F042X6/configs/bootloader_defs.h deleted file mode 100644 index 25113425a655..000000000000 --- a/platforms/chibios/boards/GENERIC_STM32_F042X6/configs/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFC400 diff --git a/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/bootloader_defs.h b/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/bootloader_defs.h deleted file mode 100644 index dccd0fa5d11e..000000000000 --- a/platforms/chibios/boards/GENERIC_STM32_F072XB/configs/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here (page 175): - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/bootloader_defs.h b/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/bootloader_defs.h deleted file mode 100644 index 87ac7b10dce7..000000000000 --- a/platforms/chibios/boards/GENERIC_STM32_F303XC/configs/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/config.h index cc52a953ed4d..90a41326a16e 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_F405XG/configs/config.h @@ -17,7 +17,7 @@ /* Address for jumping to bootloader on STM32 chips. */ /* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606. */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 + #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif diff --git a/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/config.h index cc52a953ed4d..90a41326a16e 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_F407XE/configs/config.h @@ -17,7 +17,7 @@ /* Address for jumping to bootloader on STM32 chips. */ /* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606. */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 + #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif diff --git a/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h index cc52a953ed4d..90a41326a16e 100644 --- a/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_F446XE/configs/config.h @@ -17,7 +17,7 @@ /* Address for jumping to bootloader on STM32 chips. */ /* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606. */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 + #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE #endif diff --git a/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/config.h index c27c61b19aa4..fc9055ccfb57 100644 --- a/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_L412XB/configs/config.h @@ -17,7 +17,6 @@ /* Address for jumping to bootloader on STM32 chips. */ /* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606. */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 #define PAL_STM32_OSPEED_HIGHEST PAL_STM32_OSPEED_HIGH diff --git a/platforms/chibios/boards/GENERIC_STM32_L432XC/board/board.mk b/platforms/chibios/boards/GENERIC_STM32_L432XC/board/board.mk new file mode 100644 index 000000000000..1250385eb8e2 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_L432XC/board/board.mk @@ -0,0 +1,9 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO32_L432KC/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO32_L432KC + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/GENERIC_STM32_L432XC/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_L432XC/configs/config.h new file mode 100644 index 000000000000..b1838b30a8aa --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_L432XC/configs/config.h @@ -0,0 +1,10 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// Fixup equivalent usages within QMK as the base board definitions only go up to high +#define PAL_STM32_OSPEED_HIGHEST PAL_STM32_OSPEED_HIGH + +#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP +# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE +#endif diff --git a/platforms/chibios/boards/GENERIC_STM32_L432XC/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_STM32_L432XC/configs/mcuconf.h new file mode 100644 index 000000000000..707134d49ef4 --- /dev/null +++ b/platforms/chibios/boards/GENERIC_STM32_L432XC/configs/mcuconf.h @@ -0,0 +1,267 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + 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 + + http://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. +*/ + +/* + * STM32L4xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#ifndef MCUCONF_H +#define MCUCONF_H + +#define STM32L4xx_MCUCONF +#define STM32L432_MCUCONF +#define STM32L433_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_VOS STM32_VOS_RANGE1 +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI16_ENABLED TRUE +#define STM32_HSI48_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_MSIPLL_ENABLED FALSE +#define STM32_MSIRANGE STM32_MSIRANGE_4M +#define STM32_MSISRANGE STM32_MSISRANGE_4M +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI16 +#define STM32_PLLM_VALUE 1 +#define STM32_PLLN_VALUE 10 +#define STM32_PLLPDIV_VALUE 0 +#define STM32_PLLP_VALUE 7 +#define STM32_PLLQ_VALUE 2 +#define STM32_PLLR_VALUE 2 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV1 +#define STM32_PPRE2 STM32_PPRE2_DIV1 +#define STM32_STOPWUCK STM32_STOPWUCK_MSI +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_MCOPRE STM32_MCOPRE_DIV1 +#define STM32_LSCOSEL STM32_LSCOSEL_NOCLOCK +#define STM32_PLLSAI1N_VALUE 24 +#define STM32_PLLSAI1PDIV_VALUE 0 +#define STM32_PLLSAI1P_VALUE 7 +#define STM32_PLLSAI1Q_VALUE 2 +#define STM32_PLLSAI1R_VALUE 2 + +/* + * Peripherals clock sources. + */ +#define STM32_USART1SEL STM32_USART1SEL_SYSCLK +#define STM32_USART2SEL STM32_USART2SEL_SYSCLK +#define STM32_LPUART1SEL STM32_LPUART1SEL_SYSCLK +#define STM32_I2C1SEL STM32_I2C1SEL_SYSCLK +#define STM32_I2C3SEL STM32_I2C3SEL_SYSCLK +#define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK1 +#define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK1 +#define STM32_SAI1SEL STM32_SAI1SEL_OFF +#define STM32_CLK48SEL STM32_CLK48SEL_HSI48 +#define STM32_ADCSEL STM32_ADCSEL_SYSCLK +#define STM32_SWPMI1SEL STM32_SWPMI1SEL_PCLK1 +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * IRQ system settings. + */ +#define STM32_IRQ_EXTI0_PRIORITY 6 +#define STM32_IRQ_EXTI1_PRIORITY 6 +#define STM32_IRQ_EXTI2_PRIORITY 6 +#define STM32_IRQ_EXTI3_PRIORITY 6 +#define STM32_IRQ_EXTI4_PRIORITY 6 +#define STM32_IRQ_EXTI5_9_PRIORITY 6 +#define STM32_IRQ_EXTI10_15_PRIORITY 6 +#define STM32_IRQ_EXTI1635_38_PRIORITY 6 +#define STM32_IRQ_EXTI18_PRIORITY 6 +#define STM32_IRQ_EXTI19_PRIORITY 6 +#define STM32_IRQ_EXTI20_PRIORITY 6 +#define STM32_IRQ_EXTI21_22_PRIORITY 15 + +#define STM32_IRQ_TIM1_BRK_TIM15_PRIORITY 7 +#define STM32_IRQ_TIM1_UP_TIM16_PRIORITY 7 +#define STM32_IRQ_TIM1_TRGCO_TIM17_PRIORITY 7 +#define STM32_IRQ_TIM1_CC_PRIORITY 7 +#define STM32_IRQ_TIM2_PRIORITY 7 +#define STM32_IRQ_TIM6_PRIORITY 7 +#define STM32_IRQ_TIM7_PRIORITY 7 + +#define STM32_IRQ_USART1_PRIORITY 12 +#define STM32_IRQ_USART2_PRIORITY 12 +#define STM32_IRQ_LPUART1_PRIORITY 12 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC123_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC123_PRESC ADC_CCR_PRESC_DIV2 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 FALSE +#define STM32_DAC_USE_DAC1_CH2 FALSE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) +#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM6 FALSE +#define STM32_GPT_USE_TIM7 FALSE +#define STM32_GPT_USE_TIM15 FALSE +#define STM32_GPT_USE_TIM16 FALSE + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C3 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C3_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C3_DMA_PRIORITY 3 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM15 FALSE +#define STM32_ICU_USE_TIM16 FALSE + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM15 FALSE +#define STM32_PWM_USE_TIM16 FALSE + +/* + * RTC driver system settings. + */ +#define STM32_RTC_PRESA_VALUE 32 +#define STM32_RTC_PRESS_VALUE 1024 +#define STM32_RTC_CR_INIT 0 +#define STM32_RTC_TAMPCR_INIT 0 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_LPUART1 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_LPUART1_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) +#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) +#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * TRNG driver system settings. + */ +#define STM32_TRNG_USE_RNG1 FALSE + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) +#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 6) +#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) +#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +/* + * WSPI driver system settings. + */ +#define STM32_WSPI_USE_QUADSPI1 FALSE +#define STM32_WSPI_QUADSPI1_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) +#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE 1 + +#endif /* MCUCONF_H */ diff --git a/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/config.h b/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/config.h index c27c61b19aa4..fc9055ccfb57 100644 --- a/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/config.h +++ b/platforms/chibios/boards/GENERIC_STM32_L433XC/configs/config.h @@ -17,7 +17,6 @@ /* Address for jumping to bootloader on STM32 chips. */ /* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606. */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 #define PAL_STM32_OSPEED_HIGHEST PAL_STM32_OSPEED_HIGH diff --git a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/bootloader_defs.h b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/bootloader_defs.h deleted file mode 100644 index c929d2ad035a..000000000000 --- a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/configs/bootloader_defs.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Address for jumping to bootloader on WB32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.westberrytech.com/down/mcu/data/WB32F3G71xx_rm.pdf - */ -#ifndef WB32_BOOTLOADER_ADDRESS -# undef STM32_BOOTLOADER_ADDRESS -# define WB32_BOOTLOADER_ADDRESS 0x1FFFE000 -# define STM32_BOOTLOADER_ADDRESS WB32_BOOTLOADER_ADDRESS -#else -# undef STM32_BOOTLOADER_ADDRESS -# define STM32_BOOTLOADER_ADDRESS WB32_BOOTLOADER_ADDRESS -#endif diff --git a/platforms/chibios/boards/QMK_PROTON_C/configs/bootloader_defs.h b/platforms/chibios/boards/QMK_PROTON_C/configs/bootloader_defs.h deleted file mode 100644 index 3b0e9d20a6ab..000000000000 --- a/platforms/chibios/boards/QMK_PROTON_C/configs/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/platforms/chibios/bootloader.c b/platforms/chibios/bootloader.c deleted file mode 100644 index 58212948b08a..000000000000 --- a/platforms/chibios/bootloader.c +++ /dev/null @@ -1,145 +0,0 @@ -#include "bootloader.h" - -#include -#include -#include "wait.h" - -/* This code should be checked whether it runs correctly on platforms */ -#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) -#define BOOTLOADER_MAGIC 0xDEADBEEF -#define MAGIC_ADDR (unsigned long *)(SYMVAL(__ram0_end__) - 4) - -#ifndef STM32_BOOTLOADER_DUAL_BANK -# define STM32_BOOTLOADER_DUAL_BANK FALSE -#endif - -#ifdef BOOTLOADER_TINYUF2 - -# define DBL_TAP_MAGIC 0xf01669ef // From tinyuf2's board_api.h - -// defined by linker script -extern uint32_t _board_dfu_dbl_tap[]; -# define DBL_TAP_REG _board_dfu_dbl_tap[0] - -void bootloader_jump(void) { - DBL_TAP_REG = DBL_TAP_MAGIC; - NVIC_SystemReset(); -} - -void enter_bootloader_mode_if_requested(void) { /* not needed, no two-stage reset */ -} - -#elif STM32_BOOTLOADER_DUAL_BANK - -// Need pin definitions -# include "config_common.h" - -# ifndef STM32_BOOTLOADER_DUAL_BANK_GPIO -# error "No STM32_BOOTLOADER_DUAL_BANK_GPIO defined, don't know which pin to toggle" -# endif - -# ifndef STM32_BOOTLOADER_DUAL_BANK_POLARITY -# define STM32_BOOTLOADER_DUAL_BANK_POLARITY 0 -# endif - -# ifndef STM32_BOOTLOADER_DUAL_BANK_DELAY -# define STM32_BOOTLOADER_DUAL_BANK_DELAY 100000 -# endif - -extern uint32_t __ram0_end__; - -__attribute__((weak)) void bootloader_jump(void) { - // For STM32 MCUs with dual-bank flash, and we're incapable of jumping to the bootloader. The first valid flash - // bank is executed unconditionally after a reset, so it doesn't enter DFU unless BOOT0 is high. Instead, we do - // it with hardware...in this case, we pull a GPIO high/low depending on the configuration, connects 3.3V to - // BOOT0's RC charging circuit, lets it charge the capacitor, and issue a system reset. See the QMK discord - // #hardware channel pins for an example circuit. - palSetPadMode(PAL_PORT(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_PAD(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_MODE_OUTPUT_PUSHPULL); -# if STM32_BOOTLOADER_DUAL_BANK_POLARITY - palSetPad(PAL_PORT(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_PAD(STM32_BOOTLOADER_DUAL_BANK_GPIO)); -# else - palClearPad(PAL_PORT(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_PAD(STM32_BOOTLOADER_DUAL_BANK_GPIO)); -# endif - - // Wait for a while for the capacitor to charge - wait_ms(100); - - // Issue a system reset to get the ROM bootloader to execute, with BOOT0 high - NVIC_SystemReset(); -} - -void enter_bootloader_mode_if_requested(void) {} // not needed at all, but if anybody attempts to invoke it.... - -#elif defined(STM32_BOOTLOADER_ADDRESS) // STM32_BOOTLOADER_DUAL_BANK - -extern uint32_t __ram0_end__; - -__attribute__((weak)) void bootloader_jump(void) { - *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader - NVIC_SystemReset(); -} - -void enter_bootloader_mode_if_requested(void) { - unsigned long *check = MAGIC_ADDR; - if (*check == BOOTLOADER_MAGIC) { - *check = 0; - __set_CONTROL(0); - __set_MSP(*(__IO uint32_t *)STM32_BOOTLOADER_ADDRESS); - __enable_irq(); - - typedef void (*BootJump_t)(void); - BootJump_t boot_jump = *(BootJump_t *)(STM32_BOOTLOADER_ADDRESS + 4); - boot_jump(); - while (1) - ; - } -} - -#elif defined(GD32VF103) - -# define DBGMCU_KEY_UNLOCK 0x4B5A6978 -# define DBGMCU_CMD_RESET 0x1 - -__IO uint32_t *DBGMCU_KEY = (uint32_t *)DBGMCU_BASE + 0x0CU; -__IO uint32_t *DBGMCU_CMD = (uint32_t *)DBGMCU_BASE + 0x08U; - -__attribute__((weak)) void bootloader_jump(void) { - /* The MTIMER unit of the GD32VF103 doesn't have the MSFRST - * register to generate a software reset request. - * BUT instead two undocumented registers in the debug peripheral - * that allow issueing a software reset. WHO would need the MSFRST - * register anyway? Source: - * https://github.com/esmil/gd32vf103inator/blob/master/include/gd32vf103/dbg.h */ - *DBGMCU_KEY = DBGMCU_KEY_UNLOCK; - *DBGMCU_CMD = DBGMCU_CMD_RESET; -} - -void enter_bootloader_mode_if_requested(void) { /* Jumping to bootloader is not possible from user code. */ -} - -#elif defined(KL2x) || defined(K20x) || defined(MK66F18) || defined(MIMXRT1062) // STM32_BOOTLOADER_DUAL_BANK // STM32_BOOTLOADER_ADDRESS -/* Kinetis */ - -# if defined(BOOTLOADER_KIIBOHD) -/* Kiibohd Bootloader (MCHCK and Infinity KB) */ -# define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 -const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; -__attribute__((weak)) void bootloader_jump(void) { - void *volatile vbat = (void *)VBAT; - __builtin_memcpy(vbat, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); - // request reset - SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; -} - -# else /* defined(BOOTLOADER_KIIBOHD) */ -/* Default for Kinetis - expecting an ARM Teensy */ -# include "wait.h" -__attribute__((weak)) void bootloader_jump(void) { - wait_ms(100); - __BKPT(0); -} -# endif /* defined(BOOTLOADER_KIIBOHD) */ - -#else /* neither STM32 nor KINETIS */ -__attribute__((weak)) void bootloader_jump(void) {} -#endif diff --git a/platforms/chibios/bootloaders/custom.c b/platforms/chibios/bootloaders/custom.c new file mode 100644 index 000000000000..bba9fc4637db --- /dev/null +++ b/platforms/chibios/bootloaders/custom.c @@ -0,0 +1,21 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +__attribute__((weak)) void bootloader_jump(void) {} + +__attribute__((weak)) void enter_bootloader_mode_if_requested(void) {} diff --git a/platforms/chibios/bootloaders/gd32v_dfu.c b/platforms/chibios/bootloaders/gd32v_dfu.c new file mode 100644 index 000000000000..baa7d1f8823f --- /dev/null +++ b/platforms/chibios/bootloaders/gd32v_dfu.c @@ -0,0 +1,40 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include +#include + +#define DBGMCU_KEY_UNLOCK 0x4B5A6978 +#define DBGMCU_CMD_RESET 0x1 + +__IO uint32_t *DBGMCU_KEY = (uint32_t *)DBGMCU_BASE + 0x0CU; +__IO uint32_t *DBGMCU_CMD = (uint32_t *)DBGMCU_BASE + 0x08U; + +__attribute__((weak)) void bootloader_jump(void) { + /* The MTIMER unit of the GD32VF103 doesn't have the MSFRST + * register to generate a software reset request. + * BUT instead two undocumented registers in the debug peripheral + * that allow issueing a software reset. WHO would need the MSFRST + * register anyway? Source: + * https://github.com/esmil/gd32vf103inator/blob/master/include/gd32vf103/dbg.h */ + *DBGMCU_KEY = DBGMCU_KEY_UNLOCK; + *DBGMCU_CMD = DBGMCU_CMD_RESET; +} + +/* Jumping to bootloader is not possible from user code. */ +void enter_bootloader_mode_if_requested(void) {} diff --git a/platforms/chibios/bootloaders/halfkay.c b/platforms/chibios/bootloaders/halfkay.c new file mode 100644 index 000000000000..168c2abc230e --- /dev/null +++ b/platforms/chibios/bootloaders/halfkay.c @@ -0,0 +1,25 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include +#include "wait.h" + +__attribute__((weak)) void bootloader_jump(void) { + wait_ms(100); + __BKPT(0); +} diff --git a/platforms/chibios/bootloaders/kiibohd.c b/platforms/chibios/bootloaders/kiibohd.c new file mode 100644 index 000000000000..911e80709275 --- /dev/null +++ b/platforms/chibios/bootloaders/kiibohd.c @@ -0,0 +1,32 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include + +/* Kiibohd Bootloader (MCHCK and Infinity KB) */ +#define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 + +const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; + +__attribute__((weak)) void bootloader_jump(void) { + void *volatile vbat = (void *)VBAT; + __builtin_memcpy(vbat, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); + + // request reset + SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; +} diff --git a/platforms/chibios/bootloaders/stm32_dfu.c b/platforms/chibios/bootloaders/stm32_dfu.c new file mode 100644 index 000000000000..0e7411136706 --- /dev/null +++ b/platforms/chibios/bootloaders/stm32_dfu.c @@ -0,0 +1,94 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include +#include +#include "wait.h" + +extern uint32_t __ram0_end__; + +#ifndef STM32_BOOTLOADER_DUAL_BANK +# define STM32_BOOTLOADER_DUAL_BANK FALSE +#endif + +#if STM32_BOOTLOADER_DUAL_BANK +# include "config_common.h" + +# ifndef STM32_BOOTLOADER_DUAL_BANK_GPIO +# error "No STM32_BOOTLOADER_DUAL_BANK_GPIO defined, don't know which pin to toggle" +# endif + +# ifndef STM32_BOOTLOADER_DUAL_BANK_POLARITY +# define STM32_BOOTLOADER_DUAL_BANK_POLARITY 0 +# endif + +# ifndef STM32_BOOTLOADER_DUAL_BANK_DELAY +# define STM32_BOOTLOADER_DUAL_BANK_DELAY 100000 +# endif + +__attribute__((weak)) void bootloader_jump(void) { + // For STM32 MCUs with dual-bank flash, and we're incapable of jumping to the bootloader. The first valid flash + // bank is executed unconditionally after a reset, so it doesn't enter DFU unless BOOT0 is high. Instead, we do + // it with hardware...in this case, we pull a GPIO high/low depending on the configuration, connects 3.3V to + // BOOT0's RC charging circuit, lets it charge the capacitor, and issue a system reset. See the QMK discord + // #hardware channel pins for an example circuit. + palSetPadMode(PAL_PORT(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_PAD(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_MODE_OUTPUT_PUSHPULL); +# if STM32_BOOTLOADER_DUAL_BANK_POLARITY + palSetPad(PAL_PORT(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_PAD(STM32_BOOTLOADER_DUAL_BANK_GPIO)); +# else + palClearPad(PAL_PORT(STM32_BOOTLOADER_DUAL_BANK_GPIO), PAL_PAD(STM32_BOOTLOADER_DUAL_BANK_GPIO)); +# endif + + // Wait for a while for the capacitor to charge + wait_ms(100); + + // Issue a system reset to get the ROM bootloader to execute, with BOOT0 high + NVIC_SystemReset(); +} + +// not needed at all, but if anybody attempts to invoke it.... +void enter_bootloader_mode_if_requested(void) {} + +#else + +/* This code should be checked whether it runs correctly on platforms */ +# define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) +# define BOOTLOADER_MAGIC 0xDEADBEEF +# define MAGIC_ADDR (unsigned long *)(SYMVAL(__ram0_end__) - 4) + +__attribute__((weak)) void bootloader_jump(void) { + *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader + NVIC_SystemReset(); +} + +void enter_bootloader_mode_if_requested(void) { + unsigned long *check = MAGIC_ADDR; + if (*check == BOOTLOADER_MAGIC) { + *check = 0; + __set_CONTROL(0); + __set_MSP(*(__IO uint32_t *)STM32_BOOTLOADER_ADDRESS); + __enable_irq(); + + typedef void (*BootJump_t)(void); + BootJump_t boot_jump = *(BootJump_t *)(STM32_BOOTLOADER_ADDRESS + 4); + boot_jump(); + while (1) + ; + } +} +#endif diff --git a/platforms/chibios/bootloaders/stm32duino.c b/platforms/chibios/bootloaders/stm32duino.c new file mode 100644 index 000000000000..53d3ba0adb11 --- /dev/null +++ b/platforms/chibios/bootloaders/stm32duino.c @@ -0,0 +1,23 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include + +__attribute__((weak)) void bootloader_jump(void) { + NVIC_SystemReset(); +} diff --git a/platforms/chibios/bootloaders/tinyuf2.c b/platforms/chibios/bootloaders/tinyuf2.c new file mode 100644 index 000000000000..9ffca5dec821 --- /dev/null +++ b/platforms/chibios/bootloaders/tinyuf2.c @@ -0,0 +1,34 @@ +/* Copyright 2021 QMK + * + * 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 "bootloader.h" + +#include + +// From tinyuf2's board_api.h +#define DBL_TAP_MAGIC 0xF01669EF + +// defined by linker script +extern uint32_t _board_dfu_dbl_tap[]; +#define DBL_TAP_REG _board_dfu_dbl_tap[0] + +__attribute__((weak)) void bootloader_jump(void) { + DBL_TAP_REG = DBL_TAP_MAGIC; + NVIC_SystemReset(); +} + +/* not needed, no two-stage reset */ +void enter_bootloader_mode_if_requested(void) {} diff --git a/platforms/chibios/chibios_config.h b/platforms/chibios/chibios_config.h index 4e3573660676..67d7541ba2d3 100644 --- a/platforms/chibios/chibios_config.h +++ b/platforms/chibios/chibios_config.h @@ -16,7 +16,7 @@ #pragma once #ifndef USB_VBUS_PIN -# define SPLIT_USB_DETECT // Force this on when dedicated pin is not used +# define SPLIT_USB_DETECT // Force this on when dedicated pin is not used #endif // STM32 compatibility @@ -76,7 +76,7 @@ # if defined(K20x) || defined(KL2x) # define USE_I2CV1 -# define USE_I2CV1_CONTRIB // for some reason a bunch of ChibiOS-Contrib boards only have clock_speed +# define USE_I2CV1_CONTRIB // for some reason a bunch of ChibiOS-Contrib boards only have clock_speed # define USE_GPIOV1 # endif #endif diff --git a/platforms/chibios/drivers/analog.c b/platforms/chibios/drivers/analog.c index eb437665f1d4..48a59fd29087 100644 --- a/platforms/chibios/drivers/analog.c +++ b/platforms/chibios/drivers/analog.c @@ -101,9 +101,9 @@ // Options are 12, 10, 8, and 6 bit. #ifndef ADC_RESOLUTION -# ifdef ADC_CFGR_RES_10BITS // ADCv3, ADCv4 +# ifdef ADC_CFGR_RES_10BITS // ADCv3, ADCv4 # define ADC_RESOLUTION ADC_CFGR_RES_10BITS -# else // ADCv1, ADCv5, or the bodge for ADCv2 above +# else // ADCv1, ADCv5, or the bodge for ADCv2 above # define ADC_RESOLUTION ADC_CFGR1_RES_10BIT # endif #endif @@ -123,7 +123,7 @@ static ADCConversionGroup adcConversionGroup = { .smpr = ADC_SAMPLING_RATE, #elif defined(USE_ADCV2) # if !defined(STM32F1XX) && !defined(GD32VF103) - .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without... + .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without... # endif .smpr2 = ADC_SMPR2_SMP_AN0(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN1(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN2(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN3(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN4(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN5(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN6(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN7(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN8(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN9(ADC_SAMPLING_RATE), .smpr1 = ADC_SMPR1_SMP_AN10(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN11(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN12(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN13(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN14(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN15(ADC_SAMPLING_RATE), diff --git a/platforms/chibios/drivers/analog.h b/platforms/chibios/drivers/analog.h index e61c394265bf..8a821719e327 100644 --- a/platforms/chibios/drivers/analog.h +++ b/platforms/chibios/drivers/analog.h @@ -28,7 +28,9 @@ typedef struct { uint8_t adc; } adc_mux; #define TO_MUX(i, a) \ - (adc_mux) { i, a } + (adc_mux) { \ + i, a \ + } int16_t analogReadPin(pin_t pin); int16_t analogReadPinAdc(pin_t pin, uint8_t adc); diff --git a/platforms/chibios/drivers/audio_dac_additive.c b/platforms/chibios/drivers/audio_dac_additive.c index db304adb8774..db07c4b39349 100644 --- a/platforms/chibios/drivers/audio_dac_additive.c +++ b/platforms/chibios/drivers/audio_dac_additive.c @@ -52,19 +52,19 @@ static const dacsample_t dac_buffer_sine[AUDIO_DAC_BUFFER_SIZE] = { // 256 values, max 4095 0x0, 0x1, 0x2, 0x6, 0xa, 0xf, 0x16, 0x1e, 0x27, 0x32, 0x3d, 0x4a, 0x58, 0x67, 0x78, 0x89, 0x9c, 0xb0, 0xc5, 0xdb, 0xf2, 0x10a, 0x123, 0x13e, 0x159, 0x175, 0x193, 0x1b1, 0x1d1, 0x1f1, 0x212, 0x235, 0x258, 0x27c, 0x2a0, 0x2c6, 0x2ed, 0x314, 0x33c, 0x365, 0x38e, 0x3b8, 0x3e3, 0x40e, 0x43a, 0x467, 0x494, 0x4c2, 0x4f0, 0x51f, 0x54e, 0x57d, 0x5ad, 0x5dd, 0x60e, 0x63f, 0x670, 0x6a1, 0x6d3, 0x705, 0x737, 0x769, 0x79b, 0x7cd, 0x800, 0x832, 0x864, 0x896, 0x8c8, 0x8fa, 0x92c, 0x95e, 0x98f, 0x9c0, 0x9f1, 0xa22, 0xa52, 0xa82, 0xab1, 0xae0, 0xb0f, 0xb3d, 0xb6b, 0xb98, 0xbc5, 0xbf1, 0xc1c, 0xc47, 0xc71, 0xc9a, 0xcc3, 0xceb, 0xd12, 0xd39, 0xd5f, 0xd83, 0xda7, 0xdca, 0xded, 0xe0e, 0xe2e, 0xe4e, 0xe6c, 0xe8a, 0xea6, 0xec1, 0xedc, 0xef5, 0xf0d, 0xf24, 0xf3a, 0xf4f, 0xf63, 0xf76, 0xf87, 0xf98, 0xfa7, 0xfb5, 0xfc2, 0xfcd, 0xfd8, 0xfe1, 0xfe9, 0xff0, 0xff5, 0xff9, 0xffd, 0xffe, 0xfff, 0xffe, 0xffd, 0xff9, 0xff5, 0xff0, 0xfe9, 0xfe1, 0xfd8, 0xfcd, 0xfc2, 0xfb5, 0xfa7, 0xf98, 0xf87, 0xf76, 0xf63, 0xf4f, 0xf3a, 0xf24, 0xf0d, 0xef5, 0xedc, 0xec1, 0xea6, 0xe8a, 0xe6c, 0xe4e, 0xe2e, 0xe0e, 0xded, 0xdca, 0xda7, 0xd83, 0xd5f, 0xd39, 0xd12, 0xceb, 0xcc3, 0xc9a, 0xc71, 0xc47, 0xc1c, 0xbf1, 0xbc5, 0xb98, 0xb6b, 0xb3d, 0xb0f, 0xae0, 0xab1, 0xa82, 0xa52, 0xa22, 0x9f1, 0x9c0, 0x98f, 0x95e, 0x92c, 0x8fa, 0x8c8, 0x896, 0x864, 0x832, 0x800, 0x7cd, 0x79b, 0x769, 0x737, 0x705, 0x6d3, 0x6a1, 0x670, 0x63f, 0x60e, 0x5dd, 0x5ad, 0x57d, 0x54e, 0x51f, 0x4f0, 0x4c2, 0x494, 0x467, 0x43a, 0x40e, 0x3e3, 0x3b8, 0x38e, 0x365, 0x33c, 0x314, 0x2ed, 0x2c6, 0x2a0, 0x27c, 0x258, 0x235, 0x212, 0x1f1, 0x1d1, 0x1b1, 0x193, 0x175, 0x159, 0x13e, 0x123, 0x10a, 0xf2, 0xdb, 0xc5, 0xb0, 0x9c, 0x89, 0x78, 0x67, 0x58, 0x4a, 0x3d, 0x32, 0x27, 0x1e, 0x16, 0xf, 0xa, 0x6, 0x2, 0x1}; -#endif // AUDIO_DAC_SAMPLE_WAVEFORM_SINE +#endif // AUDIO_DAC_SAMPLE_WAVEFORM_SINE #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE static const dacsample_t dac_buffer_triangle[AUDIO_DAC_BUFFER_SIZE] = { // 256 values, max 4095 0x0, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0, 0xe0, 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0x3c0, 0x3e0, 0x400, 0x420, 0x440, 0x460, 0x480, 0x4a0, 0x4c0, 0x4e0, 0x500, 0x520, 0x540, 0x560, 0x580, 0x5a0, 0x5c0, 0x5e0, 0x600, 0x620, 0x640, 0x660, 0x680, 0x6a0, 0x6c0, 0x6e0, 0x700, 0x720, 0x740, 0x760, 0x780, 0x7a0, 0x7c0, 0x7e0, 0x800, 0x81f, 0x83f, 0x85f, 0x87f, 0x89f, 0x8bf, 0x8df, 0x8ff, 0x91f, 0x93f, 0x95f, 0x97f, 0x99f, 0x9bf, 0x9df, 0x9ff, 0xa1f, 0xa3f, 0xa5f, 0xa7f, 0xa9f, 0xabf, 0xadf, 0xaff, 0xb1f, 0xb3f, 0xb5f, 0xb7f, 0xb9f, 0xbbf, 0xbdf, 0xbff, 0xc1f, 0xc3f, 0xc5f, 0xc7f, 0xc9f, 0xcbf, 0xcdf, 0xcff, 0xd1f, 0xd3f, 0xd5f, 0xd7f, 0xd9f, 0xdbf, 0xddf, 0xdff, 0xe1f, 0xe3f, 0xe5f, 0xe7f, 0xe9f, 0xebf, 0xedf, 0xeff, 0xf1f, 0xf3f, 0xf5f, 0xf7f, 0xf9f, 0xfbf, 0xfdf, 0xfff, 0xfdf, 0xfbf, 0xf9f, 0xf7f, 0xf5f, 0xf3f, 0xf1f, 0xeff, 0xedf, 0xebf, 0xe9f, 0xe7f, 0xe5f, 0xe3f, 0xe1f, 0xdff, 0xddf, 0xdbf, 0xd9f, 0xd7f, 0xd5f, 0xd3f, 0xd1f, 0xcff, 0xcdf, 0xcbf, 0xc9f, 0xc7f, 0xc5f, 0xc3f, 0xc1f, 0xbff, 0xbdf, 0xbbf, 0xb9f, 0xb7f, 0xb5f, 0xb3f, 0xb1f, 0xaff, 0xadf, 0xabf, 0xa9f, 0xa7f, 0xa5f, 0xa3f, 0xa1f, 0x9ff, 0x9df, 0x9bf, 0x99f, 0x97f, 0x95f, 0x93f, 0x91f, 0x8ff, 0x8df, 0x8bf, 0x89f, 0x87f, 0x85f, 0x83f, 0x81f, 0x800, 0x7e0, 0x7c0, 0x7a0, 0x780, 0x760, 0x740, 0x720, 0x700, 0x6e0, 0x6c0, 0x6a0, 0x680, 0x660, 0x640, 0x620, 0x600, 0x5e0, 0x5c0, 0x5a0, 0x580, 0x560, 0x540, 0x520, 0x500, 0x4e0, 0x4c0, 0x4a0, 0x480, 0x460, 0x440, 0x420, 0x400, 0x3e0, 0x3c0, 0x3a0, 0x380, 0x360, 0x340, 0x320, 0x300, 0x2e0, 0x2c0, 0x2a0, 0x280, 0x260, 0x240, 0x220, 0x200, 0x1e0, 0x1c0, 0x1a0, 0x180, 0x160, 0x140, 0x120, 0x100, 0xe0, 0xc0, 0xa0, 0x80, 0x60, 0x40, 0x20}; -#endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE +#endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE static const dacsample_t dac_buffer_square[AUDIO_DAC_BUFFER_SIZE] = { - [0 ... AUDIO_DAC_BUFFER_SIZE / 2 - 1] = 0, // first and - [AUDIO_DAC_BUFFER_SIZE / 2 ... AUDIO_DAC_BUFFER_SIZE - 1] = AUDIO_DAC_SAMPLE_MAX, // second half + [0 ... AUDIO_DAC_BUFFER_SIZE / 2 - 1] = 0, // first and + [AUDIO_DAC_BUFFER_SIZE / 2 ... AUDIO_DAC_BUFFER_SIZE - 1] = AUDIO_DAC_SAMPLE_MAX, // second half }; -#endif // AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE +#endif // AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE /* // four steps: 0, 1/3, 2/3 and 1 static const dacsample_t dac_buffer_staircase[AUDIO_DAC_BUFFER_SIZE] = { @@ -77,7 +77,7 @@ static const dacsample_t dac_buffer_staircase[AUDIO_DAC_BUFFER_SIZE] = { #ifdef AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID static const dacsample_t dac_buffer_trapezoid[AUDIO_DAC_BUFFER_SIZE] = {0x0, 0x1f, 0x7f, 0xdf, 0x13f, 0x19f, 0x1ff, 0x25f, 0x2bf, 0x31f, 0x37f, 0x3df, 0x43f, 0x49f, 0x4ff, 0x55f, 0x5bf, 0x61f, 0x67f, 0x6df, 0x73f, 0x79f, 0x7ff, 0x85f, 0x8bf, 0x91f, 0x97f, 0x9df, 0xa3f, 0xa9f, 0xaff, 0xb5f, 0xbbf, 0xc1f, 0xc7f, 0xcdf, 0xd3f, 0xd9f, 0xdff, 0xe5f, 0xebf, 0xf1f, 0xf7f, 0xfdf, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfdf, 0xf7f, 0xf1f, 0xebf, 0xe5f, 0xdff, 0xd9f, 0xd3f, 0xcdf, 0xc7f, 0xc1f, 0xbbf, 0xb5f, 0xaff, 0xa9f, 0xa3f, 0x9df, 0x97f, 0x91f, 0x8bf, 0x85f, 0x7ff, 0x79f, 0x73f, 0x6df, 0x67f, 0x61f, 0x5bf, 0x55f, 0x4ff, 0x49f, 0x43f, 0x3df, 0x37f, 0x31f, 0x2bf, 0x25f, 0x1ff, 0x19f, 0x13f, 0xdf, 0x7f, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID +#endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID static dacsample_t dac_buffer_empty[AUDIO_DAC_BUFFER_SIZE] = {AUDIO_DAC_OFF_VALUE}; @@ -98,7 +98,7 @@ typedef enum { OUTPUT_REACHED_ZERO_BEFORE_OFF, OUTPUT_OFF, OUTPUT_OFF_1, - OUTPUT_OFF_2, // trailing off: giving the DAC two more conversion cycles until the AUDIO_DAC_OFF_VALUE reaches the output, then turn the timer off, which leaves the output at that level + OUTPUT_OFF_2, // trailing off: giving the DAC two more conversion cycles until the AUDIO_DAC_OFF_VALUE reaches the output, then turn the timer off, which leaves the output at that level number_of_output_states } output_states_t; output_states_t state = OUTPUT_OFF_2; @@ -171,7 +171,7 @@ static void dac_end(DACDriver *dacp) { // work on the other half of the buffer if (dacIsBufferComplete(dacp)) { - sample_p += AUDIO_DAC_BUFFER_SIZE / 2; // 'half_index' + sample_p += AUDIO_DAC_BUFFER_SIZE / 2; // 'half_index' } for (uint8_t s = 0; s < AUDIO_DAC_BUFFER_SIZE / 2; s++) { @@ -196,8 +196,8 @@ static void dac_end(DACDriver *dacp) { * * * * =====*=*================================================= 0x0 */ - if (((sample_p[s] + (AUDIO_DAC_SAMPLE_MAX / 100)) > AUDIO_DAC_OFF_VALUE) && // value approaches from below - (sample_p[s] < (AUDIO_DAC_OFF_VALUE + (AUDIO_DAC_SAMPLE_MAX / 100))) // or above + if (((sample_p[s] + (AUDIO_DAC_SAMPLE_MAX / 100)) > AUDIO_DAC_OFF_VALUE) && // value approaches from below + (sample_p[s] < (AUDIO_DAC_OFF_VALUE + (AUDIO_DAC_SAMPLE_MAX / 100))) // or above ) { if ((OUTPUT_SHOULD_START == state) && (active_tones_snapshot_length > 0)) { state = OUTPUT_RUN_NORMALLY; @@ -220,7 +220,7 @@ static void dac_end(DACDriver *dacp) { // -> saves cpu cycles (?) for (uint8_t i = 0; i < active_tones; i++) { float freq = audio_get_processed_frequency(i); - if (freq > 0) { // disregard 'rest' notes, with valid frequency 0.0f; which would only lower the resulting waveform volume during the additive synthesis step + if (freq > 0) { // disregard 'rest' notes, with valid frequency 0.0f; which would only lower the resulting waveform volume during the additive synthesis step active_tones_snapshot[active_tones_snapshot_length++] = freq; } } @@ -321,7 +321,9 @@ void audio_driver_initialize() { gptStart(&GPTD6, &gpt6cfg1); } -void audio_driver_stop(void) { state = OUTPUT_SHOULD_STOP; } +void audio_driver_stop(void) { + state = OUTPUT_SHOULD_STOP; +} void audio_driver_start(void) { gptStartContinuous(&GPTD6, 2U); diff --git a/platforms/chibios/drivers/audio_dac_basic.c b/platforms/chibios/drivers/audio_dac_basic.c index fac65135066a..64439a1e3cee 100644 --- a/platforms/chibios/drivers/audio_dac_basic.c +++ b/platforms/chibios/drivers/audio_dac_basic.c @@ -115,13 +115,15 @@ void channel_1_set_frequency(float freq) { channel_1_frequency = freq; channel_1_stop(); - if (freq <= 0.0) // a pause/rest has freq=0 + if (freq <= 0.0) // a pause/rest has freq=0 return; gpt6cfg1.frequency = 2 * freq * AUDIO_DAC_BUFFER_SIZE; channel_1_start(); } -float channel_1_get_frequency(void) { return channel_1_frequency; } +float channel_1_get_frequency(void) { + return channel_1_frequency; +} void channel_2_start(void) { gptStart(&GPTD7, &gpt7cfg1); @@ -140,13 +142,15 @@ void channel_2_set_frequency(float freq) { channel_2_frequency = freq; channel_2_stop(); - if (freq <= 0.0) // a pause/rest has freq=0 + if (freq <= 0.0) // a pause/rest has freq=0 return; gpt7cfg1.frequency = 2 * freq * AUDIO_DAC_BUFFER_SIZE; channel_2_start(); } -float channel_2_get_frequency(void) { return channel_2_frequency; } +float channel_2_get_frequency(void) { + return channel_2_frequency; +} static void gpt_audio_state_cb(GPTDriver *gptp) { if (audio_update_state()) { @@ -155,8 +159,8 @@ static void gpt_audio_state_cb(GPTDriver *gptp) { channel_1_set_frequency(audio_get_processed_frequency(0)); channel_2_set_frequency(audio_get_processed_frequency(0)); -#else // two separate audio outputs/speakers - // primary speaker on A4, optional secondary on A5 +#else // two separate audio outputs/speakers + // primary speaker on A4, optional secondary on A5 if (AUDIO_PIN == A4) { channel_1_set_frequency(audio_get_processed_frequency(0)); if (AUDIO_PIN_ALT == A5) { diff --git a/platforms/chibios/drivers/audio_pwm_hardware.c b/platforms/chibios/drivers/audio_pwm_hardware.c index cd40019ee7c3..710f3976090c 100644 --- a/platforms/chibios/drivers/audio_pwm_hardware.c +++ b/platforms/chibios/drivers/audio_pwm_hardware.c @@ -72,7 +72,7 @@ static float channel_1_frequency = 0.0f; void channel_1_set_frequency(float freq) { channel_1_frequency = freq; - if (freq <= 0.0) // a pause/rest has freq=0 + if (freq <= 0.0) // a pause/rest has freq=0 return; pwmcnt_t period = (pwmCFG.frequency / freq); @@ -82,14 +82,18 @@ void channel_1_set_frequency(float freq) { PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); } -float channel_1_get_frequency(void) { return channel_1_frequency; } +float channel_1_get_frequency(void) { + return channel_1_frequency; +} void channel_1_start(void) { pwmStop(&AUDIO_PWM_DRIVER); pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG); } -void channel_1_stop(void) { pwmStop(&AUDIO_PWM_DRIVER); } +void channel_1_stop(void) { + pwmStop(&AUDIO_PWM_DRIVER); +} static void gpt_callback(GPTDriver *gptp); GPTConfig gptCFG = { @@ -108,9 +112,9 @@ void audio_driver_initialize(void) { pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG); // connect the AUDIO_PIN to the PWM hardware -#if defined(USE_GPIOV1) // STM32F103C8 +#if defined(USE_GPIOV1) // STM32F103C8 palSetLineMode(AUDIO_PIN, PAL_MODE_ALTERNATE_PUSHPULL); -#else // GPIOv2 (or GPIOv3 for f4xx, which is the same/compatible at this command) +#else // GPIOv2 (or GPIOv3 for f4xx, which is the same/compatible at this command) palSetLineMode(AUDIO_PIN, PAL_MODE_ALTERNATE(AUDIO_PWM_PAL_MODE)); #endif @@ -135,10 +139,10 @@ void audio_driver_stop(void) { * and updates the pwm to output that frequency */ static void gpt_callback(GPTDriver *gptp) { - float freq; // TODO: freq_alt + float freq; // TODO: freq_alt if (audio_update_state()) { - freq = audio_get_processed_frequency(0); // freq_alt would be index=1 + freq = audio_get_processed_frequency(0); // freq_alt would be index=1 channel_1_set_frequency(freq); } } diff --git a/platforms/chibios/drivers/audio_pwm_software.c b/platforms/chibios/drivers/audio_pwm_software.c index 15c3e98b6a96..e01f86ea5265 100644 --- a/platforms/chibios/drivers/audio_pwm_software.c +++ b/platforms/chibios/drivers/audio_pwm_software.c @@ -57,7 +57,7 @@ static float channel_1_frequency = 0.0f; void channel_1_set_frequency(float freq) { channel_1_frequency = freq; - if (freq <= 0.0) // a pause/rest has freq=0 + if (freq <= 0.0) // a pause/rest has freq=0 return; pwmcnt_t period = (pwmCFG.frequency / freq); @@ -68,7 +68,9 @@ void channel_1_set_frequency(float freq) { PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); } -float channel_1_get_frequency(void) { return channel_1_frequency; } +float channel_1_get_frequency(void) { + return channel_1_frequency; +} void channel_1_start(void) { pwmStop(&AUDIO_PWM_DRIVER); @@ -81,10 +83,10 @@ void channel_1_start(void) { void channel_1_stop(void) { pwmStop(&AUDIO_PWM_DRIVER); - palClearLine(AUDIO_PIN); // leave the line low, after last note was played + palClearLine(AUDIO_PIN); // leave the line low, after last note was played #if defined(AUDIO_PIN_ALT) && defined(AUDIO_PIN_ALT_AS_NEGATIVE) - palClearLine(AUDIO_PIN_ALT); // leave the line low, after last note was played + palClearLine(AUDIO_PIN_ALT); // leave the line low, after last note was played #endif } @@ -100,7 +102,7 @@ static void pwm_audio_period_callback(PWMDriver *pwmp) { static void pwm_audio_channel_interrupt_callback(PWMDriver *pwmp) { (void)pwmp; if (channel_1_frequency > 0) { - palSetLine(AUDIO_PIN); // generate a PWM signal on any pin, not necessarily the one connected to the timer + palSetLine(AUDIO_PIN); // generate a PWM signal on any pin, not necessarily the one connected to the timer #if defined(AUDIO_PIN_ALT) && defined(AUDIO_PIN_ALT_AS_NEGATIVE) palClearLine(AUDIO_PIN_ALT); #endif @@ -131,7 +133,7 @@ void audio_driver_initialize(void) { palClearLine(AUDIO_PIN_ALT); #endif - pwmEnablePeriodicNotification(&AUDIO_PWM_DRIVER); // enable pwm callbacks + pwmEnablePeriodicNotification(&AUDIO_PWM_DRIVER); // enable pwm callbacks pwmEnableChannelNotification(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1); gptStart(&AUDIO_STATE_TIMER, &gptCFG); @@ -155,10 +157,10 @@ void audio_driver_stop(void) { * and updates the pwm to output that frequency */ static void gpt_callback(GPTDriver *gptp) { - float freq; // TODO: freq_alt + float freq; // TODO: freq_alt if (audio_update_state()) { - freq = audio_get_processed_frequency(0); // freq_alt would be index=1 + freq = audio_get_processed_frequency(0); // freq_alt would be index=1 channel_1_set_frequency(freq); } } diff --git a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h index a35defca8bfa..616d7ccbeeec 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h +++ b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h @@ -24,7 +24,7 @@ # define STM32_ONBOARD_EEPROM_SIZE 1024 # else # include "eeconfig.h" -# define STM32_ONBOARD_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO and EEPROM page sizing +# define STM32_ONBOARD_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO and EEPROM page sizing # endif #endif diff --git a/platforms/chibios/drivers/i2c_master.c b/platforms/chibios/drivers/i2c_master.c index 43591d56f80c..d10bdbabc100 100644 --- a/platforms/chibios/drivers/i2c_master.c +++ b/platforms/chibios/drivers/i2c_master.c @@ -27,8 +27,67 @@ #include "quantum.h" #include "i2c_master.h" #include +#include #include +#ifndef I2C1_SCL_PIN +# define I2C1_SCL_PIN B6 +#endif +#ifndef I2C1_SDA_PIN +# define I2C1_SDA_PIN B7 +#endif + +#ifdef USE_I2CV1 +# ifndef I2C1_OPMODE +# define I2C1_OPMODE OPMODE_I2C +# endif +# ifndef I2C1_CLOCK_SPEED +# define I2C1_CLOCK_SPEED 100000 /* 400000 */ +# endif +# ifndef I2C1_DUTY_CYCLE +# define I2C1_DUTY_CYCLE STD_DUTY_CYCLE /* FAST_DUTY_CYCLE_2 */ +# endif +#else +// The default timing values below configures the I2C clock to 400khz assuming a 72Mhz clock +// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html +# ifndef I2C1_TIMINGR_PRESC +# define I2C1_TIMINGR_PRESC 0U +# endif +# ifndef I2C1_TIMINGR_SCLDEL +# define I2C1_TIMINGR_SCLDEL 7U +# endif +# ifndef I2C1_TIMINGR_SDADEL +# define I2C1_TIMINGR_SDADEL 0U +# endif +# ifndef I2C1_TIMINGR_SCLH +# define I2C1_TIMINGR_SCLH 38U +# endif +# ifndef I2C1_TIMINGR_SCLL +# define I2C1_TIMINGR_SCLL 129U +# 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 uint8_t i2c_address; static const I2CConfig i2cconfig = { @@ -144,4 +203,6 @@ i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uin return chibios_to_qmk(&status); } -void i2c_stop(void) { i2cStop(&I2C_DRIVER); } +void i2c_stop(void) { + i2cStop(&I2C_DRIVER); +} diff --git a/platforms/chibios/drivers/i2c_master.h b/platforms/chibios/drivers/i2c_master.h index 5f082e9d1e25..deee7ecc084e 100644 --- a/platforms/chibios/drivers/i2c_master.h +++ b/platforms/chibios/drivers/i2c_master.h @@ -24,66 +24,7 @@ */ #pragma once -#include -#include - -#ifndef I2C1_SCL_PIN -# define I2C1_SCL_PIN B6 -#endif -#ifndef I2C1_SDA_PIN -# define I2C1_SDA_PIN B7 -#endif - -#ifdef USE_I2CV1 -# ifndef I2C1_OPMODE -# define I2C1_OPMODE OPMODE_I2C -# endif -# ifndef I2C1_CLOCK_SPEED -# define I2C1_CLOCK_SPEED 100000 /* 400000 */ -# endif -# ifndef I2C1_DUTY_CYCLE -# define I2C1_DUTY_CYCLE STD_DUTY_CYCLE /* FAST_DUTY_CYCLE_2 */ -# endif -#else -// The default timing values below configures the I2C clock to 400khz assuming a 72Mhz clock -// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html -# ifndef I2C1_TIMINGR_PRESC -# define I2C1_TIMINGR_PRESC 0U -# endif -# ifndef I2C1_TIMINGR_SCLDEL -# define I2C1_TIMINGR_SCLDEL 7U -# endif -# ifndef I2C1_TIMINGR_SDADEL -# define I2C1_TIMINGR_SDADEL 0U -# endif -# ifndef I2C1_TIMINGR_SCLH -# define I2C1_TIMINGR_SCLH 38U -# endif -# ifndef I2C1_TIMINGR_SCLL -# define I2C1_TIMINGR_SCLL 129U -# 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 +#include typedef int16_t i2c_status_t; diff --git a/platforms/chibios/drivers/serial.c b/platforms/chibios/drivers/serial.c index ef6f0aa8d5f3..6db5d8525067 100644 --- a/platforms/chibios/drivers/serial.c +++ b/platforms/chibios/drivers/serial.c @@ -50,14 +50,30 @@ # error invalid SELECT_SOFT_SERIAL_SPEED value #endif -inline static void serial_delay(void) { wait_us(SERIAL_DELAY); } -inline static void serial_delay_half(void) { wait_us(SERIAL_DELAY / 2); } -inline static void serial_delay_blip(void) { wait_us(1); } -inline static void serial_output(void) { setPinOutput(SOFT_SERIAL_PIN); } -inline static void serial_input(void) { setPinInputHigh(SOFT_SERIAL_PIN); } -inline static bool serial_read_pin(void) { return !!readPin(SOFT_SERIAL_PIN); } -inline static void serial_low(void) { writePinLow(SOFT_SERIAL_PIN); } -inline static void serial_high(void) { writePinHigh(SOFT_SERIAL_PIN); } +inline static void serial_delay(void) { + wait_us(SERIAL_DELAY); +} +inline static void serial_delay_half(void) { + wait_us(SERIAL_DELAY / 2); +} +inline static void serial_delay_blip(void) { + wait_us(1); +} +inline static void serial_output(void) { + setPinOutput(SOFT_SERIAL_PIN); +} +inline static void serial_input(void) { + setPinInputHigh(SOFT_SERIAL_PIN); +} +inline static bool serial_read_pin(void) { + return !!readPin(SOFT_SERIAL_PIN); +} +inline static void serial_low(void) { + writePinLow(SOFT_SERIAL_PIN); +} +inline static void serial_high(void) { + writePinHigh(SOFT_SERIAL_PIN); +} void interrupt_handler(void *arg); @@ -179,8 +195,6 @@ void interrupt_handler(void *arg) { // wait for the sync to finish sending serial_delay(); - *trans->status = (checksum_computed == checksum_received) ? TRANSACTION_ACCEPTED : TRANSACTION_DATA_ERROR; - // end transaction serial_input(); @@ -193,17 +207,12 @@ void interrupt_handler(void *arg) { ///////// // start transaction by initiator // -// int soft_serial_transaction(int sstd_index) +// bool soft_serial_transaction(int sstd_index) // -// Returns: -// TRANSACTION_END -// TRANSACTION_NO_RESPONSE -// TRANSACTION_DATA_ERROR // this code is very time dependent, so we need to disable interrupts -int soft_serial_transaction(int sstd_index) { - if (sstd_index > NUM_TOTAL_TRANSACTIONS) return TRANSACTION_TYPE_ERROR; +bool soft_serial_transaction(int sstd_index) { + if (sstd_index > NUM_TOTAL_TRANSACTIONS) return false; split_transaction_desc_t *trans = &split_transaction_table[sstd_index]; - if (!trans->status) return TRANSACTION_TYPE_ERROR; // not registered // TODO: remove extra delay between transactions serial_delay(); @@ -226,14 +235,14 @@ int soft_serial_transaction(int sstd_index) { // slave failed to pull the line low, assume not present dprintf("serial::NO_RESPONSE\n"); chSysUnlock(); - return TRANSACTION_NO_RESPONSE; + return false; } // if the slave is present syncronize with it uint8_t checksum = 0; // send data to the slave - serial_write_byte(sstd_index); // first chunk is transaction id + serial_write_byte(sstd_index); // first chunk is transaction id sync_recv(); for (int i = 0; i < trans->initiator2target_buffer_size; ++i) { @@ -245,7 +254,7 @@ int soft_serial_transaction(int sstd_index) { sync_recv(); serial_delay(); - serial_delay(); // read mid pulses + serial_delay(); // read mid pulses // receive data from the slave uint8_t checksum_computed = 0; @@ -266,7 +275,7 @@ int soft_serial_transaction(int sstd_index) { serial_high(); chSysUnlock(); - return TRANSACTION_DATA_ERROR; + return false; } // always, release the line when not in use @@ -274,5 +283,5 @@ int soft_serial_transaction(int sstd_index) { serial_output(); chSysUnlock(); - return TRANSACTION_END; + return true; } diff --git a/platforms/chibios/drivers/serial_usart.c b/platforms/chibios/drivers/serial_usart.c index 124e4be685ed..85c64214d161 100644 --- a/platforms/chibios/drivers/serial_usart.c +++ b/platforms/chibios/drivers/serial_usart.c @@ -36,7 +36,7 @@ static SerialDriver* serial_driver = &SERIAL_USART_DRIVER; static inline bool react_to_transactions(void); static inline bool __attribute__((nonnull)) receive(uint8_t* destination, const size_t size); static inline bool __attribute__((nonnull)) send(const uint8_t* source, const size_t size); -static inline int initiate_transaction(uint8_t sstd_index); +static inline bool initiate_transaction(uint8_t sstd_index); static inline void usart_clear(void); /** @@ -206,14 +206,12 @@ static inline bool react_to_transactions(void) { to signal that the slave is ready to receive possible transaction buffers */ sstd_index ^= HANDSHAKE_MAGIC; if (!send(&sstd_index, sizeof(sstd_index))) { - *trans->status = TRANSACTION_DATA_ERROR; return false; } /* Receive transaction buffer from the master. If this transaction requires it.*/ if (trans->initiator2target_buffer_size) { if (!receive(split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size)) { - *trans->status = TRANSACTION_DATA_ERROR; return false; } } @@ -226,12 +224,10 @@ static inline bool react_to_transactions(void) { /* Send transaction buffer to the master. If this transaction requires it. */ if (trans->target2initiator_buffer_size) { if (!send(split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size)) { - *trans->status = TRANSACTION_DATA_ERROR; return false; } } - *trans->status = TRANSACTION_ACCEPTED; return true; } @@ -242,7 +238,7 @@ void soft_serial_initiator_init(void) { usart_master_init(&serial_driver); #if defined(MCU_STM32) && defined(SERIAL_USART_PIN_SWAP) - serial_config.cr2 |= USART_CR2_SWAP; // master has swapped TX/RX pins + serial_config.cr2 |= USART_CR2_SWAP; // master has swapped TX/RX pins #endif sdStart(serial_driver, &serial_config); @@ -252,11 +248,9 @@ void soft_serial_initiator_init(void) { * @brief Start transaction from the master half to the slave half. * * @param index Transaction Table index of the transaction to start. - * @return int TRANSACTION_NO_RESPONSE in case of Timeout. - * TRANSACTION_TYPE_ERROR in case of invalid transaction index. - * TRANSACTION_END in case of success. + * @return bool Indicates success of transaction. */ -int soft_serial_transaction(int index) { +bool soft_serial_transaction(int index) { /* Clear the receive queue, to start with a clean slate. * Parts of failed transactions or spurious bytes could still be in it. */ usart_clear(); @@ -266,25 +260,19 @@ int soft_serial_transaction(int index) { /** * @brief Initiate transaction to slave half. */ -static inline int initiate_transaction(uint8_t sstd_index) { +static inline bool initiate_transaction(uint8_t sstd_index) { /* Sanity check that we are actually starting a valid transaction. */ if (sstd_index >= NUM_TOTAL_TRANSACTIONS) { dprintln("USART: Illegal transaction Id."); - return TRANSACTION_TYPE_ERROR; + return false; } split_transaction_desc_t* trans = &split_transaction_table[sstd_index]; - /* Transaction is not registered. Abort. */ - if (!trans->status) { - dprintln("USART: Transaction not registered."); - return TRANSACTION_TYPE_ERROR; - } - /* Send transaction table index to the slave, which doubles as basic handshake token. */ if (!send(&sstd_index, sizeof(sstd_index))) { dprintln("USART: Send Handshake failed."); - return TRANSACTION_TYPE_ERROR; + return false; } uint8_t sstd_index_shake = 0xFF; @@ -295,14 +283,14 @@ static inline int initiate_transaction(uint8_t sstd_index) { */ if (!receive(&sstd_index_shake, sizeof(sstd_index_shake)) || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) { dprintln("USART: Handshake failed."); - return TRANSACTION_NO_RESPONSE; + return false; } /* Send transaction buffer to the slave. If this transaction requires it. */ if (trans->initiator2target_buffer_size) { if (!send(split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size)) { dprintln("USART: Send failed."); - return TRANSACTION_NO_RESPONSE; + return false; } } @@ -310,9 +298,9 @@ static inline int initiate_transaction(uint8_t sstd_index) { if (trans->target2initiator_buffer_size) { if (!receive(split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size)) { dprintln("USART: Receive failed."); - return TRANSACTION_NO_RESPONSE; + return false; } } - return TRANSACTION_END; + return true; } diff --git a/platforms/chibios/drivers/serial_usart.h b/platforms/chibios/drivers/serial_usart.h index 7b135b31e055..81fe9e0113b4 100644 --- a/platforms/chibios/drivers/serial_usart.h +++ b/platforms/chibios/drivers/serial_usart.h @@ -50,15 +50,15 @@ #endif #if !defined(USART_CR1_M0) -# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so +# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so #endif #if !defined(SERIAL_USART_CR1) -# define SERIAL_USART_CR1 (USART_CR1_PCE | USART_CR1_PS | USART_CR1_M0) // parity enable, odd parity, 9 bit length +# define SERIAL_USART_CR1 (USART_CR1_PCE | USART_CR1_PS | USART_CR1_M0) // parity enable, odd parity, 9 bit length #endif #if !defined(SERIAL_USART_CR2) -# define SERIAL_USART_CR2 (USART_CR2_STOP_1) // 2 stop bits +# define SERIAL_USART_CR2 (USART_CR2_STOP_1) // 2 stop bits #endif #if !defined(SERIAL_USART_CR3) diff --git a/platforms/chibios/drivers/spi_master.c b/platforms/chibios/drivers/spi_master.c index dde0bb059792..998bace5501c 100644 --- a/platforms/chibios/drivers/spi_master.c +++ b/platforms/chibios/drivers/spi_master.c @@ -115,7 +115,7 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { #elif defined(HT32) spiConfig.cr0 = SPI_CR0_SELOEN; - spiConfig.cr1 = SPI_CR1_MODE | 8; // 8 bits and in master mode + spiConfig.cr1 = SPI_CR1_MODE | 8; // 8 bits and in master mode if (lsbFirst) { spiConfig.cr1 |= SPI_CR1_FIRSTBIT; diff --git a/platforms/chibios/drivers/uart.c b/platforms/chibios/drivers/uart.c index d2ea5d6415c4..4884d7024f68 100644 --- a/platforms/chibios/drivers/uart.c +++ b/platforms/chibios/drivers/uart.c @@ -43,7 +43,9 @@ void uart_init(uint32_t baud) { } } -void uart_write(uint8_t data) { sdPut(&SERIAL_DRIVER, c); } +void uart_write(uint8_t data) { + sdPut(&SERIAL_DRIVER, data); +} uint8_t uart_read(void) { msg_t res = sdGet(&SERIAL_DRIVER); @@ -51,8 +53,14 @@ uint8_t uart_read(void) { return (uint8_t)res; } -void uart_transmit(const uint8_t *data, uint16_t length) { sdWrite(&SERIAL_DRIVER, data, length); } +void uart_transmit(const uint8_t *data, uint16_t length) { + sdWrite(&SERIAL_DRIVER, data, length); +} -void uart_receive(uint8_t *data, uint16_t length) { sdRead(&SERIAL_DRIVER, data, length); } +void uart_receive(uint8_t *data, uint16_t length) { + sdRead(&SERIAL_DRIVER, data, length); +} -bool uart_available(void) { return !sdGetWouldBlock(&SERIAL_DRIVER); } +bool uart_available(void) { + return !sdGetWouldBlock(&SERIAL_DRIVER); +} diff --git a/platforms/chibios/drivers/usbpd_stm32g4.c b/platforms/chibios/drivers/usbpd_stm32g4.c index f16ca8aeaeac..0096f22f077c 100644 --- a/platforms/chibios/drivers/usbpd_stm32g4.c +++ b/platforms/chibios/drivers/usbpd_stm32g4.c @@ -18,7 +18,7 @@ #ifndef USBPD_UCPD1_CFG1 # define USBPD_UCPD1_CFG1 (UCPD_CFG1_PSC_UCPDCLK_0 | UCPD_CFG1_TRANSWIN_3 | UCPD_CFG1_IFRGAP_4 | UCPD_CFG1_HBITCLKDIV_4) -#endif // USBPD_UCPD1_CFG1 +#endif // USBPD_UCPD1_CFG1 // Initialises the USBPD subsystem __attribute__((weak)) void usbpd_init(void) { @@ -64,7 +64,7 @@ __attribute__((weak)) usbpd_allowance_t usbpd_get_allowance(void) { switch (vstate_max) { case 0: case 1: - return USBPD_500MA; // Note that this is 500mA (i.e. max USB 2.0), not 900mA, as we're not using USB 3.1 as a sink device. + return USBPD_500MA; // Note that this is 500mA (i.e. max USB 2.0), not 900mA, as we're not using USB 3.1 as a sink device. case 2: return USBPD_1500MA; case 3: diff --git a/platforms/chibios/drivers/ws2812.c b/platforms/chibios/drivers/ws2812.c index 7e870661dec2..1b3bb5984261 100644 --- a/platforms/chibios/drivers/ws2812.c +++ b/platforms/chibios/drivers/ws2812.c @@ -10,7 +10,7 @@ # define NOP_FUDGE 0.4 # else # error("NOP_FUDGE configuration required") -# define NOP_FUDGE 1 // this just pleases the compile so the above error is easier to spot +# define NOP_FUDGE 1 // this just pleases the compile so the above error is easier to spot # endif #endif @@ -25,12 +25,12 @@ // The reset gap can be 6000 ns, but depending on the LED strip it may have to be increased // to values like 600000 ns. If it is too small, the pixels will show nothing most of the time. #ifndef WS2812_RES -# define WS2812_RES (1000 * WS2812_TRST_US) // Width of the low gap between bits to cause a frame to latch +# define WS2812_RES (1000 * WS2812_TRST_US) // Width of the low gap between bits to cause a frame to latch #endif #define NUMBER_NOPS 6 #define CYCLES_PER_SEC (CPU_CLOCK / NUMBER_NOPS * NOP_FUDGE) -#define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives +#define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives #define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) #define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) @@ -67,7 +67,9 @@ void sendByte(uint8_t byte) { } } -void ws2812_init(void) { palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); } +void ws2812_init(void) { + palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); +} // Setleds for standard RGB void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { diff --git a/platforms/chibios/drivers/ws2812_pwm.c b/platforms/chibios/drivers/ws2812_pwm.c index 19ea3cfe8ac6..57187676d77d 100644 --- a/platforms/chibios/drivers/ws2812_pwm.c +++ b/platforms/chibios/drivers/ws2812_pwm.c @@ -11,19 +11,19 @@ #endif #ifndef WS2812_PWM_DRIVER -# define WS2812_PWM_DRIVER PWMD2 // TIMx +# define WS2812_PWM_DRIVER PWMD2 // TIMx #endif #ifndef WS2812_PWM_CHANNEL -# define WS2812_PWM_CHANNEL 2 // Channel +# define WS2812_PWM_CHANNEL 2 // Channel #endif #ifndef WS2812_PWM_PAL_MODE -# define WS2812_PWM_PAL_MODE 2 // DI Pin's alternate function value +# define WS2812_PWM_PAL_MODE 2 // DI Pin's alternate function value #endif #ifndef WS2812_DMA_STREAM -# define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP +# define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP #endif #ifndef WS2812_DMA_CHANNEL -# define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP +# define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP #endif #if (STM32_DMA_SUPPORTS_DMAMUX == TRUE) && !defined(WS2812_DMAMUX_ID) # error "please consult your MCU's datasheet and specify in your config.h: #define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM?_UP" @@ -56,7 +56,7 @@ #ifndef WS2812_PWM_TARGET_PERIOD //# define WS2812_PWM_TARGET_PERIOD 800000 // Original code is 800k...? -# define WS2812_PWM_TARGET_PERIOD 80000 // TODO: work out why 10x less on f303/f4x1 +# define WS2812_PWM_TARGET_PERIOD 80000 // TODO: work out why 10x less on f303/f4x1 #endif /* --- PRIVATE CONSTANTS ---------------------------------------------------- */ @@ -259,8 +259,10 @@ write/read to/from the other buffer). void ws2812_init(void) { // Initialize led frame buffer uint32_t i; - for (i = 0; i < WS2812_COLOR_BIT_N; i++) ws2812_frame_buffer[i] = WS2812_DUTYCYCLE_0; // All color bits are zero duty cycle - for (i = 0; i < WS2812_RESET_BIT_N; i++) ws2812_frame_buffer[i + WS2812_COLOR_BIT_N] = 0; // All reset bits are zero + for (i = 0; i < WS2812_COLOR_BIT_N; i++) + ws2812_frame_buffer[i] = WS2812_DUTYCYCLE_0; // All color bits are zero duty cycle + for (i = 0; i < WS2812_RESET_BIT_N; i++) + ws2812_frame_buffer[i + WS2812_COLOR_BIT_N] = 0; // All reset bits are zero palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); @@ -268,22 +270,22 @@ void ws2812_init(void) { //#pragma GCC diagnostic ignored "-Woverride-init" // Turn off override-init warning for this struct. We use the overriding ability to set a "default" channel config static const PWMConfig ws2812_pwm_config = { .frequency = WS2812_PWM_FREQUENCY, - .period = WS2812_PWM_PERIOD, // Mit dieser Periode wird UDE-Event erzeugt und ein neuer Wert (Länge WS2812_BIT_N) vom DMA ins CCR geschrieben + .period = WS2812_PWM_PERIOD, // Mit dieser Periode wird UDE-Event erzeugt und ein neuer Wert (Länge WS2812_BIT_N) vom DMA ins CCR geschrieben .callback = NULL, .channels = { - [0 ... 3] = {.mode = PWM_OUTPUT_DISABLED, .callback = NULL}, // Channels default to disabled - [WS2812_PWM_CHANNEL - 1] = {.mode = WS2812_PWM_OUTPUT_MODE, .callback = NULL}, // Turn on the channel we care about + [0 ... 3] = {.mode = PWM_OUTPUT_DISABLED, .callback = NULL}, // Channels default to disabled + [WS2812_PWM_CHANNEL - 1] = {.mode = WS2812_PWM_OUTPUT_MODE, .callback = NULL}, // Turn on the channel we care about }, .cr2 = 0, - .dier = TIM_DIER_UDE, // DMA on update event for next period + .dier = TIM_DIER_UDE, // DMA on update event for next period }; //#pragma GCC diagnostic pop // Restore command-line warning options // Configure DMA // dmaInit(); // Joe added this dmaStreamAlloc(WS2812_DMA_STREAM - STM32_DMA_STREAM(0), 10, NULL, NULL); - dmaStreamSetPeripheral(WS2812_DMA_STREAM, &(WS2812_PWM_DRIVER.tim->CCR[WS2812_PWM_CHANNEL - 1])); // Ziel ist der An-Zeit im Cap-Comp-Register + dmaStreamSetPeripheral(WS2812_DMA_STREAM, &(WS2812_PWM_DRIVER.tim->CCR[WS2812_PWM_CHANNEL - 1])); // Ziel ist der An-Zeit im Cap-Comp-Register dmaStreamSetMemory0(WS2812_DMA_STREAM, ws2812_frame_buffer); dmaStreamSetTransactionSize(WS2812_DMA_STREAM, WS2812_BIT_N); dmaStreamSetMode(WS2812_DMA_STREAM, STM32_DMA_CR_CHSEL(WS2812_DMA_CHANNEL) | STM32_DMA_CR_DIR_M2P | STM32_DMA_CR_PSIZE_WORD | STM32_DMA_CR_MSIZE_WORD | STM32_DMA_CR_MINC | STM32_DMA_CR_CIRC | STM32_DMA_CR_PL(3)); @@ -302,7 +304,7 @@ void ws2812_init(void) { // ChibiOS driver code, so we don't have to do anything special to the timer. If we did, we'd have to start the timer, // disable counting, enable the channel, and then make whatever configuration changes we need. pwmStart(&WS2812_PWM_DRIVER, &ws2812_pwm_config); - pwmEnableChannel(&WS2812_PWM_DRIVER, WS2812_PWM_CHANNEL - 1, 0); // Initial period is 0; output will be low until first duty cycle is DMA'd in + pwmEnableChannel(&WS2812_PWM_DRIVER, WS2812_PWM_CHANNEL - 1, 0); // Initial period is 0; output will be low until first duty cycle is DMA'd in } void ws2812_write_led(uint16_t led_number, uint8_t r, uint8_t g, uint8_t b) { diff --git a/platforms/chibios/drivers/ws2812_spi.c b/platforms/chibios/drivers/ws2812_spi.c index ba471e0b8e5b..76191db1657a 100644 --- a/platforms/chibios/drivers/ws2812_spi.c +++ b/platforms/chibios/drivers/ws2812_spi.c @@ -42,7 +42,7 @@ # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 8 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1) -#elif WS2812_SPI_DIVISOR == 16 // same as default +#elif WS2812_SPI_DIVISOR == 16 // same as default # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 32 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2) @@ -53,14 +53,14 @@ #elif WS2812_SPI_DIVISOR == 256 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0) #else -# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) // default +# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) // default #endif // Use SPI circular buffer #ifdef WS2812_SPI_USE_CIRCULAR_BUFFER -# define WS2812_SPI_BUFFER_MODE 1 // circular buffer +# define WS2812_SPI_BUFFER_MODE 1 // circular buffer #else -# define WS2812_SPI_BUFFER_MODE 0 // normal buffer +# define WS2812_SPI_BUFFER_MODE 0 // normal buffer #endif #if defined(USE_GPIOV1) @@ -104,20 +104,30 @@ static void set_led_color_rgb(LED_TYPE color, int pos) { uint8_t* tx_start = &txbuf[PREAMBLE_SIZE]; #if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB) - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.g, j); - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.r, j); - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.g, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.r, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j); #elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB) - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.r, j); - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.g, j); - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.r, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.g, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j); #elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_BGR) - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.b, j); - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.g, j); - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.r, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.b, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.g, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.r, j); #endif #ifdef RGBW - for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 4 + j] = get_protocol_eq(color.w, j); + for (int j = 0; j < 4; j++) + tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 4 + j] = get_protocol_eq(color.w, j); #endif } @@ -126,7 +136,7 @@ void ws2812_init(void) { #ifdef WS2812_SPI_SCK_PIN palSetLineMode(WS2812_SPI_SCK_PIN, WS2812_SCK_OUTPUT_MODE); -#endif // WS2812_SPI_SCK_PIN +#endif // WS2812_SPI_SCK_PIN // TODO: more dynamic baudrate static const SPIConfig spicfg = {WS2812_SPI_BUFFER_MODE, NULL, PAL_PORT(RGB_DI_PIN), PAL_PAD(RGB_DI_PIN), WS2812_SPI_DIVISOR_CR1_BR_X}; diff --git a/platforms/chibios/eeprom_stm32.c b/platforms/chibios/eeprom_stm32.c index acc6a48516c9..a15bfe09edae 100644 --- a/platforms/chibios/eeprom_stm32.c +++ b/platforms/chibios/eeprom_stm32.c @@ -133,10 +133,6 @@ */ #include "eeprom_stm32_defs.h" -#if !defined(FEE_PAGE_SIZE) || !defined(FEE_PAGE_COUNT) || !defined(FEE_MCU_FLASH_SIZE) || !defined(FEE_PAGE_BASE_ADDRESS) -# error "not implemented." -#endif - /* These bits are used for optimizing encoding of bytes, 0 and 1 */ #define FEE_WORD_ENCODING 0x8000 #define FEE_VALUE_NEXT 0x6000 @@ -144,69 +140,11 @@ #define FEE_VALUE_ENCODED 0x2000 #define FEE_BYTE_RANGE 0x80 -/* Addressable range 16KByte: 0 <-> (0x1FFF << 1) */ -#define FEE_ADDRESS_MAX_SIZE 0x4000 - /* Flash word value after erase */ #define FEE_EMPTY_WORD ((uint16_t)0xFFFF) -/* Size of combined compacted eeprom and write log pages */ -#define FEE_DENSITY_MAX_SIZE (FEE_PAGE_COUNT * FEE_PAGE_SIZE) - -#ifndef FEE_MCU_FLASH_SIZE_IGNORE_CHECK /* *TODO: Get rid of this check */ -# if FEE_DENSITY_MAX_SIZE > (FEE_MCU_FLASH_SIZE * 1024) -# pragma message STR(FEE_DENSITY_MAX_SIZE) " > " STR(FEE_MCU_FLASH_SIZE * 1024) -# error emulated eeprom: FEE_DENSITY_MAX_SIZE is greater than available flash size -# endif -#endif - -/* Size of emulated eeprom */ -#ifdef FEE_DENSITY_BYTES -# if (FEE_DENSITY_BYTES > FEE_DENSITY_MAX_SIZE) -# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) -# error emulated eeprom: FEE_DENSITY_BYTES exceeds FEE_DENSITY_MAX_SIZE -# endif -# if (FEE_DENSITY_BYTES == FEE_DENSITY_MAX_SIZE) -# pragma message STR(FEE_DENSITY_BYTES) " == " STR(FEE_DENSITY_MAX_SIZE) -# warning emulated eeprom: FEE_DENSITY_BYTES leaves no room for a write log. This will greatly increase the flash wear rate! -# endif -# if FEE_DENSITY_BYTES > FEE_ADDRESS_MAX_SIZE -# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_ADDRESS_MAX_SIZE) -# error emulated eeprom: FEE_DENSITY_BYTES is greater than FEE_ADDRESS_MAX_SIZE allows -# endif -# if ((FEE_DENSITY_BYTES) % 2) == 1 -# error emulated eeprom: FEE_DENSITY_BYTES must be even -# endif -#else -/* Default to half of allocated space used for emulated eeprom, half for write log */ -# define FEE_DENSITY_BYTES (FEE_PAGE_COUNT * FEE_PAGE_SIZE / 2) -#endif - -/* Size of write log */ -#ifdef FEE_WRITE_LOG_BYTES -# if ((FEE_DENSITY_BYTES + FEE_WRITE_LOG_BYTES) > FEE_DENSITY_MAX_SIZE) -# pragma message STR(FEE_DENSITY_BYTES) " + " STR(FEE_WRITE_LOG_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) -# error emulated eeprom: FEE_WRITE_LOG_BYTES exceeds remaining FEE_DENSITY_MAX_SIZE -# endif -# if ((FEE_WRITE_LOG_BYTES) % 2) == 1 -# error emulated eeprom: FEE_WRITE_LOG_BYTES must be even -# endif -#else -/* Default to use all remaining space */ -# define FEE_WRITE_LOG_BYTES (FEE_PAGE_COUNT * FEE_PAGE_SIZE - FEE_DENSITY_BYTES) -#endif - -/* Start of the emulated eeprom compacted flash area */ -#define FEE_COMPACTED_BASE_ADDRESS FEE_PAGE_BASE_ADDRESS -/* End of the emulated eeprom compacted flash area */ -#define FEE_COMPACTED_LAST_ADDRESS (FEE_COMPACTED_BASE_ADDRESS + FEE_DENSITY_BYTES) -/* Start of the emulated eeprom write log */ -#define FEE_WRITE_LOG_BASE_ADDRESS FEE_COMPACTED_LAST_ADDRESS -/* End of the emulated eeprom write log */ -#define FEE_WRITE_LOG_LAST_ADDRESS (FEE_WRITE_LOG_BASE_ADDRESS + FEE_WRITE_LOG_BYTES) - -#if defined(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) && (DYNAMIC_KEYMAP_EEPROM_MAX_ADDR >= FEE_DENSITY_BYTES) -# error emulated eeprom: DYNAMIC_KEYMAP_EEPROM_MAX_ADDR is greater than the FEE_DENSITY_BYTES available +#if !defined(FEE_PAGE_SIZE) || !defined(FEE_PAGE_COUNT) || !defined(FEE_MCU_FLASH_SIZE) || !defined(FEE_PAGE_BASE_ADDRESS) +# error "not implemented." #endif /* In-memory contents of emulated eeprom for faster access */ @@ -622,9 +560,13 @@ uint16_t EEPROM_ReadDataWord(uint16_t Address) { /***************************************************************************** * Bind to eeprom_driver.c *******************************************************************************/ -void eeprom_driver_init(void) { EEPROM_Init(); } +void eeprom_driver_init(void) { + EEPROM_Init(); +} -void eeprom_driver_erase(void) { EEPROM_Erase(); } +void eeprom_driver_erase(void) { + EEPROM_Erase(); +} void eeprom_read_block(void *buf, const void *addr, size_t len) { const uint8_t *src = (const uint8_t *)addr; diff --git a/platforms/chibios/eeprom_stm32_defs.h b/platforms/chibios/eeprom_stm32_defs.h index 66904f247f58..a6ceb413557e 100644 --- a/platforms/chibios/eeprom_stm32_defs.h +++ b/platforms/chibios/eeprom_stm32_defs.h @@ -20,41 +20,41 @@ #if !defined(FEE_PAGE_SIZE) || !defined(FEE_PAGE_COUNT) # if defined(STM32F103xB) || defined(STM32F042x6) || defined(GD32VF103C8) || defined(GD32VF103CB) # ifndef FEE_PAGE_SIZE -# define FEE_PAGE_SIZE 0x400 // Page size = 1KByte +# define FEE_PAGE_SIZE 0x400 // Page size = 1KByte # endif # ifndef FEE_PAGE_COUNT -# define FEE_PAGE_COUNT 2 // How many pages are used +# define FEE_PAGE_COUNT 2 // How many pages are used # endif # elif defined(STM32F103xE) || defined(STM32F303xC) || defined(STM32F072xB) || defined(STM32F070xB) # ifndef FEE_PAGE_SIZE -# define FEE_PAGE_SIZE 0x800 // Page size = 2KByte +# define FEE_PAGE_SIZE 0x800 // Page size = 2KByte # endif # ifndef FEE_PAGE_COUNT -# define FEE_PAGE_COUNT 4 // How many pages are used +# define FEE_PAGE_COUNT 4 // How many pages are used # endif # elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F405xG) || defined(STM32F411xE) # ifndef FEE_PAGE_SIZE -# define FEE_PAGE_SIZE 0x4000 // Page size = 16KByte +# define FEE_PAGE_SIZE 0x4000 // Page size = 16KByte # endif # ifndef FEE_PAGE_COUNT -# define FEE_PAGE_COUNT 1 // How many pages are used +# define FEE_PAGE_COUNT 1 // How many pages are used # endif # endif #endif #if !defined(FEE_MCU_FLASH_SIZE) # if defined(STM32F042x6) -# define FEE_MCU_FLASH_SIZE 32 // Size in Kb +# define FEE_MCU_FLASH_SIZE 32 // Size in Kb # elif defined(GD32VF103C8) -# define FEE_MCU_FLASH_SIZE 64 // Size in Kb +# define FEE_MCU_FLASH_SIZE 64 // Size in Kb # elif defined(STM32F103xB) || defined(STM32F072xB) || defined(STM32F070xB) || defined(GD32VF103CB) -# define FEE_MCU_FLASH_SIZE 128 // Size in Kb +# define FEE_MCU_FLASH_SIZE 128 // Size in Kb # elif defined(STM32F303xC) || defined(STM32F401xC) -# define FEE_MCU_FLASH_SIZE 256 // Size in Kb +# define FEE_MCU_FLASH_SIZE 256 // Size in Kb # elif defined(STM32F103xE) || defined(STM32F401xE) || defined(STM32F411xE) -# define FEE_MCU_FLASH_SIZE 512 // Size in Kb +# define FEE_MCU_FLASH_SIZE 512 // Size in Kb # elif defined(STM32F405xG) -# define FEE_MCU_FLASH_SIZE 1024 // Size in Kb +# define FEE_MCU_FLASH_SIZE 1024 // Size in Kb # endif #endif @@ -62,7 +62,7 @@ #if !defined(FEE_PAGE_BASE_ADDRESS) # if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F405xG) || defined(STM32F411xE) # ifndef FEE_PAGE_BASE_ADDRESS -# define FEE_PAGE_BASE_ADDRESS 0x08004000 // bodge to force 2nd 16k page +# define FEE_PAGE_BASE_ADDRESS 0x08004000 // bodge to force 2nd 16k page # endif # else # ifndef FEE_FLASH_BASE @@ -72,3 +72,65 @@ # define FEE_PAGE_BASE_ADDRESS ((uintptr_t)(FEE_FLASH_BASE) + FEE_MCU_FLASH_SIZE * 1024 - (FEE_PAGE_COUNT * FEE_PAGE_SIZE)) # endif #endif + +/* Addressable range 16KByte: 0 <-> (0x1FFF << 1) */ +#define FEE_ADDRESS_MAX_SIZE 0x4000 + +/* Size of combined compacted eeprom and write log pages */ +#define FEE_DENSITY_MAX_SIZE (FEE_PAGE_COUNT * FEE_PAGE_SIZE) + +#ifndef FEE_MCU_FLASH_SIZE_IGNORE_CHECK /* *TODO: Get rid of this check */ +# if FEE_DENSITY_MAX_SIZE > (FEE_MCU_FLASH_SIZE * 1024) +# pragma message STR(FEE_DENSITY_MAX_SIZE) " > " STR(FEE_MCU_FLASH_SIZE * 1024) +# error emulated eeprom: FEE_DENSITY_MAX_SIZE is greater than available flash size +# endif +#endif + +/* Size of emulated eeprom */ +#ifdef FEE_DENSITY_BYTES +# if (FEE_DENSITY_BYTES > FEE_DENSITY_MAX_SIZE) +# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) +# error emulated eeprom: FEE_DENSITY_BYTES exceeds FEE_DENSITY_MAX_SIZE +# endif +# if (FEE_DENSITY_BYTES == FEE_DENSITY_MAX_SIZE) +# pragma message STR(FEE_DENSITY_BYTES) " == " STR(FEE_DENSITY_MAX_SIZE) +# warning emulated eeprom: FEE_DENSITY_BYTES leaves no room for a write log. This will greatly increase the flash wear rate! +# endif +# if FEE_DENSITY_BYTES > FEE_ADDRESS_MAX_SIZE +# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_ADDRESS_MAX_SIZE) +# error emulated eeprom: FEE_DENSITY_BYTES is greater than FEE_ADDRESS_MAX_SIZE allows +# endif +# if ((FEE_DENSITY_BYTES) % 2) == 1 +# error emulated eeprom: FEE_DENSITY_BYTES must be even +# endif +#else +/* Default to half of allocated space used for emulated eeprom, half for write log */ +# define FEE_DENSITY_BYTES (FEE_PAGE_COUNT * FEE_PAGE_SIZE / 2) +#endif + +/* Size of write log */ +#ifdef FEE_WRITE_LOG_BYTES +# if ((FEE_DENSITY_BYTES + FEE_WRITE_LOG_BYTES) > FEE_DENSITY_MAX_SIZE) +# pragma message STR(FEE_DENSITY_BYTES) " + " STR(FEE_WRITE_LOG_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) +# error emulated eeprom: FEE_WRITE_LOG_BYTES exceeds remaining FEE_DENSITY_MAX_SIZE +# endif +# if ((FEE_WRITE_LOG_BYTES) % 2) == 1 +# error emulated eeprom: FEE_WRITE_LOG_BYTES must be even +# endif +#else +/* Default to use all remaining space */ +# define FEE_WRITE_LOG_BYTES (FEE_PAGE_COUNT * FEE_PAGE_SIZE - FEE_DENSITY_BYTES) +#endif + +/* Start of the emulated eeprom compacted flash area */ +#define FEE_COMPACTED_BASE_ADDRESS FEE_PAGE_BASE_ADDRESS +/* End of the emulated eeprom compacted flash area */ +#define FEE_COMPACTED_LAST_ADDRESS (FEE_COMPACTED_BASE_ADDRESS + FEE_DENSITY_BYTES) +/* Start of the emulated eeprom write log */ +#define FEE_WRITE_LOG_BASE_ADDRESS FEE_COMPACTED_LAST_ADDRESS +/* End of the emulated eeprom write log */ +#define FEE_WRITE_LOG_LAST_ADDRESS (FEE_WRITE_LOG_BASE_ADDRESS + FEE_WRITE_LOG_BYTES) + +#if defined(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) && (DYNAMIC_KEYMAP_EEPROM_MAX_ADDR >= FEE_DENSITY_BYTES) +# error emulated eeprom: DYNAMIC_KEYMAP_EEPROM_MAX_ADDR is greater than the FEE_DENSITY_BYTES available +#endif diff --git a/platforms/chibios/eeprom_teensy.c b/platforms/chibios/eeprom_teensy.c index 4aaf66526907..c8777febde3a 100644 --- a/platforms/chibios/eeprom_teensy.c +++ b/platforms/chibios/eeprom_teensy.c @@ -1,6 +1,7 @@ #include #include +#include "eeprom_teensy.h" #include "eeconfig.h" /*************************************/ @@ -42,18 +43,6 @@ #if defined(K20x) /* chip selection */ /* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */ -// The EEPROM is really RAM with a hardware-based backup system to -// flash memory. Selecting a smaller size EEPROM allows more wear -// leveling, for higher write endurance. If you edit this file, -// set this to the smallest size your application can use. Also, -// due to Freescale's implementation, writing 16 or 32 bit words -// (aligned to 2 or 4 byte boundaries) has twice the endurance -// compared to writing 8 bit bytes. -// -# ifndef EEPROM_SIZE -# define EEPROM_SIZE 32 -# endif - /* ^^^ Here be dragons: NXP AppNote AN4282 section 3.1 states that partitioning must only be done once. @@ -71,19 +60,19 @@ // Minimum EEPROM Endurance // ------------------------ -# if (EEPROM_SIZE == 2048) // 35000 writes/byte or 70000 writes/word +# if (EEPROM_SIZE == 2048) // 35000 writes/byte or 70000 writes/word # define EEESIZE 0x33 -# elif (EEPROM_SIZE == 1024) // 75000 writes/byte or 150000 writes/word +# elif (EEPROM_SIZE == 1024) // 75000 writes/byte or 150000 writes/word # define EEESIZE 0x34 -# elif (EEPROM_SIZE == 512) // 155000 writes/byte or 310000 writes/word +# elif (EEPROM_SIZE == 512) // 155000 writes/byte or 310000 writes/word # define EEESIZE 0x35 -# elif (EEPROM_SIZE == 256) // 315000 writes/byte or 630000 writes/word +# elif (EEPROM_SIZE == 256) // 315000 writes/byte or 630000 writes/word # define EEESIZE 0x36 -# elif (EEPROM_SIZE == 128) // 635000 writes/byte or 1270000 writes/word +# elif (EEPROM_SIZE == 128) // 635000 writes/byte or 1270000 writes/word # define EEESIZE 0x37 -# elif (EEPROM_SIZE == 64) // 1275000 writes/byte or 2550000 writes/word +# elif (EEPROM_SIZE == 64) // 1275000 writes/byte or 2550000 writes/word # define EEESIZE 0x38 -# elif (EEPROM_SIZE == 32) // 2555000 writes/byte or 5110000 writes/word +# elif (EEPROM_SIZE == 32) // 2555000 writes/byte or 5110000 writes/word # define EEESIZE 0x39 # endif @@ -99,9 +88,9 @@ void eeprom_initialize(void) { if (FTFL->FCNFG & FTFL_FCNFG_RAMRDY) { // FlexRAM is configured as traditional RAM // We need to reconfigure for EEPROM usage - FTFL->FCCOB0 = 0x80; // PGMPART = Program Partition Command - FTFL->FCCOB4 = EEESIZE; // EEPROM Size - FTFL->FCCOB5 = 0x03; // 0K for Dataflash, 32K for EEPROM backup + FTFL->FCCOB0 = 0x80; // PGMPART = Program Partition Command + FTFL->FCCOB4 = EEESIZE; // EEPROM Size + FTFL->FCCOB5 = 0x03; // 0K for Dataflash, 32K for EEPROM backup __disable_irq(); // do_flash_cmd() must execute from RAM. Luckily the C syntax is simple... (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFL->FSTAT)); @@ -109,7 +98,7 @@ void eeprom_initialize(void) { status = FTFL->FSTAT; if (status & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL)) { FTFL->FSTAT = (status & (FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL)); - return; // error + return; // error } } // wait for eeprom to become ready (is this really necessary?) @@ -173,7 +162,9 @@ void eeprom_read_block(void *buf, const void *addr, uint32_t len) { * * FIXME: needs doc */ -int eeprom_is_ready(void) { return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; } +int eeprom_is_ready(void) { + return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; +} /** \brief flexram wait * @@ -350,8 +341,6 @@ void do_flash_cmd(volatile uint8_t *fstat) extern uint32_t __eeprom_workarea_start__; extern uint32_t __eeprom_workarea_end__; -# define EEPROM_SIZE 128 - static uint32_t flashend = 0; void eeprom_initialize(void) { @@ -499,7 +488,9 @@ void eeprom_read_block(void *buf, const void *addr, uint32_t len) { } } -int eeprom_is_ready(void) { return 1; } +int eeprom_is_ready(void) { + return 1; +} void eeprom_write_word(uint16_t *addr, uint16_t value) { uint8_t *p = (uint8_t *)addr; @@ -524,68 +515,13 @@ void eeprom_write_block(const void *buf, void *addr, uint32_t len) { } #else -// No EEPROM supported, so emulate it - -# ifndef EEPROM_SIZE -# include "eeconfig.h" -# define EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO -# endif -__attribute__((aligned(4))) static uint8_t buffer[EEPROM_SIZE]; - -uint8_t eeprom_read_byte(const uint8_t *addr) { - uint32_t offset = (uint32_t)addr; - return buffer[offset]; -} - -void eeprom_write_byte(uint8_t *addr, uint8_t value) { - uint32_t offset = (uint32_t)addr; - buffer[offset] = value; -} - -uint16_t eeprom_read_word(const uint16_t *addr) { - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p + 1) << 8); -} - -uint32_t eeprom_read_dword(const uint32_t *addr) { - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p + 1) << 8) | (eeprom_read_byte(p + 2) << 16) | (eeprom_read_byte(p + 3) << 24); -} - -void eeprom_read_block(void *buf, const void *addr, size_t len) { - const uint8_t *p = (const uint8_t *)addr; - uint8_t * dest = (uint8_t *)buf; - while (len--) { - *dest++ = eeprom_read_byte(p++); - } -} - -void eeprom_write_word(uint16_t *addr, uint16_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p, value >> 8); -} - -void eeprom_write_dword(uint32_t *addr, uint32_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p++, value >> 8); - eeprom_write_byte(p++, value >> 16); - eeprom_write_byte(p, value >> 24); -} - -void eeprom_write_block(const void *buf, void *addr, size_t len) { - uint8_t * p = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - while (len--) { - eeprom_write_byte(p++, *src++); - } -} - +# error Unsupported Teensy EEPROM. #endif /* chip selection */ // The update functions just calls write for now, but could probably be optimized -void eeprom_update_byte(uint8_t *addr, uint8_t value) { eeprom_write_byte(addr, value); } +void eeprom_update_byte(uint8_t *addr, uint8_t value) { + eeprom_write_byte(addr, value); +} void eeprom_update_word(uint16_t *addr, uint16_t value) { uint8_t *p = (uint8_t *)addr; diff --git a/platforms/chibios/eeprom_teensy.h b/platforms/chibios/eeprom_teensy.h new file mode 100755 index 000000000000..9a14a1fa79e5 --- /dev/null +++ b/platforms/chibios/eeprom_teensy.h @@ -0,0 +1,25 @@ +// Copyright 2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include +#include + +#if defined(K20x) +/* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */ +// The EEPROM is really RAM with a hardware-based backup system to +// flash memory. Selecting a smaller size EEPROM allows more wear +// leveling, for higher write endurance. If you edit this file, +// set this to the smallest size your application can use. Also, +// due to Freescale's implementation, writing 16 or 32 bit words +// (aligned to 2 or 4 byte boundaries) has twice the endurance +// compared to writing 8 bit bytes. +// +# ifndef EEPROM_SIZE +# define EEPROM_SIZE 32 +# endif +#elif defined(KL2x) /* Teensy LC (emulated) */ +# define EEPROM_SIZE 128 +#else +# error Unsupported Teensy EEPROM. +#endif diff --git a/platforms/chibios/gd32v_compatibility.h b/platforms/chibios/gd32v_compatibility.h index f4dcfd8c55ea..a3148fb6d2e4 100644 --- a/platforms/chibios/gd32v_compatibility.h +++ b/platforms/chibios/gd32v_compatibility.h @@ -97,10 +97,10 @@ /* Serial USART redefines. */ #if HAL_USE_SERIAL # if !defined(SERIAL_USART_CR1) -# define SERIAL_USART_CR1 (USART_CTL0_PCEN | USART_CTL0_PM | USART_CTL0_WL) // parity enable, odd parity, 9 bit length +# define SERIAL_USART_CR1 (USART_CTL0_PCEN | USART_CTL0_PM | USART_CTL0_WL) // parity enable, odd parity, 9 bit length # endif # if !defined(SERIAL_USART_CR2) -# define SERIAL_USART_CR2 (USART_CTL1_STB_1) // 2 stop bits +# define SERIAL_USART_CR2 (USART_CTL1_STB_1) // 2 stop bits # endif # if !defined(SERIAL_USART_CR3) # define SERIAL_USART_CR3 0x0 diff --git a/platforms/chibios/gpio.h b/platforms/chibios/gpio.h index 4d057f1cab77..eb44a18f9c3e 100644 --- a/platforms/chibios/gpio.h +++ b/platforms/chibios/gpio.h @@ -22,10 +22,12 @@ typedef ioline_t pin_t; /* Operation of GPIO by pin. */ -#define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) -#define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) -#define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) -#define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) +#define setPinInput(pin) palSetLineMode((pin), PAL_MODE_INPUT) +#define setPinInputHigh(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLUP) +#define setPinInputLow(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLDOWN) +#define setPinOutputPushPull(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_PUSHPULL) +#define setPinOutputOpenDrain(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_OPENDRAIN) +#define setPinOutput(pin) setPinOutputPushPull(pin) #define writePinHigh(pin) palSetLine(pin) #define writePinLow(pin) palClearLine(pin) @@ -34,17 +36,3 @@ typedef ioline_t pin_t; #define readPin(pin) palReadLine(pin) #define togglePin(pin) palToggleLine(pin) - -/* Operation of GPIO by port. */ - -typedef uint16_t port_data_t; - -#define readPort(pin) palReadPort(PAL_PORT(pin)) - -#define setPortBitInput(pin, bit) palSetPadMode(PAL_PORT(pin), bit, PAL_MODE_INPUT) -#define setPortBitInputHigh(pin, bit) palSetPadMode(PAL_PORT(pin), bit, PAL_MODE_INPUT_PULLUP) -#define setPortBitInputLow(pin, bit) palSetPadMode(PAL_PORT(pin), bit, PAL_MODE_INPUT_PULLDOWN) -#define setPortBitOutput(pin, bit) palSetPadMode(PAL_PORT(pin), bit, PAL_MODE_OUTPUT_PUSHPULL) - -#define writePortBitLow(pin, bit) palClearLine(PAL_LINE(PAL_PORT(pin), bit)) -#define writePortBitHigh(pin, bit) palSetLine(PAL_LINE(PAL_PORT(pin), bit)) diff --git a/platforms/chibios/platform.mk b/platforms/chibios/platform.mk index 45e337788229..6fd1fd83f5ad 100644 --- a/platforms/chibios/platform.mk +++ b/platforms/chibios/platform.mk @@ -344,7 +344,7 @@ ifeq ($(strip $(MCU)), risc-v) ifneq ($(shell which riscv64-unknown-elf-gcc 2>/dev/null),) TOOLCHAIN = riscv64-unknown-elf- else - $(error "No RISC-V toolchain found. Can't find riscv32-unknown-elf-gcc or riscv64-unknown-elf-gcc found in your systems PATH variable. Please install a valid toolchain and make it accessible!") + $(call CATASTROPHIC_ERROR,Missing toolchain,No RISC-V toolchain found. Can't find riscv32-unknown-elf-gcc or riscv64-unknown-elf-gcc found in your systems PATH variable. Please install a valid toolchain and make it accessible!) endif endif endif diff --git a/platforms/chibios/sleep_led.c b/platforms/chibios/sleep_led.c index 477056a454f0..a777d60468bb 100644 --- a/platforms/chibios/sleep_led.c +++ b/platforms/chibios/sleep_led.c @@ -93,7 +93,7 @@ void sleep_led_init(void) { /* Reset LPTMR settings */ LPTMR0->CSR = 0; /* Set the compare value */ - LPTMR0->CMR = 0; // trigger on counter value (i.e. every time) + LPTMR0->CMR = 0; // trigger on counter value (i.e. every time) /* Set up clock source and prescaler */ /* Software PWM @@ -118,11 +118,11 @@ void sleep_led_init(void) { /* === OPTION 2 === */ # if 1 // nMHz IRC (n=4 on KL25Z, KL26Z and K20x; n=2 or 8 on KL27Z) - MCG->C2 |= MCG_C2_IRCS; // fast (4MHz) internal ref clock -# if defined(KL27) // divide the 8MHz IRC by 2, to have the same MCGIRCLK speed as others + MCG->C2 |= MCG_C2_IRCS; // fast (4MHz) internal ref clock +# if defined(KL27) // divide the 8MHz IRC by 2, to have the same MCGIRCLK speed as others MCG->MC |= MCG_MC_LIRC_DIV2_DIV2; -# endif /* KL27 */ - MCG->C1 |= MCG_C1_IRCLKEN; // enable internal ref clock +# endif /* KL27 */ + MCG->C1 |= MCG_C1_IRCLKEN; // enable internal ref clock // to work in stop mode, also MCG_C1_IREFSTEN // Divide 4MHz by 2^N (N=6) => 62500 irqs/sec => // => approx F=61, R=256, duration = 4 @@ -140,7 +140,7 @@ void sleep_led_init(void) { /* === END OPTIONS === */ /* Interrupt on TCF set (compare flag) */ - nvicEnableVector(LPTMR0_IRQn, 2); // vector, priority + nvicEnableVector(LPTMR0_IRQn, 2); // vector, priority LPTMR0->CSR |= LPTMRx_CSR_TIE; } @@ -169,21 +169,33 @@ static void gptTimerCallback(GPTDriver *gptp) { static const GPTConfig gptcfg = {1000000, gptTimerCallback, 0, 0}; /* Initialise the timer */ -void sleep_led_init(void) { gptStart(&SLEEP_LED_GPT_DRIVER, &gptcfg); } +void sleep_led_init(void) { + gptStart(&SLEEP_LED_GPT_DRIVER, &gptcfg); +} -void sleep_led_enable(void) { gptStartContinuous(&SLEEP_LED_GPT_DRIVER, gptcfg.frequency / 0xFFFF); } +void sleep_led_enable(void) { + gptStartContinuous(&SLEEP_LED_GPT_DRIVER, gptcfg.frequency / 0xFFFF); +} -void sleep_led_disable(void) { gptStopTimer(&SLEEP_LED_GPT_DRIVER); } +void sleep_led_disable(void) { + gptStopTimer(&SLEEP_LED_GPT_DRIVER); +} -void sleep_led_toggle(void) { (SLEEP_LED_GPT_DRIVER.state == GPT_READY) ? sleep_led_enable() : sleep_led_disable(); } +void sleep_led_toggle(void) { + (SLEEP_LED_GPT_DRIVER.state == GPT_READY) ? sleep_led_enable() : sleep_led_disable(); +} #else /* platform selection: not on familiar chips */ void sleep_led_init(void) {} -void sleep_led_enable(void) { led_set(1 << USB_LED_CAPS_LOCK); } +void sleep_led_enable(void) { + led_set(1 << USB_LED_CAPS_LOCK); +} -void sleep_led_disable(void) { led_set(0); } +void sleep_led_disable(void) { + led_set(0); +} void sleep_led_toggle(void) { // not implemented diff --git a/platforms/chibios/suspend.c b/platforms/chibios/suspend.c index 9310a999209c..ce03433e3a2d 100644 --- a/platforms/chibios/suspend.c +++ b/platforms/chibios/suspend.c @@ -13,15 +13,6 @@ #include "led.h" #include "wait.h" -/** \brief suspend idle - * - * FIXME: needs doc - */ -void suspend_idle(uint8_t time) { - // TODO: this is not used anywhere - what units is 'time' in? - wait_ms(time); -} - /** \brief suspend power down * * FIXME: needs doc @@ -34,34 +25,6 @@ void suspend_power_down(void) { wait_ms(17); } -/** \brief suspend wakeup condition - * - * FIXME: needs doc - */ -__attribute__((weak)) void matrix_power_up(void) {} -__attribute__((weak)) void matrix_power_down(void) {} -bool suspend_wakeup_condition(void) { - matrix_power_up(); - matrix_scan(); - matrix_power_down(); - for (uint8_t r = 0; r < MATRIX_ROWS; r++) { - if (matrix_get_row(r)) return true; - } - return false; -} - -/** \brief run user level code immediately after wakeup - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_wakeup_init_user(void) {} - -/** \brief run keyboard level code immediately after wakeup - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); } - /** \brief suspend wakeup condition * * run immediately after wakeup diff --git a/platforms/chibios/syscall-fallbacks.c b/platforms/chibios/syscall-fallbacks.c index 7150a463262d..86f7907bfcaa 100644 --- a/platforms/chibios/syscall-fallbacks.c +++ b/platforms/chibios/syscall-fallbacks.c @@ -87,9 +87,13 @@ __attribute__((weak, used)) int _kill(int pid, int sig) { return -1; } -__attribute__((weak, used)) pid_t _getpid(void) { return 1; } +__attribute__((weak, used)) pid_t _getpid(void) { + return 1; +} -__attribute__((weak, used)) void _fini(void) { return; } +__attribute__((weak, used)) void _fini(void) { + return; +} __attribute__((weak, used, noreturn)) void _exit(int i) { while (1) diff --git a/platforms/chibios/timer.c b/platforms/chibios/timer.c index 9f664e1f7983..e3bdfdcc372e 100644 --- a/platforms/chibios/timer.c +++ b/platforms/chibios/timer.c @@ -2,46 +2,106 @@ #include "timer.h" -static uint32_t reset_point = 0; +static uint32_t ticks_offset = 0; +static uint32_t last_ticks = 0; +static uint32_t ms_offset = 0; #if CH_CFG_ST_RESOLUTION < 32 static uint32_t last_systime = 0; static uint32_t overflow = 0; #endif -void timer_init(void) { timer_clear(); } +// Get the current system time in ticks as a 32-bit number. +// This function must be called from within a system lock zone (so that it can safely use and update the static data). +static inline uint32_t get_system_time_ticks(void) { + uint32_t systime = (uint32_t)chVTGetSystemTimeX(); -void timer_clear(void) { - reset_point = (uint32_t)chVTGetSystemTime(); #if CH_CFG_ST_RESOLUTION < 32 - last_systime = reset_point; - overflow = 0; -#endif -} - -uint16_t timer_read(void) { return (uint16_t)timer_read32(); } - -uint32_t timer_read32(void) { - uint32_t systime = (uint32_t)chVTGetSystemTime(); - -#if CH_CFG_ST_RESOLUTION < 32 - // If/when we need to support 64-bit chips, this may need to be modified to match the native bit-ness of the MCU. - // At this point, the only SysTick resolution allowed other than 32 is 16 bit. - // In the 16-bit case, at: + // If the real system timer resolution is less than 32 bits, provide the missing bits by checking for the counter + // overflow. For this to work, this function must be called at least once for every overflow of the system timer. + // In the 16-bit case, the corresponding times are: // - CH_CFG_ST_FREQUENCY = 100000, overflow will occur every ~0.65 seconds // - CH_CFG_ST_FREQUENCY = 10000, overflow will occur every ~6.5 seconds // - CH_CFG_ST_FREQUENCY = 1000, overflow will occur every ~65 seconds - // With this implementation, as long as we ensure a timer read happens at least once during the overflow period, timing should be accurate. if (systime < last_systime) { overflow += ((uint32_t)1) << CH_CFG_ST_RESOLUTION; } - last_systime = systime; - return (uint32_t)TIME_I2MS(systime - reset_point + overflow); -#else - return (uint32_t)TIME_I2MS(systime - reset_point); + systime += overflow; +#endif + + return systime; +} + +#if CH_CFG_ST_RESOLUTION < 32 +static virtual_timer_t update_timer; + +// Update the system tick counter every half of the timer overflow period; this should keep the tick counter correct +// even if something blocks timer interrupts for 1/2 of the timer overflow period. +# define UPDATE_INTERVAL (((sysinterval_t)1) << (CH_CFG_ST_RESOLUTION - 1)) + +// VT callback function to keep the overflow bits of the system tick counter updated. +static void update_fn(void *arg) { + (void)arg; + chSysLockFromISR(); + get_system_time_ticks(); + chVTSetI(&update_timer, UPDATE_INTERVAL, update_fn, NULL); + chSysUnlockFromISR(); +} +#endif + +// The highest multiple of CH_CFG_ST_FREQUENCY that fits into uint32_t. This number of ticks will necessarily +// correspond to some integer number of seconds. +#define OVERFLOW_ADJUST_TICKS ((uint32_t)((UINT32_MAX / CH_CFG_ST_FREQUENCY) * CH_CFG_ST_FREQUENCY)) + +// The time in milliseconds which corresponds to OVERFLOW_ADJUST_TICKS ticks (this is a precise conversion, because +// OVERFLOW_ADJUST_TICKS corresponds to an integer number of seconds). +#define OVERFLOW_ADJUST_MS (TIME_I2MS(OVERFLOW_ADJUST_TICKS)) + +void timer_init(void) { + timer_clear(); +#if CH_CFG_ST_RESOLUTION < 32 + chVTObjectInit(&update_timer); + chVTSet(&update_timer, UPDATE_INTERVAL, update_fn, NULL); #endif } -uint16_t timer_elapsed(uint16_t last) { return TIMER_DIFF_16(timer_read(), last); } +void timer_clear(void) { + chSysLock(); + ticks_offset = get_system_time_ticks(); + last_ticks = 0; + ms_offset = 0; + chSysUnlock(); +} + +uint16_t timer_read(void) { + return (uint16_t)timer_read32(); +} -uint32_t timer_elapsed32(uint32_t last) { return TIMER_DIFF_32(timer_read32(), last); } +uint32_t timer_read32(void) { + chSysLock(); + 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, + // because TIME_I2MS() may encounter overflows when handling a 64-bit argument; therefore the solution here is + // to subtract a reasonably large number of ticks from the tick counter to bring its value below the 32-bit + // limit again, and then add the equivalent number of milliseconds to the converted value. (Adjusting just the + // converted value to account for 2**32 ticks is not possible in general, because 2**32 ticks may not correspond + // to an integer number of milliseconds). + ticks -= OVERFLOW_ADJUST_TICKS; + ticks_offset += OVERFLOW_ADJUST_TICKS; + ms_offset += OVERFLOW_ADJUST_MS; + } + last_ticks = ticks; + uint32_t ms_offset_copy = ms_offset; // read while still holding the lock to ensure a consistent value + chSysUnlock(); + + 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/common.mk b/platforms/common.mk index f7a0fc7028b7..2a1fc8d377be 100644 --- a/platforms/common.mk +++ b/platforms/common.mk @@ -1,10 +1,11 @@ PLATFORM_COMMON_DIR = $(PLATFORM_PATH)/$(PLATFORM_KEY) TMK_COMMON_SRC += \ + $(PLATFORM_PATH)/suspend.c \ $(PLATFORM_COMMON_DIR)/platform.c \ $(PLATFORM_COMMON_DIR)/suspend.c \ $(PLATFORM_COMMON_DIR)/timer.c \ - $(PLATFORM_COMMON_DIR)/bootloader.c \ + $(PLATFORM_COMMON_DIR)/bootloaders/$(BOOTLOADER_TYPE).c # Search Path VPATH += $(PLATFORM_PATH) diff --git a/platforms/eeprom.h b/platforms/eeprom.h index f5b3f0ad53d1..091e6e440091 100644 --- a/platforms/eeprom.h +++ b/platforms/eeprom.h @@ -1,3 +1,5 @@ +// Copyright 2018-2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once #if defined(__AVR__) && !defined(EEPROM_DRIVER) @@ -19,3 +21,50 @@ void eeprom_update_word(uint16_t *__p, uint16_t __value); void eeprom_update_dword(uint32_t *__p, uint32_t __value); void eeprom_update_block(const void *__src, void *__dst, size_t __n); #endif + +#if defined(EEPROM_CUSTOM) +# ifndef EEPROM_SIZE +# error EEPROM_SIZE has not been defined for custom driver. +# endif +# define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) +#elif defined(EEPROM_TRANSIENT) +# include "eeprom_transient.h" +# define TOTAL_EEPROM_BYTE_COUNT (TRANSIENT_EEPROM_SIZE) +#elif defined(EEPROM_I2C) +# include "eeprom_i2c.h" +# define TOTAL_EEPROM_BYTE_COUNT (EXTERNAL_EEPROM_BYTE_COUNT) +#elif defined(EEPROM_SPI) +# include "eeprom_spi.h" +# define TOTAL_EEPROM_BYTE_COUNT (EXTERNAL_EEPROM_BYTE_COUNT) +#elif defined(EEPROM_STM32_L0_L1) +# include "eeprom_stm32_L0_L1.h" +# define TOTAL_EEPROM_BYTE_COUNT (STM32_ONBOARD_EEPROM_SIZE) +#elif defined(EEPROM_TEENSY) +# include "eeprom_teensy.h" +# define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) +#elif defined(EEPROM_STM32_FLASH_EMULATED) +# include "eeprom_stm32_defs.h" +# define TOTAL_EEPROM_BYTE_COUNT (FEE_DENSITY_BYTES) +#elif defined(EEPROM_SAMD) +# include "eeprom_samd.h" +# define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) +#elif defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_AT90USB162__) || defined(__AVR_ATtiny85__) +# define TOTAL_EEPROM_BYTE_COUNT 512 +#elif defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega32A__) +# define TOTAL_EEPROM_BYTE_COUNT 1024 +#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) +# define TOTAL_EEPROM_BYTE_COUNT 2048 +#elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) +# define TOTAL_EEPROM_BYTE_COUNT 4096 +#elif defined(EEPROM_TEST_HARNESS) +# ifndef FLASH_STM32_MOCKED +// Normal tests +# define TOTAL_EEPROM_BYTE_COUNT 32 +# else +// Flash wear-leveling testing +# include "eeprom_stm32_tests.h" +# define TOTAL_EEPROM_BYTE_COUNT (EEPROM_SIZE) +# endif +#else +# error Unknown EEPROM driver. +#endif diff --git a/platforms/suspend.c b/platforms/suspend.c new file mode 100644 index 000000000000..fea23cbd02b4 --- /dev/null +++ b/platforms/suspend.c @@ -0,0 +1,51 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "suspend.h" +#include "matrix.h" + +// TODO: Move to more correct location +__attribute__((weak)) void matrix_power_up(void) {} +__attribute__((weak)) void matrix_power_down(void) {} + +/** \brief Run user level Power down + * + * FIXME: needs doc + */ +__attribute__((weak)) void suspend_power_down_user(void) {} + +/** \brief Run keyboard level Power down + * + * FIXME: needs doc + */ +__attribute__((weak)) void suspend_power_down_kb(void) { + suspend_power_down_user(); +} + +/** \brief run user level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__((weak)) void suspend_wakeup_init_user(void) {} + +/** \brief run keyboard level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__((weak)) void suspend_wakeup_init_kb(void) { + suspend_wakeup_init_user(); +} + +/** \brief suspend wakeup condition + * + * FIXME: needs doc + */ +bool suspend_wakeup_condition(void) { + matrix_power_up(); + matrix_scan(); + matrix_power_down(); + for (uint8_t r = 0; r < MATRIX_ROWS; r++) { + if (matrix_get_row(r)) return true; + } + return false; +} diff --git a/platforms/suspend.h b/platforms/suspend.h index 081735f90e35..e4f7f39ddb83 100644 --- a/platforms/suspend.h +++ b/platforms/suspend.h @@ -3,7 +3,6 @@ #include #include -void suspend_idle(uint8_t timeout); void suspend_power_down(void); bool suspend_wakeup_condition(void); void suspend_wakeup_init(void); diff --git a/platforms/test/bootloader.c b/platforms/test/bootloaders/none.c similarity index 100% rename from platforms/test/bootloader.c rename to platforms/test/bootloaders/none.c diff --git a/platforms/test/eeprom.c b/platforms/test/eeprom.c index 5c8e69dae330..d501745e5579 100644 --- a/platforms/test/eeprom.c +++ b/platforms/test/eeprom.c @@ -16,9 +16,7 @@ #include "eeprom.h" -#define EEPROM_SIZE 32 - -static uint8_t buffer[EEPROM_SIZE]; +static uint8_t buffer[TOTAL_EEPROM_BYTE_COUNT]; uint8_t eeprom_read_byte(const uint8_t *addr) { uintptr_t offset = (uintptr_t)addr; @@ -70,7 +68,9 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) { } } -void eeprom_update_byte(uint8_t *addr, uint8_t value) { eeprom_write_byte(addr, value); } +void eeprom_update_byte(uint8_t *addr, uint8_t value) { + eeprom_write_byte(addr, value); +} void eeprom_update_word(uint16_t *addr, uint16_t value) { uint8_t *p = (uint8_t *)addr; diff --git a/platforms/test/eeprom_stm32_tests.cpp b/platforms/test/eeprom_stm32_tests.cpp index 5bc8d87900e1..d2c41fb77dfb 100644 --- a/platforms/test/eeprom_stm32_tests.cpp +++ b/platforms/test/eeprom_stm32_tests.cpp @@ -17,8 +17,6 @@ #include "gtest/gtest.h" extern "C" { -#include "flash_stm32.h" -#include "eeprom_stm32.h" #include "eeprom.h" } @@ -46,7 +44,6 @@ extern "C" { * */ -#define EEPROM_SIZE (FEE_PAGE_SIZE * FEE_PAGE_COUNT / 2) #define LOG_SIZE EEPROM_SIZE #define LOG_BASE (MOCK_FLASH_SIZE - LOG_SIZE) #define EEPROM_BASE (LOG_BASE - EEPROM_SIZE) @@ -63,7 +60,9 @@ class EepromStm32Test : public testing::Test { ~EepromStm32Test() {} protected: - void SetUp() override { EEPROM_Erase(); } + void SetUp() override { + EEPROM_Erase(); + } void TearDown() override { #ifdef EEPROM_DEBUG @@ -86,7 +85,7 @@ TEST_F(EepromStm32Test, TestReadGarbage) { garbage += i; FlashBuf[i] = garbage; } - EEPROM_Init(); // Just verify we don't crash + EEPROM_Init(); // Just verify we don't crash } TEST_F(EepromStm32Test, TestWriteBadAddress) { @@ -209,11 +208,11 @@ TEST_F(EepromStm32Test, TestReadWord) { TEST_F(EepromStm32Test, TestWriteWord) { /* Direct compacted-area: Address < 0x80 */ - EEPROM_WriteDataWord(0, 0xdead); // Aligned - EEPROM_WriteDataWord(3, 0xbeef); // Unaligned + EEPROM_WriteDataWord(0, 0xdead); // Aligned + EEPROM_WriteDataWord(3, 0xbeef); // Unaligned /* Direct compacted-area: Address >= 0x80 */ - EEPROM_WriteDataWord(200, 0xabcd); // Aligned - EEPROM_WriteDataWord(203, 0x9876); // Unaligned + EEPROM_WriteDataWord(200, 0xabcd); // Aligned + EEPROM_WriteDataWord(203, 0x9876); // Unaligned EEPROM_WriteDataWord(EEPROM_SIZE - 4, 0x1234); EEPROM_WriteDataWord(EEPROM_SIZE - 2, 0x5678); /* Write Log word zero-encoded */ @@ -221,10 +220,10 @@ TEST_F(EepromStm32Test, TestWriteWord) { /* Write Log word one-encoded */ EEPROM_WriteDataWord(EEPROM_SIZE - 2, 1); /* Write Log word value aligned */ - EEPROM_WriteDataWord(200, 0x4321); // Aligned + EEPROM_WriteDataWord(200, 0x4321); // Aligned /* Write Log word value unaligned */ - EEPROM_WriteDataByte(202, 0x3c); // Set neighboring byte - EEPROM_WriteDataWord(203, 0xcdef); // Unaligned + EEPROM_WriteDataByte(202, 0x3c); // Set neighboring byte + EEPROM_WriteDataWord(203, 0xcdef); // Unaligned /* Check values */ /* Direct compacted-area */ EXPECT_EQ(*(uint16_t*)&FlashBuf[EEPROM_BASE], (uint16_t)~0xdead); @@ -252,11 +251,11 @@ TEST_F(EepromStm32Test, TestWriteWord) { TEST_F(EepromStm32Test, TestWordRoundTrip) { /* Direct compacted-area: Address < 0x80 */ - EEPROM_WriteDataWord(0, 0xdead); // Aligned - EEPROM_WriteDataWord(3, 0xbeef); // Unaligned + EEPROM_WriteDataWord(0, 0xdead); // Aligned + EEPROM_WriteDataWord(3, 0xbeef); // Unaligned /* Direct compacted-area: Address >= 0x80 */ - EEPROM_WriteDataWord(200, 0xabcd); // Aligned - EEPROM_WriteDataWord(203, 0x9876); // Unaligned + EEPROM_WriteDataWord(200, 0xabcd); // Aligned + EEPROM_WriteDataWord(203, 0x9876); // Unaligned EEPROM_WriteDataWord(EEPROM_SIZE - 4, 0x1234); EEPROM_WriteDataWord(EEPROM_SIZE - 2, 0x5678); /* Check values */ @@ -273,10 +272,10 @@ TEST_F(EepromStm32Test, TestWordRoundTrip) { /* Write Log word one-encoded */ EEPROM_WriteDataWord(EEPROM_SIZE - 2, 1); /* Write Log word value aligned */ - EEPROM_WriteDataWord(200, 0x4321); // Aligned + EEPROM_WriteDataWord(200, 0x4321); // Aligned /* Write Log word value unaligned */ - EEPROM_WriteDataByte(202, 0x3c); // Set neighboring byte - EEPROM_WriteDataWord(203, 0xcdef); // Unaligned + EEPROM_WriteDataByte(202, 0x3c); // Set neighboring byte + EEPROM_WriteDataWord(203, 0xcdef); // Unaligned /* Check values */ EEPROM_Init(); EXPECT_EQ(EEPROM_ReadDataWord(200), 0x4321); @@ -327,34 +326,34 @@ TEST_F(EepromStm32Test, TestByteWordBoundary) { TEST_F(EepromStm32Test, TestDWordRoundTrip) { /* Direct compacted-area: Address < 0x80 */ - eeprom_write_dword((uint32_t*)0, 0xdeadbeef); // Aligned - eeprom_write_dword((uint32_t*)9, 0x12345678); // Unaligned + eeprom_write_dword((uint32_t*)0, 0xdeadbeef); // Aligned + eeprom_write_dword((uint32_t*)9, 0x12345678); // Unaligned /* Direct compacted-area: Address >= 0x80 */ eeprom_write_dword((uint32_t*)200, 0xfacef00d); - eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 4), 0xba5eba11); // Aligned - eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 9), 0xcafed00d); // Unaligned + eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 4), 0xba5eba11); // Aligned + eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 9), 0xcafed00d); // Unaligned /* Check direct values */ EEPROM_Init(); EXPECT_EQ(eeprom_read_dword((uint32_t*)0), 0xdeadbeef); EXPECT_EQ(eeprom_read_dword((uint32_t*)9), 0x12345678); EXPECT_EQ(eeprom_read_dword((uint32_t*)200), 0xfacef00d); - EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 4)), 0xba5eba11); // Aligned - EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 9)), 0xcafed00d); // Unaligned + EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 4)), 0xba5eba11); // Aligned + EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 9)), 0xcafed00d); // Unaligned /* Write Log byte encoded */ eeprom_write_dword((uint32_t*)0, 0xdecafbad); eeprom_write_dword((uint32_t*)9, 0x87654321); /* Write Log word encoded */ eeprom_write_dword((uint32_t*)200, 1); /* Write Log word value aligned */ - eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 4), 0xdeadc0de); // Aligned - eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 9), 0x6789abcd); // Unaligned + eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 4), 0xdeadc0de); // Aligned + eeprom_write_dword((uint32_t*)(EEPROM_SIZE - 9), 0x6789abcd); // Unaligned /* Check log values */ EEPROM_Init(); EXPECT_EQ(eeprom_read_dword((uint32_t*)0), 0xdecafbad); EXPECT_EQ(eeprom_read_dword((uint32_t*)9), 0x87654321); EXPECT_EQ(eeprom_read_dword((uint32_t*)200), 1); - EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 4)), 0xdeadc0de); // Aligned - EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 9)), 0x6789abcd); // Unaligned + EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 4)), 0xdeadc0de); // Aligned + EXPECT_EQ(eeprom_read_dword((uint32_t*)(EEPROM_SIZE - 9)), 0x6789abcd); // Unaligned } TEST_F(EepromStm32Test, TestBlockRoundTrip) { diff --git a/platforms/test/eeprom_stm32_tests.h b/platforms/test/eeprom_stm32_tests.h new file mode 100644 index 000000000000..35ed885e52ff --- /dev/null +++ b/platforms/test/eeprom_stm32_tests.h @@ -0,0 +1,8 @@ +// Copyright 2018-2022 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "flash_stm32.h" +#include "eeprom_stm32.h" + +#define EEPROM_SIZE (FEE_PAGE_SIZE * FEE_PAGE_COUNT / 2) diff --git a/platforms/test/flash_stm32_mock.c b/platforms/test/flash_stm32_mock.c index 222a004bc766..b6ab170f9525 100644 --- a/platforms/test/flash_stm32_mock.c +++ b/platforms/test/flash_stm32_mock.c @@ -44,6 +44,12 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { } } -FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) { return FLASH_COMPLETE; } -void FLASH_Unlock(void) { flash_locked = false; } -void FLASH_Lock(void) { flash_locked = true; } +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) { + return FLASH_COMPLETE; +} +void FLASH_Unlock(void) { + flash_locked = false; +} +void FLASH_Lock(void) { + flash_locked = true; +} diff --git a/platforms/test/rules.mk b/platforms/test/rules.mk index 66b853d8eeb1..55512c7392f0 100644 --- a/platforms/test/rules.mk +++ b/platforms/test/rules.mk @@ -1,4 +1,4 @@ -eeprom_stm32_DEFS := -DFLASH_STM32_MOCKED -DNO_PRINT -DFEE_FLASH_BASE=FlashBuf +eeprom_stm32_DEFS := -DEEPROM_TEST_HARNESS -DFLASH_STM32_MOCKED -DNO_PRINT -DFEE_FLASH_BASE=FlashBuf eeprom_stm32_tiny_DEFS := $(eeprom_stm32_DEFS) \ -DFEE_MCU_FLASH_SIZE=1 \ -DMOCK_FLASH_SIZE=1024 \ diff --git a/platforms/test/timer.c b/platforms/test/timer.c index 61c3a002011b..e0acd1b16d6e 100644 --- a/platforms/test/timer.c +++ b/platforms/test/timer.c @@ -18,16 +18,34 @@ static uint32_t current_time = 0; -void timer_init(void) { current_time = 0; } +void timer_init(void) { + current_time = 0; +} -void timer_clear(void) { current_time = 0; } +void timer_clear(void) { + current_time = 0; +} -uint16_t timer_read(void) { return current_time & 0xFFFF; } -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); } +uint16_t timer_read(void) { + return current_time & 0xFFFF; +} +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; } -void advance_time(uint32_t ms) { current_time += ms; } +void set_time(uint32_t t) { + current_time = t; +} +void advance_time(uint32_t ms) { + current_time += ms; +} -void wait_ms(uint32_t ms) { advance_time(ms); } +void wait_ms(uint32_t ms) { + advance_time(ms); +} diff --git a/platforms/timer.h b/platforms/timer.h index 02e39e79e797..d55f40f0b0b1 100644 --- a/platforms/timer.h +++ b/platforms/timer.h @@ -52,14 +52,22 @@ uint32_t timer_elapsed32(uint32_t last); # define TIMER_DIFF_FAST(a, b) TIMER_DIFF_16(a, b) # define timer_expired_fast(current, future) timer_expired(current, future) typedef uint16_t fast_timer_t; -fast_timer_t inline timer_read_fast(void) { return timer_read(); } -fast_timer_t inline timer_elapsed_fast(fast_timer_t last) { return timer_elapsed(last); } +fast_timer_t inline timer_read_fast(void) { + return timer_read(); +} +fast_timer_t inline timer_elapsed_fast(fast_timer_t last) { + return timer_elapsed(last); +} #else # define TIMER_DIFF_FAST(a, b) TIMER_DIFF_32(a, b) # define timer_expired_fast(current, future) timer_expired32(current, future) typedef uint32_t fast_timer_t; -fast_timer_t inline timer_read_fast(void) { return timer_read32(); } -fast_timer_t inline timer_elapsed_fast(fast_timer_t last) { return timer_elapsed32(last); } +fast_timer_t inline timer_read_fast(void) { + return timer_read32(); +} +fast_timer_t inline timer_elapsed_fast(fast_timer_t last) { + return timer_elapsed32(last); +} #endif #ifdef __cplusplus diff --git a/quantum/action.c b/quantum/action.c index 7a330b05cdf1..3efed443a30d 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -23,7 +23,6 @@ along with this program. If not, see . #include "led.h" #include "action_layer.h" #include "action_tapping.h" -#include "action_macro.h" #include "action_util.h" #include "action.h" #include "wait.h" @@ -54,14 +53,20 @@ int retro_tapping_counter = 0; #endif #ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY -__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { return false; } +__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { + return false; +} #endif #ifdef RETRO_TAPPING_PER_KEY -__attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { return false; } +__attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { + return false; +} #endif -__attribute__((weak)) bool pre_process_record_quantum(keyrecord_t *record) { return true; } +__attribute__((weak)) bool pre_process_record_quantum(keyrecord_t *record) { + return true; +} /** \brief Called to execute an action. * @@ -164,10 +169,14 @@ void process_record_nocache(keyrecord_t *record) { disable_action_cache = false; } #else -void process_record_nocache(keyrecord_t *record) { process_record(record); } +void process_record_nocache(keyrecord_t *record) { + process_record(record); +} #endif -__attribute__((weak)) bool process_record_quantum(keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_record_quantum(keyrecord_t *record) { + return true; +} __attribute__((weak)) void post_process_record_quantum(keyrecord_t *record) {} @@ -634,12 +643,7 @@ void process_action(keyrecord_t *record, action_t action) { break; # endif #endif - /* Extentions */ -#ifndef NO_ACTION_MACRO - case ACT_MACRO: - action_macro_play(action_get_macro(record, action.func.id, action.func.opt)); - break; -#endif + #ifdef SWAP_HANDS_ENABLE case ACT_SWAP_HANDS: switch (action.swap.code) { @@ -694,7 +698,7 @@ void process_action(keyrecord_t *record, action_t action) { /* tap key */ if (tap_count > 0) { if (swap_held) { - swap_hands = !swap_hands; // undo hold set up in _tap_hint + swap_hands = !swap_hands; // undo hold set up in _tap_hint swap_held = false; } if (event.pressed) { @@ -702,21 +706,16 @@ void process_action(keyrecord_t *record, action_t action) { } else { wait_ms(TAP_CODE_DELAY); unregister_code(action.swap.code); - *record = (keyrecord_t){}; // hack: reset tap mode + *record = (keyrecord_t){}; // hack: reset tap mode } } else { if (swap_held && !event.pressed) { - swap_hands = !swap_hands; // undo hold set up in _tap_hint + swap_hands = !swap_hands; // undo hold set up in _tap_hint swap_held = false; } } # endif } -#endif -#ifndef NO_ACTION_FUNCTION - case ACT_FUNCTION: - action_function(record, action.func.id, action.func.opt); - break; #endif default: break; @@ -794,7 +793,7 @@ void process_action(keyrecord_t *record, action_t action) { * * FIXME: Needs documentation. */ -void register_code(uint8_t code) { +__attribute__((weak)) void register_code(uint8_t code) { if (code == KC_NO) { return; } @@ -887,7 +886,7 @@ void register_code(uint8_t code) { * * FIXME: Needs documentation. */ -void unregister_code(uint8_t code) { +__attribute__((weak)) void unregister_code(uint8_t code) { if (code == KC_NO) { return; } @@ -948,7 +947,7 @@ void unregister_code(uint8_t code) { * \param code The basic keycode to tap. * \param delay The amount of time in milliseconds to leave the keycode registered, before unregistering it. */ -void tap_code_delay(uint8_t code, uint16_t delay) { +__attribute__((weak)) void tap_code_delay(uint8_t code, uint16_t delay) { register_code(code); for (uint16_t i = delay; i > 0; i--) { wait_ms(1); @@ -960,13 +959,15 @@ void tap_code_delay(uint8_t code, uint16_t delay) { * * \param code The basic keycode to tap. If `code` is `KC_CAPS_LOCK`, the delay will be `TAP_HOLD_CAPS_DELAY`, otherwise `TAP_CODE_DELAY`, if defined. */ -void tap_code(uint8_t code) { tap_code_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); } +__attribute__((weak)) void tap_code(uint8_t code) { + tap_code_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); +} /** \brief Adds the given physically pressed modifiers and sends a keyboard report immediately. * * \param mods A bitfield of modifiers to register. */ -void register_mods(uint8_t mods) { +__attribute__((weak)) void register_mods(uint8_t mods) { if (mods) { add_mods(mods); send_keyboard_report(); @@ -977,7 +978,7 @@ void register_mods(uint8_t mods) { * * \param mods A bitfield of modifiers to unregister. */ -void unregister_mods(uint8_t mods) { +__attribute__((weak)) void unregister_mods(uint8_t mods) { if (mods) { del_mods(mods); send_keyboard_report(); @@ -988,7 +989,7 @@ void unregister_mods(uint8_t mods) { * * \param mods A bitfield of modifiers to register. */ -void register_weak_mods(uint8_t mods) { +__attribute__((weak)) void register_weak_mods(uint8_t mods) { if (mods) { add_weak_mods(mods); send_keyboard_report(); @@ -999,7 +1000,7 @@ void register_weak_mods(uint8_t mods) { * * \param mods A bitfield of modifiers to unregister. */ -void unregister_weak_mods(uint8_t mods) { +__attribute__((weak)) void unregister_weak_mods(uint8_t mods) { if (mods) { del_weak_mods(mods); send_keyboard_report(); @@ -1034,7 +1035,6 @@ void clear_keyboard_but_mods_and_keys() { host_consumer_send(0); #endif clear_weak_mods(); - clear_macro_mods(); send_keyboard_report(); #ifdef MOUSEKEY_ENABLE mousekey_clear(); @@ -1097,12 +1097,6 @@ bool is_tap_action(action_t action) { return true; } return false; - case ACT_MACRO: - case ACT_FUNCTION: - if (action.func.opt & FUNC_TAP) { - return true; - } - return false; } return false; } @@ -1111,7 +1105,9 @@ bool is_tap_action(action_t action) { * * FIXME: Needs documentation. */ -void debug_event(keyevent_t event) { dprintf("%04X%c(%u)", (event.key.row << 8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); } +void debug_event(keyevent_t event) { + dprintf("%04X%c(%u)", (event.key.row << 8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); +} /** \brief Debug print (FIXME: Needs better description) * * FIXME: Needs documentation. @@ -1159,12 +1155,6 @@ void debug_action(action_t action) { case ACT_LAYER_TAP_EXT: dprint("ACT_LAYER_TAP_EXT"); break; - case ACT_MACRO: - dprint("ACT_MACRO"); - break; - case ACT_FUNCTION: - dprint("ACT_FUNCTION"); - break; case ACT_SWAP_HANDS: dprint("ACT_SWAP_HANDS"); break; diff --git a/quantum/action.h b/quantum/action.h index 8a357ded87b2..08e1f6ac29ae 100644 --- a/quantum/action.h +++ b/quantum/action.h @@ -19,25 +19,15 @@ along with this program. If not, see . #include #include +#include "progmem.h" #include "keyboard.h" #include "keycode.h" #include "action_code.h" -#include "action_macro.h" #ifdef __cplusplus extern "C" { #endif -/* Disable macro and function features when LTO is enabled, since they break */ -#ifdef LTO_ENABLE -# ifndef NO_ACTION_MACRO -# define NO_ACTION_MACRO -# endif -# ifndef NO_ACTION_FUNCTION -# define NO_ACTION_FUNCTION -# endif -#endif - #ifndef TAP_CODE_DELAY # define TAP_CODE_DELAY 0 #endif @@ -72,12 +62,6 @@ void action_exec(keyevent_t event); action_t action_for_key(uint8_t layer, keypos_t key); action_t action_for_keycode(uint16_t keycode); -/* macro */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); - -/* user defined special function */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); - /* keyboard-specific key event (pre)processing */ bool process_record_quantum(keyrecord_t *record); diff --git a/quantum/action_code.h b/quantum/action_code.h index eb18c36ae809..20b3e459d2a7 100644 --- a/quantum/action_code.h +++ b/quantum/action_code.h @@ -79,19 +79,6 @@ along with this program. If not, see . * 101E|LLLL|1111 0100 One Shot Layer (0xF4) [TAP] * 101E|LLLL|1111 xxxx Reserved (0xF5-FF) * ELLLL: layer 0-31(E: extra bit for layer 16-31) - * - * Extensions(11xx) - * ---------------- - * ACT_MACRO(1100): - * 1100|opt | id(8) Macro play? - * 1100|1111| id(8) Macro record? - * - * 1101|xxxx xxxx xxxx (reserved) - * 1110|xxxx xxxx xxxx (reserved) - * - * ACT_FUNCTION(1111): - * 1111| address(12) Function? - * 1111|opt | id(8) Function? */ enum action_kind_id { /* Key Actions */ @@ -111,9 +98,6 @@ enum action_kind_id { ACT_LAYER_MODS = 0b1001, ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */ ACT_LAYER_TAP_EXT = 0b1011, /* Layer 16-31 */ - /* Extensions */ - ACT_MACRO = 0b1100, - ACT_FUNCTION = 0b1111 }; /** \brief Action Code Struct @@ -164,11 +148,6 @@ typedef union { uint8_t page : 2; uint8_t kind : 4; } usage; - struct action_function { - uint8_t id : 8; - uint8_t opt : 4; - uint8_t kind : 4; - } func; struct action_swap { uint8_t code : 8; uint8_t opt : 4; @@ -275,17 +254,6 @@ enum layer_param_tap_op { #define ACTION_DEFAULT_LAYER_BIT_XOR(part, bits) ACTION_LAYER_BITOP(OP_BIT_XOR, (part), (bits), 0) #define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0) -/* Macro */ -#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) -#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP << 8 | (id)) -#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt) << 8 | (id)) -/* Function */ -enum function_opts { - FUNC_TAP = 0x8, /* indciates function is tappable */ -}; -#define ACTION_FUNCTION(id) ACTION(ACT_FUNCTION, (id)) -#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP << 8 | (id)) -#define ACTION_FUNCTION_OPT(id, opt) ACTION(ACT_FUNCTION, (opt) << 8 | (id)) /* OneHand Support */ enum swap_hands_param_tap_op { OP_SH_TOGGLE = 0xF0, diff --git a/quantum/action_layer.c b/quantum/action_layer.c index ed1a4bd20d94..e20eedee404b 100644 --- a/quantum/action_layer.c +++ b/quantum/action_layer.c @@ -18,13 +18,17 @@ layer_state_t default_layer_state = 0; * * Run user code on default layer state change */ -__attribute__((weak)) layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } +__attribute__((weak)) layer_state_t default_layer_state_set_user(layer_state_t state) { + return state; +} /** \brief Default Layer State Set At Keyboard Level * * Run keyboard code on default layer state change */ -__attribute__((weak)) layer_state_t default_layer_state_set_kb(layer_state_t state) { return default_layer_state_set_user(state); } +__attribute__((weak)) layer_state_t default_layer_state_set_kb(layer_state_t state) { + return default_layer_state_set_user(state); +} /** \brief Default Layer State Set * @@ -39,9 +43,9 @@ static void default_layer_state_set(layer_state_t state) { default_layer_debug(); debug("\n"); #ifdef STRICT_LAYER_RELEASE - clear_keyboard_but_mods(); // To avoid stuck keys + clear_keyboard_but_mods(); // To avoid stuck keys #else - clear_keyboard_but_mods_and_keys(); // Don't reset held keys + clear_keyboard_but_mods_and_keys(); // Don't reset held keys #endif } @@ -49,30 +53,40 @@ static void default_layer_state_set(layer_state_t state) { * * Print out the hex value of the 32-bit default layer state, as well as the value of the highest bit. */ -void default_layer_debug(void) { dprintf("%08lX(%u)", default_layer_state, get_highest_layer(default_layer_state)); } +void default_layer_debug(void) { + dprintf("%08lX(%u)", default_layer_state, get_highest_layer(default_layer_state)); +} /** \brief Default Layer Set * * Sets the default layer state. */ -void default_layer_set(layer_state_t state) { default_layer_state_set(state); } +void default_layer_set(layer_state_t state) { + default_layer_state_set(state); +} #ifndef NO_ACTION_LAYER /** \brief Default Layer Or * * Turns on the default layer based on matching bits between specifed layer and existing layer state */ -void default_layer_or(layer_state_t state) { default_layer_state_set(default_layer_state | state); } +void default_layer_or(layer_state_t state) { + default_layer_state_set(default_layer_state | state); +} /** \brief Default Layer And * * Turns on default layer based on matching enabled bits between specifed layer and existing layer state */ -void default_layer_and(layer_state_t state) { default_layer_state_set(default_layer_state & state); } +void default_layer_and(layer_state_t state) { + default_layer_state_set(default_layer_state & state); +} /** \brief Default Layer Xor * * Turns on default layer based on non-matching bits between specifed layer and existing layer state */ -void default_layer_xor(layer_state_t state) { default_layer_state_set(default_layer_state ^ state); } +void default_layer_xor(layer_state_t state) { + default_layer_state_set(default_layer_state ^ state); +} #endif #ifndef NO_ACTION_LAYER @@ -84,13 +98,17 @@ layer_state_t layer_state = 0; * * Runs user code on layer state change */ -__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { return state; } +__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { + return state; +} /** \brief Layer state set keyboard * * Runs keyboard code on layer state change */ -__attribute__((weak)) layer_state_t layer_state_set_kb(layer_state_t state) { return layer_state_set_user(state); } +__attribute__((weak)) layer_state_t layer_state_set_kb(layer_state_t state) { + return layer_state_set_user(state); +} /** \brief Layer state set * @@ -105,9 +123,9 @@ void layer_state_set(layer_state_t state) { layer_debug(); dprintln(); # ifdef STRICT_LAYER_RELEASE - clear_keyboard_but_mods(); // To avoid stuck keys + clear_keyboard_but_mods(); // To avoid stuck keys # else - clear_keyboard_but_mods_and_keys(); // Don't reset held keys + clear_keyboard_but_mods_and_keys(); // Don't reset held keys # endif } @@ -115,13 +133,17 @@ void layer_state_set(layer_state_t state) { * * Turn off all layers */ -void layer_clear(void) { layer_state_set(0); } +void layer_clear(void) { + layer_state_set(0); +} /** \brief Layer state is * * Return whether the given state is on (it might still be shadowed by a higher state, though) */ -bool layer_state_is(uint8_t layer) { return layer_state_cmp(layer_state, layer); } +bool layer_state_is(uint8_t layer) { + return layer_state_cmp(layer_state, layer); +} /** \brief Layer state compare * @@ -138,47 +160,63 @@ bool layer_state_cmp(layer_state_t cmp_layer_state, uint8_t layer) { * * Turns on the given layer and turn off all other layers */ -void layer_move(uint8_t layer) { layer_state_set((layer_state_t)1 << layer); } +void layer_move(uint8_t layer) { + layer_state_set((layer_state_t)1 << layer); +} /** \brief Layer on * * Turns on given layer */ -void layer_on(uint8_t layer) { layer_state_set(layer_state | ((layer_state_t)1 << layer)); } +void layer_on(uint8_t layer) { + layer_state_set(layer_state | ((layer_state_t)1 << layer)); +} /** \brief Layer off * * Turns off given layer */ -void layer_off(uint8_t layer) { layer_state_set(layer_state & ~((layer_state_t)1 << layer)); } +void layer_off(uint8_t layer) { + layer_state_set(layer_state & ~((layer_state_t)1 << layer)); +} /** \brief Layer invert * * Toggle the given layer (set it if it's unset, or unset it if it's set) */ -void layer_invert(uint8_t layer) { layer_state_set(layer_state ^ ((layer_state_t)1 << layer)); } +void layer_invert(uint8_t layer) { + layer_state_set(layer_state ^ ((layer_state_t)1 << layer)); +} /** \brief Layer or * * Turns on layers based on matching bits between specifed layer and existing layer state */ -void layer_or(layer_state_t state) { layer_state_set(layer_state | state); } +void layer_or(layer_state_t state) { + layer_state_set(layer_state | state); +} /** \brief Layer and * * Turns on layers based on matching enabled bits between specifed layer and existing layer state */ -void layer_and(layer_state_t state) { layer_state_set(layer_state & state); } +void layer_and(layer_state_t state) { + layer_state_set(layer_state & state); +} /** \brief Layer xor * * Turns on layers based on non-matching bits between specifed layer and existing layer state */ -void layer_xor(layer_state_t state) { layer_state_set(layer_state ^ state); } +void layer_xor(layer_state_t state) { + layer_state_set(layer_state ^ state); +} /** \brief Layer debug printing * * Print out the hex value of the 32-bit layer state, as well as the value of the highest bit. */ -void layer_debug(void) { dprintf("%08lX(%u)", layer_state, get_highest_layer(layer_state)); } +void layer_debug(void) { + dprintf("%08lX(%u)", layer_state, get_highest_layer(layer_state)); +} #endif #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) @@ -276,4 +314,6 @@ uint8_t layer_switch_get_layer(keypos_t key) { * * Gets action code based on key position */ -action_t layer_switch_get_action(keypos_t key) { return action_for_key(layer_switch_get_layer(key), key); } +action_t layer_switch_get_action(keypos_t key) { + return action_for_key(layer_switch_get_layer(key), key); +} diff --git a/quantum/action_macro.c b/quantum/action_macro.c deleted file mode 100644 index 92228c0ba816..000000000000 --- a/quantum/action_macro.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2013 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 . -*/ -#include "action.h" -#include "action_util.h" -#include "action_macro.h" -#include "wait.h" - -#ifdef DEBUG_ACTION -# include "debug.h" -#else -# include "nodebug.h" -#endif - -#ifndef NO_ACTION_MACRO - -# define MACRO_READ() (macro = MACRO_GET(macro_p++)) -/** \brief Action Macro Play - * - * FIXME: Needs doc - */ -void action_macro_play(const macro_t *macro_p) { - macro_t macro = END; - uint8_t interval = 0; - - if (!macro_p) return; - while (true) { - switch (MACRO_READ()) { - case KEY_DOWN: - MACRO_READ(); - dprintf("KEY_DOWN(%02X)\n", macro); - if (IS_MOD(macro)) { - add_macro_mods(MOD_BIT(macro)); - send_keyboard_report(); - } else { - register_code(macro); - } - break; - case KEY_UP: - MACRO_READ(); - dprintf("KEY_UP(%02X)\n", macro); - if (IS_MOD(macro)) { - del_macro_mods(MOD_BIT(macro)); - send_keyboard_report(); - } else { - unregister_code(macro); - } - break; - case WAIT: - MACRO_READ(); - dprintf("WAIT(%u)\n", macro); - { - uint8_t ms = macro; - while (ms--) wait_ms(1); - } - break; - case INTERVAL: - interval = MACRO_READ(); - dprintf("INTERVAL(%u)\n", interval); - break; - case 0x04 ... 0x73: - dprintf("DOWN(%02X)\n", macro); - register_code(macro); - break; - case 0x84 ... 0xF3: - dprintf("UP(%02X)\n", macro); - unregister_code(macro & 0x7F); - break; - case END: - default: - return; - } - // interval - { - uint8_t ms = interval; - while (ms--) wait_ms(1); - } - } -} -#endif diff --git a/quantum/action_macro.h b/quantum/action_macro.h deleted file mode 100644 index 685e2c6ffcfc..000000000000 --- a/quantum/action_macro.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright 2013 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 . -*/ - -#pragma once - -#include -#include "progmem.h" - -typedef uint8_t macro_t; - -#define MACRO_NONE (macro_t *)0 -#define MACRO(...) \ - ({ \ - static const macro_t __m[] PROGMEM = {__VA_ARGS__}; \ - &__m[0]; \ - }) -#define MACRO_GET(p) pgm_read_byte(p) - -// Sends press when the macro key is pressed, release when release, or tap_macro when the key has been tapped -#define MACRO_TAP_HOLD(record, press, release, tap_macro) (((record)->event.pressed) ? (((record)->tap.count <= 0 || (record)->tap.interrupted) ? (press) : MACRO_NONE) : (((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (tap_macro) : (release))) - -// Holds down the modifier mod when the macro key is held, or sends macro instead when tapped -#define MACRO_TAP_HOLD_MOD(record, macro, mod) MACRO_TAP_HOLD(record, (MACRO(D(mod), END)), MACRO(U(mod), END), macro) - -// Holds down the modifier mod when the macro key is held, or pressed a shifted key when tapped (eg: shift+3 for #) -#define MACRO_TAP_SHFT_KEY_HOLD_MOD(record, key, mod) MACRO_TAP_HOLD_MOD(record, (MACRO(I(10), D(LSFT), T(key), U(LSFT), END)), mod) - -// Momentary switch layer when held, sends macro if tapped -#define MACRO_TAP_HOLD_LAYER(record, macro, layer) \ - (((record)->event.pressed) ? (((record)->tap.count <= 0 || (record)->tap.interrupted) ? ({ \ - layer_on((layer)); \ - MACRO_NONE; \ - }) \ - : MACRO_NONE) \ - : (((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (macro) : ({ \ - layer_off((layer)); \ - MACRO_NONE; \ - }))) - -// Momentary switch layer when held, presses a shifted key when tapped (eg: shift+3 for #) -#define MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, key, layer) MACRO_TAP_HOLD_LAYER(record, MACRO(I(10), D(LSFT), T(key), U(LSFT), END), layer) - -#ifndef NO_ACTION_MACRO -void action_macro_play(const macro_t *macro_p); -#else -# define action_macro_play(macro) -#endif - -/* Macro commands - * code(0x04-73) // key down(1byte) - * code(0x04-73) | 0x80 // key up(1byte) - * { KEY_DOWN, code(0x04-0xff) } // key down(2bytes) - * { KEY_UP, code(0x04-0xff) } // key up(2bytes) - * WAIT // wait milli-seconds - * INTERVAL // set interval between macro commands - * END // stop macro execution - * - * Ideas(Not implemented): - * modifiers - * system usage - * consumer usage - * unicode usage - * function call - * conditionals - * loop - */ -enum macro_command_id { - /* 0x00 - 0x03 */ - END = 0x00, - KEY_DOWN, - KEY_UP, - - /* 0x04 - 0x73 (reserved for keycode down) */ - - /* 0x74 - 0x83 */ - WAIT = 0x74, - INTERVAL, - - /* 0x84 - 0xf3 (reserved for keycode up) */ - - /* 0xf4 - 0xff */ -}; - -/* TODO: keycode:0x04-0x73 can be handled by 1byte command else 2bytes are needed - * if keycode between 0x04 and 0x73 - * keycode / (keycode|0x80) - * else - * {KEY_DOWN, keycode} / {KEY_UP, keycode} - */ -#define DOWN(key) KEY_DOWN, (key) -#define UP(key) KEY_UP, (key) -#define TYPE(key) DOWN(key), UP(key) -#define WAIT(ms) WAIT, (ms) -#define INTERVAL(ms) INTERVAL, (ms) - -/* key down */ -#define D(key) DOWN(KC_##key) -/* key up */ -#define U(key) UP(KC_##key) -/* key type */ -#define T(key) TYPE(KC_##key) -/* wait */ -#define W(ms) WAIT(ms) -/* interval */ -#define I(ms) INTERVAL(ms) - -/* for backward comaptibility */ -#define MD(key) DOWN(KC_##key) -#define MU(key) UP(KC_##key) diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c index d2c93f85e3f5..6f8b4f8c56ae 100644 --- a/quantum/action_tapping.c +++ b/quantum/action_tapping.c @@ -26,7 +26,9 @@ uint16_t g_tapping_term = TAPPING_TERM; -__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return g_tapping_term; } +__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + return g_tapping_term; +} # ifdef TAPPING_TERM_PER_KEY # define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_record_keycode(&tapping_key, false), &tapping_key)) @@ -35,15 +37,21 @@ __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *r # endif # ifdef TAPPING_FORCE_HOLD_PER_KEY -__attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { return false; } +__attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { + return false; +} # endif # ifdef PERMISSIVE_HOLD_PER_KEY -__attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { return false; } +__attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { + return false; +} # endif # 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; } +__attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { + return false; +} # endif # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) @@ -124,7 +132,7 @@ bool process_tapping(keyrecord_t *keyp) { # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) || ( # ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(tapping_keycode, keyp) && + get_retro_tapping(tapping_keycode, &tapping_key) && # endif (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0) ) @@ -158,7 +166,7 @@ bool process_tapping(keyrecord_t *keyp) { ( ( # ifdef TAPPING_TERM_PER_KEY - get_tapping_term(tapping_keycode, keyp) + get_tapping_term(tapping_keycode, &tapping_key) # else g_tapping_term # endif @@ -166,7 +174,7 @@ bool process_tapping(keyrecord_t *keyp) { ) # ifdef PERMISSIVE_HOLD_PER_KEY - || get_permissive_hold(tapping_keycode, keyp) + || get_permissive_hold(tapping_keycode, &tapping_key) # elif defined(PERMISSIVE_HOLD) || true # endif @@ -177,7 +185,7 @@ bool process_tapping(keyrecord_t *keyp) { # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) || ( # ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(tapping_keycode, keyp) && + get_retro_tapping(tapping_keycode, &tapping_key) && # endif ( // Rolled over the two keys. @@ -188,7 +196,7 @@ bool process_tapping(keyrecord_t *keyp) { || ( IS_LT(tapping_keycode) # ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY - && get_hold_on_other_key_press(tapping_keycode, keyp) + && get_hold_on_other_key_press(tapping_keycode, &tapping_key) # endif ) # endif @@ -196,7 +204,7 @@ bool process_tapping(keyrecord_t *keyp) { || ( IS_MT(tapping_keycode) # ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - && !get_ignore_mod_tap_interrupt(tapping_keycode, keyp) + && !get_ignore_mod_tap_interrupt(tapping_keycode, &tapping_key) # endif ) # endif @@ -252,7 +260,7 @@ bool process_tapping(keyrecord_t *keyp) { tapping_key.tap.interrupted = true; # if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) # if defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) - if (get_hold_on_other_key_press(tapping_keycode, keyp)) + if (get_hold_on_other_key_press(tapping_keycode, &tapping_key)) # endif { debug("Tapping: End. No tap. Interfered by pressed key\n"); @@ -360,7 +368,7 @@ bool process_tapping(keyrecord_t *keyp) { # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) || ( # ifdef RETRO_TAPPING_PER_KEY - get_retro_tapping(tapping_keycode, keyp) && + get_retro_tapping(tapping_keycode, &tapping_key) && # endif (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0) ) @@ -373,7 +381,7 @@ bool process_tapping(keyrecord_t *keyp) { # if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY) if ( # ifdef TAPPING_FORCE_HOLD_PER_KEY - !get_tapping_force_hold(tapping_keycode, keyp) && + !get_tapping_force_hold(tapping_keycode, &tapping_key) && # endif !tapping_key.tap.interrupted && tapping_key.tap.count > 0) { // sequential tap. diff --git a/quantum/action_util.c b/quantum/action_util.c index 78e02aec185f..64a1b6b30d80 100644 --- a/quantum/action_util.c +++ b/quantum/action_util.c @@ -21,12 +21,12 @@ along with this program. If not, see . #include "action_layer.h" #include "timer.h" #include "keycode_config.h" +#include extern keymap_config_t keymap_config; -static uint8_t real_mods = 0; -static uint8_t weak_mods = 0; -static uint8_t macro_mods = 0; +static uint8_t real_mods = 0; +static uint8_t weak_mods = 0; #ifdef KEY_OVERRIDE_ENABLE static uint8_t weak_override_mods = 0; static uint8_t suppressed_mods = 0; @@ -43,8 +43,10 @@ extern inline void clear_keys(void); #ifndef NO_ACTION_ONESHOT static uint8_t oneshot_mods = 0; static uint8_t oneshot_locked_mods = 0; -uint8_t get_oneshot_locked_mods(void) { return oneshot_locked_mods; } -void set_oneshot_locked_mods(uint8_t mods) { +uint8_t get_oneshot_locked_mods(void) { + return oneshot_locked_mods; +} +void set_oneshot_locked_mods(uint8_t mods) { if (mods != oneshot_locked_mods) { oneshot_locked_mods = mods; oneshot_locked_mods_changed_kb(oneshot_locked_mods); @@ -58,9 +60,13 @@ void clear_oneshot_locked_mods(void) { } # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static uint16_t oneshot_time = 0; -bool has_oneshot_mods_timed_out(void) { return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT; } +bool has_oneshot_mods_timed_out(void) { + return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT; +} # else -bool has_oneshot_mods_timed_out(void) { return false; } +bool has_oneshot_mods_timed_out(void) { + return false; +} # endif #endif @@ -74,24 +80,32 @@ bool has_oneshot_mods_timed_out(void) { return false; } */ static int8_t oneshot_layer_data = 0; -inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; } -inline uint8_t get_oneshot_layer_state(void) { return oneshot_layer_data & 0b111; } +inline uint8_t get_oneshot_layer(void) { + return oneshot_layer_data >> 3; +} +inline uint8_t get_oneshot_layer_state(void) { + return oneshot_layer_data & 0b111; +} # ifdef SWAP_HANDS_ENABLE enum { SHO_OFF, - SHO_ACTIVE, // Swap hands button was pressed, and we didn't send any swapped keys yet - SHO_PRESSED, // Swap hands button is currently pressed - SHO_USED, // Swap hands button is still pressed, and we already sent swapped keys + SHO_ACTIVE, // Swap hands button was pressed, and we didn't send any swapped keys yet + SHO_PRESSED, // Swap hands button is currently pressed + SHO_USED, // Swap hands button is still pressed, and we already sent swapped keys } swap_hands_oneshot = SHO_OFF; # endif # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static uint16_t oneshot_layer_time = 0; -inline bool has_oneshot_layer_timed_out() { return TIMER_DIFF_16(timer_read(), oneshot_layer_time) >= ONESHOT_TIMEOUT && !(get_oneshot_layer_state() & ONESHOT_TOGGLED); } +inline bool has_oneshot_layer_timed_out() { + return TIMER_DIFF_16(timer_read(), oneshot_layer_time) >= ONESHOT_TIMEOUT && !(get_oneshot_layer_state() & ONESHOT_TOGGLED); +} # ifdef SWAP_HANDS_ENABLE static uint16_t oneshot_swaphands_time = 0; -inline bool has_oneshot_swaphands_timed_out() { return TIMER_DIFF_16(timer_read(), oneshot_swaphands_time) >= ONESHOT_TIMEOUT && (swap_hands_oneshot == SHO_ACTIVE); } +inline bool has_oneshot_swaphands_timed_out() { + return TIMER_DIFF_16(timer_read(), oneshot_swaphands_time) >= ONESHOT_TIMEOUT && (swap_hands_oneshot == SHO_ACTIVE); +} # endif # endif @@ -179,7 +193,9 @@ void clear_oneshot_layer_state(oneshot_fullfillment_t state) { * * FIXME: needs doc */ -bool is_oneshot_layer_active(void) { return get_oneshot_layer_state(); } +bool is_oneshot_layer_active(void) { + return get_oneshot_layer_state(); +} /** \brief set oneshot * @@ -198,21 +214,29 @@ void oneshot_set(bool active) { * * FIXME: needs doc */ -void oneshot_toggle(void) { oneshot_set(!keymap_config.oneshot_disable); } +void oneshot_toggle(void) { + oneshot_set(!keymap_config.oneshot_disable); +} /** \brief enable oneshot * * FIXME: needs doc */ -void oneshot_enable(void) { oneshot_set(true); } +void oneshot_enable(void) { + oneshot_set(true); +} /** \brief disable oneshot * * FIXME: needs doc */ -void oneshot_disable(void) { oneshot_set(false); } +void oneshot_disable(void) { + oneshot_set(false); +} -bool is_oneshot_enabled(void) { return keymap_config.oneshot_disable; } +bool is_oneshot_enabled(void) { + return keymap_config.oneshot_disable; +} #endif @@ -223,7 +247,6 @@ bool is_oneshot_enabled(void) { return keymap_config.oneshot_disable; } void send_keyboard_report(void) { keyboard_report->mods = real_mods; keyboard_report->mods |= weak_mods; - keyboard_report->mods |= macro_mods; #ifndef NO_ACTION_ONESHOT if (oneshot_mods) { @@ -247,110 +270,119 @@ void send_keyboard_report(void) { keyboard_report->mods |= weak_override_mods; #endif - host_keyboard_send(keyboard_report); + static report_keyboard_t last_report; + + /* Only send the report if there are changes to propagate to the host. */ + if (memcmp(keyboard_report, &last_report, sizeof(report_keyboard_t)) != 0) { + memcpy(&last_report, keyboard_report, sizeof(report_keyboard_t)); + host_keyboard_send(keyboard_report); + } } /** \brief Get mods * * FIXME: needs doc */ -uint8_t get_mods(void) { return real_mods; } +uint8_t get_mods(void) { + return real_mods; +} /** \brief add mods * * FIXME: needs doc */ -void add_mods(uint8_t mods) { real_mods |= mods; } +void add_mods(uint8_t mods) { + real_mods |= mods; +} /** \brief del mods * * FIXME: needs doc */ -void del_mods(uint8_t mods) { real_mods &= ~mods; } +void del_mods(uint8_t mods) { + real_mods &= ~mods; +} /** \brief set mods * * FIXME: needs doc */ -void set_mods(uint8_t mods) { real_mods = mods; } +void set_mods(uint8_t mods) { + real_mods = mods; +} /** \brief clear mods * * FIXME: needs doc */ -void clear_mods(void) { real_mods = 0; } +void clear_mods(void) { + real_mods = 0; +} /** \brief get weak mods * * FIXME: needs doc */ -uint8_t get_weak_mods(void) { return weak_mods; } +uint8_t get_weak_mods(void) { + return weak_mods; +} /** \brief add weak mods * * FIXME: needs doc */ -void add_weak_mods(uint8_t mods) { weak_mods |= mods; } +void add_weak_mods(uint8_t mods) { + weak_mods |= mods; +} /** \brief del weak mods * * FIXME: needs doc */ -void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; } +void del_weak_mods(uint8_t mods) { + weak_mods &= ~mods; +} /** \brief set weak mods * * FIXME: needs doc */ -void set_weak_mods(uint8_t mods) { weak_mods = mods; } +void set_weak_mods(uint8_t mods) { + weak_mods = mods; +} /** \brief clear weak mods * * FIXME: needs doc */ -void clear_weak_mods(void) { weak_mods = 0; } +void clear_weak_mods(void) { + weak_mods = 0; +} #ifdef KEY_OVERRIDE_ENABLE /** \brief set weak mods used by key overrides. DO not call this manually */ -void set_weak_override_mods(uint8_t mods) { weak_override_mods = mods; } +void set_weak_override_mods(uint8_t mods) { + weak_override_mods = mods; +} /** \brief clear weak mods used by key overrides. DO not call this manually */ -void clear_weak_override_mods(void) { weak_override_mods = 0; } +void clear_weak_override_mods(void) { + weak_override_mods = 0; +} /** \brief set suppressed mods used by key overrides. DO not call this manually */ -void set_suppressed_override_mods(uint8_t mods) { suppressed_mods = mods; } +void set_suppressed_override_mods(uint8_t mods) { + suppressed_mods = mods; +} /** \brief clear suppressed mods used by key overrides. DO not call this manually */ -void clear_suppressed_override_mods(void) { suppressed_mods = 0; } +void clear_suppressed_override_mods(void) { + suppressed_mods = 0; +} #endif -/* macro modifier */ -/** \brief get macro mods - * - * FIXME: needs doc - */ -uint8_t get_macro_mods(void) { return macro_mods; } -/** \brief add macro mods - * - * FIXME: needs doc - */ -void add_macro_mods(uint8_t mods) { macro_mods |= mods; } -/** \brief del macro mods - * - * FIXME: needs doc - */ -void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; } -/** \brief set macro mods - * - * FIXME: needs doc - */ -void set_macro_mods(uint8_t mods) { macro_mods = mods; } -/** \brief clear macro mods - * - * FIXME: needs doc - */ -void clear_macro_mods(void) { macro_mods = 0; } - #ifndef NO_ACTION_ONESHOT /** \brief get oneshot mods * * FIXME: needs doc */ -uint8_t get_oneshot_mods(void) { return oneshot_mods; } +uint8_t get_oneshot_mods(void) { + return oneshot_mods; +} void add_oneshot_mods(uint8_t mods) { if ((oneshot_mods & mods) != mods) { @@ -413,7 +445,9 @@ __attribute__((weak)) void oneshot_locked_mods_changed_user(uint8_t mods) {} * * \param mods Contains the active modifiers active after the change. */ -__attribute__((weak)) void oneshot_locked_mods_changed_kb(uint8_t mods) { oneshot_locked_mods_changed_user(mods); } +__attribute__((weak)) void oneshot_locked_mods_changed_kb(uint8_t mods) { + oneshot_locked_mods_changed_user(mods); +} /** \brief Called when the one shot modifiers have been changed. * @@ -425,7 +459,9 @@ __attribute__((weak)) void oneshot_mods_changed_user(uint8_t mods) {} * * \param mods Contains the active modifiers active after the change. */ -__attribute__((weak)) void oneshot_mods_changed_kb(uint8_t mods) { oneshot_mods_changed_user(mods); } +__attribute__((weak)) void oneshot_mods_changed_kb(uint8_t mods) { + oneshot_mods_changed_user(mods); +} /** \brief Called when the one shot layers have been changed. * @@ -437,10 +473,14 @@ __attribute__((weak)) void oneshot_layer_changed_user(uint8_t layer) {} * * \param layer Contains the layer that is toggled on, or zero when toggled off. */ -__attribute__((weak)) void oneshot_layer_changed_kb(uint8_t layer) { oneshot_layer_changed_user(layer); } +__attribute__((weak)) void oneshot_layer_changed_kb(uint8_t layer) { + oneshot_layer_changed_user(layer); +} /** \brief inspect keyboard state * * FIXME: needs doc */ -uint8_t has_anymod(void) { return bitpop(real_mods); } +uint8_t has_anymod(void) { + return bitpop(real_mods); +} diff --git a/quantum/action_util.h b/quantum/action_util.h index f2b3897ae501..6f1f09c4bd1c 100644 --- a/quantum/action_util.h +++ b/quantum/action_util.h @@ -29,11 +29,17 @@ extern report_keyboard_t *keyboard_report; void send_keyboard_report(void); /* key */ -inline void add_key(uint8_t key) { add_key_to_report(keyboard_report, key); } +inline void add_key(uint8_t key) { + add_key_to_report(keyboard_report, key); +} -inline void del_key(uint8_t key) { del_key_from_report(keyboard_report, key); } +inline void del_key(uint8_t key) { + del_key_from_report(keyboard_report, key); +} -inline void clear_keys(void) { clear_keys_from_report(keyboard_report); } +inline void clear_keys(void) { + clear_keys_from_report(keyboard_report); +} /* modifier */ uint8_t get_mods(void); @@ -49,13 +55,6 @@ void del_weak_mods(uint8_t mods); void set_weak_mods(uint8_t mods); void clear_weak_mods(void); -/* macro modifier */ -uint8_t get_macro_mods(void); -void add_macro_mods(uint8_t mods); -void del_macro_mods(uint8_t mods); -void set_macro_mods(uint8_t mods); -void clear_macro_mods(void); - /* oneshot modifier */ uint8_t get_oneshot_mods(void); void add_oneshot_mods(uint8_t mods); diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index 49bb309e80f4..c6523b908cd3 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -64,21 +64,21 @@ #ifndef AUDIO_TONE_STACKSIZE # define AUDIO_TONE_STACKSIZE 8 #endif -uint8_t active_tones = 0; // number of tones pushed onto the stack by audio_play_tone - might be more than the hardware is able to reproduce at any single time -musical_tone_t tones[AUDIO_TONE_STACKSIZE]; // stack of currently active tones +uint8_t active_tones = 0; // number of tones pushed onto the stack by audio_play_tone - might be more than the hardware is able to reproduce at any single time +musical_tone_t tones[AUDIO_TONE_STACKSIZE]; // stack of currently active tones -bool playing_melody = false; // playing a SONG? -bool playing_note = false; // or (possibly multiple simultaneous) tones -bool state_changed = false; // global flag, which is set if anything changes with the active_tones +bool playing_melody = false; // playing a SONG? +bool playing_note = false; // or (possibly multiple simultaneous) tones +bool state_changed = false; // global flag, which is set if anything changes with the active_tones // melody/SONG related state variables -float (*notes_pointer)[][2]; // SONG, an array of MUSICAL_NOTEs -uint16_t notes_count; // length of the notes_pointer array -bool notes_repeat; // PLAY_SONG or PLAY_LOOP? -uint16_t melody_current_note_duration = 0; // duration of the currently playing note from the active melody, in ms -uint8_t note_tempo = TEMPO_DEFAULT; // beats-per-minute -uint16_t current_note = 0; // index into the array at notes_pointer -bool note_resting = false; // if a short pause was introduced between two notes with the same frequency while playing a melody +float (*notes_pointer)[][2]; // SONG, an array of MUSICAL_NOTEs +uint16_t notes_count; // length of the notes_pointer array +bool notes_repeat; // PLAY_SONG or PLAY_LOOP? +uint16_t melody_current_note_duration = 0; // duration of the currently playing note from the active melody, in ms +uint8_t note_tempo = TEMPO_DEFAULT; // beats-per-minute +uint16_t current_note = 0; // index into the array at notes_pointer +bool note_resting = false; // if a short pause was introduced between two notes with the same frequency while playing a melody uint16_t last_timestamp = 0; #ifdef AUDIO_ENABLE_TONE_MULTIPLEXING @@ -86,7 +86,7 @@ uint16_t last_timestamp = 0; # define AUDIO_MAX_SIMULTANEOUS_TONES 3 # endif uint16_t tone_multiplexing_rate = AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT; -uint8_t tone_multiplexing_index_shift = 0; // offset used on active-tone array access +uint8_t tone_multiplexing_index_shift = 0; // offset used on active-tone array access #endif // provided and used by voices.c @@ -123,12 +123,12 @@ void audio_init() { eeconfig_init(); } audio_config.raw = eeconfig_read_audio(); -#else // EEPROM settings +#else // EEPROM settings audio_config.enable = true; # ifdef AUDIO_CLICKY_ON audio_config.clicky_enable = true; # endif -#endif // EEPROM settings +#endif // EEPROM settings for (uint8_t i = 0; i < AUDIO_TONE_STACKSIZE; i++) { tones[i] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0}; @@ -160,6 +160,8 @@ void audio_toggle(void) { eeconfig_update_audio(audio_config.raw); if (audio_config.enable) { audio_on_user(); + } else { + audio_off_user(); } } @@ -172,13 +174,16 @@ void audio_on(void) { void audio_off(void) { PLAY_SONG(audio_off_song); + audio_off_user(); wait_ms(100); audio_stop_all(); audio_config.enable = 0; eeconfig_update_audio(audio_config.raw); } -bool audio_is_on(void) { return (audio_config.enable != 0); } +bool audio_is_on(void) { + return (audio_config.enable != 0); +} void audio_stop_all() { if (audio_driver_stopped) { @@ -265,7 +270,7 @@ void audio_play_note(float pitch, uint16_t duration) { tones[j] = tones[j + 1]; tones[j + 1] = (musical_tone_t){.time_started = timer_read(), .pitch = pitch, .duration = duration}; } - return; // since this frequency played already, the hardware was already started + return; // since this frequency played already, the hardware was already started } } @@ -283,7 +288,7 @@ void audio_play_note(float pitch, uint16_t duration) { tones[active_tones - 1] = (musical_tone_t){.time_started = timer_read(), .pitch = pitch, .duration = duration}; // TODO: needs to be handled per note/tone -> use its timestamp instead? - voices_timer = timer_read(); // reset to zero, for the effects added by voices.c + voices_timer = timer_read(); // reset to zero, for the effects added by voices.c if (audio_driver_stopped) { audio_driver_start(); @@ -291,7 +296,9 @@ void audio_play_note(float pitch, uint16_t duration) { } } -void audio_play_tone(float pitch) { audio_play_note(pitch, 0xffff); } +void audio_play_tone(float pitch) { + audio_play_note(pitch, 0xffff); +} void audio_play_melody(float (*np)[][2], uint16_t n_count, bool n_repeat) { if (!audio_config.enable) { @@ -313,7 +320,7 @@ void audio_play_melody(float (*np)[][2], uint16_t n_count, bool n_repeat) { notes_count = n_count; notes_repeat = n_repeat; - current_note = 0; // note in the melody-array/list at note_pointer + current_note = 0; // note in the melody-array/list at note_pointer // start first note manually, which also starts the audio_driver // all following/remaining notes are played by 'audio_update_state' @@ -344,11 +351,17 @@ void audio_play_click(uint16_t delay, float pitch, uint16_t duration) { } } -bool audio_is_playing_note(void) { return playing_note; } +bool audio_is_playing_note(void) { + return playing_note; +} -bool audio_is_playing_melody(void) { return playing_melody; } +bool audio_is_playing_melody(void) { + return playing_melody; +} -uint8_t audio_get_number_of_active_tones(void) { return active_tones; } +uint8_t audio_get_number_of_active_tones(void) { + return active_tones; +} float audio_get_frequency(uint8_t tone_index) { if (tone_index >= active_tones) { @@ -367,7 +380,7 @@ float audio_get_processed_frequency(uint8_t tone_index) { #ifdef AUDIO_ENABLE_TONE_MULTIPLEXING index = index - tone_multiplexing_index_shift; - if (index < 0) // wrap around + if (index < 0) // wrap around index += active_tones; #endif @@ -393,7 +406,7 @@ bool audio_update_state(void) { last_timestamp = current_time; uint16_t previous_note = current_note; current_note++; - voices_timer = timer_read(); // reset to zero, for the effects added by voices.c + voices_timer = timer_read(); // reset to zero, for the effects added by voices.c if (current_note >= notes_count) { if (notes_repeat) { @@ -463,11 +476,11 @@ bool audio_update_state(void) { // housekeeping: stop notes that have no playtime left for (int i = 0; i < active_tones; i++) { - if ((tones[i].duration != 0xffff) // indefinitely playing notes, started by 'audio_play_tone' - && (tones[i].duration != 0) // 'uninitialized' + if ((tones[i].duration != 0xffff) // indefinitely playing notes, started by 'audio_play_tone' + && (tones[i].duration != 0) // 'uninitialized' ) { if (timer_elapsed(tones[i].time_started) >= tones[i].duration) { - audio_stop_tone(tones[i].pitch); // also sets 'state_changed=true' + audio_stop_tone(tones[i].pitch); // also sets 'state_changed=true' } } } @@ -484,9 +497,15 @@ bool audio_update_state(void) { // Tone-multiplexing functions #ifdef AUDIO_ENABLE_TONE_MULTIPLEXING -void audio_set_tone_multiplexing_rate(uint16_t rate) { tone_multiplexing_rate = rate; } -void audio_enable_tone_multiplexing(void) { tone_multiplexing_rate = AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT; } -void audio_disable_tone_multiplexing(void) { tone_multiplexing_rate = 0; } +void audio_set_tone_multiplexing_rate(uint16_t rate) { + tone_multiplexing_rate = rate; +} +void audio_enable_tone_multiplexing(void) { + tone_multiplexing_rate = AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT; +} +void audio_disable_tone_multiplexing(void) { + tone_multiplexing_rate = 0; +} void audio_increase_tone_multiplexing_rate(uint16_t change) { if ((0xffff - change) > tone_multiplexing_rate) { tone_multiplexing_rate += change; diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h index 290d461f5a16..fe23cf3ed1a8 100644 --- a/quantum/audio/audio.h +++ b/quantum/audio/audio.h @@ -54,9 +54,9 @@ typedef union { * "A musical tone is characterized by its duration, pitch, intensity (or loudness), and timbre (or quality)" */ typedef struct { - uint16_t time_started; // timestamp the tone/note was started, system time runs with 1ms resolution -> 16bit timer overflows every ~64 seconds, long enough under normal circumstances; but might be too soon for long-duration notes when the note_tempo is set to a very low value - float pitch; // aka frequency, in Hz - uint16_t duration; // in ms, converted from the musical_notes.h unit which has 64parts to a beat, factoring in the current tempo in beats-per-minute + uint16_t time_started; // timestamp the tone/note was started, system time runs with 1ms resolution -> 16bit timer overflows every ~64 seconds, long enough under normal circumstances; but might be too soon for long-duration notes when the note_tempo is set to a very low value + float pitch; // aka frequency, in Hz + uint16_t duration; // in ms, converted from the musical_notes.h unit which has 64parts to a beat, factoring in the current tempo in beats-per-minute // float intensity; // aka volume [0,1] TODO: not used at the moment; pwm drivers can't handle it // uint8_t timbre; // range: [0,100] TODO: this currently kept track of globally, should we do this per tone instead? } musical_tone_t; diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 8e80a016aa51..3e425abb4783 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -22,7 +22,7 @@ #if __has_include("user_song_list.h") # include "user_song_list.h" -#endif // if file exists +#endif // if file exists #define NO_SOUND diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 8988d827e9b8..1c08a3af366a 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -32,11 +32,17 @@ voice_type voice = AUDIO_VOICE_DEFAULT; voice_type voice = default_voice; #endif -void set_voice(voice_type v) { voice = v; } +void set_voice(voice_type v) { + voice = v; +} -void voice_iterate() { voice = (voice + 1) % number_of_voices; } +void voice_iterate() { + voice = (voice + 1) % number_of_voices; +} -void voice_deiterate() { voice = (voice - 1 + number_of_voices) % number_of_voices; } +void voice_deiterate() { + voice = (voice - 1 + number_of_voices) % number_of_voices; +} #ifdef AUDIO_VOICES float mod(float a, int b) { @@ -67,8 +73,8 @@ float voice_envelope(float frequency) { // envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz // __attribute__((unused)) uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency)); #ifdef AUDIO_VOICES - uint16_t envelope_index = timer_elapsed(voices_timer); // TODO: multiply in some factor? - uint16_t compensated_index = envelope_index / 100; // TODO: correct factor would be? + uint16_t envelope_index = timer_elapsed(voices_timer); // TODO: multiply in some factor? + uint16_t compensated_index = envelope_index / 100; // TODO: correct factor would be? #endif switch (voice) { @@ -303,7 +309,7 @@ float voice_envelope(float frequency) { // note_timbre = TIMBRE_25; // break; -#endif // AUDIO_VOICES +#endif // AUDIO_VOICES default: break; @@ -318,19 +324,31 @@ float voice_envelope(float frequency) { // TODO: where to keep track of the start-frequency? // frequency = voice_add_glissando(??, frequency); } -#endif // AUDIO_VOICES +#endif // AUDIO_VOICES return frequency; } // Vibrato functions -void voice_set_vibrato_rate(float rate) { vibrato_rate = rate; } -void voice_increase_vibrato_rate(float change) { vibrato_rate *= change; } -void voice_decrease_vibrato_rate(float change) { vibrato_rate /= change; } -void voice_set_vibrato_strength(float strength) { vibrato_strength = strength; } -void voice_increase_vibrato_strength(float change) { vibrato_strength *= change; } -void voice_decrease_vibrato_strength(float change) { vibrato_strength /= change; } +void voice_set_vibrato_rate(float rate) { + vibrato_rate = rate; +} +void voice_increase_vibrato_rate(float change) { + vibrato_rate *= change; +} +void voice_decrease_vibrato_rate(float change) { + vibrato_rate /= change; +} +void voice_set_vibrato_strength(float strength) { + vibrato_strength = strength; +} +void voice_increase_vibrato_strength(float change) { + vibrato_strength *= change; +} +void voice_decrease_vibrato_strength(float change) { + vibrato_strength /= change; +} // Timbre functions @@ -339,4 +357,6 @@ void voice_set_timbre(uint8_t timbre) { note_timbre = timbre; } } -uint8_t voice_get_timbre(void) { return note_timbre; } +uint8_t voice_get_timbre(void) { + return note_timbre; +} diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index 1f402e7e1269..fcab9db55688 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h @@ -40,7 +40,7 @@ typedef enum { // duty_third_down, // duty_fifth_third_down, #endif - number_of_voices // important that this is last + number_of_voices // important that this is last } voice_type; void set_voice(voice_type v); diff --git a/quantum/backlight/backlight.c b/quantum/backlight/backlight.c index dfb98419e6c9..52ec086bb093 100644 --- a/quantum/backlight/backlight.c +++ b/quantum/backlight/backlight.c @@ -95,10 +95,10 @@ void backlight_toggle(void) { * FIXME: needs doc */ void backlight_enable(void) { - if (backlight_config.enable) return; // do nothing if backlight is already on + if (backlight_config.enable) return; // do nothing if backlight is already on backlight_config.enable = true; - if (backlight_config.raw == 1) // enabled but level == 0 + if (backlight_config.raw == 1) // enabled but level == 0 backlight_config.level = 1; eeconfig_update_backlight(backlight_config.raw); dprintf("backlight enable\n"); @@ -110,7 +110,7 @@ void backlight_enable(void) { * FIXME: needs doc */ void backlight_disable(void) { - if (!backlight_config.enable) return; // do nothing if backlight is already off + if (!backlight_config.enable) return; // do nothing if backlight is already off backlight_config.enable = false; eeconfig_update_backlight(backlight_config.raw); @@ -122,7 +122,9 @@ void backlight_disable(void) { * * FIXME: needs doc */ -bool is_backlight_enabled(void) { return backlight_config.enable; } +bool is_backlight_enabled(void) { + return backlight_config.enable; +} /** \brief Backlight step through levels * @@ -158,11 +160,17 @@ void backlight_level(uint8_t level) { eeconfig_update_backlight(backlight_config.raw); } -uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } +uint8_t eeconfig_read_backlight(void) { + return eeprom_read_byte(EECONFIG_BACKLIGHT); +} -void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); } +void eeconfig_update_backlight(uint8_t val) { + eeprom_update_byte(EECONFIG_BACKLIGHT, val); +} -void eeconfig_update_backlight_current(void) { eeconfig_update_backlight(backlight_config.raw); } +void eeconfig_update_backlight_current(void) { + eeconfig_update_backlight(backlight_config.raw); +} void eeconfig_update_backlight_default(void) { backlight_config.enable = 1; @@ -179,7 +187,9 @@ void eeconfig_update_backlight_default(void) { * * FIXME: needs doc */ -uint8_t get_backlight_level(void) { return backlight_config.level; } +uint8_t get_backlight_level(void) { + return backlight_config.level; +} #ifdef BACKLIGHT_BREATHING /** \brief Backlight breathing toggle @@ -200,7 +210,7 @@ void backlight_toggle_breathing(void) { * FIXME: needs doc */ void backlight_enable_breathing(void) { - if (backlight_config.breathing) return; // do nothing if breathing is already on + if (backlight_config.breathing) return; // do nothing if breathing is already on backlight_config.breathing = true; eeconfig_update_backlight(backlight_config.raw); @@ -213,7 +223,7 @@ void backlight_enable_breathing(void) { * FIXME: needs doc */ void backlight_disable_breathing(void) { - if (!backlight_config.breathing) return; // do nothing if breathing is already off + if (!backlight_config.breathing) return; // do nothing if breathing is already off backlight_config.breathing = false; eeconfig_update_backlight(backlight_config.raw); @@ -225,18 +235,30 @@ void backlight_disable_breathing(void) { * * FIXME: needs doc */ -bool is_backlight_breathing(void) { return backlight_config.breathing; } +bool is_backlight_breathing(void) { + return backlight_config.breathing; +} // following are marked as weak purely for backwards compatibility -__attribute__((weak)) void breathing_period_set(uint8_t value) { breathing_period = value ? value : 1; } +__attribute__((weak)) void breathing_period_set(uint8_t value) { + breathing_period = value ? value : 1; +} -__attribute__((weak)) uint8_t get_breathing_period(void) { return breathing_period; } +__attribute__((weak)) uint8_t get_breathing_period(void) { + return breathing_period; +} -__attribute__((weak)) void breathing_period_default(void) { breathing_period_set(BREATHING_PERIOD); } +__attribute__((weak)) void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} -__attribute__((weak)) void breathing_period_inc(void) { breathing_period_set(breathing_period + 1); } +__attribute__((weak)) void breathing_period_inc(void) { + breathing_period_set(breathing_period + 1); +} -__attribute__((weak)) void breathing_period_dec(void) { breathing_period_set(breathing_period - 1); } +__attribute__((weak)) void breathing_period_dec(void) { + breathing_period_set(breathing_period - 1); +} __attribute__((weak)) void breathing_toggle(void) { if (is_breathing()) diff --git a/quantum/backlight/backlight.h b/quantum/backlight/backlight.h index c30c70fd6266..ff9c8de420ce 100644 --- a/quantum/backlight/backlight.h +++ b/quantum/backlight/backlight.h @@ -39,7 +39,7 @@ typedef union { struct { bool enable : 1; bool breathing : 1; - uint8_t reserved : 1; // Reserved for possible future backlight modes + uint8_t reserved : 1; // Reserved for possible future backlight modes uint8_t level : 5; }; } backlight_config_t; diff --git a/quantum/backlight/backlight_avr.c b/quantum/backlight/backlight_avr.c index 9c972ae02eda..f3a025227001 100644 --- a/quantum/backlight/backlight_avr.c +++ b/quantum/backlight/backlight_avr.c @@ -136,7 +136,7 @@ # define TCCRxB TCCR1B # define TIMERx_COMPA_vect TIMER1_COMPA_vect # define TIMERx_OVF_vect TIMER1_OVF_vect -# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register +# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register # define TIMSKx TIMSK # else # define TIMSKx TIMSK1 @@ -166,7 +166,7 @@ error("Please set 'BACKLIGHT_DRIVER = custom' within rules.mk") error("Please set 'BACKLIGHT_DRIVER = software' within rules.mk") #endif -#ifndef BACKLIGHT_PWM_TIMER // pwm through software +#ifndef BACKLIGHT_PWM_TIMER // pwm through software static inline void enable_pwm(void) { # if BACKLIGHT_ON_STATE == 1 @@ -203,7 +203,9 @@ static inline void disable_pwm(void) { // or F_CPU/BACKLIGHT_CUSTOM_RESOLUTION if used. // Triggered when the counter reaches the OCRx value -ISR(TIMERx_COMPA_vect) { backlight_pins_off(); } +ISR(TIMERx_COMPA_vect) { + backlight_pins_off(); +} // Triggered when the counter reaches the TOP value // this one triggers at F_CPU/ICRx = 16MHz/65536 =~ 244 Hz @@ -232,15 +234,15 @@ ISR(TIMERx_OVF_vect) { // See http://jared.geek.nz/2013/feb/linear-led-pwm static uint16_t cie_lightness(uint16_t v) { - if (v <= (uint32_t)ICRx / 12) // If the value is less than or equal to ~8% of max + if (v <= (uint32_t)ICRx / 12) // If the value is less than or equal to ~8% of max { - return v / 9; // Same as dividing by 900% + return v / 9; // Same as dividing by 900% } else { // In the next two lines values are bit-shifted. This is to avoid loosing decimals in integer math. - uint32_t y = (((uint32_t)v + (uint32_t)ICRx / 6) << 5) / ((uint32_t)ICRx / 6 + ICRx); // If above 8%, add ~16% of max, and normalize with (max + ~16% max) - uint32_t out = (y * y * y * ICRx) >> 15; // Cube it and undo the bit-shifting. (which is now three times as much due to the cubing) + uint32_t y = (((uint32_t)v + (uint32_t)ICRx / 6) << 5) / ((uint32_t)ICRx / 6 + ICRx); // If above 8%, add ~16% of max, and normalize with (max + ~16% max) + uint32_t out = (y * y * y * ICRx) >> 15; // Cube it and undo the bit-shifting. (which is now three times as much due to the cubing) - if (out > ICRx) // Avoid overflows + if (out > ICRx) // Avoid overflows { out = ICRx; } @@ -249,10 +251,14 @@ static uint16_t cie_lightness(uint16_t v) { } // rescale the supplied backlight value to be in terms of the value limit // range for val is [0..ICRx]. PWM pin is high while the timer count is below val. -static uint32_t rescale_limit_val(uint32_t val) { return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; } +static uint32_t rescale_limit_val(uint32_t val) { + return (val * (BACKLIGHT_LIMIT_VAL + 1)) / 256; +} // range for val is [0..ICRx]. PWM pin is high while the timer count is below val. -static inline void set_pwm(uint16_t val) { OCRxx = val; } +static inline void set_pwm(uint16_t val) { + OCRxx = val; +} void backlight_set(uint8_t level) { if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; @@ -303,7 +309,9 @@ static uint16_t breathing_freq_scale_factor = 2; # ifdef BACKLIGHT_PWM_TIMER static bool breathing = false; -bool is_breathing(void) { return breathing; } +bool is_breathing(void) { + return breathing; +} # define breathing_interrupt_enable() \ do { \ @@ -315,7 +323,9 @@ bool is_breathing(void) { return breathing; } } while (0) # else -bool is_breathing(void) { return !!(TIMSKx & _BV(TOIEx)); } +bool is_breathing(void) { + return !!(TIMSKx & _BV(TOIEx)); +} # define breathing_interrupt_enable() \ do { \ @@ -370,7 +380,9 @@ void breathing_self_disable(void) { static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Use this before the cie_lightness function. -static inline uint16_t scale_backlight(uint16_t v) { return v / BACKLIGHT_LEVELS * get_backlight_level(); } +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} # ifdef BACKLIGHT_PWM_TIMER void breathing_task(void) @@ -403,7 +415,7 @@ ISR(TIMERx_OVF_vect) set_pwm(cie_lightness(rescale_limit_val(scale_backlight((uint16_t)pgm_read_byte(&breathing_table[index]) * ICRx / 255)))); } -#endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_BREATHING void backlight_init_ports(void) { // Setup backlight pin as output and output to on state. @@ -415,10 +427,10 @@ void backlight_init_ports(void) { #ifdef BACKLIGHT_PWM_TIMER // TimerX setup, Fast PWM mode count to TOP set in ICRx - TCCRxA = _BV(WGM11); // = 0b00000010; + TCCRxA = _BV(WGM11); // = 0b00000010; // clock select clk/1 - TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; -#else // hardware PWM + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; +#else // hardware PWM // Pin PB7 = OCR1C (Timer 1, Channel C) // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 // (i.e. start high, go low when counter matches.) @@ -430,8 +442,8 @@ void backlight_init_ports(void) { "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." */ - TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; - TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + TCCRxA = _BV(COMxx1) | _BV(WGM11); // = 0b00001010; + TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; #endif #ifdef BACKLIGHT_CUSTOM_RESOLUTION diff --git a/quantum/backlight/backlight_chibios.c b/quantum/backlight/backlight_chibios.c index 7c6edd10d6eb..e8f9e70f782b 100644 --- a/quantum/backlight/backlight_chibios.c +++ b/quantum/backlight/backlight_chibios.c @@ -53,14 +53,14 @@ static PWMConfig pwmCFG = {0xFFFF, /* PWM clock frequency */ // See http://jared.geek.nz/2013/feb/linear-led-pwm static uint16_t cie_lightness(uint16_t v) { - if (v <= 5243) // if below 8% of max - return v / 9; // same as dividing by 900% + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% else { - uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare // to get a useful result with integer division, we shift left in the expression above // and revert what we've done again after squaring. y = y * y * y >> 8; - if (y > 0xFFFFUL) // prevent overflow + if (y > 0xFFFFUL) // prevent overflow return 0xFFFFU; else return (uint16_t)y; @@ -117,7 +117,9 @@ static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, void breathing_callback(PWMDriver *pwmp); -bool is_breathing(void) { return pwmCFG.callback != NULL; } +bool is_breathing(void) { + return pwmCFG.callback != NULL; +} void breathing_enable(void) { pwmCFG.callback = breathing_callback; @@ -133,7 +135,9 @@ void breathing_disable(void) { } // Use this before the cie_lightness function. -static inline uint16_t scale_backlight(uint16_t v) { return v / BACKLIGHT_LEVELS * get_backlight_level(); } +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} void breathing_callback(PWMDriver *pwmp) { uint8_t breathing_period = get_breathing_period(); diff --git a/quantum/backlight/backlight_driver_common.c b/quantum/backlight/backlight_driver_common.c index 270a43c67e63..e4c2e90b5fd0 100644 --- a/quantum/backlight/backlight_driver_common.c +++ b/quantum/backlight/backlight_driver_common.c @@ -44,6 +44,10 @@ void backlight_pins_init(void) { FOR_EACH_LED(setPinOutput(backlight_pin); backlight_off(backlight_pin);) } -void backlight_pins_on(void) { FOR_EACH_LED(backlight_on(backlight_pin);) } +void backlight_pins_on(void) { + FOR_EACH_LED(backlight_on(backlight_pin);) +} -void backlight_pins_off(void) { FOR_EACH_LED(backlight_off(backlight_pin);) } +void backlight_pins_off(void) { + FOR_EACH_LED(backlight_off(backlight_pin);) +} diff --git a/quantum/backlight/backlight_software.c b/quantum/backlight/backlight_software.c index 709304f55929..3d412cab5214 100644 --- a/quantum/backlight/backlight_software.c +++ b/quantum/backlight/backlight_software.c @@ -30,11 +30,17 @@ static const uint16_t backlight_duty_table[] = { // clang-format on -static uint8_t scale_backlight(uint8_t v) { return v * (backlight_duty_table_size - 1) / BACKLIGHT_LEVELS; } +static uint8_t scale_backlight(uint8_t v) { + return v * (backlight_duty_table_size - 1) / BACKLIGHT_LEVELS; +} -void backlight_init_ports(void) { backlight_pins_init(); } +void backlight_init_ports(void) { + backlight_pins_init(); +} -void backlight_set(uint8_t level) { s_duty_pattern = backlight_duty_table[scale_backlight(level)]; } +void backlight_set(uint8_t level) { + s_duty_pattern = backlight_duty_table[scale_backlight(level)]; +} void backlight_task(void) { static uint8_t backlight_tick = 0; diff --git a/quantum/backlight/backlight_timer.c b/quantum/backlight/backlight_timer.c index c32c35c1543a..82fb6a6a83e7 100644 --- a/quantum/backlight/backlight_timer.c +++ b/quantum/backlight/backlight_timer.c @@ -14,14 +14,14 @@ static uint16_t backlight_timer_get_duty(void); // See http://jared.geek.nz/2013/feb/linear-led-pwm static uint16_t cie_lightness(uint16_t v) { - if (v <= 5243) // if below 8% of max - return v / 9; // same as dividing by 900% + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% else { - uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare // to get a useful result with integer division, we shift left in the expression above // and revert what we've done again after squaring. y = y * y * y >> 8; - if (y > 0xFFFFUL) // prevent overflow + if (y > 0xFFFFUL) // prevent overflow return 0xFFFFU; else return (uint16_t)y; @@ -61,7 +61,9 @@ static void backlight_timer_top(void) { } } -static void backlight_timer_cmp(void) { backlight_pins_off(); } +static void backlight_timer_cmp(void) { + backlight_pins_off(); +} void backlight_task(void) {} @@ -77,7 +79,9 @@ static uint16_t breathing_counter = 0; static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Use this before the cie_lightness function. -static inline uint16_t scale_backlight(uint16_t v) { return v / BACKLIGHT_LEVELS * get_backlight_level(); } +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} void breathing_task(void) { uint8_t breathing_period = get_breathing_period(); @@ -91,13 +95,17 @@ void breathing_task(void) { backlight_timer_set_duty(cie_lightness(scale_backlight((uint16_t)breathing_table[index] * 256))); } -bool is_breathing(void) { return breathing; } +bool is_breathing(void) { + return breathing; +} void breathing_enable(void) { breathing_counter = 0; breathing = true; } -void breathing_disable(void) { breathing = false; } +void breathing_disable(void) { + breathing = false; +} void breathing_pulse(void) { backlight_set(is_backlight_enabled() ? 0 : BACKLIGHT_LEVELS); @@ -140,8 +148,12 @@ static void timerCallback(void) { } } -static void backlight_timer_set_duty(uint16_t duty) { s_duty = duty; } -static uint16_t backlight_timer_get_duty(void) { return s_duty; } +static void backlight_timer_set_duty(uint16_t duty) { + s_duty = duty; +} +static uint16_t backlight_timer_get_duty(void) { + return s_duty; +} // ChibiOS - Map GPT timer onto Software PWM static void gptTimerCallback(GPTDriver *gptp) { diff --git a/quantum/bitwise.c b/quantum/bitwise.c index 861cca0054fb..1868e1493232 100644 --- a/quantum/bitwise.c +++ b/quantum/bitwise.c @@ -20,7 +20,8 @@ along with this program. If not, see . // bit population - return number of on-bit __attribute__((noinline)) uint8_t bitpop(uint8_t bits) { uint8_t c; - for (c = 0; bits; c++) bits &= bits - 1; + for (c = 0; bits; c++) + bits &= bits - 1; return c; /* const uint8_t bit_count[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; @@ -30,13 +31,15 @@ __attribute__((noinline)) uint8_t bitpop(uint8_t bits) { uint8_t bitpop16(uint16_t bits) { uint8_t c; - for (c = 0; bits; c++) bits &= bits - 1; + for (c = 0; bits; c++) + bits &= bits - 1; return c; } uint8_t bitpop32(uint32_t bits) { uint8_t c; - for (c = 0; bits; c++) bits &= bits - 1; + for (c = 0; bits; c++) + bits &= bits - 1; return c; } diff --git a/quantum/bootmagic/bootmagic_lite.c b/quantum/bootmagic/bootmagic_lite.c index 54bbf5a2ee76..f63c71fc6b16 100644 --- a/quantum/bootmagic/bootmagic_lite.c +++ b/quantum/bootmagic/bootmagic_lite.c @@ -19,7 +19,9 @@ * * ...just incase someone wants to only change the eeprom behaviour */ -__attribute__((weak)) void bootmagic_lite_reset_eeprom(void) { eeconfig_disable(); } +__attribute__((weak)) void bootmagic_lite_reset_eeprom(void) { + eeconfig_disable(); +} /** \brief The lite version of TMK's bootmagic based on Wilba. * @@ -57,4 +59,6 @@ __attribute__((weak)) void bootmagic_lite(void) { } } -void bootmagic(void) { bootmagic_lite(); } +void bootmagic(void) { + bootmagic_lite(); +} diff --git a/quantum/color.c b/quantum/color.c index 1c5128e4a2b0..c80078dbf215 100644 --- a/quantum/color.c +++ b/quantum/color.c @@ -104,7 +104,9 @@ RGB hsv_to_rgb(HSV hsv) { #endif } -RGB hsv_to_rgb_nocie(HSV hsv) { return hsv_to_rgb_impl(hsv, false); } +RGB hsv_to_rgb_nocie(HSV hsv) { + return hsv_to_rgb_impl(hsv, false); +} #ifdef RGBW # ifndef MIN diff --git a/quantum/color.h b/quantum/color.h index e2cfc469275e..135ad623b552 100644 --- a/quantum/color.h +++ b/quantum/color.h @@ -60,7 +60,7 @@ #define HSV_GOLDENROD 30, 218, 218 #define HSV_GREEN 85, 255, 255 #define HSV_MAGENTA 213, 255, 255 -#define HSV_ORANGE 28, 255, 255 +#define HSV_ORANGE 21, 255, 255 #define HSV_PINK 234, 128, 255 #define HSV_PURPLE 191, 255, 255 #define HSV_RED 0, 255, 255 diff --git a/quantum/command.c b/quantum/command.c index 6d56a25ea114..f90d73207c3e 100644 --- a/quantum/command.c +++ b/quantum/command.c @@ -446,7 +446,7 @@ static bool command_common(uint8_t code) { // NKRO toggle case MAGIC_KC(MAGIC_KEY_NKRO): - clear_keyboard(); // clear to prevent stuck keys + clear_keyboard(); // clear to prevent stuck keys keymap_config.nkro = !keymap_config.nkro; if (keymap_config.nkro) { print("NKRO: on\n"); diff --git a/quantum/debounce.h b/quantum/debounce.h index 5043868289bc..3532d9cd7b79 100644 --- a/quantum/debounce.h +++ b/quantum/debounce.h @@ -6,8 +6,6 @@ // changed is true if raw has changed since the last call void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed); -bool debounce_active(void); - void debounce_init(uint8_t num_rows); void debounce_free(void); diff --git a/quantum/debounce/asym_eager_defer_pk.c b/quantum/debounce/asym_eager_defer_pk.c index 81f39383c4fc..b1eb4a2b7be7 100644 --- a/quantum/debounce/asym_eager_defer_pk.c +++ b/quantum/debounce/asym_eager_defer_pk.c @@ -165,7 +165,6 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui } } -bool debounce_active(void) { return true; } #else # include "none.c" #endif diff --git a/quantum/debounce/none.c b/quantum/debounce/none.c index b03892bc5b51..8a85cc04a8d0 100644 --- a/quantum/debounce/none.c +++ b/quantum/debounce/none.c @@ -26,6 +26,4 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool } } -bool debounce_active(void) { return false; } - void debounce_free(void) {} diff --git a/quantum/debounce/sym_defer_g.c b/quantum/debounce/sym_defer_g.c index 9155eb914cb5..47450992a492 100644 --- a/quantum/debounce/sym_defer_g.c +++ b/quantum/debounce/sym_defer_g.c @@ -44,9 +44,7 @@ void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool } } -bool debounce_active(void) { return debouncing; } - void debounce_free(void) {} -#else // no debouncing. +#else // no debouncing. # include "none.c" #endif diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c index 1b698ba347d4..9dee29e28e65 100644 --- a/quantum/debounce/sym_defer_pk.c +++ b/quantum/debounce/sym_defer_pk.c @@ -134,7 +134,6 @@ static void start_debounce_counters(matrix_row_t raw[], matrix_row_t cooked[], u } } -bool debounce_active(void) { return true; } #else # include "none.c" #endif diff --git a/quantum/debounce/sym_defer_pr.c b/quantum/debounce/sym_defer_pr.c new file mode 100644 index 000000000000..ce24f0922fea --- /dev/null +++ b/quantum/debounce/sym_defer_pr.c @@ -0,0 +1,74 @@ +/* +Copyright 2021 Chad Austin +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 . +*/ + +/* +Symmetric per-row debounce algorithm. Changes only apply when +DEBOUNCE milliseconds have elapsed since the last change. +*/ + +#include "matrix.h" +#include "timer.h" +#include "quantum.h" +#include + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint16_t last_time; +// [row] milliseconds until key's state is considered debounced. +static uint8_t* countdowns; +// [row] +static matrix_row_t* last_raw; + +void debounce_init(uint8_t num_rows) { + countdowns = (uint8_t*)calloc(num_rows, sizeof(uint8_t)); + last_raw = (matrix_row_t*)calloc(num_rows, sizeof(matrix_row_t)); + + last_time = timer_read(); +} + +void debounce_free(void) { + free(countdowns); + countdowns = NULL; + free(last_raw); + last_raw = NULL; +} + +void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) { + uint16_t now = timer_read(); + uint16_t elapsed16 = TIMER_DIFF_16(now, last_time); + last_time = now; + uint8_t elapsed = (elapsed16 > 255) ? 255 : elapsed16; + + uint8_t* countdown = countdowns; + + for (uint8_t row = 0; row < num_rows; ++row, ++countdown) { + matrix_row_t raw_row = raw[row]; + + if (raw_row != last_raw[row]) { + *countdown = DEBOUNCE; + last_raw[row] = raw_row; + } else if (*countdown > elapsed) { + *countdown -= elapsed; + } else if (*countdown) { + cooked[row] = raw_row; + *countdown = 0; + } + } +} + +bool debounce_active(void) { + return true; +} diff --git a/quantum/debounce/sym_eager_pk.c b/quantum/debounce/sym_eager_pk.c index 9da000ea9a59..fe3e88bb061b 100644 --- a/quantum/debounce/sym_eager_pk.c +++ b/quantum/debounce/sym_eager_pk.c @@ -131,7 +131,7 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui if (*debounce_pointer == DEBOUNCE_ELAPSED) { *debounce_pointer = DEBOUNCE; counters_need_update = true; - existing_row ^= col_mask; // flip the bit. + existing_row ^= col_mask; // flip the bit. } } debounce_pointer++; @@ -140,7 +140,6 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui } } -bool debounce_active(void) { return true; } #else # include "none.c" #endif diff --git a/quantum/debounce/sym_eager_pr.c b/quantum/debounce/sym_eager_pr.c index eda92a263b02..29b0cabefbe0 100644 --- a/quantum/debounce/sym_eager_pr.c +++ b/quantum/debounce/sym_eager_pr.c @@ -132,7 +132,6 @@ static void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], ui } } -bool debounce_active(void) { return true; } #else # include "none.c" #endif diff --git a/quantum/debounce/tests/debounce_test_common.cpp b/quantum/debounce/tests/debounce_test_common.cpp index f9414e571d84..0d5a7bb76648 100644 --- a/quantum/debounce/tests/debounce_test_common.cpp +++ b/quantum/debounce/tests/debounce_test_common.cpp @@ -31,7 +31,9 @@ void set_time(uint32_t t); void advance_time(uint32_t ms); } -void DebounceTest::addEvents(std::initializer_list events) { events_.insert(events_.end(), events.begin(), events.end()); } +void DebounceTest::addEvents(std::initializer_list events) { + events_.insert(events_.end(), events.begin(), events.end()); +} void DebounceTest::runEvents() { /* Run the test multiple times, from 1kHz to 10kHz scan rate */ diff --git a/quantum/debounce/tests/rules.mk b/quantum/debounce/tests/rules.mk index e908dd6f67e1..8318b1c6683d 100644 --- a/quantum/debounce/tests/rules.mk +++ b/quantum/debounce/tests/rules.mk @@ -28,6 +28,11 @@ debounce_sym_defer_pk_SRC := $(DEBOUNCE_COMMON_SRC) \ $(QUANTUM_PATH)/debounce/sym_defer_pk.c \ $(QUANTUM_PATH)/debounce/tests/sym_defer_pk_tests.cpp +debounce_sym_defer_pr_DEFS := $(DEBOUNCE_COMMON_DEFS) +debounce_sym_defer_pr_SRC := $(DEBOUNCE_COMMON_SRC) \ + $(QUANTUM_PATH)/debounce/sym_defer_pr.c \ + $(QUANTUM_PATH)/debounce/tests/sym_defer_pr_tests.cpp + debounce_sym_eager_pk_DEFS := $(DEBOUNCE_COMMON_DEFS) debounce_sym_eager_pk_SRC := $(DEBOUNCE_COMMON_SRC) \ $(QUANTUM_PATH)/debounce/sym_eager_pk.c \ diff --git a/quantum/debounce/tests/sym_defer_pr_tests.cpp b/quantum/debounce/tests/sym_defer_pr_tests.cpp new file mode 100644 index 000000000000..417e1f4ca24a --- /dev/null +++ b/quantum/debounce/tests/sym_defer_pr_tests.cpp @@ -0,0 +1,238 @@ +/* Copyright 2021 Simon Arlott + * + * 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 "gtest/gtest.h" + +#include "debounce_test_common.h" + +TEST_F(DebounceTest, OneKeyShort1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + /* 0ms delay (fast scan rate) */ + {5, {{0, 1, UP}}, {}}, + + {10, {}, {{0, 1, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyShort2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + /* 1ms delay */ + {6, {{0, 1, UP}}, {}}, + + {11, {}, {{0, 1, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyShort3) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + /* 2ms delay */ + {7, {{0, 1, UP}}, {}}, + + {12, {}, {{0, 1, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyTooQuick1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + /* Release key exactly on the debounce time */ + {5, {{0, 1, UP}}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyTooQuick2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + {6, {{0, 1, UP}}, {}}, + + /* Press key exactly on the debounce time */ + {11, {{0, 1, DOWN}}, {}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyBouncing1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + {1, {{0, 1, UP}}, {}}, + {2, {{0, 1, DOWN}}, {}}, + {3, {{0, 1, UP}}, {}}, + {4, {{0, 1, DOWN}}, {}}, + {5, {{0, 1, UP}}, {}}, + {6, {{0, 1, DOWN}}, {}}, + {11, {}, {{0, 1, DOWN}}}, /* 5ms after DOWN at time 7 */ + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyBouncing2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + {5, {}, {{0, 1, DOWN}}}, + {6, {{0, 1, UP}}, {}}, + {7, {{0, 1, DOWN}}, {}}, + {8, {{0, 1, UP}}, {}}, + {9, {{0, 1, DOWN}}, {}}, + {10, {{0, 1, UP}}, {}}, + {15, {}, {{0, 1, UP}}}, /* 5ms after UP at time 10 */ + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyLong) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}}}, + + {25, {{0, 1, UP}}, {}}, + + {30, {}, {{0, 1, UP}}}, + + {50, {{0, 1, DOWN}}, {}}, + + {55, {}, {{0, 1, DOWN}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, TwoKeysShort) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + {1, {{0, 2, DOWN}}, {}}, + + {6, {}, {{0, 1, DOWN}, {0, 2, DOWN}}}, + + {7, {{0, 1, UP}}, {}}, + {8, {{0, 2, UP}}, {}}, + + {13, {}, {{0, 1, UP}, {0, 2, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, TwoKeysSimultaneous1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}, {0, 2, DOWN}}, {}}, + + {5, {}, {{0, 1, DOWN}, {0, 2, DOWN}}}, + {6, {{0, 1, UP}, {0, 2, UP}}, {}}, + + {11, {}, {{0, 1, UP}, {0, 2, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, TwoKeysSimultaneous2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + {1, {{0, 2, DOWN}}, {}}, + + {6, {}, {{0, 1, DOWN}, {0, 2, DOWN}}}, + {7, {{0, 2, UP}}, {}}, + {9, {{0, 1, UP}}, {}}, + + // Debouncing loses the specific ordering -- both events report simultaneously. + {14, {}, {{0, 1, UP}, {0, 2, UP}}}, + }); + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan1) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + /* Processing is very late */ + {300, {}, {{0, 1, DOWN}}}, + /* Immediately release key */ + {300, {{0, 1, UP}}, {}}, + + {305, {}, {{0, 1, UP}}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan2) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + /* Processing is very late */ + {300, {}, {{0, 1, DOWN}}}, + /* Release key after 1ms */ + {301, {{0, 1, UP}}, {}}, + + {306, {}, {{0, 1, UP}}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan3) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + /* Release key before debounce expires */ + {300, {{0, 1, UP}}, {}}, + }); + time_jumps_ = true; + runEvents(); +} + +TEST_F(DebounceTest, OneKeyDelayedScan4) { + addEvents({ + /* Time, Inputs, Outputs */ + {0, {{0, 1, DOWN}}, {}}, + + /* Processing is a bit late */ + {50, {}, {{0, 1, DOWN}}}, + /* Release key after 1ms */ + {51, {{0, 1, UP}}, {}}, + + {56, {}, {{0, 1, UP}}}, + }); + time_jumps_ = true; + runEvents(); +} diff --git a/quantum/debounce/tests/testlist.mk b/quantum/debounce/tests/testlist.mk index c54c45aa63ef..f7bd5206983b 100644 --- a/quantum/debounce/tests/testlist.mk +++ b/quantum/debounce/tests/testlist.mk @@ -1,6 +1,7 @@ TEST_LIST += \ debounce_sym_defer_g \ debounce_sym_defer_pk \ + debounce_sym_defer_pr \ debounce_sym_eager_pk \ debounce_sym_eager_pr \ debounce_asym_eager_defer_pk diff --git a/quantum/deferred_exec.c b/quantum/deferred_exec.c index 5b0a5b14258b..a0046a9648d6 100644 --- a/quantum/deferred_exec.c +++ b/quantum/deferred_exec.c @@ -9,32 +9,27 @@ # define MAX_DEFERRED_EXECUTORS 8 #endif -typedef struct deferred_executor_t { - deferred_token token; - uint32_t trigger_time; - deferred_exec_callback callback; - void * cb_arg; -} deferred_executor_t; - -static deferred_token current_token = 0; -static uint32_t last_deferred_exec_check = 0; -static deferred_executor_t executors[MAX_DEFERRED_EXECUTORS] = {0}; - -static inline bool token_can_be_used(deferred_token token) { +//------------------------------------ +// Helpers +// + +static deferred_token current_token = 0; + +static inline bool token_can_be_used(deferred_executor_t *table, size_t table_count, deferred_token token) { if (token == INVALID_DEFERRED_TOKEN) { return false; } - for (int i = 0; i < MAX_DEFERRED_EXECUTORS; ++i) { - if (executors[i].token == token) { + for (int i = 0; i < table_count; ++i) { + if (table[i].token == token) { return false; } } return true; } -static inline deferred_token allocate_token(void) { +static inline deferred_token allocate_token(deferred_executor_t *table, size_t table_count) { deferred_token first = ++current_token; - while (!token_can_be_used(current_token)) { + while (!token_can_be_used(table, table_count, current_token)) { ++current_token; if (current_token == first) { // If we've looped back around to the first, everything is already allocated (yikes!). Need to exit with a failure. @@ -44,18 +39,22 @@ static inline deferred_token allocate_token(void) { return current_token; } -deferred_token defer_exec(uint32_t delay_ms, deferred_exec_callback callback, void *cb_arg) { - // Ignore queueing if it's a zero-time delay, or invalid callback - if (delay_ms == 0 || !callback) { +//------------------------------------ +// Advanced API: used when a custom-allocated table is used, primarily for core code. +// + +deferred_token defer_exec_advanced(deferred_executor_t *table, size_t table_count, uint32_t delay_ms, deferred_exec_callback callback, void *cb_arg) { + // Ignore queueing if the table isn't valid, it's a zero-time delay, or the token is not valid + if (!table || table_count == 0 || delay_ms == 0 || !callback) { return INVALID_DEFERRED_TOKEN; } // Find an unused slot and claim it - for (int i = 0; i < MAX_DEFERRED_EXECUTORS; ++i) { - deferred_executor_t *entry = &executors[i]; + for (int i = 0; i < table_count; ++i) { + deferred_executor_t *entry = &table[i]; if (entry->token == INVALID_DEFERRED_TOKEN) { // Work out the new token value, dropping out if none were available - deferred_token token = allocate_token(); + deferred_token token = allocate_token(table, table_count); if (token == INVALID_DEFERRED_TOKEN) { return false; } @@ -73,15 +72,15 @@ deferred_token defer_exec(uint32_t delay_ms, deferred_exec_callback callback, vo return INVALID_DEFERRED_TOKEN; } -bool extend_deferred_exec(deferred_token token, uint32_t delay_ms) { - // Ignore queueing if it's a zero-time delay, or the token is not valid - if (delay_ms == 0 || token == INVALID_DEFERRED_TOKEN) { +bool extend_deferred_exec_advanced(deferred_executor_t *table, size_t table_count, deferred_token token, uint32_t delay_ms) { + // Ignore queueing if the table isn't valid, it's a zero-time delay, or the token is not valid + if (!table || table_count == 0 || delay_ms == 0 || token == INVALID_DEFERRED_TOKEN) { return false; } // Find the entry corresponding to the token - for (int i = 0; i < MAX_DEFERRED_EXECUTORS; ++i) { - deferred_executor_t *entry = &executors[i]; + for (int i = 0; i < table_count; ++i) { + deferred_executor_t *entry = &table[i]; if (entry->token == token) { // Found it, extend the delay entry->trigger_time = timer_read32() + delay_ms; @@ -93,15 +92,15 @@ bool extend_deferred_exec(deferred_token token, uint32_t delay_ms) { return false; } -bool cancel_deferred_exec(deferred_token token) { - // Ignore request if the token is not valid - if (token == INVALID_DEFERRED_TOKEN) { +bool cancel_deferred_exec_advanced(deferred_executor_t *table, size_t table_count, deferred_token token) { + // Ignore request if the table/token are not valid + if (!table || table_count == 0 || token == INVALID_DEFERRED_TOKEN) { return false; } // Find the entry corresponding to the token - for (int i = 0; i < MAX_DEFERRED_EXECUTORS; ++i) { - deferred_executor_t *entry = &executors[i]; + for (int i = 0; i < table_count; ++i) { + deferred_executor_t *entry = &table[i]; if (entry->token == token) { // Found it, cancel and clear the table entry entry->token = INVALID_DEFERRED_TOKEN; @@ -116,16 +115,16 @@ bool cancel_deferred_exec(deferred_token token) { return false; } -void deferred_exec_task(void) { +void deferred_exec_advanced_task(deferred_executor_t *table, size_t table_count, uint32_t *last_execution_time) { uint32_t now = timer_read32(); // Throttle only once per millisecond - if (((int32_t)TIMER_DIFF_32(now, last_deferred_exec_check)) > 0) { - last_deferred_exec_check = now; + if (((int32_t)TIMER_DIFF_32(now, (*last_execution_time))) > 0) { + *last_execution_time = now; // Run through each of the executors - for (int i = 0; i < MAX_DEFERRED_EXECUTORS; ++i) { - deferred_executor_t *entry = &executors[i]; + for (int i = 0; i < table_count; ++i) { + deferred_executor_t *entry = &table[i]; // Check if we're supposed to execute this entry if (entry->token != INVALID_DEFERRED_TOKEN && ((int32_t)TIMER_DIFF_32(entry->trigger_time, now)) <= 0) { @@ -150,3 +149,23 @@ void deferred_exec_task(void) { } } } + +//------------------------------------ +// Basic API: used by user-mode code, guaranteed to not collide with core deferred execution +// + +static uint32_t last_deferred_exec_check = 0; +static deferred_executor_t basic_executors[MAX_DEFERRED_EXECUTORS] = {0}; + +deferred_token defer_exec(uint32_t delay_ms, deferred_exec_callback callback, void *cb_arg) { + return defer_exec_advanced(basic_executors, MAX_DEFERRED_EXECUTORS, delay_ms, callback, cb_arg); +} +bool extend_deferred_exec(deferred_token token, uint32_t delay_ms) { + return extend_deferred_exec_advanced(basic_executors, MAX_DEFERRED_EXECUTORS, token, delay_ms); +} +bool cancel_deferred_exec(deferred_token token) { + return cancel_deferred_exec_advanced(basic_executors, MAX_DEFERRED_EXECUTORS, token); +} +void deferred_exec_task(void) { + deferred_exec_advanced_task(basic_executors, MAX_DEFERRED_EXECUTORS, &last_deferred_exec_check); +} diff --git a/quantum/deferred_exec.h b/quantum/deferred_exec.h index f80d353169bf..97ef0f6c0e2b 100644 --- a/quantum/deferred_exec.h +++ b/quantum/deferred_exec.h @@ -5,34 +5,117 @@ #include #include +#include -// A token that can be used to cancel an existing deferred execution. +//------------------------------------ +// Common +//------------------------------------ + +/** + * @typedef A token that can be used to cancel or extend an existing deferred execution. + */ typedef uint8_t deferred_token; + +/** + * @def The constant used to denote an invalid deferred execution token. + */ #define INVALID_DEFERRED_TOKEN 0 -// Callback to execute. -// -- Parameter trigger_time: the intended trigger time to execute the callback -- equivalent time-space as timer_read32() -// cb_arg: the callback argument specified when enqueueing the deferred executor -// -- Return value: Non-zero re-queues the callback to execute after the returned number of milliseconds. Zero cancels repeated execution. +/** + * @typedef Callback to execute. + * @param trigger_time[in] the intended trigger time to execute the callback -- equivalent time-space as timer_read32() + * @param cb_arg[in] the callback argument specified when enqueueing the deferred executor + * @return non-zero re-queues the callback to execute after the returned number of milliseconds. Zero cancels repeated execution. + */ typedef uint32_t (*deferred_exec_callback)(uint32_t trigger_time, void *cb_arg); -// Configures the supplied deferred executor to be executed after the required number of milliseconds. -// -- Parameter delay_ms: the number of milliseconds before executing the callback -// -- callback: the executor to invoke -// -- cb_arg: the argument to pass to the executor, may be NULL if unused by the executor -// -- Return value: a token usable for cancellation, or INVALID_DEFERRED_TOKEN if an error occurred +//------------------------------------ +// Basic API: used by user-mode code, guaranteed to not collide with core deferred execution +//------------------------------------ + +/** + * Configures the supplied deferred executor to be executed after the required number of milliseconds. + * + * @param delay_ms[in] the number of milliseconds before executing the callback + * @param callback[in] the executor to invoke + * @param cb_arg[in] the argument to pass to the executor, may be NULL if unused by the executor + * @return a token usable for extension/cancellation, or INVALID_DEFERRED_TOKEN if an error occurred + */ deferred_token defer_exec(uint32_t delay_ms, deferred_exec_callback callback, void *cb_arg); -// Allows for extending the timeframe before an existing deferred execution is invoked. -// -- Parameter token: the returned value from defer_exec for the deferred execution you wish to extend. -// -- delay_ms: the new delay (with respect to the current time) -// -- Return value: if the token was found, and the delay was extended +/** + * Allows for extending the timeframe before an existing deferred execution is invoked. + * + * @param token[in] the returned value from defer_exec for the deferred execution you wish to extend + * @param delay_ms[in] the number of milliseconds before executing the callback + * @return true if the token was extended successfully, otherwise false + */ bool extend_deferred_exec(deferred_token token, uint32_t delay_ms); -// Allows for cancellation of an existing deferred execution. -// -- Parameter token: the returned value from defer_exec for the deferred execution you wish to cancel. -// -- Return value: if the token was found, and the executor was cancelled +/** + * Allows for cancellation of an existing deferred execution. + * + * @param token[in] the returned value from defer_exec for the deferred execution you wish to cancel + * @return true if the token was cancelled successfully, otherwise false + */ bool cancel_deferred_exec(deferred_token token); -// Forward declaration for the main loop in order to execute any deferred executors. Should not be invoked by keyboard/user code. +/** + * Forward declaration for the main loop in order to execute any deferred executors. Should not be invoked by keyboard/user code. + */ void deferred_exec_task(void); + +//------------------------------------ +// Advanced API: used when a custom-allocated table is used, primarily for core code. +//------------------------------------ + +/** + * @struct Structure for containing self-hosted deferred executor tables. + * @brief Core-side code can use this to create their own tables without impacting on the use of users' ability to add deferred execution. + * Code outside deferred_exec.c should not worry about internals of this struct, and should just allocate the required number in an array. + */ +typedef struct deferred_executor_t { + deferred_token token; + uint32_t trigger_time; + deferred_exec_callback callback; + void * cb_arg; +} deferred_executor_t; + +/** + * Configures the supplied deferred executor to be executed after the required number of milliseconds. + * + * @param table[in] the custom table used for storage + * @param table_count[in] the number of available items in the table + * @param delay_ms[in] the number of milliseconds before executing the callback + * @param callback[in] the executor to invoke + * @param cb_arg[in] the argument to pass to the executor, may be NULL if unused by the executor + * @return a token usable for extension/cancellation, or INVALID_DEFERRED_TOKEN if an error occurred + */ +deferred_token defer_exec_advanced(deferred_executor_t *table, size_t table_count, uint32_t delay_ms, deferred_exec_callback callback, void *cb_arg); + +/** + * Allows for extending the timeframe before an existing deferred execution is invoked. + * + * @param token[in] the returned value from defer_exec for the deferred execution you wish to extend + * @param delay_ms[in] the number of milliseconds before executing the callback + * @return true if the token was extended successfully, otherwise false + */ +bool extend_deferred_exec_advanced(deferred_executor_t *table, size_t table_count, deferred_token token, uint32_t delay_ms); + +/** + * Allows for cancellation of an existing deferred execution. + * + * @param token[in] the returned value from defer_exec for the deferred execution you wish to cancel + * @return true if the token was cancelled successfully, otherwise false + */ +bool cancel_deferred_exec_advanced(deferred_executor_t *table, size_t table_count, deferred_token token); + +/** + * Forward declaration for the main loop in order to execute any custom table deferred executors. Should not be invoked by keyboard/user code. + * Needed for any custom-allocated deferred execution tables. Any core tasks should add appropriate invocation to quantum/main.c. + * + * @param table[in] the custom table used for storage + * @param table_count[in] the number of available items in the table + * @param last_execution_time[in,out] the last execution time -- this will be checked first to determine if execution is needed, and updated if execution occurred + */ +void deferred_exec_advanced_task(deferred_executor_t *table, size_t table_count, uint32_t *last_execution_time); diff --git a/quantum/digitizer.c b/quantum/digitizer.c index e29986742916..7925129d0cb5 100644 --- a/quantum/digitizer.c +++ b/quantum/digitizer.c @@ -24,9 +24,13 @@ __attribute__((weak)) void digitizer_send(void) { } } -__attribute__((weak)) void digitizer_task(void) { digitizer_send(); } +__attribute__((weak)) void digitizer_task(void) { + digitizer_send(); +} -digitizer_t digitizer_get_report(void) { return digitizerReport; } +digitizer_t digitizer_get_report(void) { + return digitizerReport; +} void digitizer_set_report(digitizer_t newDigitizerReport) { digitizerReport = newDigitizerReport; diff --git a/quantum/dip_switch.c b/quantum/dip_switch.c index 133ec850273e..eee29aaf9122 100644 --- a/quantum/dip_switch.c +++ b/quantum/dip_switch.c @@ -52,13 +52,21 @@ static uint16_t scan_count; static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; -__attribute__((weak)) bool dip_switch_update_user(uint8_t index, bool active) { return true; } +__attribute__((weak)) bool dip_switch_update_user(uint8_t index, bool active) { + return true; +} -__attribute__((weak)) bool dip_switch_update_kb(uint8_t index, bool active) { return dip_switch_update_user(index, active); } +__attribute__((weak)) bool dip_switch_update_kb(uint8_t index, bool active) { + return dip_switch_update_user(index, active); +} -__attribute__((weak)) bool dip_switch_update_mask_user(uint32_t state) { return true; } +__attribute__((weak)) bool dip_switch_update_mask_user(uint32_t state) { + return true; +} -__attribute__((weak)) bool dip_switch_update_mask_kb(uint32_t state) { return dip_switch_update_mask_user(state); } +__attribute__((weak)) bool dip_switch_update_mask_kb(uint32_t state) { + return dip_switch_update_mask_user(state); +} void dip_switch_init(void) { #ifdef DIP_SWITCH_PINS diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index 19a6bea59a0d..f070375ff3c2 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -14,12 +14,12 @@ * along with this program. If not, see . */ -#include "keymap.h" // to get keymaps[][][] +#include "keymap.h" // to get keymaps[][][] #include "eeprom.h" -#include "progmem.h" // to read default from flash -#include "quantum.h" // for send_string() +#include "progmem.h" // to read default from flash +#include "quantum.h" // for send_string() #include "dynamic_keymap.h" -#include "via.h" // for default VIA_EEPROM_ADDR_END +#include "via.h" // for default VIA_EEPROM_ADDR_END #ifndef DYNAMIC_KEYMAP_LAYER_COUNT # define DYNAMIC_KEYMAP_LAYER_COUNT 4 @@ -29,24 +29,22 @@ # define DYNAMIC_KEYMAP_MACRO_COUNT 16 #endif -// This is the default EEPROM max address to use for dynamic keymaps. -// The default is the ATmega32u4 EEPROM max address. -// Explicitly override it if the keyboard uses a microcontroller with -// more EEPROM *and* it makes sense to increase it. +#ifndef TOTAL_EEPROM_BYTE_COUNT +# error Unknown total EEPROM size. Cannot derive maximum for dynamic keymaps. +#endif + #ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR -# if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) -# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 -# elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) -# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095 -# elif defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_AT90USB162__) || defined(__AVR_ATtiny85__) -# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 511 -# else -# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1023 -# endif +# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR (TOTAL_EEPROM_BYTE_COUNT - 1) +#endif + +#if DYNAMIC_KEYMAP_EEPROM_MAX_ADDR > (TOTAL_EEPROM_BYTE_COUNT - 1) +# pragma message STR(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) " > " STR((TOTAL_EEPROM_BYTE_COUNT - 1)) +# error DYNAMIC_KEYMAP_EEPROM_MAX_ADDR is configured to use more space than what is available for the selected EEPROM driver #endif // Due to usage of uint16_t check for max 65535 #if DYNAMIC_KEYMAP_EEPROM_MAX_ADDR > 65535 +# pragma message STR(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) " > 65535" # error DYNAMIC_KEYMAP_EEPROM_MAX_ADDR must be less than 65536 #endif @@ -71,6 +69,7 @@ // or DYNAMIC_KEYMAP_EEPROM_MAX_ADDR to increase it, *only if* the microcontroller has // more than the default. #if DYNAMIC_KEYMAP_EEPROM_MAX_ADDR - DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR < 100 +# pragma message STR(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR - DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR) " < 100" # error Dynamic keymaps are configured to use more EEPROM than is available. #endif @@ -80,7 +79,9 @@ # define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE (DYNAMIC_KEYMAP_EEPROM_MAX_ADDR - DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + 1) #endif -uint8_t dynamic_keymap_get_layer_count(void) { return DYNAMIC_KEYMAP_LAYER_COUNT; } +uint8_t dynamic_keymap_get_layer_count(void) { + return DYNAMIC_KEYMAP_LAYER_COUNT; +} void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column) { // TODO: optimize this with some left shifts @@ -152,9 +153,13 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { } } -uint8_t dynamic_keymap_macro_get_count(void) { return DYNAMIC_KEYMAP_MACRO_COUNT; } +uint8_t dynamic_keymap_macro_get_count(void) { + return DYNAMIC_KEYMAP_MACRO_COUNT; +} -uint16_t dynamic_keymap_macro_get_buffer_size(void) { return DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE; } +uint16_t dynamic_keymap_macro_get_buffer_size(void) { + return DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE; +} void dynamic_keymap_macro_get_buffer(uint16_t offset, uint16_t size, uint8_t *data) { void * source = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset); diff --git a/quantum/eeconfig.c b/quantum/eeconfig.c index 4c2ad2490ce8..14cd5887f442 100644 --- a/quantum/eeconfig.c +++ b/quantum/eeconfig.c @@ -49,7 +49,7 @@ void eeconfig_init_quantum(void) { eeprom_update_byte(EECONFIG_KEYMAP_UPPER_BYTE, 0); eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); eeprom_update_byte(EECONFIG_BACKLIGHT, 0); - eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default + eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default eeprom_update_dword(EECONFIG_RGBLIGHT, 0); eeprom_update_byte(EECONFIG_STENOMODE, 0); eeprom_update_dword(EECONFIG_HAPTIC, 0); @@ -90,13 +90,17 @@ void eeconfig_init_quantum(void) { * * FIXME: needs doc */ -void eeconfig_init(void) { eeconfig_init_quantum(); } +void eeconfig_init(void) { + eeconfig_init_quantum(); +} /** \brief eeconfig enable * * FIXME: needs doc */ -void eeconfig_enable(void) { eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); } +void eeconfig_enable(void) { + eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); +} /** \brief eeconfig disable * @@ -141,29 +145,39 @@ bool eeconfig_is_disabled(void) { * * FIXME: needs doc */ -uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } +uint8_t eeconfig_read_debug(void) { + return eeprom_read_byte(EECONFIG_DEBUG); +} /** \brief eeconfig update debug * * FIXME: needs doc */ -void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); } +void eeconfig_update_debug(uint8_t val) { + eeprom_update_byte(EECONFIG_DEBUG, val); +} /** \brief eeconfig read default layer * * FIXME: needs doc */ -uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } +uint8_t eeconfig_read_default_layer(void) { + return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); +} /** \brief eeconfig update default layer * * FIXME: needs doc */ -void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); } +void eeconfig_update_default_layer(uint8_t val) { + eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); +} /** \brief eeconfig read keymap * * FIXME: needs doc */ -uint16_t eeconfig_read_keymap(void) { return (eeprom_read_byte(EECONFIG_KEYMAP_LOWER_BYTE) | (eeprom_read_byte(EECONFIG_KEYMAP_UPPER_BYTE) << 8)); } +uint16_t eeconfig_read_keymap(void) { + return (eeprom_read_byte(EECONFIG_KEYMAP_LOWER_BYTE) | (eeprom_read_byte(EECONFIG_KEYMAP_UPPER_BYTE) << 8)); +} /** \brief eeconfig update keymap * * FIXME: needs doc @@ -177,53 +191,73 @@ void eeconfig_update_keymap(uint16_t val) { * * FIXME: needs doc */ -uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); } +uint8_t eeconfig_read_audio(void) { + return eeprom_read_byte(EECONFIG_AUDIO); +} /** \brief eeconfig update audio * * FIXME: needs doc */ -void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); } +void eeconfig_update_audio(uint8_t val) { + eeprom_update_byte(EECONFIG_AUDIO, val); +} /** \brief eeconfig read kb * * FIXME: needs doc */ -uint32_t eeconfig_read_kb(void) { return eeprom_read_dword(EECONFIG_KEYBOARD); } +uint32_t eeconfig_read_kb(void) { + return eeprom_read_dword(EECONFIG_KEYBOARD); +} /** \brief eeconfig update kb * * FIXME: needs doc */ -void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); } +void eeconfig_update_kb(uint32_t val) { + eeprom_update_dword(EECONFIG_KEYBOARD, val); +} /** \brief eeconfig read user * * FIXME: needs doc */ -uint32_t eeconfig_read_user(void) { return eeprom_read_dword(EECONFIG_USER); } +uint32_t eeconfig_read_user(void) { + return eeprom_read_dword(EECONFIG_USER); +} /** \brief eeconfig update user * * FIXME: needs doc */ -void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); } +void eeconfig_update_user(uint32_t val) { + eeprom_update_dword(EECONFIG_USER, val); +} /** \brief eeconfig read haptic * * FIXME: needs doc */ -uint32_t eeconfig_read_haptic(void) { return eeprom_read_dword(EECONFIG_HAPTIC); } +uint32_t eeconfig_read_haptic(void) { + return eeprom_read_dword(EECONFIG_HAPTIC); +} /** \brief eeconfig update haptic * * FIXME: needs doc */ -void eeconfig_update_haptic(uint32_t val) { eeprom_update_dword(EECONFIG_HAPTIC, val); } +void eeconfig_update_haptic(uint32_t val) { + eeprom_update_dword(EECONFIG_HAPTIC, val); +} /** \brief eeconfig read split handedness * * FIXME: needs doc */ -bool eeconfig_read_handedness(void) { return !!eeprom_read_byte(EECONFIG_HANDEDNESS); } +bool eeconfig_read_handedness(void) { + return !!eeprom_read_byte(EECONFIG_HANDEDNESS); +} /** \brief eeconfig update split handedness * * FIXME: needs doc */ -void eeconfig_update_handedness(bool val) { eeprom_update_byte(EECONFIG_HANDEDNESS, !!val); } +void eeconfig_update_handedness(bool val) { + eeprom_update_byte(EECONFIG_HANDEDNESS, !!val); +} diff --git a/quantum/eeconfig.h b/quantum/eeconfig.h index 22d874273c08..f3cd1867ab43 100644 --- a/quantum/eeconfig.h +++ b/quantum/eeconfig.h @@ -21,7 +21,7 @@ along with this program. If not, see . #include #ifndef EECONFIG_MAGIC_NUMBER -# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE9 // When changing, decrement this value to avoid future re-init issues +# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE9 // When changing, decrement this value to avoid future re-init issues #endif #define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF @@ -112,28 +112,30 @@ void eeconfig_update_haptic(uint32_t val); bool eeconfig_read_handedness(void); void eeconfig_update_handedness(bool val); -#define EECONFIG_DEBOUNCE_HELPER(name, offset, config) \ - static uint8_t dirty_##name = false; \ - \ - static inline void eeconfig_init_##name(void) { \ - eeprom_read_block(&config, offset, sizeof(config)); \ - dirty_##name = false; \ - } \ - static inline void eeconfig_flush_##name(bool force) { \ - if (force || dirty_##name) { \ - eeprom_update_block(&config, offset, sizeof(config)); \ - dirty_##name = false; \ - } \ - } \ - static inline void eeconfig_flush_##name##_task(uint16_t timeout) { \ - static uint16_t flush_timer = 0; \ - if (timer_elapsed(flush_timer) > timeout) { \ - eeconfig_flush_##name(false); \ - flush_timer = timer_read(); \ - } \ - } \ - static inline void eeconfig_flag_##name(bool v) { dirty_##name |= v; } \ - static inline void eeconfig_write_##name(typeof(config) conf) { \ - memcpy(&config, &conf, sizeof(config)); \ - eeconfig_flag_##name(true); \ +#define EECONFIG_DEBOUNCE_HELPER(name, offset, config) \ + static uint8_t dirty_##name = false; \ + \ + static inline void eeconfig_init_##name(void) { \ + eeprom_read_block(&config, offset, sizeof(config)); \ + dirty_##name = false; \ + } \ + static inline void eeconfig_flush_##name(bool force) { \ + if (force || dirty_##name) { \ + eeprom_update_block(&config, offset, sizeof(config)); \ + dirty_##name = false; \ + } \ + } \ + static inline void eeconfig_flush_##name##_task(uint16_t timeout) { \ + static uint16_t flush_timer = 0; \ + if (timer_elapsed(flush_timer) > timeout) { \ + eeconfig_flush_##name(false); \ + flush_timer = timer_read(); \ + } \ + } \ + static inline void eeconfig_flag_##name(bool v) { \ + dirty_##name |= v; \ + } \ + static inline void eeconfig_write_##name(typeof(config) conf) { \ + memcpy(&config, &conf, sizeof(config)); \ + eeconfig_flag_##name(true); \ } diff --git a/quantum/encoder.c b/quantum/encoder.c index ecbc0c16153e..438c7d8564e1 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -59,11 +59,17 @@ static uint8_t thisHand, thatHand; static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; #endif -__attribute__((weak)) void encoder_wait_pullup_charge(void) { wait_us(100); } +__attribute__((weak)) void encoder_wait_pullup_charge(void) { + wait_us(100); +} -__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return true; } +__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { + return true; +} -__attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { return encoder_update_user(index, clockwise); } +__attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { + return encoder_update_user(index, clockwise); +} void encoder_init(void) { #if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) @@ -117,7 +123,7 @@ static bool encoder_update(uint8_t index, uint8_t state) { changed = true; encoder_update_kb(index, ENCODER_COUNTER_CLOCKWISE); } - if (encoder_pulses[i] <= -resolution) { // direction is arbitrary here, but this clockwise + if (encoder_pulses[i] <= -resolution) { // direction is arbitrary here, but this clockwise encoder_value[index]--; changed = true; encoder_update_kb(index, ENCODER_CLOCKWISE); @@ -144,7 +150,9 @@ bool encoder_read(void) { #ifdef SPLIT_KEYBOARD void last_encoder_activity_trigger(void); -void encoder_state_raw(uint8_t* slave_state) { memcpy(slave_state, &encoder_value[thisHand], sizeof(uint8_t) * NUMBER_OF_ENCODERS); } +void encoder_state_raw(uint8_t* slave_state) { + memcpy(slave_state, &encoder_value[thisHand], sizeof(uint8_t) * NUMBER_OF_ENCODERS); +} void encoder_update_raw(uint8_t* slave_state) { bool changed = false; diff --git a/quantum/encoder/tests/mock.c b/quantum/encoder/tests/mock.c index d0506a938f7b..10a00cb8f2c1 100644 --- a/quantum/encoder/tests/mock.c +++ b/quantum/encoder/tests/mock.c @@ -26,7 +26,9 @@ uint8_t mockSetPinInputHigh(pin_t pin) { return 0; } -bool mockReadPin(pin_t pin) { return pins[pin]; } +bool mockReadPin(pin_t pin) { + return pins[pin]; +} bool setPin(pin_t pin, bool val) { pins[pin] = val; diff --git a/quantum/encoder/tests/mock_split.c b/quantum/encoder/tests/mock_split.c index 68bf3af59929..dd3c26d9584b 100644 --- a/quantum/encoder/tests/mock_split.c +++ b/quantum/encoder/tests/mock_split.c @@ -26,7 +26,9 @@ uint8_t mockSetPinInputHigh(pin_t pin) { return 0; } -bool mockReadPin(pin_t pin) { return pins[pin]; } +bool mockReadPin(pin_t pin) { + return pins[pin]; +} bool setPin(pin_t pin, bool val) { pins[pin] = val; diff --git a/quantum/haptic.c b/quantum/haptic.c index f915acf94647..31d111480675 100644 --- a/quantum/haptic.c +++ b/quantum/haptic.c @@ -247,7 +247,9 @@ void haptic_set_dwell(uint8_t dwell) { xprintf("haptic_config.dwell = %u\n", haptic_config.dwell); } -uint8_t haptic_get_enable(void) { return haptic_config.enable; } +uint8_t haptic_get_enable(void) { + return haptic_config.enable; +} uint8_t haptic_get_mode(void) { if (!haptic_config.enable) { diff --git a/quantum/keyboard.c b/quantum/keyboard.c index 3bca05aab7cf..ba5609f0aabf 100644 --- a/quantum/keyboard.c +++ b/quantum/keyboard.c @@ -16,9 +16,11 @@ along with this program. If not, see . */ #include +#include "quantum.h" #include "keyboard.h" #include "matrix.h" #include "keymap.h" +#include "magic.h" #include "host.h" #include "led.h" #include "keycode.h" @@ -100,20 +102,42 @@ along with this program. If not, see . #ifdef SLEEP_LED_ENABLE # include "sleep_led.h" #endif +#ifdef SPLIT_KEYBOARD +# include "split_util.h" +#endif +#ifdef BLUETOOTH_ENABLE +# include "outputselect.h" +#endif static uint32_t last_input_modification_time = 0; -uint32_t last_input_activity_time(void) { return last_input_modification_time; } -uint32_t last_input_activity_elapsed(void) { return timer_elapsed32(last_input_modification_time); } +uint32_t last_input_activity_time(void) { + return last_input_modification_time; +} +uint32_t last_input_activity_elapsed(void) { + return timer_elapsed32(last_input_modification_time); +} static uint32_t last_matrix_modification_time = 0; -uint32_t last_matrix_activity_time(void) { return last_matrix_modification_time; } -uint32_t last_matrix_activity_elapsed(void) { return timer_elapsed32(last_matrix_modification_time); } -void last_matrix_activity_trigger(void) { last_matrix_modification_time = last_input_modification_time = timer_read32(); } +uint32_t last_matrix_activity_time(void) { + return last_matrix_modification_time; +} +uint32_t last_matrix_activity_elapsed(void) { + return timer_elapsed32(last_matrix_modification_time); +} +void last_matrix_activity_trigger(void) { + last_matrix_modification_time = last_input_modification_time = timer_read32(); +} static uint32_t last_encoder_modification_time = 0; -uint32_t last_encoder_activity_time(void) { return last_encoder_modification_time; } -uint32_t last_encoder_activity_elapsed(void) { return timer_elapsed32(last_encoder_modification_time); } -void last_encoder_activity_trigger(void) { last_encoder_modification_time = last_input_modification_time = timer_read32(); } +uint32_t last_encoder_activity_time(void) { + return last_encoder_modification_time; +} +uint32_t last_encoder_activity_elapsed(void) { + return timer_elapsed32(last_encoder_modification_time); +} +void last_encoder_activity_trigger(void) { + last_encoder_modification_time = last_input_modification_time = timer_read32(); +} // Only enable this if console is enabled to print to #if defined(DEBUG_MATRIX_SCAN_RATE) @@ -135,7 +159,9 @@ void matrix_scan_perf_task(void) { } } -uint32_t get_matrix_scan_rate(void) { return last_matrix_scan_count; } +uint32_t get_matrix_scan_rate(void) { + return last_matrix_scan_count; +} #else # define matrix_scan_perf_task() #endif @@ -155,7 +181,7 @@ static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata) { } static inline bool popcount_more_than_one(matrix_row_t rowdata) { - rowdata &= rowdata - 1; // if there are less than two bits (keys) set, rowdata will become zero + rowdata &= rowdata - 1; // if there are less than two bits (keys) set, rowdata will become zero return rowdata; } @@ -212,7 +238,9 @@ __attribute__((weak)) void keyboard_pre_init_user(void) {} * * FIXME: needs doc */ -__attribute__((weak)) void keyboard_pre_init_kb(void) { keyboard_pre_init_user(); } +__attribute__((weak)) void keyboard_pre_init_kb(void) { + keyboard_pre_init_user(); +} /** \brief keyboard_post_init_user * @@ -226,7 +254,9 @@ __attribute__((weak)) void keyboard_post_init_user() {} * FIXME: needs doc */ -__attribute__((weak)) void keyboard_post_init_kb(void) { keyboard_post_init_user(); } +__attribute__((weak)) void keyboard_post_init_kb(void) { + keyboard_post_init_user(); +} /** \brief keyboard_setup * @@ -250,13 +280,17 @@ void keyboard_setup(void) { * * FIXME: needs doc */ -__attribute__((weak)) bool is_keyboard_master(void) { return true; } +__attribute__((weak)) bool is_keyboard_master(void) { + return true; +} /** \brief is_keyboard_left * * FIXME: needs doc */ -__attribute__((weak)) bool is_keyboard_left(void) { return true; } +__attribute__((weak)) bool is_keyboard_left(void) { + return true; +} #endif @@ -265,7 +299,9 @@ __attribute__((weak)) bool is_keyboard_left(void) { return true; } * Override this function if you have a condition where keypresses processing should change: * - splits where the slave side needs to process for rgb/oled functionality */ -__attribute__((weak)) bool should_process_keypress(void) { return is_keyboard_master(); } +__attribute__((weak)) bool should_process_keypress(void) { + return is_keyboard_master(); +} /** \brief housekeeping_task_kb * @@ -290,6 +326,36 @@ void housekeeping_task(void) { housekeeping_task_user(); } +/** \brief Init tasks previously located in matrix_init_quantum + * + * TODO: rationalise against keyboard_init and current split role + */ +void quantum_init(void) { + magic(); + led_init_ports(); +#ifdef BACKLIGHT_ENABLE + backlight_init_ports(); +#endif +#ifdef AUDIO_ENABLE + audio_init(); +#endif +#ifdef LED_MATRIX_ENABLE + led_matrix_init(); +#endif +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init(); +#endif +#if defined(UNICODE_COMMON_ENABLE) + unicode_input_mode_init(); +#endif +#ifdef HAPTIC_ENABLE + haptic_init(); +#endif +#if defined(BLUETOOTH_ENABLE) && defined(OUTPUT_AUTO_ENABLE) + set_output(OUTPUT_AUTO); +#endif +} + /** \brief keyboard_init * * FIXME: needs doc @@ -299,8 +365,12 @@ void keyboard_init(void) { sync_timer_init(); #ifdef VIA_ENABLE via_init(); +#endif +#ifdef SPLIT_KEYBOARD + split_pre_init(); #endif matrix_init(); + quantum_init(); #if defined(CRC_ENABLE) crc_init(); #endif @@ -341,6 +411,9 @@ void keyboard_init(void) { #ifdef VIRTSER_ENABLE virtser_init(); #endif +#ifdef SPLIT_KEYBOARD + split_post_init(); +#endif #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) debug_enable = true; @@ -363,28 +436,17 @@ void switch_events(uint8_t row, uint8_t col, bool pressed) { #endif } -/** \brief Keyboard task: Do keyboard routine jobs - * - * Do routine keyboard jobs: +/** \brief Perform scan of keyboard matrix * - * * scan matrix - * * handle mouse movements - * * handle midi commands - * * light LEDs - * - * This is repeatedly called as fast as possible. + * Any detected changes in state are sent out as part of the processing */ -void keyboard_task(void) { +bool matrix_scan_task(void) { static matrix_row_t matrix_prev[MATRIX_ROWS]; - static uint8_t led_status = 0; matrix_row_t matrix_row = 0; matrix_row_t matrix_change = 0; #ifdef QMK_KEYS_PER_SCAN uint8_t keys_processed = 0; #endif -#ifdef ENCODER_ENABLE - bool encoders_changed = false; -#endif uint8_t matrix_changed = matrix_scan(); if (matrix_changed) last_matrix_activity_trigger(); @@ -431,10 +493,94 @@ void keyboard_task(void) { MATRIX_LOOP_END: -#ifdef DEBUG_MATRIX_SCAN_RATE matrix_scan_perf_task(); + return matrix_changed; +} + +/** \brief Tasks previously located in matrix_scan_quantum + * + * TODO: rationalise against keyboard_task and current split role + */ +void quantum_task(void) { +#ifdef SPLIT_KEYBOARD + // some tasks should only run on master + if (!is_keyboard_master()) return; +#endif + +#if defined(AUDIO_ENABLE) && defined(AUDIO_INIT_DELAY) + // There are some tasks that need to be run a little bit + // after keyboard startup, or else they will not work correctly + // because of interaction with the USB device state, which + // may still be in flux... + // + // At the moment the only feature that needs this is the + // startup song. + static bool delayed_tasks_run = false; + static uint16_t delayed_task_timer = 0; + if (!delayed_tasks_run) { + if (!delayed_task_timer) { + delayed_task_timer = timer_read(); + } else if (timer_elapsed(delayed_task_timer) > 300) { + audio_startup(); + delayed_tasks_run = true; + } + } +#endif + +#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) + music_task(); +#endif + +#ifdef KEY_OVERRIDE_ENABLE + key_override_task(); +#endif + +#ifdef SEQUENCER_ENABLE + sequencer_task(); +#endif + +#ifdef TAP_DANCE_ENABLE + tap_dance_task(); #endif +#ifdef COMBO_ENABLE + combo_task(); +#endif + +#ifdef WPM_ENABLE + decay_wpm(); +#endif + +#ifdef HAPTIC_ENABLE + haptic_task(); +#endif + +#ifdef DIP_SWITCH_ENABLE + dip_switch_read(false); +#endif + +#ifdef AUTO_SHIFT_ENABLE + autoshift_matrix_scan(); +#endif +} + +/** \brief Keyboard task: Do keyboard routine jobs + * + * Do routine keyboard jobs: + * + * * scan matrix + * * handle mouse movements + * * handle midi commands + * * light LEDs + * + * This is repeatedly called as fast as possible. + */ +void keyboard_task(void) { + bool matrix_changed = matrix_scan_task(); + (void)matrix_changed; + + quantum_task(); + #if defined(RGBLIGHT_ENABLE) rgblight_task(); #endif @@ -453,7 +599,7 @@ void keyboard_task(void) { #endif #ifdef ENCODER_ENABLE - encoders_changed = encoder_read(); + bool encoders_changed = encoder_read(); if (encoders_changed) last_encoder_activity_trigger(); #endif @@ -516,22 +662,5 @@ void keyboard_task(void) { programmable_button_send(); #endif - // update LED - if (led_status != host_keyboard_leds()) { - led_status = host_keyboard_leds(); - keyboard_set_leds(led_status); - } -} - -/** \brief keyboard set leds - * - * FIXME: needs doc - */ -void keyboard_set_leds(uint8_t leds) { - if (debug_keyboard) { - debug("keyboard_set_led: "); - debug_hex8(leds); - debug("\n"); - } - led_set(leds); + led_task(); } diff --git a/quantum/keyboard.h b/quantum/keyboard.h index 08f4e84f94a5..e122b3826414 100644 --- a/quantum/keyboard.h +++ b/quantum/keyboard.h @@ -44,13 +44,21 @@ typedef struct { * 1) (time == 0) to handle (keyevent_t){} as empty event * 2) Matrix(255, 255) to make TICK event available */ -static inline bool IS_NOEVENT(keyevent_t event) { return event.time == 0 || (event.key.row == 255 && event.key.col == 255); } -static inline bool IS_PRESSED(keyevent_t event) { return (!IS_NOEVENT(event) && event.pressed); } -static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && !event.pressed); } +static inline bool IS_NOEVENT(keyevent_t event) { + return event.time == 0 || (event.key.row == 255 && event.key.col == 255); +} +static inline bool IS_PRESSED(keyevent_t event) { + return (!IS_NOEVENT(event) && event.pressed); +} +static inline bool IS_RELEASED(keyevent_t event) { + return (!IS_NOEVENT(event) && !event.pressed); +} /* Tick event */ -#define TICK \ - (keyevent_t) { .key = (keypos_t){.row = 255, .col = 255}, .pressed = false, .time = (timer_read() | 1) } +#define TICK \ + (keyevent_t) { \ + .key = (keypos_t){.row = 255, .col = 255}, .pressed = false, .time = (timer_read() | 1) \ + } /* it runs once at early stage of startup before keyboard_init. */ void keyboard_setup(void); @@ -58,8 +66,6 @@ void keyboard_setup(void); void keyboard_init(void); /* it runs repeatedly in main loop */ void keyboard_task(void); -/* it runs when host LED status is updated */ -void keyboard_set_leds(uint8_t leds); /* it runs whenever code has to behave differently on a slave */ bool is_keyboard_master(void); /* it runs whenever code has to behave differently on left vs right split */ @@ -70,18 +76,18 @@ void keyboard_pre_init_user(void); void keyboard_post_init_kb(void); void keyboard_post_init_user(void); -void housekeeping_task(void); // To be executed by the main loop in each backend TMK protocol -void housekeeping_task_kb(void); // To be overridden by keyboard-level code -void housekeeping_task_user(void); // To be overridden by user/keymap-level code +void housekeeping_task(void); // To be executed by the main loop in each backend TMK protocol +void housekeeping_task_kb(void); // To be overridden by keyboard-level code +void housekeeping_task_user(void); // To be overridden by user/keymap-level code -uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity -uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity +uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity +uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity -uint32_t last_matrix_activity_time(void); // Timestamp of the last matrix activity -uint32_t last_matrix_activity_elapsed(void); // Number of milliseconds since the last matrix activity +uint32_t last_matrix_activity_time(void); // Timestamp of the last matrix activity +uint32_t last_matrix_activity_elapsed(void); // Number of milliseconds since the last matrix activity -uint32_t last_encoder_activity_time(void); // Timestamp of the last encoder activity -uint32_t last_encoder_activity_elapsed(void); // Number of milliseconds since the last encoder activity +uint32_t last_encoder_activity_time(void); // Timestamp of the last encoder activity +uint32_t last_encoder_activity_elapsed(void); // Number of milliseconds since the last encoder activity uint32_t get_matrix_scan_rate(void); diff --git a/quantum/keycode.h b/quantum/keycode.h index 38a29b439ba0..3c80a386d18b 100644 --- a/quantum/keycode.h +++ b/quantum/keycode.h @@ -35,8 +35,6 @@ along with this program. If not, see . #define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) #define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRID) -#define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31) - #define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2) #define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) #define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN8) @@ -62,11 +60,6 @@ along with this program. If not, see . #define MOD_MASK_SAG (MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) #define MOD_MASK_CSAG (MOD_MASK_CTRL | MOD_MASK_SHIFT | MOD_MASK_ALT | MOD_MASK_GUI) -#define FN_BIT(code) (1 << FN_INDEX(code)) -#define FN_INDEX(code) ((code)-KC_FN0) -#define FN_MIN KC_FN0 -#define FN_MAX KC_FN31 - // clang-format off /* @@ -258,7 +251,7 @@ enum hid_keyboard_keypad_usage { KC_J, KC_K, KC_L, - KC_M, // 0x10 + KC_M, // 0x10 KC_N, KC_O, KC_P, @@ -274,7 +267,7 @@ enum hid_keyboard_keypad_usage { KC_Z, KC_1, KC_2, - KC_3, // 0x20 + KC_3, // 0x20 KC_4, KC_5, KC_6, @@ -290,7 +283,7 @@ enum hid_keyboard_keypad_usage { KC_MINUS, KC_EQUAL, KC_LEFT_BRACKET, - KC_RIGHT_BRACKET, // 0x30 + KC_RIGHT_BRACKET, // 0x30 KC_BACKSLASH, KC_NONUS_HASH, KC_SEMICOLON, @@ -306,7 +299,7 @@ enum hid_keyboard_keypad_usage { KC_F4, KC_F5, KC_F6, - KC_F7, // 0x40 + KC_F7, // 0x40 KC_F8, KC_F9, KC_F10, @@ -322,7 +315,7 @@ enum hid_keyboard_keypad_usage { KC_END, KC_PAGE_DOWN, KC_RIGHT, - KC_LEFT, // 0x50 + KC_LEFT, // 0x50 KC_DOWN, KC_UP, KC_NUM_LOCK, @@ -338,7 +331,7 @@ enum hid_keyboard_keypad_usage { KC_KP_5, KC_KP_6, KC_KP_7, - KC_KP_8, // 0x60 + KC_KP_8, // 0x60 KC_KP_9, KC_KP_0, KC_KP_DOT, @@ -354,7 +347,7 @@ enum hid_keyboard_keypad_usage { KC_F18, KC_F19, KC_F20, - KC_F21, // 0x70 + KC_F21, // 0x70 KC_F22, KC_F23, KC_F24, @@ -370,7 +363,7 @@ enum hid_keyboard_keypad_usage { KC_PASTE, KC_FIND, KC_KB_MUTE, - KC_KB_VOLUME_UP, // 0x80 + KC_KB_VOLUME_UP, // 0x80 KC_KB_VOLUME_DOWN, KC_LOCKING_CAPS_LOCK, KC_LOCKING_NUM_LOCK, @@ -386,7 +379,7 @@ enum hid_keyboard_keypad_usage { KC_INTERNATIONAL_7, KC_INTERNATIONAL_8, KC_INTERNATIONAL_9, - KC_LANGUAGE_1, // 0x90 + KC_LANGUAGE_1, // 0x90 KC_LANGUAGE_2, KC_LANGUAGE_3, KC_LANGUAGE_4, @@ -402,7 +395,7 @@ enum hid_keyboard_keypad_usage { KC_PRIOR, KC_RETURN, KC_SEPARATOR, - KC_OUT, // 0xA0 + KC_OUT, // 0xA0 KC_OPER, KC_CLEAR_AGAIN, KC_CRSEL, @@ -495,7 +488,7 @@ enum internal_special_keycodes { KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_SELECT, - KC_MEDIA_EJECT, // 0xB0 + KC_MEDIA_EJECT, // 0xB0 KC_MAIL, KC_CALCULATOR, KC_MY_COMPUTER, @@ -509,41 +502,7 @@ enum internal_special_keycodes { KC_MEDIA_FAST_FORWARD, KC_MEDIA_REWIND, KC_BRIGHTNESS_UP, - KC_BRIGHTNESS_DOWN, - - /* Fn keys */ - KC_FN0 = 0xC0, - KC_FN1, - KC_FN2, - KC_FN3, - KC_FN4, - KC_FN5, - KC_FN6, - KC_FN7, - KC_FN8, - KC_FN9, - KC_FN10, - KC_FN11, - KC_FN12, - KC_FN13, - KC_FN14, - KC_FN15, - KC_FN16, // 0xD0 - KC_FN17, - KC_FN18, - KC_FN19, - KC_FN20, - KC_FN21, - KC_FN22, - KC_FN23, - KC_FN24, - KC_FN25, - KC_FN26, - KC_FN27, - KC_FN28, - KC_FN29, - KC_FN30, - KC_FN31 + KC_BRIGHTNESS_DOWN }; enum mouse_keys { @@ -555,7 +514,7 @@ enum mouse_keys { #endif KC_MS_DOWN, KC_MS_LEFT, - KC_MS_RIGHT, // 0xF0 + KC_MS_RIGHT, // 0xF0 KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, @@ -580,7 +539,7 @@ enum mouse_keys { /* Acceleration */ KC_MS_ACCEL0, KC_MS_ACCEL1, - KC_MS_ACCEL2 // 0xFF + KC_MS_ACCEL2 // 0xFF }; #include "keycode_legacy.h" diff --git a/quantum/keymap.h b/quantum/keymap.h index 191e81397789..2ee2e1b57625 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -27,7 +27,6 @@ along with this program. If not, see . # include #endif #include "keycode.h" -#include "action_macro.h" #include "report.h" #include "host.h" // #include "print.h" @@ -35,9 +34,9 @@ along with this program. If not, see . #include "keycode_config.h" // ChibiOS uses RESET in its FlagStatus enumeration -// Therefore define it as QK_RESET here, to avoid name collision +// Therefore define it as QK_BOOTLOADER here, to avoid name collision #if defined(PROTOCOL_CHIBIOS) -# define RESET QK_RESET +# define RESET QK_BOOTLOADER #endif // Gross hack, remove me and change RESET keycode to QK_BOOT #if defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__) @@ -49,8 +48,4 @@ along with this program. If not, see . // translates key to keycode uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); -// translates function id to action -uint16_t keymap_function_id_to_action(uint16_t function_id); - extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 5007f15f1116..a91b2a0b36a1 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -20,7 +20,6 @@ along with this program. If not, see . #include "keycode.h" #include "action_layer.h" #include "action.h" -#include "action_macro.h" #include "debug.h" #include "quantum.h" @@ -78,26 +77,8 @@ action_t action_for_keycode(uint16_t keycode) { case QK_MODS ... QK_MODS_MAX:; // Has a modifier // Split it up - action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); // adds modifier to key + action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); // adds modifier to key break; -#ifndef NO_ACTION_FUNCTION - case KC_FN0 ... KC_FN31: - action.code = keymap_function_id_to_action(FN_INDEX(keycode)); - break; - case QK_FUNCTION ... QK_FUNCTION_MAX:; - // Is a shortcut for function action_layer, pull last 12bits - // This means we have 4,096 FN macros at our disposal - action.code = keymap_function_id_to_action((int)keycode & 0xFFF); - break; -#endif -#ifndef NO_ACTION_MACRO - case QK_MACRO ... QK_MACRO_MAX: - if (keycode & 0x800) // tap macros have upper bit set - action.code = ACTION_MACRO_TAP(keycode & 0xFF); - else - action.code = ACTION_MACRO(keycode & 0xFF); - break; -#endif #ifndef NO_ACTION_LAYER case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); @@ -165,30 +146,8 @@ action_t action_for_keycode(uint16_t keycode) { return action; } -__attribute__((weak)) const uint16_t PROGMEM fn_actions[] = { - -}; - -/* Macro */ -__attribute__((weak)) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; } - -/* Function */ -__attribute__((weak)) void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {} - // translates key to keycode __attribute__((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { // Read entire word (16bits) return pgm_read_word(&keymaps[(layer)][(key.row)][(key.col)]); } - -// translates function id to action -__attribute__((weak)) uint16_t keymap_function_id_to_action(uint16_t function_id) { -// The compiler sees the empty (weak) fn_actions and generates a warning -// This function should not be called in that case, so the warning is too strict -// If this function is called however, the keymap should have overridden fn_actions, and then the compile -// is comparing against the wrong array -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Warray-bounds" - return pgm_read_word(&fn_actions[function_id]); -#pragma GCC diagnostic pop -} diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 76d2f4f6b0b3..55a58a25b07e 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -24,7 +24,7 @@ #define NO_ACUT KC_EQL #define NO_AM KC_LBRC -#define NO_QUOT KC_RBRC // this is the "umlaut" char on Nordic keyboards, Apple layout +#define NO_QUOT KC_RBRC // this is the "umlaut" char on Nordic keyboards, Apple layout #define NO_AE KC_SCLN #define NO_OSLH KC_QUOT #define NO_APOS KC_NUHS diff --git a/quantum/keymap_extras/keymap_steno.h b/quantum/keymap_extras/keymap_steno.h index 310aa0740947..e888ccd64374 100644 --- a/quantum/keymap_extras/keymap_steno.h +++ b/quantum/keymap_extras/keymap_steno.h @@ -70,7 +70,7 @@ enum steno_keycodes { STN_NB, STN_NC, STN_ZR, - STN__MAX = STN_ZR, // must be less than QK_STENO_BOLT + STN__MAX = STN_ZR, // must be less than QK_STENO_BOLT }; #ifdef STENO_COMBINEDMAP diff --git a/quantum/led.c b/quantum/led.c index 8f0eccf55d85..c5ddbc22c5af 100644 --- a/quantum/led.c +++ b/quantum/led.c @@ -13,21 +13,26 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "quantum.h" +#include "led.h" +#include "host.h" +#include "debug.h" +#include "gpio.h" -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" +#ifdef BACKLIGHT_CAPS_LOCK +# ifdef BACKLIGHT_ENABLE +# include "backlight.h" extern backlight_config_t backlight_config; -#else -// Cannot use BACKLIGHT_CAPS_LOCK without backlight being enabled -# undef BACKLIGHT_CAPS_LOCK +# else +# pragma message "Cannot use BACKLIGHT_CAPS_LOCK without backlight being enabled" +# undef BACKLIGHT_CAPS_LOCK +# endif #endif #ifndef LED_PIN_ON_STATE # define LED_PIN_ON_STATE 1 #endif -#if defined(BACKLIGHT_CAPS_LOCK) +#ifdef BACKLIGHT_CAPS_LOCK /** \brief Caps Lock indicator using backlight (for keyboards without dedicated LED) */ static void handle_backlight_caps_lock(led_t led_state) { @@ -59,13 +64,17 @@ __attribute__((weak)) void led_set_user(uint8_t usb_led) {} * * \deprecated Use led_update_kb() instead. */ -__attribute__((weak)) void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } +__attribute__((weak)) void led_set_kb(uint8_t usb_led) { + led_set_user(usb_led); +} /** \brief Lock LED update callback - keymap/user level * * \return True if led_update_kb() should run its own code, false otherwise. */ -__attribute__((weak)) bool led_update_user(led_t led_state) { return true; } +__attribute__((weak)) bool led_update_user(led_t led_state) { + return true; +} /** \brief Lock LED update callback - keyboard level * @@ -135,3 +144,43 @@ __attribute__((weak)) void led_set(uint8_t usb_led) { led_set_kb(usb_led); led_update_kb((led_t)usb_led); } + +/** \brief Trigger behaviour on transition to suspend + */ +void led_suspend(void) { + uint8_t leds_off = 0; +#ifdef BACKLIGHT_CAPS_LOCK + if (is_backlight_enabled()) { + // Don't try to turn off Caps Lock indicator as it is backlight and backlight is already off + leds_off |= (1 << USB_LED_CAPS_LOCK); + } +#endif + led_set(leds_off); +} + +/** \brief Trigger behaviour on transition from suspend + */ +void led_wakeup(void) { + led_set(host_keyboard_leds()); +} + +/** \brief set host led state + * + * Only sets state if change detected + */ +void led_task(void) { + static uint8_t last_led_status = 0; + + // update LED + uint8_t led_status = host_keyboard_leds(); + if (last_led_status != led_status) { + last_led_status = led_status; + + if (debug_keyboard) { + debug("led_task: "); + debug_hex8(led_status); + debug("\n"); + } + led_set(led_status); + } +} diff --git a/quantum/led.h b/quantum/led.h index 0fe38ea035a8..934d25312cc9 100644 --- a/quantum/led.h +++ b/quantum/led.h @@ -49,6 +49,18 @@ void led_set(uint8_t usb_led); void led_init_ports(void); +void led_suspend(void); + +void led_wakeup(void); + +void led_task(void); + +/* Callbacks */ +void led_set_user(uint8_t usb_led); +void led_set_kb(uint8_t usb_led); +bool led_update_user(led_t led_state); +bool led_update_kb(led_t led_state); + #ifdef __cplusplus } #endif diff --git a/quantum/led_matrix/animations/alpha_mods_anim.h b/quantum/led_matrix/animations/alpha_mods_anim.h index 4d017894a11b..01acb3f933c7 100644 --- a/quantum/led_matrix/animations/alpha_mods_anim.h +++ b/quantum/led_matrix/animations/alpha_mods_anim.h @@ -20,5 +20,5 @@ bool ALPHAS_MODS(effect_params_t* params) { return led_matrix_check_finished_leds(led_max); } -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_ALPHAS_MODS +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_ALPHAS_MODS diff --git a/quantum/led_matrix/animations/band_anim.h b/quantum/led_matrix/animations/band_anim.h index 293be4f67adc..d9491849eaed 100644 --- a/quantum/led_matrix/animations/band_anim.h +++ b/quantum/led_matrix/animations/band_anim.h @@ -7,7 +7,9 @@ static uint8_t BAND_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(v < 0 ? 0 : v, val); } -bool BAND(effect_params_t* params) { return effect_runner_i(params, &BAND_math); } +bool BAND(effect_params_t* params) { + return effect_runner_i(params, &BAND_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_BAND +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_BAND diff --git a/quantum/led_matrix/animations/band_pinwheel_anim.h b/quantum/led_matrix/animations/band_pinwheel_anim.h index f47a3869ce5a..482d183eb6e4 100644 --- a/quantum/led_matrix/animations/band_pinwheel_anim.h +++ b/quantum/led_matrix/animations/band_pinwheel_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(BAND_PINWHEEL) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t BAND_PINWHEEL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t time) { return scale8(val - time - atan2_8(dy, dx) * 3, val); } +static uint8_t BAND_PINWHEEL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t time) { + return scale8(val - time - atan2_8(dy, dx) * 3, val); +} -bool BAND_PINWHEEL(effect_params_t* params) { return effect_runner_dx_dy(params, &BAND_PINWHEEL_math); } +bool BAND_PINWHEEL(effect_params_t* params) { + return effect_runner_dx_dy(params, &BAND_PINWHEEL_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_BAND_PINWHEEL +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_BAND_PINWHEEL diff --git a/quantum/led_matrix/animations/band_spiral_anim.h b/quantum/led_matrix/animations/band_spiral_anim.h index a4bd38218173..ef93d192701c 100644 --- a/quantum/led_matrix/animations/band_spiral_anim.h +++ b/quantum/led_matrix/animations/band_spiral_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(BAND_SPIRAL) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t BAND_SPIRAL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { return scale8(val + dist - time - atan2_8(dy, dx), val); } +static uint8_t BAND_SPIRAL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { + return scale8(val + dist - time - atan2_8(dy, dx), val); +} -bool BAND_SPIRAL(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_math); } +bool BAND_SPIRAL(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_BAND_SPIRAL +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_BAND_SPIRAL diff --git a/quantum/led_matrix/animations/breathing_anim.h b/quantum/led_matrix/animations/breathing_anim.h index 899925f516d1..0bd4cb0cc388 100644 --- a/quantum/led_matrix/animations/breathing_anim.h +++ b/quantum/led_matrix/animations/breathing_anim.h @@ -15,5 +15,5 @@ bool BREATHING(effect_params_t* params) { return led_matrix_check_finished_leds(led_max); } -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_BREATHING +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_BREATHING diff --git a/quantum/led_matrix/animations/cycle_left_right_anim.h b/quantum/led_matrix/animations/cycle_left_right_anim.h index 1a8999b8313c..0a339e6d62b7 100644 --- a/quantum/led_matrix/animations/cycle_left_right_anim.h +++ b/quantum/led_matrix/animations/cycle_left_right_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(CYCLE_LEFT_RIGHT) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t CYCLE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(g_led_config.point[i].x - time, val); } +static uint8_t CYCLE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { + return scale8(g_led_config.point[i].x - time, val); +} -bool CYCLE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); } +bool CYCLE_LEFT_RIGHT(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_CYCLE_LEFT_RIGHT +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_CYCLE_LEFT_RIGHT diff --git a/quantum/led_matrix/animations/cycle_out_in_anim.h b/quantum/led_matrix/animations/cycle_out_in_anim.h index 77d3a14b6ff7..8311d97fe894 100644 --- a/quantum/led_matrix/animations/cycle_out_in_anim.h +++ b/quantum/led_matrix/animations/cycle_out_in_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(CYCLE_OUT_IN) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t CYCLE_OUT_IN_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { return scale8(3 * dist / 2 + time, val); } +static uint8_t CYCLE_OUT_IN_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { + return scale8(3 * dist / 2 + time, val); +} -bool CYCLE_OUT_IN(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); } +bool CYCLE_OUT_IN(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_CYCLE_OUT_IN +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_CYCLE_OUT_IN diff --git a/quantum/led_matrix/animations/cycle_up_down_anim.h b/quantum/led_matrix/animations/cycle_up_down_anim.h index b25947199c13..7e2d71a0f1f3 100644 --- a/quantum/led_matrix/animations/cycle_up_down_anim.h +++ b/quantum/led_matrix/animations/cycle_up_down_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(CYCLE_UP_DOWN) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t CYCLE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(g_led_config.point[i].y - time, val); } +static uint8_t CYCLE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { + return scale8(g_led_config.point[i].y - time, val); +} -bool CYCLE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &CYCLE_UP_DOWN_math); } +bool CYCLE_UP_DOWN(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_UP_DOWN_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_CYCLE_UP_DOWN +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_CYCLE_UP_DOWN diff --git a/quantum/led_matrix/animations/dual_beacon_anim.h b/quantum/led_matrix/animations/dual_beacon_anim.h index 81735e323cb0..1dfb5ffe5231 100644 --- a/quantum/led_matrix/animations/dual_beacon_anim.h +++ b/quantum/led_matrix/animations/dual_beacon_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(DUAL_BEACON) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t DUAL_BEACON_math(uint8_t val, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { return scale8(((g_led_config.point[i].y - k_led_matrix_center.y) * cos + (g_led_config.point[i].x - k_led_matrix_center.x) * sin) / 128, val); } +static uint8_t DUAL_BEACON_math(uint8_t val, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { + return scale8(((g_led_config.point[i].y - k_led_matrix_center.y) * cos + (g_led_config.point[i].x - k_led_matrix_center.x) * sin) / 128, val); +} -bool DUAL_BEACON(effect_params_t* params) { return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); } +bool DUAL_BEACON(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_DUAL_BEACON +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_DUAL_BEACON diff --git a/quantum/led_matrix/animations/runners/effect_runner_reactive.h b/quantum/led_matrix/animations/runners/effect_runner_reactive.h index be3090aa5320..846845874425 100644 --- a/quantum/led_matrix/animations/runners/effect_runner_reactive.h +++ b/quantum/led_matrix/animations/runners/effect_runner_reactive.h @@ -25,4 +25,4 @@ bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { return led_matrix_check_finished_leds(led_max); } -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/runners/effect_runner_reactive_splash.h b/quantum/led_matrix/animations/runners/effect_runner_reactive_splash.h index f6ffc825a1ee..aec4a6ffdafb 100644 --- a/quantum/led_matrix/animations/runners/effect_runner_reactive_splash.h +++ b/quantum/led_matrix/animations/runners/effect_runner_reactive_splash.h @@ -23,4 +23,4 @@ bool effect_runner_reactive_splash(uint8_t start, effect_params_t* params, react return led_matrix_check_finished_leds(led_max); } -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/solid_anim.h b/quantum/led_matrix/animations/solid_anim.h index c728dbcc98d9..895542e15294 100644 --- a/quantum/led_matrix/animations/solid_anim.h +++ b/quantum/led_matrix/animations/solid_anim.h @@ -12,4 +12,4 @@ bool SOLID(effect_params_t* params) { return led_matrix_check_finished_leds(led_max); } -#endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/quantum/led_matrix/animations/solid_reactive_cross.h b/quantum/led_matrix/animations/solid_reactive_cross.h index a149e9a9290f..55a2556996ff 100644 --- a/quantum/led_matrix/animations/solid_reactive_cross.h +++ b/quantum/led_matrix/animations/solid_reactive_cross.h @@ -23,13 +23,17 @@ static uint8_t SOLID_REACTIVE_CROSS_math(uint8_t val, int16_t dx, int16_t dy, ui } # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_CROSS -bool SOLID_REACTIVE_CROSS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); } +bool SOLID_REACTIVE_CROSS(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); +} # endif # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS -bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); } +bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); +} # endif -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS) -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS) +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/solid_reactive_nexus.h b/quantum/led_matrix/animations/solid_reactive_nexus.h index 5a86e48c6c31..b1ec54e3b129 100644 --- a/quantum/led_matrix/animations/solid_reactive_nexus.h +++ b/quantum/led_matrix/animations/solid_reactive_nexus.h @@ -20,13 +20,17 @@ static uint8_t SOLID_REACTIVE_NEXUS_math(uint8_t val, int16_t dx, int16_t dy, ui } # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS -bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); } +bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); +} # endif # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS -bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); } +bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); +} # endif -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/solid_reactive_simple_anim.h b/quantum/led_matrix/animations/solid_reactive_simple_anim.h index 14f5e90730f1..3b289c78dd4c 100644 --- a/quantum/led_matrix/animations/solid_reactive_simple_anim.h +++ b/quantum/led_matrix/animations/solid_reactive_simple_anim.h @@ -3,10 +3,14 @@ LED_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t SOLID_REACTIVE_SIMPLE_math(uint8_t val, uint16_t offset) { return scale8(255 - offset, val); } +static uint8_t SOLID_REACTIVE_SIMPLE_math(uint8_t val, uint16_t offset) { + return scale8(255 - offset, val); +} -bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); } +bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { + return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // ENABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // ENABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/solid_reactive_wide.h b/quantum/led_matrix/animations/solid_reactive_wide.h index 9f039c45d4c3..dda54eab2c66 100644 --- a/quantum/led_matrix/animations/solid_reactive_wide.h +++ b/quantum/led_matrix/animations/solid_reactive_wide.h @@ -18,13 +18,17 @@ static uint8_t SOLID_REACTIVE_WIDE_math(uint8_t val, int16_t dx, int16_t dy, uin } # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_WIDE -bool SOLID_REACTIVE_WIDE(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); } +bool SOLID_REACTIVE_WIDE(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); +} # endif # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE -bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); } +bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); +} # endif -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE) -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE) +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/solid_splash_anim.h b/quantum/led_matrix/animations/solid_splash_anim.h index 17b692a09a21..b8b6e8ea5ef4 100644 --- a/quantum/led_matrix/animations/solid_splash_anim.h +++ b/quantum/led_matrix/animations/solid_splash_anim.h @@ -18,13 +18,17 @@ uint8_t SOLID_SPLASH_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uin } # ifdef ENABLE_LED_MATRIX_SOLID_SPLASH -bool SOLID_SPLASH(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); } +bool SOLID_SPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); +} # endif # ifdef ENABLE_LED_MATRIX_SOLID_MULTISPLASH -bool SOLID_MULTISPLASH(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); } +bool SOLID_MULTISPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); +} # endif -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // defined(ENABLE_LED_MATRIX_SPLASH) || defined(ENABLE_LED_MATRIX_MULTISPLASH) -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // defined(ENABLE_LED_MATRIX_SPLASH) || defined(ENABLE_LED_MATRIX_MULTISPLASH) +#endif // LED_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/led_matrix/animations/wave_left_right_anim.h b/quantum/led_matrix/animations/wave_left_right_anim.h index 76487f85155b..8dedd647388d 100644 --- a/quantum/led_matrix/animations/wave_left_right_anim.h +++ b/quantum/led_matrix/animations/wave_left_right_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(WAVE_LEFT_RIGHT) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t WAVE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(sin8(g_led_config.point[i].x - time), val); } +static uint8_t WAVE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { + return scale8(sin8(g_led_config.point[i].x - time), val); +} -bool WAVE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &WAVE_LEFT_RIGHT_math); } +bool WAVE_LEFT_RIGHT(effect_params_t* params) { + return effect_runner_i(params, &WAVE_LEFT_RIGHT_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_WAVE_LEFT_RIGHT +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_WAVE_LEFT_RIGHT diff --git a/quantum/led_matrix/animations/wave_up_down_anim.h b/quantum/led_matrix/animations/wave_up_down_anim.h index 94710f5c6e90..4564f3e493e2 100644 --- a/quantum/led_matrix/animations/wave_up_down_anim.h +++ b/quantum/led_matrix/animations/wave_up_down_anim.h @@ -2,9 +2,13 @@ LED_MATRIX_EFFECT(WAVE_UP_DOWN) # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS -static uint8_t WAVE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(sin8(g_led_config.point[i].y - time), val); } +static uint8_t WAVE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { + return scale8(sin8(g_led_config.point[i].y - time), val); +} -bool WAVE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &WAVE_UP_DOWN_math); } +bool WAVE_UP_DOWN(effect_params_t* params) { + return effect_runner_i(params, &WAVE_UP_DOWN_math); +} -# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_LED_MATRIX_WAVE_UP_DOWN +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_LED_MATRIX_WAVE_UP_DOWN diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index be1494e88461..38ed79bed05e 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c @@ -88,14 +88,14 @@ const led_point_t k_led_matrix_center = LED_MATRIX_CENTER; #endif // globals -led_eeconfig_t led_matrix_eeconfig; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr +led_eeconfig_t led_matrix_eeconfig; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr uint32_t g_led_timer; #ifdef LED_MATRIX_FRAMEBUFFER_EFFECTS uint8_t g_led_frame_buffer[MATRIX_ROWS][MATRIX_COLS] = {{0}}; -#endif // LED_MATRIX_FRAMEBUFFER_EFFECTS +#endif // LED_MATRIX_FRAMEBUFFER_EFFECTS #ifdef LED_MATRIX_KEYREACTIVE_ENABLED last_hit_t g_last_hit_tracker; -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED // internals static bool suspend_state = false; @@ -105,13 +105,13 @@ static effect_params_t led_effect_params = {0, LED_FLAG_ALL, false}; static led_task_states led_task_state = SYNCING; #if LED_DISABLE_TIMEOUT > 0 static uint32_t led_anykey_timer; -#endif // LED_DISABLE_TIMEOUT > 0 +#endif // LED_DISABLE_TIMEOUT > 0 // double buffers static uint32_t led_timer_buffer; #ifdef LED_MATRIX_KEYREACTIVE_ENABLED static last_hit_t last_hit_buffer; -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED // split led matrix #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) @@ -120,7 +120,9 @@ const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; EECONFIG_DEBOUNCE_HELPER(led_matrix, EECONFIG_LED_MATRIX, led_matrix_eeconfig); -void eeconfig_update_led_matrix(void) { eeconfig_flush_led_matrix(true); } +void eeconfig_update_led_matrix(void) { + eeconfig_flush_led_matrix(true); +} void eeconfig_update_led_matrix_default(void) { dprintf("eeconfig_update_led_matrix_default\n"); @@ -141,7 +143,9 @@ void eeconfig_debug_led_matrix(void) { dprintf("led_matrix_eeconfig.flags = %d\n", led_matrix_eeconfig.flags); } -__attribute__((weak)) uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { return 0; } +__attribute__((weak)) uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + return 0; +} uint8_t led_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { uint8_t led_count = led_matrix_map_row_column_to_led_kb(row, column, led_i); @@ -153,7 +157,9 @@ uint8_t led_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *l return led_count; } -void led_matrix_update_pwm_buffers(void) { led_matrix_driver.flush(); } +void led_matrix_update_pwm_buffers(void) { + led_matrix_driver.flush(); +} void led_matrix_set_value(int index, uint8_t value) { #ifdef USE_CIE1931_CURVE @@ -164,7 +170,8 @@ void led_matrix_set_value(int index, uint8_t value) { void led_matrix_set_value_all(uint8_t value) { #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) led_matrix_set_value(i, value); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) + led_matrix_set_value(i, value); #else # ifdef USE_CIE1931_CURVE led_matrix_driver.set_value_all(pgm_read_byte(&CIE1931_CURVE[value])); @@ -180,7 +187,7 @@ void process_led_matrix(uint8_t row, uint8_t col, bool pressed) { #endif #if LED_DISABLE_TIMEOUT > 0 led_anykey_timer = 0; -#endif // LED_DISABLE_TIMEOUT > 0 +#endif // LED_DISABLE_TIMEOUT > 0 #ifdef LED_MATRIX_KEYREACTIVE_ENABLED uint8_t led[LED_HITS_TO_REMEMBER]; @@ -190,7 +197,7 @@ void process_led_matrix(uint8_t row, uint8_t col, bool pressed) { if (!pressed) # elif defined(LED_MATRIX_KEYPRESSES) if (pressed) -# endif // defined(LED_MATRIX_KEYRELEASES) +# endif // defined(LED_MATRIX_KEYRELEASES) { led_count = led_matrix_map_row_column_to_led(row, col, led); } @@ -198,7 +205,7 @@ void process_led_matrix(uint8_t row, uint8_t col, bool pressed) { if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) { memcpy(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count); memcpy(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count); - memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit + memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit memcpy(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count); last_hit_buffer.count = LED_HITS_TO_REMEMBER - led_count; } @@ -211,13 +218,13 @@ void process_led_matrix(uint8_t row, uint8_t col, bool pressed) { last_hit_buffer.tick[index] = 0; last_hit_buffer.count++; } -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED #if defined(LED_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_LED_MATRIX_TYPING_HEATMAP) if (led_matrix_eeconfig.mode == LED_MATRIX_TYPING_HEATMAP) { process_led_matrix_typing_heatmap(row, col); } -#endif // defined(LED_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_LED_MATRIX_TYPING_HEATMAP) +#endif // defined(LED_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_LED_MATRIX_TYPING_HEATMAP) } static bool led_matrix_none(effect_params_t *params) { @@ -232,7 +239,7 @@ static bool led_matrix_none(effect_params_t *params) { static void led_task_timers(void) { #if defined(LED_MATRIX_KEYREACTIVE_ENABLED) || LED_DISABLE_TIMEOUT > 0 uint32_t deltaTime = sync_timer_elapsed32(led_timer_buffer); -#endif // defined(LED_MATRIX_KEYREACTIVE_ENABLED) || LED_DISABLE_TIMEOUT > 0 +#endif // defined(LED_MATRIX_KEYREACTIVE_ENABLED) || LED_DISABLE_TIMEOUT > 0 led_timer_buffer = sync_timer_read32(); // Update double buffer timers @@ -244,7 +251,7 @@ static void led_task_timers(void) { led_anykey_timer += deltaTime; } } -#endif // LED_DISABLE_TIMEOUT > 0 +#endif // LED_DISABLE_TIMEOUT > 0 // Update double buffer last hit timers #ifdef LED_MATRIX_KEYREACTIVE_ENABLED @@ -256,7 +263,7 @@ static void led_task_timers(void) { } last_hit_buffer.tick[i] += deltaTime; } -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED } static void led_task_sync(void) { @@ -273,7 +280,7 @@ static void led_task_start(void) { g_led_timer = led_timer_buffer; #ifdef LED_MATRIX_KEYREACTIVE_ENABLED g_last_hit_tracker = last_hit_buffer; -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED // next task led_task_state = RENDERING; @@ -352,7 +359,7 @@ void led_matrix_task(void) { bool suspend_backlight = suspend_state || #if LED_DISABLE_TIMEOUT > 0 (led_anykey_timer > (uint32_t)LED_DISABLE_TIMEOUT) || -#endif // LED_DISABLE_TIMEOUT > 0 +#endif // LED_DISABLE_TIMEOUT > 0 false; uint8_t effect = suspend_backlight || !led_matrix_eeconfig.enable ? 0 : led_matrix_eeconfig.mode; @@ -421,7 +428,7 @@ void led_matrix_init(void) { for (uint8_t i = 0; i < LED_HITS_TO_REMEMBER; ++i) { last_hit_buffer.tick[i] = UINT16_MAX; } -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED if (!eeconfig_is_enabled()) { dprintf("led_matrix_init_drivers eeconfig is not enabled.\n"); @@ -434,20 +441,22 @@ void led_matrix_init(void) { dprintf("led_matrix_init_drivers led_matrix_eeconfig.mode = 0. Write default values to EEPROM.\n"); eeconfig_update_led_matrix_default(); } - eeconfig_debug_led_matrix(); // display current eeprom values + eeconfig_debug_led_matrix(); // display current eeprom values } void led_matrix_set_suspend_state(bool state) { #ifdef LED_DISABLE_WHEN_USB_SUSPENDED - if (state && !suspend_state && is_keyboard_master()) { // only run if turning off, and only once - led_task_render(0); // turn off all LEDs when suspending - led_task_flush(0); // and actually flash led state to LEDs + if (state && !suspend_state && is_keyboard_master()) { // only run if turning off, and only once + led_task_render(0); // turn off all LEDs when suspending + led_task_flush(0); // and actually flash led state to LEDs } suspend_state = state; #endif } -bool led_matrix_get_suspend_state(void) { return suspend_state; } +bool led_matrix_get_suspend_state(void) { + return suspend_state; +} void led_matrix_toggle_eeprom_helper(bool write_to_eeprom) { led_matrix_eeconfig.enable ^= 1; @@ -455,8 +464,12 @@ void led_matrix_toggle_eeprom_helper(bool write_to_eeprom) { eeconfig_flag_led_matrix(write_to_eeprom); dprintf("led matrix toggle [%s]: led_matrix_eeconfig.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.enable); } -void led_matrix_toggle_noeeprom(void) { led_matrix_toggle_eeprom_helper(false); } -void led_matrix_toggle(void) { led_matrix_toggle_eeprom_helper(true); } +void led_matrix_toggle_noeeprom(void) { + led_matrix_toggle_eeprom_helper(false); +} +void led_matrix_toggle(void) { + led_matrix_toggle_eeprom_helper(true); +} void led_matrix_enable(void) { led_matrix_enable_noeeprom(); @@ -478,7 +491,9 @@ void led_matrix_disable_noeeprom(void) { led_matrix_eeconfig.enable = 0; } -uint8_t led_matrix_is_enabled(void) { return led_matrix_eeconfig.enable; } +uint8_t led_matrix_is_enabled(void) { + return led_matrix_eeconfig.enable; +} void led_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { if (!led_matrix_eeconfig.enable) { @@ -495,24 +510,38 @@ void led_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { eeconfig_flag_led_matrix(write_to_eeprom); dprintf("led matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.mode); } -void led_matrix_mode_noeeprom(uint8_t mode) { led_matrix_mode_eeprom_helper(mode, false); } -void led_matrix_mode(uint8_t mode) { led_matrix_mode_eeprom_helper(mode, true); } +void led_matrix_mode_noeeprom(uint8_t mode) { + led_matrix_mode_eeprom_helper(mode, false); +} +void led_matrix_mode(uint8_t mode) { + led_matrix_mode_eeprom_helper(mode, true); +} -uint8_t led_matrix_get_mode(void) { return led_matrix_eeconfig.mode; } +uint8_t led_matrix_get_mode(void) { + return led_matrix_eeconfig.mode; +} void led_matrix_step_helper(bool write_to_eeprom) { uint8_t mode = led_matrix_eeconfig.mode + 1; led_matrix_mode_eeprom_helper((mode < LED_MATRIX_EFFECT_MAX) ? mode : 1, write_to_eeprom); } -void led_matrix_step_noeeprom(void) { led_matrix_step_helper(false); } -void led_matrix_step(void) { led_matrix_step_helper(true); } +void led_matrix_step_noeeprom(void) { + led_matrix_step_helper(false); +} +void led_matrix_step(void) { + led_matrix_step_helper(true); +} void led_matrix_step_reverse_helper(bool write_to_eeprom) { uint8_t mode = led_matrix_eeconfig.mode - 1; led_matrix_mode_eeprom_helper((mode < 1) ? LED_MATRIX_EFFECT_MAX - 1 : mode, write_to_eeprom); } -void led_matrix_step_reverse_noeeprom(void) { led_matrix_step_reverse_helper(false); } -void led_matrix_step_reverse(void) { led_matrix_step_reverse_helper(true); } +void led_matrix_step_reverse_noeeprom(void) { + led_matrix_step_reverse_helper(false); +} +void led_matrix_step_reverse(void) { + led_matrix_step_reverse_helper(true); +} void led_matrix_set_val_eeprom_helper(uint8_t val, bool write_to_eeprom) { if (!led_matrix_eeconfig.enable) { @@ -522,37 +551,77 @@ void led_matrix_set_val_eeprom_helper(uint8_t val, bool write_to_eeprom) { eeconfig_flag_led_matrix(write_to_eeprom); dprintf("led matrix set val [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.val); } -void led_matrix_set_val_noeeprom(uint8_t val) { led_matrix_set_val_eeprom_helper(val, false); } -void led_matrix_set_val(uint8_t val) { led_matrix_set_val_eeprom_helper(val, true); } +void led_matrix_set_val_noeeprom(uint8_t val) { + led_matrix_set_val_eeprom_helper(val, false); +} +void led_matrix_set_val(uint8_t val) { + led_matrix_set_val_eeprom_helper(val, true); +} -uint8_t led_matrix_get_val(void) { return led_matrix_eeconfig.val; } +uint8_t led_matrix_get_val(void) { + return led_matrix_eeconfig.val; +} -void led_matrix_increase_val_helper(bool write_to_eeprom) { led_matrix_set_val_eeprom_helper(qadd8(led_matrix_eeconfig.val, LED_MATRIX_VAL_STEP), write_to_eeprom); } -void led_matrix_increase_val_noeeprom(void) { led_matrix_increase_val_helper(false); } -void led_matrix_increase_val(void) { led_matrix_increase_val_helper(true); } +void led_matrix_increase_val_helper(bool write_to_eeprom) { + led_matrix_set_val_eeprom_helper(qadd8(led_matrix_eeconfig.val, LED_MATRIX_VAL_STEP), write_to_eeprom); +} +void led_matrix_increase_val_noeeprom(void) { + led_matrix_increase_val_helper(false); +} +void led_matrix_increase_val(void) { + led_matrix_increase_val_helper(true); +} -void led_matrix_decrease_val_helper(bool write_to_eeprom) { led_matrix_set_val_eeprom_helper(qsub8(led_matrix_eeconfig.val, LED_MATRIX_VAL_STEP), write_to_eeprom); } -void led_matrix_decrease_val_noeeprom(void) { led_matrix_decrease_val_helper(false); } -void led_matrix_decrease_val(void) { led_matrix_decrease_val_helper(true); } +void led_matrix_decrease_val_helper(bool write_to_eeprom) { + led_matrix_set_val_eeprom_helper(qsub8(led_matrix_eeconfig.val, LED_MATRIX_VAL_STEP), write_to_eeprom); +} +void led_matrix_decrease_val_noeeprom(void) { + led_matrix_decrease_val_helper(false); +} +void led_matrix_decrease_val(void) { + led_matrix_decrease_val_helper(true); +} void led_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { led_matrix_eeconfig.speed = speed; eeconfig_flag_led_matrix(write_to_eeprom); dprintf("led matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.speed); } -void led_matrix_set_speed_noeeprom(uint8_t speed) { led_matrix_set_speed_eeprom_helper(speed, false); } -void led_matrix_set_speed(uint8_t speed) { led_matrix_set_speed_eeprom_helper(speed, true); } +void led_matrix_set_speed_noeeprom(uint8_t speed) { + led_matrix_set_speed_eeprom_helper(speed, false); +} +void led_matrix_set_speed(uint8_t speed) { + led_matrix_set_speed_eeprom_helper(speed, true); +} -uint8_t led_matrix_get_speed(void) { return led_matrix_eeconfig.speed; } +uint8_t led_matrix_get_speed(void) { + return led_matrix_eeconfig.speed; +} -void led_matrix_increase_speed_helper(bool write_to_eeprom) { led_matrix_set_speed_eeprom_helper(qadd8(led_matrix_eeconfig.speed, LED_MATRIX_SPD_STEP), write_to_eeprom); } -void led_matrix_increase_speed_noeeprom(void) { led_matrix_increase_speed_helper(false); } -void led_matrix_increase_speed(void) { led_matrix_increase_speed_helper(true); } +void led_matrix_increase_speed_helper(bool write_to_eeprom) { + led_matrix_set_speed_eeprom_helper(qadd8(led_matrix_eeconfig.speed, LED_MATRIX_SPD_STEP), write_to_eeprom); +} +void led_matrix_increase_speed_noeeprom(void) { + led_matrix_increase_speed_helper(false); +} +void led_matrix_increase_speed(void) { + led_matrix_increase_speed_helper(true); +} -void led_matrix_decrease_speed_helper(bool write_to_eeprom) { led_matrix_set_speed_eeprom_helper(qsub8(led_matrix_eeconfig.speed, LED_MATRIX_SPD_STEP), write_to_eeprom); } -void led_matrix_decrease_speed_noeeprom(void) { led_matrix_decrease_speed_helper(false); } -void led_matrix_decrease_speed(void) { led_matrix_decrease_speed_helper(true); } +void led_matrix_decrease_speed_helper(bool write_to_eeprom) { + led_matrix_set_speed_eeprom_helper(qsub8(led_matrix_eeconfig.speed, LED_MATRIX_SPD_STEP), write_to_eeprom); +} +void led_matrix_decrease_speed_noeeprom(void) { + led_matrix_decrease_speed_helper(false); +} +void led_matrix_decrease_speed(void) { + led_matrix_decrease_speed_helper(true); +} -led_flags_t led_matrix_get_flags(void) { return led_matrix_eeconfig.flags; } +led_flags_t led_matrix_get_flags(void) { + return led_matrix_eeconfig.flags; +} -void led_matrix_set_flags(led_flags_t flags) { led_matrix_eeconfig.flags = flags; } +void led_matrix_set_flags(led_flags_t flags) { + led_matrix_eeconfig.flags = flags; +} diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h index e42be6466187..d21f36e295cb 100644 --- a/quantum/led_matrix/led_matrix.h +++ b/quantum/led_matrix/led_matrix.h @@ -2,6 +2,7 @@ * Copyright 2017 Jack Humbert * Copyright 2018 Yiancar * Copyright 2019 Clueboard + * Copyright 2021 Leo Deng * * 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 @@ -26,6 +27,11 @@ #ifdef IS31FL3731 # include "is31fl3731-simple.h" +#elif defined(IS31FLCOMMON) +# include "is31flcommon.h" +#endif +#ifdef IS31FL3733 +# include "is31fl3733-simple.h" #endif #ifndef LED_MATRIX_LED_FLUSH_LIMIT diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c index 2157619a0bec..847ca1c3106b 100644 --- a/quantum/led_matrix/led_matrix_drivers.c +++ b/quantum/led_matrix/led_matrix_drivers.c @@ -25,7 +25,7 @@ * in their own files. */ -#if defined(IS31FL3731) || defined(IS31FL3733) +#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FLCOMMON) # include "i2c_master.h" static void init(void) { @@ -66,6 +66,18 @@ static void init(void) { # endif # endif # endif + +# elif defined(IS31FLCOMMON) + IS31FL_common_init(DRIVER_ADDR_1, ISSI_SSR_1); +# if defined(LED_DRIVER_ADDR_2) + IS31FL_common_init(DRIVER_ADDR_2, ISSI_SSR_2); +# if defined(LED_DRIVER_ADDR_3) + IS31FL_common_init(DRIVER_ADDR_3, ISSI_SSR_3); +# if defined(LED_DRIVER_ADDR_4) + IS31FL_common_init(DRIVER_ADDR_4, ISSI_SSR_4); +# endif +# endif +# endif # endif for (int index = 0; index < DRIVER_LED_TOTAL; index++) { @@ -73,6 +85,8 @@ static void init(void) { IS31FL3731_set_led_control_register(index, true); # elif defined(IS31FL3733) IS31FL3733_set_led_control_register(index, true); +# elif defined(IS31FLCOMMON) + IS31FL_simple_set_scaling_buffer(index, true); # endif } @@ -100,6 +114,21 @@ static void init(void) { # endif # endif # endif + +# elif defined(IS31FLCOMMON) +# ifdef ISSI_MANUAL_SCALING + IS31FL_set_manual_scaling_buffer(); +# endif + IS31FL_common_update_scaling_register(DRIVER_ADDR_1, 0); +# if defined(LED_DRIVER_ADDR_2) + IS31FL_common_update_scaling_register(DRIVER_ADDR_2, 1); +# if defined(LED_DRIVER_ADDR_3) + IS31FL_common_update_scaling_register(DRIVER_ADDR_3, 2); +# if defined(LED_DRIVER_ADDR_4) + IS31FL_common_update_scaling_register(DRIVER_ADDR_4, 3); +# endif +# endif +# endif # endif } @@ -144,5 +173,26 @@ const led_matrix_driver_t led_matrix_driver = { .set_value = IS31FL3733_set_value, .set_value_all = IS31FL3733_set_value_all, }; + +# elif defined(IS31FLCOMMON) +static void flush(void) { + IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); +# if defined(LED_DRIVER_ADDR_2) + IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); +# if defined(LED_DRIVER_ADDR_3) + IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); +# if defined(LED_DRIVER_ADDR_4) + IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); +# endif +# endif +# endif +} + +const led_matrix_driver_t led_matrix_driver = { + .init = init, + .flush = flush, + .set_value = IS31FL_simple_set_brightness, + .set_value_all = IS31FL_simple_set_brigntness_all, +}; # endif #endif diff --git a/quantum/led_matrix/led_matrix_types.h b/quantum/led_matrix/led_matrix_types.h index 61cdbd9b8e02..3dc533100f43 100644 --- a/quantum/led_matrix/led_matrix_types.h +++ b/quantum/led_matrix/led_matrix_types.h @@ -36,7 +36,7 @@ // Last led hit #ifndef LED_HITS_TO_REMEMBER # define LED_HITS_TO_REMEMBER 8 -#endif // LED_HITS_TO_REMEMBER +#endif // LED_HITS_TO_REMEMBER #ifdef LED_MATRIX_KEYREACTIVE_ENABLED typedef struct PACKED { @@ -46,7 +46,7 @@ typedef struct PACKED { uint8_t index[LED_HITS_TO_REMEMBER]; uint16_t tick[LED_HITS_TO_REMEMBER]; } last_hit_t; -#endif // LED_MATRIX_KEYREACTIVE_ENABLED +#endif // LED_MATRIX_KEYREACTIVE_ENABLED typedef enum led_task_states { STARTING, RENDERING, FLUSHING, SYNCING } led_task_states; @@ -87,7 +87,7 @@ typedef union { uint8_t mode : 6; uint16_t reserved; uint8_t val; - uint8_t speed; // EECONFIG needs to be increased to support this + uint8_t speed; // EECONFIG needs to be increased to support this led_flags_t flags; }; } led_eeconfig_t; diff --git a/quantum/logging/debug.c b/quantum/logging/debug.c index ea62deaa8ccc..ca7654eda2aa 100644 --- a/quantum/logging/debug.c +++ b/quantum/logging/debug.c @@ -17,9 +17,9 @@ along with this program. If not, see . #include "debug.h" debug_config_t debug_config = { - .enable = false, // - .matrix = false, // - .keyboard = false, // - .mouse = false, // - .reserved = 0 // + .enable = false, // + .matrix = false, // + .keyboard = false, // + .mouse = false, // + .reserved = 0 // }; diff --git a/quantum/logging/print.c b/quantum/logging/print.c index e8440e55ee5d..50a6b826eec8 100644 --- a/quantum/logging/print.c +++ b/quantum/logging/print.c @@ -19,9 +19,15 @@ along with this program. If not, see . // bind lib/printf to console interface - sendchar -static int8_t null_sendchar_func(uint8_t c) { return 0; } +static int8_t null_sendchar_func(uint8_t c) { + return 0; +} static sendchar_func_t func = null_sendchar_func; -void print_set_sendchar(sendchar_func_t send) { func = send; } +void print_set_sendchar(sendchar_func_t send) { + func = send; +} -void _putchar(char character) { func(character); } +void _putchar(char character) { + func(character); +} diff --git a/quantum/logging/print.h b/quantum/logging/print.h index 8c055f549e59..aa72fc70745e 100644 --- a/quantum/logging/print.h +++ b/quantum/logging/print.h @@ -37,7 +37,7 @@ void print_set_sendchar(sendchar_func_t func); # include_next "_print.h" /* Include the platforms print.h */ # else // Fall back to lib/printf -# include "printf.h" // lib/printf/printf.h +# include "printf.h" // lib/printf/printf.h // Create user & normal print defines # define print(s) printf(s) diff --git a/quantum/logging/sendchar.c b/quantum/logging/sendchar.c index 9422382f6f9f..5bc744b7433c 100644 --- a/quantum/logging/sendchar.c +++ b/quantum/logging/sendchar.c @@ -17,4 +17,6 @@ along with this program. If not, see . #include "sendchar.h" /* default noop "null" implementation */ -__attribute__((weak)) int8_t sendchar(uint8_t c) { return 0; } +__attribute__((weak)) int8_t sendchar(uint8_t c) { + return 0; +} diff --git a/quantum/main.c b/quantum/main.c index 6ed6b95741d9..faba668056e1 100644 --- a/quantum/main.c +++ b/quantum/main.c @@ -45,7 +45,7 @@ void protocol_task(void) { #ifdef DEFERRED_EXEC_ENABLE void deferred_exec_task(void); -#endif // DEFERRED_EXEC_ENABLE +#endif // DEFERRED_EXEC_ENABLE /** \brief Main * @@ -66,7 +66,7 @@ int main(void) { #ifdef DEFERRED_EXEC_ENABLE // Run deferred executions deferred_exec_task(); -#endif // DEFERRED_EXEC_ENABLE +#endif // DEFERRED_EXEC_ENABLE housekeeping_task(); } diff --git a/quantum/matrix.c b/quantum/matrix.c index 8596c2eabd77..db59b73754f5 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -47,33 +47,29 @@ along with this program. If not, see . #endif #ifdef DIRECT_PINS -static SPLIT_MUTABLE pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +static SPLIT_MUTABLE pin_t direct_pins[ROWS_PER_HAND][MATRIX_COLS] = DIRECT_PINS; #elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) # ifdef MATRIX_ROW_PINS -static SPLIT_MUTABLE_ROW pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -# endif // MATRIX_ROW_PINS +static SPLIT_MUTABLE_ROW pin_t row_pins[ROWS_PER_HAND] = MATRIX_ROW_PINS; +# endif // MATRIX_ROW_PINS # ifdef MATRIX_COL_PINS -static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -# endif // MATRIX_COL_PINS +static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +# endif // MATRIX_COL_PINS #endif /* matrix state(1:on, 0:off) */ -extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values -extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values +extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values +extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values #ifdef SPLIT_KEYBOARD // row offsets for each hand -uint8_t thisHand, thatHand; +extern uint8_t thisHand, thatHand; #endif // user-defined overridable functions __attribute__((weak)) void matrix_init_pins(void); __attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); __attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter); -#ifdef SPLIT_KEYBOARD -__attribute__((weak)) void matrix_slave_scan_kb(void) { matrix_slave_scan_user(); } -__attribute__((weak)) void matrix_slave_scan_user(void) {} -#endif static inline void setPinOutput_writeLow(pin_t pin) { ATOMIC_BLOCK_FORCEON { @@ -90,7 +86,9 @@ static inline void setPinOutput_writeHigh(pin_t pin) { } static inline void setPinInputHigh_atomic(pin_t pin) { - ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } + ATOMIC_BLOCK_FORCEON { + setPinInputHigh(pin); + } } static inline uint8_t readMatrixPin(pin_t pin) { @@ -106,7 +104,7 @@ static inline uint8_t readMatrixPin(pin_t pin) { #ifdef DIRECT_PINS __attribute__((weak)) void matrix_init_pins(void) { - for (int row = 0; row < MATRIX_ROWS; row++) { + for (int row = 0; row < ROWS_PER_HAND; row++) { for (int col = 0; col < MATRIX_COLS; col++) { pin_t pin = direct_pins[row][col]; if (pin != NO_PIN) { @@ -175,8 +173,8 @@ __attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[] // Start with a clear matrix row matrix_row_t current_row_value = 0; - if (!select_row(current_row)) { // Select row - return; // skip NO_PIN row + if (!select_row(current_row)) { // Select row + return; // skip NO_PIN row } matrix_output_select_delay(); @@ -191,7 +189,7 @@ __attribute__((weak)) void matrix_read_cols_on_row(matrix_row_t current_matrix[] // Unselect row unselect_row(current_row); - matrix_output_unselect_delay(current_row, current_row_value != 0); // wait for all Col signals to go HIGH + matrix_output_unselect_delay(current_row, current_row_value != 0); // wait for all Col signals to go HIGH // Update the matrix current_matrix[current_row] = current_row_value; @@ -238,8 +236,8 @@ __attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[] bool key_pressed = false; // Select col - if (!select_col(current_col)) { // select col - return; // skip NO_PIN col + if (!select_col(current_col)) { // select col + return; // skip NO_PIN col } matrix_output_select_delay(); @@ -258,34 +256,32 @@ __attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[] // Unselect col unselect_col(current_col); - matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH + matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH } # else # error DIODE_DIRECTION must be one of COL2ROW or ROW2COL! # endif -# endif // defined(MATRIX_ROW_PINS) && defined(MATRIX_COL_PINS) +# endif // defined(MATRIX_ROW_PINS) && defined(MATRIX_COL_PINS) #else # error DIODE_DIRECTION is not defined! #endif void matrix_init(void) { #ifdef SPLIT_KEYBOARD - split_pre_init(); - // Set pinout for right half if pinout for that half is defined if (!isLeftHand) { # ifdef DIRECT_PINS_RIGHT - const pin_t direct_pins_right[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS_RIGHT; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + const pin_t direct_pins_right[ROWS_PER_HAND][MATRIX_COLS] = DIRECT_PINS_RIGHT; + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { for (uint8_t j = 0; j < MATRIX_COLS; j++) { direct_pins[i][j] = direct_pins_right[i][j]; } } # endif # ifdef MATRIX_ROW_PINS_RIGHT - const pin_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + const pin_t row_pins_right[ROWS_PER_HAND] = MATRIX_ROW_PINS_RIGHT; + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { row_pins[i] = row_pins_right[i]; } # endif @@ -311,46 +307,13 @@ void matrix_init(void) { debounce_init(ROWS_PER_HAND); matrix_init_quantum(); - -#ifdef SPLIT_KEYBOARD - split_post_init(); -#endif } #ifdef SPLIT_KEYBOARD // Fallback implementation for keyboards not using the standard split_util.c __attribute__((weak)) bool transport_master_if_connected(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { transport_master(master_matrix, slave_matrix); - return true; // Treat the transport as always connected -} - -bool matrix_post_scan(void) { - bool changed = false; - if (is_keyboard_master()) { - static bool last_connected = false; - matrix_row_t slave_matrix[ROWS_PER_HAND] = {0}; - if (transport_master_if_connected(matrix + thisHand, slave_matrix)) { - changed = memcmp(matrix + thatHand, slave_matrix, sizeof(slave_matrix)) != 0; - - last_connected = true; - } else if (last_connected) { - // reset other half when disconnected - memset(slave_matrix, 0, sizeof(slave_matrix)); - changed = true; - - last_connected = false; - } - - if (changed) memcpy(matrix + thatHand, slave_matrix, sizeof(slave_matrix)); - - matrix_scan_quantum(); - } else { - transport_slave(matrix + thatHand, matrix + thisHand); - - matrix_slave_scan_kb(); - } - - return changed; + return true; // Treat the transport as always connected } #endif diff --git a/quantum/matrix.h b/quantum/matrix.h index 5c696622fcf2..d968efeb0f51 100644 --- a/quantum/matrix.h +++ b/quantum/matrix.h @@ -46,8 +46,6 @@ void matrix_setup(void); void matrix_init(void); /* scan all key states on matrix */ uint8_t matrix_scan(void); -/* whether modified from previous scan. used after matrix_scan. */ -bool matrix_is_modified(void) __attribute__((deprecated)); /* whether a switch is on */ bool matrix_is_on(uint8_t row, uint8_t col); /* matrix state on row */ @@ -75,6 +73,7 @@ void matrix_init_user(void); void matrix_scan_user(void); #ifdef SPLIT_KEYBOARD +bool matrix_post_scan(void); void matrix_slave_scan_kb(void); void matrix_slave_scan_user(void); #endif diff --git a/quantum/matrix_common.c b/quantum/matrix_common.c index 66c89970b109..1497ceae71b5 100644 --- a/quantum/matrix_common.c +++ b/quantum/matrix_common.c @@ -4,6 +4,15 @@ #include "wait.h" #include "print.h" #include "debug.h" +#ifdef SPLIT_KEYBOARD +# include "split_common/split_util.h" +# include "split_common/transactions.h" +# include + +# define ROWS_PER_HAND (MATRIX_ROWS / 2) +#else +# define ROWS_PER_HAND (MATRIX_ROWS) +#endif #ifndef MATRIX_IO_DELAY # define MATRIX_IO_DELAY 30 @@ -13,15 +22,24 @@ matrix_row_t raw_matrix[MATRIX_ROWS]; matrix_row_t matrix[MATRIX_ROWS]; +#ifdef SPLIT_KEYBOARD +// row offsets for each hand +uint8_t thisHand, thatHand; +#endif + #ifdef MATRIX_MASKED extern const matrix_row_t matrix_mask[]; #endif // user-defined overridable functions -__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } +__attribute__((weak)) void matrix_init_kb(void) { + matrix_init_user(); +} -__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } +__attribute__((weak)) void matrix_scan_kb(void) { + matrix_scan_user(); +} __attribute__((weak)) void matrix_init_user(void) {} @@ -29,11 +47,17 @@ __attribute__((weak)) void matrix_scan_user(void) {} // helper functions -inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } +inline uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} -inline uint8_t matrix_cols(void) { return MATRIX_COLS; } +inline uint8_t matrix_cols(void) { + return MATRIX_COLS; +} -inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); } +inline bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & ((matrix_row_t)1 << col)); +} inline matrix_row_t matrix_get_row(uint8_t row) { // Matrix mask lets you disable switches in the returned matrix data. For example, if you have a @@ -45,12 +69,6 @@ inline matrix_row_t matrix_get_row(uint8_t row) { #endif } -// Deprecated. -bool matrix_is_modified(void) { - if (debounce_active()) return false; - return true; -} - #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) @@ -84,18 +102,67 @@ uint8_t matrix_key_count(void) { return count; } -/* `matrix_io_delay ()` exists for backwards compatibility. From now on, use matrix_output_unselect_delay(). */ -__attribute__((weak)) void matrix_io_delay(void) { wait_us(MATRIX_IO_DELAY); } +#ifdef SPLIT_KEYBOARD +bool matrix_post_scan(void) { + bool changed = false; + if (is_keyboard_master()) { + static bool last_connected = false; + matrix_row_t slave_matrix[ROWS_PER_HAND] = {0}; + if (transport_master_if_connected(matrix + thisHand, slave_matrix)) { + changed = memcmp(matrix + thatHand, slave_matrix, sizeof(slave_matrix)) != 0; + + last_connected = true; + } else if (last_connected) { + // reset other half when disconnected + memset(slave_matrix, 0, sizeof(slave_matrix)); + changed = true; -__attribute__((weak)) void matrix_output_select_delay(void) { waitInputPinDelay(); } -__attribute__((weak)) void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { matrix_io_delay(); } + last_connected = false; + } + + if (changed) memcpy(matrix + thatHand, slave_matrix, sizeof(slave_matrix)); + + matrix_scan_quantum(); + } else { + transport_slave(matrix + thatHand, matrix + thisHand); + + matrix_slave_scan_kb(); + } + + return changed; +} +#endif + +/* `matrix_io_delay ()` exists for backwards compatibility. From now on, use matrix_output_unselect_delay(). */ +__attribute__((weak)) void matrix_io_delay(void) { + wait_us(MATRIX_IO_DELAY); +} +__attribute__((weak)) void matrix_output_select_delay(void) { + waitInputPinDelay(); +} +__attribute__((weak)) void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { + matrix_io_delay(); +} // CUSTOM MATRIX 'LITE' __attribute__((weak)) void matrix_init_custom(void) {} +__attribute__((weak)) bool matrix_scan_custom(matrix_row_t current_matrix[]) { + return true; +} -__attribute__((weak)) bool matrix_scan_custom(matrix_row_t current_matrix[]) { return true; } +#ifdef SPLIT_KEYBOARD +__attribute__((weak)) void matrix_slave_scan_kb(void) { + matrix_slave_scan_user(); +} +__attribute__((weak)) void matrix_slave_scan_user(void) {} +#endif __attribute__((weak)) void matrix_init(void) { +#ifdef SPLIT_KEYBOARD + thisHand = isLeftHand ? 0 : (ROWS_PER_HAND); + thatHand = ROWS_PER_HAND - thisHand; +#endif + matrix_init_custom(); // initialize matrix state: all keys off @@ -104,7 +171,7 @@ __attribute__((weak)) void matrix_init(void) { matrix[i] = 0; } - debounce_init(MATRIX_ROWS); + debounce_init(ROWS_PER_HAND); matrix_init_quantum(); } @@ -112,10 +179,17 @@ __attribute__((weak)) void matrix_init(void) { __attribute__((weak)) uint8_t matrix_scan(void) { bool changed = matrix_scan_custom(raw_matrix); - debounce(raw_matrix, matrix, MATRIX_ROWS, changed); - +#ifdef SPLIT_KEYBOARD + debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); + changed = (changed || matrix_post_scan()); +#else + debounce(raw_matrix, matrix, ROWS_PER_HAND, changed); matrix_scan_quantum(); +#endif + return changed; } -__attribute__((weak)) bool peek_matrix(uint8_t row_index, uint8_t col_index, bool raw) { return 0 != ((raw ? raw_matrix[row_index] : matrix[row_index]) & (MATRIX_ROW_SHIFTER << col_index)); } +__attribute__((weak)) bool peek_matrix(uint8_t row_index, uint8_t col_index, bool raw) { + return 0 != ((raw ? raw_matrix[row_index] : matrix[row_index]) & (MATRIX_ROW_SHIFTER << col_index)); +} diff --git a/quantum/mousekey.c b/quantum/mousekey.c index c2291fb39790..8bafbf977a7f 100644 --- a/quantum/mousekey.c +++ b/quantum/mousekey.c @@ -487,4 +487,6 @@ static void mousekey_debug(void) { print(")\n"); } -report_mouse_t mousekey_get_report(void) { return mouse_report; } +report_mouse_t mousekey_get_report(void) { + return mouse_report; +} diff --git a/quantum/mousekey.h b/quantum/mousekey.h index 56c91b5f1b43..03da5f282a7a 100644 --- a/quantum/mousekey.h +++ b/quantum/mousekey.h @@ -37,9 +37,9 @@ along with this program. If not, see . # ifndef MOUSEKEY_MOVE_DELTA # ifndef MK_KINETIC_SPEED -# define MOUSEKEY_MOVE_DELTA 5 +# define MOUSEKEY_MOVE_DELTA 8 # else -# define MOUSEKEY_MOVE_DELTA 25 +# define MOUSEKEY_MOVE_DELTA 5 # endif # endif # ifndef MOUSEKEY_WHEEL_DELTA @@ -47,29 +47,29 @@ along with this program. If not, see . # endif # ifndef MOUSEKEY_DELAY # ifndef MK_KINETIC_SPEED -# define MOUSEKEY_DELAY 300 +# define MOUSEKEY_DELAY 10 # else -# define MOUSEKEY_DELAY 8 +# define MOUSEKEY_DELAY 5 # endif # endif # ifndef MOUSEKEY_INTERVAL # ifndef MK_KINETIC_SPEED -# define MOUSEKEY_INTERVAL 50 +# define MOUSEKEY_INTERVAL 20 # else -# define MOUSEKEY_INTERVAL 8 +# define MOUSEKEY_INTERVAL 10 # endif # endif # ifndef MOUSEKEY_MAX_SPEED # define MOUSEKEY_MAX_SPEED 10 # endif # ifndef MOUSEKEY_TIME_TO_MAX -# define MOUSEKEY_TIME_TO_MAX 20 +# define MOUSEKEY_TIME_TO_MAX 30 # endif # ifndef MOUSEKEY_WHEEL_DELAY -# define MOUSEKEY_WHEEL_DELAY 300 +# define MOUSEKEY_WHEEL_DELAY 10 # endif # ifndef MOUSEKEY_WHEEL_INTERVAL -# define MOUSEKEY_WHEEL_INTERVAL 100 +# define MOUSEKEY_WHEEL_INTERVAL 80 # endif # ifndef MOUSEKEY_WHEEL_MAX_SPEED # define MOUSEKEY_WHEEL_MAX_SPEED 8 diff --git a/quantum/pointing_device.c b/quantum/pointing_device.c index 2fefdb67b6af..9627cab4b836 100644 --- a/quantum/pointing_device.c +++ b/quantum/pointing_device.c @@ -18,24 +18,115 @@ #include "pointing_device.h" #include +#include "timer.h" #ifdef MOUSEKEY_ENABLE # include "mousekey.h" #endif #if (defined(POINTING_DEVICE_ROTATION_90) + defined(POINTING_DEVICE_ROTATION_180) + defined(POINTING_DEVICE_ROTATION_270)) > 1 # error More than one rotation selected. This is not supported. #endif +#if defined(SPLIT_POINTING_ENABLE) +# include "transactions.h" +# include "keyboard.h" -static report_mouse_t mouseReport = {}; +report_mouse_t shared_mouse_report = {}; +uint16_t shared_cpi = 0; + +/** + * @brief Sets the shared mouse report used be pointing device task + * + * NOTE : Only available when using SPLIT_POINTING_ENABLE + * + * @param[in] new_mouse_report report_mouse_t + */ +void pointing_device_set_shared_report(report_mouse_t new_mouse_report) { + shared_mouse_report = new_mouse_report; +} + +/** + * @brief Gets current pointing device CPI if supported + * + * Gets current cpi of the shared report and returns it as uint16_t + * + * NOTE : Only available when using SPLIT_POINTING_ENABLE + * + * @return cpi value as uint16_t + */ +uint16_t pointing_device_get_shared_cpi(void) { + return shared_cpi; +} + +# if defined(POINTING_DEVICE_LEFT) +# define POINTING_DEVICE_THIS_SIDE is_keyboard_left() +# elif defined(POINTING_DEVICE_RIGHT) +# define POINTING_DEVICE_THIS_SIDE !is_keyboard_left() +# elif defined(POINTING_DEVICE_COMBINED) +# define POINTING_DEVICE_THIS_SIDE true +# endif + +#endif // defined(SPLIT_POINTING_ENABLE) + +static report_mouse_t local_mouse_report = {}; extern const pointing_device_driver_t pointing_device_driver; -__attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { return memcmp(&new, &old, sizeof(new)); } +/** + * @brief Compares 2 mouse reports for difference and returns result + * + * @param[in] new report_mouse_t + * @param[in] old report_mouse_t + * @return bool result + */ +__attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { + return memcmp(&new, &old, sizeof(new)); +} + +/** + * @brief Keyboard level code pointing device initialisation + * + */ +__attribute__((weak)) void pointing_device_init_kb(void) {} -__attribute__((weak)) void pointing_device_init_kb(void) {} -__attribute__((weak)) void pointing_device_init_user(void) {} -__attribute__((weak)) report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { return pointing_device_task_user(mouse_report); } -__attribute__((weak)) report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { return mouse_report; } +/** + * @brief User level code pointing device initialisation + * + */ +__attribute__((weak)) void pointing_device_init_user(void) {} +/** + * @brief Weak function allowing for keyboard level mouse report modification + * + * Takes report_mouse_t struct allowing modification at keyboard level then returns report_mouse_t. + * + * @param[in] mouse_report report_mouse_t + * @return report_mouse_t + */ +__attribute__((weak)) report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { + return pointing_device_task_user(mouse_report); +} + +/** + * @brief Weak function allowing for user level mouse report modification + * + * Takes report_mouse_t struct allowing modification at user level then returns report_mouse_t. + * + * @param[in] mouse_report report_mouse_t + * @return report_mouse_t + */ +__attribute__((weak)) report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + return mouse_report; +} + +/** + * @brief Handles pointing device buttons + * + * Returns modified button bitmask using bool pressed and selected pointing_device_buttons_t button in uint8_t buttons bitmask. + * + * @param buttons[in] uint8_t bitmask + * @param pressed[in] bool + * @param button[in] pointing_device_buttons_t value + * @return Modified uint8_t bitmask buttons + */ __attribute__((weak)) uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button) { if (pressed) { buttons |= 1 << (button); @@ -45,7 +136,17 @@ __attribute__((weak)) uint8_t pointing_device_handle_buttons(uint8_t buttons, bo return buttons; } +/** + * @brief Initialises pointing device + * + * Initialises pointing device, perform driver init and optional keyboard/user level code. + */ __attribute__((weak)) void pointing_device_init(void) { +#if defined(SPLIT_POINTING_ENABLE) + if (!(POINTING_DEVICE_THIS_SIDE)) { + return; + } +#endif pointing_device_driver.init(); #ifdef POINTING_DEVICE_MOTION_PIN setPinInputHigh(POINTING_DEVICE_MOTION_PIN); @@ -54,67 +155,303 @@ __attribute__((weak)) void pointing_device_init(void) { pointing_device_init_user(); } +/** + * @brief Sends processed mouse report to host + * + * This sends the mouse report generated by pointing_device_task if changed since the last report. Once send zeros mouse report except buttons. + * + */ __attribute__((weak)) void pointing_device_send(void) { static report_mouse_t old_report = {}; // If you need to do other things, like debugging, this is the place to do it. - if (has_mouse_report_changed(mouseReport, old_report)) { - host_mouse_send(&mouseReport); + if (has_mouse_report_changed(local_mouse_report, old_report)) { + host_mouse_send(&local_mouse_report); } // send it and 0 it out except for buttons, so those stay until they are explicity over-ridden using update_pointing_device - mouseReport.x = 0; - mouseReport.y = 0; - mouseReport.v = 0; - mouseReport.h = 0; + local_mouse_report.x = 0; + local_mouse_report.y = 0; + local_mouse_report.v = 0; + local_mouse_report.h = 0; - memcpy(&old_report, &mouseReport, sizeof(mouseReport)); + memcpy(&old_report, &local_mouse_report, sizeof(local_mouse_report)); } -__attribute__((weak)) void pointing_device_task(void) { - // Gather report info -#ifdef POINTING_DEVICE_MOTION_PIN - if (!readPin(POINTING_DEVICE_MOTION_PIN)) -#endif - mouseReport = pointing_device_driver.get_report(mouseReport); - - // Support rotation of the sensor data +/** + * @brief Adjust mouse report by any optional common pointing configuration defines + * + * This applies rotation or inversion to the mouse report as selected by the pointing device common configuration defines. + * + * @param mouse_report[in] takes a report_mouse_t to be adjusted + * @return report_mouse_t with adjusted values + */ +report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report) { + // Support rotation of the sensor data #if defined(POINTING_DEVICE_ROTATION_90) || defined(POINTING_DEVICE_ROTATION_180) || defined(POINTING_DEVICE_ROTATION_270) - int8_t x = mouseReport.x, y = mouseReport.y; + int8_t x = mouse_report.x, y = mouse_report.y; # if defined(POINTING_DEVICE_ROTATION_90) - mouseReport.x = y; - mouseReport.y = -x; + mouse_report.x = y; + mouse_report.y = -x; # elif defined(POINTING_DEVICE_ROTATION_180) - mouseReport.x = -x; - mouseReport.y = -y; + mouse_report.x = -x; + mouse_report.y = -y; # elif defined(POINTING_DEVICE_ROTATION_270) - mouseReport.x = -y; - mouseReport.y = x; + mouse_report.x = -y; + mouse_report.y = x; # else # error "How the heck did you get here?!" # endif #endif // Support Inverting the X and Y Axises #if defined(POINTING_DEVICE_INVERT_X) - mouseReport.x = -mouseReport.x; + mouse_report.x = -mouse_report.x; #endif #if defined(POINTING_DEVICE_INVERT_Y) - mouseReport.y = -mouseReport.y; + mouse_report.y = -mouse_report.y; +#endif + return mouse_report; +} + +/** + * @brief Retrieves and processes pointing device data. + * + * This function is part of the keyboard loop and retrieves the mouse report from the pointing device driver. + * It applies any optional configuration e.g. rotation or axis inversion and then initiates a send. + * + */ +__attribute__((weak)) void pointing_device_task(void) { +#if defined(SPLIT_POINTING_ENABLE) + // Don't poll the target side pointing device. + if (!is_keyboard_master()) { + return; + }; +#endif + +#if (POINTING_DEVICE_TASK_THROTTLE_MS > 0) + static uint32_t last_exec = 0; + if (timer_elapsed32(last_exec) < POINTING_DEVICE_TASK_THROTTLE_MS) { + return; + } + last_exec = timer_read32(); +#endif + + // Gather report info +#ifdef POINTING_DEVICE_MOTION_PIN +# if defined(SPLIT_POINTING_ENABLE) +# error POINTING_DEVICE_MOTION_PIN not supported when sharing the pointing device report between sides. +# endif + if (!readPin(POINTING_DEVICE_MOTION_PIN)) #endif +#if defined(SPLIT_POINTING_ENABLE) +# if defined(POINTING_DEVICE_COMBINED) + static uint8_t old_buttons = 0; + local_mouse_report.buttons = old_buttons; + local_mouse_report = pointing_device_driver.get_report(local_mouse_report); + old_buttons = local_mouse_report.buttons; +# elif defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) + local_mouse_report = POINTING_DEVICE_THIS_SIDE ? pointing_device_driver.get_report(local_mouse_report) : shared_mouse_report; +# else +# error "You need to define the side(s) the pointing device is on. POINTING_DEVICE_COMBINED / POINTING_DEVICE_LEFT / POINTING_DEVICE_RIGHT" +# endif +#else + local_mouse_report = pointing_device_driver.get_report(local_mouse_report); +#endif // defined(SPLIT_POINTING_ENABLE) + // allow kb to intercept and modify report - mouseReport = pointing_device_task_kb(mouseReport); +#if defined(SPLIT_POINTING_ENABLE) && defined(POINTING_DEVICE_COMBINED) + if (is_keyboard_left()) { + local_mouse_report = pointing_device_adjust_by_defines(local_mouse_report); + shared_mouse_report = pointing_device_adjust_by_defines_right(shared_mouse_report); + } else { + local_mouse_report = pointing_device_adjust_by_defines_right(local_mouse_report); + shared_mouse_report = pointing_device_adjust_by_defines(shared_mouse_report); + } + local_mouse_report = is_keyboard_left() ? pointing_device_task_combined_kb(local_mouse_report, shared_mouse_report) : pointing_device_task_combined_kb(shared_mouse_report, local_mouse_report); +#else + local_mouse_report = pointing_device_adjust_by_defines(local_mouse_report); + local_mouse_report = pointing_device_task_kb(local_mouse_report); +#endif // combine with mouse report to ensure that the combined is sent correctly #ifdef MOUSEKEY_ENABLE report_mouse_t mousekey_report = mousekey_get_report(); - mouseReport.buttons = mouseReport.buttons | mousekey_report.buttons; + local_mouse_report.buttons = local_mouse_report.buttons | mousekey_report.buttons; #endif pointing_device_send(); } -report_mouse_t pointing_device_get_report(void) { return mouseReport; } +/** + * @brief Gets current mouse report used by pointing device task + * + * @return report_mouse_t + */ +report_mouse_t pointing_device_get_report(void) { + return local_mouse_report; +} + +/** + * @brief Sets mouse report used be pointing device task + * + * @param[in] new_mouse_report + */ +void pointing_device_set_report(report_mouse_t new_mouse_report) { + local_mouse_report = new_mouse_report; +} + +/** + * @brief Gets current pointing device CPI if supported + * + * Gets current cpi from pointing device driver if supported and returns it as uint16_t + * + * @return cpi value as uint16_t + */ +uint16_t pointing_device_get_cpi(void) { +#if defined(SPLIT_POINTING_ENABLE) + return POINTING_DEVICE_THIS_SIDE ? pointing_device_driver.get_cpi() : shared_cpi; +#else + return pointing_device_driver.get_cpi(); +#endif +} -void pointing_device_set_report(report_mouse_t newMouseReport) { mouseReport = newMouseReport; } +/** + * @brief Set pointing device CPI if supported + * + * Takes a uint16_t value to set pointing device cpi if supported by driver. + * + * @param[in] cpi uint16_t value. + */ +void pointing_device_set_cpi(uint16_t cpi) { +#if defined(SPLIT_POINTING_ENABLE) + if (POINTING_DEVICE_THIS_SIDE) { + pointing_device_driver.set_cpi(cpi); + } else { + shared_cpi = cpi; + } +#else + pointing_device_driver.set_cpi(cpi); +#endif +} -uint16_t pointing_device_get_cpi(void) { return pointing_device_driver.get_cpi(); } +#if defined(SPLIT_POINTING_ENABLE) && defined(POINTING_DEVICE_COMBINED) +/** + * @brief Set pointing device CPI if supported + * + * Takes a bool and uint16_t and allows setting cpi for a single side when using 2 pointing devices with a split keyboard. + * + * NOTE: Only available when using SPLIT_POINTING_ENABLE and POINTING_DEVICE_COMBINED + * + * @param[in] left true = left, false = right. + * @param[in] cpi uint16_t value. + */ +void pointing_device_set_cpi_on_side(bool left, uint16_t cpi) { + bool local = (is_keyboard_left() & left) ? true : false; + if (local) { + pointing_device_driver.set_cpi(cpi); + } else { + shared_cpi = cpi; + } +} -void pointing_device_set_cpi(uint16_t cpi) { pointing_device_driver.set_cpi(cpi); } +/** + * @brief clamps int16_t to int8_t + * + * @param[in] int16_t value + * @return int8_t clamped value + */ +static inline int8_t pointing_device_movement_clamp(int16_t value) { + if (value < INT8_MIN) { + return INT8_MIN; + } else if (value > INT8_MAX) { + return INT8_MAX; + } else { + return value; + } +} + +/** + * @brief combines 2 mouse reports and returns 2 + * + * Combines 2 report_mouse_t structs, clamping movement values to int8_t and ignores report_id then returns the resulting report_mouse_t struct. + * + * NOTE: Only available when using SPLIT_POINTING_ENABLE and POINTING_DEVICE_COMBINED + * + * @param[in] left_report left report_mouse_t + * @param[in] right_report right report_mouse_t + * @return combined report_mouse_t of left_report and right_report + */ +report_mouse_t pointing_device_combine_reports(report_mouse_t left_report, report_mouse_t right_report) { + left_report.x = pointing_device_movement_clamp((int16_t)left_report.x + right_report.x); + left_report.y = pointing_device_movement_clamp((int16_t)left_report.y + right_report.y); + left_report.h = pointing_device_movement_clamp((int16_t)left_report.h + right_report.h); + left_report.v = pointing_device_movement_clamp((int16_t)left_report.v + right_report.v); + left_report.buttons |= right_report.buttons; + return left_report; +} + +/** + * @brief Adjust mouse report by any optional right pointing configuration defines + * + * This applies rotation or inversion to the mouse report as selected by the pointing device common configuration defines. + * + * NOTE: Only available when using SPLIT_POINTING_ENABLE and POINTING_DEVICE_COMBINED + * + * @param[in] mouse_report report_mouse_t to be adjusted + * @return report_mouse_t with adjusted values + */ +report_mouse_t pointing_device_adjust_by_defines_right(report_mouse_t mouse_report) { + // Support rotation of the sensor data +# if defined(POINTING_DEVICE_ROTATION_90_RIGHT) || defined(POINTING_DEVICE_ROTATION_RIGHT) || defined(POINTING_DEVICE_ROTATION_RIGHT) + int8_t x = mouse_report.x, y = mouse_report.y; +# if defined(POINTING_DEVICE_ROTATION_90_RIGHT) + mouse_report.x = y; + mouse_report.y = -x; +# elif defined(POINTING_DEVICE_ROTATION_180_RIGHT) + mouse_report.x = -x; + mouse_report.y = -y; +# elif defined(POINTING_DEVICE_ROTATION_270_RIGHT) + mouse_report.x = -y; + mouse_report.y = x; +# else +# error "How the heck did you get here?!" +# endif +# endif + // Support Inverting the X and Y Axises +# if defined(POINTING_DEVICE_INVERT_X_RIGHT) + mouse_report.x = -mouse_report.x; +# endif +# if defined(POINTING_DEVICE_INVERT_Y_RIGHT) + mouse_report.y = -mouse_report.y; +# endif + return mouse_report; +} + +/** + * @brief Weak function allowing for keyboard level mouse report modification + * + * Takes 2 report_mouse_t structs allowing individual modification of sides at keyboard level then returns pointing_device_task_combined_user. + * + * NOTE: Only available when using SPLIT_POINTING_ENABLE and POINTING_DEVICE_COMBINED + * + * @param[in] left_report report_mouse_t + * @param[in] right_report report_mouse_t + * @return pointing_device_task_combined_user(left_report, right_report) by default + */ +__attribute__((weak)) report_mouse_t pointing_device_task_combined_kb(report_mouse_t left_report, report_mouse_t right_report) { + return pointing_device_task_combined_user(left_report, right_report); +} + +/** + * @brief Weak function allowing for user level mouse report modification + * + * Takes 2 report_mouse_t structs allowing individual modification of sides at user level then returns pointing_device_combine_reports. + * + * NOTE: Only available when using SPLIT_POINTING_ENABLE and POINTING_DEVICE_COMBINED + * + * @param[in] left_report report_mouse_t + * @param[in] right_report report_mouse_t + * @return pointing_device_combine_reports(left_report, right_report) by default + */ +__attribute__((weak)) report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report) { + return pointing_device_combine_reports(left_report, right_report); +} +#endif diff --git a/quantum/pointing_device.h b/quantum/pointing_device.h index 5106c26660e7..5f3845227aa0 100644 --- a/quantum/pointing_device.h +++ b/quantum/pointing_device.h @@ -47,6 +47,9 @@ along with this program. If not, see . #elif defined(POINTING_DEVICE_DRIVER_pmw3360) # include "spi_master.h" # include "drivers/sensors/pmw3360.h" +#elif defined(POINTING_DEVICE_DRIVER_pmw3389) +# include "spi_master.h" +# include "drivers/sensors/pmw3389.h" #else void pointing_device_driver_init(void); report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report); @@ -86,3 +89,19 @@ void pointing_device_init_user(void); report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report); report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button); +report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report); + +#if defined(SPLIT_POINTING_ENABLE) +void pointing_device_set_shared_report(report_mouse_t report); +uint16_t pointing_device_get_shared_cpi(void); +# if !defined(POINTING_DEVICE_TASK_THROTTLE_MS) +# define POINTING_DEVICE_TASK_THROTTLE_MS 1 +# endif +# if defined(POINTING_DEVICE_COMBINED) +void pointing_device_set_cpi_on_side(bool left, uint16_t cpi); +report_mouse_t pointing_device_combine_reports(report_mouse_t left_report, report_mouse_t right_report); +report_mouse_t pointing_device_task_combined_kb(report_mouse_t left_report, report_mouse_t right_report); +report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report); +report_mouse_t pointing_device_adjust_by_defines_right(report_mouse_t mouse_report); +# endif // defined(POINTING_DEVICE_COMBINED) +#endif // defined(SPLIT_POINTING_ENABLE) diff --git a/quantum/pointing_device_drivers.c b/quantum/pointing_device_drivers.c index 9ad5e76ba634..b8ef6e67e58a 100644 --- a/quantum/pointing_device_drivers.c +++ b/quantum/pointing_device_drivers.c @@ -101,7 +101,7 @@ const pointing_device_driver_t pointing_device_driver = { # ifdef TAPPING_TERM_PER_KEY # include "action.h" # include "action_tapping.h" -# define CIRQUE_PINNACLE_TAPPING_TERM get_tapping_term(KC_BTN1, NULL) +# define CIRQUE_PINNACLE_TAPPING_TERM get_tapping_term(KC_BTN1, &(keyrecord_t){}) # else # ifdef TAPPING_TERM # define CIRQUE_PINNACLE_TAPPING_TERM TAPPING_TERM @@ -120,7 +120,7 @@ report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { int8_t report_x = 0, report_y = 0; static bool is_z_down = false; - cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale()); // Scale coordinates to arbitrary X, Y resolution + cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale()); // Scale coordinates to arbitrary X, Y resolution if (x && y && touchData.xValue && touchData.yValue) { report_x = (int8_t)(touchData.xValue - x); @@ -165,14 +165,13 @@ const pointing_device_driver_t pointing_device_driver = { // clang-format on #elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball) -report_mouse_t pimorono_trackball_get_report(report_mouse_t mouse_report) { - static fast_timer_t throttle = 0; - static uint16_t debounce = 0; - static uint8_t error_count = 0; - pimoroni_data_t pimoroni_data = {0}; - static int16_t x_offset = 0, y_offset = 0; - - if (error_count < PIMORONI_TRACKBALL_ERROR_COUNT && timer_elapsed_fast(throttle) >= PIMORONI_TRACKBALL_INTERVAL_MS) { +report_mouse_t pimoroni_trackball_get_report(report_mouse_t mouse_report) { + static uint16_t debounce = 0; + static uint8_t error_count = 0; + pimoroni_data_t pimoroni_data = {0}; + static int16_t x_offset = 0, y_offset = 0; + + if (error_count < PIMORONI_TRACKBALL_ERROR_COUNT) { i2c_status_t status = read_pimoroni_trackball(&pimoroni_data); if (status == I2C_STATUS_SUCCESS) { @@ -195,26 +194,26 @@ report_mouse_t pimorono_trackball_get_report(report_mouse_t mouse_report) { } else { error_count++; } - throttle = timer_read_fast(); } return mouse_report; } // clang-format off const pointing_device_driver_t pointing_device_driver = { - .init = pimironi_trackball_device_init, - .get_report = pimorono_trackball_get_report, - .set_cpi = NULL, - .get_cpi = NULL + .init = pimoroni_trackball_device_init, + .get_report = pimoroni_trackball_get_report, + .set_cpi = pimoroni_trackball_set_cpi, + .get_cpi = pimoroni_trackball_get_cpi }; // clang-format on #elif defined(POINTING_DEVICE_DRIVER_pmw3360) - -static void init(void) { pmw3360_init(); } +static void pmw3360_device_init(void) { + pmw3360_init(); +} report_mouse_t pmw3360_get_report(report_mouse_t mouse_report) { report_pmw3360_t data = pmw3360_read_burst(); - static uint16_t MotionStart = 0; // Timer for accel, 0 is resting state + static uint16_t MotionStart = 0; // Timer for accel, 0 is resting state if (data.isOnSurface && data.isMotion) { // Reset timer if stopped moving @@ -239,17 +238,59 @@ report_mouse_t pmw3360_get_report(report_mouse_t mouse_report) { // clang-format off const pointing_device_driver_t pointing_device_driver = { - .init = init, + .init = pmw3360_device_init, .get_report = pmw3360_get_report, .set_cpi = pmw3360_set_cpi, .get_cpi = pmw3360_get_cpi }; // clang-format on +#elif defined(POINTING_DEVICE_DRIVER_pmw3389) +static void pmw3389_device_init(void) { + pmw3389_init(); +} + +report_mouse_t pmw3389_get_report(report_mouse_t mouse_report) { + report_pmw3389_t data = pmw3389_read_burst(); + static uint16_t MotionStart = 0; // Timer for accel, 0 is resting state + + if (data.isOnSurface && data.isMotion) { + // Reset timer if stopped moving + if (!data.isMotion) { + if (MotionStart != 0) MotionStart = 0; + return mouse_report; + } + + // Set timer if new motion + if ((MotionStart == 0) && data.isMotion) { +# ifdef CONSOLE_ENABLE + if (debug_mouse) dprintf("Starting motion.\n"); +# endif + MotionStart = timer_read(); + } + mouse_report.x = constrain_hid(data.dx); + mouse_report.y = constrain_hid(data.dy); + } + + return mouse_report; +} + +// clang-format off +const pointing_device_driver_t pointing_device_driver = { + .init = pmw3389_device_init, + .get_report = pmw3389_get_report, + .set_cpi = pmw3389_set_cpi, + .get_cpi = pmw3389_get_cpi +}; +// clang-format on #else __attribute__((weak)) void pointing_device_driver_init(void) {} -__attribute__((weak)) report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) { return mouse_report; } -__attribute__((weak)) uint16_t pointing_device_driver_get_cpi(void) { return 0; } -__attribute__((weak)) void pointing_device_driver_set_cpi(uint16_t cpi) {} +__attribute__((weak)) report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) { + return mouse_report; +} +__attribute__((weak)) uint16_t pointing_device_driver_get_cpi(void) { + return 0; +} +__attribute__((weak)) void pointing_device_driver_set_cpi(uint16_t cpi) {} // clang-format off const pointing_device_driver_t pointing_device_driver = { diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index 3b5fa8490b93..e7fe453308bb 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c @@ -50,10 +50,17 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) { return true; } -void process_audio_noteon(uint8_t note) { play_note(compute_freq_for_midi_note(note), 0xF); } +void process_audio_noteon(uint8_t note) { + play_note(compute_freq_for_midi_note(note), 0xF); +} -void process_audio_noteoff(uint8_t note) { stop_note(compute_freq_for_midi_note(note)); } +void process_audio_noteoff(uint8_t note) { + stop_note(compute_freq_for_midi_note(note)); +} -void process_audio_all_notes_off(void) { stop_all_notes(); } +void process_audio_all_notes_off(void) { + stop_all_notes(); +} __attribute__((weak)) void audio_on_user() {} +__attribute__((weak)) void audio_off_user() {} diff --git a/quantum/process_keycode/process_audio.h b/quantum/process_keycode/process_audio.h index d89a834ea85c..42cfab4af27d 100644 --- a/quantum/process_keycode/process_audio.h +++ b/quantum/process_keycode/process_audio.h @@ -8,3 +8,4 @@ void process_audio_noteoff(uint8_t note); void process_audio_all_notes_off(void); void audio_on_user(void); +void audio_off_user(void); diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index bbc6367ff187..2150edd7b284 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -62,7 +62,9 @@ static struct { // clang-format on /** \brief Called on physical press, returns whether key should be added to Auto Shift */ -__attribute__((weak)) bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { return false; } +__attribute__((weak)) bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { + return false; +} /** \brief Called on physical press, returns whether is Auto Shift key */ __attribute__((weak)) bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { @@ -82,8 +84,12 @@ __attribute__((weak)) bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *r } /** \brief Called to check whether defines should apply if PER_KEY is set for it */ -__attribute__((weak)) bool get_auto_shift_repeat(uint16_t keycode, keyrecord_t *record) { return true; } -__attribute__((weak)) bool get_auto_shift_no_auto_repeat(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__((weak)) bool get_auto_shift_repeat(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__((weak)) bool get_auto_shift_no_auto_repeat(uint16_t keycode, keyrecord_t *record) { + return true; +} /** \brief Called when an Auto Shift key needs to be pressed */ __attribute__((weak)) void autoshift_press_user(uint16_t keycode, bool shifted, keyrecord_t *record) { @@ -94,7 +100,9 @@ __attribute__((weak)) void autoshift_press_user(uint16_t keycode, bool shifted, } /** \brief Called when an Auto Shift key needs to be released */ -__attribute__((weak)) void autoshift_release_user(uint16_t keycode, bool shifted, keyrecord_t *record) { unregister_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode); } +__attribute__((weak)) void autoshift_release_user(uint16_t keycode, bool shifted, keyrecord_t *record) { + unregister_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode); +} /** \brief Sets the shift state to use when keyrepeating, required by custom shifts */ void set_autoshift_shift_state(uint16_t keycode, bool shifted) { @@ -311,7 +319,9 @@ void autoshift_toggle(void) { autoshift_flush_shift(); } -void autoshift_enable(void) { autoshift_flags.enabled = true; } +void autoshift_enable(void) { + autoshift_flags.enabled = true; +} void autoshift_disable(void) { autoshift_flags.enabled = false; @@ -328,12 +338,20 @@ void autoshift_timer_report(void) { } # endif -bool get_autoshift_state(void) { return autoshift_flags.enabled; } +bool get_autoshift_state(void) { + return autoshift_flags.enabled; +} -uint16_t get_generic_autoshift_timeout() { return autoshift_timeout; } -__attribute__((weak)) uint16_t get_autoshift_timeout(uint16_t keycode, keyrecord_t *record) { return autoshift_timeout; } +uint16_t get_generic_autoshift_timeout() { + return autoshift_timeout; +} +__attribute__((weak)) uint16_t get_autoshift_timeout(uint16_t keycode, keyrecord_t *record) { + return autoshift_timeout; +} -void set_autoshift_timeout(uint16_t timeout) { autoshift_timeout = timeout; } +void set_autoshift_timeout(uint16_t timeout) { + autoshift_timeout = timeout; +} bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { // Note that record->event.time isn't reliable, see: diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index 6ab382d4aadf..97957349848c 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -5,40 +5,40 @@ # ifndef AUDIO_CLICKY_DELAY_DURATION # define AUDIO_CLICKY_DELAY_DURATION 1 -# endif // !AUDIO_CLICKY_DELAY_DURATION +# endif // !AUDIO_CLICKY_DELAY_DURATION # ifndef AUDIO_CLICKY_FREQ_DEFAULT # define AUDIO_CLICKY_FREQ_DEFAULT 440.0f -# endif // !AUDIO_CLICKY_FREQ_DEFAULT +# endif // !AUDIO_CLICKY_FREQ_DEFAULT # ifndef AUDIO_CLICKY_FREQ_MIN # define AUDIO_CLICKY_FREQ_MIN 65.0f -# endif // !AUDIO_CLICKY_FREQ_MIN +# endif // !AUDIO_CLICKY_FREQ_MIN # ifndef AUDIO_CLICKY_FREQ_MAX # define AUDIO_CLICKY_FREQ_MAX 1500.0f -# endif // !AUDIO_CLICKY_FREQ_MAX +# endif // !AUDIO_CLICKY_FREQ_MAX # ifndef AUDIO_CLICKY_FREQ_FACTOR # define AUDIO_CLICKY_FREQ_FACTOR 1.18921f -# endif // !AUDIO_CLICKY_FREQ_FACTOR +# endif // !AUDIO_CLICKY_FREQ_FACTOR # ifndef AUDIO_CLICKY_FREQ_RANDOMNESS # define AUDIO_CLICKY_FREQ_RANDOMNESS 0.05f -# endif // !AUDIO_CLICKY_FREQ_RANDOMNESS +# endif // !AUDIO_CLICKY_FREQ_RANDOMNESS float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; float clicky_rand = AUDIO_CLICKY_FREQ_RANDOMNESS; // the first "note" is an intentional delay; the 2nd and 3rd notes are the "clicky" -float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_MIN, AUDIO_CLICKY_DELAY_DURATION}, {AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations +float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_MIN, AUDIO_CLICKY_DELAY_DURATION}, {AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations extern audio_config_t audio_config; # ifndef NO_MUSIC_MODE extern bool music_activated; extern bool midi_activated; -# endif // !NO_MUSIC_MODE +# endif // !NO_MUSIC_MODE void clicky_play(void) { # ifndef NO_MUSIC_MODE if (music_activated || midi_activated || !audio_config.enable) return; -# endif // !NO_MUSIC_MODE +# endif // !NO_MUSIC_MODE clicky_song[1][0] = 2.0f * clicky_freq * (1.0f + clicky_rand * (((float)rand()) / ((float)(RAND_MAX)))); clicky_song[2][0] = clicky_freq * (1.0f + clicky_rand * (((float)rand()) / ((float)(RAND_MAX)))); PLAY_SONG(clicky_song); @@ -58,7 +58,9 @@ void clicky_freq_down(void) { } } -void clicky_freq_reset(void) { clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; } +void clicky_freq_reset(void) { + clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; +} void clicky_toggle(void) { audio_config.clicky_enable ^= 1; @@ -75,7 +77,9 @@ void clicky_off(void) { eeconfig_update_audio(audio_config.raw); } -bool is_clicky_on(void) { return (audio_config.clicky_enable != 0); } +bool is_clicky_on(void) { + return (audio_config.clicky_enable != 0); +} bool process_clicky(uint16_t keycode, keyrecord_t *record) { if (keycode == CLICKY_TOGGLE && record->event.pressed) { @@ -101,8 +105,8 @@ bool process_clicky(uint16_t keycode, keyrecord_t *record) { } if (audio_config.enable && audio_config.clicky_enable) { - if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound - if (keycode != AU_OFF && keycode != AU_TOG) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM + if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound + if (keycode != AU_OFF && keycode != AU_TOG) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM clicky_play(); } } @@ -110,4 +114,4 @@ bool process_clicky(uint16_t keycode, keyrecord_t *record) { return true; } -#endif // AUDIO_CLICKY +#endif // AUDIO_CLICKY diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index a050161edf89..efaf8fe0e9e6 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c @@ -17,6 +17,7 @@ #include "print.h" #include "process_combo.h" #include "action_tapping.h" +#include "action.h" #ifdef COMBO_COUNT __attribute__((weak)) combo_t key_combos[COMBO_COUNT]; @@ -29,25 +30,45 @@ extern uint16_t COMBO_LEN; __attribute__((weak)) void process_combo_event(uint16_t combo_index, bool pressed) {} #ifdef COMBO_MUST_HOLD_PER_COMBO -__attribute__((weak)) bool get_combo_must_hold(uint16_t index, combo_t *combo) { return false; } +__attribute__((weak)) bool get_combo_must_hold(uint16_t index, combo_t *combo) { + return false; +} #endif #ifdef COMBO_MUST_TAP_PER_COMBO -__attribute__((weak)) bool get_combo_must_tap(uint16_t index, combo_t *combo) { return false; } +__attribute__((weak)) bool get_combo_must_tap(uint16_t index, combo_t *combo) { + return false; +} #endif #ifdef COMBO_TERM_PER_COMBO -__attribute__((weak)) uint16_t get_combo_term(uint16_t index, combo_t *combo) { return COMBO_TERM; } +__attribute__((weak)) uint16_t get_combo_term(uint16_t index, combo_t *combo) { + return COMBO_TERM; +} +#endif + +#ifdef COMBO_MUST_PRESS_IN_ORDER_PER_COMBO +__attribute__((weak)) bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) { + return true; +} #endif #ifdef COMBO_PROCESS_KEY_RELEASE -__attribute__((weak)) bool process_combo_key_release(uint16_t combo_index, combo_t *combo, uint8_t key_index, uint16_t keycode) { return false; } +__attribute__((weak)) bool process_combo_key_release(uint16_t combo_index, combo_t *combo, uint8_t key_index, uint16_t keycode) { + return false; +} +#endif + +#ifdef COMBO_SHOULD_TRIGGER +__attribute__((weak)) bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) { + return true; +} #endif #ifndef COMBO_NO_TIMER static uint16_t timer = 0; #endif -static bool b_combo_enable = true; // defaults to enabled +static bool b_combo_enable = true; // defaults to enabled static uint16_t longest_term = 0; typedef struct { @@ -185,6 +206,9 @@ void clear_combos(void) { static inline void dump_key_buffer(void) { /* First call start from 0 index; recursive calls need to start from i+1 index */ static uint8_t key_buffer_next = 0; +#if TAP_CODE_DELAY > 0 + bool delay_done = false; +#endif if (key_buffer_size == 0) { return; @@ -210,6 +234,15 @@ static inline void dump_key_buffer(void) { #endif } record->event.time = 0; + clear_weak_mods(); + +#if TAP_CODE_DELAY > 0 + // only delay once and for a non-tapping key + if (!delay_done && !is_tap_record(record)) { + delay_done = true; + wait_ms(TAP_CODE_DELAY); + } +#endif } key_buffer_next = key_buffer_size = 0; @@ -350,6 +383,28 @@ combo_t *overlaps(combo_t *combo1, combo_t *combo2) { return combo1; } +#if defined(COMBO_MUST_PRESS_IN_ORDER) || defined(COMBO_MUST_PRESS_IN_ORDER_PER_COMBO) +static bool keys_pressed_in_order(uint16_t combo_index, combo_t *combo, uint16_t key_index, uint16_t keycode, keyrecord_t *record) { +# ifdef COMBO_MUST_PRESS_IN_ORDER_PER_COMBO + if (!get_combo_must_press_in_order(combo_index, combo)) { + return true; + } +# endif + if ( + // The `state` bit for the key being pressed. + (1 << key_index) == + // The *next* combo key's bit. + (COMBO_STATE(combo) + 1) + // E.g. two keys already pressed: `state == 11`. + // Next possible `state` is `111`. + // So the needed bit is `100` which we get with `11 + 1`. + ) { + return true; + } + return false; +} +#endif + static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t *record, uint16_t combo_index) { uint8_t key_count = 0; uint16_t key_index = -1; @@ -360,7 +415,14 @@ static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t * return false; } - bool key_is_part_of_combo = !COMBO_DISABLED(combo) && is_combo_enabled(); + bool key_is_part_of_combo = (!COMBO_DISABLED(combo) && is_combo_enabled() +#if defined(COMBO_MUST_PRESS_IN_ORDER) || defined(COMBO_MUST_PRESS_IN_ORDER_PER_COMBO) + && keys_pressed_in_order(combo_index, combo, key_index, keycode, record) +#endif +#ifdef COMBO_SHOULD_TRIGGER + && combo_should_trigger(combo_index, combo, keycode, record) +#endif + ); if (record->event.pressed && key_is_part_of_combo) { uint16_t time = _get_combo_term(combo_index, combo); @@ -412,7 +474,7 @@ static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t * // get possible longer waiting time for tap-/hold-only combos. longest_term = _get_wait_time(combo_index, combo); } - } // if timer elapsed end + } // if timer elapsed end } } else { // chord releases @@ -427,7 +489,7 @@ static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t * else if (get_combo_must_tap(combo_index, combo)) { // immediately apply tap-only combo apply_combo(combo_index, combo); - apply_combos(); // also apply other prepared combos and dump key buffer + apply_combos(); // also apply other prepared combos and dump key buffer # ifdef COMBO_PROCESS_KEY_RELEASE if (process_combo_key_release(combo_index, combo, key_index, keycode)) { release_combo(combo_index, combo); @@ -509,7 +571,7 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) { key_buffer[key_buffer_size++] = (queued_record_t){ .record = *record, .keycode = keycode, - .combo_index = -1, // this will be set when applying combos + .combo_index = -1, // this will be set when applying combos }; } } else { @@ -548,7 +610,9 @@ void combo_task(void) { #endif } -void combo_enable(void) { b_combo_enable = true; } +void combo_enable(void) { + b_combo_enable = true; +} void combo_disable(void) { #ifndef COMBO_NO_TIMER @@ -568,4 +632,6 @@ void combo_toggle(void) { } } -bool is_combo_enabled(void) { return b_combo_enable; } +bool is_combo_enabled(void) { + return b_combo_enable; +} diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c index 18c8d7ca2e10..a1ada2d5a28e 100644 --- a/quantum/process_keycode/process_dynamic_macro.c +++ b/quantum/process_keycode/process_dynamic_macro.c @@ -29,13 +29,21 @@ void dynamic_macro_led_blink(void) { /* User hooks for Dynamic Macros */ -__attribute__((weak)) void dynamic_macro_record_start_user(void) { dynamic_macro_led_blink(); } +__attribute__((weak)) void dynamic_macro_record_start_user(void) { + dynamic_macro_led_blink(); +} -__attribute__((weak)) void dynamic_macro_play_user(int8_t direction) { dynamic_macro_led_blink(); } +__attribute__((weak)) void dynamic_macro_play_user(int8_t direction) { + dynamic_macro_led_blink(); +} -__attribute__((weak)) void dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record) { dynamic_macro_led_blink(); } +__attribute__((weak)) void dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record) { + dynamic_macro_led_blink(); +} -__attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { dynamic_macro_led_blink(); } +__attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { + dynamic_macro_led_blink(); +} /* Convenience macros used for retrieving the debug info. All of them * need a `direction` variable accessible at the call site. @@ -82,7 +90,7 @@ void dynamic_macro_play(keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_ clear_keyboard(); - layer_state = saved_layer_state; + layer_state_set(saved_layer_state); dynamic_macro_play_user(direction); } diff --git a/quantum/process_keycode/process_grave_esc.c b/quantum/process_keycode/process_grave_esc.c index 41c50f5cb8b3..ddf027391d5a 100644 --- a/quantum/process_keycode/process_grave_esc.c +++ b/quantum/process_keycode/process_grave_esc.c @@ -15,13 +15,13 @@ */ #include "process_grave_esc.h" -/* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise. +/* true if the last press of QK_GRAVE_ESCAPE was shifted (i.e. GUI or SHIFT were pressed), false otherwise. * Used to ensure that the correct keycode is released if the key is released. */ static bool grave_esc_was_shifted = false; bool process_grave_esc(uint16_t keycode, keyrecord_t *record) { - if (keycode == GRAVE_ESC) { + if (keycode == QK_GRAVE_ESCAPE) { const uint8_t mods = get_mods(); uint8_t shifted = mods & MOD_MASK_SG; diff --git a/quantum/process_keycode/process_haptic.c b/quantum/process_keycode/process_haptic.c index 85b2ffcddd5b..0f07f9ac7515 100644 --- a/quantum/process_keycode/process_haptic.c +++ b/quantum/process_keycode/process_haptic.c @@ -35,9 +35,6 @@ __attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t case QK_MOMENTARY ... QK_MOMENTARY_MAX: case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: #endif -#ifdef NO_HAPTIC_FN - case KC_FN0 ... KC_FN31: -#endif #ifdef NO_HAPTIC_ALPHA case KC_A ... KC_Z: #endif diff --git a/quantum/process_keycode/process_joystick.c b/quantum/process_keycode/process_joystick.c index fa9c2c1dbccc..2fb092c5736f 100644 --- a/quantum/process_keycode/process_joystick.c +++ b/quantum/process_keycode/process_joystick.c @@ -74,7 +74,9 @@ void restorePinState(pin_t pin, uint16_t restoreState) { #endif } -__attribute__((weak)) bool process_joystick_analogread() { return process_joystick_analogread_quantum(); } +__attribute__((weak)) bool process_joystick_analogread() { + return process_joystick_analogread_quantum(); +} bool process_joystick_analogread_quantum() { #if JOYSTICK_AXES_COUNT > 0 diff --git a/quantum/process_keycode/process_key_lock.c b/quantum/process_keycode/process_key_lock.c index 4bd58f0c1eb2..941a2c5780ad 100644 --- a/quantum/process_keycode/process_key_lock.c +++ b/quantum/process_keycode/process_key_lock.c @@ -56,6 +56,11 @@ static inline uint16_t translate_keycode(uint16_t keycode) { } } +void cancel_key_lock(void) { + watching = false; + UNSET_KEY_STATE(0x0); +} + bool process_key_lock(uint16_t *keycode, keyrecord_t *record) { // We start by categorizing the keypress event. In the event of a down // event, there are several possibilities: diff --git a/quantum/process_keycode/process_key_lock.h b/quantum/process_keycode/process_key_lock.h index baa0b39077aa..5159b0ba023c 100644 --- a/quantum/process_keycode/process_key_lock.h +++ b/quantum/process_keycode/process_key_lock.h @@ -18,4 +18,5 @@ #include "quantum.h" +void cancel_key_lock(void); bool process_key_lock(uint16_t *keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c index 09b2725079ef..ad9683d10666 100644 --- a/quantum/process_keycode/process_key_override.c +++ b/quantum/process_keycode/process_key_override.c @@ -106,7 +106,9 @@ void key_override_toggle(void) { } } -bool key_override_is_enabled(void) { return enabled; } +bool key_override_is_enabled(void) { + return enabled; +} // Returns whether the modifiers that are pressed are such that the override should activate static bool key_override_matches_active_modifiers(const key_override_t *override, const uint8_t mods) { @@ -150,7 +152,7 @@ static void schedule_deferred_register(const uint16_t keycode) { } else { // Wait a very short time when a modifier event triggers the override to avoid false activations when e.g. a modifier is pressed just before a key is released (with the intention of pairing the modifier with a different key), or a modifier is lifted shortly before the trigger key is lifted. Operating systems by default reject modifier-events that happen very close to a non-modifier event. defer_reference_time = timer_read32(); - defer_delay = 50; // 50ms + defer_delay = 50; // 50ms } deferred_register = keycode; } @@ -174,8 +176,8 @@ const key_override_t *clear_active_override(const bool allow_reregister) { const uint8_t mod_free_replacement = clear_mods_from(active_override->replacement); - bool unregister_replacement = mod_free_replacement != KC_NO && // KC_NO is never registered - mod_free_replacement < SAFE_RANGE; // Custom keycodes are never registered + bool unregister_replacement = mod_free_replacement != KC_NO && // KC_NO is never registered + mod_free_replacement < SAFE_RANGE; // Custom keycodes are never registered // Try firing the custom handler if (active_override->custom_action != NULL) { @@ -195,11 +197,11 @@ const key_override_t *clear_active_override(const bool allow_reregister) { const uint16_t trigger = active_override->trigger; - const bool reregister_trigger = allow_reregister && // Check if allowed from caller - (active_override->options & ko_option_no_reregister_trigger) == 0 && // Check if override allows - active_override_trigger_is_down && // Check if trigger is even down - trigger != KC_NO && // KC_NO is never registered - trigger < SAFE_RANGE; // A custom keycode should not be registered + const bool reregister_trigger = allow_reregister && // Check if allowed from caller + (active_override->options & ko_option_no_reregister_trigger) == 0 && // Check if override allows + active_override_trigger_is_down && // Check if trigger is even down + trigger != KC_NO && // KC_NO is never registered + trigger < SAFE_RANGE; // A custom keycode should not be registered // Optionally re-register the trigger if it is still down if (reregister_trigger) { @@ -336,8 +338,8 @@ static bool try_activating_override(const uint16_t keycode, const uint8_t layer, const uint16_t mod_free_replacement = clear_mods_from(override->replacement); - bool register_replacement = mod_free_replacement != KC_NO && // KC_NO is never registered - mod_free_replacement < SAFE_RANGE; // Custom keycodes are never registered + bool register_replacement = mod_free_replacement != KC_NO && // KC_NO is never registered + mod_free_replacement < SAFE_RANGE; // Custom keycodes are never registered // Try firing the custom handler if (override->custom_action != NULL) { diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index cf63f2514137..c2fd02e5c713 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -51,13 +51,13 @@ bool process_leader(uint16_t keycode, keyrecord_t *record) { if (leading) { # ifndef LEADER_NO_TIMEOUT if (timer_elapsed(leader_time) < LEADER_TIMEOUT) -# endif // LEADER_NO_TIMEOUT +# endif // LEADER_NO_TIMEOUT { # ifndef LEADER_KEY_STRICT_KEY_PROCESSING if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } -# endif // LEADER_KEY_STRICT_KEY_PROCESSING +# endif // LEADER_KEY_STRICT_KEY_PROCESSING if (leader_sequence_size < (sizeof(leader_sequence) / sizeof(leader_sequence[0]))) { leader_sequence[leader_sequence_size] = keycode; leader_sequence_size++; diff --git a/quantum/process_keycode/process_magic.c b/quantum/process_keycode/process_magic.c index d5cff4f12aa9..10161adda376 100644 --- a/quantum/process_keycode/process_magic.c +++ b/quantum/process_keycode/process_magic.c @@ -44,6 +44,7 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_ALT_GUI: case MAGIC_SWAP_LCTL_LGUI ... MAGIC_EE_HANDS_RIGHT: case MAGIC_TOGGLE_GUI: + case MAGIC_TOGGLE_CONTROL_CAPSLOCK: /* keymap config */ keymap_config.raw = eeconfig_read_keymap(); switch (keycode) { @@ -75,7 +76,7 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { keymap_config.swap_backslash_backspace = true; break; case MAGIC_HOST_NKRO: - clear_keyboard(); // clear first buffer to prevent stuck keys + clear_keyboard(); // clear first buffer to prevent stuck keys keymap_config.nkro = true; break; case MAGIC_SWAP_ALT_GUI: @@ -118,7 +119,7 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { keymap_config.swap_backslash_backspace = false; break; case MAGIC_UNHOST_NKRO: - clear_keyboard(); // clear first buffer to prevent stuck keys + clear_keyboard(); // clear first buffer to prevent stuck keys keymap_config.nkro = false; break; case MAGIC_UNSWAP_ALT_GUI: @@ -156,7 +157,7 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { #endif break; case MAGIC_TOGGLE_NKRO: - clear_keyboard(); // clear first buffer to prevent stuck keys + clear_keyboard(); // clear first buffer to prevent stuck keys keymap_config.nkro = !keymap_config.nkro; break; case MAGIC_EE_HANDS_LEFT: @@ -168,10 +169,13 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { case MAGIC_TOGGLE_GUI: keymap_config.no_gui = !keymap_config.no_gui; break; + case MAGIC_TOGGLE_CONTROL_CAPSLOCK: + keymap_config.swap_control_capslock = !keymap_config.swap_control_capslock; + break; } eeconfig_update_keymap(keymap_config.raw); - clear_keyboard(); // clear to prevent stuck keys + clear_keyboard(); // clear to prevent stuck keys return false; } diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 9632d2b75710..c49c31a52515 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -22,13 +22,19 @@ # ifdef MIDI_BASIC -void process_midi_basic_noteon(uint8_t note) { midi_send_noteon(&midi_device, 0, note, 127); } +void process_midi_basic_noteon(uint8_t note) { + midi_send_noteon(&midi_device, 0, note, 127); +} -void process_midi_basic_noteoff(uint8_t note) { midi_send_noteoff(&midi_device, 0, note, 0); } +void process_midi_basic_noteoff(uint8_t note) { + midi_send_noteoff(&midi_device, 0, note, 0); +} -void process_midi_all_notes_off(void) { midi_send_cc(&midi_device, 0, 0x7B, 0); } +void process_midi_all_notes_off(void) { + midi_send_cc(&midi_device, 0, 0x7B, 0); +} -# endif // MIDI_BASIC +# endif // MIDI_BASIC # ifdef MIDI_ADVANCED @@ -41,7 +47,9 @@ static int8_t midi_modulation_step; static uint16_t midi_modulation_timer; midi_config_t midi_config; -inline uint8_t compute_velocity(uint8_t setting) { return setting * (128 / (MIDI_VELOCITY_MAX - MIDI_VELOCITY_MIN)); } +inline uint8_t compute_velocity(uint8_t setting) { + return setting * (128 / (MIDI_VELOCITY_MAX - MIDI_VELOCITY_MIN)); +} void midi_init(void) { midi_config.octave = MI_OCT_2 - MIDI_OCTAVE_MIN; @@ -60,7 +68,9 @@ void midi_init(void) { midi_modulation_timer = 0; } -uint8_t midi_compute_note(uint16_t keycode) { return 12 * midi_config.octave + (keycode - MIDI_TONE_MIN) + midi_config.transpose; } +uint8_t midi_compute_note(uint16_t keycode) { + return 12 * midi_config.octave + (keycode - MIDI_TONE_MIN) + midi_config.transpose; +} bool process_midi(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -238,7 +248,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { return true; } -# endif // MIDI_ADVANCED +# endif // MIDI_ADVANCED void midi_task(void) { midi_device_process(&midi_device); @@ -263,4 +273,4 @@ void midi_task(void) { # endif } -#endif // MIDI_ENABLE +#endif // MIDI_ENABLE diff --git a/quantum/process_keycode/process_midi.h b/quantum/process_keycode/process_midi.h index 68c6eda6665a..e528c6ec0cab 100644 --- a/quantum/process_keycode/process_midi.h +++ b/quantum/process_keycode/process_midi.h @@ -49,6 +49,6 @@ bool process_midi(uint16_t keycode, keyrecord_t *record); # define MIDI_TONE_COUNT (MIDI_TONE_MAX - MIDI_TONE_MIN + 1) uint8_t midi_compute_note(uint16_t keycode); -# endif // MIDI_ADVANCED +# endif // MIDI_ADVANCED -#endif // MIDI_ENABLE +#endif // MIDI_ENABLE diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 6822c5e28912..eeec0c28a4ad 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -146,7 +146,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { if (music_activated || midi_activated) { if (record->event.pressed) { - if (keycode == KC_LEFT_CTRL) { // Start recording + if (keycode == KC_LEFT_CTRL) { // Start recording music_all_notes_off(); music_sequence_recording = true; music_sequence_recorded = false; @@ -155,9 +155,9 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { return false; } - if (keycode == KC_LEFT_ALT) { // Stop recording/playing + if (keycode == KC_LEFT_ALT) { // Stop recording/playing music_all_notes_off(); - if (music_sequence_recording) { // was recording + if (music_sequence_recording) { // was recording music_sequence_recorded = true; } music_sequence_recording = false; @@ -165,7 +165,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { return false; } - if (keycode == KC_LEFT_GUI && music_sequence_recorded) { // Start playing + if (keycode == KC_LEFT_GUI && music_sequence_recorded) { // Start playing music_all_notes_off(); music_sequence_recording = false; music_sequence_playing = true; @@ -230,11 +230,17 @@ bool music_mask(uint16_t keycode) { # endif } -__attribute__((weak)) bool music_mask_kb(uint16_t keycode) { return music_mask_user(keycode); } +__attribute__((weak)) bool music_mask_kb(uint16_t keycode) { + return music_mask_user(keycode); +} -__attribute__((weak)) bool music_mask_user(uint16_t keycode) { return keycode < 0xFF; } +__attribute__((weak)) bool music_mask_user(uint16_t keycode) { + return keycode < 0xFF; +} -bool is_music_on(void) { return (music_activated != 0); } +bool is_music_on(void) { + return (music_activated != 0); +} void music_toggle(void) { if (!music_activated) { @@ -260,7 +266,9 @@ void music_off(void) { # endif } -bool is_midi_on(void) { return (midi_activated != 0); } +bool is_midi_on(void) { + return (midi_activated != 0); +} void midi_toggle(void) { if (!midi_activated) { @@ -315,4 +323,4 @@ __attribute__((weak)) void midi_on_user() {} __attribute__((weak)) void music_scale_user() {} -#endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) +#endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) diff --git a/quantum/process_keycode/process_music.h b/quantum/process_keycode/process_music.h index e275cd9d26f3..83726a05ba9f 100644 --- a/quantum/process_keycode/process_music.h +++ b/quantum/process_keycode/process_music.h @@ -51,8 +51,10 @@ bool music_mask_kb(uint16_t keycode); bool music_mask_user(uint16_t keycode); # ifndef SCALE -# define SCALE \ - (int8_t[]) { 0 + (12 * 0), 2 + (12 * 0), 4 + (12 * 0), 5 + (12 * 0), 7 + (12 * 0), 9 + (12 * 0), 11 + (12 * 0), 0 + (12 * 1), 2 + (12 * 1), 4 + (12 * 1), 5 + (12 * 1), 7 + (12 * 1), 9 + (12 * 1), 11 + (12 * 1), 0 + (12 * 2), 2 + (12 * 2), 4 + (12 * 2), 5 + (12 * 2), 7 + (12 * 2), 9 + (12 * 2), 11 + (12 * 2), 0 + (12 * 3), 2 + (12 * 3), 4 + (12 * 3), 5 + (12 * 3), 7 + (12 * 3), 9 + (12 * 3), 11 + (12 * 3), 0 + (12 * 4), 2 + (12 * 4), 4 + (12 * 4), 5 + (12 * 4), 7 + (12 * 4), 9 + (12 * 4), 11 + (12 * 4), } +# define SCALE \ + (int8_t[]) { \ + 0 + (12 * 0), 2 + (12 * 0), 4 + (12 * 0), 5 + (12 * 0), 7 + (12 * 0), 9 + (12 * 0), 11 + (12 * 0), 0 + (12 * 1), 2 + (12 * 1), 4 + (12 * 1), 5 + (12 * 1), 7 + (12 * 1), 9 + (12 * 1), 11 + (12 * 1), 0 + (12 * 2), 2 + (12 * 2), 4 + (12 * 2), 5 + (12 * 2), 7 + (12 * 2), 9 + (12 * 2), 11 + (12 * 2), 0 + (12 * 3), 2 + (12 * 3), 4 + (12 * 3), 5 + (12 * 3), 7 + (12 * 3), 9 + (12 * 3), 11 + (12 * 3), 0 + (12 * 4), 2 + (12 * 4), 4 + (12 * 4), 5 + (12 * 4), 7 + (12 * 4), 9 + (12 * 4), 11 + (12 * 4), \ + } # endif -#endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) +#endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c index 82528cc680db..6dd1f28c9b40 100644 --- a/quantum/process_keycode/process_printer.c +++ b/quantum/process_keycode/process_printer.c @@ -16,16 +16,19 @@ #include "process_printer.h" #include "action_util.h" +#include "uart.h" bool printing_enabled = false; uint8_t character_shift = 0; void enable_printing(void) { printing_enabled = true; - serial_init(); + uart_init(19200); } -void disable_printing(void) { printing_enabled = false; } +void disable_printing(void) { + printing_enabled = false; +} uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29}; @@ -35,12 +38,13 @@ uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0 void print_char(char c) { USB_Disable(); - serial_send(c); + uart_write(c); USB_Init(); } void print_string(char c[]) { - for (uint8_t i = 0; i < strlen(c); i++) print_char(c[i]); + for (uint8_t i = 0; i < strlen(c); i++) + print_char(c[i]); } void print_box_string(const char text[]) { diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h index 3c6d06ff94af..6f4d09f33310 100644 --- a/quantum/process_keycode/process_printer.h +++ b/quantum/process_keycode/process_printer.h @@ -18,6 +18,4 @@ #include "quantum.h" -#include "protocol/serial.h" - bool process_printer(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c index 6c91bd27ef79..88a9f33994d9 100644 --- a/quantum/process_keycode/process_printer_bb.c +++ b/quantum/process_keycode/process_printer_bb.c @@ -25,13 +25,21 @@ uint8_t character_shift = 0; #define SERIAL_PIN_MASK _BV(PD3) #define SERIAL_DELAY 52 -inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} -inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} -inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} -inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } +inline static void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} void enable_printing() { printing_enabled = true; @@ -39,7 +47,9 @@ void enable_printing() { serial_high(); } -void disable_printing() { printing_enabled = false; } +void disable_printing() { + printing_enabled = false; +} uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29}; @@ -61,7 +71,8 @@ void print_char(char c) { } void print_string(char c[]) { - for (uint8_t i = 0; i < strlen(c); i++) print_char(c[i]); + for (uint8_t i = 0; i < strlen(c); i++) + print_char(c[i]); } bool process_printer(uint16_t keycode, keyrecord_t *record) { diff --git a/quantum/process_keycode/process_rgb.c b/quantum/process_keycode/process_rgb.c index 69853cd5c4d9..c805bd615de0 100644 --- a/quantum/process_keycode/process_rgb.c +++ b/quantum/process_keycode/process_rgb.c @@ -51,12 +51,8 @@ static void __attribute__((noinline, unused)) handleKeycodeRGBMode(const uint8_t * Handle keycodes for both rgblight and rgbmatrix */ bool process_rgb(const uint16_t keycode, const keyrecord_t *record) { -#ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -#else - // Split keyboards need to trigger on key-up for edge-case issue + // need to trigger on key-up for edge-case issue if (!record->event.pressed) { -#endif #if (defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)) || (defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES)) uint8_t shifted = get_mods() & MOD_MASK_SHIFT; #endif diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c index 5d0bb313b4cf..12ee8982125a 100644 --- a/quantum/process_keycode/process_steno.c +++ b/quantum/process_keycode/process_steno.c @@ -102,11 +102,17 @@ void steno_set_mode(steno_mode_t new_mode) { /* override to intercept chords right before they get sent. * return zero to suppress normal sending behavior. */ -__attribute__((weak)) bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { return true; } +__attribute__((weak)) bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { + return true; +} -__attribute__((weak)) bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed) { return true; } +__attribute__((weak)) bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed) { + return true; +} -__attribute__((weak)) bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_steno_user(uint16_t keycode, keyrecord_t *record) { + return true; +} static void send_steno_chord(void) { if (send_steno_chord_user(mode, chord)) { @@ -114,11 +120,11 @@ static void send_steno_chord(void) { case STENO_MODE_BOLT: send_steno_state(BOLT_STATE_SIZE, false); #ifdef VIRTSER_ENABLE - virtser_send(0); // terminating byte + virtser_send(0); // terminating byte #endif break; case STENO_MODE_GEMINI: - chord[0] |= 0x80; // Indicate start of packet + chord[0] |= 0x80; // Indicate start of packet send_steno_state(GEMINI_STATE_SIZE, true); break; } @@ -126,9 +132,13 @@ static void send_steno_chord(void) { steno_clear_state(); } -uint8_t *steno_get_state(void) { return &state[0]; } +uint8_t *steno_get_state(void) { + return &state[0]; +} -uint8_t *steno_get_chord(void) { return &chord[0]; } +uint8_t *steno_get_chord(void) { + return &chord[0]; +} static bool update_state_bolt(uint8_t key, bool press) { uint8_t boltcode = pgm_read_byte(boltmap + key); diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index c707fdea308e..e99119b2aee2 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -86,7 +86,9 @@ static inline void _process_tap_dance_action_fn(qk_tap_dance_state_t *state, voi } } -static inline void process_tap_dance_action_on_each_tap(qk_tap_dance_action_t *action) { _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_each_tap); } +static inline void process_tap_dance_action_on_each_tap(qk_tap_dance_action_t *action) { + _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_each_tap); +} static inline void process_tap_dance_action_on_dance_finished(qk_tap_dance_action_t *action) { if (action->state.finished) return; @@ -173,7 +175,7 @@ void tap_dance_task() { tap_user_defined = action->custom_tapping_term; } else { #ifdef TAPPING_TERM_PER_KEY - tap_user_defined = get_tapping_term(action->state.keycode, NULL); + tap_user_defined = get_tapping_term(action->state.keycode, &(keyrecord_t){}); #else tap_user_defined = TAPPING_TERM; #endif diff --git a/quantum/process_keycode/process_terminal.c b/quantum/process_keycode/process_terminal.c index a059f3a521a8..da1c4d506f60 100644 --- a/quantum/process_keycode/process_terminal.c +++ b/quantum/process_keycode/process_terminal.c @@ -27,12 +27,12 @@ bool terminal_enabled = false; char buffer[80] = ""; char cmd_buffer[CMD_BUFF_SIZE][80]; -bool cmd_buffer_enabled = true; // replace with ifdef? +bool cmd_buffer_enabled = true; // replace with ifdef? char newline[2] = "\n"; char arguments[6][20]; bool firstTime = true; -short int current_cmd_buffer_pos = 0; // used for up/down arrows - keeps track of where you are in the command buffer +short int current_cmd_buffer_pos = 0; // used for up/down arrows - keeps track of where you are in the command buffer __attribute__((weak)) const char terminal_prompt[8] = "> "; @@ -59,7 +59,8 @@ void enable_terminal(void) { terminal_enabled = true; strcpy(buffer, ""); memset(cmd_buffer, 0, CMD_BUFF_SIZE * 80); - for (int i = 0; i < 6; i++) strcpy(arguments[i], ""); + for (int i = 0; i < 6; i++) + strcpy(arguments[i], ""); // select all text to start over // SEND_STRING(SS_LCTL("a")); send_string(terminal_prompt); @@ -160,7 +161,7 @@ void print_cmd_buff(void) { for (int i = 0; i < CMD_BUFF_SIZE; i++) { char tmpChar = ' '; itoa(i, &tmpChar, 10); - const char *tmpCnstCharStr = &tmpChar; // because sned_string wont take a normal char * + const char *tmpCnstCharStr = &tmpChar; // because sned_string wont take a normal char * send_string(tmpCnstCharStr); SEND_STRING(". "); send_string(cmd_buffer[i]); @@ -185,7 +186,7 @@ void terminal_help(void) { } void command_not_found(void) { - wait_ms(50); // sometimes buffer isnt grabbed quick enough + wait_ms(50); // sometimes buffer isnt grabbed quick enough SEND_STRING("command \""); send_string(buffer); SEND_STRING("\" not found\n"); @@ -217,15 +218,16 @@ void process_terminal_command(void) { if (terminal_enabled) { strcpy(buffer, ""); - for (int i = 0; i < 6; i++) strcpy(arguments[i], ""); + for (int i = 0; i < 6; i++) + strcpy(arguments[i], ""); SEND_STRING(SS_TAP(X_HOME)); send_string(terminal_prompt); } } void check_pos(void) { - if (current_cmd_buffer_pos >= CMD_BUFF_SIZE) { // if over the top, move it back down to the top of the buffer so you can climb back down... + if (current_cmd_buffer_pos >= CMD_BUFF_SIZE) { // if over the top, move it back down to the top of the buffer so you can climb back down... current_cmd_buffer_pos = CMD_BUFF_SIZE - 1; - } else if (current_cmd_buffer_pos < 0) { //...and if you fall under the bottom of the buffer, reset back to 0 so you can climb back up + } else if (current_cmd_buffer_pos < 0) { //...and if you fall under the bottom of the buffer, reset back to 0 so you can climb back up current_cmd_buffer_pos = 0; } } @@ -278,33 +280,33 @@ bool process_terminal(uint16_t keycode, keyrecord_t *record) { case KC_RIGHT: return false; break; - case KC_UP: // 0 = recent - check_pos(); // check our current buffer position is valid - if (current_cmd_buffer_pos <= CMD_BUFF_SIZE - 1) { // once we get to the top, dont do anything + case KC_UP: // 0 = recent + check_pos(); // check our current buffer position is valid + if (current_cmd_buffer_pos <= CMD_BUFF_SIZE - 1) { // once we get to the top, dont do anything str_len = strlen(buffer); for (int i = 0; i < str_len; ++i) { - send_string(SS_TAP(X_BSPACE)); // clear w/e is on the line already + send_string(SS_TAP(X_BSPACE)); // clear w/e is on the line already // process_terminal(KC_BACKSPACE,record); } strncpy(buffer, cmd_buffer[current_cmd_buffer_pos], 80); send_string(buffer); - ++current_cmd_buffer_pos; // get ready to access the above cmd if up/down is pressed again + ++current_cmd_buffer_pos; // get ready to access the above cmd if up/down is pressed again } return false; break; case KC_DOWN: check_pos(); - if (current_cmd_buffer_pos >= 0) { // once we get to the bottom, dont do anything + if (current_cmd_buffer_pos >= 0) { // once we get to the bottom, dont do anything str_len = strlen(buffer); for (int i = 0; i < str_len; ++i) { - send_string(SS_TAP(X_BSPACE)); // clear w/e is on the line already + send_string(SS_TAP(X_BSPACE)); // clear w/e is on the line already // process_terminal(KC_BACKSPACE,record); } strncpy(buffer, cmd_buffer[current_cmd_buffer_pos], 79); send_string(buffer); - --current_cmd_buffer_pos; // get ready to access the above cmd if down/up is pressed again + --current_cmd_buffer_pos; // get ready to access the above cmd if down/up is pressed again } return false; break; diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index d084d2b66c6d..6a8d8f0ff6a4 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -27,7 +27,7 @@ void qk_ucis_start(void) { __attribute__((weak)) void qk_ucis_start_user(void) { unicode_input_start(); - register_hex(0x2328); // ⌨ + register_hex(0x2328); // ⌨ unicode_input_finish(); } diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 7685bb1c9950..46b77e14bae5 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -54,7 +54,9 @@ void unicode_input_mode_init(void) { dprintf("Unicode input mode init to: %u\n", unicode_config.input_mode); } -uint8_t get_unicode_input_mode(void) { return unicode_config.input_mode; } +uint8_t get_unicode_input_mode(void) { + return unicode_config.input_mode; +} void set_unicode_input_mode(uint8_t mode) { unicode_config.input_mode = mode; @@ -76,7 +78,9 @@ void cycle_unicode_input_mode(int8_t offset) { #endif } -void persist_unicode_input_mode(void) { eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); } +void persist_unicode_input_mode(void) { + eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); +} __attribute__((weak)) void unicode_input_start(void) { unicode_saved_caps_lock = host_keyboard_led_state().caps_lock; @@ -90,8 +94,8 @@ __attribute__((weak)) void unicode_input_start(void) { tap_code(KC_CAPS_LOCK); } - unicode_saved_mods = get_mods(); // Save current mods - clear_mods(); // Unregister mods to start from a clean state + unicode_saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state switch (unicode_config.input_mode) { case UC_MAC: @@ -140,7 +144,7 @@ __attribute__((weak)) void unicode_input_finish(void) { break; } - set_mods(unicode_saved_mods); // Reregister previously set mods + set_mods(unicode_saved_mods); // Reregister previously set mods } __attribute__((weak)) void unicode_input_cancel(void) { @@ -165,7 +169,7 @@ __attribute__((weak)) void unicode_input_cancel(void) { break; } - set_mods(unicode_saved_mods); // Reregister previously set mods + set_mods(unicode_saved_mods); // Reregister previously set mods } // clang-format off @@ -262,16 +266,16 @@ void send_unicode_hex_string(const char *str) { static const char *decode_utf8(const char *str, int32_t *code_point) { const char *next; - if (str[0] < 0x80) { // U+0000-007F + if (str[0] < 0x80) { // U+0000-007F *code_point = str[0]; next = str + 1; - } else if ((str[0] & 0xE0) == 0xC0) { // U+0080-07FF + } else if ((str[0] & 0xE0) == 0xC0) { // U+0080-07FF *code_point = ((int32_t)(str[0] & 0x1F) << 6) | ((int32_t)(str[1] & 0x3F) << 0); next = str + 2; - } else if ((str[0] & 0xF0) == 0xE0) { // U+0800-FFFF + } else if ((str[0] & 0xF0) == 0xE0) { // U+0800-FFFF *code_point = ((int32_t)(str[0] & 0x0F) << 12) | ((int32_t)(str[1] & 0x3F) << 6) | ((int32_t)(str[2] & 0x3F) << 0); next = str + 3; - } else if ((str[0] & 0xF8) == 0xF0 && (str[0] <= 0xF4)) { // U+10000-10FFFF + } else if ((str[0] & 0xF8) == 0xF0 && (str[0] <= 0xF4)) { // U+10000-10FFFF *code_point = ((int32_t)(str[0] & 0x07) << 18) | ((int32_t)(str[1] & 0x3F) << 12) | ((int32_t)(str[2] & 0x3F) << 6) | ((int32_t)(str[3] & 0x3F) << 0); next = str + 4; } else { diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index 72defb445eb1..1a6607c757d6 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -59,12 +59,12 @@ #define UC_OSX UC_MAC enum unicode_input_modes { - UC_MAC, // macOS using Unicode Hex Input - UC_LNX, // Linux using IBus - UC_WIN, // Windows using EnableHexNumpad - UC_BSD, // BSD (not implemented) - UC_WINC, // Windows using WinCompose (https://github.com/samhocevar/wincompose) - UC__COUNT // Number of available input modes (always leave at the end) + UC_MAC, // macOS using Unicode Hex Input + UC_LNX, // Linux using IBus + UC_WIN, // Windows using EnableHexNumpad + UC_BSD, // BSD (not implemented) + UC_WINC, // Windows using WinCompose (https://github.com/samhocevar/wincompose) + UC__COUNT // Number of available input modes (always leave at the end) }; typedef union { diff --git a/quantum/programmable_button.c b/quantum/programmable_button.c index be828fd17cd8..a3ef42d82ba2 100644 --- a/quantum/programmable_button.c +++ b/quantum/programmable_button.c @@ -22,16 +22,30 @@ along with this program. If not, see . static uint32_t programmable_button_report = 0; -void programmable_button_clear(void) { programmable_button_report = 0; } +void programmable_button_clear(void) { + programmable_button_report = 0; +} -void programmable_button_send(void) { host_programmable_button_send(programmable_button_report); } +void programmable_button_send(void) { + host_programmable_button_send(programmable_button_report); +} -void programmable_button_on(uint8_t index) { programmable_button_report |= REPORT_BIT(index); } +void programmable_button_on(uint8_t index) { + programmable_button_report |= REPORT_BIT(index); +} -void programmable_button_off(uint8_t index) { programmable_button_report &= ~REPORT_BIT(index); } +void programmable_button_off(uint8_t index) { + programmable_button_report &= ~REPORT_BIT(index); +} -bool programmable_button_is_on(uint8_t index) { return !!(programmable_button_report & REPORT_BIT(index)); }; +bool programmable_button_is_on(uint8_t index) { + return !!(programmable_button_report & REPORT_BIT(index)); +}; -uint32_t programmable_button_get_report(void) { return programmable_button_report; }; +uint32_t programmable_button_get_report(void) { + return programmable_button_report; +}; -void programmable_button_set_report(uint32_t report) { programmable_button_report = report; } +void programmable_button_set_report(uint32_t report) { + programmable_button_report = report; +} diff --git a/quantum/quantum.c b/quantum/quantum.c index be43faaf6b74..ef6e5ac1df75 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "magic.h" #ifdef BLUETOOTH_ENABLE # include "outputselect.h" @@ -47,10 +46,6 @@ float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS; # endif #endif -#ifdef AUTO_SHIFT_ENABLE -# include "process_auto_shift.h" -#endif - uint8_t extract_mod_bits(uint16_t code) { switch (code) { case QK_MODS ... QK_MODS_MAX: @@ -61,7 +56,7 @@ uint8_t extract_mod_bits(uint16_t code) { uint8_t mods_to_send = 0; - if (code & QK_RMODS_MIN) { // Right mod flag is set + if (code & QK_RMODS_MIN) { // Right mod flag is set if (code & QK_LCTL) mods_to_send |= MOD_BIT(KC_RIGHT_CTRL); if (code & QK_LSFT) mods_to_send |= MOD_BIT(KC_RIGHT_SHIFT); if (code & QK_LALT) mods_to_send |= MOD_BIT(KC_RIGHT_ALT); @@ -76,9 +71,11 @@ uint8_t extract_mod_bits(uint16_t code) { return mods_to_send; } -static void do_code16(uint16_t code, void (*f)(uint8_t)) { f(extract_mod_bits(code)); } +void do_code16(uint16_t code, void (*f)(uint8_t)) { + f(extract_mod_bits(code)); +} -void register_code16(uint16_t code) { +__attribute__((weak)) void register_code16(uint16_t code) { if (IS_MOD(code) || code == KC_NO) { do_code16(code, register_mods); } else { @@ -87,7 +84,7 @@ void register_code16(uint16_t code) { register_code(code); } -void unregister_code16(uint16_t code) { +__attribute__((weak)) void unregister_code16(uint16_t code) { unregister_code(code); if (IS_MOD(code) || code == KC_NO) { do_code16(code, unregister_mods); @@ -96,21 +93,31 @@ void unregister_code16(uint16_t code) { } } -void tap_code16(uint16_t code) { +__attribute__((weak)) void tap_code16(uint16_t code) { register_code16(code); -#if TAP_CODE_DELAY > 0 - wait_ms(TAP_CODE_DELAY); -#endif + if (code == KC_CAPS_LOCK) { + wait_ms(TAP_HOLD_CAPS_DELAY); + } else if (TAP_CODE_DELAY > 0) { + wait_ms(TAP_CODE_DELAY); + } unregister_code16(code); } -__attribute__((weak)) bool process_action_kb(keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_action_kb(keyrecord_t *record) { + return true; +} -__attribute__((weak)) bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } +__attribute__((weak)) bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} -__attribute__((weak)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} -__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_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) {} @@ -126,7 +133,8 @@ void reset_keyboard(void) { uint16_t timer_start = timer_read(); PLAY_SONG(goodbye_song); shutdown_user(); - while (timer_elapsed(timer_start) < 250) wait_ms(1); + while (timer_elapsed(timer_start) < 250) + wait_ms(1); stop_all_notes(); #else shutdown_user(); @@ -181,7 +189,7 @@ bool pre_process_record_quantum(keyrecord_t *record) { true)) { return false; } - return true; // continue processing + return true; // continue processing } /* Get keycode, and then call keyboard function */ @@ -263,7 +271,7 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef TAP_DANCE_ENABLE process_tap_dance(keycode, record) && #endif -#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) +#if defined(UNICODE_COMMON_ENABLE) process_unicode_common(keycode, record) && #endif #ifdef LEADER_ENABLE @@ -306,12 +314,12 @@ bool process_record_quantum(keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { #ifndef NO_RESET - case RESET: + case QK_BOOTLOADER: reset_keyboard(); return false; #endif #ifndef NO_DEBUG - case DEBUG: + case QK_DEBUG_TOGGLE: debug_enable ^= 1; if (debug_enable) { print("DEBUG: enabled.\n"); @@ -320,7 +328,7 @@ bool process_record_quantum(keyrecord_t *record) { } #endif return false; - case EEPROM_RESET: + case QK_CLEAR_EEPROM: eeconfig_init(); return false; #ifdef VELOCIKEY_ENABLE @@ -370,104 +378,18 @@ layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_ return (state & mask12) == mask12 ? (state | mask3) : (state & ~mask3); } -void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) { layer_state_set(update_tri_layer_state(layer_state, layer1, layer2, layer3)); } +void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + layer_state_set(update_tri_layer_state(layer_state, layer1, layer2, layer3)); +} +// TODO: remove legacy api void matrix_init_quantum() { - magic(); - led_init_ports(); -#ifdef BACKLIGHT_ENABLE - backlight_init_ports(); -#endif -#ifdef AUDIO_ENABLE - audio_init(); -#endif -#ifdef LED_MATRIX_ENABLE - led_matrix_init(); -#endif -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init(); -#endif -#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) - unicode_input_mode_init(); -#endif -#ifdef HAPTIC_ENABLE - haptic_init(); -#endif -#if defined(BLUETOOTH_ENABLE) && defined(OUTPUT_AUTO_ENABLE) - set_output(OUTPUT_AUTO); -#endif - matrix_init_kb(); } - void matrix_scan_quantum() { -#if defined(AUDIO_ENABLE) && defined(AUDIO_INIT_DELAY) - // There are some tasks that need to be run a little bit - // after keyboard startup, or else they will not work correctly - // because of interaction with the USB device state, which - // may still be in flux... - // - // At the moment the only feature that needs this is the - // startup song. - static bool delayed_tasks_run = false; - static uint16_t delayed_task_timer = 0; - if (!delayed_tasks_run) { - if (!delayed_task_timer) { - delayed_task_timer = timer_read(); - } else if (timer_elapsed(delayed_task_timer) > 300) { - audio_startup(); - delayed_tasks_run = true; - } - } -#endif - -#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) - music_task(); -#endif - -#ifdef KEY_OVERRIDE_ENABLE - key_override_task(); -#endif - -#ifdef SEQUENCER_ENABLE - sequencer_task(); -#endif - -#ifdef TAP_DANCE_ENABLE - tap_dance_task(); -#endif - -#ifdef COMBO_ENABLE - combo_task(); -#endif - -#ifdef LED_MATRIX_ENABLE - led_matrix_task(); -#endif - -#ifdef WPM_ENABLE - decay_wpm(); -#endif - -#ifdef HAPTIC_ENABLE - haptic_task(); -#endif - -#ifdef DIP_SWITCH_ENABLE - dip_switch_read(false); -#endif - -#ifdef AUTO_SHIFT_ENABLE - autoshift_matrix_scan(); -#endif - matrix_scan_kb(); } -#ifdef HD44780_ENABLED -# include "hd44780.h" -#endif - //------------------------------------------------------------------------------ // Override these functions in your keymap file to play different tunes on // different events such as startup and bootloader jump @@ -476,17 +398,6 @@ __attribute__((weak)) void startup_user() {} __attribute__((weak)) void shutdown_user() {} -/** \brief Run keyboard level Power down - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_power_down_user(void) {} -/** \brief Run keyboard level Power down - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_power_down_kb(void) { suspend_power_down_user(); } - void suspend_power_down_quantum(void) { suspend_power_down_kb(); #ifndef NO_SUSPEND_POWER_DOWN @@ -503,14 +414,7 @@ void suspend_power_down_quantum(void) { # endif // Turn off LED indicators - uint8_t leds_off = 0; -# if defined(BACKLIGHT_CAPS_LOCK) && defined(BACKLIGHT_ENABLE) - if (is_backlight_enabled()) { - // Don't try to turn off Caps Lock indicator as it is backlight and backlight is already off - leds_off |= (1 << USB_LED_CAPS_LOCK); - } -# endif - led_set(leds_off); + led_suspend(); // Turn off audio # ifdef AUDIO_ENABLE @@ -542,18 +446,6 @@ void suspend_power_down_quantum(void) { #endif } -/** \brief run user level code immediately after wakeup - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_wakeup_init_user(void) {} - -/** \brief run keyboard level code immediately after wakeup - * - * FIXME: needs doc - */ -__attribute__((weak)) void suspend_wakeup_init_kb(void) { suspend_wakeup_init_user(); } - __attribute__((weak)) void suspend_wakeup_init_quantum(void) { // Turn on backlight #ifdef BACKLIGHT_ENABLE @@ -561,7 +453,7 @@ __attribute__((weak)) void suspend_wakeup_init_quantum(void) { #endif // Restore LED indicators - led_set(host_keyboard_leds()); + led_wakeup(); // Wake up underglow #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) diff --git a/quantum/quantum.h b/quantum/quantum.h index 6927884e2f40..020e45594192 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -109,6 +109,10 @@ extern layer_state_t layer_state; # include "process_unicodemap.h" #endif +#ifdef UNICODE_COMMON_ENABLE +# include "process_unicode_common.h" +#endif + #ifdef KEY_OVERRIDE_ENABLE # include "process_key_override.h" #endif @@ -245,11 +249,6 @@ void register_code16(uint16_t code); void unregister_code16(uint16_t code); void tap_code16(uint16_t code); -void led_set_user(uint8_t usb_led); -void led_set_kb(uint8_t usb_led); -bool led_update_user(led_t led_state); -bool led_update_kb(led_t led_state); - const char *get_numeric_str(char *buf, size_t buf_len, uint32_t curr_num, char curr_pad); const char *get_u8_str(uint8_t curr_num, char curr_pad); const char *get_u16_str(uint16_t curr_num, char curr_pad); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index e4d0167aac3f..2552c48165fd 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -37,10 +37,6 @@ enum quantum_keycodes { QK_RALT = 0x1400, QK_RGUI = 0x1800, QK_MODS_MAX = 0x1FFF, - QK_FUNCTION = 0x2000, - QK_FUNCTION_MAX = 0x2FFF, - QK_MACRO = 0x3000, - QK_MACRO_MAX = 0x3FFF, QK_LAYER_TAP = 0x4000, QK_LAYER_TAP_MAX = 0x4FFF, QK_TO = 0x5000, @@ -80,422 +76,422 @@ enum quantum_keycodes { QK_UNICODEMAP_PAIR_MAX = 0xFFFF, // Loose keycodes - to be used directly - RESET = 0x5C00, - DEBUG, // 5C01 + QK_BOOTLOADER = 0x5C00, + QK_DEBUG_TOGGLE, // 5C01 // Magic - MAGIC_SWAP_CONTROL_CAPSLOCK, // 5C02 - MAGIC_CAPSLOCK_TO_CONTROL, // 5C03 - MAGIC_SWAP_LALT_LGUI, // 5C04 - MAGIC_SWAP_RALT_RGUI, // 5C05 - MAGIC_NO_GUI, // 5C06 - MAGIC_SWAP_GRAVE_ESC, // 5C07 - MAGIC_SWAP_BACKSLASH_BACKSPACE, // 5C08 - MAGIC_HOST_NKRO, // 5C09 - MAGIC_SWAP_ALT_GUI, // 5C0A - MAGIC_UNSWAP_CONTROL_CAPSLOCK, // 5C0B - MAGIC_UNCAPSLOCK_TO_CONTROL, // 5C0C - MAGIC_UNSWAP_LALT_LGUI, // 5C0D - MAGIC_UNSWAP_RALT_RGUI, // 5C0E - MAGIC_UNNO_GUI, // 5C0F - MAGIC_UNSWAP_GRAVE_ESC, // 5C10 - MAGIC_UNSWAP_BACKSLASH_BACKSPACE, // 5C11 - MAGIC_UNHOST_NKRO, // 5C12 - MAGIC_UNSWAP_ALT_GUI, // 5C13 - MAGIC_TOGGLE_NKRO, // 5C14 - MAGIC_TOGGLE_ALT_GUI, // 5C15 + MAGIC_SWAP_CONTROL_CAPSLOCK, // 5C02 + MAGIC_CAPSLOCK_TO_CONTROL, // 5C03 + MAGIC_SWAP_LALT_LGUI, // 5C04 + MAGIC_SWAP_RALT_RGUI, // 5C05 + MAGIC_NO_GUI, // 5C06 + MAGIC_SWAP_GRAVE_ESC, // 5C07 + MAGIC_SWAP_BACKSLASH_BACKSPACE, // 5C08 + MAGIC_HOST_NKRO, // 5C09 + MAGIC_SWAP_ALT_GUI, // 5C0A + MAGIC_UNSWAP_CONTROL_CAPSLOCK, // 5C0B + MAGIC_UNCAPSLOCK_TO_CONTROL, // 5C0C + MAGIC_UNSWAP_LALT_LGUI, // 5C0D + MAGIC_UNSWAP_RALT_RGUI, // 5C0E + MAGIC_UNNO_GUI, // 5C0F + MAGIC_UNSWAP_GRAVE_ESC, // 5C10 + MAGIC_UNSWAP_BACKSLASH_BACKSPACE, // 5C11 + MAGIC_UNHOST_NKRO, // 5C12 + MAGIC_UNSWAP_ALT_GUI, // 5C13 + MAGIC_TOGGLE_NKRO, // 5C14 + MAGIC_TOGGLE_ALT_GUI, // 5C15 // Grave Escape - GRAVE_ESC, // 5C16 + QK_GRAVE_ESCAPE, // 5C16 // Auto Shift - KC_ASUP, // 5C17 - KC_ASDN, // 5C18 - KC_ASRP, // 5C19 - KC_ASTG, // 5C1A - KC_ASON, // 5C1B - KC_ASOFF, // 5C1C + KC_ASUP, // 5C17 + KC_ASDN, // 5C18 + KC_ASRP, // 5C19 + KC_ASTG, // 5C1A + KC_ASON, // 5C1B + KC_ASOFF, // 5C1C // Audio - AU_ON, // 5C1D - AU_OFF, // 5C1E - AU_TOG, // 5C1F + AU_ON, // 5C1D + AU_OFF, // 5C1E + AU_TOG, // 5C1F // Audio Clicky - CLICKY_TOGGLE, // 5C20 - CLICKY_ENABLE, // 5C21 - CLICKY_DISABLE, // 5C22 - CLICKY_UP, // 5C23 - CLICKY_DOWN, // 5C24 - CLICKY_RESET, // 5C25 + CLICKY_TOGGLE, // 5C20 + CLICKY_ENABLE, // 5C21 + CLICKY_DISABLE, // 5C22 + CLICKY_UP, // 5C23 + CLICKY_DOWN, // 5C24 + CLICKY_RESET, // 5C25 // Music mode - MU_ON, // 5C26 - MU_OFF, // 5C27 - MU_TOG, // 5C28 - MU_MOD, // 5C29 - MUV_IN, // 5C2A - MUV_DE, // 5C2B + MU_ON, // 5C26 + MU_OFF, // 5C27 + MU_TOG, // 5C28 + MU_MOD, // 5C29 + MUV_IN, // 5C2A + MUV_DE, // 5C2B // MIDI - MI_ON, // 5C2C - MI_OFF, // 5C2D - MI_TOG, // 5C2E + MI_ON, // 5C2C + MI_OFF, // 5C2D + MI_TOG, // 5C2E - MI_C, // 5C2F - MI_Cs, // 5C30 + MI_C, // 5C2F + MI_Cs, // 5C30 MI_Db = MI_Cs, - MI_D, // 5C31 - MI_Ds, // 5C32 + MI_D, // 5C31 + MI_Ds, // 5C32 MI_Eb = MI_Ds, - MI_E, // 5C33 - MI_F, // 5C34 - MI_Fs, // 5C35 + MI_E, // 5C33 + MI_F, // 5C34 + MI_Fs, // 5C35 MI_Gb = MI_Fs, - MI_G, // 5C36 - MI_Gs, // 5C37 + MI_G, // 5C36 + MI_Gs, // 5C37 MI_Ab = MI_Gs, - MI_A, // 5C38 - MI_As, // 5C39 + MI_A, // 5C38 + MI_As, // 5C39 MI_Bb = MI_As, - MI_B, // 5C3A + MI_B, // 5C3A - MI_C_1, // 5C3B - MI_Cs_1, // 5C3C + MI_C_1, // 5C3B + MI_Cs_1, // 5C3C MI_Db_1 = MI_Cs_1, - MI_D_1, // 5C3D - MI_Ds_1, // 5C3E + MI_D_1, // 5C3D + MI_Ds_1, // 5C3E MI_Eb_1 = MI_Ds_1, - MI_E_1, // 5C3F - MI_F_1, // 5C40 - MI_Fs_1, // 5C41 + MI_E_1, // 5C3F + MI_F_1, // 5C40 + MI_Fs_1, // 5C41 MI_Gb_1 = MI_Fs_1, - MI_G_1, // 5C42 - MI_Gs_1, // 5C43 + MI_G_1, // 5C42 + MI_Gs_1, // 5C43 MI_Ab_1 = MI_Gs_1, - MI_A_1, // 5C44 - MI_As_1, // 5C45 + MI_A_1, // 5C44 + MI_As_1, // 5C45 MI_Bb_1 = MI_As_1, - MI_B_1, // 5C46 + MI_B_1, // 5C46 - MI_C_2, // 5C47 - MI_Cs_2, // 5C48 + MI_C_2, // 5C47 + MI_Cs_2, // 5C48 MI_Db_2 = MI_Cs_2, - MI_D_2, // 5C49 - MI_Ds_2, // 5C4A + MI_D_2, // 5C49 + MI_Ds_2, // 5C4A MI_Eb_2 = MI_Ds_2, - MI_E_2, // 5C4B - MI_F_2, // 5C4C - MI_Fs_2, // 5C4D + MI_E_2, // 5C4B + MI_F_2, // 5C4C + MI_Fs_2, // 5C4D MI_Gb_2 = MI_Fs_2, - MI_G_2, // 5C4E - MI_Gs_2, // 5C4F + MI_G_2, // 5C4E + MI_Gs_2, // 5C4F MI_Ab_2 = MI_Gs_2, - MI_A_2, // 5C50 - MI_As_2, // 5C51 + MI_A_2, // 5C50 + MI_As_2, // 5C51 MI_Bb_2 = MI_As_2, - MI_B_2, // 5C52 + MI_B_2, // 5C52 - MI_C_3, // 5C53 - MI_Cs_3, // 5C54 + MI_C_3, // 5C53 + MI_Cs_3, // 5C54 MI_Db_3 = MI_Cs_3, - MI_D_3, // 5C55 - MI_Ds_3, // 5C56 + MI_D_3, // 5C55 + MI_Ds_3, // 5C56 MI_Eb_3 = MI_Ds_3, - MI_E_3, // 5C57 - MI_F_3, // 5C58 - MI_Fs_3, // 5C59 + MI_E_3, // 5C57 + MI_F_3, // 5C58 + MI_Fs_3, // 5C59 MI_Gb_3 = MI_Fs_3, - MI_G_3, // 5C5A - MI_Gs_3, // 5C5B + MI_G_3, // 5C5A + MI_Gs_3, // 5C5B MI_Ab_3 = MI_Gs_3, - MI_A_3, // 5C5C - MI_As_3, // 5C5D + MI_A_3, // 5C5C + MI_As_3, // 5C5D MI_Bb_3 = MI_As_3, - MI_B_3, // 5C5E + MI_B_3, // 5C5E - MI_C_4, // 5C5F - MI_Cs_4, // 5C60 + MI_C_4, // 5C5F + MI_Cs_4, // 5C60 MI_Db_4 = MI_Cs_4, - MI_D_4, // 5C61 - MI_Ds_4, // 5C62 + MI_D_4, // 5C61 + MI_Ds_4, // 5C62 MI_Eb_4 = MI_Ds_4, - MI_E_4, // 5C63 - MI_F_4, // 5C64 - MI_Fs_4, // 5C65 + MI_E_4, // 5C63 + MI_F_4, // 5C64 + MI_Fs_4, // 5C65 MI_Gb_4 = MI_Fs_4, - MI_G_4, // 5C66 - MI_Gs_4, // 5C67 + MI_G_4, // 5C66 + MI_Gs_4, // 5C67 MI_Ab_4 = MI_Gs_4, - MI_A_4, // 5C68 - MI_As_4, // 5C69 + MI_A_4, // 5C68 + MI_As_4, // 5C69 MI_Bb_4 = MI_As_4, - MI_B_4, // 5C6A + MI_B_4, // 5C6A - MI_C_5, // 5C6B - MI_Cs_5, // 5C6C + MI_C_5, // 5C6B + MI_Cs_5, // 5C6C MI_Db_5 = MI_Cs_5, - MI_D_5, // 5C6D - MI_Ds_5, // 5C6E + MI_D_5, // 5C6D + MI_Ds_5, // 5C6E MI_Eb_5 = MI_Ds_5, - MI_E_5, // 5C6F - MI_F_5, // 5C70 - MI_Fs_5, // 5C71 + MI_E_5, // 5C6F + MI_F_5, // 5C70 + MI_Fs_5, // 5C71 MI_Gb_5 = MI_Fs_5, - MI_G_5, // 5C72 - MI_Gs_5, // 5C73 + MI_G_5, // 5C72 + MI_Gs_5, // 5C73 MI_Ab_5 = MI_Gs_5, - MI_A_5, // 5C74 - MI_As_5, // 5C75 + MI_A_5, // 5C74 + MI_As_5, // 5C75 MI_Bb_5 = MI_As_5, - MI_B_5, // 5C76 - - MI_OCT_N2, // 5C77 - MI_OCT_N1, // 5C78 - MI_OCT_0, // 5C79 - MI_OCT_1, // 5C7A - MI_OCT_2, // 5C7B - MI_OCT_3, // 5C7C - MI_OCT_4, // 5C7D - MI_OCT_5, // 5C7E - MI_OCT_6, // 5C7F - MI_OCT_7, // 5C80 - MI_OCTD, // 5C81 - MI_OCTU, // 5C82 - - MI_TRNS_N6, // 5C83 - MI_TRNS_N5, // 5C84 - MI_TRNS_N4, // 5C85 - MI_TRNS_N3, // 5C86 - MI_TRNS_N2, // 5C87 - MI_TRNS_N1, // 5C88 - MI_TRNS_0, // 5C89 - MI_TRNS_1, // 5C8A - MI_TRNS_2, // 5C8B - MI_TRNS_3, // 5C8C - MI_TRNS_4, // 5C8D - MI_TRNS_5, // 5C8E - MI_TRNS_6, // 5C8F - MI_TRNSD, // 5C90 - MI_TRNSU, // 5C91 - - MI_VEL_0, // 5C92 + MI_B_5, // 5C76 + + MI_OCT_N2, // 5C77 + MI_OCT_N1, // 5C78 + MI_OCT_0, // 5C79 + MI_OCT_1, // 5C7A + MI_OCT_2, // 5C7B + MI_OCT_3, // 5C7C + MI_OCT_4, // 5C7D + MI_OCT_5, // 5C7E + MI_OCT_6, // 5C7F + MI_OCT_7, // 5C80 + MI_OCTD, // 5C81 + MI_OCTU, // 5C82 + + MI_TRNS_N6, // 5C83 + MI_TRNS_N5, // 5C84 + MI_TRNS_N4, // 5C85 + MI_TRNS_N3, // 5C86 + MI_TRNS_N2, // 5C87 + MI_TRNS_N1, // 5C88 + MI_TRNS_0, // 5C89 + MI_TRNS_1, // 5C8A + MI_TRNS_2, // 5C8B + MI_TRNS_3, // 5C8C + MI_TRNS_4, // 5C8D + MI_TRNS_5, // 5C8E + MI_TRNS_6, // 5C8F + MI_TRNSD, // 5C90 + MI_TRNSU, // 5C91 + + MI_VEL_0, // 5C92 #ifdef VIA_ENABLE MI_VEL_1 = MI_VEL_0, #else - MI_VEL_1, // 5C93 + MI_VEL_1, // 5C93 #endif - MI_VEL_2, // 5C94 - MI_VEL_3, // 5C95 - MI_VEL_4, // 5C96 - MI_VEL_5, // 5C97 - MI_VEL_6, // 5C98 - MI_VEL_7, // 5C99 - MI_VEL_8, // 5C9A - MI_VEL_9, // 5C9B - MI_VEL_10, // 5C9C - MI_VELD, // 5C9D - MI_VELU, // 5C9E - - MI_CH1, // 5C9F - MI_CH2, // 5CA0 - MI_CH3, // 5CA1 - MI_CH4, // 5CA2 - MI_CH5, // 5CA3 - MI_CH6, // 5CA4 - MI_CH7, // 5CA5 - MI_CH8, // 5CA6 - MI_CH9, // 5CA7 - MI_CH10, // 5CA8 - MI_CH11, // 5CA9 - MI_CH12, // 5CAA - MI_CH13, // 5CAB - MI_CH14, // 5CAC - MI_CH15, // 5CAD - MI_CH16, // 5CAE - MI_CHD, // 5CAF - MI_CHU, // 5CB0 - - MI_ALLOFF, // 5CB1 - - MI_SUS, // 5CB2 - MI_PORT, // 5CB3 - MI_SOST, // 5CB4 - MI_SOFT, // 5CB5 - MI_LEG, // 5CB6 - - MI_MOD, // 5CB7 - MI_MODSD, // 5CB8 - MI_MODSU, // 5CB9 - - MI_BENDD, // 5CBA - MI_BENDU, // 5CBB + MI_VEL_2, // 5C94 + MI_VEL_3, // 5C95 + MI_VEL_4, // 5C96 + MI_VEL_5, // 5C97 + MI_VEL_6, // 5C98 + MI_VEL_7, // 5C99 + MI_VEL_8, // 5C9A + MI_VEL_9, // 5C9B + MI_VEL_10, // 5C9C + MI_VELD, // 5C9D + MI_VELU, // 5C9E + + MI_CH1, // 5C9F + MI_CH2, // 5CA0 + MI_CH3, // 5CA1 + MI_CH4, // 5CA2 + MI_CH5, // 5CA3 + MI_CH6, // 5CA4 + MI_CH7, // 5CA5 + MI_CH8, // 5CA6 + MI_CH9, // 5CA7 + MI_CH10, // 5CA8 + MI_CH11, // 5CA9 + MI_CH12, // 5CAA + MI_CH13, // 5CAB + MI_CH14, // 5CAC + MI_CH15, // 5CAD + MI_CH16, // 5CAE + MI_CHD, // 5CAF + MI_CHU, // 5CB0 + + MI_ALLOFF, // 5CB1 + + MI_SUS, // 5CB2 + MI_PORT, // 5CB3 + MI_SOST, // 5CB4 + MI_SOFT, // 5CB5 + MI_LEG, // 5CB6 + + MI_MOD, // 5CB7 + MI_MODSD, // 5CB8 + MI_MODSU, // 5CB9 + + MI_BENDD, // 5CBA + MI_BENDU, // 5CBB // Backlight - BL_ON, // 5CBC - BL_OFF, // 5CBD - BL_DEC, // 5CBE - BL_INC, // 5CBF - BL_TOGG, // 5CC0 - BL_STEP, // 5CC1 - BL_BRTG, // 5CC2 + BL_ON, // 5CBC + BL_OFF, // 5CBD + BL_DEC, // 5CBE + BL_INC, // 5CBF + BL_TOGG, // 5CC0 + BL_STEP, // 5CC1 + BL_BRTG, // 5CC2 // RGB underglow/matrix - RGB_TOG, // 5CC3 - RGB_MODE_FORWARD, // 5CC4 - RGB_MODE_REVERSE, // 5CC5 - RGB_HUI, // 5CC6 - RGB_HUD, // 5CC7 - RGB_SAI, // 5CC8 - RGB_SAD, // 5CC9 - RGB_VAI, // 5CCA - RGB_VAD, // 5CCB - RGB_SPI, // 5CCC - RGB_SPD, // 5CCD - RGB_MODE_PLAIN, // 5CCE - RGB_MODE_BREATHE, // 5CCF - RGB_MODE_RAINBOW, // 5CD0 - RGB_MODE_SWIRL, // 5CD1 - RGB_MODE_SNAKE, // 5CD2 - RGB_MODE_KNIGHT, // 5CD3 - RGB_MODE_XMAS, // 5CD4 - RGB_MODE_GRADIENT, // 5CD5 - RGB_MODE_RGBTEST, // 5CD6 + RGB_TOG, // 5CC3 + RGB_MODE_FORWARD, // 5CC4 + RGB_MODE_REVERSE, // 5CC5 + RGB_HUI, // 5CC6 + RGB_HUD, // 5CC7 + RGB_SAI, // 5CC8 + RGB_SAD, // 5CC9 + RGB_VAI, // 5CCA + RGB_VAD, // 5CCB + RGB_SPI, // 5CCC + RGB_SPD, // 5CCD + RGB_MODE_PLAIN, // 5CCE + RGB_MODE_BREATHE, // 5CCF + RGB_MODE_RAINBOW, // 5CD0 + RGB_MODE_SWIRL, // 5CD1 + RGB_MODE_SNAKE, // 5CD2 + RGB_MODE_KNIGHT, // 5CD3 + RGB_MODE_XMAS, // 5CD4 + RGB_MODE_GRADIENT, // 5CD5 + RGB_MODE_RGBTEST, // 5CD6 // Velocikey - VLK_TOG, // 5CD7 + VLK_TOG, // 5CD7 // Space Cadet - KC_LSPO, // 5CD8 - KC_RSPC, // 5CD9 - KC_SFTENT, // 5CDA + KC_LSPO, // 5CD8 + KC_RSPC, // 5CD9 + KC_SFTENT, // 5CDA // Thermal Printer - PRINT_ON, // 5CDB - PRINT_OFF, // 5CDC + PRINT_ON, // 5CDB + PRINT_OFF, // 5CDC // Bluetooth: output selection - OUT_AUTO, // 5CDD - OUT_USB, // 5CDE + OUT_AUTO, // 5CDD + OUT_USB, // 5CDE // Clear EEPROM - EEPROM_RESET, // 5CDF + QK_CLEAR_EEPROM, // 5CDF // Unicode - UNICODE_MODE_FORWARD, // 5CE0 - UNICODE_MODE_REVERSE, // 5CE1 - UNICODE_MODE_MAC, // 5CE2 - UNICODE_MODE_LNX, // 5CE3 - UNICODE_MODE_WIN, // 5CE4 - UNICODE_MODE_BSD, // 5CE5 - UNICODE_MODE_WINC, // 5CE6 + UNICODE_MODE_FORWARD, // 5CE0 + UNICODE_MODE_REVERSE, // 5CE1 + UNICODE_MODE_MAC, // 5CE2 + UNICODE_MODE_LNX, // 5CE3 + UNICODE_MODE_WIN, // 5CE4 + UNICODE_MODE_BSD, // 5CE5 + UNICODE_MODE_WINC, // 5CE6 // Haptic - HPT_ON, // 5CE7 - HPT_OFF, // 5CE8 - HPT_TOG, // 5CE9 - HPT_RST, // 5CEA - HPT_FBK, // 5CEB - HPT_BUZ, // 5CEC - HPT_MODI, // 5CED - HPT_MODD, // 5CEE - HPT_CONT, // 5CEF - HPT_CONI, // 5CF0 - HPT_COND, // 5CF1 - HPT_DWLI, // 5CF2 - HPT_DWLD, // 5CF3 + HPT_ON, // 5CE7 + HPT_OFF, // 5CE8 + HPT_TOG, // 5CE9 + HPT_RST, // 5CEA + HPT_FBK, // 5CEB + HPT_BUZ, // 5CEC + HPT_MODI, // 5CED + HPT_MODD, // 5CEE + HPT_CONT, // 5CEF + HPT_CONI, // 5CF0 + HPT_COND, // 5CF1 + HPT_DWLI, // 5CF2 + HPT_DWLD, // 5CF3 // Space Cadet (continued) - KC_LCPO, // 5CF4 - KC_RCPC, // 5CF5 - KC_LAPO, // 5CF6 - KC_RAPC, // 5CF7 + KC_LCPO, // 5CF4 + KC_RCPC, // 5CF5 + KC_LAPO, // 5CF6 + KC_RAPC, // 5CF7 // Combos - CMB_ON, // 5CF8 - CMB_OFF, // 5CF9 - CMB_TOG, // 5CFA + CMB_ON, // 5CF8 + CMB_OFF, // 5CF9 + CMB_TOG, // 5CFA // Magic (continued) - MAGIC_SWAP_LCTL_LGUI, // 5CFB - MAGIC_SWAP_RCTL_RGUI, // 5CFC - MAGIC_UNSWAP_LCTL_LGUI, // 5CFD - MAGIC_UNSWAP_RCTL_RGUI, // 5CFE - MAGIC_SWAP_CTL_GUI, // 5CFF - MAGIC_UNSWAP_CTL_GUI, // 5D00 - MAGIC_TOGGLE_CTL_GUI, // 5D01 - MAGIC_EE_HANDS_LEFT, // 5D02 - MAGIC_EE_HANDS_RIGHT, // 5D03 + MAGIC_SWAP_LCTL_LGUI, // 5CFB + MAGIC_SWAP_RCTL_RGUI, // 5CFC + MAGIC_UNSWAP_LCTL_LGUI, // 5CFD + MAGIC_UNSWAP_RCTL_RGUI, // 5CFE + MAGIC_SWAP_CTL_GUI, // 5CFF + MAGIC_UNSWAP_CTL_GUI, // 5D00 + MAGIC_TOGGLE_CTL_GUI, // 5D01 + MAGIC_EE_HANDS_LEFT, // 5D02 + MAGIC_EE_HANDS_RIGHT, // 5D03 // Dynamic Macros - DYN_REC_START1, // 5D04 - DYN_REC_START2, // 5D05 - DYN_REC_STOP, // 5D06 - DYN_MACRO_PLAY1, // 5D07 - DYN_MACRO_PLAY2, // 5D08 + DYN_REC_START1, // 5D04 + DYN_REC_START2, // 5D05 + DYN_REC_STOP, // 5D06 + DYN_MACRO_PLAY1, // 5D07 + DYN_MACRO_PLAY2, // 5D08 // Joystick - JS_BUTTON0, // 5D09 - JS_BUTTON1, // 5D0A - JS_BUTTON2, // 5D0B - JS_BUTTON3, // 5D0C - JS_BUTTON4, // 5D0D - JS_BUTTON5, // 5D0E - JS_BUTTON6, // 5D0F - JS_BUTTON7, // 5D10 - JS_BUTTON8, // 5D11 - JS_BUTTON9, // 5D12 - JS_BUTTON10, // 5D13 - JS_BUTTON11, // 5D14 - JS_BUTTON12, // 5D15 - JS_BUTTON13, // 5D16 - JS_BUTTON14, // 5D17 - JS_BUTTON15, // 5D18 - JS_BUTTON16, // 5D19 - JS_BUTTON17, // 5D1A - JS_BUTTON18, // 5D1B - JS_BUTTON19, // 5D1C - JS_BUTTON20, // 5D1D - JS_BUTTON21, // 5D1E - JS_BUTTON22, // 5D1F - JS_BUTTON23, // 5D20 - JS_BUTTON24, // 5D21 - JS_BUTTON25, // 5D22 - JS_BUTTON26, // 5D23 - JS_BUTTON27, // 5D24 - JS_BUTTON28, // 5D25 - JS_BUTTON29, // 5D26 - JS_BUTTON30, // 5D27 - JS_BUTTON31, // 5D28 + JS_BUTTON0, // 5D09 + JS_BUTTON1, // 5D0A + JS_BUTTON2, // 5D0B + JS_BUTTON3, // 5D0C + JS_BUTTON4, // 5D0D + JS_BUTTON5, // 5D0E + JS_BUTTON6, // 5D0F + JS_BUTTON7, // 5D10 + JS_BUTTON8, // 5D11 + JS_BUTTON9, // 5D12 + JS_BUTTON10, // 5D13 + JS_BUTTON11, // 5D14 + JS_BUTTON12, // 5D15 + JS_BUTTON13, // 5D16 + JS_BUTTON14, // 5D17 + JS_BUTTON15, // 5D18 + JS_BUTTON16, // 5D19 + JS_BUTTON17, // 5D1A + JS_BUTTON18, // 5D1B + JS_BUTTON19, // 5D1C + JS_BUTTON20, // 5D1D + JS_BUTTON21, // 5D1E + JS_BUTTON22, // 5D1F + JS_BUTTON23, // 5D20 + JS_BUTTON24, // 5D21 + JS_BUTTON25, // 5D22 + JS_BUTTON26, // 5D23 + JS_BUTTON27, // 5D24 + JS_BUTTON28, // 5D25 + JS_BUTTON29, // 5D26 + JS_BUTTON30, // 5D27 + JS_BUTTON31, // 5D28 // Leader Key - KC_LEAD, // 5D29 + KC_LEAD, // 5D29 // Bluetooth: output selection (continued) - OUT_BT, // 5D2A + OUT_BT, // 5D2A // Lock Key - KC_LOCK, // 5D2B + KC_LOCK, // 5D2B // Terminal - TERM_ON, // 5D2C - TERM_OFF, // 5D2D + TERM_ON, // 5D2C + TERM_OFF, // 5D2D // Sequencer - SQ_ON, // 5D2E - SQ_OFF, // 5D2F - SQ_TOG, // 5D30 + SQ_ON, // 5D2E + SQ_OFF, // 5D2F + SQ_TOG, // 5D30 - SQ_TMPD, // 5D31 - SQ_TMPU, // 5D32 + SQ_TMPD, // 5D31 + SQ_TMPU, // 5D32 - SQ_RESD, // 5D33 - SQ_RESU, // 5D34 + SQ_RESD, // 5D33 + SQ_RESU, // 5D34 - SQ_SALL, // 5D35 - SQ_SCLR, // 5D36 + SQ_SALL, // 5D35 + SQ_SCLR, // 5D36 - SEQUENCER_STEP_MIN, // 5D37 + SEQUENCER_STEP_MIN, // 5D37 SEQUENCER_STEP_MAX = SEQUENCER_STEP_MIN + SEQUENCER_STEPS, SEQUENCER_RESOLUTION_MIN, @@ -597,6 +593,8 @@ enum quantum_keycodes { MACRO_30, MACRO_31, + MAGIC_TOGGLE_CONTROL_CAPSLOCK, + // Start of custom keycode range for keyboards and keymaps - always leave at the end SAFE_RANGE }; @@ -638,69 +636,69 @@ enum quantum_keycodes { #define MOD_MEH 0x7 // US ANSI shifted keycode aliases -#define KC_TILDE LSFT(KC_GRAVE) // ~ +#define KC_TILDE LSFT(KC_GRAVE) // ~ #define KC_TILD KC_TILDE -#define KC_EXCLAIM LSFT(KC_1) // ! +#define KC_EXCLAIM LSFT(KC_1) // ! #define KC_EXLM KC_EXCLAIM -#define KC_AT LSFT(KC_2) // @ +#define KC_AT LSFT(KC_2) // @ -#define KC_HASH LSFT(KC_3) // # +#define KC_HASH LSFT(KC_3) // # -#define KC_DOLLAR LSFT(KC_4) // $ +#define KC_DOLLAR LSFT(KC_4) // $ #define KC_DLR KC_DOLLAR -#define KC_PERCENT LSFT(KC_5) // % +#define KC_PERCENT LSFT(KC_5) // % #define KC_PERC KC_PERCENT -#define KC_CIRCUMFLEX LSFT(KC_6) // ^ +#define KC_CIRCUMFLEX LSFT(KC_6) // ^ #define KC_CIRC KC_CIRCUMFLEX -#define KC_AMPERSAND LSFT(KC_7) // & +#define KC_AMPERSAND LSFT(KC_7) // & #define KC_AMPR KC_AMPERSAND -#define KC_ASTERISK LSFT(KC_8) // * +#define KC_ASTERISK LSFT(KC_8) // * #define KC_ASTR KC_ASTERISK -#define KC_LEFT_PAREN LSFT(KC_9) // ( +#define KC_LEFT_PAREN LSFT(KC_9) // ( #define KC_LPRN KC_LEFT_PAREN -#define KC_RIGHT_PAREN LSFT(KC_0) // ) +#define KC_RIGHT_PAREN LSFT(KC_0) // ) #define KC_RPRN KC_RIGHT_PAREN -#define KC_UNDERSCORE LSFT(KC_MINUS) // _ +#define KC_UNDERSCORE LSFT(KC_MINUS) // _ #define KC_UNDS KC_UNDERSCORE -#define KC_PLUS LSFT(KC_EQUAL) // + +#define KC_PLUS LSFT(KC_EQUAL) // + -#define KC_LEFT_CURLY_BRACE LSFT(KC_LEFT_BRACKET) // { +#define KC_LEFT_CURLY_BRACE LSFT(KC_LEFT_BRACKET) // { #define KC_LCBR KC_LEFT_CURLY_BRACE -#define KC_RIGHT_CURLY_BRACE LSFT(KC_RIGHT_BRACKET) // } +#define KC_RIGHT_CURLY_BRACE LSFT(KC_RIGHT_BRACKET) // } #define KC_RCBR KC_RIGHT_CURLY_BRACE -#define KC_LEFT_ANGLE_BRACKET LSFT(KC_COMMA) // < +#define KC_LEFT_ANGLE_BRACKET LSFT(KC_COMMA) // < #define KC_LABK KC_LEFT_ANGLE_BRACKET #define KC_LT KC_LEFT_ANGLE_BRACKET -#define KC_RIGHT_ANGLE_BRACKET LSFT(KC_DOT) // > +#define KC_RIGHT_ANGLE_BRACKET LSFT(KC_DOT) // > #define KC_RABK KC_RIGHT_ANGLE_BRACKET #define KC_GT KC_RIGHT_ANGLE_BRACKET -#define KC_COLON LSFT(KC_SEMICOLON) // : +#define KC_COLON LSFT(KC_SEMICOLON) // : #define KC_COLN KC_COLON -#define KC_PIPE LSFT(KC_BACKSLASH) // | +#define KC_PIPE LSFT(KC_BACKSLASH) // | -#define KC_QUESTION LSFT(KC_SLASH) // ? +#define KC_QUESTION LSFT(KC_SLASH) // ? #define KC_QUES KC_QUESTION -#define KC_DOUBLE_QUOTE LSFT(KC_QUOTE) // " +#define KC_DOUBLE_QUOTE LSFT(KC_QUOTE) // " #define KC_DQUO KC_DOUBLE_QUOTE #define KC_DQT KC_DOUBLE_QUOTE -#define KC_DELT KC_DELETE // Del key (four letter code) +#define KC_DELT KC_DELETE // Del key (four letter code) // Modified keycode aliases #define C(kc) LCTL(kc) @@ -708,15 +706,11 @@ enum quantum_keycodes { #define A(kc) LALT(kc) #define G(kc) LGUI(kc) -// Deprecated - do not use -#define F(kc) (QK_FUNCTION | (kc)) -#define M(kc) (QK_MACRO | (kc)) -#define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc)) -#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) - -#define KC_GESC GRAVE_ESC +#define QK_GESC QK_GRAVE_ESCAPE -#define EEP_RST EEPROM_RESET +#define QK_BOOT QK_BOOTLOADER +#define DB_TOGG QK_DEBUG_TOGGLE +#define EE_CLR QK_CLEAR_EEPROM // Audio Clicky aliases #define CK_TOGG CLICKY_TOGGLE @@ -749,6 +743,7 @@ enum quantum_keycodes { #define CL_NORM MAGIC_UNSWAP_CONTROL_CAPSLOCK #define CL_CTRL MAGIC_CAPSLOCK_TO_CONTROL #define CL_CAPS MAGIC_UNCAPSLOCK_TO_CONTROL +#define CL_TOGG MAGIC_TOGGLE_CONTROL_CAPSLOCK #define LCG_SWP MAGIC_SWAP_LCTL_LGUI #define LCG_NRM MAGIC_UNSWAP_LCTL_LGUI @@ -846,22 +841,22 @@ enum quantum_keycodes { #define CMD_T(kc) LCMD_T(kc) #define WIN_T(kc) LWIN_T(kc) -#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal -#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include GUI, so just Left Control + Shift + Alt -#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI -#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI -#define HYPR_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ -#define LSG_T(kc) MT(MOD_LSFT | MOD_LGUI, kc) // Left Shift + GUI +#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal +#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include GUI, so just Left Control + Shift + Alt +#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI +#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI +#define HYPR_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ +#define LSG_T(kc) MT(MOD_LSFT | MOD_LGUI, kc) // Left Shift + GUI #define SGUI_T(kc) LSG_T(kc) #define SCMD_T(kc) LSG_T(kc) #define SWIN_T(kc) LSG_T(kc) -#define LAG_T(kc) MT(MOD_LALT | MOD_LGUI, kc) // Left Alt + GUI -#define RSG_T(kc) MT(MOD_RSFT | MOD_RGUI, kc) // Right Shift + GUI -#define RAG_T(kc) MT(MOD_RALT | MOD_RGUI, kc) // Right Alt + GUI -#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt -#define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc) // Left Shift + Alt -#define RSA_T(kc) MT(MOD_RSFT | MOD_RALT, kc) // Right Shift + Alt -#define RCS_T(kc) MT(MOD_RCTL | MOD_RSFT, kc) // Right Control + Shift +#define LAG_T(kc) MT(MOD_LALT | MOD_LGUI, kc) // Left Alt + GUI +#define RSG_T(kc) MT(MOD_RSFT | MOD_RGUI, kc) // Right Shift + GUI +#define RAG_T(kc) MT(MOD_RALT | MOD_RGUI, kc) // Right Alt + GUI +#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt +#define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc) // Left Shift + Alt +#define RSA_T(kc) MT(MOD_RSFT | MOD_RALT, kc) // Right Shift + Alt +#define RCS_T(kc) MT(MOD_RCTL | MOD_RSFT, kc) // Right Control + Shift #define SAGR_T(kc) RSA_T(kc) #define ALL_T(kc) HYPR_T(kc) @@ -875,14 +870,14 @@ enum quantum_keycodes { #define UC(c) (QK_UNICODE | (c)) // UNICODEMAP_ENABLE - Allows Unicode input up to 0x10FFFF, requires unicode_map #define X(i) (QK_UNICODEMAP | (i)) -#define XP(i, j) (QK_UNICODEMAP_PAIR | ((i)&0x7F) | (((j)&0x7F) << 7)) // 127 max i and j +#define XP(i, j) (QK_UNICODEMAP_PAIR | ((i)&0x7F) | (((j)&0x7F) << 7)) // 127 max i and j #define UC_MOD UNICODE_MODE_FORWARD #define UC_RMOD UNICODE_MODE_REVERSE #define UC_M_MA UNICODE_MODE_MAC -#define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias -#define UC_M_OS UNICODE_MODE_MAC // Deprecated alias +#define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias +#define UC_M_OS UNICODE_MODE_MAC // Deprecated alias #define UC_M_LN UNICODE_MODE_LNX #define UC_M_WI UNICODE_MODE_WIN #define UC_M_BS UNICODE_MODE_BSD @@ -961,3 +956,5 @@ enum quantum_keycodes { #define PB_32 PROGRAMMABLE_BUTTON_32 #define PROGRAMMABLE_BUTTON_MIN PROGRAMMABLE_BUTTON_1 #define PROGRAMMABLE_BUTTON_MAX PROGRAMMABLE_BUTTON_32 + +#include "quantum_keycodes_legacy.h" diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h new file mode 100644 index 000000000000..ed9455ee74f4 --- /dev/null +++ b/quantum/quantum_keycodes_legacy.h @@ -0,0 +1,13 @@ +#pragma once + +// clang-format off + +// Deprecated Quantum keycodes + +#define RESET QK_BOOTLOADER +#define DEBUG QK_DEBUG_TOGGLE +#define GRAVE_ESC QK_GRAVE_ESCAPE +#define EEPROM_RESET QK_CLEAR_EEPROM + +#define KC_GESC QK_GRAVE_ESCAPE +#define EEP_RST QK_CLEAR_EEPROM diff --git a/quantum/rgb_matrix/animations/alpha_mods_anim.h b/quantum/rgb_matrix/animations/alpha_mods_anim.h index d6136f1ba470..59b8381d6984 100644 --- a/quantum/rgb_matrix/animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix/animations/alpha_mods_anim.h @@ -22,5 +22,5 @@ bool ALPHAS_MODS(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_ALPHAS_MODS +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_ALPHAS_MODS diff --git a/quantum/rgb_matrix/animations/breathing_anim.h b/quantum/rgb_matrix/animations/breathing_anim.h index 29187e1543e7..e9a3c96e1bb8 100644 --- a/quantum/rgb_matrix/animations/breathing_anim.h +++ b/quantum/rgb_matrix/animations/breathing_anim.h @@ -16,5 +16,5 @@ bool BREATHING(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BREATHING +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BREATHING diff --git a/quantum/rgb_matrix/animations/colorband_pinwheel_sat_anim.h b/quantum/rgb_matrix/animations/colorband_pinwheel_sat_anim.h index 0375d4937de0..06aa8b5ed5f4 100644 --- a/quantum/rgb_matrix/animations/colorband_pinwheel_sat_anim.h +++ b/quantum/rgb_matrix/animations/colorband_pinwheel_sat_anim.h @@ -7,7 +7,9 @@ static HSV BAND_PINWHEEL_SAT_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) return hsv; } -bool BAND_PINWHEEL_SAT(effect_params_t* params) { return effect_runner_dx_dy(params, &BAND_PINWHEEL_SAT_math); } +bool BAND_PINWHEEL_SAT(effect_params_t* params) { + return effect_runner_dx_dy(params, &BAND_PINWHEEL_SAT_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT diff --git a/quantum/rgb_matrix/animations/colorband_pinwheel_val_anim.h b/quantum/rgb_matrix/animations/colorband_pinwheel_val_anim.h index e40bf4cd1f2f..bcbc31949814 100644 --- a/quantum/rgb_matrix/animations/colorband_pinwheel_val_anim.h +++ b/quantum/rgb_matrix/animations/colorband_pinwheel_val_anim.h @@ -7,7 +7,9 @@ static HSV BAND_PINWHEEL_VAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) return hsv; } -bool BAND_PINWHEEL_VAL(effect_params_t* params) { return effect_runner_dx_dy(params, &BAND_PINWHEEL_VAL_math); } +bool BAND_PINWHEEL_VAL(effect_params_t* params) { + return effect_runner_dx_dy(params, &BAND_PINWHEEL_VAL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL diff --git a/quantum/rgb_matrix/animations/colorband_sat_anim.h b/quantum/rgb_matrix/animations/colorband_sat_anim.h index 1c4f7de575a6..cb0897ad3e9a 100644 --- a/quantum/rgb_matrix/animations/colorband_sat_anim.h +++ b/quantum/rgb_matrix/animations/colorband_sat_anim.h @@ -8,7 +8,9 @@ static HSV BAND_SAT_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool BAND_SAT(effect_params_t* params) { return effect_runner_i(params, &BAND_SAT_math); } +bool BAND_SAT(effect_params_t* params) { + return effect_runner_i(params, &BAND_SAT_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BAND_SAT +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BAND_SAT diff --git a/quantum/rgb_matrix/animations/colorband_spiral_sat_anim.h b/quantum/rgb_matrix/animations/colorband_spiral_sat_anim.h index cdd02b37974b..d26eb378558a 100644 --- a/quantum/rgb_matrix/animations/colorband_spiral_sat_anim.h +++ b/quantum/rgb_matrix/animations/colorband_spiral_sat_anim.h @@ -7,7 +7,9 @@ static HSV BAND_SPIRAL_SAT_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, u return hsv; } -bool BAND_SPIRAL_SAT(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_SAT_math); } +bool BAND_SPIRAL_SAT(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_SAT_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT diff --git a/quantum/rgb_matrix/animations/colorband_spiral_val_anim.h b/quantum/rgb_matrix/animations/colorband_spiral_val_anim.h index e1331eaebe86..3ae34bb6f097 100644 --- a/quantum/rgb_matrix/animations/colorband_spiral_val_anim.h +++ b/quantum/rgb_matrix/animations/colorband_spiral_val_anim.h @@ -7,7 +7,9 @@ static HSV BAND_SPIRAL_VAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, u return hsv; } -bool BAND_SPIRAL_VAL(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_VAL_math); } +bool BAND_SPIRAL_VAL(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_VAL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL diff --git a/quantum/rgb_matrix/animations/colorband_val_anim.h b/quantum/rgb_matrix/animations/colorband_val_anim.h index 02ee4add6724..69c29f53a355 100644 --- a/quantum/rgb_matrix/animations/colorband_val_anim.h +++ b/quantum/rgb_matrix/animations/colorband_val_anim.h @@ -8,7 +8,9 @@ static HSV BAND_VAL_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool BAND_VAL(effect_params_t* params) { return effect_runner_i(params, &BAND_VAL_math); } +bool BAND_VAL(effect_params_t* params) { + return effect_runner_i(params, &BAND_VAL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_BAND_VAL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_BAND_VAL diff --git a/quantum/rgb_matrix/animations/cycle_all_anim.h b/quantum/rgb_matrix/animations/cycle_all_anim.h index 3b73b9d385aa..d8c7220d95e7 100644 --- a/quantum/rgb_matrix/animations/cycle_all_anim.h +++ b/quantum/rgb_matrix/animations/cycle_all_anim.h @@ -7,7 +7,9 @@ static HSV CYCLE_ALL_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool CYCLE_ALL(effect_params_t* params) { return effect_runner_i(params, &CYCLE_ALL_math); } +bool CYCLE_ALL(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_ALL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_ALL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_ALL diff --git a/quantum/rgb_matrix/animations/cycle_left_right_anim.h b/quantum/rgb_matrix/animations/cycle_left_right_anim.h index bf6a57406969..84c2127aff9a 100644 --- a/quantum/rgb_matrix/animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix/animations/cycle_left_right_anim.h @@ -7,7 +7,9 @@ static HSV CYCLE_LEFT_RIGHT_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool CYCLE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); } +bool CYCLE_LEFT_RIGHT(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT diff --git a/quantum/rgb_matrix/animations/cycle_out_in_anim.h b/quantum/rgb_matrix/animations/cycle_out_in_anim.h index 2bdb9d9375a5..9513fe959344 100644 --- a/quantum/rgb_matrix/animations/cycle_out_in_anim.h +++ b/quantum/rgb_matrix/animations/cycle_out_in_anim.h @@ -7,7 +7,9 @@ static HSV CYCLE_OUT_IN_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint return hsv; } -bool CYCLE_OUT_IN(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); } +bool CYCLE_OUT_IN(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_OUT_IN diff --git a/quantum/rgb_matrix/animations/cycle_out_in_dual_anim.h b/quantum/rgb_matrix/animations/cycle_out_in_dual_anim.h index 51979c44feed..3cca45f27a57 100644 --- a/quantum/rgb_matrix/animations/cycle_out_in_dual_anim.h +++ b/quantum/rgb_matrix/animations/cycle_out_in_dual_anim.h @@ -9,7 +9,9 @@ static HSV CYCLE_OUT_IN_DUAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) return hsv; } -bool CYCLE_OUT_IN_DUAL(effect_params_t* params) { return effect_runner_dx_dy(params, &CYCLE_OUT_IN_DUAL_math); } +bool CYCLE_OUT_IN_DUAL(effect_params_t* params) { + return effect_runner_dx_dy(params, &CYCLE_OUT_IN_DUAL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL diff --git a/quantum/rgb_matrix/animations/cycle_pinwheel_anim.h b/quantum/rgb_matrix/animations/cycle_pinwheel_anim.h index 10ba2b7c2c78..de5993992cbe 100644 --- a/quantum/rgb_matrix/animations/cycle_pinwheel_anim.h +++ b/quantum/rgb_matrix/animations/cycle_pinwheel_anim.h @@ -7,7 +7,9 @@ static HSV CYCLE_PINWHEEL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { return hsv; } -bool CYCLE_PINWHEEL(effect_params_t* params) { return effect_runner_dx_dy(params, &CYCLE_PINWHEEL_math); } +bool CYCLE_PINWHEEL(effect_params_t* params) { + return effect_runner_dx_dy(params, &CYCLE_PINWHEEL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_PINWHEEL diff --git a/quantum/rgb_matrix/animations/cycle_spiral_anim.h b/quantum/rgb_matrix/animations/cycle_spiral_anim.h index 482c7e7da63c..904450179eb1 100644 --- a/quantum/rgb_matrix/animations/cycle_spiral_anim.h +++ b/quantum/rgb_matrix/animations/cycle_spiral_anim.h @@ -7,7 +7,9 @@ static HSV CYCLE_SPIRAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint return hsv; } -bool CYCLE_SPIRAL(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &CYCLE_SPIRAL_math); } +bool CYCLE_SPIRAL(effect_params_t* params) { + return effect_runner_dx_dy_dist(params, &CYCLE_SPIRAL_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_SPIRAL diff --git a/quantum/rgb_matrix/animations/cycle_up_down_anim.h b/quantum/rgb_matrix/animations/cycle_up_down_anim.h index 277edccb2f12..dce05fecff0c 100644 --- a/quantum/rgb_matrix/animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix/animations/cycle_up_down_anim.h @@ -7,7 +7,9 @@ static HSV CYCLE_UP_DOWN_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool CYCLE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &CYCLE_UP_DOWN_math); } +bool CYCLE_UP_DOWN(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_UP_DOWN_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_CYCLE_UP_DOWN diff --git a/quantum/rgb_matrix/animations/digital_rain_anim.h b/quantum/rgb_matrix/animations/digital_rain_anim.h index 8ce8fd7039bb..4633145ff6bd 100644 --- a/quantum/rgb_matrix/animations/digital_rain_anim.h +++ b/quantum/rgb_matrix/animations/digital_rain_anim.h @@ -71,5 +71,5 @@ bool DIGITAL_RAIN(effect_params_t* params) { return false; } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(ENABLE_RGB_MATRIX_DIGITAL_RAIN) +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(ENABLE_RGB_MATRIX_DIGITAL_RAIN) diff --git a/quantum/rgb_matrix/animations/dual_beacon_anim.h b/quantum/rgb_matrix/animations/dual_beacon_anim.h index dbe9b3ecf166..5585015b8694 100644 --- a/quantum/rgb_matrix/animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix/animations/dual_beacon_anim.h @@ -7,7 +7,9 @@ static HSV DUAL_BEACON_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t return hsv; } -bool DUAL_BEACON(effect_params_t* params) { return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); } +bool DUAL_BEACON(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_DUAL_BEACON +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_DUAL_BEACON diff --git a/quantum/rgb_matrix/animations/gradient_left_right_anim.h b/quantum/rgb_matrix/animations/gradient_left_right_anim.h index 8bb5e570bd0f..ebb06f59f278 100644 --- a/quantum/rgb_matrix/animations/gradient_left_right_anim.h +++ b/quantum/rgb_matrix/animations/gradient_left_right_anim.h @@ -18,5 +18,5 @@ bool GRADIENT_LEFT_RIGHT(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT diff --git a/quantum/rgb_matrix/animations/gradient_up_down_anim.h b/quantum/rgb_matrix/animations/gradient_up_down_anim.h index a5674583e39d..febc3919a888 100644 --- a/quantum/rgb_matrix/animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix/animations/gradient_up_down_anim.h @@ -18,5 +18,5 @@ bool GRADIENT_UP_DOWN(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN diff --git a/quantum/rgb_matrix/animations/hue_breathing_anim.h b/quantum/rgb_matrix/animations/hue_breathing_anim.h index 82be1a44241f..853776283298 100644 --- a/quantum/rgb_matrix/animations/hue_breathing_anim.h +++ b/quantum/rgb_matrix/animations/hue_breathing_anim.h @@ -18,5 +18,5 @@ bool HUE_BREATHING(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // DISABLE_RGB_HUE_BREATHING +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_HUE_BREATHING diff --git a/quantum/rgb_matrix/animations/hue_pendulum_anim.h b/quantum/rgb_matrix/animations/hue_pendulum_anim.h index a6e1c1074de7..7d8cbcdfb243 100644 --- a/quantum/rgb_matrix/animations/hue_pendulum_anim.h +++ b/quantum/rgb_matrix/animations/hue_pendulum_anim.h @@ -11,7 +11,9 @@ static HSV HUE_PENDULUM_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool HUE_PENDULUM(effect_params_t* params) { return effect_runner_i(params, &HUE_PENDULUM_math); } +bool HUE_PENDULUM(effect_params_t* params) { + return effect_runner_i(params, &HUE_PENDULUM_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // DISABLE_RGB_HUE_PENDULUM +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_HUE_PENDULUM diff --git a/quantum/rgb_matrix/animations/hue_wave_anim.h b/quantum/rgb_matrix/animations/hue_wave_anim.h index b1c72b7336f6..81aa7e139e9a 100644 --- a/quantum/rgb_matrix/animations/hue_wave_anim.h +++ b/quantum/rgb_matrix/animations/hue_wave_anim.h @@ -11,7 +11,9 @@ static HSV HUE_WAVE_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool HUE_WAVE(effect_params_t* params) { return effect_runner_i(params, &HUE_WAVE_math); } +bool HUE_WAVE(effect_params_t* params) { + return effect_runner_i(params, &HUE_WAVE_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // DISABLE_RGB_HUE_WAVE +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_RGB_HUE_WAVE diff --git a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h index 3ffb57eb3592..31dffcbc5afd 100644 --- a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h @@ -25,5 +25,5 @@ bool JELLYBEAN_RAINDROPS(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS diff --git a/quantum/rgb_matrix/animations/pixel_flow_anim.h b/quantum/rgb_matrix/animations/pixel_flow_anim.h new file mode 100644 index 000000000000..714f5d174e35 --- /dev/null +++ b/quantum/rgb_matrix/animations/pixel_flow_anim.h @@ -0,0 +1,51 @@ +// Copyright 2022 @filterpaper +// SPDX-License-Identifier: GPL-2.0+ + +#ifdef ENABLE_RGB_MATRIX_PIXEL_FLOW +RGB_MATRIX_EFFECT(PIXEL_FLOW) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static bool PIXEL_FLOW(effect_params_t* params) { + // LED state array + static RGB led[DRIVER_LED_TOTAL]; + + static uint32_t wait_timer = 0; + if (wait_timer > g_rgb_timer) { + return false; + } + + inline uint32_t interval(void) { + return 3000 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); + } + + if (params->init) { + // Clear LEDs and fill the state array + rgb_matrix_set_color_all(0, 0, 0); + for (uint8_t j = 0; j < DRIVER_LED_TOTAL; ++j) { + led[j] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}); + } + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + // Light LEDs based on state array + for (uint8_t i = led_min; i < led_max; ++i) { + RGB_MATRIX_TEST_LED_FLAGS(); + rgb_matrix_set_color(i, led[i].r, led[i].g, led[i].b); + } + + if (!rgb_matrix_check_finished_leds(led_max)) { + // Shift LED state forward + for (uint8_t j = 0; j < led_max - 1; ++j) { + led[j] = led[j + 1]; + } + // Fill last LED + led[led_max - 1] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}); + // Set pulse timer + wait_timer = g_rgb_timer + interval(); + } + + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_PIXEL_FLOW diff --git a/quantum/rgb_matrix/animations/pixel_fractal_anim.h b/quantum/rgb_matrix/animations/pixel_fractal_anim.h index 8e25ec402c25..906da1a48ede 100644 --- a/quantum/rgb_matrix/animations/pixel_fractal_anim.h +++ b/quantum/rgb_matrix/animations/pixel_fractal_anim.h @@ -29,11 +29,17 @@ static bool PIXEL_FRACTAL(effect_params_t* params) { return false; } - inline uint32_t interval(void) { return 3000 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); } + inline uint32_t interval(void) { + return 3000 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); + } + + if (params->init) { + rgb_matrix_set_color_all(0, 0, 0); + } RGB rgb = rgb_matrix_hsv_to_rgb(rgb_matrix_config.hsv); for (uint8_t h = 0; h < MATRIX_ROWS; ++h) { - for (uint8_t l = 0; l < MID_COL - 1; ++l) { // Light and move left columns outwards + for (uint8_t l = 0; l < MID_COL - 1; ++l) { // Light and move left columns outwards if (led[h][l]) { rgb_matrix_set_color(g_led_config.matrix_co[h][l], rgb.r, rgb.g, rgb.b); } else { @@ -42,7 +48,7 @@ static bool PIXEL_FRACTAL(effect_params_t* params) { led[h][l] = led[h][l + 1]; } - for (uint8_t r = MATRIX_COLS - 1; r > MID_COL; --r) { // Light and move right columns outwards + for (uint8_t r = MATRIX_COLS - 1; r > MID_COL; --r) { // Light and move right columns outwards if (led[h][r]) { rgb_matrix_set_color(g_led_config.matrix_co[h][r], rgb.r, rgb.g, rgb.b); } else { @@ -70,5 +76,5 @@ static bool PIXEL_FRACTAL(effect_params_t* params) { wait_timer = g_rgb_timer + interval(); return false; } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_PIXEL_FRACTAL +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_PIXEL_FRACTAL diff --git a/quantum/rgb_matrix/animations/pixel_rain_anim.h b/quantum/rgb_matrix/animations/pixel_rain_anim.h index 001649aa6e0c..03488b43df07 100644 --- a/quantum/rgb_matrix/animations/pixel_rain_anim.h +++ b/quantum/rgb_matrix/animations/pixel_rain_anim.h @@ -24,7 +24,9 @@ static bool PIXEL_RAIN(effect_params_t* params) { return false; } - inline uint32_t interval(void) { return 500 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); } + inline uint32_t interval(void) { + return 500 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); + } bool rain_pixel(uint8_t i, effect_params_t * params, bool off) { if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) { @@ -44,5 +46,5 @@ static bool PIXEL_RAIN(effect_params_t* params) { return rain_pixel(mod8(random8(), DRIVER_LED_TOTAL), params, random8() & 2); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_PIXEL_RAIN +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_PIXEL_RAIN diff --git a/quantum/rgb_matrix/animations/rainbow_beacon_anim.h b/quantum/rgb_matrix/animations/rainbow_beacon_anim.h index cd529958dbfd..bdcca5530fd4 100644 --- a/quantum/rgb_matrix/animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix/animations/rainbow_beacon_anim.h @@ -7,7 +7,9 @@ static HSV RAINBOW_BEACON_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8 return hsv; } -bool RAINBOW_BEACON(effect_params_t* params) { return effect_runner_sin_cos_i(params, &RAINBOW_BEACON_math); } +bool RAINBOW_BEACON(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &RAINBOW_BEACON_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_RAINBOW_BEACON +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_RAINBOW_BEACON diff --git a/quantum/rgb_matrix/animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix/animations/rainbow_moving_chevron_anim.h index 2f3de64e9dca..f7b8f6c2f324 100644 --- a/quantum/rgb_matrix/animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix/animations/rainbow_moving_chevron_anim.h @@ -7,7 +7,9 @@ static HSV RAINBOW_MOVING_CHEVRON_math(HSV hsv, uint8_t i, uint8_t time) { return hsv; } -bool RAINBOW_MOVING_CHEVRON(effect_params_t* params) { return effect_runner_i(params, &RAINBOW_MOVING_CHEVRON_math); } +bool RAINBOW_MOVING_CHEVRON(effect_params_t* params) { + return effect_runner_i(params, &RAINBOW_MOVING_CHEVRON_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON diff --git a/quantum/rgb_matrix/animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix/animations/rainbow_pinwheels_anim.h index dae2b5d19044..91e31ea8cc0f 100644 --- a/quantum/rgb_matrix/animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix/animations/rainbow_pinwheels_anim.h @@ -7,7 +7,9 @@ static HSV RAINBOW_PINWHEELS_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, ui return hsv; } -bool RAINBOW_PINWHEELS(effect_params_t* params) { return effect_runner_sin_cos_i(params, &RAINBOW_PINWHEELS_math); } +bool RAINBOW_PINWHEELS(effect_params_t* params) { + return effect_runner_sin_cos_i(params, &RAINBOW_PINWHEELS_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS diff --git a/quantum/rgb_matrix/animations/raindrops_anim.h b/quantum/rgb_matrix/animations/raindrops_anim.h index 4b1b9dd9ec4d..2d4b53b7b0b4 100644 --- a/quantum/rgb_matrix/animations/raindrops_anim.h +++ b/quantum/rgb_matrix/animations/raindrops_anim.h @@ -35,5 +35,5 @@ bool RAINDROPS(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_RAINDROPS +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_RAINDROPS diff --git a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc index 27ce34723511..ac7bac428d1e 100644 --- a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc @@ -27,6 +27,7 @@ #include "hue_pendulum_anim.h" #include "hue_wave_anim.h" #include "pixel_rain_anim.h" +#include "pixel_flow_anim.h" #include "pixel_fractal_anim.h" #include "typing_heatmap_anim.h" #include "digital_rain_anim.h" diff --git a/quantum/rgb_matrix/animations/runners/effect_runner_reactive.h b/quantum/rgb_matrix/animations/runners/effect_runner_reactive.h index d5c1a26cefe7..f9584d707191 100644 --- a/quantum/rgb_matrix/animations/runners/effect_runner_reactive.h +++ b/quantum/rgb_matrix/animations/runners/effect_runner_reactive.h @@ -26,4 +26,4 @@ bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { return rgb_matrix_check_finished_leds(led_max); } -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/runners/effect_runner_reactive_splash.h b/quantum/rgb_matrix/animations/runners/effect_runner_reactive_splash.h index d3a6e4e72f0f..41020eb47f82 100644 --- a/quantum/rgb_matrix/animations/runners/effect_runner_reactive_splash.h +++ b/quantum/rgb_matrix/animations/runners/effect_runner_reactive_splash.h @@ -26,4 +26,4 @@ bool effect_runner_reactive_splash(uint8_t start, effect_params_t* params, react return rgb_matrix_check_finished_leds(led_max); } -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/solid_color_anim.h b/quantum/rgb_matrix/animations/solid_color_anim.h index 4209959468af..c8762dcbc2ef 100644 --- a/quantum/rgb_matrix/animations/solid_color_anim.h +++ b/quantum/rgb_matrix/animations/solid_color_anim.h @@ -12,4 +12,4 @@ bool SOLID_COLOR(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/quantum/rgb_matrix/animations/solid_reactive_anim.h b/quantum/rgb_matrix/animations/solid_reactive_anim.h index 360d05a67af3..d3a7ebbdf7c2 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix/animations/solid_reactive_anim.h @@ -8,8 +8,10 @@ static HSV SOLID_REACTIVE_math(HSV hsv, uint16_t offset) { return hsv; } -bool SOLID_REACTIVE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_math); } +bool SOLID_REACTIVE(effect_params_t* params) { + return effect_runner_reactive(params, &SOLID_REACTIVE_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // ENABLE_RGB_MATRIX_SOLID_REACTIVE -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // ENABLE_RGB_MATRIX_SOLID_REACTIVE +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/solid_reactive_cross.h b/quantum/rgb_matrix/animations/solid_reactive_cross.h index 496651f8a5fc..043a369b7371 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix/animations/solid_reactive_cross.h @@ -24,13 +24,17 @@ static HSV SOLID_REACTIVE_CROSS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t di } # ifdef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -bool SOLID_REACTIVE_CROSS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); } +bool SOLID_REACTIVE_CROSS(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); +} # endif # ifdef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); } +bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); +} # endif -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/solid_reactive_nexus.h b/quantum/rgb_matrix/animations/solid_reactive_nexus.h index 3562e74a7279..8d62a49feae0 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix/animations/solid_reactive_nexus.h @@ -22,13 +22,17 @@ static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t di } # ifdef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); } +bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); +} # endif # ifdef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); } +bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); +} # endif -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h index 69189f636b20..0d0a424cf322 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix/animations/solid_reactive_simple_anim.h @@ -8,8 +8,10 @@ static HSV SOLID_REACTIVE_SIMPLE_math(HSV hsv, uint16_t offset) { return hsv; } -bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); } +bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { + return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); +} -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/solid_reactive_wide.h b/quantum/rgb_matrix/animations/solid_reactive_wide.h index a613c7ff5f7c..759879631653 100644 --- a/quantum/rgb_matrix/animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix/animations/solid_reactive_wide.h @@ -19,13 +19,17 @@ static HSV SOLID_REACTIVE_WIDE_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dis } # ifdef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -bool SOLID_REACTIVE_WIDE(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); } +bool SOLID_REACTIVE_WIDE(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); +} # endif # ifdef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); } +bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); +} # endif -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/solid_splash_anim.h b/quantum/rgb_matrix/animations/solid_splash_anim.h index bd9c1cfe2b98..77d6f8c5eb0c 100644 --- a/quantum/rgb_matrix/animations/solid_splash_anim.h +++ b/quantum/rgb_matrix/animations/solid_splash_anim.h @@ -19,13 +19,17 @@ HSV SOLID_SPLASH_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t ti } # ifdef ENABLE_RGB_MATRIX_SOLID_SPLASH -bool SOLID_SPLASH(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); } +bool SOLID_SPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); +} # endif # ifdef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -bool SOLID_MULTISPLASH(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); } +bool SOLID_MULTISPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); +} # endif -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // !defined(ENABLE_RGB_MATRIX_SPLASH) && !defined(ENABLE_RGB_MATRIX_MULTISPLASH) -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // !defined(ENABLE_RGB_MATRIX_SPLASH) && !defined(ENABLE_RGB_MATRIX_MULTISPLASH) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/splash_anim.h b/quantum/rgb_matrix/animations/splash_anim.h index 382355e9ed63..06459e1b0a2e 100644 --- a/quantum/rgb_matrix/animations/splash_anim.h +++ b/quantum/rgb_matrix/animations/splash_anim.h @@ -20,13 +20,17 @@ HSV SPLASH_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { } # ifdef ENABLE_RGB_MATRIX_SPLASH -bool SPLASH(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SPLASH_math); } +bool SPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SPLASH_math); +} # endif # ifdef ENABLE_RGB_MATRIX_MULTISPLASH -bool MULTISPLASH(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SPLASH_math); } +bool MULTISPLASH(effect_params_t* params) { + return effect_runner_reactive_splash(0, params, &SPLASH_math); +} # endif -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -# endif // !defined(ENABLE_RGB_MATRIX_SPLASH) || !defined(ENABLE_RGB_MATRIX_MULTISPLASH) -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# endif // !defined(ENABLE_RGB_MATRIX_SPLASH) || !defined(ENABLE_RGB_MATRIX_MULTISPLASH) +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED diff --git a/quantum/rgb_matrix/animations/typing_heatmap_anim.h b/quantum/rgb_matrix/animations/typing_heatmap_anim.h index b66667b9b8c0..f3a94280c068 100644 --- a/quantum/rgb_matrix/animations/typing_heatmap_anim.h +++ b/quantum/rgb_matrix/animations/typing_heatmap_anim.h @@ -82,5 +82,5 @@ bool TYPING_HEATMAP(effect_params_t* params) { return led_max < sizeof(g_rgb_frame_buffer); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c index 51e9554e2dc4..f721dfc7f240 100644 --- a/quantum/rgb_matrix/rgb_matrix.c +++ b/quantum/rgb_matrix/rgb_matrix.c @@ -31,7 +31,9 @@ const led_point_t k_rgb_matrix_center = {112, 32}; const led_point_t k_rgb_matrix_center = RGB_MATRIX_CENTER; #endif -__attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); } +__attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { + return hsv_to_rgb(hsv); +} // Generic effect runners #include "rgb_matrix_runners.inc" @@ -109,14 +111,14 @@ __attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv #endif // globals -rgb_config_t rgb_matrix_config; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr +rgb_config_t rgb_matrix_config; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr uint32_t g_rgb_timer; #ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS uint8_t g_rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS] = {{0}}; -#endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED last_hit_t g_last_hit_tracker; -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED // internals static bool suspend_state = false; @@ -126,13 +128,13 @@ static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false}; static rgb_task_states rgb_task_state = SYNCING; #if RGB_DISABLE_TIMEOUT > 0 static uint32_t rgb_anykey_timer; -#endif // RGB_DISABLE_TIMEOUT > 0 +#endif // RGB_DISABLE_TIMEOUT > 0 // double buffers static uint32_t rgb_timer_buffer; #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED static last_hit_t last_hit_buffer; -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED // split rgb matrix #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) @@ -141,7 +143,9 @@ const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; EECONFIG_DEBOUNCE_HELPER(rgb_matrix, EECONFIG_RGB_MATRIX, rgb_matrix_config); -void eeconfig_update_rgb_matrix(void) { eeconfig_flush_rgb_matrix(true); } +void eeconfig_update_rgb_matrix(void) { + eeconfig_flush_rgb_matrix(true); +} void eeconfig_update_rgb_matrix_default(void) { dprintf("eeconfig_update_rgb_matrix_default\n"); @@ -164,7 +168,19 @@ void eeconfig_debug_rgb_matrix(void) { dprintf("rgb_matrix_config.flags = %d\n", rgb_matrix_config.flags); } -__attribute__((weak)) uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { return 0; } +void rgb_matrix_reload_from_eeprom(void) { + rgb_matrix_disable_noeeprom(); + /* Reset back to what we have in eeprom */ + eeconfig_init_rgb_matrix(); + eeconfig_debug_rgb_matrix(); // display current eeprom values + if (rgb_matrix_config.enable) { + rgb_matrix_mode_noeeprom(rgb_matrix_config.mode); + } +} + +__attribute__((weak)) uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + return 0; +} uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i); @@ -176,13 +192,18 @@ uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *l return led_count; } -void rgb_matrix_update_pwm_buffers(void) { rgb_matrix_driver.flush(); } +void rgb_matrix_update_pwm_buffers(void) { + rgb_matrix_driver.flush(); +} -void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_driver.set_color(index, red, green, blue); } +void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + rgb_matrix_driver.set_color(index, red, green, blue); +} void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) rgb_matrix_set_color(i, red, green, blue); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) + rgb_matrix_set_color(i, red, green, blue); #else rgb_matrix_driver.set_color_all(red, green, blue); #endif @@ -194,7 +215,7 @@ void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) { #endif #if RGB_DISABLE_TIMEOUT > 0 rgb_anykey_timer = 0; -#endif // RGB_DISABLE_TIMEOUT > 0 +#endif // RGB_DISABLE_TIMEOUT > 0 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED uint8_t led[LED_HITS_TO_REMEMBER]; @@ -204,7 +225,7 @@ void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) { if (!pressed) # elif defined(RGB_MATRIX_KEYPRESSES) if (pressed) -# endif // defined(RGB_MATRIX_KEYRELEASES) +# endif // defined(RGB_MATRIX_KEYRELEASES) { led_count = rgb_matrix_map_row_column_to_led(row, col, led); } @@ -212,7 +233,7 @@ void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) { if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) { memcpy(&last_hit_buffer.x[0], &last_hit_buffer.x[led_count], LED_HITS_TO_REMEMBER - led_count); memcpy(&last_hit_buffer.y[0], &last_hit_buffer.y[led_count], LED_HITS_TO_REMEMBER - led_count); - memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit + memcpy(&last_hit_buffer.tick[0], &last_hit_buffer.tick[led_count], (LED_HITS_TO_REMEMBER - led_count) * 2); // 16 bit memcpy(&last_hit_buffer.index[0], &last_hit_buffer.index[led_count], LED_HITS_TO_REMEMBER - led_count); last_hit_buffer.count = LED_HITS_TO_REMEMBER - led_count; } @@ -225,13 +246,13 @@ void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) { last_hit_buffer.tick[index] = 0; last_hit_buffer.count++; } -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { process_rgb_matrix_typing_heatmap(row, col); } -#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) +#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP) } void rgb_matrix_test(void) { @@ -270,7 +291,7 @@ static bool rgb_matrix_none(effect_params_t *params) { static void rgb_task_timers(void) { #if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 uint32_t deltaTime = sync_timer_elapsed32(rgb_timer_buffer); -#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 +#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 rgb_timer_buffer = sync_timer_read32(); // Update double buffer timers @@ -278,7 +299,7 @@ static void rgb_task_timers(void) { if (rgb_anykey_timer + deltaTime <= UINT32_MAX) { rgb_anykey_timer += deltaTime; } -#endif // RGB_DISABLE_TIMEOUT > 0 +#endif // RGB_DISABLE_TIMEOUT > 0 // Update double buffer last hit timers #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED @@ -290,7 +311,7 @@ static void rgb_task_timers(void) { } last_hit_buffer.tick[i] += deltaTime; } -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED } static void rgb_task_sync(void) { @@ -307,7 +328,7 @@ static void rgb_task_start(void) { g_rgb_timer = rgb_timer_buffer; #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED g_last_hit_tracker = last_hit_buffer; -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED // next task rgb_task_state = RENDERING; @@ -393,7 +414,7 @@ void rgb_matrix_task(void) { bool suspend_backlight = suspend_state || #if RGB_DISABLE_TIMEOUT > 0 (rgb_anykey_timer > (uint32_t)RGB_DISABLE_TIMEOUT) || -#endif // RGB_DISABLE_TIMEOUT > 0 +#endif // RGB_DISABLE_TIMEOUT > 0 false; uint8_t effect = suspend_backlight || !rgb_matrix_config.enable ? 0 : rgb_matrix_config.mode; @@ -462,7 +483,7 @@ void rgb_matrix_init(void) { for (uint8_t i = 0; i < LED_HITS_TO_REMEMBER; ++i) { last_hit_buffer.tick[i] = UINT16_MAX; } -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED if (!eeconfig_is_enabled()) { dprintf("rgb_matrix_init_drivers eeconfig is not enabled.\n"); @@ -475,20 +496,22 @@ void rgb_matrix_init(void) { dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n"); eeconfig_update_rgb_matrix_default(); } - eeconfig_debug_rgb_matrix(); // display current eeprom values + eeconfig_debug_rgb_matrix(); // display current eeprom values } void rgb_matrix_set_suspend_state(bool state) { #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED - if (state && !suspend_state) { // only run if turning off, and only once - rgb_task_render(0); // turn off all LEDs when suspending - rgb_task_flush(0); // and actually flash led state to LEDs + if (state && !suspend_state) { // only run if turning off, and only once + rgb_task_render(0); // turn off all LEDs when suspending + rgb_task_flush(0); // and actually flash led state to LEDs } suspend_state = state; #endif } -bool rgb_matrix_get_suspend_state(void) { return suspend_state; } +bool rgb_matrix_get_suspend_state(void) { + return suspend_state; +} void rgb_matrix_toggle_eeprom_helper(bool write_to_eeprom) { rgb_matrix_config.enable ^= 1; @@ -496,8 +519,12 @@ void rgb_matrix_toggle_eeprom_helper(bool write_to_eeprom) { eeconfig_flag_rgb_matrix(write_to_eeprom); dprintf("rgb matrix toggle [%s]: rgb_matrix_config.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.enable); } -void rgb_matrix_toggle_noeeprom(void) { rgb_matrix_toggle_eeprom_helper(false); } -void rgb_matrix_toggle(void) { rgb_matrix_toggle_eeprom_helper(true); } +void rgb_matrix_toggle_noeeprom(void) { + rgb_matrix_toggle_eeprom_helper(false); +} +void rgb_matrix_toggle(void) { + rgb_matrix_toggle_eeprom_helper(true); +} void rgb_matrix_enable(void) { rgb_matrix_enable_noeeprom(); @@ -519,7 +546,9 @@ void rgb_matrix_disable_noeeprom(void) { rgb_matrix_config.enable = 0; } -uint8_t rgb_matrix_is_enabled(void) { return rgb_matrix_config.enable; } +uint8_t rgb_matrix_is_enabled(void) { + return rgb_matrix_config.enable; +} void rgb_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { if (!rgb_matrix_config.enable) { @@ -536,24 +565,38 @@ void rgb_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { eeconfig_flag_rgb_matrix(write_to_eeprom); dprintf("rgb matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.mode); } -void rgb_matrix_mode_noeeprom(uint8_t mode) { rgb_matrix_mode_eeprom_helper(mode, false); } -void rgb_matrix_mode(uint8_t mode) { rgb_matrix_mode_eeprom_helper(mode, true); } +void rgb_matrix_mode_noeeprom(uint8_t mode) { + rgb_matrix_mode_eeprom_helper(mode, false); +} +void rgb_matrix_mode(uint8_t mode) { + rgb_matrix_mode_eeprom_helper(mode, true); +} -uint8_t rgb_matrix_get_mode(void) { return rgb_matrix_config.mode; } +uint8_t rgb_matrix_get_mode(void) { + return rgb_matrix_config.mode; +} void rgb_matrix_step_helper(bool write_to_eeprom) { uint8_t mode = rgb_matrix_config.mode + 1; rgb_matrix_mode_eeprom_helper((mode < RGB_MATRIX_EFFECT_MAX) ? mode : 1, write_to_eeprom); } -void rgb_matrix_step_noeeprom(void) { rgb_matrix_step_helper(false); } -void rgb_matrix_step(void) { rgb_matrix_step_helper(true); } +void rgb_matrix_step_noeeprom(void) { + rgb_matrix_step_helper(false); +} +void rgb_matrix_step(void) { + rgb_matrix_step_helper(true); +} void rgb_matrix_step_reverse_helper(bool write_to_eeprom) { uint8_t mode = rgb_matrix_config.mode - 1; rgb_matrix_mode_eeprom_helper((mode < 1) ? RGB_MATRIX_EFFECT_MAX - 1 : mode, write_to_eeprom); } -void rgb_matrix_step_reverse_noeeprom(void) { rgb_matrix_step_reverse_helper(false); } -void rgb_matrix_step_reverse(void) { rgb_matrix_step_reverse_helper(true); } +void rgb_matrix_step_reverse_noeeprom(void) { + rgb_matrix_step_reverse_helper(false); +} +void rgb_matrix_step_reverse(void) { + rgb_matrix_step_reverse_helper(true); +} void rgb_matrix_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { if (!rgb_matrix_config.enable) { @@ -565,56 +608,126 @@ void rgb_matrix_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, boo eeconfig_flag_rgb_matrix(write_to_eeprom); dprintf("rgb matrix set hsv [%s]: %u,%u,%u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); } -void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_sethsv_eeprom_helper(hue, sat, val, false); } -void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_sethsv_eeprom_helper(hue, sat, val, true); } +void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { + rgb_matrix_sethsv_eeprom_helper(hue, sat, val, false); +} +void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { + rgb_matrix_sethsv_eeprom_helper(hue, sat, val, true); +} -HSV rgb_matrix_get_hsv(void) { return rgb_matrix_config.hsv; } -uint8_t rgb_matrix_get_hue(void) { return rgb_matrix_config.hsv.h; } -uint8_t rgb_matrix_get_sat(void) { return rgb_matrix_config.hsv.s; } -uint8_t rgb_matrix_get_val(void) { return rgb_matrix_config.hsv.v; } +HSV rgb_matrix_get_hsv(void) { + return rgb_matrix_config.hsv; +} +uint8_t rgb_matrix_get_hue(void) { + return rgb_matrix_config.hsv.h; +} +uint8_t rgb_matrix_get_sat(void) { + return rgb_matrix_config.hsv.s; +} +uint8_t rgb_matrix_get_val(void) { + return rgb_matrix_config.hsv.v; +} -void rgb_matrix_increase_hue_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h + RGB_MATRIX_HUE_STEP, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, write_to_eeprom); } -void rgb_matrix_increase_hue_noeeprom(void) { rgb_matrix_increase_hue_helper(false); } -void rgb_matrix_increase_hue(void) { rgb_matrix_increase_hue_helper(true); } +void rgb_matrix_increase_hue_helper(bool write_to_eeprom) { + rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h + RGB_MATRIX_HUE_STEP, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, write_to_eeprom); +} +void rgb_matrix_increase_hue_noeeprom(void) { + rgb_matrix_increase_hue_helper(false); +} +void rgb_matrix_increase_hue(void) { + rgb_matrix_increase_hue_helper(true); +} -void rgb_matrix_decrease_hue_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h - RGB_MATRIX_HUE_STEP, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, write_to_eeprom); } -void rgb_matrix_decrease_hue_noeeprom(void) { rgb_matrix_decrease_hue_helper(false); } -void rgb_matrix_decrease_hue(void) { rgb_matrix_decrease_hue_helper(true); } +void rgb_matrix_decrease_hue_helper(bool write_to_eeprom) { + rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h - RGB_MATRIX_HUE_STEP, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, write_to_eeprom); +} +void rgb_matrix_decrease_hue_noeeprom(void) { + rgb_matrix_decrease_hue_helper(false); +} +void rgb_matrix_decrease_hue(void) { + rgb_matrix_decrease_hue_helper(true); +} -void rgb_matrix_increase_sat_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, qadd8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP), rgb_matrix_config.hsv.v, write_to_eeprom); } -void rgb_matrix_increase_sat_noeeprom(void) { rgb_matrix_increase_sat_helper(false); } -void rgb_matrix_increase_sat(void) { rgb_matrix_increase_sat_helper(true); } +void rgb_matrix_increase_sat_helper(bool write_to_eeprom) { + rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, qadd8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP), rgb_matrix_config.hsv.v, write_to_eeprom); +} +void rgb_matrix_increase_sat_noeeprom(void) { + rgb_matrix_increase_sat_helper(false); +} +void rgb_matrix_increase_sat(void) { + rgb_matrix_increase_sat_helper(true); +} -void rgb_matrix_decrease_sat_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, qsub8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP), rgb_matrix_config.hsv.v, write_to_eeprom); } -void rgb_matrix_decrease_sat_noeeprom(void) { rgb_matrix_decrease_sat_helper(false); } -void rgb_matrix_decrease_sat(void) { rgb_matrix_decrease_sat_helper(true); } +void rgb_matrix_decrease_sat_helper(bool write_to_eeprom) { + rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, qsub8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP), rgb_matrix_config.hsv.v, write_to_eeprom); +} +void rgb_matrix_decrease_sat_noeeprom(void) { + rgb_matrix_decrease_sat_helper(false); +} +void rgb_matrix_decrease_sat(void) { + rgb_matrix_decrease_sat_helper(true); +} -void rgb_matrix_increase_val_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, qadd8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP), write_to_eeprom); } -void rgb_matrix_increase_val_noeeprom(void) { rgb_matrix_increase_val_helper(false); } -void rgb_matrix_increase_val(void) { rgb_matrix_increase_val_helper(true); } +void rgb_matrix_increase_val_helper(bool write_to_eeprom) { + rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, qadd8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP), write_to_eeprom); +} +void rgb_matrix_increase_val_noeeprom(void) { + rgb_matrix_increase_val_helper(false); +} +void rgb_matrix_increase_val(void) { + rgb_matrix_increase_val_helper(true); +} -void rgb_matrix_decrease_val_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, qsub8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP), write_to_eeprom); } -void rgb_matrix_decrease_val_noeeprom(void) { rgb_matrix_decrease_val_helper(false); } -void rgb_matrix_decrease_val(void) { rgb_matrix_decrease_val_helper(true); } +void rgb_matrix_decrease_val_helper(bool write_to_eeprom) { + rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, qsub8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP), write_to_eeprom); +} +void rgb_matrix_decrease_val_noeeprom(void) { + rgb_matrix_decrease_val_helper(false); +} +void rgb_matrix_decrease_val(void) { + rgb_matrix_decrease_val_helper(true); +} void rgb_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { rgb_matrix_config.speed = speed; eeconfig_flag_rgb_matrix(write_to_eeprom); dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.speed); } -void rgb_matrix_set_speed_noeeprom(uint8_t speed) { rgb_matrix_set_speed_eeprom_helper(speed, false); } -void rgb_matrix_set_speed(uint8_t speed) { rgb_matrix_set_speed_eeprom_helper(speed, true); } +void rgb_matrix_set_speed_noeeprom(uint8_t speed) { + rgb_matrix_set_speed_eeprom_helper(speed, false); +} +void rgb_matrix_set_speed(uint8_t speed) { + rgb_matrix_set_speed_eeprom_helper(speed, true); +} -uint8_t rgb_matrix_get_speed(void) { return rgb_matrix_config.speed; } +uint8_t rgb_matrix_get_speed(void) { + return rgb_matrix_config.speed; +} -void rgb_matrix_increase_speed_helper(bool write_to_eeprom) { rgb_matrix_set_speed_eeprom_helper(qadd8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP), write_to_eeprom); } -void rgb_matrix_increase_speed_noeeprom(void) { rgb_matrix_increase_speed_helper(false); } -void rgb_matrix_increase_speed(void) { rgb_matrix_increase_speed_helper(true); } +void rgb_matrix_increase_speed_helper(bool write_to_eeprom) { + rgb_matrix_set_speed_eeprom_helper(qadd8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP), write_to_eeprom); +} +void rgb_matrix_increase_speed_noeeprom(void) { + rgb_matrix_increase_speed_helper(false); +} +void rgb_matrix_increase_speed(void) { + rgb_matrix_increase_speed_helper(true); +} -void rgb_matrix_decrease_speed_helper(bool write_to_eeprom) { rgb_matrix_set_speed_eeprom_helper(qsub8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP), write_to_eeprom); } -void rgb_matrix_decrease_speed_noeeprom(void) { rgb_matrix_decrease_speed_helper(false); } -void rgb_matrix_decrease_speed(void) { rgb_matrix_decrease_speed_helper(true); } +void rgb_matrix_decrease_speed_helper(bool write_to_eeprom) { + rgb_matrix_set_speed_eeprom_helper(qsub8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP), write_to_eeprom); +} +void rgb_matrix_decrease_speed_noeeprom(void) { + rgb_matrix_decrease_speed_helper(false); +} +void rgb_matrix_decrease_speed(void) { + rgb_matrix_decrease_speed_helper(true); +} -led_flags_t rgb_matrix_get_flags(void) { return rgb_matrix_config.flags; } +led_flags_t rgb_matrix_get_flags(void) { + return rgb_matrix_config.flags; +} -void rgb_matrix_set_flags(led_flags_t flags) { rgb_matrix_config.flags = flags; } +void rgb_matrix_set_flags(led_flags_t flags) { + rgb_matrix_config.flags = flags; +} diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h index a804d99abcc2..359d507a4d9f 100644 --- a/quantum/rgb_matrix/rgb_matrix.h +++ b/quantum/rgb_matrix/rgb_matrix.h @@ -32,6 +32,8 @@ # include "is31fl3737.h" #elif defined(IS31FL3741) # include "is31fl3741.h" +#elif defined(IS31FLCOMMON) +# include "is31flcommon.h" #elif defined(CKLED2001) # include "ckled2001.h" #elif defined(AW20216) @@ -136,6 +138,8 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); void rgb_matrix_init(void); +void rgb_matrix_reload_from_eeprom(void); + void rgb_matrix_set_suspend_state(bool state); bool rgb_matrix_get_suspend_state(void); void rgb_matrix_toggle(void); @@ -182,6 +186,7 @@ void rgb_matrix_set_flags(led_flags_t flags); #ifndef RGBLIGHT_ENABLE # define eeconfig_update_rgblight_current eeconfig_update_rgb_matrix +# define rgblight_reload_from_eeprom rgb_matrix_reload_from_eeprom # define rgblight_toggle rgb_matrix_toggle # define rgblight_toggle_noeeprom rgb_matrix_toggle_noeeprom # define rgblight_enable rgb_matrix_enable diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index 130ca47a6394..27fa7369bfd7 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -23,7 +23,7 @@ * be here if shared between boards. */ -#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741) || defined(CKLED2001) +#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741) || defined(IS31FLCOMMON) || defined(CKLED2001) # include "i2c_master.h" // TODO: Remove this at some later date @@ -81,6 +81,18 @@ static void init(void) { # elif defined(IS31FL3741) IS31FL3741_init(DRIVER_ADDR_1); +# elif defined(IS31FLCOMMON) + IS31FL_common_init(DRIVER_ADDR_1, ISSI_SSR_1); +# if defined(DRIVER_ADDR_2) + IS31FL_common_init(DRIVER_ADDR_2, ISSI_SSR_2); +# if defined(DRIVER_ADDR_3) + IS31FL_common_init(DRIVER_ADDR_3, ISSI_SSR_3); +# if defined(DRIVER_ADDR_4) + IS31FL_common_init(DRIVER_ADDR_4, ISSI_SSR_4); +# endif +# endif +# endif + # elif defined(CKLED2001) CKLED2001_init(DRIVER_ADDR_1); # if defined(DRIVER_ADDR_2) @@ -106,6 +118,8 @@ static void init(void) { IS31FL3737_set_led_control_register(index, enabled, enabled, enabled); # elif defined(IS31FL3741) IS31FL3741_set_led_control_register(index, enabled, enabled, enabled); +# elif defined(IS31FLCOMMON) + IS31FL_RGB_set_scaling_buffer(index, enabled, enabled, enabled); # elif defined(CKLED2001) CKLED2001_set_led_control_register(index, enabled, enabled, enabled); # endif @@ -145,6 +159,21 @@ static void init(void) { # elif defined(IS31FL3741) IS31FL3741_update_led_control_registers(DRIVER_ADDR_1, 0); +# elif defined(IS31FLCOMMON) +# ifdef ISSI_MANUAL_SCALING + IS31FL_set_manual_scaling_buffer(); +# endif + IS31FL_common_update_scaling_register(DRIVER_ADDR_1, 0); +# if defined(DRIVER_ADDR_2) + IS31FL_common_update_scaling_register(DRIVER_ADDR_2, 1); +# if defined(DRIVER_ADDR_3) + IS31FL_common_update_scaling_register(DRIVER_ADDR_3, 2); +# if defined(DRIVER_ADDR_4) + IS31FL_common_update_scaling_register(DRIVER_ADDR_4, 3); +# endif +# endif +# endif + # elif defined(CKLED2001) CKLED2001_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) @@ -231,6 +260,27 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = IS31FL3741_set_color_all, }; +# elif defined(IS31FLCOMMON) +static void flush(void) { + IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); +# if defined(DRIVER_ADDR_2) + IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); +# if defined(DRIVER_ADDR_3) + IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); +# if defined(DRIVER_ADDR_4) + IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); +# endif +# endif +# endif +} + +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = IS31FL_RGB_set_color, + .set_color_all = IS31FL_RGB_set_color_all, +}; + # elif defined(CKLED2001) static void flush(void) { CKLED2001_update_pwm_buffers(DRIVER_ADDR_1, 0); @@ -299,10 +349,15 @@ static void flush(void) { static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { # if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; - if (!is_keyboard_left() && (i >= k_rgb_matrix_split[0])) { - i -= k_rgb_matrix_split[0]; - } else if (is_keyboard_left() && (i >= k_rgb_matrix_split[0])) + if (!is_keyboard_left()) { + if (i >= k_rgb_matrix_split[0]) { + i -= k_rgb_matrix_split[0]; + } else { + return; + } + } else if (i >= k_rgb_matrix_split[0]) { return; + } # endif rgb_matrix_ws2812_array[i].r = r; diff --git a/quantum/rgb_matrix/rgb_matrix_types.h b/quantum/rgb_matrix/rgb_matrix_types.h index df575d6577c4..d0ac4e4466fe 100644 --- a/quantum/rgb_matrix/rgb_matrix_types.h +++ b/quantum/rgb_matrix/rgb_matrix_types.h @@ -37,7 +37,7 @@ // Last led hit #ifndef LED_HITS_TO_REMEMBER # define LED_HITS_TO_REMEMBER 8 -#endif // LED_HITS_TO_REMEMBER +#endif // LED_HITS_TO_REMEMBER #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED typedef struct PACKED { @@ -47,7 +47,7 @@ typedef struct PACKED { uint8_t index[LED_HITS_TO_REMEMBER]; uint16_t tick[LED_HITS_TO_REMEMBER]; } last_hit_t; -#endif // RGB_MATRIX_KEYREACTIVE_ENABLED +#endif // RGB_MATRIX_KEYREACTIVE_ENABLED typedef enum rgb_task_states { STARTING, RENDERING, FLUSHING, SYNCING } rgb_task_states; @@ -88,7 +88,7 @@ typedef union { uint8_t enable : 2; uint8_t mode : 6; HSV hsv; - uint8_t speed; // EECONFIG needs to be increased to support this + uint8_t speed; // EECONFIG needs to be increased to support this led_flags_t flags; }; } rgb_config_t; diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c index 148dae78f4b3..8f933a6e510c 100644 --- a/quantum/rgblight/rgblight.c +++ b/quantum/rgblight/rgblight.c @@ -72,7 +72,7 @@ static uint8_t static_effect_table[] = { #define _RGBM_TMP_STATIC(sym, msym) RGBLIGHT_MODE_##msym, #define _RGBM_TMP_DYNAMIC(sym, msym) RGBLIGHT_MODE_##msym, static uint8_t mode_base_table[] = { - 0, // RGBLIGHT_MODE_zero + 0, // RGBLIGHT_MODE_zero #include "rgblight_modes.h" }; @@ -96,7 +96,9 @@ static uint8_t mode_base_table[] = { # define RGBLIGHT_DEFAULT_SPD 0 #endif -static inline int is_static_effect(uint8_t mode) { return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; } +static inline int is_static_effect(uint8_t mode) { + return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; +} #ifdef RGBLIGHT_LED_MAP const uint8_t led_map[] PROGMEM = RGBLIGHT_LED_MAP; @@ -143,7 +145,9 @@ void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds) { rgblight_ranges.effect_num_leds = num_leds; } -__attribute__((weak)) RGB rgblight_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); } +__attribute__((weak)) RGB rgblight_hsv_to_rgb(HSV hsv) { + return hsv_to_rgb(hsv); +} void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { HSV hsv = {hue, sat, val}; @@ -151,7 +155,9 @@ void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { setrgb(rgb.r, rgb.g, rgb.b, led1); } -void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { sethsv_raw(hue, sat, val > RGBLIGHT_LIMIT_VAL ? RGBLIGHT_LIMIT_VAL : val, led1); } +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { + sethsv_raw(hue, sat, val > RGBLIGHT_LIMIT_VAL ? RGBLIGHT_LIMIT_VAL : val, led1); +} void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { led1->r = r; @@ -191,7 +197,9 @@ void eeconfig_update_rgblight(uint32_t val) { #endif } -void eeconfig_update_rgblight_current(void) { eeconfig_update_rgblight(rgblight_config.raw); } +void eeconfig_update_rgblight_current(void) { + eeconfig_update_rgblight(rgblight_config.raw); +} void eeconfig_update_rgblight_default(void) { rgblight_config.enable = 1; @@ -238,9 +246,9 @@ void rgblight_init(void) { } rgblight_check_config(); - eeconfig_debug_rgblight(); // display current eeprom values + eeconfig_debug_rgblight(); // display current eeprom values - rgblight_timer_init(); // setup the timer + rgblight_timer_init(); // setup the timer if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); @@ -254,13 +262,15 @@ void rgblight_reload_from_eeprom(void) { rgblight_config.raw = eeconfig_read_rgblight(); RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; rgblight_check_config(); - eeconfig_debug_rgblight(); // display current eeprom values + eeconfig_debug_rgblight(); // display current eeprom values if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); } } -uint32_t rgblight_read_dword(void) { return rgblight_config.raw; } +uint32_t rgblight_read_dword(void) { + return rgblight_config.raw; +} void rgblight_update_dword(uint32_t dword) { RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; @@ -296,8 +306,12 @@ void rgblight_step_helper(bool write_to_eeprom) { } rgblight_mode_eeprom_helper(mode, write_to_eeprom); } -void rgblight_step_noeeprom(void) { rgblight_step_helper(false); } -void rgblight_step(void) { rgblight_step_helper(true); } +void rgblight_step_noeeprom(void) { + rgblight_step_helper(false); +} +void rgblight_step(void) { + rgblight_step_helper(true); +} void rgblight_step_reverse_helper(bool write_to_eeprom) { uint8_t mode = 0; mode = rgblight_config.mode - 1; @@ -306,8 +320,12 @@ void rgblight_step_reverse_helper(bool write_to_eeprom) { } rgblight_mode_eeprom_helper(mode, write_to_eeprom); } -void rgblight_step_reverse_noeeprom(void) { rgblight_step_reverse_helper(false); } -void rgblight_step_reverse(void) { rgblight_step_reverse_helper(true); } +void rgblight_step_reverse_noeeprom(void) { + rgblight_step_reverse_helper(false); +} +void rgblight_step_reverse(void) { + rgblight_step_reverse_helper(true); +} uint8_t rgblight_get_mode(void) { if (!rgblight_config.enable) { @@ -346,9 +364,13 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } -void rgblight_mode(uint8_t mode) { rgblight_mode_eeprom_helper(mode, true); } +void rgblight_mode(uint8_t mode) { + rgblight_mode_eeprom_helper(mode, true); +} -void rgblight_mode_noeeprom(uint8_t mode) { rgblight_mode_eeprom_helper(mode, false); } +void rgblight_mode_noeeprom(uint8_t mode) { + rgblight_mode_eeprom_helper(mode, false); +} void rgblight_toggle(void) { dprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); @@ -401,64 +423,98 @@ void rgblight_disable_noeeprom(void) { rgblight_set(); } -bool rgblight_is_enabled(void) { return rgblight_config.enable; } +bool rgblight_is_enabled(void) { + return rgblight_config.enable; +} void rgblight_increase_hue_helper(bool write_to_eeprom) { uint8_t hue = rgblight_config.hue + RGBLIGHT_HUE_STEP; rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } -void rgblight_increase_hue_noeeprom(void) { rgblight_increase_hue_helper(false); } -void rgblight_increase_hue(void) { rgblight_increase_hue_helper(true); } +void rgblight_increase_hue_noeeprom(void) { + rgblight_increase_hue_helper(false); +} +void rgblight_increase_hue(void) { + rgblight_increase_hue_helper(true); +} void rgblight_decrease_hue_helper(bool write_to_eeprom) { uint8_t hue = rgblight_config.hue - RGBLIGHT_HUE_STEP; rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } -void rgblight_decrease_hue_noeeprom(void) { rgblight_decrease_hue_helper(false); } -void rgblight_decrease_hue(void) { rgblight_decrease_hue_helper(true); } +void rgblight_decrease_hue_noeeprom(void) { + rgblight_decrease_hue_helper(false); +} +void rgblight_decrease_hue(void) { + rgblight_decrease_hue_helper(true); +} void rgblight_increase_sat_helper(bool write_to_eeprom) { uint8_t sat = qadd8(rgblight_config.sat, RGBLIGHT_SAT_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); } -void rgblight_increase_sat_noeeprom(void) { rgblight_increase_sat_helper(false); } -void rgblight_increase_sat(void) { rgblight_increase_sat_helper(true); } +void rgblight_increase_sat_noeeprom(void) { + rgblight_increase_sat_helper(false); +} +void rgblight_increase_sat(void) { + rgblight_increase_sat_helper(true); +} void rgblight_decrease_sat_helper(bool write_to_eeprom) { uint8_t sat = qsub8(rgblight_config.sat, RGBLIGHT_SAT_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); } -void rgblight_decrease_sat_noeeprom(void) { rgblight_decrease_sat_helper(false); } -void rgblight_decrease_sat(void) { rgblight_decrease_sat_helper(true); } +void rgblight_decrease_sat_noeeprom(void) { + rgblight_decrease_sat_helper(false); +} +void rgblight_decrease_sat(void) { + rgblight_decrease_sat_helper(true); +} void rgblight_increase_val_helper(bool write_to_eeprom) { uint8_t val = qadd8(rgblight_config.val, RGBLIGHT_VAL_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); } -void rgblight_increase_val_noeeprom(void) { rgblight_increase_val_helper(false); } -void rgblight_increase_val(void) { rgblight_increase_val_helper(true); } +void rgblight_increase_val_noeeprom(void) { + rgblight_increase_val_helper(false); +} +void rgblight_increase_val(void) { + rgblight_increase_val_helper(true); +} void rgblight_decrease_val_helper(bool write_to_eeprom) { uint8_t val = qsub8(rgblight_config.val, RGBLIGHT_VAL_STEP); rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); } -void rgblight_decrease_val_noeeprom(void) { rgblight_decrease_val_helper(false); } -void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); } +void rgblight_decrease_val_noeeprom(void) { + rgblight_decrease_val_helper(false); +} +void rgblight_decrease_val(void) { + rgblight_decrease_val_helper(true); +} void rgblight_increase_speed_helper(bool write_to_eeprom) { if (rgblight_config.speed < 3) rgblight_config.speed++; // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED? if (write_to_eeprom) { - eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this } } -void rgblight_increase_speed(void) { rgblight_increase_speed_helper(true); } -void rgblight_increase_speed_noeeprom(void) { rgblight_increase_speed_helper(false); } +void rgblight_increase_speed(void) { + rgblight_increase_speed_helper(true); +} +void rgblight_increase_speed_noeeprom(void) { + rgblight_increase_speed_helper(false); +} void rgblight_decrease_speed_helper(bool write_to_eeprom) { if (rgblight_config.speed > 0) rgblight_config.speed--; // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?? if (write_to_eeprom) { - eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this } } -void rgblight_decrease_speed(void) { rgblight_decrease_speed_helper(true); } -void rgblight_decrease_speed_noeeprom(void) { rgblight_decrease_speed_helper(false); } +void rgblight_decrease_speed(void) { + rgblight_decrease_speed_helper(true); +} +void rgblight_decrease_speed_noeeprom(void) { + rgblight_decrease_speed_helper(false); +} void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { if (rgblight_config.enable) { @@ -478,7 +534,7 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } else { // all LEDs in same color - if (1 == 0) { // dummy + if (1 == 0) { // dummy } #ifdef RGBLIGHT_EFFECT_BREATHING else if (rgblight_status.base_mode == RGBLIGHT_MODE_BREATHING) { @@ -540,33 +596,51 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w } } -void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, true); } +void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val) { + rgblight_sethsv_eeprom_helper(hue, sat, val, true); +} -void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } +void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { + rgblight_sethsv_eeprom_helper(hue, sat, val, false); +} -uint8_t rgblight_get_speed(void) { return rgblight_config.speed; } +uint8_t rgblight_get_speed(void) { + return rgblight_config.speed; +} void rgblight_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { rgblight_config.speed = speed; if (write_to_eeprom) { - eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this dprintf("rgblight set speed [EEPROM]: %u\n", rgblight_config.speed); } else { dprintf("rgblight set speed [NOEEPROM]: %u\n", rgblight_config.speed); } } -void rgblight_set_speed(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, true); } +void rgblight_set_speed(uint8_t speed) { + rgblight_set_speed_eeprom_helper(speed, true); +} -void rgblight_set_speed_noeeprom(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, false); } +void rgblight_set_speed_noeeprom(uint8_t speed) { + rgblight_set_speed_eeprom_helper(speed, false); +} -uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } +uint8_t rgblight_get_hue(void) { + return rgblight_config.hue; +} -uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } +uint8_t rgblight_get_sat(void) { + return rgblight_config.sat; +} -uint8_t rgblight_get_val(void) { return rgblight_config.val; } +uint8_t rgblight_get_val(void) { + return rgblight_config.val; +} -HSV rgblight_get_hsv(void) { return (HSV){rgblight_config.hue, rgblight_config.sat, rgblight_config.val}; } +HSV rgblight_get_hsv(void) { + return (HSV){rgblight_config.hue, rgblight_config.sat, rgblight_config.val}; +} void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { if (!rgblight_config.enable) { @@ -648,14 +722,22 @@ void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, } #ifndef RGBLIGHT_SPLIT -void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, 0, (uint8_t)RGBLED_NUM / 2); } +void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b) { + rgblight_setrgb_range(r, g, b, 0, (uint8_t)RGBLED_NUM / 2); +} -void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } +void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { + rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); +} -void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, 0, (uint8_t)RGBLED_NUM / 2); } +void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { + rgblight_sethsv_range(hue, sat, val, 0, (uint8_t)RGBLED_NUM / 2); +} -void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } -#endif // ifndef RGBLIGHT_SPLIT +void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { + rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); +} +#endif // ifndef RGBLIGHT_SPLIT #ifdef RGBLIGHT_LAYERS void rgblight_set_layer_state(uint8_t layer, bool enabled) { @@ -693,18 +775,18 @@ static void rgblight_layers_write(void) { // For each layer for (const rgblight_segment_t *const *layer_ptr = rgblight_layers; i < RGBLIGHT_MAX_LAYERS; layer_ptr++, i++) { if (!rgblight_get_layer_state(i)) { - continue; // Layer is disabled + continue; // Layer is disabled } const rgblight_segment_t *segment_ptr = pgm_read_ptr(layer_ptr); if (segment_ptr == NULL) { - break; // No more layers + break; // No more layers } // For each segment while (1) { rgblight_segment_t segment; memcpy_P(&segment, segment_ptr, sizeof(rgblight_segment_t)); if (segment.index == RGBLIGHT_END_SEGMENT_INDEX) { - break; // No more segments + break; // No more segments } // Write segment.count LEDs LED_TYPE *const limit = &led[MIN(segment.index + segment.count, RGBLED_NUM)]; @@ -726,7 +808,9 @@ static uint16_t _repeat_timer; static uint8_t _times_remaining; static uint16_t _dur; -void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) { rgblight_blink_layer_repeat(layer, duration_ms, 1); } +void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) { + rgblight_blink_layer_repeat(layer, duration_ms, 1); +} void rgblight_blink_layer_repeat(uint8_t layer, uint16_t duration_ms, uint8_t times) { _times_remaining = times * 2; @@ -796,7 +880,9 @@ void rgblight_wakeup(void) { #endif -__attribute__((weak)) void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { ws2812_setleds(start_led, num_leds); } +__attribute__((weak)) void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { + ws2812_setleds(start_led, num_leds); +} #ifndef RGBLIGHT_CUSTOM_DRIVER @@ -848,9 +934,13 @@ void rgblight_set(void) { #ifdef RGBLIGHT_SPLIT /* for split keyboard master side */ -uint8_t rgblight_get_change_flags(void) { return rgblight_status.change_flags; } +uint8_t rgblight_get_change_flags(void) { + return rgblight_status.change_flags; +} -void rgblight_clear_change_flags(void) { rgblight_status.change_flags = 0; } +void rgblight_clear_change_flags(void) { + rgblight_status.change_flags = 0; +} void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo) { syncinfo->config = rgblight_config; @@ -866,7 +956,7 @@ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) { # endif if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_MODE) { if (syncinfo->config.enable) { - rgblight_config.enable = 1; // == rgblight_enable_noeeprom(); + rgblight_config.enable = 1; // == rgblight_enable_noeeprom(); rgblight_mode_eeprom_helper(syncinfo->config.mode, write_to_eeprom); } else { rgblight_disable_noeeprom(); @@ -945,12 +1035,12 @@ static void rgblight_effect_dummy(animation_status_t *anim) { void rgblight_task(void) { if (rgblight_status.timer_enabled) { effect_func_t effect_func = rgblight_effect_dummy; - uint16_t interval_time = 2000; // dummy interval + uint16_t interval_time = 2000; // dummy interval uint8_t delta = rgblight_config.mode - rgblight_status.base_mode; animation_status.delta = delta; // static light mode, do nothing here - if (1 == 0) { // dummy + if (1 == 0) { // dummy } # ifdef RGBLIGHT_EFFECT_BREATHING else if (rgblight_status.base_mode == RGBLIGHT_MODE_BREATHING) { @@ -1016,7 +1106,7 @@ void rgblight_task(void) { if (animation_status.restart) { animation_status.restart = false; animation_status.last_timer = sync_timer_read(); - animation_status.pos16 = 0; // restart signal to local each effect + animation_status.pos16 = 0; // restart signal to local each effect } uint16_t now = sync_timer_read(); if (timer_expired(now, animation_status.last_timer)) { @@ -1055,7 +1145,7 @@ void rgblight_task(void) { # ifndef RGBLIGHT_EFFECT_BREATHE_CENTER # ifndef RGBLIGHT_BREATHE_TABLE_SIZE -# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256 or 128 or 64 +# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256 or 128 or 64 # endif # include # endif @@ -1131,7 +1221,7 @@ void rgblight_effect_snake(animation_status_t *anim) { } # if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) - if (anim->pos == 0) { // restart signal + if (anim->pos == 0) { // restart signal if (increment == 1) { pos = rgblight_ranges.effect_num_leds - 1; } else { @@ -1194,7 +1284,7 @@ void rgblight_effect_knight(animation_status_t *anim) { uint8_t i, cur; # if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) - if (anim->pos == 0) { // restart signal + if (anim->pos == 0) { // restart signal anim->pos = 1; low_bound = 0; high_bound = RGBLIGHT_EFFECT_KNIGHT_LENGTH - 1; @@ -1347,8 +1437,12 @@ void rgblight_effect_twinkle(animation_status_t *anim) { const uint8_t bottom = breathe_calc(0); const uint8_t top = breathe_calc(127); - uint8_t frac(uint8_t n, uint8_t d) { return (uint16_t)255 * n / d; } - uint8_t scale(uint16_t v, uint8_t scale) { return (v * scale) >> 8; } + uint8_t frac(uint8_t n, uint8_t d) { + return (uint16_t)255 * n / d; + } + uint8_t scale(uint16_t v, uint8_t scale) { + return (v * scale) >> 8; + } for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) { TwinkleState *t = &(led_twinkle_state[i]); diff --git a/quantum/rgblight/rgblight.h b/quantum/rgblight/rgblight.h index 5b90b8f49e0f..7076dc41ac8f 100644 --- a/quantum/rgblight/rgblight.h +++ b/quantum/rgblight/rgblight.h @@ -119,7 +119,7 @@ enum RGBLIGHT_EFFECT_MODE { // sample: #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 #ifndef RGBLIGHT_EFFECT_BREATHE_MAX -# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 +# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 #endif #ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH @@ -177,8 +177,8 @@ enum RGBLIGHT_EFFECT_MODE { #ifdef RGBLIGHT_LAYERS typedef struct { - uint8_t index; // The first LED to light - uint8_t count; // The number of LEDs to light + uint8_t index; // The first LED to light + uint8_t count; // The number of LEDs to light uint8_t hue; uint8_t sat; uint8_t val; @@ -241,7 +241,7 @@ typedef union { uint8_t hue : 8; uint8_t sat : 8; uint8_t val : 8; - uint8_t speed : 8; // EECONFIG needs to be increased to support this + uint8_t speed : 8; // EECONFIG needs to be increased to support this }; } rgblight_config_t; @@ -271,7 +271,7 @@ extern rgblight_ranges_t rgblight_ranges; /* === Utility Functions ===*/ void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); -void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check +void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); /* === Low level Functions === */ diff --git a/quantum/ring_buffer.h b/quantum/ring_buffer.h index 284745ca8e03..85419de11b80 100644 --- a/quantum/ring_buffer.h +++ b/quantum/ring_buffer.h @@ -36,9 +36,13 @@ static inline uint8_t rbuf_dequeue(void) { } static inline bool rbuf_has_data(void) { bool has_data; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { has_data = (rbuf_head != rbuf_tail); } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + has_data = (rbuf_head != rbuf_tail); + } return has_data; } static inline void rbuf_clear(void) { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { rbuf_head = rbuf_tail = 0; } + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + rbuf_head = rbuf_tail = 0; + } } diff --git a/quantum/send_string.c b/quantum/send_string.c index 1a7f7a1315ac..0de12ba12d05 100644 --- a/quantum/send_string.c +++ b/quantum/send_string.c @@ -142,9 +142,13 @@ __attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // Note: we bit-pack in "reverse" order to optimize loading #define PGM_LOADBIT(mem, pos) ((pgm_read_byte(&((mem)[(pos) / 8])) >> ((pos) % 8)) & 0x01) -void send_string(const char *str) { send_string_with_delay(str, 0); } +void send_string(const char *str) { + send_string_with_delay(str, 0); +} -void send_string_P(const char *str) { send_string_with_delay_P(str, 0); } +void send_string_P(const char *str) { + send_string_with_delay_P(str, 0); +} void send_string_with_delay(const char *str, uint8_t interval) { while (1) { @@ -173,7 +177,8 @@ void send_string_with_delay(const char *str, uint8_t interval) { ms += keycode - '0'; keycode = *(++str); } - while (ms--) wait_ms(1); + while (ms--) + wait_ms(1); } } else { send_char(ascii_code); @@ -182,7 +187,8 @@ void send_string_with_delay(const char *str, uint8_t interval) { // interval { uint8_t ms = interval; - while (ms--) wait_ms(1); + while (ms--) + wait_ms(1); } } } @@ -214,7 +220,8 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { ms += keycode - '0'; keycode = pgm_read_byte(++str); } - while (ms--) wait_ms(1); + while (ms--) + wait_ms(1); } } else { send_char(ascii_code); @@ -223,14 +230,15 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { // interval { uint8_t ms = interval; - while (ms--) wait_ms(1); + while (ms--) + wait_ms(1); } } } void send_char(char ascii_code) { #if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL) - if (ascii_code == '\a') { // BEL + if (ascii_code == '\a') { // BEL PLAY_SONG(bell_song); return; } diff --git a/quantum/sequencer/sequencer.c b/quantum/sequencer/sequencer.c index 18a83661ec87..2e92f7b3ebfe 100644 --- a/quantum/sequencer/sequencer.c +++ b/quantum/sequencer/sequencer.c @@ -25,16 +25,18 @@ #endif sequencer_config_t sequencer_config = { - false, // enabled - {false}, // steps - {0}, // track notes - 60, // tempo - SQ_RES_4, // resolution + false, // enabled + {false}, // steps + {0}, // track notes + 60, // tempo + SQ_RES_4, // resolution }; sequencer_state_t sequencer_internal_state = {0, 0, 0, 0, SEQUENCER_PHASE_ATTACK}; -bool is_sequencer_on(void) { return sequencer_config.enabled; } +bool is_sequencer_on(void) { + return sequencer_config.enabled; +} void sequencer_on(void) { dprintln("sequencer on"); @@ -65,7 +67,9 @@ void sequencer_set_track_notes(const uint16_t track_notes[SEQUENCER_TRACKS]) { } } -bool is_sequencer_track_active(uint8_t track) { return (sequencer_internal_state.active_tracks >> track) & true; } +bool is_sequencer_track_active(uint8_t track) { + return (sequencer_internal_state.active_tracks >> track) & true; +} void sequencer_set_track_activation(uint8_t track, bool value) { if (value) { @@ -76,7 +80,9 @@ void sequencer_set_track_activation(uint8_t track, bool value) { dprintf("sequencer: track %d is %s\n", track, value ? "active" : "inactive"); } -void sequencer_toggle_track_activation(uint8_t track) { sequencer_set_track_activation(track, !is_sequencer_track_active(track)); } +void sequencer_toggle_track_activation(uint8_t track) { + sequencer_set_track_activation(track, !is_sequencer_track_active(track)); +} void sequencer_toggle_single_active_track(uint8_t track) { if (is_sequencer_track_active(track)) { @@ -86,9 +92,13 @@ void sequencer_toggle_single_active_track(uint8_t track) { } } -bool is_sequencer_step_on(uint8_t step) { return step < SEQUENCER_STEPS && (sequencer_config.steps[step] & sequencer_internal_state.active_tracks) > 0; } +bool is_sequencer_step_on(uint8_t step) { + return step < SEQUENCER_STEPS && (sequencer_config.steps[step] & sequencer_internal_state.active_tracks) > 0; +} -bool is_sequencer_step_on_for_track(uint8_t step, uint8_t track) { return step < SEQUENCER_STEPS && (sequencer_config.steps[step] >> track) & true; } +bool is_sequencer_step_on_for_track(uint8_t step, uint8_t track) { + return step < SEQUENCER_STEPS && (sequencer_config.steps[step] >> track) & true; +} void sequencer_set_step(uint8_t step, bool value) { if (step < SEQUENCER_STEPS) { @@ -122,7 +132,9 @@ void sequencer_set_all_steps(bool value) { dprintf("sequencer: all steps are %s\n", value ? "on" : "off"); } -uint8_t sequencer_get_tempo(void) { return sequencer_config.tempo; } +uint8_t sequencer_get_tempo(void) { + return sequencer_config.tempo; +} void sequencer_set_tempo(uint8_t tempo) { if (tempo > 0) { @@ -142,9 +154,13 @@ void sequencer_increase_tempo(void) { } } -void sequencer_decrease_tempo(void) { sequencer_set_tempo(sequencer_config.tempo - 1); } +void sequencer_decrease_tempo(void) { + sequencer_set_tempo(sequencer_config.tempo - 1); +} -sequencer_resolution_t sequencer_get_resolution(void) { return sequencer_config.resolution; } +sequencer_resolution_t sequencer_get_resolution(void) { + return sequencer_config.resolution; +} void sequencer_set_resolution(sequencer_resolution_t resolution) { if (resolution >= 0 && resolution < SEQUENCER_RESOLUTIONS) { @@ -155,11 +171,17 @@ void sequencer_set_resolution(sequencer_resolution_t resolution) { } } -void sequencer_increase_resolution(void) { sequencer_set_resolution(sequencer_config.resolution + 1); } +void sequencer_increase_resolution(void) { + sequencer_set_resolution(sequencer_config.resolution + 1); +} -void sequencer_decrease_resolution(void) { sequencer_set_resolution(sequencer_config.resolution - 1); } +void sequencer_decrease_resolution(void) { + sequencer_set_resolution(sequencer_config.resolution - 1); +} -uint8_t sequencer_get_current_step(void) { return sequencer_internal_state.current_step; } +uint8_t sequencer_get_current_step(void) { + return sequencer_internal_state.current_step; +} void sequencer_phase_attack(void) { dprintf("sequencer: step %d\n", sequencer_internal_state.current_step); @@ -229,9 +251,13 @@ void sequencer_task(void) { } } -uint16_t sequencer_get_beat_duration(void) { return get_beat_duration(sequencer_config.tempo); } +uint16_t sequencer_get_beat_duration(void) { + return get_beat_duration(sequencer_config.tempo); +} -uint16_t sequencer_get_step_duration(void) { return get_step_duration(sequencer_config.tempo, sequencer_config.resolution); } +uint16_t sequencer_get_step_duration(void) { + return get_step_duration(sequencer_config.tempo, sequencer_config.resolution); +} uint16_t get_beat_duration(uint8_t tempo) { // Don’t crash in the unlikely case where the given tempo is 0 diff --git a/quantum/sequencer/sequencer.h b/quantum/sequencer/sequencer.h index 4017ae764efc..a8ea16eece6c 100644 --- a/quantum/sequencer/sequencer.h +++ b/quantum/sequencer/sequencer.h @@ -48,7 +48,7 @@ typedef struct { bool enabled; uint8_t steps[SEQUENCER_STEPS]; uint16_t track_notes[SEQUENCER_TRACKS]; - uint8_t tempo; // Is a maximum tempo of 255 reasonable? + uint8_t tempo; // Is a maximum tempo of 255 reasonable? sequencer_resolution_t resolution; } sequencer_config_t; @@ -57,9 +57,9 @@ typedef struct { * We use a "phase" state machine to delay some of the events. */ typedef enum sequencer_phase_t { - SEQUENCER_PHASE_ATTACK, // t=0ms, send the MIDI note on signal - SEQUENCER_PHASE_RELEASE, // t=SEQUENCER_PHASE_RELEASE_TIMEOUT ms, send the MIDI note off signal - SEQUENCER_PHASE_PAUSE // t=step duration ms, loop + SEQUENCER_PHASE_ATTACK, // t=0ms, send the MIDI note on signal + SEQUENCER_PHASE_RELEASE, // t=SEQUENCER_PHASE_RELEASE_TIMEOUT ms, send the MIDI note off signal + SEQUENCER_PHASE_PAUSE // t=step duration ms, loop } sequencer_phase_t; typedef struct { diff --git a/quantum/sequencer/tests/midi_mock.c b/quantum/sequencer/tests/midi_mock.c index 236e16f9d70e..5bd945d615c0 100644 --- a/quantum/sequencer/tests/midi_mock.c +++ b/quantum/sequencer/tests/midi_mock.c @@ -19,8 +19,14 @@ uint16_t last_noteon = 0; uint16_t last_noteoff = 0; -uint16_t midi_compute_note(uint16_t keycode) { return keycode; } +uint16_t midi_compute_note(uint16_t keycode) { + return keycode; +} -void process_midi_basic_noteon(uint16_t note) { last_noteon = note; } +void process_midi_basic_noteon(uint16_t note) { + last_noteon = note; +} -void process_midi_basic_noteoff(uint16_t note) { last_noteoff = note; } +void process_midi_basic_noteoff(uint16_t note) { + last_noteoff = note; +} diff --git a/quantum/sequencer/tests/sequencer_tests.cpp b/quantum/sequencer/tests/sequencer_tests.cpp index 290605a52a4f..05e58e41111f 100644 --- a/quantum/sequencer/tests/sequencer_tests.cpp +++ b/quantum/sequencer/tests/sequencer_tests.cpp @@ -78,7 +78,9 @@ class SequencerTest : public ::testing::Test { sequencer_state_t state_copy; }; -TEST_F(SequencerTest, TestOffByDefault) { EXPECT_EQ(is_sequencer_on(), false); } +TEST_F(SequencerTest, TestOffByDefault) { + EXPECT_EQ(is_sequencer_on(), false); +} TEST_F(SequencerTest, TestOn) { sequencer_config.enabled = false; diff --git a/quantum/split_common/post_config.h b/quantum/split_common/post_config.h index a4c0a1956b8a..8f79beb6eda6 100644 --- a/quantum/split_common/post_config.h +++ b/quantum/split_common/post_config.h @@ -5,6 +5,6 @@ # endif # ifndef F_SCL -# define F_SCL 100000UL // SCL frequency +# define F_SCL 100000UL // SCL frequency # endif #endif diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 35f0a9d181dd..7d50adf758fb 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -43,14 +43,14 @@ // Set to 0 to disable the disconnection check altogether. #ifndef SPLIT_MAX_CONNECTION_ERRORS # define SPLIT_MAX_CONNECTION_ERRORS 10 -#endif // SPLIT_MAX_CONNECTION_ERRORS +#endif // SPLIT_MAX_CONNECTION_ERRORS // How long (in milliseconds) to block all connection attempts after the communication has been flagged as disconnected. // One communication attempt will be allowed everytime this amount of time has passed since the last attempt. If that attempt succeeds, the communication is seen as working again. // Set to 0 to disable communication throttling while disconnected #ifndef SPLIT_CONNECTION_CHECK_TIMEOUT # define SPLIT_CONNECTION_CHECK_TIMEOUT 500 -#endif // SPLIT_CONNECTION_CHECK_TIMEOUT +#endif // SPLIT_CONNECTION_CHECK_TIMEOUT static uint8_t connection_errors = 0; @@ -68,7 +68,9 @@ static bool usbIsActive(void) { return false; } #else -static inline bool usbIsActive(void) { return usb_vbus_state(); } +static inline bool usbIsActive(void) { + return usb_vbus_state(); +} #endif #ifdef SPLIT_HAND_MATRIX_GRID @@ -83,7 +85,7 @@ static uint8_t peek_matrix_intersection(pin_t out_pin, pin_t in_pin) { uint8_t pin_state = readPin(in_pin); // Set out_pin to a setting that is less susceptible to noise. setPinInputHigh(out_pin); - matrix_io_delay(); // Wait for the pull-up to go HIGH. + matrix_io_delay(); // Wait for the pull-up to go HIGH. return pin_state; } #endif @@ -158,7 +160,9 @@ void split_post_init(void) { } } -bool is_transport_connected(void) { return connection_errors < SPLIT_MAX_CONNECTION_ERRORS; } +bool is_transport_connected(void) { + return connection_errors < SPLIT_MAX_CONNECTION_ERRORS; +} bool transport_master_if_connected(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { #if SPLIT_MAX_CONNECTION_ERRORS > 0 && SPLIT_CONNECTION_CHECK_TIMEOUT > 0 @@ -169,7 +173,7 @@ bool transport_master_if_connected(matrix_row_t master_matrix[], matrix_row_t sl if (is_disconnected && timer_elapsed(connection_check_timer) < SPLIT_CONNECTION_CHECK_TIMEOUT) { return false; } -#endif // SPLIT_MAX_CONNECTION_ERRORS > 0 && SPLIT_CONNECTION_CHECK_TIMEOUT > 0 +#endif // SPLIT_MAX_CONNECTION_ERRORS > 0 && SPLIT_CONNECTION_CHECK_TIMEOUT > 0 __attribute__((unused)) bool okay = transport_master(master_matrix, slave_matrix); #if SPLIT_MAX_CONNECTION_ERRORS > 0 @@ -186,10 +190,10 @@ bool transport_master_if_connected(matrix_row_t master_matrix[], matrix_row_t sl return connected; } else if (is_disconnected) { dprintln("Target connected"); -# endif // SPLIT_CONNECTION_CHECK_TIMEOUT > 0 +# endif // SPLIT_CONNECTION_CHECK_TIMEOUT > 0 } connection_errors = 0; -#endif // SPLIT_MAX_CONNECTION_ERRORS > 0 +#endif // SPLIT_MAX_CONNECTION_ERRORS > 0 return true; } diff --git a/quantum/split_common/split_util.h b/quantum/split_common/split_util.h index ef72043bb786..c7eabea23324 100644 --- a/quantum/split_common/split_util.h +++ b/quantum/split_common/split_util.h @@ -2,7 +2,6 @@ #include #include -#include #include #include "matrix.h" diff --git a/quantum/split_common/transaction_id_define.h b/quantum/split_common/transaction_id_define.h index 535bc21aeaa1..761a8884f4ec 100644 --- a/quantum/split_common/transaction_id_define.h +++ b/quantum/split_common/transaction_id_define.h @@ -19,81 +19,87 @@ enum serial_transaction_id { #ifdef USE_I2C I2C_EXECUTE_CALLBACK, -#endif // USE_I2C +#endif // USE_I2C GET_SLAVE_MATRIX_CHECKSUM, GET_SLAVE_MATRIX_DATA, #ifdef SPLIT_TRANSPORT_MIRROR PUT_MASTER_MATRIX, -#endif // SPLIT_TRANSPORT_MIRROR +#endif // SPLIT_TRANSPORT_MIRROR #ifdef ENCODER_ENABLE GET_ENCODERS_CHECKSUM, GET_ENCODERS_DATA, -#endif // ENCODER_ENABLE +#endif // ENCODER_ENABLE #ifndef DISABLE_SYNC_TIMER PUT_SYNC_TIMER, -#endif // DISABLE_SYNC_TIMER +#endif // DISABLE_SYNC_TIMER #if !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) PUT_LAYER_STATE, PUT_DEFAULT_LAYER_STATE, -#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) +#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) #ifdef SPLIT_LED_STATE_ENABLE PUT_LED_STATE, -#endif // SPLIT_LED_STATE_ENABLE +#endif // SPLIT_LED_STATE_ENABLE #ifdef SPLIT_MODS_ENABLE PUT_MODS, -#endif // SPLIT_MODS_ENABLE +#endif // SPLIT_MODS_ENABLE #ifdef BACKLIGHT_ENABLE PUT_BACKLIGHT, -#endif // BACKLIGHT_ENABLE +#endif // BACKLIGHT_ENABLE #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) PUT_RGBLIGHT, -#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) +#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) PUT_LED_MATRIX, -#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) +#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) PUT_RGB_MATRIX, -#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) +#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) #if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) PUT_WPM, -#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) +#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) #if defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) PUT_OLED, -#endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) +#endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) #if defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) PUT_ST7565, -#endif // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) +#endif // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) + +#if defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) + GET_POINTING_CHECKSUM, + GET_POINTING_DATA, + PUT_POINTING_CPI, +#endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) PUT_RPC_INFO, PUT_RPC_REQ_DATA, EXECUTE_RPC, GET_RPC_RESP_DATA, -#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) // keyboard-specific #ifdef SPLIT_TRANSACTION_IDS_KB SPLIT_TRANSACTION_IDS_KB, -#endif // SPLIT_TRANSACTION_IDS_KB +#endif // SPLIT_TRANSACTION_IDS_KB // user/keymap-specific #ifdef SPLIT_TRANSACTION_IDS_USER SPLIT_TRANSACTION_IDS_USER, -#endif // SPLIT_TRANSACTION_IDS_USER +#endif // SPLIT_TRANSACTION_IDS_USER NUM_TOTAL_TRANSACTIONS }; diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c index 3ff87710e7e4..cffbccaeee2f 100644 --- a/quantum/split_common/transactions.c +++ b/quantum/split_common/transactions.c @@ -30,16 +30,16 @@ #ifndef FORCED_SYNC_THROTTLE_MS # define FORCED_SYNC_THROTTLE_MS 100 -#endif // FORCED_SYNC_THROTTLE_MS +#endif // FORCED_SYNC_THROTTLE_MS #define sizeof_member(type, member) sizeof(((type *)NULL)->member) #define trans_initiator2target_initializer_cb(member, cb) \ - { &dummy, sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), 0, 0, cb } + { sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), 0, 0, cb } #define trans_initiator2target_initializer(member) trans_initiator2target_initializer_cb(member, NULL) #define trans_target2initiator_initializer_cb(member, cb) \ - { &dummy, 0, 0, sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), cb } + { 0, 0, sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), cb } #define trans_target2initiator_initializer(member) trans_target2initiator_initializer_cb(member, NULL) #define transport_write(id, data, length) transport_execute_transaction(id, data, length, NULL, 0) @@ -49,7 +49,7 @@ // Forward-declare the RPC callback handlers void slave_rpc_info_callback(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer); void slave_rpc_exec_callback(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer); -#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) //////////////////////////////////////////////////// // Helpers @@ -63,7 +63,9 @@ static bool transaction_handler_master(matrix_row_t master_matrix[], matrix_row_ } } bool this_okay = true; - ATOMIC_BLOCK_FORCEON { this_okay = handler(master_matrix, slave_matrix); }; + ATOMIC_BLOCK_FORCEON { + this_okay = handler(master_matrix, slave_matrix); + }; if (this_okay) return true; } dprintf("Failed to execute %s\n", prefix); @@ -75,9 +77,11 @@ static bool transaction_handler_master(matrix_row_t master_matrix[], matrix_row_ if (!transaction_handler_master(master_matrix, slave_matrix, #prefix, &prefix##_handlers_master)) return false; \ } while (0) -#define TRANSACTION_HANDLER_SLAVE(prefix) \ - do { \ - ATOMIC_BLOCK_FORCEON { prefix##_handlers_slave(master_matrix, slave_matrix); }; \ +#define TRANSACTION_HANDLER_SLAVE(prefix) \ + do { \ + ATOMIC_BLOCK_FORCEON { \ + prefix##_handlers_slave(master_matrix, slave_matrix); \ + }; \ } while (0) inline static bool read_if_checksum_mismatch(int8_t trans_id_checksum, int8_t trans_id_retrieve, uint32_t *last_update, void *destination, const void *equiv_shmem, size_t length) { @@ -116,8 +120,8 @@ inline static bool send_if_data_mismatch(int8_t trans_id, uint32_t *last_update, static bool slave_matrix_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { static uint32_t last_update = 0; - static matrix_row_t last_matrix[(MATRIX_ROWS) / 2] = {0}; // last successfully-read matrix, so we can replicate if there are checksum errors - matrix_row_t temp_matrix[(MATRIX_ROWS) / 2]; // holding area while we test whether or not checksum is correct + static matrix_row_t last_matrix[(MATRIX_ROWS) / 2] = {0}; // last successfully-read matrix, so we can replicate if there are checksum errors + matrix_row_t temp_matrix[(MATRIX_ROWS) / 2]; // holding area while we test whether or not checksum is correct bool okay = read_if_checksum_mismatch(GET_SLAVE_MATRIX_CHECKSUM, GET_SLAVE_MATRIX_DATA, &last_update, temp_matrix, split_shmem->smatrix.matrix, sizeof(split_shmem->smatrix.matrix)); if (okay) { @@ -161,13 +165,13 @@ static void master_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_ro # define TRANSACTIONS_MASTER_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE(master_matrix) # define TRANSACTIONS_MASTER_MATRIX_REGISTRATIONS [PUT_MASTER_MATRIX] = trans_initiator2target_initializer(mmatrix.matrix), -#else // SPLIT_TRANSPORT_MIRROR +#else // SPLIT_TRANSPORT_MIRROR # define TRANSACTIONS_MASTER_MATRIX_MASTER() # define TRANSACTIONS_MASTER_MATRIX_SLAVE() # define TRANSACTIONS_MASTER_MATRIX_REGISTRATIONS -#endif // SPLIT_TRANSPORT_MIRROR +#endif // SPLIT_TRANSPORT_MIRROR //////////////////////////////////////////////////// // Encoders @@ -200,13 +204,13 @@ static void encoder_handlers_slave(matrix_row_t master_matrix[], matrix_row_t sl [GET_ENCODERS_DATA] = trans_target2initiator_initializer(encoders.state), // clang-format on -#else // ENCODER_ENABLE +#else // ENCODER_ENABLE # define TRANSACTIONS_ENCODERS_MASTER() # define TRANSACTIONS_ENCODERS_SLAVE() # define TRANSACTIONS_ENCODERS_REGISTRATIONS -#endif // ENCODER_ENABLE +#endif // ENCODER_ENABLE //////////////////////////////////////////////////// // Sync timer @@ -239,13 +243,13 @@ static void sync_timer_handlers_slave(matrix_row_t master_matrix[], matrix_row_t # define TRANSACTIONS_SYNC_TIMER_SLAVE() TRANSACTION_HANDLER_SLAVE(sync_timer) # define TRANSACTIONS_SYNC_TIMER_REGISTRATIONS [PUT_SYNC_TIMER] = trans_initiator2target_initializer(sync_timer), -#else // DISABLE_SYNC_TIMER +#else // DISABLE_SYNC_TIMER # define TRANSACTIONS_SYNC_TIMER_MASTER() # define TRANSACTIONS_SYNC_TIMER_SLAVE() # define TRANSACTIONS_SYNC_TIMER_REGISTRATIONS -#endif // DISABLE_SYNC_TIMER +#endif // DISABLE_SYNC_TIMER //////////////////////////////////////////////////// // Layer state @@ -276,13 +280,13 @@ static void layer_state_handlers_slave(matrix_row_t master_matrix[], matrix_row_ [PUT_DEFAULT_LAYER_STATE] = trans_initiator2target_initializer(layers.default_layer_state), // clang-format on -#else // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) +#else // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) # define TRANSACTIONS_LAYER_STATE_MASTER() # define TRANSACTIONS_LAYER_STATE_SLAVE() # define TRANSACTIONS_LAYER_STATE_REGISTRATIONS -#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) +#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) //////////////////////////////////////////////////// // LED state @@ -304,13 +308,13 @@ static void led_state_handlers_slave(matrix_row_t master_matrix[], matrix_row_t # define TRANSACTIONS_LED_STATE_SLAVE() TRANSACTION_HANDLER_SLAVE(led_state) # define TRANSACTIONS_LED_STATE_REGISTRATIONS [PUT_LED_STATE] = trans_initiator2target_initializer(led_state), -#else // SPLIT_LED_STATE_ENABLE +#else // SPLIT_LED_STATE_ENABLE # define TRANSACTIONS_LED_STATE_MASTER() # define TRANSACTIONS_LED_STATE_SLAVE() # define TRANSACTIONS_LED_STATE_REGISTRATIONS -#endif // SPLIT_LED_STATE_ENABLE +#endif // SPLIT_LED_STATE_ENABLE //////////////////////////////////////////////////// // Mods @@ -336,7 +340,7 @@ static bool mods_handlers_master(matrix_row_t master_matrix[], matrix_row_t slav if (!mods_need_sync && new_mods.oneshot_mods != split_shmem->mods.oneshot_mods) { mods_need_sync = true; } -# endif // NO_ACTION_ONESHOT +# endif // NO_ACTION_ONESHOT bool okay = true; if (mods_need_sync) { @@ -361,13 +365,13 @@ static void mods_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave # define TRANSACTIONS_MODS_SLAVE() TRANSACTION_HANDLER_SLAVE(mods) # define TRANSACTIONS_MODS_REGISTRATIONS [PUT_MODS] = trans_initiator2target_initializer(mods), -#else // SPLIT_MODS_ENABLE +#else // SPLIT_MODS_ENABLE # define TRANSACTIONS_MODS_MASTER() # define TRANSACTIONS_MODS_SLAVE() # define TRANSACTIONS_MODS_REGISTRATIONS -#endif // SPLIT_MODS_ENABLE +#endif // SPLIT_MODS_ENABLE //////////////////////////////////////////////////// // Backlight @@ -380,19 +384,21 @@ static bool backlight_handlers_master(matrix_row_t master_matrix[], matrix_row_t return send_if_condition(PUT_BACKLIGHT, &last_update, (level != split_shmem->backlight_level), &level, sizeof(level)); } -static void backlight_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { backlight_set(split_shmem->backlight_level); } +static void backlight_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + backlight_set(split_shmem->backlight_level); +} # define TRANSACTIONS_BACKLIGHT_MASTER() TRANSACTION_HANDLER_MASTER(backlight) # define TRANSACTIONS_BACKLIGHT_SLAVE() TRANSACTION_HANDLER_SLAVE(backlight) # define TRANSACTIONS_BACKLIGHT_REGISTRATIONS [PUT_BACKLIGHT] = trans_initiator2target_initializer(backlight_level), -#else // BACKLIGHT_ENABLE +#else // BACKLIGHT_ENABLE # define TRANSACTIONS_BACKLIGHT_MASTER() # define TRANSACTIONS_BACKLIGHT_SLAVE() # define TRANSACTIONS_BACKLIGHT_REGISTRATIONS -#endif // BACKLIGHT_ENABLE +#endif // BACKLIGHT_ENABLE //////////////////////////////////////////////////// // RGBLIGHT @@ -423,13 +429,13 @@ static void rgblight_handlers_slave(matrix_row_t master_matrix[], matrix_row_t s # define TRANSACTIONS_RGBLIGHT_SLAVE() TRANSACTION_HANDLER_SLAVE(rgblight) # define TRANSACTIONS_RGBLIGHT_REGISTRATIONS [PUT_RGBLIGHT] = trans_initiator2target_initializer(rgblight_sync), -#else // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) +#else // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) # define TRANSACTIONS_RGBLIGHT_MASTER() # define TRANSACTIONS_RGBLIGHT_SLAVE() # define TRANSACTIONS_RGBLIGHT_REGISTRATIONS -#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) +#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) //////////////////////////////////////////////////// // LED Matrix @@ -453,13 +459,13 @@ static void led_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_row_t # define TRANSACTIONS_LED_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE(led_matrix) # define TRANSACTIONS_LED_MATRIX_REGISTRATIONS [PUT_LED_MATRIX] = trans_initiator2target_initializer(led_matrix_sync), -#else // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) +#else // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) # define TRANSACTIONS_LED_MATRIX_MASTER() # define TRANSACTIONS_LED_MATRIX_SLAVE() # define TRANSACTIONS_LED_MATRIX_REGISTRATIONS -#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) +#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) //////////////////////////////////////////////////// // RGB Matrix @@ -483,13 +489,13 @@ static void rgb_matrix_handlers_slave(matrix_row_t master_matrix[], matrix_row_t # define TRANSACTIONS_RGB_MATRIX_SLAVE() TRANSACTION_HANDLER_SLAVE(rgb_matrix) # define TRANSACTIONS_RGB_MATRIX_REGISTRATIONS [PUT_RGB_MATRIX] = trans_initiator2target_initializer(rgb_matrix_sync), -#else // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) +#else // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) # define TRANSACTIONS_RGB_MATRIX_MASTER() # define TRANSACTIONS_RGB_MATRIX_SLAVE() # define TRANSACTIONS_RGB_MATRIX_REGISTRATIONS -#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) +#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) //////////////////////////////////////////////////// // WPM @@ -502,19 +508,21 @@ static bool wpm_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave return send_if_condition(PUT_WPM, &last_update, (current_wpm != split_shmem->current_wpm), ¤t_wpm, sizeof(current_wpm)); } -static void wpm_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { set_current_wpm(split_shmem->current_wpm); } +static void wpm_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + set_current_wpm(split_shmem->current_wpm); +} # define TRANSACTIONS_WPM_MASTER() TRANSACTION_HANDLER_MASTER(wpm) # define TRANSACTIONS_WPM_SLAVE() TRANSACTION_HANDLER_SLAVE(wpm) # define TRANSACTIONS_WPM_REGISTRATIONS [PUT_WPM] = trans_initiator2target_initializer(current_wpm), -#else // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) +#else // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) # define TRANSACTIONS_WPM_MASTER() # define TRANSACTIONS_WPM_SLAVE() # define TRANSACTIONS_WPM_REGISTRATIONS -#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) +#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) //////////////////////////////////////////////////// // OLED @@ -539,13 +547,13 @@ static void oled_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave # define TRANSACTIONS_OLED_SLAVE() TRANSACTION_HANDLER_SLAVE(oled) # define TRANSACTIONS_OLED_REGISTRATIONS [PUT_OLED] = trans_initiator2target_initializer(current_oled_state), -#else // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) +#else // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) # define TRANSACTIONS_OLED_MASTER() # define TRANSACTIONS_OLED_SLAVE() # define TRANSACTIONS_OLED_REGISTRATIONS -#endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) +#endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) //////////////////////////////////////////////////// // ST7565 @@ -570,24 +578,101 @@ static void st7565_handlers_slave(matrix_row_t master_matrix[], matrix_row_t sla # define TRANSACTIONS_ST7565_SLAVE() TRANSACTION_HANDLER_SLAVE(st7565) # define TRANSACTIONS_ST7565_REGISTRATIONS [PUT_ST7565] = trans_initiator2target_initializer(current_st7565_state), -#else // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) +#else // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) # define TRANSACTIONS_ST7565_MASTER() # define TRANSACTIONS_ST7565_SLAVE() # define TRANSACTIONS_ST7565_REGISTRATIONS -#endif // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) +#endif // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) + +//////////////////////////////////////////////////// +// POINTING + +#if defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) + +static bool pointing_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { +# if defined(POINTING_DEVICE_LEFT) + if (is_keyboard_left()) { + return true; + } +# elif defined(POINTING_DEVICE_RIGHT) + if (!is_keyboard_left()) { + return true; + } +# endif + static uint32_t last_update = 0; + static uint16_t last_cpi = 0; + report_mouse_t temp_state; + uint16_t temp_cpi; + bool okay = read_if_checksum_mismatch(GET_POINTING_CHECKSUM, GET_POINTING_DATA, &last_update, &temp_state, &split_shmem->pointing.report, sizeof(temp_state)); + if (okay) pointing_device_set_shared_report(temp_state); + temp_cpi = pointing_device_get_shared_cpi(); + if (temp_cpi && memcmp(&last_cpi, &temp_cpi, sizeof(temp_cpi)) != 0) { + memcpy(&split_shmem->pointing.cpi, &temp_cpi, sizeof(temp_cpi)); + okay = transport_write(PUT_POINTING_CPI, &split_shmem->pointing.cpi, sizeof(split_shmem->pointing.cpi)); + if (okay) { + last_cpi = temp_cpi; + } + } + return okay; +} + +extern const pointing_device_driver_t pointing_device_driver; + +static void pointing_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { +# if defined(POINTING_DEVICE_LEFT) + if (!is_keyboard_left()) { + return; + } +# elif defined(POINTING_DEVICE_RIGHT) + if (is_keyboard_left()) { + return; + } +# endif + report_mouse_t temp_report; + uint16_t temp_cpi; +# if (POINTING_DEVICE_TASK_THROTTLE_MS > 0) + static uint32_t last_exec = 0; + if (timer_elapsed32(last_exec) < POINTING_DEVICE_TASK_THROTTLE_MS) { + return; + } + last_exec = timer_read32(); +# endif + temp_cpi = !pointing_device_driver.get_cpi ? 0 : pointing_device_driver.get_cpi(); // check for NULL + if (split_shmem->pointing.cpi && memcmp(&split_shmem->pointing.cpi, &temp_cpi, sizeof(temp_cpi)) != 0) { + if (pointing_device_driver.set_cpi) { + pointing_device_driver.set_cpi(split_shmem->pointing.cpi); + } + } + memset(&temp_report, 0, sizeof(temp_report)); + temp_report = pointing_device_driver.get_report(temp_report); + memcpy(&split_shmem->pointing.report, &temp_report, sizeof(temp_report)); + // Now update the checksum given that the pointing has been written to + split_shmem->pointing.checksum = crc8(&temp_report, sizeof(temp_report)); +} + +# define TRANSACTIONS_POINTING_MASTER() TRANSACTION_HANDLER_MASTER(pointing) +# define TRANSACTIONS_POINTING_SLAVE() TRANSACTION_HANDLER_SLAVE(pointing) +# define TRANSACTIONS_POINTING_REGISTRATIONS [GET_POINTING_CHECKSUM] = trans_target2initiator_initializer(pointing.checksum), [GET_POINTING_DATA] = trans_target2initiator_initializer(pointing.report), [PUT_POINTING_CPI] = trans_initiator2target_initializer(pointing.cpi), + +#else // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) + +# define TRANSACTIONS_POINTING_MASTER() +# define TRANSACTIONS_POINTING_SLAVE() +# define TRANSACTIONS_POINTING_REGISTRATIONS + +#endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) //////////////////////////////////////////////////// -uint8_t dummy; split_transaction_desc_t split_transaction_table[NUM_TOTAL_TRANSACTIONS] = { // Set defaults - [0 ...(NUM_TOTAL_TRANSACTIONS - 1)] = {NULL, 0, 0, 0, 0, 0}, + [0 ...(NUM_TOTAL_TRANSACTIONS - 1)] = {0, 0, 0, 0, 0}, #ifdef USE_I2C [I2C_EXECUTE_CALLBACK] = trans_initiator2target_initializer(transaction_id), -#endif // USE_I2C +#endif // USE_I2C // clang-format off TRANSACTIONS_SLAVE_MATRIX_REGISTRATIONS @@ -604,6 +689,7 @@ split_transaction_desc_t split_transaction_table[NUM_TOTAL_TRANSACTIONS] = { TRANSACTIONS_WPM_REGISTRATIONS TRANSACTIONS_OLED_REGISTRATIONS TRANSACTIONS_ST7565_REGISTRATIONS + TRANSACTIONS_POINTING_REGISTRATIONS // clang-format on #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) @@ -611,7 +697,7 @@ split_transaction_desc_t split_transaction_table[NUM_TOTAL_TRANSACTIONS] = { [PUT_RPC_REQ_DATA] = trans_initiator2target_initializer(rpc_m2s_buffer), [EXECUTE_RPC] = trans_initiator2target_initializer_cb(rpc_info.transaction_id, slave_rpc_exec_callback), [GET_RPC_RESP_DATA] = trans_target2initiator_initializer(rpc_s2m_buffer), -#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) }; bool transactions_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { @@ -629,6 +715,7 @@ bool transactions_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix TRANSACTIONS_WPM_MASTER(); TRANSACTIONS_OLED_MASTER(); TRANSACTIONS_ST7565_MASTER(); + TRANSACTIONS_POINTING_MASTER(); return true; } @@ -647,6 +734,7 @@ void transactions_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[ TRANSACTIONS_WPM_SLAVE(); TRANSACTIONS_OLED_SLAVE(); TRANSACTIONS_ST7565_SLAVE(); + TRANSACTIONS_POINTING_SLAVE(); } #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) @@ -720,4 +808,4 @@ void slave_rpc_exec_callback(uint8_t initiator2target_buffer_size, const void *i } } -#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) diff --git a/quantum/split_common/transactions.h b/quantum/split_common/transactions.h index 53610d6f8e85..e38ec79ce910 100644 --- a/quantum/split_common/transactions.h +++ b/quantum/split_common/transactions.h @@ -27,7 +27,6 @@ typedef void (*slave_callback_t)(uint8_t initiator2target_buffer_size, const voi // Split transaction Descriptor typedef struct _split_transaction_desc_t { - uint8_t * status; uint8_t initiator2target_buffer_size; uint16_t initiator2target_offset; uint8_t target2initiator_buffer_size; diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index bcc0261417d4..aade3c98d7a8 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -26,7 +26,7 @@ # ifndef SLAVE_I2C_TIMEOUT # define SLAVE_I2C_TIMEOUT 100 -# endif // SLAVE_I2C_TIMEOUT +# endif // SLAVE_I2C_TIMEOUT # ifndef SLAVE_I2C_ADDRESS # define SLAVE_I2C_ADDRESS 0x32 @@ -40,8 +40,12 @@ _Static_assert(sizeof(split_shared_memory_t) <= I2C_SLAVE_REG_COUNT, "split_shar split_shared_memory_t *const split_shmem = (split_shared_memory_t *)i2c_slave_reg; -void transport_master_init(void) { i2c_init(); } -void transport_slave_init(void) { i2c_slave_init(SLAVE_I2C_ADDRESS); } +void transport_master_init(void) { + i2c_init(); +} +void transport_slave_init(void) { + i2c_slave_init(SLAVE_I2C_ADDRESS); +} i2c_status_t transport_trigger_callback(int8_t id) { // If there's no callback, indicate that we were successful @@ -82,15 +86,19 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, return true; } -#else // USE_I2C +#else // USE_I2C # include "serial.h" static split_shared_memory_t shared_memory; split_shared_memory_t *const split_shmem = &shared_memory; -void transport_master_init(void) { soft_serial_initiator_init(); } -void transport_slave_init(void) { soft_serial_target_init(); } +void transport_master_init(void) { + soft_serial_initiator_init(); +} +void transport_slave_init(void) { + soft_serial_target_init(); +} bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, uint16_t initiator2target_length, void *target2initiator_buf, uint16_t target2initiator_length) { split_transaction_desc_t *trans = &split_transaction_table[id]; @@ -99,7 +107,7 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, memcpy(split_trans_initiator2target_buffer(trans), initiator2target_buf, len); } - if (soft_serial_transaction(id) != TRANSACTION_END) { + if (!soft_serial_transaction(id)) { return false; } @@ -111,8 +119,12 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, return true; } -#endif // USE_I2C +#endif // USE_I2C -bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { return transactions_master(master_matrix, slave_matrix); } +bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + return transactions_master(master_matrix, slave_matrix); +} -void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { transactions_slave(master_matrix, slave_matrix); } +void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { + transactions_slave(master_matrix, slave_matrix); +} diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h index 1d4f6ed0cd86..26bd136728ee 100644 --- a/quantum/split_common/transport.h +++ b/quantum/split_common/transport.h @@ -25,11 +25,11 @@ #ifndef RPC_M2S_BUFFER_SIZE # define RPC_M2S_BUFFER_SIZE 32 -#endif // RPC_M2S_BUFFER_SIZE +#endif // RPC_M2S_BUFFER_SIZE #ifndef RPC_S2M_BUFFER_SIZE # define RPC_S2M_BUFFER_SIZE 32 -#endif // RPC_S2M_BUFFER_SIZE +#endif // RPC_S2M_BUFFER_SIZE void transport_master_init(void); void transport_slave_init(void); @@ -43,15 +43,15 @@ bool transport_execute_transaction(int8_t id, const void *initiator2target_buf, #ifdef ENCODER_ENABLE # include "encoder.h" # define NUMBER_OF_ENCODERS (sizeof((pin_t[])ENCODERS_PAD_A) / sizeof(pin_t)) -#endif // ENCODER_ENABLE +#endif // ENCODER_ENABLE #ifdef BACKLIGHT_ENABLE # include "backlight.h" -#endif // BACKLIGHT_ENABLE +#endif // BACKLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE # include "rgblight.h" -#endif // RGBLIGHT_ENABLE +#endif // RGBLIGHT_ENABLE typedef struct _split_slave_matrix_sync_t { uint8_t checksum; @@ -62,21 +62,21 @@ typedef struct _split_slave_matrix_sync_t { typedef struct _split_master_matrix_sync_t { matrix_row_t matrix[(MATRIX_ROWS) / 2]; } split_master_matrix_sync_t; -#endif // SPLIT_TRANSPORT_MIRROR +#endif // SPLIT_TRANSPORT_MIRROR #ifdef ENCODER_ENABLE typedef struct _split_slave_encoder_sync_t { uint8_t checksum; uint8_t state[NUMBER_OF_ENCODERS]; } split_slave_encoder_sync_t; -#endif // ENCODER_ENABLE +#endif // ENCODER_ENABLE #if !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) typedef struct _split_layers_sync_t { layer_state_t layer_state; layer_state_t default_layer_state; } split_layers_sync_t; -#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) +#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) # include "led_matrix.h" @@ -85,7 +85,7 @@ typedef struct _led_matrix_sync_t { led_eeconfig_t led_matrix; bool led_suspend_state; } led_matrix_sync_t; -#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) +#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) # include "rgb_matrix.h" @@ -94,7 +94,7 @@ typedef struct _rgb_matrix_sync_t { rgb_config_t rgb_matrix; bool rgb_suspend_state; } rgb_matrix_sync_t; -#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) +#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) #ifdef SPLIT_MODS_ENABLE typedef struct _split_mods_sync_t { @@ -102,9 +102,18 @@ typedef struct _split_mods_sync_t { uint8_t weak_mods; # ifndef NO_ACTION_ONESHOT uint8_t oneshot_mods; -# endif // NO_ACTION_ONESHOT +# endif // NO_ACTION_ONESHOT } split_mods_sync_t; -#endif // SPLIT_MODS_ENABLE +#endif // SPLIT_MODS_ENABLE + +#if defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) +# include "pointing_device.h" +typedef struct _split_slave_pointing_sync_t { + uint8_t checksum; + report_mouse_t report; + uint16_t cpi; +} split_slave_pointing_sync_t; +#endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) typedef struct _rpc_sync_info_t { @@ -112,72 +121,76 @@ typedef struct _rpc_sync_info_t { uint8_t m2s_length; uint8_t s2m_length; } rpc_sync_info_t; -#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) typedef struct _split_shared_memory_t { #ifdef USE_I2C int8_t transaction_id; -#endif // USE_I2C +#endif // USE_I2C split_slave_matrix_sync_t smatrix; #ifdef SPLIT_TRANSPORT_MIRROR split_master_matrix_sync_t mmatrix; -#endif // SPLIT_TRANSPORT_MIRROR +#endif // SPLIT_TRANSPORT_MIRROR #ifdef ENCODER_ENABLE split_slave_encoder_sync_t encoders; -#endif // ENCODER_ENABLE +#endif // ENCODER_ENABLE #ifndef DISABLE_SYNC_TIMER uint32_t sync_timer; -#endif // DISABLE_SYNC_TIMER +#endif // DISABLE_SYNC_TIMER #if !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) split_layers_sync_t layers; -#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) +#endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE) #ifdef SPLIT_LED_STATE_ENABLE uint8_t led_state; -#endif // SPLIT_LED_STATE_ENABLE +#endif // SPLIT_LED_STATE_ENABLE #ifdef SPLIT_MODS_ENABLE split_mods_sync_t mods; -#endif // SPLIT_MODS_ENABLE +#endif // SPLIT_MODS_ENABLE #ifdef BACKLIGHT_ENABLE uint8_t backlight_level; -#endif // BACKLIGHT_ENABLE +#endif // BACKLIGHT_ENABLE #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) rgblight_syncinfo_t rgblight_sync; -#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) +#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) led_matrix_sync_t led_matrix_sync; -#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) +#endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) rgb_matrix_sync_t rgb_matrix_sync; -#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) +#endif // defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) #if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) uint8_t current_wpm; -#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) +#endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE) #if defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) uint8_t current_oled_state; -#endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) +#endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE) #if defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE) uint8_t current_st7565_state; -#endif // ST7565_ENABLE(OLED_ENABLE) && defined(SPLIT_ST7565_ENABLE) +#endif // ST7565_ENABLE(OLED_ENABLE) && defined(SPLIT_ST7565_ENABLE) + +#if defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) + split_slave_pointing_sync_t pointing; +#endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE) #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) rpc_sync_info_t rpc_info; uint8_t rpc_m2s_buffer[RPC_M2S_BUFFER_SIZE]; uint8_t rpc_s2m_buffer[RPC_S2M_BUFFER_SIZE]; -#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) +#endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER) } split_shared_memory_t; extern split_shared_memory_t *const split_shmem; diff --git a/quantum/sync_timer.c b/quantum/sync_timer.c index de24b463b6b7..217891233f02 100644 --- a/quantum/sync_timer.c +++ b/quantum/sync_timer.c @@ -29,7 +29,9 @@ SOFTWARE. #if defined(SPLIT_KEYBOARD) && !defined(DISABLE_SYNC_TIMER) volatile int32_t sync_timer_ms; -void sync_timer_init(void) { sync_timer_ms = 0; } +void sync_timer_init(void) { + sync_timer_ms = 0; +} void sync_timer_update(uint32_t time) { if (is_keyboard_master()) return; diff --git a/quantum/velocikey.c b/quantum/velocikey.c index 6b7f82d9508d..58e14215bb36 100644 --- a/quantum/velocikey.c +++ b/quantum/velocikey.c @@ -13,7 +13,9 @@ #define TYPING_SPEED_MAX_VALUE 200 uint8_t typing_speed = 0; -bool velocikey_enabled(void) { return eeprom_read_byte(EECONFIG_VELOCIKEY) == 1; } +bool velocikey_enabled(void) { + return eeprom_read_byte(EECONFIG_VELOCIKEY) == 1; +} void velocikey_toggle(void) { if (velocikey_enabled()) @@ -39,4 +41,6 @@ void velocikey_decelerate(void) { } } -uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); } +uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { + return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); +} diff --git a/quantum/via.c b/quantum/via.c index 7c8aa753e762..05ab799cbbed 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -45,7 +45,7 @@ #include "raw_hid.h" #include "dynamic_keymap.h" #include "eeprom.h" -#include "version.h" // for QMK_BUILDDATE used in EEPROM magic +#include "version.h" // for QMK_BUILDDATE used in EEPROM magic #include "via_ensure_keycode.h" // Forward declare some helpers. @@ -62,7 +62,7 @@ void via_qmk_rgblight_get_value(uint8_t *data); // Can be called in an overriding via_init_kb() to test if keyboard level code usage of // EEPROM is invalid and use/save defaults. bool via_eeprom_is_valid(void) { - char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" + char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F); uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F); uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F); @@ -73,7 +73,7 @@ bool via_eeprom_is_valid(void) { // Sets VIA/keyboard level usage of EEPROM to valid/invalid // Keyboard level code (eg. via_init_kb()) should not call this void via_eeprom_set_valid(bool valid) { - char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" + char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F); uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F); uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F); @@ -96,6 +96,7 @@ void via_init(void) { // Let keyboard level test EEPROM valid state, // but not set it valid, it is done here. via_init_kb(); + via_set_layout_options_kb(via_get_layout_options()); // If the EEPROM has the magic, the data is good. // OK to load from EEPROM. @@ -131,7 +132,10 @@ uint32_t via_get_layout_options(void) { return value; } +__attribute__((weak)) void via_set_layout_options_kb(uint32_t value) {} + void via_set_layout_options(uint32_t value) { + via_set_layout_options_kb(value); // Start at the least significant byte void *target = (void *)(VIA_EEPROM_LAYOUT_OPTIONS_ADDR + VIA_EEPROM_LAYOUT_OPTIONS_SIZE - 1); for (uint8_t i = 0; i < VIA_EEPROM_LAYOUT_OPTIONS_SIZE; i++) { @@ -343,13 +347,13 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { } case id_dynamic_keymap_macro_get_buffer: { uint16_t offset = (command_data[0] << 8) | command_data[1]; - uint16_t size = command_data[2]; // size <= 28 + uint16_t size = command_data[2]; // size <= 28 dynamic_keymap_macro_get_buffer(offset, size, &command_data[3]); break; } case id_dynamic_keymap_macro_set_buffer: { uint16_t offset = (command_data[0] << 8) | command_data[1]; - uint16_t size = command_data[2]; // size <= 28 + uint16_t size = command_data[2]; // size <= 28 dynamic_keymap_macro_set_buffer(offset, size, &command_data[3]); break; } @@ -363,13 +367,13 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { } case id_dynamic_keymap_get_buffer: { uint16_t offset = (command_data[0] << 8) | command_data[1]; - uint16_t size = command_data[2]; // size <= 28 + uint16_t size = command_data[2]; // size <= 28 dynamic_keymap_get_buffer(offset, size, &command_data[3]); break; } case id_dynamic_keymap_set_buffer: { uint16_t offset = (command_data[0] << 8) | command_data[1]; - uint16_t size = command_data[2]; // size <= 28 + uint16_t size = command_data[2]; // size <= 28 dynamic_keymap_set_buffer(offset, size, &command_data[3]); break; } @@ -434,7 +438,7 @@ void via_qmk_backlight_set_value(uint8_t *data) { } } -#endif // #if defined(VIA_QMK_BACKLIGHT_ENABLE) +#endif // #if defined(VIA_QMK_BACKLIGHT_ENABLE) #if defined(VIA_QMK_RGBLIGHT_ENABLE) @@ -490,4 +494,4 @@ void via_qmk_rgblight_set_value(uint8_t *data) { } } -#endif // #if defined(VIA_QMK_RGBLIGHT_ENABLE) +#endif // #if defined(VIA_QMK_RGBLIGHT_ENABLE) diff --git a/quantum/via.h b/quantum/via.h index 3db318a45465..ac29a5890232 100644 --- a/quantum/via.h +++ b/quantum/via.h @@ -16,7 +16,7 @@ #pragma once -#include "eeconfig.h" // for EECONFIG_SIZE +#include "eeconfig.h" // for EECONFIG_SIZE // Keyboard level code can change where VIA stores the magic. // The magic is the build date YYMMDD encoded as BCD in 3 bytes, @@ -59,7 +59,7 @@ #define VIA_PROTOCOL_VERSION 0x0009 enum via_command_id { - id_get_protocol_version = 0x01, // always 0x01 + id_get_protocol_version = 0x01, // always 0x01 id_get_keyboard_value = 0x02, id_set_keyboard_value = 0x03, id_dynamic_keymap_get_keycode = 0x04, @@ -82,7 +82,7 @@ enum via_command_id { }; enum via_keyboard_value_id { - id_uptime = 0x01, // + id_uptime = 0x01, // id_layout_options = 0x02, id_switch_matrix_state = 0x03 }; @@ -159,6 +159,7 @@ void via_init(void); // Used by VIA to store and retrieve the layout options. uint32_t via_get_layout_options(void); void via_set_layout_options(uint32_t value); +void via_set_layout_options_kb(uint32_t value); // Called by QMK core to process VIA-specific keycodes. bool process_record_via(uint16_t keycode, keyrecord_t *record); diff --git a/quantum/via_ensure_keycode.h b/quantum/via_ensure_keycode.h index 1aba0cdd2a38..75f816b56083 100644 --- a/quantum/via_ensure_keycode.h +++ b/quantum/via_ensure_keycode.h @@ -244,12 +244,12 @@ _Static_assert(KC_LT == 0x0236, ""); _Static_assert(KC_GT == 0x0237, ""); _Static_assert(KC_QUES == 0x0238, ""); -_Static_assert(RESET == 0x5C00, ""); -_Static_assert(DEBUG == 0x5C01, ""); +_Static_assert(QK_BOOTLOADER == 0x5C00, ""); +_Static_assert(QK_DEBUG_TOGGLE == 0x5C01, ""); _Static_assert(MAGIC_TOGGLE_NKRO == 0x5C14, ""); -_Static_assert(KC_GESC == 0x5C16, ""); +_Static_assert(QK_GRAVE_ESCAPE == 0x5C16, ""); _Static_assert(AU_ON == 0x5C1D, ""); _Static_assert(AU_OFF == 0x5C1E, ""); diff --git a/quantum/wpm.c b/quantum/wpm.c index 925e2c416e70..b2e6fe0430cc 100644 --- a/quantum/wpm.c +++ b/quantum/wpm.c @@ -22,41 +22,53 @@ // WPM Stuff static uint8_t current_wpm = 0; static uint32_t wpm_timer = 0; -#ifndef WPM_UNFILTERED -static uint32_t smoothing_timer = 0; -#endif /* The WPM calculation works by specifying a certain number of 'periods' inside * a ring buffer, and we count the number of keypresses which occur in each of * those periods. Then to calculate WPM, we add up all of the keypresses in * the whole ring buffer, divide by the number of keypresses in a 'word', and - * then adjust for how much time is captured by our ring buffer. Right now - * the ring buffer is hardcoded below to be six half-second periods, accounting - * for a total WPM sampling period of up to three seconds of typing. + * then adjust for how much time is captured by our ring buffer. The size + * of the ring buffer can be configured using the keymap configuration + * value `WPM_SAMPLE_PERIODS`. * - * Whenever our WPM drops to absolute zero due to no typing occurring within - * any contiguous three seconds, we reset and start measuring fresh, - * which lets our WPM immediately reach the correct value even before a full - * three second sampling buffer has been filled. */ #define MAX_PERIODS (WPM_SAMPLE_PERIODS) #define PERIOD_DURATION (1000 * WPM_SAMPLE_SECONDS / MAX_PERIODS) -#define LATENCY (100) -static int8_t period_presses[MAX_PERIODS] = {0}; + +static int16_t period_presses[MAX_PERIODS] = {0}; static uint8_t current_period = 0; static uint8_t periods = 1; #if !defined(WPM_UNFILTERED) -static uint8_t prev_wpm = 0; -static uint8_t next_wpm = 0; +/* LATENCY is used as part of filtering, and controls how quickly the reported + * WPM trails behind our actual instantaneous measured WPM value, and is + * defined in milliseconds. So for LATENCY == 100, the displayed WPM is + * smoothed out over periods of 0.1 seconds. This results in a nice, + * smoothly-moving reported WPM value which nevertheless is never more than + * 0.1 seconds behind the typist's actual current WPM. + * + * LATENCY is not used if WPM_UNFILTERED is defined. + */ +# define LATENCY (100) +static uint32_t smoothing_timer = 0; +static uint8_t prev_wpm = 0; +static uint8_t next_wpm = 0; #endif -void set_current_wpm(uint8_t new_wpm) { current_wpm = new_wpm; } -uint8_t get_current_wpm(void) { return current_wpm; } +void set_current_wpm(uint8_t new_wpm) { + current_wpm = new_wpm; +} +uint8_t get_current_wpm(void) { + return current_wpm; +} -bool wpm_keycode(uint16_t keycode) { return wpm_keycode_kb(keycode); } +bool wpm_keycode(uint16_t keycode) { + return wpm_keycode_kb(keycode); +} -__attribute__((weak)) bool wpm_keycode_kb(uint16_t keycode) { return wpm_keycode_user(keycode); } +__attribute__((weak)) bool wpm_keycode_kb(uint16_t keycode) { + return wpm_keycode_user(keycode); +} __attribute__((weak)) bool wpm_keycode_user(uint16_t keycode) { if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { @@ -71,7 +83,7 @@ __attribute__((weak)) bool wpm_keycode_user(uint16_t keycode) { return false; } -#ifdef WPM_ALLOW_COUNT_REGRESSION +#if defined(WPM_ALLOW_COUNT_REGRESSION) __attribute__((weak)) uint8_t wpm_regress_count(uint16_t keycode) { bool weak_modded = (keycode >= QK_LCTL && keycode < QK_LSFT) || (keycode >= QK_RCTL && keycode < QK_RSFT); @@ -95,12 +107,12 @@ __attribute__((weak)) uint8_t wpm_regress_count(uint16_t keycode) { // Outside 'raw' mode we smooth results over time. void update_wpm(uint16_t keycode) { - if (wpm_keycode(keycode)) { + if (wpm_keycode(keycode) && period_presses[current_period] < INT16_MAX) { period_presses[current_period]++; } -#ifdef WPM_ALLOW_COUNT_REGRESSION +#if defined(WPM_ALLOW_COUNT_REGRESSION) uint8_t regress = wpm_regress_count(keycode); - if (regress) { + if (regress && period_presses[current_period] > INT16_MIN) { period_presses[current_period]--; } #endif @@ -116,32 +128,41 @@ void decay_wpm(void) { } int32_t elapsed = timer_elapsed32(wpm_timer); uint32_t duration = (((periods)*PERIOD_DURATION) + elapsed); - uint32_t wpm_now = (60000 * presses) / (duration * WPM_ESTIMATED_WORD_SIZE); - wpm_now = (wpm_now > 240) ? 240 : wpm_now; + int32_t wpm_now = (60000 * presses) / (duration * WPM_ESTIMATED_WORD_SIZE); + + if (wpm_now < 0) // set some reasonable WPM measurement limits + wpm_now = 0; + if (wpm_now > 240) wpm_now = 240; if (elapsed > PERIOD_DURATION) { current_period = (current_period + 1) % MAX_PERIODS; period_presses[current_period] = 0; periods = (periods < MAX_PERIODS - 1) ? periods + 1 : MAX_PERIODS - 1; elapsed = 0; - /* if (wpm_timer == 0) { */ - wpm_timer = timer_read32(); - /* } else { */ - /* wpm_timer += PERIOD_DURATION; */ - /* } */ + wpm_timer = timer_read32(); } - if (presses < 2) // don't guess high WPM based on a single keypress. + if (presses < 2) // don't guess high WPM based on a single keypress. wpm_now = 0; -#if defined WPM_LAUNCH_CONTROL +#if defined(WPM_LAUNCH_CONTROL) + /* + * If the `WPM_LAUNCH_CONTROL` option is enabled, then whenever our WPM + * drops to absolute zero due to no typing occurring within our sample + * ring buffer, we reset and start measuring fresh, which lets our WPM + * immediately reach the correct value even before a full sampling buffer + * has been filled. + */ if (presses == 0) { - current_period = 0; - periods = 0; - wpm_now = 0; + current_period = 0; + periods = 0; + wpm_now = 0; + period_presses[0] = 0; } -#endif // WPM_LAUNCH_CONTROL +#endif // WPM_LAUNCH_CONTROL -#ifndef WPM_UNFILTERED +#if defined(WPM_UNFILTERED) + current_wpm = wpm_now; +#else int32_t latency = timer_elapsed32(smoothing_timer); if (latency > LATENCY) { smoothing_timer = timer_read32(); @@ -150,7 +171,5 @@ void decay_wpm(void) { } current_wpm = prev_wpm + (latency * ((int)next_wpm - (int)prev_wpm) / LATENCY); -#else - current_wpm = wpm_now; #endif } diff --git a/quantum/wpm.h b/quantum/wpm.h index c8e7d2668413..305d75b4508f 100644 --- a/quantum/wpm.h +++ b/quantum/wpm.h @@ -26,7 +26,7 @@ # define WPM_SAMPLE_SECONDS 5 #endif #ifndef WPM_SAMPLE_PERIODS -# define WPM_SAMPLE_PERIODS 50 +# define WPM_SAMPLE_PERIODS 25 #endif bool wpm_keycode(uint16_t keycode); diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index 9c5ed9a8326a..a19b5dfa824c 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -42,7 +42,6 @@ TEST_F(AutoShift, key_release_before_timeout) { /* Release regular key */ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); regular_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -65,8 +64,6 @@ TEST_F(AutoShift, key_release_after_timeout) { EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_A))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); regular_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); diff --git a/tests/basic/test_action_layer.cpp b/tests/basic/test_action_layer.cpp index 1b12d13642fe..fe5c729f7c3b 100644 --- a/tests/basic/test_action_layer.cpp +++ b/tests/basic/test_action_layer.cpp @@ -131,14 +131,12 @@ TEST_F(ActionLayer, MomentaryLayerDoesNothing) { set_keymap({layer_key}); /* Press and release MO, nothing should happen. */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.press(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -153,8 +151,7 @@ TEST_F(ActionLayer, MomentaryLayerWithKeypress) { set_keymap({layer_key, regular_key, KeymapKey{1, 1, 0, KC_B}}); /* Press MO. */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); @@ -175,8 +172,7 @@ TEST_F(ActionLayer, MomentaryLayerWithKeypress) { testing::Mock::VerifyAndClearExpectations(&driver); /* Release MO */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); @@ -199,8 +195,7 @@ TEST_F(ActionLayer, ToggleLayerDoesNothing) { testing::Mock::VerifyAndClearExpectations(&driver); /* Release TG. */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); @@ -223,8 +218,7 @@ TEST_F(ActionLayer, ToggleLayerUpAndDown) { EXPECT_TRUE(layer_state_is(1)); testing::Mock::VerifyAndClearExpectations(&driver); - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); toggle_layer_1_on_layer_0.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); @@ -237,8 +231,7 @@ TEST_F(ActionLayer, ToggleLayerUpAndDown) { EXPECT_TRUE(layer_state_is(0)); testing::Mock::VerifyAndClearExpectations(&driver); - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); toggle_layer_0_on_layer_1.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); @@ -254,14 +247,13 @@ TEST_F(ActionLayer, LayerTapToggleDoesNothing) { set_keymap({layer_key}); /* Press and release TT. */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(0); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); testing::Mock::VerifyAndClearExpectations(&driver); - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); @@ -279,7 +271,6 @@ TEST_F(ActionLayer, LayerTapToggleWithKeypress) { set_keymap({layer_key, regular_key, KeymapKey{1, 1, 0, KC_B}}); /* Press TT. */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(0); layer_key.press(); run_one_scan_loop(); @@ -298,8 +289,7 @@ TEST_F(ActionLayer, LayerTapToggleWithKeypress) { EXPECT_TRUE(layer_state_is(1)); testing::Mock::VerifyAndClearExpectations(&driver); - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); @@ -317,8 +307,7 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { set_keymap({layer_key, regular_key, KeymapKey{1, 1, 0, KC_B}}); /* Tap TT five times . */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(9); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.press(); run_one_scan_loop(); diff --git a/tests/basic/test_keypress.cpp b/tests/basic/test_keypress.cpp index 1c175c9d56a7..044fc2937806 100644 --- a/tests/basic/test_keypress.cpp +++ b/tests/basic/test_keypress.cpp @@ -85,7 +85,7 @@ TEST_F(KeyPress, CorrectKeysAreReportedWhenTwoKeysArePressed) { TEST_F(KeyPress, LeftShiftIsReportedCorrectly) { TestDriver driver; auto key_a = KeymapKey(0, 0, 0, KC_A); - auto key_lsft = KeymapKey(0, 3, 0, KC_LSFT); + auto key_lsft = KeymapKey(0, 3, 0, KC_LEFT_SHIFT); set_keymap({key_a, key_lsft}); @@ -110,8 +110,8 @@ TEST_F(KeyPress, LeftShiftIsReportedCorrectly) { TEST_F(KeyPress, PressLeftShiftAndControl) { TestDriver driver; - auto key_lsft = KeymapKey(0, 3, 0, KC_LSFT); - auto key_lctrl = KeymapKey(0, 5, 0, KC_LCTRL); + auto key_lsft = KeymapKey(0, 3, 0, KC_LEFT_SHIFT); + auto key_lctrl = KeymapKey(0, 5, 0, KC_LEFT_CTRL); set_keymap({key_lctrl, key_lsft}); @@ -138,8 +138,8 @@ TEST_F(KeyPress, PressLeftShiftAndControl) { TEST_F(KeyPress, LeftAndRightShiftCanBePressedAtTheSameTime) { TestDriver driver; - auto key_lsft = KeymapKey(0, 3, 0, KC_LSFT); - auto key_rsft = KeymapKey(0, 4, 0, KC_RSFT); + auto key_lsft = KeymapKey(0, 3, 0, KC_LEFT_SHIFT); + auto key_rsft = KeymapKey(0, 4, 0, KC_RIGHT_SHIFT); set_keymap({key_rsft, key_lsft}); @@ -175,12 +175,12 @@ TEST_F(KeyPress, RightShiftLeftControlAndCharWithTheSameKey) { // The underlying cause is that we use only one bit to represent the right hand // modifiers. combo_key.press(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL))); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL, KC_O))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RIGHT_SHIFT, KC_RIGHT_CTRL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RIGHT_SHIFT, KC_RIGHT_CTRL, KC_O))); keyboard_task(); combo_key.release(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RIGHT_SHIFT, KC_RIGHT_CTRL))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); keyboard_task(); } @@ -189,18 +189,18 @@ TEST_F(KeyPress, PressPlusEqualReleaseBeforePress) { TestDriver driver; InSequence s; auto key_plus = KeymapKey(0, 1, 1, KC_PLUS); - auto key_eql = KeymapKey(0, 0, 1, KC_EQL); + auto key_eql = KeymapKey(0, 0, 1, KC_EQUAL); set_keymap({key_plus, key_eql}); key_plus.press(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL))); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); key_plus.release(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -220,13 +220,13 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { TestDriver driver; InSequence s; auto key_plus = KeymapKey(0, 1, 1, KC_PLUS); - auto key_eql = KeymapKey(0, 0, 1, KC_EQL); + auto key_eql = KeymapKey(0, 0, 1, KC_EQUAL); set_keymap({key_plus, key_eql}); key_plus.press(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL))); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -237,14 +237,13 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { testing::Mock::VerifyAndClearExpectations(&driver); key_plus.release(); - // BUG: Should really still return KC_EQL, but this is fine too - // It's also called twice for some reason - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2); + // BUG: Should really still return KC_EQUAL, but this is fine too + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(1); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); key_eql.release(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); } @@ -253,12 +252,12 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { TestDriver driver; InSequence s; auto key_plus = KeymapKey(0, 1, 1, KC_PLUS); - auto key_eql = KeymapKey(0, 0, 1, KC_EQL); + auto key_eql = KeymapKey(0, 0, 1, KC_EQUAL); set_keymap({key_plus, key_eql}); key_eql.press(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQUAL))); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -268,13 +267,13 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { testing::Mock::VerifyAndClearExpectations(&driver); key_plus.press(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL))); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); key_plus.release(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -284,12 +283,12 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { TestDriver driver; InSequence s; auto key_plus = KeymapKey(0, 1, 1, KC_PLUS); - auto key_eql = KeymapKey(0, 0, 1, KC_EQL); + auto key_eql = KeymapKey(0, 0, 1, KC_EQUAL); set_keymap({key_plus, key_eql}); key_eql.press(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL))); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQUAL))); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); @@ -309,9 +308,7 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { testing::Mock::VerifyAndClearExpectations(&driver); key_plus.release(); - // This report is not needed - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); -} \ No newline at end of file +} diff --git a/tests/basic/test_macro.cpp b/tests/basic/test_macro.cpp deleted file mode 100644 index ae2f3b32e3fb..000000000000 --- a/tests/basic/test_macro.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright 2017 Fred Sundvik - * - * 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 "test_common.hpp" -#include "time.h" - -using testing::InSequence; -using testing::InvokeWithoutArgs; - -class Macro : public TestFixture {}; - -#define AT_TIME(t) WillOnce(InvokeWithoutArgs([current_time]() { EXPECT_EQ(timer_elapsed32(current_time), t); })) - -extern "C" const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch (id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(E), T(L), T(L), T(O), T(SPACE), W(100), D(LSFT), T(W), U(LSFT), I(10), T(O), T(R), T(L), T(D), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; -}; - -TEST_F(Macro, PlayASimpleMacro) { - TestDriver driver; - InSequence s; - auto key_macro = KeymapKey(0, 8, 0, M(0)); - - set_keymap({key_macro}); - - key_macro.press(); - - uint32_t current_time = timer_read32(); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_H))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_E))).AT_TIME(0); - // The macro system could actually skip these empty keyboard reports - // it should be enough to just send a report with the next key down - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_L))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_L))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_O))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_SPACE))).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(0); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))).AT_TIME(100); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_W))).AT_TIME(100); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))).AT_TIME(100); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(100); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_O))) - // BUG: The timer should not really have advanced 10 ms here - // See issue #1477 - .AT_TIME(110); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())) - // BUG: The timer should not advance on both keydown and key-up - // See issue #1477 - .AT_TIME(120); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_R))).AT_TIME(130); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(140); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_L))).AT_TIME(150); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(160); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_D))).AT_TIME(170); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(180); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))).AT_TIME(190); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_1))).AT_TIME(200); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT))).AT_TIME(210); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).AT_TIME(220); - run_one_scan_loop(); - - key_macro.release(); -} diff --git a/tests/basic/test_one_shot_keys.cpp b/tests/basic/test_one_shot_keys.cpp index 98178912e4cc..43fc3e1ba3b8 100644 --- a/tests/basic/test_one_shot_keys.cpp +++ b/tests/basic/test_one_shot_keys.cpp @@ -175,22 +175,20 @@ TEST_F(OneShot, OSLWithAdditionalKeypress) { testing::Mock::VerifyAndClearExpectations(&driver); /* Release OSL key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); osl_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); /* Press regular key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(regular_key.report_code))).Times(2); - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(regular_key.report_code))).Times(1); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); regular_key.press(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); /* Release regular key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); regular_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); diff --git a/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp b/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp index ab9dd1518bb2..00c2b33cb7d4 100644 --- a/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp @@ -117,7 +117,6 @@ TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { testing::Mock::VerifyAndClearExpectations(&driver); /* Release regular key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(layer_key.report_code))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); regular_key.release(); @@ -125,7 +124,7 @@ TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { testing::Mock::VerifyAndClearExpectations(&driver); /* Release layer-tap-hold key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_tap_hold_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); diff --git a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp b/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp index 67f394653f3a..67706f80dc2e 100644 --- a/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/permissive_hold_ignore_mod_tap_interrupt/test_tap_hold.cpp @@ -119,7 +119,6 @@ TEST_F(PermissiveHold_IgnoreModTapInterrupt, tap_regular_key_while_layer_tap_key testing::Mock::VerifyAndClearExpectations(&driver); /* Release regular key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_B))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); regular_key.release(); @@ -127,7 +126,7 @@ TEST_F(PermissiveHold_IgnoreModTapInterrupt, tap_regular_key_while_layer_tap_key testing::Mock::VerifyAndClearExpectations(&driver); /* Release layer-tap-hold key */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_tap_hold_key.release(); run_one_scan_loop(); testing::Mock::VerifyAndClearExpectations(&driver); diff --git a/tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp b/tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp index 02416eed7365..54e7daa22c6a 100644 --- a/tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp +++ b/tests/tap_hold_configurations/tapping_force_hold/test_action_layer.cpp @@ -31,9 +31,8 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { set_keymap({layer_key, regular_key, KeymapKey{1, 1, 0, KC_B}}); /* Tap TT five times . */ - /* TODO: QMK currently sends an empty report even if nothing needs to be reported to the host! */ /* TODO: Tapping Force Hold breaks TT */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(10); + EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); layer_key.press(); run_one_scan_loop(); diff --git a/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp b/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp index cb6842961724..3ae7c4ccfdfd 100644 --- a/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/tapping_force_hold/test_tap_hold.cpp @@ -60,7 +60,6 @@ TEST_F(TappingForceHold, tap_regular_key_while_mod_tap_key_is_held) { testing::Mock::VerifyAndClearExpectations(&driver); /* Idle for tapping term of mod tap hold key. */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_A))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); @@ -101,7 +100,6 @@ TEST_F(TappingForceHold, tap_mod_tap_key_while_mod_tap_key_is_held) { testing::Mock::VerifyAndClearExpectations(&driver); /* Idle for tapping term of first mod tap hold key. */ - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_A))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT))); EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp index e148c76beb7e..7908e64f7f41 100644 --- a/tests/test_common/keyboard_report_util.cpp +++ b/tests/test_common/keyboard_report_util.cpp @@ -36,7 +36,7 @@ std::vector get_keys(const report_keyboard_t& report) { std::sort(result.begin(), result.end()); return result; } -} // namespace +} // namespace bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) { auto lhskeys = get_keys(lhs); @@ -72,8 +72,14 @@ KeyboardReportMatcher::KeyboardReportMatcher(const std::vector& keys) { } } -bool KeyboardReportMatcher::MatchAndExplain(report_keyboard_t& report, MatchResultListener* listener) const { return m_report == report; } +bool KeyboardReportMatcher::MatchAndExplain(report_keyboard_t& report, MatchResultListener* listener) const { + return m_report == report; +} -void KeyboardReportMatcher::DescribeTo(::std::ostream* os) const { *os << "is equal to " << m_report; } +void KeyboardReportMatcher::DescribeTo(::std::ostream* os) const { + *os << "is equal to " << m_report; +} -void KeyboardReportMatcher::DescribeNegationTo(::std::ostream* os) const { *os << "is not equal to " << m_report; } +void KeyboardReportMatcher::DescribeNegationTo(::std::ostream* os) const { + *os << "is not equal to " << m_report; +} diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c index 9a92a801c780..7b24d560e3e0 100644 --- a/tests/test_common/matrix.c +++ b/tests/test_common/matrix.c @@ -30,7 +30,9 @@ uint8_t matrix_scan(void) { return 1; } -matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } +matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} void matrix_print(void) {} @@ -38,10 +40,16 @@ void matrix_init_kb(void) {} void matrix_scan_kb(void) {} -void press_key(uint8_t col, uint8_t row) { matrix[row] |= 1 << col; } +void press_key(uint8_t col, uint8_t row) { + matrix[row] |= 1 << col; +} -void release_key(uint8_t col, uint8_t row) { matrix[row] &= ~(1 << col); } +void release_key(uint8_t col, uint8_t row) { + matrix[row] &= ~(1 << col); +} -void clear_all_keys(void) { memset(matrix, 0, sizeof(matrix)); } +void clear_all_keys(void) { + memset(matrix, 0, sizeof(matrix)); +} void led_set(uint8_t usb_led) {} diff --git a/tests/test_common/test_driver.cpp b/tests/test_common/test_driver.cpp index 2fa2b6a2e791..68f1dfd17d15 100644 --- a/tests/test_common/test_driver.cpp +++ b/tests/test_common/test_driver.cpp @@ -23,17 +23,27 @@ TestDriver::TestDriver() : m_driver{&TestDriver::keyboard_leds, &TestDriver::sen m_this = this; } -TestDriver::~TestDriver() { m_this = nullptr; } +TestDriver::~TestDriver() { + m_this = nullptr; +} -uint8_t TestDriver::keyboard_leds(void) { return m_this->m_leds; } +uint8_t TestDriver::keyboard_leds(void) { + return m_this->m_leds; +} void TestDriver::send_keyboard(report_keyboard_t* report) { test_logger.trace() << *report; m_this->send_keyboard_mock(*report); } -void TestDriver::send_mouse(report_mouse_t* report) { m_this->send_mouse_mock(*report); } +void TestDriver::send_mouse(report_mouse_t* report) { + m_this->send_mouse_mock(*report); +} -void TestDriver::send_system(uint16_t data) { m_this->send_system_mock(data); } +void TestDriver::send_system(uint16_t data) { + m_this->send_system_mock(data); +} -void TestDriver::send_consumer(uint16_t data) { m_this->send_consumer(data); } +void TestDriver::send_consumer(uint16_t data) { + m_this->send_consumer(data); +} diff --git a/tests/test_common/test_fixture.cpp b/tests/test_common/test_fixture.cpp index 0601b1719137..c98a679554db 100644 --- a/tests/test_common/test_fixture.cpp +++ b/tests/test_common/test_fixture.cpp @@ -48,7 +48,6 @@ void TestFixture::SetUpTestCase() { eeconfig_update_debug(debug_config.raw); TestDriver driver; - EXPECT_CALL(driver, send_keyboard_mock(_)); keyboard_init(); test_logger.info() << "TestFixture setup-up end." << std::endl; @@ -56,14 +55,14 @@ void TestFixture::SetUpTestCase() { void TestFixture::TearDownTestCase() {} -TestFixture::TestFixture() { m_this = this; } +TestFixture::TestFixture() { + m_this = this; +} TestFixture::~TestFixture() { test_logger.info() << "TestFixture clean-up start." << std::endl; TestDriver driver; - EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2); - /* Reset keyboard state. */ clear_all_keys(); diff --git a/tests/test_common/test_logger.cpp b/tests/test_common/test_logger.cpp index 959fdde5ec56..efc7719d132e 100644 --- a/tests/test_common/test_logger.cpp +++ b/tests/test_common/test_logger.cpp @@ -34,6 +34,10 @@ TestLogger& TestLogger::error() { return *this; } -void TestLogger::reset() { this->m_log.str(""); }; +void TestLogger::reset() { + this->m_log.str(""); +}; -void TestLogger::print_log() { std::cerr << this->m_log.str(); } +void TestLogger::print_log() { + std::cerr << this->m_log.str(); +} diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index 31a6de76f104..19fd7d242594 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk @@ -28,6 +28,11 @@ ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) SHARED_EP_ENABLE = yes endif +ifeq ($(strip $(PROGRAMMABLE_BUTTON_ENABLE)), yes) + TMK_COMMON_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE + SHARED_EP_ENABLE = yes +endif + ifeq ($(strip $(RAW_ENABLE)), yes) TMK_COMMON_DEFS += -DRAW_ENABLE endif diff --git a/tmk_core/protocol/arm_atsam/adc.c b/tmk_core/protocol/arm_atsam/adc.c index 1ef1b11d5721..3afcbddf1011 100644 --- a/tmk_core/protocol/arm_atsam/adc.c +++ b/tmk_core/protocol/arm_atsam/adc.c @@ -27,10 +27,10 @@ uint16_t v_con_2_boot; void ADC0_clock_init(void) { DBGC(DC_ADC0_CLOCK_INIT_BEGIN); - MCLK->APBDMASK.bit.ADC0_ = 1; // ADC0 Clock Enable + MCLK->APBDMASK.bit.ADC0_ = 1; // ADC0 Clock Enable - GCLK->PCHCTRL[ADC0_GCLK_ID].bit.GEN = GEN_OSC0; // Select generator clock - GCLK->PCHCTRL[ADC0_GCLK_ID].bit.CHEN = 1; // Enable peripheral clock + GCLK->PCHCTRL[ADC0_GCLK_ID].bit.GEN = GEN_OSC0; // Select generator clock + GCLK->PCHCTRL[ADC0_GCLK_ID].bit.CHEN = 1; // Enable peripheral clock DBGC(DC_ADC0_CLOCK_INIT_COMPLETE); } @@ -39,15 +39,15 @@ void ADC0_init(void) { DBGC(DC_ADC0_INIT_BEGIN); // MCU - PORT->Group[1].DIRCLR.reg = 1 << 0; // PB00 as input 5V - PORT->Group[1].DIRCLR.reg = 1 << 1; // PB01 as input CON2 - PORT->Group[1].DIRCLR.reg = 1 << 2; // PB02 as input CON1 - PORT->Group[1].PMUX[0].bit.PMUXE = 1; // PB00 mux select B ADC 5V - PORT->Group[1].PMUX[0].bit.PMUXO = 1; // PB01 mux select B ADC CON2 - PORT->Group[1].PMUX[1].bit.PMUXE = 1; // PB02 mux select B ADC CON1 - PORT->Group[1].PINCFG[0].bit.PMUXEN = 1; // PB01 mux ADC Enable 5V - PORT->Group[1].PINCFG[1].bit.PMUXEN = 1; // PB01 mux ADC Enable CON2 - PORT->Group[1].PINCFG[2].bit.PMUXEN = 1; // PB02 mux ADC Enable CON1 + PORT->Group[1].DIRCLR.reg = 1 << 0; // PB00 as input 5V + PORT->Group[1].DIRCLR.reg = 1 << 1; // PB01 as input CON2 + PORT->Group[1].DIRCLR.reg = 1 << 2; // PB02 as input CON1 + PORT->Group[1].PMUX[0].bit.PMUXE = 1; // PB00 mux select B ADC 5V + PORT->Group[1].PMUX[0].bit.PMUXO = 1; // PB01 mux select B ADC CON2 + PORT->Group[1].PMUX[1].bit.PMUXE = 1; // PB02 mux select B ADC CON1 + PORT->Group[1].PINCFG[0].bit.PMUXEN = 1; // PB01 mux ADC Enable 5V + PORT->Group[1].PINCFG[1].bit.PMUXEN = 1; // PB01 mux ADC Enable CON2 + PORT->Group[1].PINCFG[2].bit.PMUXEN = 1; // PB02 mux ADC Enable CON1 // ADC ADC0->CTRLA.bit.SWRST = 1; @@ -81,7 +81,7 @@ void ADC0_init(void) { } // Settling - ADC0->SAMPCTRL.bit.SAMPLEN = 45; // Sampling Time Length: 1-63, 1 ADC CLK per + ADC0->SAMPCTRL.bit.SAMPLEN = 45; // Sampling Time Length: 1-63, 1 ADC CLK per while (ADC0->SYNCBUSY.bit.SAMPCTRL) { DBGC(DC_ADC0_SAMPCTRL_SYNCING_1); } diff --git a/tmk_core/protocol/arm_atsam/adc.h b/tmk_core/protocol/arm_atsam/adc.h index 9ab653e5a206..74fbb0e66f71 100644 --- a/tmk_core/protocol/arm_atsam/adc.h +++ b/tmk_core/protocol/arm_atsam/adc.h @@ -34,4 +34,4 @@ extern uint16_t v_con_2_boot; void ADC0_clock_init(void); void ADC0_init(void); -#endif //_ADC_H_ +#endif //_ADC_H_ diff --git a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h index e1749f872daa..db9827f6a2b8 100644 --- a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h +++ b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h @@ -19,7 +19,6 @@ along with this program. If not, see . #define _ARM_ATSAM_PROTOCOL_H_ #include "samd51j18a.h" -#include "md_bootloader.h" #include "timer.h" #include "d51_util.h" @@ -43,6 +42,6 @@ along with this program. If not, see . # include "./usb/udc.h" # include "./usb/udi_cdc.h" -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER -#endif //_ARM_ATSAM_PROTOCOL_H_ +#endif //_ARM_ATSAM_PROTOCOL_H_ diff --git a/tmk_core/protocol/arm_atsam/clks.c b/tmk_core/protocol/arm_atsam/clks.c index 84ed6d83af57..9b9475c61659 100644 --- a/tmk_core/protocol/arm_atsam/clks.c +++ b/tmk_core/protocol/arm_atsam/clks.c @@ -22,7 +22,7 @@ along with this program. If not, see . volatile clk_t system_clks; volatile uint64_t ms_clk; uint32_t usec_delay_mult; -#define USEC_DELAY_LOOP_CYCLES 3 // Sum of instruction cycles in us delay loop +#define USEC_DELAY_LOOP_CYCLES 3 // Sum of instruction cycles in us delay loop const uint32_t sercom_apbbase[] = {(uint32_t)SERCOM0, (uint32_t)SERCOM1, (uint32_t)SERCOM2, (uint32_t)SERCOM3, (uint32_t)SERCOM4, (uint32_t)SERCOM5}; const uint8_t sercom_pchan[] = {7, 8, 23, 24, 34, 35}; @@ -59,9 +59,9 @@ void CLK_oscctrl_init(void) { while (posctrl->Dpll[USE_DPLL_IND].DPLLSYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_OSC_INIT_DPLL_SYNC_DISABLE); } - posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.REFCLK = 2; // select XOSC0 (16MHz) - posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.DIV = 7; // 16 MHz / (2 * (7 + 1)) = 1 MHz - posctrl->Dpll[USE_DPLL_IND].DPLLRATIO.bit.LDR = PLL_RATIO; // 1 MHz * (PLL_RATIO(47) + 1) = 48MHz + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.REFCLK = 2; // select XOSC0 (16MHz) + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.DIV = 7; // 16 MHz / (2 * (7 + 1)) = 1 MHz + posctrl->Dpll[USE_DPLL_IND].DPLLRATIO.bit.LDR = PLL_RATIO; // 1 MHz * (PLL_RATIO(47) + 1) = 48MHz while (posctrl->Dpll[USE_DPLL_IND].DPLLSYNCBUSY.bit.DPLLRATIO) { DBGC(DC_CLK_OSC_INIT_DPLL_SYNC_RATIO); } @@ -87,7 +87,7 @@ void CLK_oscctrl_init(void) { system_clks.freq_gclk[0] = system_clks.freq_dpll[0]; usec_delay_mult = system_clks.freq_gclk[0] / (USEC_DELAY_LOOP_CYCLES * 1000000); - if (usec_delay_mult < 1) usec_delay_mult = 1; // Never allow a multiplier of zero + if (usec_delay_mult < 1) usec_delay_mult = 1; // Never allow a multiplier of zero DBGC(DC_CLK_OSC_INIT_COMPLETE); } @@ -240,7 +240,7 @@ uint32_t CLK_enable_timebase(void) { // ptc4->COUNT16.DBGCTRL.bit.DBGRUN = 1; // wave mode - ptc4->COUNT16.WAVE.bit.WAVEGEN = 1; // MFRQ match frequency mode, toggle each CC match + ptc4->COUNT16.WAVE.bit.WAVEGEN = 1; // MFRQ match frequency mode, toggle each CC match // generate event for next stage ptc4->COUNT16.EVCTRL.bit.MCEO0 = 1; @@ -272,9 +272,9 @@ uint32_t CLK_enable_timebase(void) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_SWRST_2); } // CTRLA as default - ptc0->COUNT32.CTRLA.bit.MODE = 2; // 32 bit mode - ptc0->COUNT32.EVCTRL.bit.TCEI = 1; // enable incoming events - ptc0->COUNT32.EVCTRL.bit.EVACT = 2; // count events + ptc0->COUNT32.CTRLA.bit.MODE = 2; // 32 bit mode + ptc0->COUNT32.EVCTRL.bit.TCEI = 1; // enable incoming events + ptc0->COUNT32.EVCTRL.bit.EVACT = 2; // count events DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_COMPLETE); @@ -284,10 +284,10 @@ uint32_t CLK_enable_timebase(void) { pmclk->APBBMASK.bit.EVSYS_ = 1; pgclk->PCHCTRL[EVSYS_GCLK_ID_0].bit.GEN = GEN_TC45; pgclk->PCHCTRL[EVSYS_GCLK_ID_0].bit.CHEN = 1; - pevsys->USER[44].reg = EVSYS_ID_USER_PORT_EV_0; // TC0 will get event channel 0 - pevsys->Channel[0].CHANNEL.bit.EDGSEL = EVSYS_CHANNEL_EDGSEL_RISING_EDGE_Val; // Rising edge - pevsys->Channel[0].CHANNEL.bit.PATH = EVSYS_CHANNEL_PATH_SYNCHRONOUS_Val; // Synchronous - pevsys->Channel[0].CHANNEL.bit.EVGEN = EVSYS_ID_GEN_TC4_MCX_0; // TC4 MC0 + pevsys->USER[44].reg = EVSYS_ID_USER_PORT_EV_0; // TC0 will get event channel 0 + pevsys->Channel[0].CHANNEL.bit.EDGSEL = EVSYS_CHANNEL_EDGSEL_RISING_EDGE_Val; // Rising edge + pevsys->Channel[0].CHANNEL.bit.PATH = EVSYS_CHANNEL_PATH_SYNCHRONOUS_Val; // Synchronous + pevsys->Channel[0].CHANNEL.bit.EVGEN = EVSYS_ID_GEN_TC4_MCX_0; // TC4 MC0 DBGC(DC_CLK_ENABLE_TIMEBASE_EVSYS_COMPLETE); @@ -301,15 +301,15 @@ uint32_t CLK_enable_timebase(void) { } void CLK_delay_us(uint32_t usec) { - asm("CBZ R0, return\n\t" // If usec == 0, branch to return label + asm("CBZ R0, return\n\t" // If usec == 0, branch to return label ); - asm("MULS R0, %0\n\t" // Multiply R0(usec) by usec_delay_mult and store in R0 - ".balign 16\n\t" // Ensure loop is aligned for fastest performance - "loop: SUBS R0, #1\n\t" // Subtract 1 from R0 and update flags (1 cycle) - "BNE loop\n\t" // Branch if non-zero to loop label (2 cycles) NOTE: USEC_DELAY_LOOP_CYCLES is the sum of loop cycles - "return:\n\t" // Return label - : // No output registers - : "r"(usec_delay_mult) // For %0 + asm("MULS R0, %0\n\t" // Multiply R0(usec) by usec_delay_mult and store in R0 + ".balign 16\n\t" // Ensure loop is aligned for fastest performance + "loop: SUBS R0, #1\n\t" // Subtract 1 from R0 and update flags (1 cycle) + "BNE loop\n\t" // Branch if non-zero to loop label (2 cycles) NOTE: USEC_DELAY_LOOP_CYCLES is the sum of loop cycles + "return:\n\t" // Return label + : // No output registers + : "r"(usec_delay_mult) // For %0 ); // Note: BX LR generated } diff --git a/tmk_core/protocol/arm_atsam/clks.h b/tmk_core/protocol/arm_atsam/clks.h index 72df3a8e3f3f..6ee71aff8fa6 100644 --- a/tmk_core/protocol/arm_atsam/clks.h +++ b/tmk_core/protocol/arm_atsam/clks.h @@ -24,14 +24,14 @@ along with this program. If not, see . # include "config_led.h" # include "config.h" -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER -#define PLL_RATIO 47 // mcu frequency ((X+1)MHz) -#define FREQ_DFLL_DEFAULT 48000000 // DFLL frequency / usb clock -#define FREQ_SPI_DEFAULT 1000000 // spi to 595 shift regs -#define FREQ_I2C0_DEFAULT 100000 // i2c to hub -#define FREQ_I2C1_DEFAULT I2C_HZ // i2c to LED drivers -#define FREQ_TC45_DEFAULT 1000000 // 1 usec resolution +#define PLL_RATIO 47 // mcu frequency ((X+1)MHz) +#define FREQ_DFLL_DEFAULT 48000000 // DFLL frequency / usb clock +#define FREQ_SPI_DEFAULT 1000000 // spi to 595 shift regs +#define FREQ_I2C0_DEFAULT 100000 // i2c to hub +#define FREQ_I2C1_DEFAULT I2C_HZ // i2c to LED drivers +#define FREQ_TC45_DEFAULT 1000000 // 1 usec resolution // I2C1 Set ~Result PWM Time (2x Drivers) // 1000000 1090000 @@ -44,10 +44,10 @@ along with this program. If not, see . #define FREQ_XOSC0 16000000 -#define CHAN_SERCOM_SPI 2 // shift regs -#define CHAN_SERCOM_I2C0 0 // hub -#define CHAN_SERCOM_I2C1 1 // led drivers -#define CHAN_SERCOM_UART 3 // debug util +#define CHAN_SERCOM_SPI 2 // shift regs +#define CHAN_SERCOM_I2C0 0 // hub +#define CHAN_SERCOM_I2C1 1 // led drivers +#define CHAN_SERCOM_UART 3 // debug util // Generator clock channels #define GEN_DPLL0 0 @@ -86,4 +86,4 @@ uint32_t CLK_set_i2c0_freq(uint8_t sercomn, uint32_t freq); uint32_t CLK_set_i2c1_freq(uint8_t sercomn, uint32_t freq); void CLK_init(void); -#endif // _CLKS_H_ +#endif // _CLKS_H_ diff --git a/tmk_core/protocol/arm_atsam/d51_util.c b/tmk_core/protocol/arm_atsam/d51_util.c index df596f7ba242..590323308563 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.c +++ b/tmk_core/protocol/arm_atsam/d51_util.c @@ -34,7 +34,8 @@ void dbg_print(uint32_t x) { while (t >= 0) { p2 = t; p = 1; - while (p2--) p *= 10; + while (p2--) + p *= 10; n = x / p; x -= n * p; if (!n) { @@ -55,7 +56,7 @@ void dbg_print(uint32_t x) { } for (w = DBG_PAUSE; w; w--) - ; // Long pause after number is complete + ; // Long pause after number is complete } // Display unsigned 32-bit number through debug led @@ -91,7 +92,8 @@ void dled_print(uint32_t x, uint8_t long_pause) { while (t >= 0) { p2 = t; p = 1; - while (p2--) p *= 10; + while (p2--) + p *= 10; n = x / p; x -= n * p; if (!n) { @@ -188,12 +190,12 @@ void debug_code_init(void) { DBGC(DC_UNSET); // Configure Ports for EIC - PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; // Input - PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTSET.reg = 1 << DEBUG_BOOT_TRACING_PIN; // High - PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 1; // Input Enable - PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 1; // Pull Enable - PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 1; // Mux Enable - PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; // Mux A + PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; // Input + PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTSET.reg = 1 << DEBUG_BOOT_TRACING_PIN; // High + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 1; // Input Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 1; // Pull Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 1; // Mux Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; // Mux A // Enable CLK_EIC_APB MCLK->APBAMASK.bit.EIC_ = 1; @@ -223,12 +225,12 @@ void debug_code_disable(void) { } // Default port configuration - PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; // Input - PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; // Low - PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 0; // Input Disable - PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 0; // Pull Disable - PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 0; // Mux Disable - PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; // Mux A + PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; // Input + PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; // Low + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 0; // Input Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 0; // Pull Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 0; // Mux Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; // Mux A // Disable CLK_EIC_APB MCLK->APBAMASK.bit.EIC_ = 0; @@ -239,4 +241,4 @@ void debug_code_disable(void) { void debug_code_init(void) {} void debug_code_disable(void) {} -#endif // DEBUG_BOOT_TRACING_ENABLE +#endif // DEBUG_BOOT_TRACING_ENABLE diff --git a/tmk_core/protocol/arm_atsam/d51_util.h b/tmk_core/protocol/arm_atsam/d51_util.h index 89cf338d2340..d301e5541140 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.h +++ b/tmk_core/protocol/arm_atsam/d51_util.h @@ -219,6 +219,6 @@ enum debug_code_list { # define DBGC(n) \ {} -#endif // DEBUG_BOOT_TRACING_ENABLE +#endif // DEBUG_BOOT_TRACING_ENABLE -#endif //_D51_UTIL_H_ +#endif //_D51_UTIL_H_ diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index af046625f433..6b0b9a703bd8 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -26,21 +26,21 @@ along with this program. If not, see . # include "config_led.h" # include "matrix.h" -# define I2C_LED_USE_DMA 1 // Set 1 to use background DMA transfers for leds, Set 0 to use inline software transfers +# define I2C_LED_USE_DMA 1 // Set 1 to use background DMA transfers for leds, Set 0 to use inline software transfers DmacDescriptor dmac_desc; DmacDescriptor dmac_desc_wb; -static uint8_t i2c_led_q[I2C_Q_SIZE]; // I2C queue circular buffer -static uint8_t i2c_led_q_s; // Start of circular buffer -static uint8_t i2c_led_q_e; // End of circular buffer -static uint8_t i2c_led_q_full; // Queue full counter for reset +static uint8_t i2c_led_q[I2C_Q_SIZE]; // I2C queue circular buffer +static uint8_t i2c_led_q_s; // Start of circular buffer +static uint8_t i2c_led_q_e; // End of circular buffer +static uint8_t i2c_led_q_full; // Queue full counter for reset -static uint8_t dma_sendbuf[I2C_DMA_MAX_SEND]; // Data being written to I2C +static uint8_t dma_sendbuf[I2C_DMA_MAX_SEND]; // Data being written to I2C volatile uint8_t i2c_led_q_running; -#endif // !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) +#endif // !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) void i2c0_init(void) { DBGC(DC_I2C0_INIT_BEGIN); @@ -56,23 +56,23 @@ void i2c0_init(void) { // I2C // Note: SW Reset handled in CLK_set_i2c0_freq clks.c - SERCOM0->I2CM.CTRLA.bit.MODE = 5; // Set master mode + SERCOM0->I2CM.CTRLA.bit.MODE = 5; // Set master mode - SERCOM0->I2CM.CTRLA.bit.SPEED = 0; // Set to 1 for Fast-mode Plus (FM+) up to 1 MHz - SERCOM0->I2CM.CTRLA.bit.RUNSTDBY = 1; // Enabled + SERCOM0->I2CM.CTRLA.bit.SPEED = 0; // Set to 1 for Fast-mode Plus (FM+) up to 1 MHz + SERCOM0->I2CM.CTRLA.bit.RUNSTDBY = 1; // Enabled - SERCOM0->I2CM.CTRLA.bit.ENABLE = 1; // Enable the device + SERCOM0->I2CM.CTRLA.bit.ENABLE = 1; // Enable the device while (SERCOM0->I2CM.SYNCBUSY.bit.ENABLE) { DBGC(DC_I2C0_INIT_SYNC_ENABLING); - } // Wait for SYNCBUSY.ENABLE to clear + } // Wait for SYNCBUSY.ENABLE to clear - SERCOM0->I2CM.STATUS.bit.BUSSTATE = 1; // Force into IDLE state + SERCOM0->I2CM.STATUS.bit.BUSSTATE = 1; // Force into IDLE state while (SERCOM0->I2CM.SYNCBUSY.bit.SYSOP) { DBGC(DC_I2C0_INIT_SYNC_SYSOP); } while (SERCOM0->I2CM.STATUS.bit.BUSSTATE != 1) { DBGC(DC_I2C0_INIT_WAIT_IDLE); - } // Wait while not idle + } // Wait while not idle DBGC(DC_I2C0_INIT_COMPLETE); } @@ -139,27 +139,27 @@ void i2c1_init(void) { /* I2C */ // Note: SW Reset handled in CLK_set_i2c1_freq clks.c - SERCOM1->I2CM.CTRLA.bit.MODE = 5; // MODE: Set master mode (No sync) - SERCOM1->I2CM.CTRLA.bit.SPEED = 1; // SPEED: Fm+ up to 1MHz (No sync) - SERCOM1->I2CM.CTRLA.bit.RUNSTDBY = 1; // RUNSTBY: Enabled (No sync) + SERCOM1->I2CM.CTRLA.bit.MODE = 5; // MODE: Set master mode (No sync) + SERCOM1->I2CM.CTRLA.bit.SPEED = 1; // SPEED: Fm+ up to 1MHz (No sync) + SERCOM1->I2CM.CTRLA.bit.RUNSTDBY = 1; // RUNSTBY: Enabled (No sync) - SERCOM1->I2CM.CTRLB.bit.SMEN = 1; // SMEN: Smart mode enabled (For DMA)(No sync) + SERCOM1->I2CM.CTRLB.bit.SMEN = 1; // SMEN: Smart mode enabled (For DMA)(No sync) NVIC_EnableIRQ(SERCOM1_0_IRQn); SERCOM1->I2CM.INTENSET.bit.ERROR = 1; - SERCOM1->I2CM.CTRLA.bit.ENABLE = 1; // ENABLE: Enable the device (sync SYNCBUSY.ENABLE) + SERCOM1->I2CM.CTRLA.bit.ENABLE = 1; // ENABLE: Enable the device (sync SYNCBUSY.ENABLE) while (SERCOM1->I2CM.SYNCBUSY.bit.ENABLE) { DBGC(DC_I2C1_INIT_SYNC_ENABLING); - } // Wait for SYNCBUSY.ENABLE to clear + } // Wait for SYNCBUSY.ENABLE to clear - SERCOM1->I2CM.STATUS.bit.BUSSTATE = 1; // BUSSTATE: Force into IDLE state (sync SYNCBUSY.SYSOP) + SERCOM1->I2CM.STATUS.bit.BUSSTATE = 1; // BUSSTATE: Force into IDLE state (sync SYNCBUSY.SYSOP) while (SERCOM1->I2CM.SYNCBUSY.bit.SYSOP) { DBGC(DC_I2C1_INIT_SYNC_SYSOP); } while (SERCOM1->I2CM.STATUS.bit.BUSSTATE != 1) { DBGC(DC_I2C1_INIT_WAIT_IDLE); - } // Wait while not idle + } // Wait while not idle DBGC(DC_I2C1_INIT_COMPLETE); } @@ -240,7 +240,7 @@ void i2c_led_send_onoff(uint8_t drvid) { } # endif - *issidrv[drvid].onoff = 0; // Force start location offset to zero + *issidrv[drvid].onoff = 0; // Force start location offset to zero i2c1_transmit(issidrv[drvid].addr, issidrv[drvid].onoff, ISSI3733_PG0_BYTES, 0); } @@ -265,7 +265,7 @@ void i2c_led_send_pwm(uint8_t drvid) { } # endif - *issidrv[drvid].pwm = 0; // Force start location offset to zero + *issidrv[drvid].pwm = 0; // Force start location offset to zero i2c1_transmit(issidrv[drvid].addr, issidrv[drvid].pwm, ISSI3733_PG1_BYTES, 0); } @@ -300,12 +300,12 @@ uint8_t I2C3733_Init_Drivers(void) { // Set up master device i2c_led_send_CRWL(0); i2c_led_select_page(0, 3); - i2c_led_send_mode_op_gcr(0, 0, ISSI3733_CR_SSD_NORMAL); // No SYNC due to brightness mismatch with second driver + i2c_led_send_mode_op_gcr(0, 0, ISSI3733_CR_SSD_NORMAL); // No SYNC due to brightness mismatch with second driver // Set up slave device i2c_led_send_CRWL(1); i2c_led_select_page(1, 3); - i2c_led_send_mode_op_gcr(1, 0, ISSI3733_CR_SSD_NORMAL); // No SYNC due to brightness mismatch with first driver and slight flicker at rgb values 1,2 + i2c_led_send_mode_op_gcr(1, 0, ISSI3733_CR_SSD_NORMAL); // No SYNC due to brightness mismatch with first driver and slight flicker at rgb values 1,2 i2c_led_send_CRWL(0); i2c_led_select_page(0, 3); @@ -326,41 +326,41 @@ void I2C_DMAC_LED_Init(void) { DBGC(DC_I2C_DMAC_LED_INIT_BEGIN); // Disable device - dmac->CTRL.bit.DMAENABLE = 0; // Disable DMAC + dmac->CTRL.bit.DMAENABLE = 0; // Disable DMAC while (dmac->CTRL.bit.DMAENABLE) { - } // Wait for disabled state in case of ongoing transfers - dmac->CTRL.bit.SWRST = 1; // Software Reset DMAC + } // Wait for disabled state in case of ongoing transfers + dmac->CTRL.bit.SWRST = 1; // Software Reset DMAC while (dmac->CTRL.bit.SWRST) { - } // Wait for software reset to complete + } // Wait for software reset to complete // Configure device - dmac->BASEADDR.reg = (uint32_t)&dmac_desc; // Set descriptor base address - dmac->WRBADDR.reg = (uint32_t)&dmac_desc_wb; // Set descriptor write back address - dmac->CTRL.reg |= 0x0f00; // Handle all priorities (LVL0-3) + dmac->BASEADDR.reg = (uint32_t)&dmac_desc; // Set descriptor base address + dmac->WRBADDR.reg = (uint32_t)&dmac_desc_wb; // Set descriptor write back address + dmac->CTRL.reg |= 0x0f00; // Handle all priorities (LVL0-3) // Disable channel - dmac->Channel[0].CHCTRLA.bit.ENABLE = 0; // Disable the channel + dmac->Channel[0].CHCTRLA.bit.ENABLE = 0; // Disable the channel while (dmac->Channel[0].CHCTRLA.bit.ENABLE) { - } // Wait for disabled state in case of ongoing transfers - dmac->Channel[0].CHCTRLA.bit.SWRST = 1; // Software Reset the channel + } // Wait for disabled state in case of ongoing transfers + dmac->Channel[0].CHCTRLA.bit.SWRST = 1; // Software Reset the channel while (dmac->Channel[0].CHCTRLA.bit.SWRST) { - } // Wait for software reset to complete + } // Wait for software reset to complete // Configure channel - dmac->Channel[0].CHCTRLA.bit.THRESHOLD = 0; // 1BEAT - dmac->Channel[0].CHCTRLA.bit.BURSTLEN = 0; // SINGLE - dmac->Channel[0].CHCTRLA.bit.TRIGACT = 2; // BURST - dmac->Channel[0].CHCTRLA.bit.TRIGSRC = SERCOM1_DMAC_ID_TX; // Trigger source - dmac->Channel[0].CHCTRLA.bit.RUNSTDBY = 1; // Run in standby + dmac->Channel[0].CHCTRLA.bit.THRESHOLD = 0; // 1BEAT + dmac->Channel[0].CHCTRLA.bit.BURSTLEN = 0; // SINGLE + dmac->Channel[0].CHCTRLA.bit.TRIGACT = 2; // BURST + dmac->Channel[0].CHCTRLA.bit.TRIGSRC = SERCOM1_DMAC_ID_TX; // Trigger source + dmac->Channel[0].CHCTRLA.bit.RUNSTDBY = 1; // Run in standby NVIC_EnableIRQ(DMAC_0_IRQn); dmac->Channel[0].CHINTENSET.bit.TCMPL = 1; dmac->Channel[0].CHINTENSET.bit.TERR = 1; // Enable device - dmac->CTRL.bit.DMAENABLE = 1; // Enable DMAC + dmac->CTRL.bit.DMAENABLE = 1; // Enable DMAC while (dmac->CTRL.bit.DMAENABLE == 0) { - } // Wait for enable state + } // Wait for enable state DBGC(DC_I2C_DMAC_LED_INIT_COMPLETE); } @@ -377,14 +377,14 @@ void I2C3733_Control_Set(uint8_t state) { } void i2c_led_desc_defaults(void) { - dmac_desc.BTCTRL.bit.STEPSIZE = 0; // SRCINC used in favor for auto 1 inc - dmac_desc.BTCTRL.bit.STEPSEL = 0; // SRCINC used in favor for auto 1 inc - dmac_desc.BTCTRL.bit.DSTINC = 0; // The Destination Address Increment is disabled - dmac_desc.BTCTRL.bit.SRCINC = 1; // The Source Address Increment is enabled (Inc by 1) - dmac_desc.BTCTRL.bit.BEATSIZE = 0; // 8-bit bus transfer - dmac_desc.BTCTRL.bit.BLOCKACT = 0; // Channel will be disabled if it is the last block transfer in the transaction - dmac_desc.BTCTRL.bit.EVOSEL = 0; // Event generation disabled - dmac_desc.BTCTRL.bit.VALID = 1; // Set dmac valid + dmac_desc.BTCTRL.bit.STEPSIZE = 0; // SRCINC used in favor for auto 1 inc + dmac_desc.BTCTRL.bit.STEPSEL = 0; // SRCINC used in favor for auto 1 inc + dmac_desc.BTCTRL.bit.DSTINC = 0; // The Destination Address Increment is disabled + dmac_desc.BTCTRL.bit.SRCINC = 1; // The Source Address Increment is enabled (Inc by 1) + dmac_desc.BTCTRL.bit.BEATSIZE = 0; // 8-bit bus transfer + dmac_desc.BTCTRL.bit.BLOCKACT = 0; // Channel will be disabled if it is the last block transfer in the transaction + dmac_desc.BTCTRL.bit.EVOSEL = 0; // Event generation disabled + dmac_desc.BTCTRL.bit.VALID = 1; // Set dmac valid } void i2c_led_prepare_send_dma(uint8_t *data, uint8_t len) { @@ -397,9 +397,9 @@ void i2c_led_prepare_send_dma(uint8_t *data, uint8_t len) { } void i2c_led_begin_dma(uint8_t drvid) { - DMAC->Channel[0].CHCTRLA.bit.ENABLE = 1; // Enable the channel + DMAC->Channel[0].CHCTRLA.bit.ENABLE = 1; // Enable the channel - SERCOM1->I2CM.ADDR.reg = (dmac_desc.BTCNT.reg << 16) | 0x2000 | issidrv[drvid].addr; // Begin transfer + SERCOM1->I2CM.ADDR.reg = (dmac_desc.BTCNT.reg << 16) | 0x2000 | issidrv[drvid].addr; // Begin transfer } void i2c_led_send_CRWL_dma(uint8_t drvid) { @@ -429,7 +429,7 @@ void i2c_led_send_GCR_dma(uint8_t drvid) { void i2c_led_send_pwm_dma(uint8_t drvid) { // Note: This copies the CURRENT pwm buffer, which may be getting modified memcpy(dma_sendbuf, issidrv[drvid].pwm, ISSI3733_PG1_BYTES); - *dma_sendbuf = 0; // Force start location offset to zero + *dma_sendbuf = 0; // Force start location offset to zero i2c_led_prepare_send_dma(dma_sendbuf, ISSI3733_PG1_BYTES); i2c_led_begin_dma(drvid); @@ -438,7 +438,7 @@ void i2c_led_send_pwm_dma(uint8_t drvid) { void i2c_led_send_onoff_dma(uint8_t drvid) { // Note: This copies the CURRENT onoff buffer, which may be getting modified memcpy(dma_sendbuf, issidrv[drvid].onoff, ISSI3733_PG0_BYTES); - *dma_sendbuf = 0; // Force start location offset to zero + *dma_sendbuf = 0; // Force start location offset to zero i2c_led_prepare_send_dma(dma_sendbuf, ISSI3733_PG0_BYTES); i2c_led_begin_dma(drvid); @@ -452,12 +452,16 @@ void i2c_led_q_init(void) { i2c_led_q_full = 0; } -uint8_t i2c_led_q_isempty(void) { return i2c_led_q_s == i2c_led_q_e; } +uint8_t i2c_led_q_isempty(void) { + return i2c_led_q_s == i2c_led_q_e; +} -uint8_t i2c_led_q_size(void) { return (i2c_led_q_e - i2c_led_q_s) % I2C_Q_SIZE; } +uint8_t i2c_led_q_size(void) { + return (i2c_led_q_e - i2c_led_q_s) % I2C_Q_SIZE; +} uint8_t i2c_led_q_available(void) { - return I2C_Q_SIZE - i2c_led_q_size() - 1; // Never allow end to meet start + return I2C_Q_SIZE - i2c_led_q_size() - 1; // Never allow end to meet start } void i2c_led_q_add(uint8_t cmd) { @@ -466,11 +470,11 @@ void i2c_led_q_add(uint8_t cmd) { // Assign command i2c_led_q[i2c_led_q_e] = cmd; - i2c_led_q_e = (i2c_led_q_e + 1) % I2C_Q_SIZE; // Move end up one or wrap + i2c_led_q_e = (i2c_led_q_e + 1) % I2C_Q_SIZE; // Move end up one or wrap } void i2c_led_q_s_advance(void) { - i2c_led_q_s = (i2c_led_q_s + 1) % I2C_Q_SIZE; // Move start up one or wrap + i2c_led_q_s = (i2c_led_q_s + 1) % I2C_Q_SIZE; // Move start up one or wrap } // Always request room before adding commands @@ -480,7 +484,7 @@ uint8_t i2c_led_q_request_room(uint8_t request_size) { if (request_size > i2c_led_q_available()) { i2c_led_q_full++; - if (i2c_led_q_full >= 100) // Give the queue a chance to clear up + if (i2c_led_q_full >= 100) // Give the queue a chance to clear up { DBG_LED_ON; I2C_DMAC_LED_Init(); @@ -554,7 +558,7 @@ uint8_t i2c_led_q_run(void) { # endif } - i2c_led_q_s_advance(); // Advance last run command or if the command byte was not serviced + i2c_led_q_s_advance(); // Advance last run command or if the command byte was not serviced # if I2C_LED_USE_DMA != 1 } @@ -583,4 +587,4 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t *data, uint16_t length, return ret ? I2C_STATUS_SUCCESS : I2C_STATUS_ERROR; } -#endif // !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) +#endif // !defined(MD_BOOTLOADER) && defined(RGB_MATRIX_ENABLE) diff --git a/tmk_core/protocol/arm_atsam/i2c_master.h b/tmk_core/protocol/arm_atsam/i2c_master.h index e11235d4476a..5459923de43d 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.h +++ b/tmk_core/protocol/arm_atsam/i2c_master.h @@ -95,7 +95,7 @@ void i2c1_init(void); uint8_t i2c1_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout); void i2c1_stop(void); -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER void i2c0_init(void); uint8_t i2c0_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout); @@ -110,4 +110,4 @@ typedef int16_t i2c_status_t; void i2c_init(void); i2c_status_t i2c_transmit(uint8_t address, const uint8_t *data, uint16_t length, uint16_t timeout); -#endif // _I2C_MASTER_H_ +#endif // _I2C_MASTER_H_ diff --git a/tmk_core/protocol/arm_atsam/issi3733_driver.h b/tmk_core/protocol/arm_atsam/issi3733_driver.h index bd29fe76b6b5..c01f147e13dd 100644 --- a/tmk_core/protocol/arm_atsam/issi3733_driver.h +++ b/tmk_core/protocol/arm_atsam/issi3733_driver.h @@ -20,29 +20,29 @@ along with this program. If not, see . // ISII3733 Registers -#define ISSI3733_CMDR 0xFD // Command Register (Write Only) - -#define ISSI3733_CMDRWL 0xFE // Command Register Write Lock (Read/Write) -#define ISSI3733_CMDRWL_WRITE_DISABLE 0x00 // Lock register -#define ISSI3733_CMDRWL_WRITE_ENABLE_ONCE 0xC5 // Enable one write to register then reset to locked - -#define ISSI3733_IMR 0xF0 // Interrupt Mask Register (Write Only) -#define ISSI3733_IMR_IAC_ON 0x08 // Auto Clear Interrupt Bit - Interrupt auto clear when INTB stay low exceeds 8ms -#define ISSI3733_IMR_IAB_ON 0x04 // Auto Breath Interrupt Bit - Enable auto breath loop finish interrupt -#define ISSI3733_IMR_IS_ON 0x02 // Dot Short Interrupt Bit - Enable dot short interrupt -#define ISSI3733_IMR_IO_ON 0x01 // Dot Open Interrupt Bit - Enable dot open interrupt - -#define ISSI3733_ISR 0xF1 // Interrupt Status Register (Read Only) -#define ISSI3733_ISR_ABM3_FINISH 0x10 // Auto Breath Mode 3 Finish Bit - ABM3 finished -#define ISSI3733_ISR_ABM2_FINISH 0x08 // Auto Breath Mode 2 Finish Bit - ABM2 finished -#define ISSI3733_ISR_ABM1_FINISH 0x04 // Auto Breath Mode 1 Finish Bit - ABM1 finished -#define ISSI3733_ISR_SB 0x02 // Short Bit - Shorted -#define ISSI3733_ISR_OB 0x01 // Open Bit - Opened - -#define ISSI3733_PG0 0x00 // LED Control Register -#define ISSI3733_PG1 0x01 // PWM Register -#define ISSI3733_PG2 0x02 // Auto Breath Mode Register -#define ISSI3733_PG3 0x03 // Function Register +#define ISSI3733_CMDR 0xFD // Command Register (Write Only) + +#define ISSI3733_CMDRWL 0xFE // Command Register Write Lock (Read/Write) +#define ISSI3733_CMDRWL_WRITE_DISABLE 0x00 // Lock register +#define ISSI3733_CMDRWL_WRITE_ENABLE_ONCE 0xC5 // Enable one write to register then reset to locked + +#define ISSI3733_IMR 0xF0 // Interrupt Mask Register (Write Only) +#define ISSI3733_IMR_IAC_ON 0x08 // Auto Clear Interrupt Bit - Interrupt auto clear when INTB stay low exceeds 8ms +#define ISSI3733_IMR_IAB_ON 0x04 // Auto Breath Interrupt Bit - Enable auto breath loop finish interrupt +#define ISSI3733_IMR_IS_ON 0x02 // Dot Short Interrupt Bit - Enable dot short interrupt +#define ISSI3733_IMR_IO_ON 0x01 // Dot Open Interrupt Bit - Enable dot open interrupt + +#define ISSI3733_ISR 0xF1 // Interrupt Status Register (Read Only) +#define ISSI3733_ISR_ABM3_FINISH 0x10 // Auto Breath Mode 3 Finish Bit - ABM3 finished +#define ISSI3733_ISR_ABM2_FINISH 0x08 // Auto Breath Mode 2 Finish Bit - ABM2 finished +#define ISSI3733_ISR_ABM1_FINISH 0x04 // Auto Breath Mode 1 Finish Bit - ABM1 finished +#define ISSI3733_ISR_SB 0x02 // Short Bit - Shorted +#define ISSI3733_ISR_OB 0x01 // Open Bit - Opened + +#define ISSI3733_PG0 0x00 // LED Control Register +#define ISSI3733_PG1 0x01 // PWM Register +#define ISSI3733_PG2 0x02 // Auto Breath Mode Register +#define ISSI3733_PG3 0x03 // Function Register #define ISSI3733_PG_ONOFF ISSI3733_PG0 #define ISSI3733_PG_OR ISSI3733_PG0 @@ -51,88 +51,88 @@ along with this program. If not, see . #define ISSI3733_PG_ABM ISSI3733_PG2 #define ISSI3733_PG_FN ISSI3733_PG3 -#define ISSI3733_CR 0x00 // Configuration Register +#define ISSI3733_CR 0x00 // Configuration Register // PG3: Configuration Register: Synchronize Configuration -#define ISSI3733_CR_SYNC_MASTER 0x40 // Master -#define ISSI3733_CR_SYNC_SLAVE 0x80 // Slave -#define ISSI3733_CR_SYNC_HIGH_IMP 0xC0 // High Impedance +#define ISSI3733_CR_SYNC_MASTER 0x40 // Master +#define ISSI3733_CR_SYNC_SLAVE 0x80 // Slave +#define ISSI3733_CR_SYNC_HIGH_IMP 0xC0 // High Impedance // PG3: Configuration Register: Open/Short Detection Enable Bit //#define ISSI3733_CR_OSD_DISABLE 0x00 //Disable open/short detection -#define ISSI3733_CR_OSD_ENABLE 0x04 // Enable open/short detection +#define ISSI3733_CR_OSD_ENABLE 0x04 // Enable open/short detection // PG3: Configuration Register: Auto Breath Enable //#define ISSI3733_CR_B_EN_PWM 0x00 //PWM Mode Enable -#define ISSI3733_CR_B_EN_AUTO 0x02 // Auto Breath Mode Enable +#define ISSI3733_CR_B_EN_AUTO 0x02 // Auto Breath Mode Enable // PG3: Configuration Register: Software Shutdown Control //#define ISSI3733_CR_SSD_SHUTDOWN 0x00 //Software shutdown -#define ISSI3733_CR_SSD_NORMAL 0x01 // Normal operation +#define ISSI3733_CR_SSD_NORMAL 0x01 // Normal operation -#define ISSI3733_GCCR 0x01 // Global Current Control Register +#define ISSI3733_GCCR 0x01 // Global Current Control Register // 1 Byte, Iout = (GCC / 256) * (840 / Rext) // TODO: Give user define for Rext // PG3: Auto Breath Control Register 1 -#define ISSI3733_ABCR1_ABM1 0x02 // Auto Breath Control Register 1 of ABM-1 -#define ISSI3733_ABCR1_ABM2 0x06 // Auto Breath Control Register 1 of ABM-2 -#define ISSI3733_ABCR1_ABM3 0x0A // Auto Breath Control Register 1 of ABM-3 +#define ISSI3733_ABCR1_ABM1 0x02 // Auto Breath Control Register 1 of ABM-1 +#define ISSI3733_ABCR1_ABM2 0x06 // Auto Breath Control Register 1 of ABM-2 +#define ISSI3733_ABCR1_ABM3 0x0A // Auto Breath Control Register 1 of ABM-3 // Rise time -#define ISSI3733_ABCR1_T1_0021 0x00 // 0.21s -#define ISSI3733_ABCR1_T1_0042 0x20 // 0.42s -#define ISSI3733_ABCR1_T1_0084 0x40 // 0.84s -#define ISSI3733_ABCR1_T1_0168 0x60 // 1.68s -#define ISSI3733_ABCR1_T1_0336 0x80 // 3.36s -#define ISSI3733_ABCR1_T1_0672 0xA0 // 6.72s -#define ISSI3733_ABCR1_T1_1344 0xC0 // 13.44s -#define ISSI3733_ABCR1_T1_2688 0xE0 // 26.88s +#define ISSI3733_ABCR1_T1_0021 0x00 // 0.21s +#define ISSI3733_ABCR1_T1_0042 0x20 // 0.42s +#define ISSI3733_ABCR1_T1_0084 0x40 // 0.84s +#define ISSI3733_ABCR1_T1_0168 0x60 // 1.68s +#define ISSI3733_ABCR1_T1_0336 0x80 // 3.36s +#define ISSI3733_ABCR1_T1_0672 0xA0 // 6.72s +#define ISSI3733_ABCR1_T1_1344 0xC0 // 13.44s +#define ISSI3733_ABCR1_T1_2688 0xE0 // 26.88s // Max value time -#define ISSI3733_ABCR1_T2_0000 0x00 // 0s -#define ISSI3733_ABCR1_T2_0021 0x02 // 0.21s -#define ISSI3733_ABCR1_T2_0042 0x04 // 0.42s -#define ISSI3733_ABCR1_T2_0084 0x06 // 0.84s -#define ISSI3733_ABCR1_T2_0168 0x08 // 1.68s -#define ISSI3733_ABCR1_T2_0336 0x0A // 3.36s -#define ISSI3733_ABCR1_T2_0672 0x0C // 6.72s -#define ISSI3733_ABCR1_T2_1344 0x0E // 13.44s -#define ISSI3733_ABCR1_T2_2688 0x10 // 26.88s +#define ISSI3733_ABCR1_T2_0000 0x00 // 0s +#define ISSI3733_ABCR1_T2_0021 0x02 // 0.21s +#define ISSI3733_ABCR1_T2_0042 0x04 // 0.42s +#define ISSI3733_ABCR1_T2_0084 0x06 // 0.84s +#define ISSI3733_ABCR1_T2_0168 0x08 // 1.68s +#define ISSI3733_ABCR1_T2_0336 0x0A // 3.36s +#define ISSI3733_ABCR1_T2_0672 0x0C // 6.72s +#define ISSI3733_ABCR1_T2_1344 0x0E // 13.44s +#define ISSI3733_ABCR1_T2_2688 0x10 // 26.88s // PG3: Auto Breath Control Register 2 -#define ISSI3733_ABCR2_ABM1 0x03 // Auto Breath Control Register 2 of ABM-1 -#define ISSI3733_ABCR2_ABM2 0x07 // Auto Breath Control Register 2 of ABM-2 -#define ISSI3733_ABCR2_ABM3 0x0B // Auto Breath Control Register 2 of ABM-3 +#define ISSI3733_ABCR2_ABM1 0x03 // Auto Breath Control Register 2 of ABM-1 +#define ISSI3733_ABCR2_ABM2 0x07 // Auto Breath Control Register 2 of ABM-2 +#define ISSI3733_ABCR2_ABM3 0x0B // Auto Breath Control Register 2 of ABM-3 // Fall time -#define ISSI3733_ABCR2_T3_0021 0x00 // 0.21s -#define ISSI3733_ABCR2_T3_0042 0x20 // 0.42s -#define ISSI3733_ABCR2_T3_0084 0x40 // 0.84s -#define ISSI3733_ABCR2_T3_0168 0x60 // 1.68s -#define ISSI3733_ABCR2_T3_0336 0x80 // 3.36s -#define ISSI3733_ABCR2_T3_0672 0xA0 // 6.72s -#define ISSI3733_ABCR2_T3_1344 0xC0 // 13.44s -#define ISSI3733_ABCR2_T3_2688 0xE0 // 26.88s +#define ISSI3733_ABCR2_T3_0021 0x00 // 0.21s +#define ISSI3733_ABCR2_T3_0042 0x20 // 0.42s +#define ISSI3733_ABCR2_T3_0084 0x40 // 0.84s +#define ISSI3733_ABCR2_T3_0168 0x60 // 1.68s +#define ISSI3733_ABCR2_T3_0336 0x80 // 3.36s +#define ISSI3733_ABCR2_T3_0672 0xA0 // 6.72s +#define ISSI3733_ABCR2_T3_1344 0xC0 // 13.44s +#define ISSI3733_ABCR2_T3_2688 0xE0 // 26.88s // Min value time -#define ISSI3733_ABCR2_T4_0000 0x00 // 0s -#define ISSI3733_ABCR2_T4_0021 0x02 // 0.21s -#define ISSI3733_ABCR2_T4_0042 0x04 // 0.42s -#define ISSI3733_ABCR2_T4_0084 0x06 // 0.84s -#define ISSI3733_ABCR2_T4_0168 0x08 // 1.68s -#define ISSI3733_ABCR2_T4_0336 0x0A // 3.36s -#define ISSI3733_ABCR2_T4_0672 0x0C // 6.72s -#define ISSI3733_ABCR2_T4_1344 0x0E // 13.44s -#define ISSI3733_ABCR2_T4_2688 0x10 // 26.88s -#define ISSI3733_ABCR2_T4_5376 0x12 // 53.76s -#define ISSI3733_ABCR2_T4_10752 0x14 // 107.52s +#define ISSI3733_ABCR2_T4_0000 0x00 // 0s +#define ISSI3733_ABCR2_T4_0021 0x02 // 0.21s +#define ISSI3733_ABCR2_T4_0042 0x04 // 0.42s +#define ISSI3733_ABCR2_T4_0084 0x06 // 0.84s +#define ISSI3733_ABCR2_T4_0168 0x08 // 1.68s +#define ISSI3733_ABCR2_T4_0336 0x0A // 3.36s +#define ISSI3733_ABCR2_T4_0672 0x0C // 6.72s +#define ISSI3733_ABCR2_T4_1344 0x0E // 13.44s +#define ISSI3733_ABCR2_T4_2688 0x10 // 26.88s +#define ISSI3733_ABCR2_T4_5376 0x12 // 53.76s +#define ISSI3733_ABCR2_T4_10752 0x14 // 107.52s // PG3: Auto Breath Control Register 3 -#define ISSI3733_ABCR3_ABM1 0x04 // Auto Breath Control Register 3 of ABM-1 -#define ISSI3733_ABCR3_ABM2 0x08 // Auto Breath Control Register 3 of ABM-2 -#define ISSI3733_ABCR3_ABM3 0x0C // Auto Breath Control Register 3 of ABM-3 +#define ISSI3733_ABCR3_ABM1 0x04 // Auto Breath Control Register 3 of ABM-1 +#define ISSI3733_ABCR3_ABM2 0x08 // Auto Breath Control Register 3 of ABM-2 +#define ISSI3733_ABCR3_ABM3 0x0C // Auto Breath Control Register 3 of ABM-3 #define ISSI3733_ABCR3_LTA_LOOP_ENDLESS 0x00 #define ISSI3733_ABCR3_LTA_LOOP_1 0x01 @@ -158,44 +158,44 @@ along with this program. If not, see . #define ISSI3733_ABCR3_LB_T4 0x30 // Loop End -#define ISSI3733_ABCR3_LE_T3 0x00 // End at Off state -#define ISSI3733_ABCR3_LE_T1 0x40 // End at On State +#define ISSI3733_ABCR3_LE_T3 0x00 // End at Off state +#define ISSI3733_ABCR3_LE_T1 0x40 // End at On State // PG3: Auto Breath Control Register 4 -#define ISSI3733_ABCR4_ABM1 0x05 // Auto Breath Control Register 4 of ABM-1 -#define ISSI3733_ABCR4_ABM2 0x09 // Auto Breath Control Register 4 of ABM-2 -#define ISSI3733_ABCR4_ABM3 0x0D // Auto Breath Control Register 4 of ABM-3 +#define ISSI3733_ABCR4_ABM1 0x05 // Auto Breath Control Register 4 of ABM-1 +#define ISSI3733_ABCR4_ABM2 0x09 // Auto Breath Control Register 4 of ABM-2 +#define ISSI3733_ABCR4_ABM3 0x0D // Auto Breath Control Register 4 of ABM-3 #define ISSI3733_ABCR4_LTB_LOOP_ENDLESS 0x00 // Or 8bit loop times // PG3: Time Update Register #define ISSI3733_TUR 0x0E -#define ISSI3733_TUR_UPDATE 0x00 // Write to update 02h~0Dh time registers after configuring +#define ISSI3733_TUR_UPDATE 0x00 // Write to update 02h~0Dh time registers after configuring // PG3: SWy Pull-Up Resistor Selection Register #define ISSI3733_SWYR_PUR 0x0F -#define ISSI3733_SWYR_PUR_NONE 0x00 // No pull-up resistor -#define ISSI3733_SWYR_PUR_500 0x01 // 0.5k Ohm -#define ISSI3733_SWYR_PUR_1000 0x02 // 1.0k Ohm -#define ISSI3733_SWYR_PUR_2000 0x03 // 2.0k Ohm -#define ISSI3733_SWYR_PUR_4000 0x04 // 4.0k Ohm -#define ISSI3733_SWYR_PUR_8000 0x05 // 8.0k Ohm -#define ISSI3733_SWYR_PUR_16000 0x06 // 16k Ohm -#define ISSI3733_SWYR_PUR_32000 0x07 // 32k Ohm +#define ISSI3733_SWYR_PUR_NONE 0x00 // No pull-up resistor +#define ISSI3733_SWYR_PUR_500 0x01 // 0.5k Ohm +#define ISSI3733_SWYR_PUR_1000 0x02 // 1.0k Ohm +#define ISSI3733_SWYR_PUR_2000 0x03 // 2.0k Ohm +#define ISSI3733_SWYR_PUR_4000 0x04 // 4.0k Ohm +#define ISSI3733_SWYR_PUR_8000 0x05 // 8.0k Ohm +#define ISSI3733_SWYR_PUR_16000 0x06 // 16k Ohm +#define ISSI3733_SWYR_PUR_32000 0x07 // 32k Ohm // PG3: CSx Pull-Down Resistor Selection Register #define ISSI3733_CSXR_PDR 0x10 -#define ISSI3733_CSXR_PDR_NONE 0x00 // No pull-down resistor -#define ISSI3733_CSXR_PDR_500 0x01 // 0.5k Ohm -#define ISSI3733_CSXR_PDR_1000 0x02 // 1.0k Ohm -#define ISSI3733_CSXR_PDR_2000 0x03 // 2.0k Ohm -#define ISSI3733_CSXR_PDR_4000 0x04 // 4.0k Ohm -#define ISSI3733_CSXR_PDR_8000 0x05 // 8.0k Ohm -#define ISSI3733_CSXR_PDR_16000 0x06 // 16k Ohm -#define ISSI3733_CSXR_PDR_32000 0x07 // 32k Ohm +#define ISSI3733_CSXR_PDR_NONE 0x00 // No pull-down resistor +#define ISSI3733_CSXR_PDR_500 0x01 // 0.5k Ohm +#define ISSI3733_CSXR_PDR_1000 0x02 // 1.0k Ohm +#define ISSI3733_CSXR_PDR_2000 0x03 // 2.0k Ohm +#define ISSI3733_CSXR_PDR_4000 0x04 // 4.0k Ohm +#define ISSI3733_CSXR_PDR_8000 0x05 // 8.0k Ohm +#define ISSI3733_CSXR_PDR_16000 0x06 // 16k Ohm +#define ISSI3733_CSXR_PDR_32000 0x07 // 32k Ohm // PG3: Reset Register -#define ISSI3733_RR 0x11 // Read to reset all registers to default values +#define ISSI3733_RR 0x11 // Read to reset all registers to default values -#endif //_ISSI3733_DRIVER_H_ +#endif //_ISSI3733_DRIVER_H_ diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index de12821a7472..d092da86826c 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -31,7 +31,7 @@ along with this program. If not, see . // From keyboard's directory #include "config_led.h" -uint8_t g_usb_state = USB_FSMSTATUS_FSMSTATE_OFF_Val; // Saved USB state from hardware value to detect changes +uint8_t g_usb_state = USB_FSMSTATUS_FSMSTATE_OFF_Val; // Saved USB state from hardware value to detect changes void main_subtasks(void); uint8_t keyboard_leds(void); @@ -42,7 +42,7 @@ void send_consumer(uint16_t data); #ifdef DEFERRED_EXEC_ENABLE void deferred_exec_task(void); -#endif // DEFERRED_EXEC_ENABLE +#endif // DEFERRED_EXEC_ENABLE host_driver_t arm_atsam_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer}; @@ -53,7 +53,7 @@ uint8_t keyboard_leds(void) { if (keymap_config.nkro) return udi_hid_nkro_report_set; else -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE return udi_hid_kbd_report_set; } @@ -62,10 +62,10 @@ void send_keyboard(report_keyboard_t *report) { #ifdef NKRO_ENABLE if (!keymap_config.nkro) { -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE while (udi_hid_kbd_b_report_trans_ongoing) { main_subtasks(); - } // Run other tasks while waiting for USB to be free + } // Run other tasks while waiting for USB to be free irqflags = __get_PRIMASK(); __disable_irq(); @@ -81,7 +81,7 @@ void send_keyboard(report_keyboard_t *report) { } else { while (udi_hid_nkro_b_report_trans_ongoing) { main_subtasks(); - } // Run other tasks while waiting for USB to be free + } // Run other tasks while waiting for USB to be free irqflags = __get_PRIMASK(); __disable_irq(); @@ -94,7 +94,7 @@ void send_keyboard(report_keyboard_t *report) { __DMB(); __set_PRIMASK(irqflags); } -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE } void send_mouse(report_mouse_t *report) { @@ -111,7 +111,7 @@ void send_mouse(report_mouse_t *report) { __DMB(); __set_PRIMASK(irqflags); -#endif // MOUSEKEY_ENABLE +#endif // MOUSEKEY_ENABLE } #ifdef EXTRAKEY_ENABLE @@ -130,18 +130,18 @@ void send_extra(uint8_t report_id, uint16_t data) { __DMB(); __set_PRIMASK(irqflags); } -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE void send_system(uint16_t data) { #ifdef EXTRAKEY_ENABLE send_extra(REPORT_ID_SYSTEM, data); -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE } void send_consumer(uint16_t data) { #ifdef EXTRAKEY_ENABLE send_extra(REPORT_ID_CONSUMER, data); -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE } #ifdef CONSOLE_ENABLE @@ -158,81 +158,81 @@ int8_t sendchar(uint8_t c) { void main_subtask_console_flush(void) { while (udi_hid_con_b_report_trans_ongoing) { - } // Wait for any previous transfers to complete + } // Wait for any previous transfers to complete uint16_t result = console_printbuf_len; uint32_t irqflags; - char * pconbuf = console_printbuf; // Pointer to start send from - int send_out = CONSOLE_EPSIZE; // Bytes to send per transfer + char * pconbuf = console_printbuf; // Pointer to start send from + int send_out = CONSOLE_EPSIZE; // Bytes to send per transfer - while (result > 0) { // While not error and bytes remain + while (result > 0) { // While not error and bytes remain while (udi_hid_con_b_report_trans_ongoing) { - } // Wait for any previous transfers to complete + } // Wait for any previous transfers to complete irqflags = __get_PRIMASK(); __disable_irq(); __DMB(); - if (result < CONSOLE_EPSIZE) { // If remaining bytes are less than console epsize - memset(udi_hid_con_report, 0, CONSOLE_EPSIZE); // Clear the buffer - send_out = result; // Send remaining size + if (result < CONSOLE_EPSIZE) { // If remaining bytes are less than console epsize + memset(udi_hid_con_report, 0, CONSOLE_EPSIZE); // Clear the buffer + send_out = result; // Send remaining size } - memcpy(udi_hid_con_report, pconbuf, send_out); // Copy data into the send buffer + memcpy(udi_hid_con_report, pconbuf, send_out); // Copy data into the send buffer - udi_hid_con_b_report_valid = 1; // Set report valid - udi_hid_con_send_report(); // Send report + udi_hid_con_b_report_valid = 1; // Set report valid + udi_hid_con_send_report(); // Send report __DMB(); __set_PRIMASK(irqflags); - result -= send_out; // Decrement result by bytes sent - pconbuf += send_out; // Increment buffer point by bytes sent + result -= send_out; // Decrement result by bytes sent + pconbuf += send_out; // Increment buffer point by bytes sent } console_printbuf_len = 0; } -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE void main_subtask_usb_state(void) { - static uint64_t fsmstate_on_delay = 0; // Delay timer to be sure USB is actually operating before bringing up hardware - uint8_t fsmstate_now = USB->DEVICE.FSMSTATUS.reg; // Current state from hardware register + static uint64_t fsmstate_on_delay = 0; // Delay timer to be sure USB is actually operating before bringing up hardware + uint8_t fsmstate_now = USB->DEVICE.FSMSTATUS.reg; // Current state from hardware register - if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) // If USB SUSPENDED + if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) // If USB SUSPENDED { - fsmstate_on_delay = 0; // Clear ON delay timer + fsmstate_on_delay = 0; // Clear ON delay timer - if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) // If previously not SUSPENDED + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) // If previously not SUSPENDED { - suspend_power_down(); // Run suspend routine - g_usb_state = fsmstate_now; // Save current USB state + suspend_power_down(); // Run suspend routine + g_usb_state = fsmstate_now; // Save current USB state } - } else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) // Else if USB SLEEPING + } else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) // Else if USB SLEEPING { - fsmstate_on_delay = 0; // Clear ON delay timer + fsmstate_on_delay = 0; // Clear ON delay timer - if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SLEEP_Val) // If previously not SLEEPING + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SLEEP_Val) // If previously not SLEEPING { - suspend_power_down(); // Run suspend routine - g_usb_state = fsmstate_now; // Save current USB state + suspend_power_down(); // Run suspend routine + g_usb_state = fsmstate_now; // Save current USB state } - } else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_ON_Val) // Else if USB ON + } else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_ON_Val) // Else if USB ON { - if (g_usb_state != USB_FSMSTATUS_FSMSTATE_ON_Val) // If previously not ON + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_ON_Val) // If previously not ON { - if (fsmstate_on_delay == 0) // If ON delay timer is cleared + if (fsmstate_on_delay == 0) // If ON delay timer is cleared { - fsmstate_on_delay = timer_read64() + 250; // Set ON delay timer - } else if (timer_read64() > fsmstate_on_delay) // Else if ON delay timer is active and timed out + fsmstate_on_delay = timer_read64() + 250; // Set ON delay timer + } else if (timer_read64() > fsmstate_on_delay) // Else if ON delay timer is active and timed out { - suspend_wakeup_init(); // Run wakeup routine - g_usb_state = fsmstate_now; // Save current USB state + suspend_wakeup_init(); // Run wakeup routine + g_usb_state = fsmstate_now; // Save current USB state } } - } else // Else if USB is in a state not being tracked + } else // Else if USB is in a state not being tracked { - fsmstate_on_delay = 0; // Clear ON delay timer + fsmstate_on_delay = 0; // Clear ON delay timer } } @@ -262,7 +262,9 @@ void main_subtask_usb_extra_device(void) { } #ifdef RAW_ENABLE -void main_subtask_raw(void) { udi_hid_raw_receive_report(); } +void main_subtask_raw(void) { + udi_hid_raw_receive_report(); +} #endif void main_subtasks(void) { @@ -296,7 +298,7 @@ int main(void) { #ifdef RGB_MATRIX_ENABLE i2c1_init(); -#endif // RGB_MATRIX_ENABLE +#endif // RGB_MATRIX_ENABLE matrix_init(); @@ -325,8 +327,9 @@ int main(void) { i2c_led_q_init(); - for (uint8_t drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) I2C_LED_Q_ONOFF(drvid); // Queue data -#endif // RGB_MATRIX_ENABLE + for (uint8_t drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) + I2C_LED_Q_ONOFF(drvid); // Queue data +#endif // RGB_MATRIX_ENABLE keyboard_setup(); @@ -336,18 +339,18 @@ int main(void) { #ifdef CONSOLE_ENABLE uint64_t next_print = 0; -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE v_5v_avg = adc_get(ADC_5V); debug_code_disable(); while (1) { - main_subtasks(); // Note these tasks will also be run while waiting for USB keyboard polling intervals + main_subtasks(); // Note these tasks will also be run while waiting for USB keyboard polling intervals if (g_usb_state == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val || g_usb_state == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) { if (suspend_wakeup_condition()) { - udc_remotewakeup(); // Send remote wakeup signal + udc_remotewakeup(); // Send remote wakeup signal wait_ms(50); } @@ -362,12 +365,12 @@ int main(void) { // Add any debug information here that you want to see very often // dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired); } -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE #ifdef DEFERRED_EXEC_ENABLE // Run deferred executions deferred_exec_task(); -#endif // DEFERRED_EXEC_ENABLE +#endif // DEFERRED_EXEC_ENABLE // Run housekeeping housekeeping_task(); diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.h b/tmk_core/protocol/arm_atsam/main_arm_atsam.h index 5b088f0e20cc..78205e2e1be9 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.h +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.h @@ -20,4 +20,4 @@ along with this program. If not, see . uint8_t keyboard_leds(void); -#endif //_MAIN_ARM_ATSAM_H_ +#endif //_MAIN_ARM_ATSAM_H_ diff --git a/tmk_core/protocol/arm_atsam/md_bootloader.h b/tmk_core/protocol/arm_atsam/md_bootloader.h deleted file mode 100644 index 362b9bd52a8f..000000000000 --- a/tmk_core/protocol/arm_atsam/md_bootloader.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _MD_BOOTLOADER_H_ -#define _MD_BOOTLOADER_H_ - -extern uint32_t _srom; -extern uint32_t _lrom; -extern uint32_t _erom; - -#define BOOTLOADER_SERIAL_MAX_SIZE 20 // DO NOT MODIFY! - -#ifdef KEYBOARD_massdrop_ctrl -// WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support -extern uint32_t _eram; -# define BOOTLOADER_MAGIC 0x3B9ACA00 -# define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4) -#endif - -#ifdef MD_BOOTLOADER - -# define MCU_HZ 48000000 -# define I2C_HZ 0 // Not used - -#endif // MD_BOOTLOADER - -#endif //_MD_BOOTLOADER_H_ diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c index 0741584439f7..84ce3ee24b4c 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c @@ -53,16 +53,20 @@ void eeconfig_update_md_led_default(void) { eeconfig_flush_md_led(true); } -void md_led_changed(void) { eeconfig_flag_md_led(true); } +void md_led_changed(void) { + eeconfig_flag_md_led(true); +} // todo: use real task rather than this bodge -void housekeeping_task_kb(void) { eeconfig_flush_md_led_task(FLUSH_TIMEOUT); } +void housekeeping_task_kb(void) { + eeconfig_flush_md_led_task(FLUSH_TIMEOUT); +} __attribute__((weak)) led_instruction_t led_instructions[] = {{.end = 1}}; static void md_rgb_matrix_config_override(int i); # else uint8_t gcr_desired; -# endif // USE_MASSDROP_CONFIGURATOR +# endif // USE_MASSDROP_CONFIGURATOR void SERCOM1_0_Handler(void) { if (SERCOM1->I2CM.INTFLAG.bit.ERROR) { @@ -125,9 +129,9 @@ void gcr_compute(void) { if (v_5v < V5_CAT) { I2C3733_Control_Set(0); // CDC_print("USB: WARNING: 5V catastrophic level reached! Disabling LED drivers!\r\n"); //Blocking print is bad here! - v_5v_cat_hit = 20; //~100ms recover - gcr_actual = 0; // Minimize GCR - usb_gcr_auto = 1; // Force auto mode enabled + v_5v_cat_hit = 20; //~100ms recover + gcr_actual = 0; // Minimize GCR + usb_gcr_auto = 1; // Force auto mode enabled return; } else if (v_5v_cat_hit > 1) { v_5v_cat_hit--; @@ -157,24 +161,24 @@ void gcr_compute(void) { gcr_min_counter = 0; } else if (action == ACT_GCR_INC) { if (LED_GCR_STEP_AUTO > LED_GCR_MAX - gcr_actual) - gcr_actual = LED_GCR_MAX; // Obey max and prevent wrapping + gcr_actual = LED_GCR_MAX; // Obey max and prevent wrapping else gcr_actual += LED_GCR_STEP_AUTO; gcr_min_counter = 0; } else if (action == ACT_GCR_DEC) { - if (LED_GCR_STEP_AUTO > gcr_actual) // Prevent wrapping + if (LED_GCR_STEP_AUTO > gcr_actual) // Prevent wrapping { gcr_actual = 0; // At this point, power can no longer be cut from the LED drivers, so focus on cutting out extra port if active - if (usb_extra_state != USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) // If not in a wait for replug state + if (usb_extra_state != USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) // If not in a wait for replug state { - if (usb_extra_state == USB_EXTRA_STATE_ENABLED) // If extra usb is enabled + if (usb_extra_state == USB_EXTRA_STATE_ENABLED) // If extra usb is enabled { gcr_min_counter++; - if (gcr_min_counter > 200) // 5ms per check = 1s delay + if (gcr_min_counter > 200) // 5ms per check = 1s delay { USB_ExtraSetState(USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG); - usb_extra_manual = 0; // Force disable manual mode of extra port + usb_extra_manual = 0; // Force disable manual mode of extra port if (usb_extra_manual) CDC_print("USB: Disabling extra port until replug and manual mode toggle!\r\n"); else @@ -275,11 +279,11 @@ static void flush(void) { # ifdef USE_MASSDROP_CONFIGURATOR if (!led_enabled) { return; - } // Prevent calculations and I2C traffic if LED drivers are not enabled + } // Prevent calculations and I2C traffic if LED drivers are not enabled # else if (!sr_exp_data.bit.SDB_N) { return; - } // Prevent calculations and I2C traffic if LED drivers are not enabled + } // Prevent calculations and I2C traffic if LED drivers are not enabled # endif // Wait for previous transfer to complete @@ -319,17 +323,19 @@ static void flush(void) { pomod = (uint32_t)pomod % 10000; pomod /= 100.0f; -# endif // USE_MASSDROP_CONFIGURATOR +# endif // USE_MASSDROP_CONFIGURATOR uint8_t drvid; // NOTE: GCR does not need to be timed with LED processing, but there is really no harm if (gcr_actual != gcr_actual_last) { - for (drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) I2C_LED_Q_GCR(drvid); // Queue data + for (drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) + I2C_LED_Q_GCR(drvid); // Queue data gcr_actual_last = gcr_actual; } - for (drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) I2C_LED_Q_PWM(drvid); // Queue data + for (drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) + I2C_LED_Q_PWM(drvid); // Queue data i2c_led_q_run(); } @@ -341,19 +347,19 @@ void md_rgb_matrix_indicators_advanced(uint8_t led_min, uint8_t led_max) { if ( # if USB_LED_NUM_LOCK_SCANCODE != 255 (led_map[i].scan == USB_LED_NUM_LOCK_SCANCODE && (kbled & (1 << USB_LED_NUM_LOCK))) || -# endif // NUM LOCK +# endif // NUM LOCK # if USB_LED_CAPS_LOCK_SCANCODE != 255 (led_map[i].scan == USB_LED_CAPS_LOCK_SCANCODE && (kbled & (1 << USB_LED_CAPS_LOCK))) || -# endif // CAPS LOCK +# endif // CAPS LOCK # if USB_LED_SCROLL_LOCK_SCANCODE != 255 (led_map[i].scan == USB_LED_SCROLL_LOCK_SCANCODE && (kbled & (1 << USB_LED_SCROLL_LOCK))) || -# endif // SCROLL LOCK +# endif // SCROLL LOCK # if USB_LED_COMPOSE_SCANCODE != 255 (led_map[i].scan == USB_LED_COMPOSE_SCANCODE && (kbled & (1 << USB_LED_COMPOSE))) || -# endif // COMPOSE +# endif // COMPOSE # if USB_LED_KANA_SCANCODE != 255 (led_map[i].scan == USB_LED_KANA_SCANCODE && (kbled & (1 << USB_LED_KANA))) || -# endif // KANA +# endif // KANA (0)) { if (rgb_matrix_get_flags() & LED_FLAG_INDICATOR) { led_buffer[i].r = 255 - led_buffer[i].r; @@ -378,7 +384,7 @@ static void led_run_pattern(led_setup_t* f, float* ro, float* go, float* bo, flo float po; while (f->end != 1) { - po = pos; // Reset po for new frame + po = pos; // Reset po for new frame // Add in any moving effects if ((!led_animation_direction && f->ef & EF_SCR_R) || (led_animation_direction && (f->ef & EF_SCR_L))) { @@ -413,17 +419,17 @@ static void led_run_pattern(led_setup_t* f, float* ro, float* go, float* bo, flo // Add in any color effects if (f->ef & EF_OVER) { - *ro = (po * (f->re - f->rs)) + f->rs; // + 0.5; - *go = (po * (f->ge - f->gs)) + f->gs; // + 0.5; - *bo = (po * (f->be - f->bs)) + f->bs; // + 0.5; + *ro = (po * (f->re - f->rs)) + f->rs; // + 0.5; + *go = (po * (f->ge - f->gs)) + f->gs; // + 0.5; + *bo = (po * (f->be - f->bs)) + f->bs; // + 0.5; } else if (f->ef & EF_SUBTRACT) { - *ro -= (po * (f->re - f->rs)) + f->rs; // + 0.5; - *go -= (po * (f->ge - f->gs)) + f->gs; // + 0.5; - *bo -= (po * (f->be - f->bs)) + f->bs; // + 0.5; + *ro -= (po * (f->re - f->rs)) + f->rs; // + 0.5; + *go -= (po * (f->ge - f->gs)) + f->gs; // + 0.5; + *bo -= (po * (f->be - f->bs)) + f->bs; // + 0.5; } else { - *ro += (po * (f->re - f->rs)) + f->rs; // + 0.5; - *go += (po * (f->ge - f->gs)) + f->gs; // + 0.5; - *bo += (po * (f->be - f->bs)) + f->bs; // + 0.5; + *ro += (po * (f->re - f->rs)) + f->rs; // + 0.5; + *go += (po * (f->ge - f->gs)) + f->gs; // + 0.5; + *bo += (po * (f->be - f->bs)) + f->bs; // + 0.5; } f++; @@ -471,10 +477,10 @@ static void md_rgb_matrix_config_override(int i) { // Check if this applies to current index if (led_cur_instruction->flags & LED_FLAG_MATCH_ID) { - uint8_t modid = i / 32; // Calculate which id# contains the led bit - uint32_t modidbit = 1 << (i % 32); // Calculate the bit within the id# - uint32_t* bitfield = &led_cur_instruction->id0 + modid; // Add modid as offset to id0 address. *bitfield is now idX of the led id - if (~(*bitfield) & modidbit) { // Check if led bit is not set in idX + uint8_t modid = i / 32; // Calculate which id# contains the led bit + uint32_t modidbit = 1 << (i % 32); // Calculate the bit within the id# + uint32_t* bitfield = &led_cur_instruction->id0 + modid; // Add modid as offset to id0 address. *bitfield is now idX of the led id + if (~(*bitfield) & modidbit) { // Check if led bit is not set in idX goto next_iter; } } @@ -538,5 +544,5 @@ static void md_rgb_matrix_config_override(int i) { led_buffer[i].b = (uint8_t)bo; } -# endif // USE_MASSDROP_CONFIGURATOR -#endif // RGB_MATRIX_ENABLE +# endif // USE_MASSDROP_CONFIGURATOR +#endif // RGB_MATRIX_ENABLE diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.h b/tmk_core/protocol/arm_atsam/md_rgb_matrix.h index deea12b888ea..f27da028a0c3 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.h +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.h @@ -31,10 +31,10 @@ along with this program. If not, see . #define ISSI3733_SW_COUNT 12 #define ISSI3733_LED_RGB_COUNT ISSI3733_CS_COUNT *ISSI3733_SW_COUNT -#define ISSI3733_PG0_BYTES ISSI3733_LED_RGB_COUNT / 8 + 1 //+1 for first byte being memory start offset for I2C transfer -#define ISSI3733_PG1_BYTES ISSI3733_LED_RGB_COUNT + 1 //+1 for first byte being memory start offset for I2C transfer -#define ISSI3733_PG2_BYTES ISSI3733_LED_RGB_COUNT + 1 //+1 for first byte being memory start offset for I2C transfer -#define ISSI3733_PG3_BYTES 18 + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG0_BYTES ISSI3733_LED_RGB_COUNT / 8 + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG1_BYTES ISSI3733_LED_RGB_COUNT + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG2_BYTES ISSI3733_LED_RGB_COUNT + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG3_BYTES 18 + 1 //+1 for first byte being memory start offset for I2C transfer #define ISSI3733_PG_ONOFF_BYTES ISSI3733_PG0_BYTES #define ISSI3733_PG_OR_BYTES ISSI3733_PG0_BYTES @@ -44,38 +44,38 @@ along with this program. If not, see . #define ISSI3733_PG_FN_BYTES ISSI3733_PG3_BYTES typedef struct issi3733_driver_s { - uint8_t addr; // Address of the driver according to wiring "ISSI3733: Table 1 Slave Address" - uint8_t onoff[ISSI3733_PG_ONOFF_BYTES]; // PG0 - LED Control Register - LED On/Off Register - uint8_t open[ISSI3733_PG_OR_BYTES]; // PG0 - LED Control Register - LED Open Register - uint8_t shrt[ISSI3733_PG_SR_BYTES]; // PG0 - LED Control Register - LED Short Register - uint8_t pwm[ISSI3733_PG_PWM_BYTES]; // PG1 - PWM Register - uint8_t abm[ISSI3733_PG_ABM_BYTES]; // PG2 - Auto Breath Mode Register - uint8_t conf[ISSI3733_PG_FN_BYTES]; // PG3 - Function Register + uint8_t addr; // Address of the driver according to wiring "ISSI3733: Table 1 Slave Address" + uint8_t onoff[ISSI3733_PG_ONOFF_BYTES]; // PG0 - LED Control Register - LED On/Off Register + uint8_t open[ISSI3733_PG_OR_BYTES]; // PG0 - LED Control Register - LED Open Register + uint8_t shrt[ISSI3733_PG_SR_BYTES]; // PG0 - LED Control Register - LED Short Register + uint8_t pwm[ISSI3733_PG_PWM_BYTES]; // PG1 - PWM Register + uint8_t abm[ISSI3733_PG_ABM_BYTES]; // PG2 - Auto Breath Mode Register + uint8_t conf[ISSI3733_PG_FN_BYTES]; // PG3 - Function Register } issi3733_driver_t; typedef struct issi3733_rgb_s { - uint8_t *r; // Direct access into PWM data - uint8_t *g; // Direct access into PWM data - uint8_t *b; // Direct access into PWM data + uint8_t *r; // Direct access into PWM data + uint8_t *g; // Direct access into PWM data + uint8_t *b; // Direct access into PWM data } issi3733_rgb_t; typedef struct issi3733_rgb_adr_s { - uint8_t drv; // Driver from given list - uint8_t cs; // CS - uint8_t swr; // SW Red - uint8_t swg; // SW Green - uint8_t swb; // SW Blue + uint8_t drv; // Driver from given list + uint8_t cs; // CS + uint8_t swr; // SW Red + uint8_t swg; // SW Green + uint8_t swb; // SW Blue } issi3733_rgb_adr_t; typedef struct issi3733_led_s { - uint8_t id; // According to PCB ref - issi3733_rgb_t rgb; // PWM settings of R G B - issi3733_rgb_adr_t adr; // Hardware addresses - float x; // Physical position X - float y; // Physical position Y - float px; // Physical position X in percent - float py; // Physical position Y in percent - uint8_t scan; // Key scan code from wiring (set 0xFF if no key) + uint8_t id; // According to PCB ref + issi3733_rgb_t rgb; // PWM settings of R G B + issi3733_rgb_adr_t adr; // Hardware addresses + float x; // Physical position X + float y; // Physical position Y + float px; // Physical position X in percent + float py; // Physical position Y in percent + uint8_t scan; // Key scan code from wiring (set 0xFF if no key) } issi3733_led_t; extern issi3733_driver_t issidrv[ISSI3733_DRIVER_COUNT]; @@ -92,44 +92,44 @@ void md_rgb_matrix_indicators_advanced(uint8_t led_min, uint8_t led_max); #ifdef USE_MASSDROP_CONFIGURATOR -# define EF_NONE 0x00000000 // No effect -# define EF_OVER 0x00000001 // Overwrite any previous color information with new -# define EF_SCR_L 0x00000002 // Scroll left -# define EF_SCR_R 0x00000004 // Scroll right -# define EF_SUBTRACT 0x00000008 // Subtract color values +# define EF_NONE 0x00000000 // No effect +# define EF_OVER 0x00000001 // Overwrite any previous color information with new +# define EF_SCR_L 0x00000002 // Scroll left +# define EF_SCR_R 0x00000004 // Scroll right +# define EF_SUBTRACT 0x00000008 // Subtract color values typedef struct led_setup_s { - float hs; // Band begin at percent - float he; // Band end at percent - uint8_t rs; // Red start value - uint8_t re; // Red end value - uint8_t gs; // Green start value - uint8_t ge; // Green end value - uint8_t bs; // Blue start value - uint8_t be; // Blue end value - uint32_t ef; // Animation and color effects - uint8_t end; // Set to signal end of the setup + float hs; // Band begin at percent + float he; // Band end at percent + uint8_t rs; // Red start value + uint8_t re; // Red end value + uint8_t gs; // Green start value + uint8_t ge; // Green end value + uint8_t bs; // Blue start value + uint8_t be; // Blue end value + uint32_t ef; // Animation and color effects + uint8_t end; // Set to signal end of the setup } led_setup_t; extern const uint8_t led_setups_count; extern void * led_setups[]; // LED Extra Instructions -# define LED_FLAG_NULL 0x00 // Matching and coloring not used (default) -# define LED_FLAG_MATCH_ID 0x01 // Match on the ID of the LED (set id#'s to desired bit pattern, first LED is id 1) -# define LED_FLAG_MATCH_LAYER 0x02 // Match on the current active layer (set layer to desired match layer) -# define LED_FLAG_USE_RGB 0x10 // Use a specific RGB value (set r, g, b to desired output color values) -# define LED_FLAG_USE_PATTERN 0x20 // Use a specific pattern ID (set pattern_id to desired output pattern) -# define LED_FLAG_USE_ROTATE_PATTERN 0x40 // Use pattern the user has cycled to manually +# define LED_FLAG_NULL 0x00 // Matching and coloring not used (default) +# define LED_FLAG_MATCH_ID 0x01 // Match on the ID of the LED (set id#'s to desired bit pattern, first LED is id 1) +# define LED_FLAG_MATCH_LAYER 0x02 // Match on the current active layer (set layer to desired match layer) +# define LED_FLAG_USE_RGB 0x10 // Use a specific RGB value (set r, g, b to desired output color values) +# define LED_FLAG_USE_PATTERN 0x20 // Use a specific pattern ID (set pattern_id to desired output pattern) +# define LED_FLAG_USE_ROTATE_PATTERN 0x40 // Use pattern the user has cycled to manually typedef struct led_instruction_s { - uint16_t flags; // Bitfield for LED instructions - uint32_t id0; // Bitwise id, IDs 0-31 - uint32_t id1; // Bitwise id, IDs 32-63 - uint32_t id2; // Bitwise id, IDs 64-95 - uint32_t id3; // Bitwise id, IDs 96-127 - uint32_t id4; // Bitwise id, IDs 128-159 - uint32_t id5; // Bitwise id, IDs 160-191 + uint16_t flags; // Bitfield for LED instructions + uint32_t id0; // Bitwise id, IDs 0-31 + uint32_t id1; // Bitwise id, IDs 32-63 + uint32_t id2; // Bitwise id, IDs 64-95 + uint32_t id3; // Bitwise id, IDs 96-127 + uint32_t id4; // Bitwise id, IDs 128-159 + uint32_t id5; // Bitwise id, IDs 160-191 uint8_t layer; uint8_t r; uint8_t g; @@ -141,7 +141,7 @@ typedef struct led_instruction_s { extern led_instruction_t led_instructions[]; typedef struct led_config_s { - uint8_t ver; // assumed to be zero on eeprom reset + uint8_t ver; // assumed to be zero on eeprom reset uint8_t desired_gcr; uint8_t animation_breathing; @@ -178,27 +178,27 @@ void md_led_changed(void); # define led_ratio_brightness md_led_config.ratio_brightness # define led_edge_mode md_led_config.edge_mode -# define LED_MODE_NORMAL 0 // Must be 0 +# define LED_MODE_NORMAL 0 // Must be 0 # define LED_MODE_KEYS_ONLY 1 # define LED_MODE_NON_KEYS_ONLY 2 # define LED_MODE_INDICATORS_ONLY 3 -# define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY // Must be highest value +# define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY // Must be highest value -# define LED_EDGE_MODE_ALL 0 // All edge LEDs are active (Must be 0) -# define LED_EDGE_MODE_ALTERNATE 1 // Alternate mode of edge LEDs are active (Intention is for 'only every other edge LED' to be active) -# define LED_EDGE_MODE_MAX LED_EDGE_MODE_ALTERNATE // Must be the highest valued LED edge mode +# define LED_EDGE_MODE_ALL 0 // All edge LEDs are active (Must be 0) +# define LED_EDGE_MODE_ALTERNATE 1 // Alternate mode of edge LEDs are active (Intention is for 'only every other edge LED' to be active) +# define LED_EDGE_MODE_MAX LED_EDGE_MODE_ALTERNATE // Must be the highest valued LED edge mode -# define LED_EDGE_FULL_MODE 255 // LEDs configured with this scan code will always be on for edge lighting modes -# define LED_EDGE_ALT_MODE 254 // LEDs configured with this scan code will turn off in edge alternating mode -# define LED_EDGE_MIN_SCAN 254 // LEDs configured with scan code >= to this are assigned as edge LEDs -# define LED_INDICATOR_SCAN 253 // LEDs configured as dedicated indicators +# define LED_EDGE_FULL_MODE 255 // LEDs configured with this scan code will always be on for edge lighting modes +# define LED_EDGE_ALT_MODE 254 // LEDs configured with this scan code will turn off in edge alternating mode +# define LED_EDGE_MIN_SCAN 254 // LEDs configured with scan code >= to this are assigned as edge LEDs +# define LED_INDICATOR_SCAN 253 // LEDs configured as dedicated indicators -# define LED_IS_KEY(scan) (scan < LED_INDICATOR_SCAN) // Return true if an LED's scan value indicates it is a key LED -# define LED_IS_EDGE(scan) (scan >= LED_EDGE_MIN_SCAN) // Return true if an LED's scan value indicates an edge LED -# define LED_IS_EDGE_ALT(scan) (scan == LED_EDGE_ALT_MODE) // Return true if an LED's scan value indicates an alternate edge mode LED -# define LED_IS_INDICATOR(scan) (scan == LED_INDICATOR_SCAN) // Return true if an LED's scan value indicates it is a dedicated Indicator +# define LED_IS_KEY(scan) (scan < LED_INDICATOR_SCAN) // Return true if an LED's scan value indicates it is a key LED +# define LED_IS_EDGE(scan) (scan >= LED_EDGE_MIN_SCAN) // Return true if an LED's scan value indicates an edge LED +# define LED_IS_EDGE_ALT(scan) (scan == LED_EDGE_ALT_MODE) // Return true if an LED's scan value indicates an alternate edge mode LED +# define LED_IS_INDICATOR(scan) (scan == LED_INDICATOR_SCAN) // Return true if an LED's scan value indicates it is a dedicated Indicator #else extern uint8_t gcr_desired; -#endif // USE_MASSDROP_CONFIGURATOR +#endif // USE_MASSDROP_CONFIGURATOR -#endif //_LED_MATRIX_H_ +#endif //_LED_MATRIX_H_ diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c index 92b40b5b8556..69b3ad574ccc 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c @@ -97,5 +97,5 @@ void *led_setups[] = {leds_rainbow_s, leds_rainbow_ns, leds_teal_salmon, leds_ye const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); -# endif // USE_MASSDROP_CONFIGURATOR -#endif // RGB_MATRIX_ENABLE \ No newline at end of file +# endif // USE_MASSDROP_CONFIGURATOR +#endif // RGB_MATRIX_ENABLE \ No newline at end of file diff --git a/tmk_core/protocol/arm_atsam/shift_register.c b/tmk_core/protocol/arm_atsam/shift_register.c index 8d63af1b59de..3adb682aa8b6 100644 --- a/tmk_core/protocol/arm_atsam/shift_register.c +++ b/tmk_core/protocol/arm_atsam/shift_register.c @@ -54,7 +54,9 @@ void shift_out_impl(const uint8_t *data, uint16_t length) { #else -void shift_init_impl(void) { spi_init(); } +void shift_init_impl(void) { + spi_init(); +} void shift_out_impl(const uint8_t *data, uint16_t length) { spi_start(SR_EXP_RCLK_PIN, true, 0, 0); @@ -67,7 +69,9 @@ void shift_out_impl(const uint8_t *data, uint16_t length) { // *************************************************************** -void shift_out(const uint8_t *data, uint16_t length) { shift_out_impl(data, length); } +void shift_out(const uint8_t *data, uint16_t length) { + shift_out_impl(data, length); +} void shift_enable(void) { setPinOutput(SR_EXP_OE_PIN); @@ -90,8 +94,8 @@ sr_exp_t sr_exp_data; void SR_EXP_WriteData(void) { uint8_t data[2] = { - sr_exp_data.reg & 0xFF, // Shift in bits 7-0 - (sr_exp_data.reg >> 8) & 0xFF, // Shift in bits 15-8 + sr_exp_data.reg & 0xFF, // Shift in bits 7-0 + (sr_exp_data.reg >> 8) & 0xFF, // Shift in bits 15-8 }; shift_out(data, 2); } diff --git a/tmk_core/protocol/arm_atsam/spi_master.c b/tmk_core/protocol/arm_atsam/spi_master.c index 9781d45b1e00..3be82fac1d99 100644 --- a/tmk_core/protocol/arm_atsam/spi_master.c +++ b/tmk_core/protocol/arm_atsam/spi_master.c @@ -45,10 +45,10 @@ __attribute__((weak)) void spi_init(void) { CLK_set_spi_freq(CHAN_SERCOM_SPI, FREQ_SPI_DEFAULT); // Set up MCU SPI pins - PORT->Group[SAMD_PORT(SPI_DATAOUT_PIN)].PMUX[SAMD_PIN(SPI_DATAOUT_PIN) / 2].bit.SPI_DATAOUT_MUX_SEL = SPI_DATAOUT_MUX; // MUX select for sercom - PORT->Group[SAMD_PORT(SPI_SCLK_PIN)].PMUX[SAMD_PIN(SPI_SCLK_PIN) / 2].bit.SPI_SCLK_MUX_SEL = SPI_SCLK_MUX; // MUX select for sercom - PORT->Group[SAMD_PORT(SPI_DATAOUT_PIN)].PINCFG[SAMD_PIN(SPI_DATAOUT_PIN)].bit.PMUXEN = 1; // MUX Enable - PORT->Group[SAMD_PORT(SPI_SCLK_PIN)].PINCFG[SAMD_PIN(SPI_SCLK_PIN)].bit.PMUXEN = 1; // MUX Enable + PORT->Group[SAMD_PORT(SPI_DATAOUT_PIN)].PMUX[SAMD_PIN(SPI_DATAOUT_PIN) / 2].bit.SPI_DATAOUT_MUX_SEL = SPI_DATAOUT_MUX; // MUX select for sercom + PORT->Group[SAMD_PORT(SPI_SCLK_PIN)].PMUX[SAMD_PIN(SPI_SCLK_PIN) / 2].bit.SPI_SCLK_MUX_SEL = SPI_SCLK_MUX; // MUX select for sercom + PORT->Group[SAMD_PORT(SPI_DATAOUT_PIN)].PINCFG[SAMD_PIN(SPI_DATAOUT_PIN)].bit.PMUXEN = 1; // MUX Enable + PORT->Group[SAMD_PORT(SPI_SCLK_PIN)].PINCFG[SAMD_PIN(SPI_SCLK_PIN)].bit.PMUXEN = 1; // MUX Enable DBGC(DC_SPI_INIT_COMPLETE); } @@ -63,14 +63,14 @@ bool spi_start(pin_t csPin, bool lsbFirst, uint8_t mode, uint16_t divisor) { setPinOutput(currentSelectPin); writePinLow(currentSelectPin); - SPI_SERCOM->SPI.CTRLA.bit.DORD = lsbFirst; // Data Order - LSB is transferred first - SPI_SERCOM->SPI.CTRLA.bit.CPOL = 1; // Clock Polarity - SCK high when idle. Leading edge of cycle is falling. Trailing rising. - SPI_SERCOM->SPI.CTRLA.bit.CPHA = 1; // Clock Phase - Leading Edge Falling, change, Trailing Edge - Rising, sample - SPI_SERCOM->SPI.CTRLA.bit.DIPO = 3; // Data In Pinout - SERCOM PAD[3] is used as data input (Configure away from DOPO. Not using input.) - SPI_SERCOM->SPI.CTRLA.bit.DOPO = 0; // Data Output PAD[0], Serial Clock PAD[1] - SPI_SERCOM->SPI.CTRLA.bit.MODE = 3; // Operating Mode - Master operation + SPI_SERCOM->SPI.CTRLA.bit.DORD = lsbFirst; // Data Order - LSB is transferred first + SPI_SERCOM->SPI.CTRLA.bit.CPOL = 1; // Clock Polarity - SCK high when idle. Leading edge of cycle is falling. Trailing rising. + SPI_SERCOM->SPI.CTRLA.bit.CPHA = 1; // Clock Phase - Leading Edge Falling, change, Trailing Edge - Rising, sample + SPI_SERCOM->SPI.CTRLA.bit.DIPO = 3; // Data In Pinout - SERCOM PAD[3] is used as data input (Configure away from DOPO. Not using input.) + SPI_SERCOM->SPI.CTRLA.bit.DOPO = 0; // Data Output PAD[0], Serial Clock PAD[1] + SPI_SERCOM->SPI.CTRLA.bit.MODE = 3; // Operating Mode - Master operation - SPI_SERCOM->SPI.CTRLA.bit.ENABLE = 1; // Enable - Peripheral is enabled or being enabled + SPI_SERCOM->SPI.CTRLA.bit.ENABLE = 1; // Enable - Peripheral is enabled or being enabled while (SPI_SERCOM->SPI.SYNCBUSY.bit.ENABLE) { DBGC(DC_SPI_SYNC_ENABLING); } diff --git a/tmk_core/protocol/arm_atsam/startup.c b/tmk_core/protocol/arm_atsam/startup.c index 7a5791ab557a..ce043bad516a 100644 --- a/tmk_core/protocol/arm_atsam/startup.c +++ b/tmk_core/protocol/arm_atsam/startup.c @@ -28,7 +28,6 @@ */ #include "samd51.h" -#include "md_bootloader.h" /* Initialize segments */ extern uint32_t _sfixed; @@ -496,6 +495,11 @@ __attribute__((section(".vectors"))) const DeviceVectors exception_table = { #endif }; +// WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support +extern uint32_t _eram; +#define BOOTLOADER_MAGIC 0x3B9ACA00 +#define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4) + /** * \brief This is the code that gets called on processor reset. * To initialize the device, and call the main() routine. diff --git a/tmk_core/protocol/arm_atsam/usb/compiler.h b/tmk_core/protocol/arm_atsam/usb/compiler.h index 4eeef96cf430..9fb04ff6280c 100644 --- a/tmk_core/protocol/arm_atsam/usb/compiler.h +++ b/tmk_core/protocol/arm_atsam/usb/compiler.h @@ -876,66 +876,66 @@ typedef struct { // kmod #define LOW 0 // kmod #define HIGH 1 -typedef int8_t S8; //!< 8-bit signed integer. -typedef uint8_t U8; //!< 8-bit unsigned integer. -typedef int16_t S16; //!< 16-bit signed integer. -typedef uint16_t U16; //!< 16-bit unsigned integer. -typedef int32_t S32; //!< 32-bit signed integer. -typedef uint32_t U32; //!< 32-bit unsigned integer. -typedef int64_t S64; //!< 64-bit signed integer. -typedef uint64_t U64; //!< 64-bit unsigned integer. -typedef float F32; //!< 32-bit floating-point number. -typedef double F64; //!< 64-bit floating-point number. - -#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. -#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. - -#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. -#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. -#define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. -#define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. -#define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. -#define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. -#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. -#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. -#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. -#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. - -#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. -#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. -#define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. -#define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. -#define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. -#define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. -#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. -#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. -#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. -#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. -#define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. -#define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. -#define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. -#define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. -#define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. -#define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. -#define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. -#define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. -#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. -#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. -#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. -#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. -#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. -#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. -#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. -#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. - -#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. -#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. -#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. -#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. -#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. -#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. -#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. -#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. +typedef int8_t S8; //!< 8-bit signed integer. +typedef uint8_t U8; //!< 8-bit unsigned integer. +typedef int16_t S16; //!< 16-bit signed integer. +typedef uint16_t U16; //!< 16-bit unsigned integer. +typedef int32_t S32; //!< 32-bit signed integer. +typedef uint32_t U32; //!< 32-bit unsigned integer. +typedef int64_t S64; //!< 64-bit signed integer. +typedef uint64_t U64; //!< 64-bit unsigned integer. +typedef float F32; //!< 32-bit floating-point number. +typedef double F64; //!< 64-bit floating-point number. + +#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. +#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. + +#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. +#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. +#define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. +#define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. +#define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. +#define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. +#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. +#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. + +#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. +#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. +#define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. +#define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. +#define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. +#define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. +#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. +#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. +#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. +#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. +#define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. +#define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. +#define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. +#define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. +#define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. +#define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. +#define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. +#define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. +#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. +#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. +#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. +#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. +#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. +#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. +#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. +#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. + +#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. +#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. +#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. +#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. +#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. +#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. #if defined(__ICCARM__) # define SHORTENUM __packed @@ -1031,7 +1031,9 @@ static inline void convert_16_bit_to_byte_address(uint16_t value, uint8_t *data) * @return 16-Bit value * @ingroup apiPalApi */ -static inline uint16_t convert_byte_array_to_16_bit(uint8_t *data) { return (data[0] | ((uint16_t)data[1] << 8)); } +static inline uint16_t convert_byte_array_to_16_bit(uint8_t *data) { + return (data[0] | ((uint16_t)data[1] << 8)); +} /* Converts a 4 Byte array into a 32-Bit value */ static inline uint32_t convert_byte_array_to_32_bit(uint8_t *data) { diff --git a/tmk_core/protocol/arm_atsam/usb/conf_usb.h b/tmk_core/protocol/arm_atsam/usb/conf_usb.h index 184a2e81dc38..50d189a2025f 100644 --- a/tmk_core/protocol/arm_atsam/usb/conf_usb.h +++ b/tmk_core/protocol/arm_atsam/usb/conf_usb.h @@ -59,7 +59,7 @@ #define USB_DEVICE_VENDOR_ID VENDOR_ID #define USB_DEVICE_PRODUCT_ID PRODUCT_ID #define USB_DEVICE_VERSION DEVICE_VER -#define USB_DEVICE_POWER 500 // Consumption on Vbus line (mA) +#define USB_DEVICE_POWER 500 // Consumption on Vbus line (mA) #define USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_BUS_POWERED) // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) @@ -161,4 +161,4 @@ #include "usb_main.h" #include "ui.h" -#endif // _CONF_USB_H_ +#endif // _CONF_USB_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/main_usb.c b/tmk_core/protocol/arm_atsam/usb/main_usb.c index 5fcb9a9c6124..ee6ed25b8573 100644 --- a/tmk_core/protocol/arm_atsam/usb/main_usb.c +++ b/tmk_core/protocol/arm_atsam/usb/main_usb.c @@ -25,15 +25,25 @@ along with this program. If not, see . uint8_t keyboard_protocol = 1; -void main_suspend_action(void) { ui_powerdown(); } +void main_suspend_action(void) { + ui_powerdown(); +} -void main_resume_action(void) { ui_wakeup(); } +void main_resume_action(void) { + ui_wakeup(); +} -void main_sof_action(void) { ui_process(udd_get_frame_number()); } +void main_sof_action(void) { + ui_process(udd_get_frame_number()); +} -void main_remotewakeup_enable(void) { ui_wakeup_enable(); } +void main_remotewakeup_enable(void) { + ui_wakeup_enable(); +} -void main_remotewakeup_disable(void) { ui_wakeup_disable(); } +void main_remotewakeup_disable(void) { + ui_wakeup_disable(); +} volatile bool main_b_kbd_enable = false; bool main_kbd_enable(void) { @@ -41,7 +51,9 @@ bool main_kbd_enable(void) { return true; } -void main_kbd_disable(void) { main_b_kbd_enable = false; } +void main_kbd_disable(void) { + main_b_kbd_enable = false; +} #ifdef NKRO_ENABLE volatile bool main_b_nkro_enable = false; @@ -50,7 +62,9 @@ bool main_nkro_enable(void) { return true; } -void main_nkro_disable(void) { main_b_nkro_enable = false; } +void main_nkro_disable(void) { + main_b_nkro_enable = false; +} #endif #ifdef EXTRAKEY_ENABLE @@ -60,7 +74,9 @@ bool main_exk_enable(void) { return true; } -void main_exk_disable(void) { main_b_exk_enable = false; } +void main_exk_disable(void) { + main_b_exk_enable = false; +} #endif #ifdef CONSOLE_ENABLE @@ -70,7 +86,9 @@ bool main_con_enable(void) { return true; } -void main_con_disable(void) { main_b_con_enable = false; } +void main_con_disable(void) { + main_b_con_enable = false; +} #endif #ifdef MOUSE_ENABLE @@ -80,7 +98,9 @@ bool main_mou_enable(void) { return true; } -void main_mou_disable(void) { main_b_mou_enable = false; } +void main_mou_disable(void) { + main_b_mou_enable = false; +} #endif #ifdef RAW_ENABLE @@ -90,7 +110,11 @@ bool main_raw_enable(void) { return true; } -void main_raw_disable(void) { main_b_raw_enable = false; } +void main_raw_disable(void) { + main_b_raw_enable = false; +} -void main_raw_receive(uint8_t *buffer, uint8_t len) { raw_hid_receive(buffer, len); } +void main_raw_receive(uint8_t *buffer, uint8_t len) { + raw_hid_receive(buffer, len); +} #endif diff --git a/tmk_core/protocol/arm_atsam/usb/status_codes.h b/tmk_core/protocol/arm_atsam/usb/status_codes.h index a7a1230be0a9..72819a0d7d2f 100644 --- a/tmk_core/protocol/arm_atsam/usb/status_codes.h +++ b/tmk_core/protocol/arm_atsam/usb/status_codes.h @@ -124,20 +124,20 @@ typedef enum status_code status_code_genare_t; */ enum status_code_wireless { // STATUS_OK = 0, //!< Success - ERR_IO_ERROR = -1, //!< I/O error - ERR_FLUSHED = -2, //!< Request flushed from queue - ERR_TIMEOUT = -3, //!< Operation timed out - ERR_BAD_DATA = -4, //!< Data integrity check failed - ERR_PROTOCOL = -5, //!< Protocol error - ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device - ERR_NO_MEMORY = -7, //!< Insufficient memory - ERR_INVALID_ARG = -8, //!< Invalid argument - ERR_BAD_ADDRESS = -9, //!< Bad address - ERR_BUSY = -10, //!< Resource is busy - ERR_BAD_FORMAT = -11, //!< Data format not recognized - ERR_NO_TIMER = -12, //!< No timer available - ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running - ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running + ERR_IO_ERROR = -1, //!< I/O error + ERR_FLUSHED = -2, //!< Request flushed from queue + ERR_TIMEOUT = -3, //!< Operation timed out + ERR_BAD_DATA = -4, //!< Data integrity check failed + ERR_PROTOCOL = -5, //!< Protocol error + ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device + ERR_NO_MEMORY = -7, //!< Insufficient memory + ERR_INVALID_ARG = -8, //!< Invalid argument + ERR_BAD_ADDRESS = -9, //!< Bad address + ERR_BUSY = -10, //!< Resource is busy + ERR_BAD_FORMAT = -11, //!< Data format not recognized + ERR_NO_TIMER = -12, //!< No timer available + ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running + ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running /** * \brief Operation in progress diff --git a/tmk_core/protocol/arm_atsam/usb/udc.c b/tmk_core/protocol/arm_atsam/usb/udc.c index d04e9b7b2877..2a371c200af1 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc.c +++ b/tmk_core/protocol/arm_atsam/usb/udc.c @@ -51,7 +51,8 @@ #include "udi_device_conf.h" #include "udi.h" #include "udc.h" -#include "md_bootloader.h" + +#define BOOTLOADER_SERIAL_MAX_SIZE 20 // DO NOT MODIFY! /** * \ingroup udc_group @@ -122,6 +123,8 @@ static uint8_t udc_string_product_name[] = USB_DEVICE_PRODUCT_NAME; # define USB_DEVICE_SERIAL_NAME_SIZE 0 #endif +extern uint32_t _srom; + uint8_t usb_device_serial_name_size = 0; #if defined USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL uint8_t bootloader_serial_number[BOOTLOADER_SERIAL_MAX_SIZE + 1] = ""; @@ -129,13 +132,13 @@ uint8_t bootloader_serial_number[BOOTLOADER_SERIAL_MAX_SIZE + 1] = ""; static const uint8_t *udc_get_string_serial_name(void) { #if defined USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL uint32_t serial_ptrloc = (uint32_t)&_srom - 4; - uint32_t serial_address = *(uint32_t *)serial_ptrloc; // Address of bootloader's serial number if available + uint32_t serial_address = *(uint32_t *)serial_ptrloc; // Address of bootloader's serial number if available - if (serial_address != 0xFFFFFFFF && serial_address < serial_ptrloc) // Check for factory programmed serial address + if (serial_address != 0xFFFFFFFF && serial_address < serial_ptrloc) // Check for factory programmed serial address { - if ((serial_address & 0xFF) % 4 == 0) // Check alignment + if ((serial_address & 0xFF) % 4 == 0) // Check alignment { - uint16_t *serial_use = (uint16_t *)(serial_address); // Point to address of string in rom + uint16_t *serial_use = (uint16_t *)(serial_address); // Point to address of string in rom uint8_t serial_length = 0; while ((*(serial_use + serial_length) > 32 && *(serial_use + serial_length) < 127) && serial_length < BOOTLOADER_SERIAL_MAX_SIZE) { @@ -146,7 +149,7 @@ static const uint8_t *udc_get_string_serial_name(void) { usb_device_serial_name_size = serial_length; - return bootloader_serial_number; // Use serial programmed into bootloader rom + return bootloader_serial_number; // Use serial programmed into bootloader rom } } #endif @@ -154,9 +157,9 @@ static const uint8_t *udc_get_string_serial_name(void) { usb_device_serial_name_size = USB_DEVICE_SERIAL_NAME_SIZE; #if defined USB_DEVICE_SERIAL_NAME - return (const uint8_t *)USB_DEVICE_SERIAL_NAME; // Use serial supplied by keyboard's config.h + return (const uint8_t *)USB_DEVICE_SERIAL_NAME; // Use serial supplied by keyboard's config.h #else - return 0; // No serial supplied + return 0; // No serial supplied #endif } @@ -166,7 +169,7 @@ static const uint8_t *udc_get_string_serial_name(void) { */ #ifndef BOOTLOADER_SERIAL_MAX_SIZE # define BOOTLOADER_SERIAL_MAX_SIZE 0 -#endif // BOOTLOADER_SERIAL_MAX_SIZE +#endif // BOOTLOADER_SERIAL_MAX_SIZE struct udc_string_desc_t { usb_str_desc_t header; le16_t string[Max(Max(Max(USB_DEVICE_MANUFACTURE_NAME_SIZE, USB_DEVICE_PRODUCT_NAME_SIZE), USB_DEVICE_SERIAL_NAME_SIZE), BOOTLOADER_SERIAL_MAX_SIZE)]; @@ -175,14 +178,18 @@ COMPILER_WORD_ALIGNED static UDC_DESC_STORAGE struct udc_string_desc_t udc_string_desc = {.header.bDescriptorType = USB_DT_STRING}; //! @} -usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void) { return udc_ptr_iface; } +usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void) { + return udc_ptr_iface; +} /** * \brief Returns a value to check the end of USB Configuration descriptor * * \return address after the last byte of USB Configuration descriptor */ -static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void) { return (UDC_DESC_STORAGE usb_conf_desc_t *)((uint8_t *)udc_ptr_conf->desc + le16_to_cpu(udc_ptr_conf->desc->wTotalLength)); } +static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void) { + return (UDC_DESC_STORAGE usb_conf_desc_t *)((uint8_t *)udc_ptr_conf->desc + le16_to_cpu(udc_ptr_conf->desc->wTotalLength)); +} #if (0 != USB_DEVICE_MAX_EP) /** @@ -206,15 +213,15 @@ static usb_conf_desc_t UDC_DESC_STORAGE *udc_next_desc_in_iface(usb_conf_desc_t // If new interface descriptor is found, // then it is the end of the current global interface descriptor if (USB_DT_INTERFACE == desc->bDescriptorType) { - break; // End of global interface descriptor + break; // End of global interface descriptor } if (desc_id == desc->bDescriptorType) { - return desc; // Specific descriptor found + return desc; // Specific descriptor found } // Go to next descriptor desc = (UDC_DESC_STORAGE usb_conf_desc_t *)((uint8_t *)desc + desc->bLength); } - return NULL; // No specific descriptor found + return NULL; // No specific descriptor found } #endif @@ -248,13 +255,13 @@ static bool udc_update_iface_desc(uint8_t iface_num, uint8_t setting_num) { // A interface descriptor is found // Check interface and alternate setting number if ((iface_num == udc_ptr_iface->bInterfaceNumber) && (setting_num == udc_ptr_iface->bAlternateSetting)) { - return true; // Interface found + return true; // Interface found } } // Go to next descriptor udc_ptr_iface = (UDC_DESC_STORAGE usb_iface_desc_t *)((uint8_t *)udc_ptr_iface + udc_ptr_iface->bLength); } - return false; // Interface not found + return false; // Interface not found } /** @@ -340,7 +347,9 @@ static bool udc_iface_enable(uint8_t iface_num, uint8_t setting_num) { /*! \brief Start the USB Device stack */ -void udc_start(void) { udd_enable(); } +void udc_start(void) { + udd_enable(); +} /*! \brief Stop the USB Device stack */ @@ -507,7 +516,7 @@ static bool udc_req_std_dev_set_feature(void) { udd_g_ctrlreq.callback = udd_test_mode_packet; return true; - case USB_DEV_TEST_MODE_FORCE_ENABLE: // Only for downstream facing hub ports + case USB_DEV_TEST_MODE_FORCE_ENABLE: // Only for downstream facing hub ports default: break; } @@ -541,7 +550,9 @@ static bool udc_req_std_ep_set_feature(void) { * \brief Change the address of device * Callback called at the end of request set address */ -static void udc_valid_address(void) { udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F); } +static void udc_valid_address(void) { + udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F); +} /** * \brief Standard device request to set device address @@ -760,7 +771,7 @@ static bool udc_req_std_dev_set_configuration(void) { // Enable new configuration udc_num_configuration = udd_g_ctrlreq.req.wValue & 0xFF; if (udc_num_configuration == 0) { - return true; // Default empty configuration requested + return true; // Default empty configuration requested } // Update pointer of the configuration descriptor #ifdef USB_DEVICE_HS_SUPPORT @@ -793,10 +804,10 @@ static bool udc_req_std_iface_get_setting(void) { udi_api_t UDC_DESC_STORAGE *udi_api; if (udd_g_ctrlreq.req.wLength != 1) { - return false; // Error in request + return false; // Error in request } if (!udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } // Check the interface number included in the request @@ -829,10 +840,10 @@ static bool udc_req_std_iface_set_setting(void) { uint8_t iface_num, setting_num; if (udd_g_ctrlreq.req.wLength) { - return false; // Error in request + return false; // Error in request } if (!udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; @@ -856,7 +867,7 @@ static bool udc_reqstd(void) { if (Udd_setup_is_in()) { // GET Standard Requests if (udd_g_ctrlreq.req.wLength == 0) { - return false; // Error for USB host + return false; // Error for USB host } if (USB_REQ_RECIP_DEVICE == Udd_setup_recipient()) { @@ -950,7 +961,7 @@ static bool udc_req_iface(void) { udi_api_t UDC_DESC_STORAGE *udi_api; if (0 == udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } // Check interface number iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; @@ -984,7 +995,7 @@ static bool udc_req_ep(void) { udi_api_t UDC_DESC_STORAGE *udi_api; if (0 == udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } // Send this request on all enabled interfaces iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; @@ -1024,7 +1035,7 @@ bool udc_process_setup(void) { if (Udd_setup_is_in()) { if (udd_g_ctrlreq.req.wLength == 0) { - return false; // Error from USB host + return false; // Error from USB host } } @@ -1052,7 +1063,7 @@ bool udc_process_setup(void) { // Here SETUP request unknown by UDC and UDIs #ifdef USB_DEVICE_SPECIFIC_REQUEST // Try to decode it in specific callback - return USB_DEVICE_SPECIFIC_REQUEST(); // Ex: Vendor request,... + return USB_DEVICE_SPECIFIC_REQUEST(); // Ex: Vendor request,... #else return false; #endif diff --git a/tmk_core/protocol/arm_atsam/usb/udc.h b/tmk_core/protocol/arm_atsam/usb/udc.h index 8d33307d3c86..f2144059eb5a 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc.h +++ b/tmk_core/protocol/arm_atsam/usb/udc.h @@ -172,7 +172,9 @@ extern "C" { } \endcode */ -static inline bool udc_include_vbus_monitoring(void) { return udd_include_vbus_monitoring(); } +static inline bool udc_include_vbus_monitoring(void) { + return udd_include_vbus_monitoring(); +} /*! \brief Start the USB Device stack */ @@ -189,19 +191,25 @@ void udc_stop(void); * then it will attach device when an acceptable Vbus * level from the host is detected. */ -static inline void udc_attach(void) { udd_attach(); } +static inline void udc_attach(void) { + udd_attach(); +} /** * \brief Detaches the device from the bus * * The driver must remove pull-up on USB line D- or D+. */ -static inline void udc_detach(void) { udd_detach(); } +static inline void udc_detach(void) { + udd_detach(); +} /*! \brief The USB driver sends a resume signal called \e "Upstream Resume" * This is authorized only when the remote wakeup feature is enabled by host. */ -inline void udc_remotewakeup(void) { udd_send_remotewakeup(); } +inline void udc_remotewakeup(void) { + udd_send_remotewakeup(); +} /** * \brief Returns a pointer on the current interface descriptor @@ -245,4 +253,4 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void); } #endif -#endif // _UDC_H_ +#endif // _UDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udc_desc.h b/tmk_core/protocol/arm_atsam/usb/udc_desc.h index 39ea153b401b..50861da96436 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc_desc.h +++ b/tmk_core/protocol/arm_atsam/usb/udc_desc.h @@ -129,4 +129,4 @@ extern UDC_DESC_STORAGE udc_config_t udc_config; #ifdef __cplusplus } #endif -#endif // _UDC_DESC_H_ +#endif // _UDC_DESC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udd.h b/tmk_core/protocol/arm_atsam/usb/udd.h index 805b761a7755..d9f58baf0b27 100644 --- a/tmk_core/protocol/arm_atsam/usb/udd.h +++ b/tmk_core/protocol/arm_atsam/usb/udd.h @@ -381,4 +381,4 @@ extern void udc_sof_notify(void); #ifdef __cplusplus } #endif -#endif // _UDD_H_ +#endif // _UDD_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi.h b/tmk_core/protocol/arm_atsam/usb/udi.h index 89942cce4d93..60b117f3ca3a 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi.h +++ b/tmk_core/protocol/arm_atsam/usb/udi.h @@ -130,4 +130,4 @@ typedef struct { #ifdef __cplusplus } #endif -#endif // _UDI_H_ +#endif // _UDI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c index 322a32ebcc6d..d40030f36dfc 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -386,7 +386,7 @@ bool udi_cdc_comm_setup(void) { switch (udd_g_ctrlreq.req.bRequest) { case USB_REQ_CDC_GET_LINE_CODING: // Get configuration of CDC line - if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host + if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host udd_g_ctrlreq.payload = (uint8_t *)&udi_cdc_line_coding[port]; udd_g_ctrlreq.payload_size = sizeof(usb_cdc_line_coding_t); return true; @@ -400,7 +400,7 @@ bool udi_cdc_comm_setup(void) { switch (udd_g_ctrlreq.req.bRequest) { case USB_REQ_CDC_SET_LINE_CODING: // Change configuration of CDC line - if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host + if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host udd_g_ctrlreq.callback = udi_cdc_line_coding_received; udd_g_ctrlreq.payload = (uint8_t *)&udi_cdc_line_coding[port]; udd_g_ctrlreq.payload_size = sizeof(usb_cdc_line_coding_t); @@ -417,15 +417,15 @@ bool udi_cdc_comm_setup(void) { } } } - return false; // request Not supported + return false; // request Not supported } bool udi_cdc_data_setup(void) { - return false; // request Not supported + return false; // request Not supported } uint8_t udi_cdc_getsetting(void) { - return 0; // CDC don't have multiple alternate setting + return 0; // CDC don't have multiple alternate setting } void udi_cdc_data_sof_notify(void) { @@ -476,7 +476,7 @@ static void udi_cdc_line_coding_received(void) { static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) { udd_ep_id_t ep_comm; - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t //#if UDI_CDC_PORT_NB == 1 // To optimize code port = 0; @@ -514,7 +514,7 @@ static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) } static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) { -# if UDI_CDC_PORT_NB == 1 // To optimize code +# if UDI_CDC_PORT_NB == 1 // To optimize code port = 0; # endif @@ -562,7 +562,7 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, //------- Internal routines to process data transfer static bool udi_cdc_rx_start(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t buf_sel_trans; udd_ep_id_t ep; @@ -685,7 +685,7 @@ static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t } static void udi_cdc_tx_send(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t buf_sel_trans; bool b_short_packet; udd_ep_id_t ep; @@ -696,15 +696,15 @@ static void udi_cdc_tx_send(uint8_t port) { //#endif if (udi_cdc_tx_trans_ongoing[port]) { - return; // Already on going or wait next SOF to send next data + return; // Already on going or wait next SOF to send next data } if (udd_is_high_speed()) { if (udi_cdc_tx_sof_num[port] == udd_get_micro_frame_number()) { - return; // Wait next SOF to send next data + return; // Wait next SOF to send next data } } else { if (udi_cdc_tx_sof_num[port] == udd_get_frame_number()) { - return; // Wait next SOF to send next data + return; // Wait next SOF to send next data } } @@ -743,7 +743,7 @@ static void udi_cdc_tx_send(uint8_t port) { udi_cdc_tx_sof_num[port] = udd_get_frame_number(); } } else { - udi_cdc_tx_sof_num[port] = 0; // Force next transfer without wait SOF + udi_cdc_tx_sof_num[port] = 0; // Force next transfer without wait SOF } /* @@ -768,28 +768,48 @@ static void udi_cdc_tx_send(uint8_t port) { //--------------------------------------------- //------- Application interface -void udi_cdc_ctrl_signal_dcd(bool b_set) { udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DCD); } +void udi_cdc_ctrl_signal_dcd(bool b_set) { + udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DCD); +} -void udi_cdc_ctrl_signal_dsr(bool b_set) { udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR); } +void udi_cdc_ctrl_signal_dsr(bool b_set) { + udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR); +} -void udi_cdc_signal_framing_error(void) { udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING); } +void udi_cdc_signal_framing_error(void) { + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING); +} -void udi_cdc_signal_parity_error(void) { udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY); } +void udi_cdc_signal_parity_error(void) { + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY); +} -void udi_cdc_signal_overrun(void) { udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN); } +void udi_cdc_signal_overrun(void) { + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN); +} -void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set) { udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DCD); } +void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set) { + udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DCD); +} -void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set) { udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DSR); } +void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set) { + udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DSR); +} -void udi_cdc_multi_signal_framing_error(uint8_t port) { udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_FRAMING); } +void udi_cdc_multi_signal_framing_error(uint8_t port) { + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_FRAMING); +} -void udi_cdc_multi_signal_parity_error(uint8_t port) { udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_PARITY); } +void udi_cdc_multi_signal_parity_error(uint8_t port) { + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_PARITY); +} -void udi_cdc_multi_signal_overrun(uint8_t port) { udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_OVERRUN); } +void udi_cdc_multi_signal_overrun(uint8_t port) { + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_OVERRUN); +} iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint16_t pos; iram_size_t nb_received; @@ -807,14 +827,20 @@ iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port) { return nb_received; } -iram_size_t udi_cdc_get_nb_received_data(void) { return udi_cdc_multi_get_nb_received_data(0); } +iram_size_t udi_cdc_get_nb_received_data(void) { + return udi_cdc_multi_get_nb_received_data(0); +} -bool udi_cdc_multi_is_rx_ready(uint8_t port) { return (udi_cdc_multi_get_nb_received_data(port) > 0); } +bool udi_cdc_multi_is_rx_ready(uint8_t port) { + return (udi_cdc_multi_get_nb_received_data(port) > 0); +} -bool udi_cdc_is_rx_ready(void) { return udi_cdc_multi_is_rx_ready(0); } +bool udi_cdc_is_rx_ready(void) { + return udi_cdc_multi_is_rx_ready(0); +} int udi_cdc_multi_getc(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t int rx_data = 0; bool b_databit_9; uint16_t pos; @@ -859,10 +885,12 @@ int udi_cdc_multi_getc(uint8_t port) { return rx_data; } -int udi_cdc_getc(void) { return udi_cdc_multi_getc(0); } +int udi_cdc_getc(void) { + return udi_cdc_multi_getc(0); +} iram_size_t udi_cdc_multi_read_buf(uint8_t port, void *buf, iram_size_t size) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t * ptr_buf = (uint8_t *)buf; iram_size_t copy_nb; uint16_t pos; @@ -912,7 +940,7 @@ static iram_size_t udi_cdc_multi_read_no_polling(uint8_t port, void *buf, iram_s iram_size_t nb_avail_data; uint16_t pos; uint8_t buf_sel; - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t //#if UDI_CDC_PORT_NB == 1 // To optimize code port = 0; @@ -952,12 +980,16 @@ static iram_size_t udi_cdc_multi_read_no_polling(uint8_t port, void *buf, iram_s return (nb_avail_data); } -iram_size_t udi_cdc_read_no_polling(void *buf, iram_size_t size) { return udi_cdc_multi_read_no_polling(0, buf, size); } +iram_size_t udi_cdc_read_no_polling(void *buf, iram_size_t size) { + return udi_cdc_multi_read_no_polling(0, buf, size); +} -iram_size_t udi_cdc_read_buf(void *buf, iram_size_t size) { return udi_cdc_multi_read_buf(0, buf, size); } +iram_size_t udi_cdc_read_buf(void *buf, iram_size_t size) { + return udi_cdc_multi_read_buf(0, buf, size); +} iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t iram_size_t buf_sel_nb, retval; uint8_t buf_sel; @@ -986,14 +1018,20 @@ iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port) { return retval; } -iram_size_t udi_cdc_get_free_tx_buffer(void) { return udi_cdc_multi_get_free_tx_buffer(0); } +iram_size_t udi_cdc_get_free_tx_buffer(void) { + return udi_cdc_multi_get_free_tx_buffer(0); +} -bool udi_cdc_multi_is_tx_ready(uint8_t port) { return (udi_cdc_multi_get_free_tx_buffer(port) != 0); } +bool udi_cdc_multi_is_tx_ready(uint8_t port) { + return (udi_cdc_multi_get_free_tx_buffer(port) != 0); +} -bool udi_cdc_is_tx_ready(void) { return udi_cdc_multi_is_tx_ready(0); } +bool udi_cdc_is_tx_ready(void) { + return udi_cdc_multi_is_tx_ready(0); +} int udi_cdc_multi_putc(uint8_t port, int value) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t bool b_databit_9; uint8_t buf_sel; @@ -1030,10 +1068,12 @@ int udi_cdc_multi_putc(uint8_t port, int value) { return true; } -int udi_cdc_putc(int value) { return udi_cdc_multi_putc(0, value); } +int udi_cdc_putc(int value) { + return udi_cdc_multi_putc(0, value); +} iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void *buf, iram_size_t size) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t buf_sel; uint16_t buf_nb; iram_size_t copy_nb; @@ -1083,7 +1123,9 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void *buf, iram_size_t s return 0; } -iram_size_t udi_cdc_write_buf(const void *buf, iram_size_t size) { return udi_cdc_multi_write_buf(0, buf, size); } +iram_size_t udi_cdc_write_buf(const void *buf, iram_size_t size) { + return udi_cdc_multi_write_buf(0, buf, size); +} # define MAX_PRINT 256 # define CDC_SEND_INTERVAL 2 @@ -1121,10 +1163,10 @@ uint32_t CDC_print(char *printbuf) { char printbuf[CDC_PRINTBUF_SIZE]; int CDC_printf(const char *_Format, ...) { - va_list va; // Variable argument list variable + va_list va; // Variable argument list variable int result; - va_start(va, _Format); // Initialize the variable argument list + va_start(va, _Format); // Initialize the variable argument list result = vsnprintf(printbuf, CDC_PRINTBUF_SIZE, _Format, va); va_end(va); @@ -1146,18 +1188,18 @@ uint32_t CDC_input_buf(inbuf_t inbuf, uint32_t inbuf_size) { if (RXChar) { switch (RXChar) { - case '\t': // tab - repeat last + case '\t': // tab - repeat last inbuf.count = inbuf.lastcount; inbuf.buf[inbuf.count + 1] = 0; CDC_print(inbuf.buf); break; - case '\r': // enter + case '\r': // enter inbuf.buf[inbuf.count] = 0; inbuf.lastcount = inbuf.count; inbuf.count = 0; entered = 1; break; - case '\b': // backspace + case '\b': // backspace if (inbuf.count > 0) { inbuf.count -= 1; CDC_print("\b \b\0"); @@ -1181,7 +1223,9 @@ uint32_t CDC_input_buf(inbuf_t inbuf, uint32_t inbuf_size) { return entered; } -uint32_t CDC_input() { return CDC_input_buf(inbuf, CDC_INBUF_SIZE); } +uint32_t CDC_input() { + return CDC_input_buf(inbuf, CDC_INBUF_SIZE); +} void CDC_init(void) { inbuf.count = 0; @@ -1190,19 +1234,27 @@ void CDC_init(void) { cdc_tx_send_time_next = timer_read64() + CDC_SEND_INTERVAL; } -#else // CDC line 62 +#else // CDC line 62 char printbuf[CDC_PRINTBUF_SIZE]; -void CDC_send(void) { return; } +void CDC_send(void) { + return; +} -uint32_t CDC_print(char *printbuf) { return 0; } +uint32_t CDC_print(char *printbuf) { + return 0; +} -int CDC_printf(const char *_Format, ...) { return 0; } +int CDC_printf(const char *_Format, ...) { + return 0; +} inbuf_t inbuf; -uint32_t CDC_input(void) { return 0; } +uint32_t CDC_input(void) { + return 0; +} void CDC_init(void) { inbuf.count = 0; @@ -1210,6 +1262,6 @@ void CDC_init(void) { printbuf[0] = 0; } -#endif // CDC line 62 +#endif // CDC line 62 //@} diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h index 406023980c74..ff4f521ce011 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h @@ -346,7 +346,7 @@ typedef struct { char buf[CDC_INBUF_SIZE]; } inbuf_t; -#else // VIRTSER_ENABLE +#else // VIRTSER_ENABLE // keep these to accommodate calls if remaining # define CDC_PRINTBUF_SIZE 1 @@ -362,7 +362,7 @@ typedef struct { extern inbuf_t inbuf; -#endif // VIRTSER_ENABLE +#endif // VIRTSER_ENABLE uint32_t CDC_print(char* printbuf); int CDC_printf(const char* _Format, ...); @@ -373,4 +373,4 @@ void CDC_init(void); } #endif -#endif // _UDI_CDC_H_ +#endif // _UDI_CDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h index e07951249262..e17ed7bf4451 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h @@ -59,9 +59,9 @@ extern "C" { #endif -#define UDI_CDC_DATA_EP_IN_0 ((CDC_TX_ENDPOINT) | (USB_EP_DIR_IN)) // TX -#define UDI_CDC_DATA_EP_OUT_0 ((CDC_RX_ENDPOINT) | (USB_EP_DIR_OUT)) // RX -#define UDI_CDC_COMM_EP_0 ((CDC_ACM_ENDPOINT) | (USB_EP_DIR_IN)) // Notify endpoint +#define UDI_CDC_DATA_EP_IN_0 ((CDC_TX_ENDPOINT) | (USB_EP_DIR_IN)) // TX +#define UDI_CDC_DATA_EP_OUT_0 ((CDC_RX_ENDPOINT) | (USB_EP_DIR_OUT)) // RX +#define UDI_CDC_COMM_EP_0 ((CDC_ACM_ENDPOINT) | (USB_EP_DIR_IN)) // Notify endpoint #define UDI_CDC_COMM_IFACE_NUMBER_0 (CDC_STATUS_INTERFACE) #define UDI_CDC_DATA_IFACE_NUMBER_0 (CDC_DATA_INTERFACE) @@ -69,4 +69,4 @@ extern "C" { #ifdef __cplusplus } #endif -#endif // _UDI_CDC_CONF_H_ +#endif // _UDI_CDC_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h index 1c0983115cc1..eeed19627592 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -220,7 +220,7 @@ along with this program. If not, see . # define NEXT_OUT_EPNUM_4 (CDC_OUT_EPNUM + 1) # define CDC_ACM_SIZE CDC_NOTIFICATION_EPSIZE -# define CDC_RX_SIZE CDC_EPSIZE // KFSMOD was 64 +# define CDC_RX_SIZE CDC_EPSIZE // KFSMOD was 64 # define CDC_TX_SIZE CDC_RX_SIZE # define CDC_ACM_POLLING_INTERVAL 255 # define CDC_EP_INTERVAL_STATUS CDC_ACM_POLLING_INTERVAL @@ -370,7 +370,7 @@ extern udi_hid_exk_report_t udi_hid_exk_report; COMPILER_PACK_RESET() -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE // ********************************************************************** // NKRO Descriptor structure and content @@ -433,7 +433,7 @@ extern uint8_t udi_hid_nkro_report[UDI_HID_NKRO_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE // ********************************************************************** // MOU Descriptor structure and content @@ -449,7 +449,7 @@ typedef struct { } udi_hid_mou_desc_t; typedef struct { - uint8_t array[77]; // MOU PDS + uint8_t array[77]; // MOU PDS } udi_hid_mou_report_desc_t; // clang-format off @@ -488,12 +488,12 @@ typedef struct { // clang-format on // report buffer -# define UDI_HID_MOU_REPORT_SIZE 5 // MOU PDS +# define UDI_HID_MOU_REPORT_SIZE 5 // MOU PDS extern uint8_t udi_hid_mou_report[UDI_HID_MOU_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // MOUSE_ENABLE +#endif // MOUSE_ENABLE // ********************************************************************** // RAW Descriptor structure and content @@ -565,7 +565,7 @@ extern uint8_t udi_hid_raw_report[UDI_HID_RAW_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // RAW_ENABLE +#endif // RAW_ENABLE // ********************************************************************** // CON Descriptor structure and content @@ -637,7 +637,7 @@ extern uint8_t udi_hid_con_report[UDI_HID_CON_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE // ********************************************************************** // CDC Descriptor structure and content @@ -780,7 +780,7 @@ typedef struct { COMPILER_PACK_RESET() -#endif // VIRTSER_ENABLE +#endif // VIRTSER_ENABLE // ********************************************************************** // CONFIGURATION Descriptor structure and content @@ -815,4 +815,4 @@ typedef struct { COMPILER_PACK_RESET() -#endif //_UDI_DEVICE_CONF_H_ +#endif //_UDI_DEVICE_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h index 09de47546999..7a9ed3193001 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h @@ -28,4 +28,4 @@ along with this program. If not, see . #define CDC_NOTIFICATION_EPSIZE 8 #define CDC_EPSIZE 16 -#endif //_UDI_DEVICE_EPSIZE_H_ +#endif //_UDI_DEVICE_EPSIZE_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid.c b/tmk_core/protocol/arm_atsam/usb/udi_hid.c index b0bdcc693252..73e384a03927 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid.c @@ -110,7 +110,7 @@ bool udi_hid_setup(uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool } } } - return false; // Request not supported + return false; // Request not supported } //--------------------------------------------- diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid.h b/tmk_core/protocol/arm_atsam/usb/udi_hid.h index 6fd2cabd4cef..a08b7db744c8 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid.h @@ -82,4 +82,4 @@ bool udi_hid_setup(uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool #ifdef __cplusplus } #endif -#endif // _UDI_HID_H_ +#endif // _UDI_HID_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index 9ea4addcfc3e..be4f2bb0c90b 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -94,42 +94,42 @@ static uint8_t udi_hid_kbd_report_trans[UDI_HID_KBD_REPORT_SIZE]; COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc = {{ - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x06, // Usage (Keyboard) - 0xA1, 0x01, // Collection (Application) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) // Modifiers (8 bits) - 0x05, 0x07, // Usage Page (Keyboard) - 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) - 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x08, // Report Count (8) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x05, 0x07, // Usage Page (Keyboard) + 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) + 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Reserved (1 byte) - 0x81, 0x01, // Input (Constant) + 0x81, 0x01, // Input (Constant) // Keycodes (6 bytes) - 0x19, 0x00, // Usage Minimum (0) - 0x29, 0xFF, // Usage Maximum (255) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0xFF, // Logical Maximum (255) - 0x95, 0x06, // Report Count (6) - 0x75, 0x08, // Report Size (8) - 0x81, 0x00, // Input (Data, Array, Absolute) + 0x19, 0x00, // Usage Minimum (0) + 0x29, 0xFF, // Usage Maximum (255) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0xFF, // Logical Maximum (255) + 0x95, 0x06, // Report Count (6) + 0x75, 0x08, // Report Size (8) + 0x81, 0x00, // Input (Data, Array, Absolute) // Status LEDs (5 bits) - 0x05, 0x08, // Usage Page (LED) - 0x19, 0x01, // Usage Minimum (Num Lock) - 0x29, 0x05, // Usage Maximum (Kana) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x05, // Report Count (5) - 0x75, 0x01, // Report Size (1) - 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x05, // Report Count (5) + 0x75, 0x01, // Report Size (1) + 0x91, 0x02, // Output (Data, Variable, Absolute) // LED padding (3 bits) - 0x95, 0x03, // Report Count (3) - 0x91, 0x01, // Output (Constant) - 0xC0 // End Collection + 0x95, 0x03, // Report Count (3) + 0x91, 0x01, // Output (Constant) + 0xC0 // End Collection }}; static bool udi_hid_kbd_setreport(void); @@ -148,11 +148,17 @@ bool udi_hid_kbd_enable(void) { return UDI_HID_KBD_ENABLE_EXT(); } -void udi_hid_kbd_disable(void) { UDI_HID_KBD_DISABLE_EXT(); } +void udi_hid_kbd_disable(void) { + UDI_HID_KBD_DISABLE_EXT(); +} -bool udi_hid_kbd_setup(void) { return udi_hid_setup(&udi_hid_kbd_rate, &udi_hid_kbd_protocol, (uint8_t *)&udi_hid_kbd_report_desc, udi_hid_kbd_setreport); } +bool udi_hid_kbd_setup(void) { + return udi_hid_setup(&udi_hid_kbd_rate, &udi_hid_kbd_protocol, (uint8_t *)&udi_hid_kbd_report_desc, udi_hid_kbd_setreport); +} -uint8_t udi_hid_kbd_getsetting(void) { return 0; } +uint8_t udi_hid_kbd_getsetting(void) { + return 0; +} static bool udi_hid_kbd_setreport(void) { if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) && (1 == udd_g_ctrlreq.req.wLength)) { @@ -234,41 +240,41 @@ static uint8_t udi_hid_nkro_report_trans[UDI_HID_NKRO_REPORT_SIZE]; COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_nkro_report_desc_t udi_hid_nkro_report_desc = {{ - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x06, // Usage (Keyboard) - 0xA1, 0x01, // Collection (Application) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) // Modifiers (8 bits) - 0x05, 0x07, // Usage Page (Keyboard/Keypad) - 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) - 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x08, // Report Count (8) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) + 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Keycodes - 0x05, 0x07, // Usage Page (Keyboard/Keypad) - 0x19, 0x00, // Usage Minimum (0) - 0x29, 0xF7, // Usage Maximum (247) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0xF8, // Report Count (248) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0x00, // Usage Minimum (0) + 0x29, 0xF7, // Usage Maximum (247) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0xF8, // Report Count (248) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield) // Status LEDs (5 bits) - 0x05, 0x08, // Usage Page (LED) - 0x19, 0x01, // Usage Minimum (Num Lock) - 0x29, 0x05, // Usage Maximum (Kana) - 0x95, 0x05, // Report Count (5) - 0x75, 0x01, // Report Size (1) - 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x95, 0x05, // Report Count (5) + 0x75, 0x01, // Report Size (1) + 0x91, 0x02, // Output (Data, Variable, Absolute) // LED padding (3 bits) - 0x95, 0x01, // Report Count (1) - 0x75, 0x03, // Report Size (3) - 0x91, 0x03, // Output (Constant) - 0xC0 // End Collection + 0x95, 0x01, // Report Count (1) + 0x75, 0x03, // Report Size (3) + 0x91, 0x03, // Output (Constant) + 0xC0 // End Collection }}; static bool udi_hid_nkro_setreport(void); @@ -285,18 +291,24 @@ bool udi_hid_nkro_enable(void) { return UDI_HID_NKRO_ENABLE_EXT(); } -void udi_hid_nkro_disable(void) { UDI_HID_NKRO_DISABLE_EXT(); } +void udi_hid_nkro_disable(void) { + UDI_HID_NKRO_DISABLE_EXT(); +} -bool udi_hid_nkro_setup(void) { return udi_hid_setup(&udi_hid_nkro_rate, &udi_hid_nkro_protocol, (uint8_t *)&udi_hid_nkro_report_desc, udi_hid_nkro_setreport); } +bool udi_hid_nkro_setup(void) { + return udi_hid_setup(&udi_hid_nkro_rate, &udi_hid_nkro_protocol, (uint8_t *)&udi_hid_nkro_report_desc, udi_hid_nkro_setreport); +} -uint8_t udi_hid_nkro_getsetting(void) { return 0; } +uint8_t udi_hid_nkro_getsetting(void) { + return 0; +} // keyboard receives LED report here static bool udi_hid_nkro_setreport(void) { if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) && (1 == udd_g_ctrlreq.req.wLength)) { // Report OUT type on report ID 0 from USB Host udd_g_ctrlreq.payload = &udi_hid_nkro_report_set; - udd_g_ctrlreq.callback = udi_hid_nkro_setreport_valid; // must call routine to transform setreport to LED state + udd_g_ctrlreq.callback = udi_hid_nkro_setreport_valid; // must call routine to transform setreport to LED state udd_g_ctrlreq.payload_size = 1; return true; } @@ -333,7 +345,7 @@ static void udi_hid_nkro_setreport_valid(void) { // UDI_HID_NKRO_CHANGE_LED(udi_hid_nkro_report_set); } -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE //******************************************************************************************** // EXK (extra-keys) SYS-CTRL Keyboard diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h index a2d2281628a2..a33001449858 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h @@ -71,7 +71,7 @@ extern UDC_DESC_STORAGE udi_api_t udi_api_hid_nkro; extern bool udi_hid_nkro_b_report_valid; extern volatile bool udi_hid_nkro_b_report_trans_ongoing; bool udi_hid_nkro_send_report(void); -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE //******************************************************************************************** // SYS-CTRL interface @@ -81,7 +81,7 @@ extern UDC_DESC_STORAGE udi_api_t udi_api_hid_exk; extern bool udi_hid_exk_b_report_valid; extern uint8_t udi_hid_exk_report_set; bool udi_hid_exk_send_report(void); -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE //******************************************************************************************** // CON Console @@ -92,7 +92,7 @@ extern bool udi_hid_con_b_report_valid; extern uint8_t udi_hid_con_report_set[UDI_HID_CON_REPORT_SIZE]; extern volatile bool udi_hid_con_b_report_trans_ongoing; bool udi_hid_con_send_report(void); -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE //******************************************************************************************** // MOU Mouse @@ -101,7 +101,7 @@ bool udi_hid_con_send_report(void); extern UDC_DESC_STORAGE udi_api_t udi_api_hid_mou; extern bool udi_hid_mou_b_report_valid; bool udi_hid_mou_send_report(void); -#endif // MOUSE_ENABLE +#endif // MOUSE_ENABLE //******************************************************************************************** // RAW Raw @@ -110,7 +110,7 @@ bool udi_hid_mou_send_report(void); extern UDC_DESC_STORAGE udi_api_t udi_api_hid_raw; bool udi_hid_raw_send_report(void); bool udi_hid_raw_receive_report(void); -#endif // RAW_ENABLE +#endif // RAW_ENABLE //@} @@ -118,4 +118,4 @@ bool udi_hid_raw_receive_report(void); } #endif -#endif // _UDC_HID_KBD_H_ +#endif // _UDC_HID_KBD_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h index ec73252b6998..db5db17ed506 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h @@ -57,4 +57,4 @@ #include "udi_hid_kbd.h" -#endif // _UDI_HID_KBD_CONF_H_ +#endif // _UDI_HID_KBD_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c index 3c1c9a792699..2a60868ed288 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c @@ -78,17 +78,17 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {.bLength = sizeof(usb #ifdef USB_DEVICE_MANUFACTURE_NAME .iManufacturer = 1, #else - .iManufacturer = 0, // No manufacture string + .iManufacturer = 0, // No manufacture string #endif #ifdef USB_DEVICE_PRODUCT_NAME .iProduct = 2, #else - .iProduct = 0, // No product string + .iProduct = 0, // No product string #endif #if (defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER) .iSerialNumber = 3, #else - .iSerialNumber = 0, // No serial string + .iSerialNumber = 0, // No serial string #endif .bNumConfigurations = 1}; diff --git a/tmk_core/protocol/arm_atsam/usb/ui.c b/tmk_core/protocol/arm_atsam/usb/ui.c index 86c7edc94e18..f5263d728937 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.c +++ b/tmk_core/protocol/arm_atsam/usb/ui.c @@ -48,7 +48,7 @@ # define ARM_MATH_CM4 #endif -#undef LITTLE_ENDIAN // redefined in samd51j18a.h +#undef LITTLE_ENDIAN // redefined in samd51j18a.h #include "samd51j18a.h" #include "ui.h" diff --git a/tmk_core/protocol/arm_atsam/usb/ui.h b/tmk_core/protocol/arm_atsam/usb/ui.h index f7bc6523609b..d1c767d45764 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.h +++ b/tmk_core/protocol/arm_atsam/usb/ui.h @@ -73,4 +73,4 @@ void ui_process(uint16_t framenumber); */ void ui_kbd_led(uint8_t value); -#endif // _UI_H_ +#endif // _UI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb.c b/tmk_core/protocol/arm_atsam/usb/usb.c index b7393660b15f..1abf0a2f4de7 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb.c +++ b/tmk_core/protocol/arm_atsam/usb/usb.c @@ -52,7 +52,7 @@ #endif #include "compiler.h" -#undef LITTLE_ENDIAN // redefined in samd51j18a.h +#undef LITTLE_ENDIAN // redefined in samd51j18a.h #include "samd51j18a.h" #include #include @@ -319,7 +319,7 @@ enum status_code usb_device_endpoint_enable_callback(struct usb_module *module_i module_inst->device_endpoint_enabled_callback_mask[ep_num] |= _usb_endpoint_irq_bits[callback_type]; if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRCPT) { - if (ep_num == 0) { // control endpoint + if (ep_num == 0) { // control endpoint module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRCPT0 | USB_DEVICE_EPINTENSET_TRCPT1; } else if (ep & USB_EP_DIR_IN) { module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRCPT1; @@ -329,7 +329,7 @@ enum status_code usb_device_endpoint_enable_callback(struct usb_module *module_i } if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL) { - if (ep_num == 0) { // control endpoint + if (ep_num == 0) { // control endpoint module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRFAIL0 | USB_DEVICE_EPINTENSET_TRFAIL1; } else if (ep & USB_EP_DIR_IN) { module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRFAIL1; @@ -377,7 +377,7 @@ enum status_code usb_device_endpoint_disable_callback(struct usb_module *module_ module_inst->device_endpoint_enabled_callback_mask[ep_num] &= ~_usb_endpoint_irq_bits[callback_type]; if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRCPT) { - if (ep_num == 0) { // control endpoint + if (ep_num == 0) { // control endpoint module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRCPT0 | USB_DEVICE_EPINTENCLR_TRCPT1; } else if (ep & USB_EP_DIR_IN) { module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRCPT1; @@ -387,7 +387,7 @@ enum status_code usb_device_endpoint_disable_callback(struct usb_module *module_ } if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL) { - if (ep_num == 0) { // control endpoint + if (ep_num == 0) { // control endpoint module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRFAIL0 | USB_DEVICE_EPINTENCLR_TRFAIL1; } else if (ep & USB_EP_DIR_IN) { module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRFAIL1; @@ -903,11 +903,17 @@ void USB_0_Handler(void) { } } -void USB_1_Handler(void) { _usb_device_interrupt_handler(); } +void USB_1_Handler(void) { + _usb_device_interrupt_handler(); +} -void USB_2_Handler(void) { _usb_device_interrupt_handler(); } +void USB_2_Handler(void) { + _usb_device_interrupt_handler(); +} -void USB_3_Handler(void) { _usb_device_interrupt_handler(); } +void USB_3_Handler(void) { + _usb_device_interrupt_handler(); +} /** * \brief Get the default USB module settings @@ -974,10 +980,10 @@ enum status_code usb_init(struct usb_module *module_inst, Usb *const hw, struct pmclk->APBBMASK.bit.USB_ = 1; /* Set up the USB DP/DN pins */ - pport->Group[0].PMUX[12].reg = 0x77; // PA24, PA25, function column H for USB D-, D+ + pport->Group[0].PMUX[12].reg = 0x77; // PA24, PA25, function column H for USB D-, D+ pport->Group[0].PINCFG[24].bit.PMUXEN = 1; pport->Group[0].PINCFG[25].bit.PMUXEN = 1; - pport->Group[1].PMUX[11].bit.PMUXE = 7; // PB22, function column H for USB SOF_1KHz output + pport->Group[1].PMUX[11].bit.PMUXE = 7; // PB22, function column H for USB SOF_1KHz output pport->Group[1].PINCFG[22].bit.PMUXEN = 1; // configure and enable DFLL for USB clock recovery mode at 48MHz @@ -996,7 +1002,7 @@ enum status_code usb_init(struct usb_module *module_inst, Usb *const hw, struct while (posc->DFLLSYNC.bit.DFLLCTRLB) ; posc->DFLLCTRLB.bit.CCDIS = 1; - posc->DFLLMUL.bit.MUL = 0xbb80; // 4800 x 1KHz + posc->DFLLMUL.bit.MUL = 0xbb80; // 4800 x 1KHz while (posc->DFLLSYNC.bit.DFLLMUL) ; posc->DFLLCTRLA.bit.ENABLE = 1; diff --git a/tmk_core/protocol/arm_atsam/usb/usb.h b/tmk_core/protocol/arm_atsam/usb/usb.h index 4c937ecdc92f..270143a11237 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb.h +++ b/tmk_core/protocol/arm_atsam/usb/usb.h @@ -319,14 +319,18 @@ enum status_code usb_init(struct usb_module *module_inst, Usb *const hw, struct * * \param module_inst Pointer to USB device module instance */ -static inline void usb_device_attach(struct usb_module *module_inst) { module_inst->hw->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH; } +static inline void usb_device_attach(struct usb_module *module_inst) { + module_inst->hw->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH; +} /** * \brief Detach USB device from the bus * * \param module_inst Pointer to USB device module instance */ -static inline void usb_device_detach(struct usb_module *module_inst) { module_inst->hw->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH; } +static inline void usb_device_detach(struct usb_module *module_inst) { + module_inst->hw->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH; +} /** * \brief Get the speed mode of USB device @@ -348,7 +352,9 @@ static inline enum usb_speed usb_device_get_speed(struct usb_module *module_inst * \param module_inst Pointer to USB device module instance * \return USB device address value. */ -static inline uint8_t usb_device_get_address(struct usb_module *module_inst) { return ((uint8_t)(module_inst->hw->DEVICE.DADD.bit.DADD)); } +static inline uint8_t usb_device_get_address(struct usb_module *module_inst) { + return ((uint8_t)(module_inst->hw->DEVICE.DADD.bit.DADD)); +} /** * \brief Set the speed mode of USB device @@ -356,7 +362,9 @@ static inline uint8_t usb_device_get_address(struct usb_module *module_inst) { r * \param module_inst Pointer to USB device module instance * \param address USB device address value */ -static inline void usb_device_set_address(struct usb_module *module_inst, uint8_t address) { module_inst->hw->DEVICE.DADD.reg = USB_DEVICE_DADD_ADDEN | address; } +static inline void usb_device_set_address(struct usb_module *module_inst, uint8_t address) { + module_inst->hw->DEVICE.DADD.reg = USB_DEVICE_DADD_ADDEN | address; +} /** * \brief Get the frame number of USB device @@ -364,7 +372,9 @@ static inline void usb_device_set_address(struct usb_module *module_inst, uint8_ * \param module_inst Pointer to USB device module instance * \return USB device frame number value. */ -static inline uint16_t usb_device_get_frame_number(struct usb_module *module_inst) { return ((uint16_t)(module_inst->hw->DEVICE.FNUM.bit.FNUM)); } +static inline uint16_t usb_device_get_frame_number(struct usb_module *module_inst) { + return ((uint16_t)(module_inst->hw->DEVICE.FNUM.bit.FNUM)); +} /** * \brief Get the micro-frame number of USB device @@ -372,14 +382,18 @@ static inline uint16_t usb_device_get_frame_number(struct usb_module *module_ins * \param module_inst Pointer to USB device module instance * \return USB device micro-frame number value. */ -static inline uint16_t usb_device_get_micro_frame_number(struct usb_module *module_inst) { return ((uint16_t)(module_inst->hw->DEVICE.FNUM.reg)); } +static inline uint16_t usb_device_get_micro_frame_number(struct usb_module *module_inst) { + return ((uint16_t)(module_inst->hw->DEVICE.FNUM.reg)); +} /** * \brief USB device send the resume wakeup * * \param module_inst Pointer to USB device module instance */ -static inline void usb_device_send_remote_wake_up(struct usb_module *module_inst) { module_inst->hw->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_UPRSM; } +static inline void usb_device_send_remote_wake_up(struct usb_module *module_inst) { + module_inst->hw->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_UPRSM; +} /** * \brief USB device set the LPM mode @@ -387,7 +401,9 @@ static inline void usb_device_send_remote_wake_up(struct usb_module *module_inst * \param module_inst Pointer to USB device module instance * \param lpm_mode LPM mode */ -static inline void usb_device_set_lpm_mode(struct usb_module *module_inst, enum usb_device_lpm_mode lpm_mode) { module_inst->hw->DEVICE.CTRLB.bit.LPMHDSK = lpm_mode; } +static inline void usb_device_set_lpm_mode(struct usb_module *module_inst, enum usb_device_lpm_mode lpm_mode) { + module_inst->hw->DEVICE.CTRLB.bit.LPMHDSK = lpm_mode; +} /** * \name USB Device Callback Management diff --git a/tmk_core/protocol/arm_atsam/usb/usb_atmel.h b/tmk_core/protocol/arm_atsam/usb/usb_atmel.h index 1cef70378822..82bafdc7d156 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_atmel.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_atmel.h @@ -109,7 +109,7 @@ #define USB_PID_ATMEL_UC3_EVK1101_CTRLPANEL_HID_MS 0x2306 #define USB_PID_ATMEL_UC3_CDC 0x2307 #define USB_PID_ATMEL_UC3_AUDIO_MICRO 0x2308 -#define USB_PID_ATMEL_UC3_CDC_DEBUG 0x2310 // Virtual Com (debug interface) on EVK11xx +#define USB_PID_ATMEL_UC3_CDC_DEBUG 0x2310 // Virtual Com (debug interface) on EVK11xx #define USB_PID_ATMEL_UC3_AUDIO_SPEAKER_MICRO 0x2311 #define USB_PID_ATMEL_UC3_CDC_MSC 0x2312 //! @} @@ -186,4 +186,4 @@ //! @} -#endif // _USB_ATMEL_H_ +#endif // _USB_ATMEL_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c b/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c index b3d9cba8263f..bc5e79d9f09c 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c +++ b/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c @@ -127,12 +127,12 @@ uint8_t udd_ctrl_buffer[USB_DEVICE_EP_CTRL_SIZE]; /** Bit definitions about endpoint control state machine for udd_ep_control_state */ typedef enum { - UDD_EPCTRL_SETUP = 0, //!< Wait a SETUP packet - UDD_EPCTRL_DATA_OUT = 1, //!< Wait a OUT data packet - UDD_EPCTRL_DATA_IN = 2, //!< Wait a IN data packet - UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP = 3, //!< Wait a IN ZLP packet - UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP = 4, //!< Wait a OUT ZLP packet - UDD_EPCTRL_STALL_REQ = 5, //!< STALL enabled on IN & OUT packet + UDD_EPCTRL_SETUP = 0, //!< Wait a SETUP packet + UDD_EPCTRL_DATA_OUT = 1, //!< Wait a OUT data packet + UDD_EPCTRL_DATA_IN = 2, //!< Wait a IN data packet + UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP = 3, //!< Wait a IN ZLP packet + UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP = 4, //!< Wait a OUT ZLP packet + UDD_EPCTRL_STALL_REQ = 5, //!< STALL enabled on IN & OUT packet } udd_ctrl_ep_state_t; /** Global variable to give and record information of the set up request management */ @@ -363,11 +363,17 @@ void udd_ep_abort(udd_ep_id_t ep) { } } -bool udd_is_high_speed(void) { return false; } +bool udd_is_high_speed(void) { + return false; +} -uint16_t udd_get_frame_number(void) { return usb_device_get_frame_number(&usb_device); } +uint16_t udd_get_frame_number(void) { + return usb_device_get_frame_number(&usb_device); +} -uint16_t udd_get_micro_frame_number(void) { return usb_device_get_micro_frame_number(&usb_device); } +uint16_t udd_get_micro_frame_number(void) { + return usb_device_get_micro_frame_number(&usb_device); +} void udd_ep_free(udd_ep_id_t ep) { struct usb_device_endpoint_config config_ep; @@ -436,7 +442,9 @@ bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, uint16_t MaxEndpointSize return true; } -bool udd_ep_is_halted(udd_ep_id_t ep) { return usb_device_endpoint_is_halted(&usb_device, ep); } +bool udd_ep_is_halted(udd_ep_id_t ep) { + return usb_device_endpoint_is_halted(&usb_device, ep); +} bool udd_ep_set_halt(udd_ep_id_t ep) { uint8_t ep_num = ep & USB_EP_ADDR_MASK; @@ -591,9 +599,13 @@ bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, uint8_t *buf, iram_size_t bu } } -void udd_set_address(uint8_t address) { usb_device_set_address(&usb_device, address); } +void udd_set_address(uint8_t address) { + usb_device_set_address(&usb_device, address); +} -uint8_t udd_getaddress(void) { return usb_device_get_address(&usb_device); } +uint8_t udd_getaddress(void) { + return usb_device_get_address(&usb_device); +} void udd_send_remotewakeup(void) { uint32_t try = 5; @@ -912,7 +924,7 @@ static void _usb_device_lpm_suspend(struct usb_module *module_inst, void *pointe usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_WAKEUP); //#warning Here the sleep mode must be choose to have a DFLL startup time < bmAttribut.HIRD - udd_sleep_mode(UDD_STATE_SUSPEND_LPM); // Enter in LPM SUSPEND mode + udd_sleep_mode(UDD_STATE_SUSPEND_LPM); // Enter in LPM SUSPEND mode if ((*lpm_wakeup_enable)) { UDC_REMOTEWAKEUP_LPM_ENABLE(); } diff --git a/tmk_core/protocol/arm_atsam/usb/usb_hub.c b/tmk_core/protocol/arm_atsam/usb/usb_hub.c index c5fd284aab76..14fba799c797 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_hub.c +++ b/tmk_core/protocol/arm_atsam/usb/usb_hub.c @@ -27,7 +27,7 @@ uint8_t usb_extra_state; uint8_t usb_extra_manual; uint8_t usb_gcr_auto; -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER uint16_t adc_extra; @@ -51,10 +51,10 @@ void USB_Hub_init(void) { pmclk->APBBMASK.bit.USB_ = 1; // setup port pins for D-, D+, and SOF_1KHZ - pport->Group[0].PMUX[12].reg = 0x77; // PA24, PA25, function column H for USB D-, D+ + pport->Group[0].PMUX[12].reg = 0x77; // PA24, PA25, function column H for USB D-, D+ pport->Group[0].PINCFG[24].bit.PMUXEN = 1; pport->Group[0].PINCFG[25].bit.PMUXEN = 1; - pport->Group[1].PMUX[11].bit.PMUXE = 7; // PB22, function column H for USB SOF_1KHz output + pport->Group[1].PMUX[11].bit.PMUXE = 7; // PB22, function column H for USB SOF_1KHz output pport->Group[1].PINCFG[22].bit.PMUXEN = 1; // configure and enable DFLL for USB clock recovery mode at 48MHz @@ -78,7 +78,7 @@ void USB_Hub_init(void) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_4); } posc->DFLLCTRLB.bit.CCDIS = 1; - posc->DFLLMUL.bit.MUL = 0xBB80; // 4800 x 1KHz + posc->DFLLMUL.bit.MUL = 0xBB80; // 4800 x 1KHz while (posc->DFLLSYNC.bit.DFLLMUL) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLMUL); } @@ -99,7 +99,7 @@ void USB_Hub_init(void) { pusb->DEVICE.PADCAL.bit.TRANSP = (USB_FUSES_TRANSP_ADDR >> USB_FUSES_TRANSP_Pos) & USB_FUSES_TRANSP_Msk; pusb->DEVICE.PADCAL.bit.TRIM = (USB_FUSES_TRIM_ADDR >> USB_FUSES_TRIM_Pos) & USB_FUSES_TRIM_Msk; // device mode, enabled - pusb->DEVICE.CTRLB.bit.SPDCONF = 0; // full speed + pusb->DEVICE.CTRLB.bit.SPDCONF = 0; // full speed pusb->DEVICE.CTRLA.bit.MODE = 0; pusb->DEVICE.CTRLA.bit.ENABLE = 1; while (pusb->DEVICE.SYNCBUSY.bit.ENABLE) { @@ -111,8 +111,8 @@ void USB_Hub_init(void) { USB2422_init(); - sr_exp_data.bit.HUB_CONNECT = 1; // connect signal - sr_exp_data.bit.HUB_RESET_N = 1; // reset high + sr_exp_data.bit.HUB_CONNECT = 1; // connect signal + sr_exp_data.bit.HUB_RESET_N = 1; // reset high SR_EXP_WriteData(); wait_us(100); @@ -122,7 +122,7 @@ void USB_Hub_init(void) { usb_extra_manual = 0; usb_gcr_auto = 1; -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER DBGC(DC_USB2422_INIT_COMPLETE); } @@ -131,10 +131,10 @@ void USB_reset(void) { DBGC(DC_USB_RESET_BEGIN); // pulse reset for at least 1 usec - sr_exp_data.bit.HUB_RESET_N = 0; // reset low + sr_exp_data.bit.HUB_RESET_N = 0; // reset low SR_EXP_WriteData(); wait_us(2); - sr_exp_data.bit.HUB_RESET_N = 1; // reset high to run + sr_exp_data.bit.HUB_RESET_N = 1; // reset high to run SR_EXP_WriteData(); DBGC(DC_USB_RESET_COMPLETE); @@ -150,7 +150,9 @@ void USB_configure(void) { DBGC(DC_USB_CONFIGURE_COMPLETE); } -uint16_t USB_active(void) { return USB2422_active(); } +uint16_t USB_active(void) { + return USB2422_active(); +} void USB_set_host_by_voltage(void) { // UP is upstream device (HOST) @@ -162,13 +164,13 @@ void USB_set_host_by_voltage(void) { usb_host_port = USB_HOST_PORT_UNKNOWN; #ifndef MD_BOOTLOADER usb_extra_state = USB_EXTRA_STATE_UNKNOWN; -#endif // MD_BOOTLOADER - sr_exp_data.bit.SRC_1 = 1; // USBC-1 available for test - sr_exp_data.bit.SRC_2 = 1; // USBC-2 available for test - sr_exp_data.bit.E_UP_N = 1; // HOST disable - sr_exp_data.bit.E_DN1_N = 1; // EXTRA disable - sr_exp_data.bit.E_VBUS_1 = 0; // USBC-1 disable full power I/O - sr_exp_data.bit.E_VBUS_2 = 0; // USBC-2 disable full power I/O +#endif // MD_BOOTLOADER + sr_exp_data.bit.SRC_1 = 1; // USBC-1 available for test + sr_exp_data.bit.SRC_2 = 1; // USBC-2 available for test + sr_exp_data.bit.E_UP_N = 1; // HOST disable + sr_exp_data.bit.E_DN1_N = 1; // EXTRA disable + sr_exp_data.bit.E_VBUS_1 = 0; // USBC-1 disable full power I/O + sr_exp_data.bit.E_VBUS_2 = 0; // USBC-2 disable full power I/O SR_EXP_WriteData(); @@ -185,33 +187,33 @@ void USB_set_host_by_voltage(void) { v_con_2_boot = v_con_2; if (v_con_1 > v_con_2) { - sr_exp_data.bit.S_UP = 0; // HOST to USBC-1 - sr_exp_data.bit.S_DN1 = 1; // EXTRA to USBC-2 - sr_exp_data.bit.SRC_1 = 1; // HOST on USBC-1 - sr_exp_data.bit.SRC_2 = 0; // EXTRA available on USBC-2 + sr_exp_data.bit.S_UP = 0; // HOST to USBC-1 + sr_exp_data.bit.S_DN1 = 1; // EXTRA to USBC-2 + sr_exp_data.bit.SRC_1 = 1; // HOST on USBC-1 + sr_exp_data.bit.SRC_2 = 0; // EXTRA available on USBC-2 - sr_exp_data.bit.E_VBUS_1 = 1; // USBC-1 enable full power I/O - sr_exp_data.bit.E_VBUS_2 = 0; // USBC-2 disable full power I/O + sr_exp_data.bit.E_VBUS_1 = 1; // USBC-1 enable full power I/O + sr_exp_data.bit.E_VBUS_2 = 0; // USBC-2 disable full power I/O SR_EXP_WriteData(); - sr_exp_data.bit.E_UP_N = 0; // HOST enable + sr_exp_data.bit.E_UP_N = 0; // HOST enable SR_EXP_WriteData(); usb_host_port = USB_HOST_PORT_1; } else { - sr_exp_data.bit.S_UP = 1; // EXTRA to USBC-1 - sr_exp_data.bit.S_DN1 = 0; // HOST to USBC-2 - sr_exp_data.bit.SRC_1 = 0; // EXTRA available on USBC-1 - sr_exp_data.bit.SRC_2 = 1; // HOST on USBC-2 + sr_exp_data.bit.S_UP = 1; // EXTRA to USBC-1 + sr_exp_data.bit.S_DN1 = 0; // HOST to USBC-2 + sr_exp_data.bit.SRC_1 = 0; // EXTRA available on USBC-1 + sr_exp_data.bit.SRC_2 = 1; // HOST on USBC-2 - sr_exp_data.bit.E_VBUS_1 = 0; // USBC-1 disable full power I/O - sr_exp_data.bit.E_VBUS_2 = 1; // USBC-2 enable full power I/O + sr_exp_data.bit.E_VBUS_1 = 0; // USBC-1 disable full power I/O + sr_exp_data.bit.E_VBUS_2 = 1; // USBC-2 enable full power I/O SR_EXP_WriteData(); - sr_exp_data.bit.E_UP_N = 0; // HOST enable + sr_exp_data.bit.E_UP_N = 0; // HOST enable SR_EXP_WriteData(); @@ -220,7 +222,7 @@ void USB_set_host_by_voltage(void) { #ifndef MD_BOOTLOADER usb_extra_state = USB_EXTRA_STATE_DISABLED; -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER USB_reset(); USB_configure(); @@ -241,7 +243,7 @@ uint8_t USB_Hub_Port_Detect_Init(void) { while (!USB_active()) { tmod = timer_read64() % PORT_DETECT_RETRY_INTERVAL; - if (v_con_1 > v_con_2) // Values updated from USB_set_host_by_voltage(); + if (v_con_1 > v_con_2) // Values updated from USB_set_host_by_voltage(); { // 1 flash for port 1 detected if (tmod > 500 && tmod < 600) { @@ -249,7 +251,7 @@ uint8_t USB_Hub_Port_Detect_Init(void) { } else { DBG_LED_OFF; } - } else if (v_con_2 > v_con_1) // Values updated from USB_set_host_by_voltage(); + } else if (v_con_2 > v_con_1) // Values updated from USB_set_host_by_voltage(); { // 2 flash for port 2 detected if (tmod > 500 && tmod < 600) { @@ -321,7 +323,7 @@ void USB_HandleExtraDevice(void) { // Detect unplug and reset state to disabled if (adc_extra > USB_EXTRA_ADC_THRESHOLD) usb_extra_state = USB_EXTRA_STATE_DISABLED; - return; // Return even if unplug detected + return; // Return even if unplug detected } if (usb_extra_manual) { @@ -337,4 +339,4 @@ void USB_HandleExtraDevice(void) { USB_ExtraSetState(USB_EXTRA_STATE_DISABLED); } -#endif // MD_BOOTLOADER +#endif // MD_BOOTLOADER diff --git a/tmk_core/protocol/arm_atsam/usb/usb_hub.h b/tmk_core/protocol/arm_atsam/usb/usb_hub.h index 76b1e0a32633..d7b2e3fab445 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_hub.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_hub.h @@ -48,4 +48,4 @@ uint16_t adc_get(uint8_t muxpos); void USB_HandleExtraDevice(void); void USB_ExtraSetState(uint8_t state); -#endif //_USB2422_H_ +#endif //_USB2422_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_main.h b/tmk_core/protocol/arm_atsam/usb/usb_main.h index d8461c6c9f65..c3b1698c594c 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_main.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_main.h @@ -71,31 +71,31 @@ void main_kbd_disable(void); extern volatile bool main_b_nkro_enable; bool main_nkro_enable(void); void main_nkro_disable(void); -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE #ifdef EXTRAKEY_ENABLE extern volatile bool main_b_exk_enable; bool main_exk_enable(void); void main_exk_disable(void); -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE #ifdef CONSOLE_ENABLE extern volatile bool main_b_con_enable; bool main_con_enable(void); void main_con_disable(void); -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE #ifdef MOUSE_ENABLE extern volatile bool main_b_mou_enable; bool main_mou_enable(void); void main_mou_disable(void); -#endif // MOUSE_ENABLE +#endif // MOUSE_ENABLE #ifdef RAW_ENABLE extern volatile bool main_b_raw_enable; bool main_raw_enable(void); void main_raw_disable(void); void main_raw_receive(uint8_t *buffer, uint8_t len); -#endif // RAW_ENABLE +#endif // RAW_ENABLE -#endif // _MAIN_H_ +#endif // _MAIN_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_protocol.h b/tmk_core/protocol/arm_atsam/usb/usb_protocol.h index 54d023a6eeea..639b80a80401 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_protocol.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_protocol.h @@ -63,8 +63,8 @@ */ //! Value for field bcdUSB -#define USB_V2_0 0x0200 //!< USB Specification version 2.00 -#define USB_V2_1 0x0201 //!< USB Specification version 2.01 +#define USB_V2_0 0x0200 //!< USB Specification version 2.00 +#define USB_V2_1 0x0201 //!< USB Specification version 2.01 /*! \name Generic definitions (Class, subclass and protocol) */ @@ -85,26 +85,26 @@ /** * \brief USB request data transfer direction (bmRequestType) */ -#define USB_REQ_DIR_OUT (0 << 7) //!< Host to device -#define USB_REQ_DIR_IN (1 << 7) //!< Device to host -#define USB_REQ_DIR_MASK (1 << 7) //!< Mask +#define USB_REQ_DIR_OUT (0 << 7) //!< Host to device +#define USB_REQ_DIR_IN (1 << 7) //!< Device to host +#define USB_REQ_DIR_MASK (1 << 7) //!< Mask /** * \brief USB request types (bmRequestType) */ -#define USB_REQ_TYPE_STANDARD (0 << 5) //!< Standard request -#define USB_REQ_TYPE_CLASS (1 << 5) //!< Class-specific request -#define USB_REQ_TYPE_VENDOR (2 << 5) //!< Vendor-specific request -#define USB_REQ_TYPE_MASK (3 << 5) //!< Mask +#define USB_REQ_TYPE_STANDARD (0 << 5) //!< Standard request +#define USB_REQ_TYPE_CLASS (1 << 5) //!< Class-specific request +#define USB_REQ_TYPE_VENDOR (2 << 5) //!< Vendor-specific request +#define USB_REQ_TYPE_MASK (3 << 5) //!< Mask /** * \brief USB recipient codes (bmRequestType) */ -#define USB_REQ_RECIP_DEVICE (0 << 0) //!< Recipient device -#define USB_REQ_RECIP_INTERFACE (1 << 0) //!< Recipient interface -#define USB_REQ_RECIP_ENDPOINT (2 << 0) //!< Recipient endpoint -#define USB_REQ_RECIP_OTHER (3 << 0) //!< Recipient other -#define USB_REQ_RECIP_MASK (0x1F) //!< Mask +#define USB_REQ_RECIP_DEVICE (0 << 0) //!< Recipient device +#define USB_REQ_RECIP_INTERFACE (1 << 0) //!< Recipient interface +#define USB_REQ_RECIP_ENDPOINT (2 << 0) //!< Recipient endpoint +#define USB_REQ_RECIP_OTHER (3 << 0) //!< Recipient other +#define USB_REQ_RECIP_MASK (0x1F) //!< Mask /** * \brief Standard USB requests (bRequest) @@ -149,8 +149,8 @@ enum usb_endpoint_status { * \note valid for SetFeature request. */ enum usb_device_feature { - USB_DEV_FEATURE_REMOTE_WAKEUP = 1, //!< Remote wakeup enabled - USB_DEV_FEATURE_TEST_MODE = 2, //!< USB test mode + USB_DEV_FEATURE_REMOTE_WAKEUP = 1, //!< Remote wakeup enabled + USB_DEV_FEATURE_TEST_MODE = 2, //!< USB test mode USB_DEV_FEATURE_OTG_B_HNP_ENABLE = 3, USB_DEV_FEATURE_OTG_A_HNP_SUPPORT = 4, USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT = 5 @@ -261,7 +261,7 @@ enum usb_ep_type { * \brief Standard USB language IDs for string descriptors */ enum usb_langid { - USB_LANGID_EN_US = 0x0409, //!< English (United States) + USB_LANGID_EN_US = 0x0409, //!< English (United States) }; /** @@ -396,14 +396,14 @@ typedef struct { * \brief Standard USB Interface Association Descriptor structure */ typedef struct { - uint8_t bLength; //!< size of this descriptor in bytes - uint8_t bDescriptorType; //!< INTERFACE descriptor type - uint8_t bFirstInterface; //!< Number of interface - uint8_t bInterfaceCount; //!< value to select alternate setting - uint8_t bFunctionClass; //!< Class code assigned by the USB - uint8_t bFunctionSubClass; //!< Sub-class code assigned by the USB - uint8_t bFunctionProtocol; //!< Protocol code assigned by the USB - uint8_t iFunction; //!< Index of string descriptor + uint8_t bLength; //!< size of this descriptor in bytes + uint8_t bDescriptorType; //!< INTERFACE descriptor type + uint8_t bFirstInterface; //!< Number of interface + uint8_t bInterfaceCount; //!< value to select alternate setting + uint8_t bFunctionClass; //!< Class code assigned by the USB + uint8_t bFunctionSubClass; //!< Sub-class code assigned by the USB + uint8_t bFunctionProtocol; //!< Protocol code assigned by the USB + uint8_t iFunction; //!< Index of string descriptor } usb_association_desc_t; /** @@ -420,25 +420,25 @@ typedef struct { uint8_t bMaxPower; } usb_conf_desc_t; -#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set -#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered -#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered -#define USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) //!< remote wakeup supported +#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set +#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered +#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered +#define USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) //!< remote wakeup supported -#define USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) //!< Max power in mA +#define USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) //!< Max power in mA /** * \brief Standard USB association descriptor structure */ typedef struct { - uint8_t bLength; //!< Size of this descriptor in bytes - uint8_t bDescriptorType; //!< Interface descriptor type - uint8_t bFirstInterface; //!< Number of interface - uint8_t bInterfaceCount; //!< value to select alternate setting - uint8_t bFunctionClass; //!< Class code assigned by the USB - uint8_t bFunctionSubClass; //!< Sub-class code assigned by the USB - uint8_t bFunctionProtocol; //!< Protocol code assigned by the USB - uint8_t iFunction; //!< Index of string descriptor + uint8_t bLength; //!< Size of this descriptor in bytes + uint8_t bDescriptorType; //!< Interface descriptor type + uint8_t bFirstInterface; //!< Number of interface + uint8_t bInterfaceCount; //!< value to select alternate setting + uint8_t bFunctionClass; //!< Class code assigned by the USB + uint8_t bFunctionSubClass; //!< Sub-class code assigned by the USB + uint8_t bFunctionProtocol; //!< Protocol code assigned by the USB + uint8_t iFunction; //!< Index of string descriptor } usb_iad_desc_t; /** diff --git a/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h b/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h index f35503a3be58..1d36d58dbdc0 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h @@ -50,41 +50,41 @@ #ifdef VIRTSER_ENABLE -# define CDC_CLASS_DEVICE 0x02 //!< USB Communication Device Class -# define CDC_CLASS_COMM 0x02 //!< CDC Communication Class Interface -# define CDC_CLASS_DATA 0x0A //!< CDC Data Class Interface - -# define CDC_SUBCLASS_DLCM 0x01 //!< Direct Line Control Model -# define CDC_SUBCLASS_ACM 0x02 //!< Abstract Control Model -# define CDC_SUBCLASS_TCM 0x03 //!< Telephone Control Model -# define CDC_SUBCLASS_MCCM 0x04 //!< Multi-Channel Control Model -# define CDC_SUBCLASS_CCM 0x05 //!< CAPI Control Model -# define CDC_SUBCLASS_ETH 0x06 //!< Ethernet Networking Control Model -# define CDC_SUBCLASS_ATM 0x07 //!< ATM Networking Control Model - -# define CDC_PROTOCOL_V25TER 0x01 //!< Common AT commands - -# define CDC_PROTOCOL_I430 0x30 //!< ISDN BRI -# define CDC_PROTOCOL_HDLC 0x31 //!< HDLC -# define CDC_PROTOCOL_TRANS 0x32 //!< Transparent -# define CDC_PROTOCOL_Q921M 0x50 //!< Q.921 management protocol -# define CDC_PROTOCOL_Q921 0x51 //!< Q.931 [sic] Data link protocol -# define CDC_PROTOCOL_Q921TM 0x52 //!< Q.921 TEI-multiplexor -# define CDC_PROTOCOL_V42BIS 0x90 //!< Data compression procedures -# define CDC_PROTOCOL_Q931 0x91 //!< Euro-ISDN protocol control -# define CDC_PROTOCOL_V120 0x92 //!< V.24 rate adaption to ISDN -# define CDC_PROTOCOL_CAPI20 0x93 //!< CAPI Commands -# define CDC_PROTOCOL_HOST 0xFD //!< Host based driver +# define CDC_CLASS_DEVICE 0x02 //!< USB Communication Device Class +# define CDC_CLASS_COMM 0x02 //!< CDC Communication Class Interface +# define CDC_CLASS_DATA 0x0A //!< CDC Data Class Interface + +# define CDC_SUBCLASS_DLCM 0x01 //!< Direct Line Control Model +# define CDC_SUBCLASS_ACM 0x02 //!< Abstract Control Model +# define CDC_SUBCLASS_TCM 0x03 //!< Telephone Control Model +# define CDC_SUBCLASS_MCCM 0x04 //!< Multi-Channel Control Model +# define CDC_SUBCLASS_CCM 0x05 //!< CAPI Control Model +# define CDC_SUBCLASS_ETH 0x06 //!< Ethernet Networking Control Model +# define CDC_SUBCLASS_ATM 0x07 //!< ATM Networking Control Model + +# define CDC_PROTOCOL_V25TER 0x01 //!< Common AT commands + +# define CDC_PROTOCOL_I430 0x30 //!< ISDN BRI +# define CDC_PROTOCOL_HDLC 0x31 //!< HDLC +# define CDC_PROTOCOL_TRANS 0x32 //!< Transparent +# define CDC_PROTOCOL_Q921M 0x50 //!< Q.921 management protocol +# define CDC_PROTOCOL_Q921 0x51 //!< Q.931 [sic] Data link protocol +# define CDC_PROTOCOL_Q921TM 0x52 //!< Q.921 TEI-multiplexor +# define CDC_PROTOCOL_V42BIS 0x90 //!< Data compression procedures +# define CDC_PROTOCOL_Q931 0x91 //!< Euro-ISDN protocol control +# define CDC_PROTOCOL_V120 0x92 //!< V.24 rate adaption to ISDN +# define CDC_PROTOCOL_CAPI20 0x93 //!< CAPI Commands +# define CDC_PROTOCOL_HOST 0xFD //!< Host based driver # define CDC_PROTOCOL_PUFD 0xFE -# define CDC_CS_INTERFACE 0x24 //!< Interface Functional Descriptor -# define CDC_CS_ENDPOINT 0x25 //!< Endpoint Functional Descriptor +# define CDC_CS_INTERFACE 0x24 //!< Interface Functional Descriptor +# define CDC_CS_ENDPOINT 0x25 //!< Endpoint Functional Descriptor -# define CDC_SCS_HEADER 0x00 //!< Header Functional Descriptor -# define CDC_SCS_CALL_MGMT 0x01 //!< Call Management -# define CDC_SCS_ACM 0x02 //!< Abstract Control Management -# define CDC_SCS_UNION 0x06 //!< Union Functional Descriptor +# define CDC_SCS_HEADER 0x00 //!< Header Functional Descriptor +# define CDC_SCS_CALL_MGMT 0x01 //!< Call Management +# define CDC_SCS_ACM 0x02 //!< Abstract Control Management +# define CDC_SCS_UNION 0x06 //!< Union Functional Descriptor # define USB_REQ_CDC_SEND_ENCAPSULATED_COMMAND 0x00 # define USB_REQ_CDC_GET_ENCAPSULATED_RESPONSE 0x01 @@ -144,17 +144,17 @@ typedef struct { # pragma pack(pop) enum cdc_char_format { - CDC_STOP_BITS_1 = 0, //!< 1 stop bit - CDC_STOP_BITS_1_5 = 1, //!< 1.5 stop bits - CDC_STOP_BITS_2 = 2, //!< 2 stop bits + CDC_STOP_BITS_1 = 0, //!< 1 stop bit + CDC_STOP_BITS_1_5 = 1, //!< 1.5 stop bits + CDC_STOP_BITS_2 = 2, //!< 2 stop bits }; enum cdc_parity { - CDC_PAR_NONE = 0, //!< No parity - CDC_PAR_ODD = 1, //!< Odd parity - CDC_PAR_EVEN = 2, //!< Even parity - CDC_PAR_MARK = 3, //!< Parity forced to 0 (space) - CDC_PAR_SPACE = 4, //!< Parity forced to 1 (mark) + CDC_PAR_NONE = 0, //!< No parity + CDC_PAR_ODD = 1, //!< Odd parity + CDC_PAR_EVEN = 2, //!< Even parity + CDC_PAR_MARK = 3, //!< Parity forced to 0 (space) + CDC_PAR_SPACE = 4, //!< Parity forced to 1 (mark) }; typedef struct { @@ -187,4 +187,4 @@ typedef struct { #endif -#endif // _USB_PROTOCOL_CDC_H_ +#endif // _USB_PROTOCOL_CDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h b/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h index fb97f63cef97..c984c0762f07 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h @@ -121,13 +121,13 @@ COMPILER_PACK_SET(1) //! \brief HID Descriptor typedef struct { - uint8_t bLength; //!< Size of this descriptor in bytes - uint8_t bDescriptorType; //!< HID descriptor type - le16_t bcdHID; //!< Binary Coded Decimal Spec. release - uint8_t bCountryCode; //!< Hardware target country - uint8_t bNumDescriptors; //!< Number of HID class descriptors to follow - uint8_t bRDescriptorType; //!< Report descriptor type - le16_t wDescriptorLength; //!< Total length of Report descriptor + uint8_t bLength; //!< Size of this descriptor in bytes + uint8_t bDescriptorType; //!< HID descriptor type + le16_t bcdHID; //!< Binary Coded Decimal Spec. release + uint8_t bCountryCode; //!< Hardware target country + uint8_t bNumDescriptors; //!< Number of HID class descriptors to follow + uint8_t bRDescriptorType; //!< Report descriptor type + le16_t wDescriptorLength; //!< Total length of Report descriptor } usb_hid_descriptor_t; COMPILER_PACK_RESET() @@ -151,45 +151,45 @@ COMPILER_PACK_RESET() //! \name Country code //! @{ -#define USB_HID_NO_COUNTRY_CODE 0 // Not Supported -#define USB_HID_COUNTRY_ARABIC 1 // Arabic -#define USB_HID_COUNTRY_BELGIAN 2 // Belgian -#define USB_HID_COUNTRY_CANADIAN_BILINGUAL 3 // Canadian-Bilingual -#define USB_HID_COUNTRY_CANADIAN_FRENCH 4 // Canadian-French -#define USB_HID_COUNTRY_CZECH_REPUBLIC 5 // Czech Republic -#define USB_HID_COUNTRY_DANISH 6 // Danish -#define USB_HID_COUNTRY_FINNISH 7 // Finnish -#define USB_HID_COUNTRY_FRENCH 8 // French -#define USB_HID_COUNTRY_GERMAN 9 // German -#define USB_HID_COUNTRY_GREEK 10 // Greek -#define USB_HID_COUNTRY_HEBREW 11 // Hebrew -#define USB_HID_COUNTRY_HUNGARY 12 // Hungary -#define USB_HID_COUNTRY_INTERNATIONAL_ISO 13 // International (ISO) -#define USB_HID_COUNTRY_ITALIAN 14 // Italian -#define USB_HID_COUNTRY_JAPAN_KATAKANA 15 // Japan (Katakana) -#define USB_HID_COUNTRY_KOREAN 16 // Korean -#define USB_HID_COUNTRY_LATIN_AMERICAN 17 // Latin American -#define USB_HID_COUNTRY_NETHERLANDS_DUTCH 18 // Netherlands/Dutch -#define USB_HID_COUNTRY_NORWEGIAN 19 // Norwegian -#define USB_HID_COUNTRY_PERSIAN_FARSI 20 // Persian (Farsi) -#define USB_HID_COUNTRY_POLAND 21 // Poland -#define USB_HID_COUNTRY_PORTUGUESE 22 // Portuguese -#define USB_HID_COUNTRY_RUSSIA 23 // Russia -#define USB_HID_COUNTRY_SLOVAKIA 24 // Slovakia -#define USB_HID_COUNTRY_SPANISH 25 // Spanish -#define USB_HID_COUNTRY_SWEDISH 26 // Swedish -#define USB_HID_COUNTRY_SWISS_FRENCH 27 // Swiss/French -#define USB_HID_COUNTRY_SWISS_GERMAN 28 // Swiss/German -#define USB_HID_COUNTRY_SWITZERLAND 29 // Switzerland -#define USB_HID_COUNTRY_TAIWAN 30 // Taiwan -#define USB_HID_COUNTRY_TURKISH_Q 31 // Turkish-Q -#define USB_HID_COUNTRY_UK 32 // UK -#define USB_HID_COUNTRY_US 33 // US -#define USB_HID_COUNTRY_YUGOSLAVIA 34 // Yugoslavia +#define USB_HID_NO_COUNTRY_CODE 0 // Not Supported +#define USB_HID_COUNTRY_ARABIC 1 // Arabic +#define USB_HID_COUNTRY_BELGIAN 2 // Belgian +#define USB_HID_COUNTRY_CANADIAN_BILINGUAL 3 // Canadian-Bilingual +#define USB_HID_COUNTRY_CANADIAN_FRENCH 4 // Canadian-French +#define USB_HID_COUNTRY_CZECH_REPUBLIC 5 // Czech Republic +#define USB_HID_COUNTRY_DANISH 6 // Danish +#define USB_HID_COUNTRY_FINNISH 7 // Finnish +#define USB_HID_COUNTRY_FRENCH 8 // French +#define USB_HID_COUNTRY_GERMAN 9 // German +#define USB_HID_COUNTRY_GREEK 10 // Greek +#define USB_HID_COUNTRY_HEBREW 11 // Hebrew +#define USB_HID_COUNTRY_HUNGARY 12 // Hungary +#define USB_HID_COUNTRY_INTERNATIONAL_ISO 13 // International (ISO) +#define USB_HID_COUNTRY_ITALIAN 14 // Italian +#define USB_HID_COUNTRY_JAPAN_KATAKANA 15 // Japan (Katakana) +#define USB_HID_COUNTRY_KOREAN 16 // Korean +#define USB_HID_COUNTRY_LATIN_AMERICAN 17 // Latin American +#define USB_HID_COUNTRY_NETHERLANDS_DUTCH 18 // Netherlands/Dutch +#define USB_HID_COUNTRY_NORWEGIAN 19 // Norwegian +#define USB_HID_COUNTRY_PERSIAN_FARSI 20 // Persian (Farsi) +#define USB_HID_COUNTRY_POLAND 21 // Poland +#define USB_HID_COUNTRY_PORTUGUESE 22 // Portuguese +#define USB_HID_COUNTRY_RUSSIA 23 // Russia +#define USB_HID_COUNTRY_SLOVAKIA 24 // Slovakia +#define USB_HID_COUNTRY_SPANISH 25 // Spanish +#define USB_HID_COUNTRY_SWEDISH 26 // Swedish +#define USB_HID_COUNTRY_SWISS_FRENCH 27 // Swiss/French +#define USB_HID_COUNTRY_SWISS_GERMAN 28 // Swiss/German +#define USB_HID_COUNTRY_SWITZERLAND 29 // Switzerland +#define USB_HID_COUNTRY_TAIWAN 30 // Taiwan +#define USB_HID_COUNTRY_TURKISH_Q 31 // Turkish-Q +#define USB_HID_COUNTRY_UK 32 // UK +#define USB_HID_COUNTRY_US 33 // US +#define USB_HID_COUNTRY_YUGOSLAVIA 34 // Yugoslavia #define USB_HID_COUNTRY_TURKISH_F \ - 35 // Turkish-F - //! @} - //! @} + 35 // Turkish-F + //! @} + //! @} //! @} //! \name HID KEYS values @@ -237,12 +237,12 @@ COMPILER_PACK_RESET() #define HID_SPACEBAR 44 #define HID_UNDERSCORE 45 #define HID_PLUS 46 -#define HID_OPEN_BRACKET 47 // { -#define HID_CLOSE_BRACKET 48 // } +#define HID_OPEN_BRACKET 47 // { +#define HID_CLOSE_BRACKET 48 // } #define HID_BACKSLASH 49 -#define HID_ASH 50 // # ~ -#define HID_COLON 51 // ; : -#define HID_QUOTE 52 // ' " +#define HID_ASH 50 // # ~ +#define HID_COLON 51 // ; : +#define HID_QUOTE 52 // ' " #define HID_TILDE 53 #define HID_COMMA 54 #define HID_DOT 55 @@ -314,4 +314,4 @@ COMPILER_PACK_RESET() #define HID_LED_KANA (1 << 4) //! @} -#endif // _USB_PROTOCOL_HID_H_ +#endif // _USB_PROTOCOL_HID_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_util.c b/tmk_core/protocol/arm_atsam/usb/usb_util.c index a682c00b5807..c7555c84c671 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_util.c +++ b/tmk_core/protocol/arm_atsam/usb/usb_util.c @@ -11,17 +11,17 @@ char digit(int d, int radix) { } int UTIL_ltoa_radix(int64_t value, char *dest, int radix) { - int64_t original = value; // save original value + int64_t original = value; // save original value char buf[25] = ""; int c = sizeof(buf) - 1; int last = c; int d; int size; - if (value < 0) // if it's negative, take the absolute value + if (value < 0) // if it's negative, take the absolute value value = -value; - do // write least significant digit of value that's left + do // write least significant digit of value that's left { d = (value % radix); buf[--c] = digit(d, radix); @@ -30,14 +30,20 @@ int UTIL_ltoa_radix(int64_t value, char *dest, int radix) { if (original < 0) buf[--c] = '-'; - size = last - c + 1; // includes null at end + size = last - c + 1; // includes null at end memcpy(dest, &buf[c], last - c + 1); - return (size - 1); // without null termination + return (size - 1); // without null termination } -int UTIL_ltoa(int64_t value, char *dest) { return UTIL_ltoa_radix(value, dest, 10); } +int UTIL_ltoa(int64_t value, char *dest) { + return UTIL_ltoa_radix(value, dest, 10); +} -int UTIL_itoa(int value, char *dest) { return UTIL_ltoa_radix((int64_t)value, dest, 10); } +int UTIL_itoa(int value, char *dest) { + return UTIL_ltoa_radix((int64_t)value, dest, 10); +} -int UTIL_utoa(uint32_t value, char *dest) { return UTIL_ltoa_radix((int64_t)value, dest, 10); } +int UTIL_utoa(uint32_t value, char *dest) { + return UTIL_ltoa_radix((int64_t)value, dest, 10); +} diff --git a/tmk_core/protocol/arm_atsam/usb/usb_util.h b/tmk_core/protocol/arm_atsam/usb/usb_util.h index 3bad2c26f2a6..3e5b4fbb3245 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_util.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_util.h @@ -6,4 +6,4 @@ int UTIL_ltoa(int64_t value, char *dest); int UTIL_itoa(int value, char *dest); int UTIL_utoa(uint32_t value, char *dest); -#endif //_USB_UTIL_H_ +#endif //_USB_UTIL_H_ diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index 41752b21304f..c9a480c32555 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -60,10 +60,11 @@ void send_keyboard(report_keyboard_t *report); void send_mouse(report_mouse_t *report); void send_system(uint16_t data); void send_consumer(uint16_t data); +void send_programmable_button(uint32_t data); void send_digitizer(report_digitizer_t *report); /* host struct */ -host_driver_t chibios_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer}; +host_driver_t chibios_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer, send_programmable_button}; #ifdef VIRTSER_ENABLE void virtser_task(void); @@ -106,7 +107,7 @@ __attribute__((weak)) void early_hardware_init_pre(void) { #if EARLY_INIT_PERFORM_BOOTLOADER_JUMP void enter_bootloader_mode_if_requested(void); enter_bootloader_mode_if_requested(); -#endif // EARLY_INIT_PERFORM_BOOTLOADER_JUMP +#endif // EARLY_INIT_PERFORM_BOOTLOADER_JUMP } __attribute__((weak)) void early_hardware_init_post(void) {} @@ -175,7 +176,9 @@ void protocol_pre_init(void) { print("USB configured.\n"); } -void protocol_post_init(void) { host_set_driver(driver); } +void protocol_post_init(void) { + host_set_driver(driver); +} void protocol_pre_task(void) { usb_event_queue_task(); @@ -185,7 +188,7 @@ void protocol_pre_task(void) { print("[s]"); while (USB_DRIVER.state == USB_SUSPENDED) { /* Do this in the suspended state */ - suspend_power_down(); // on AVR this deep sleeps for 15ms + suspend_power_down(); // on AVR this deep sleeps for 15ms /* Remote wakeup */ if (suspend_wakeup_condition()) { usbWakeupHost(&USB_DRIVER); diff --git a/tmk_core/protocol/chibios/usb_driver.c b/tmk_core/protocol/chibios/usb_driver.c index cc0ce7600fc9..4de060f306b3 100644 --- a/tmk_core/protocol/chibios/usb_driver.c +++ b/tmk_core/protocol/chibios/usb_driver.c @@ -80,21 +80,37 @@ static bool qmkusb_start_receive(QMKUSBDriver *qmkusbp) { * Interface implementation. */ -static size_t _write(void *ip, const uint8_t *bp, size_t n) { return obqWriteTimeout(&((QMKUSBDriver *)ip)->obqueue, bp, n, TIME_INFINITE); } +static size_t _write(void *ip, const uint8_t *bp, size_t n) { + return obqWriteTimeout(&((QMKUSBDriver *)ip)->obqueue, bp, n, TIME_INFINITE); +} -static size_t _read(void *ip, uint8_t *bp, size_t n) { return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, TIME_INFINITE); } +static size_t _read(void *ip, uint8_t *bp, size_t n) { + return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, TIME_INFINITE); +} -static msg_t _put(void *ip, uint8_t b) { return obqPutTimeout(&((QMKUSBDriver *)ip)->obqueue, b, TIME_INFINITE); } +static msg_t _put(void *ip, uint8_t b) { + return obqPutTimeout(&((QMKUSBDriver *)ip)->obqueue, b, TIME_INFINITE); +} -static msg_t _get(void *ip) { return ibqGetTimeout(&((QMKUSBDriver *)ip)->ibqueue, TIME_INFINITE); } +static msg_t _get(void *ip) { + return ibqGetTimeout(&((QMKUSBDriver *)ip)->ibqueue, TIME_INFINITE); +} -static msg_t _putt(void *ip, uint8_t b, sysinterval_t timeout) { return obqPutTimeout(&((QMKUSBDriver *)ip)->obqueue, b, timeout); } +static msg_t _putt(void *ip, uint8_t b, sysinterval_t timeout) { + return obqPutTimeout(&((QMKUSBDriver *)ip)->obqueue, b, timeout); +} -static msg_t _gett(void *ip, sysinterval_t timeout) { return ibqGetTimeout(&((QMKUSBDriver *)ip)->ibqueue, timeout); } +static msg_t _gett(void *ip, sysinterval_t timeout) { + return ibqGetTimeout(&((QMKUSBDriver *)ip)->ibqueue, timeout); +} -static size_t _writet(void *ip, const uint8_t *bp, size_t n, sysinterval_t timeout) { return obqWriteTimeout(&((QMKUSBDriver *)ip)->obqueue, bp, n, timeout); } +static size_t _writet(void *ip, const uint8_t *bp, size_t n, sysinterval_t timeout) { + return obqWriteTimeout(&((QMKUSBDriver *)ip)->obqueue, bp, n, timeout); +} -static size_t _readt(void *ip, uint8_t *bp, size_t n, sysinterval_t timeout) { return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, timeout); } +static size_t _readt(void *ip, uint8_t *bp, size_t n, sysinterval_t timeout) { + return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, timeout); +} static const struct QMKUSBDriverVMT vmt = {0, _write, _read, _put, _get, _putt, _gett, _writet, _readt}; diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index ac46a9312b49..d9aa351ecbe2 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -734,7 +734,7 @@ void init_usb_driver(USBDriver *usbp) { * after a reset. */ usbDisconnectBus(usbp); - wait_ms(1500); + wait_ms(50); usbStart(usbp, &usbcfg); usbConnectBus(usbp); @@ -775,7 +775,9 @@ void kbd_in_cb(USBDriver *usbp, usbep_t ep) { /* start-of-frame handler * TODO: i guess it would be better to re-implement using timers, * so that this is not going to have to be checked every 1ms */ -void kbd_sof_cb(USBDriver *usbp) { (void)usbp; } +void kbd_sof_cb(USBDriver *usbp) { + (void)usbp; +} /* Idle requests timer code * callback (called from ISR, unlocked state) */ @@ -815,7 +817,9 @@ static void keyboard_idle_timer_cb(void *arg) { } /* LED status */ -uint8_t keyboard_leds(void) { return keyboard_led_state; } +uint8_t keyboard_leds(void) { + return keyboard_led_state; +} /* prepare and start sending a report IN * not callable from ISR or locked state */ @@ -915,7 +919,9 @@ void send_mouse(report_mouse_t *report) { } #else /* MOUSE_ENABLE */ -void send_mouse(report_mouse_t *report) { (void)report; } +void send_mouse(report_mouse_t *report) { + (void)report; +} #endif /* MOUSE_ENABLE */ /* --------------------------------------------------------- @@ -975,6 +981,35 @@ void send_consumer(uint16_t data) { #endif } +void send_programmable_button(uint32_t data) { +#ifdef PROGRAMMABLE_BUTTON_ENABLE + osalSysLock(); + if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { + osalSysUnlock(); + return; + } + + if (usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { + /* Need to either suspend, or loop and call unlock/lock during + * every iteration - otherwise the system will remain locked, + * no interrupts served, so USB not going through as well. + * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ + if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) { + osalSysUnlock(); + return; + } + } + static report_programmable_button_t report = { + .report_id = REPORT_ID_PROGRAMMABLE_BUTTON, + }; + + report.usage = data; + + usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report)); + osalSysUnlock(); +#endif +} + void send_digitizer(report_digitizer_t *report) { #ifdef DIGITIZER_ENABLE # ifdef DIGITIZER_SHARED_EP @@ -1078,7 +1113,9 @@ void raw_hid_task(void) { #ifdef MIDI_ENABLE -void send_midi_packet(MIDI_EventPacket_t *event) { chnWrite(&drivers.midi_driver.driver, (uint8_t *)event, sizeof(MIDI_EventPacket_t)); } +void send_midi_packet(MIDI_EventPacket_t *event) { + chnWrite(&drivers.midi_driver.driver, (uint8_t *)event, sizeof(MIDI_EventPacket_t)); +} bool recv_midi_packet(MIDI_EventPacket_t *const event) { size_t size = chnReadTimeout(&drivers.midi_driver.driver, (uint8_t *)event, sizeof(MIDI_EventPacket_t), TIME_IMMEDIATE); @@ -1101,7 +1138,9 @@ void midi_ep_task(void) { void virtser_init(void) {} -void virtser_send(const uint8_t byte) { chnWrite(&drivers.serial_driver.driver, &byte, 1); } +void virtser_send(const uint8_t byte) { + chnWrite(&drivers.serial_driver.driver, &byte, 1); +} __attribute__((weak)) void virtser_recv(uint8_t c) { // Ignore by default @@ -1145,7 +1184,7 @@ void send_joystick_packet(joystick_t *joystick) { joystick->axes[5], # endif }, -# endif // JOYSTICK_AXES_COUNT>0 +# endif // JOYSTICK_AXES_COUNT>0 # if JOYSTICK_BUTTON_COUNT > 0 .buttons = { @@ -1161,7 +1200,7 @@ void send_joystick_packet(joystick_t *joystick) { joystick->buttons[3], # endif } -# endif // JOYSTICK_BUTTON_COUNT>0 +# endif // JOYSTICK_BUTTON_COUNT>0 }; // chnWrite(&drivers.joystick_driver.driver, (uint8_t *)&rep, sizeof(rep)); diff --git a/tmk_core/protocol/chibios/usb_util.c b/tmk_core/protocol/chibios/usb_util.c index e32d6ebfa4d7..c8b435db0c6e 100644 --- a/tmk_core/protocol/chibios/usb_util.c +++ b/tmk_core/protocol/chibios/usb_util.c @@ -16,6 +16,10 @@ #include #include "usb_util.h" -void usb_disconnect(void) { usbStop(&USBD1); } +void usb_disconnect(void) { + usbStop(&USBD1); +} -bool usb_connected_state(void) { return usbGetDriverStateI(&USBD1) == USB_ACTIVE; } +bool usb_connected_state(void) { + return usbGetDriverStateI(&USBD1) == USB_ACTIVE; +} diff --git a/tmk_core/protocol/host.c b/tmk_core/protocol/host.c index 56d4bb084713..053d2b79e312 100644 --- a/tmk_core/protocol/host.c +++ b/tmk_core/protocol/host.c @@ -34,13 +34,19 @@ static uint16_t last_system_report = 0; static uint16_t last_consumer_report = 0; static uint32_t last_programmable_button_report = 0; -void host_set_driver(host_driver_t *d) { driver = d; } +void host_set_driver(host_driver_t *d) { + driver = d; +} -host_driver_t *host_get_driver(void) { return driver; } +host_driver_t *host_get_driver(void) { + return driver; +} #ifdef SPLIT_KEYBOARD uint8_t split_led_state = 0; -void set_split_host_keyboard_leds(uint8_t led_state) { split_led_state = led_state; } +void set_split_host_keyboard_leds(uint8_t led_state) { + split_led_state = led_state; +} #endif uint8_t host_keyboard_leds(void) { @@ -51,7 +57,9 @@ uint8_t host_keyboard_leds(void) { return (*driver->keyboard_leds)(); } -led_t host_keyboard_led_state(void) { return (led_t)host_keyboard_leds(); } +led_t host_keyboard_led_state(void) { + return (led_t)host_keyboard_leds(); +} /* send report */ void host_keyboard_send(report_keyboard_t *report) { @@ -131,8 +139,14 @@ void host_programmable_button_send(uint32_t report) { (*driver->send_programmable_button)(report); } -uint16_t host_last_system_report(void) { return last_system_report; } +uint16_t host_last_system_report(void) { + return last_system_report; +} -uint16_t host_last_consumer_report(void) { return last_consumer_report; } +uint16_t host_last_consumer_report(void) { + return last_consumer_report; +} -uint32_t host_last_programmable_button_report(void) { return last_programmable_button_report; } +uint32_t host_last_programmable_button_report(void) { + return last_programmable_button_report; +} diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index e3be96d93dad..b4b03357a36b 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -67,10 +67,10 @@ extern keymap_config_t keymap_config; #ifdef BLUETOOTH_ENABLE # include "outputselect.h" -# ifdef MODULE_ADAFRUIT_BLE -# include "adafruit_ble.h" -# else -# include "../serial.h" +# ifdef BLUETOOTH_BLUEFRUIT_LE +# include "bluefruit_le.h" +# elif BLUETOOTH_RN42 +# include "rn42.h" # endif #endif @@ -90,46 +90,6 @@ extern keymap_config_t keymap_config; # include "joystick.h" #endif -// https://cdn.sparkfun.com/datasheets/Wireless/Bluetooth/bluetooth_cr_UG-v1.0r.pdf#G7.663734 -static inline uint16_t CONSUMER2RN42(uint16_t usage) { - switch (usage) { - case AC_HOME: - return 0x0001; - case AL_EMAIL: - return 0x0002; - case AC_SEARCH: - return 0x0004; - case AL_KEYBOARD_LAYOUT: - return 0x0008; - case AUDIO_VOL_UP: - return 0x0010; - case AUDIO_VOL_DOWN: - return 0x0020; - case AUDIO_MUTE: - return 0x0040; - case TRANSPORT_PLAY_PAUSE: - return 0x0080; - case TRANSPORT_NEXT_TRACK: - return 0x0100; - case TRANSPORT_PREV_TRACK: - return 0x0200; - case TRANSPORT_STOP: - return 0x0400; - case TRANSPORT_EJECT: - return 0x0800; - case TRANSPORT_FAST_FORWARD: - return 0x1000; - case TRANSPORT_REWIND: - return 0x2000; - case TRANSPORT_STOP_EJECT: - return 0x4000; - case AL_LOCAL_BROWSER: - return 0x8000; - default: - return 0; - } -} - uint8_t keyboard_idle = 0; /* 0: Boot Protocol, 1: Report Protocol(default) */ uint8_t keyboard_protocol = 1; @@ -296,7 +256,8 @@ static void Console_Task(void) { } // fill empty bank - while (Endpoint_IsReadWriteAllowed()) Endpoint_Write_8(0); + while (Endpoint_IsReadWriteAllowed()) + Endpoint_Write_8(0); // flush sendchar packet if (Endpoint_IsINReady()) { @@ -336,7 +297,7 @@ void send_joystick_packet(joystick_t *joystick) { joystick->axes[5], # endif }, -# endif // JOYSTICK_AXES_COUNT>0 +# endif // JOYSTICK_AXES_COUNT>0 # if JOYSTICK_BUTTON_COUNT > 0 .buttons = { @@ -352,14 +313,15 @@ void send_joystick_packet(joystick_t *joystick) { joystick->buttons[3], # endif } -# endif // JOYSTICK_BUTTON_COUNT>0 +# endif // JOYSTICK_BUTTON_COUNT>0 }; /* Select the Joystick Report Endpoint */ Endpoint_SelectEndpoint(JOYSTICK_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + while (timeout-- && !Endpoint_IsReadWriteAllowed()) + _delay_us(40); if (!Endpoint_IsReadWriteAllowed()) return; /* Write Joystick Report Data */ @@ -454,9 +416,11 @@ void EVENT_USB_Device_WakeUp() { #ifdef CONSOLE_ENABLE static bool console_flush = false; -# define CONSOLE_FLUSH_SET(b) \ - do { \ - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { console_flush = b; } \ +# define CONSOLE_FLUSH_SET(b) \ + do { \ + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { \ + console_flush = b; \ + } \ } while (0) /** \brief Event USB Device Start Of Frame @@ -674,7 +638,9 @@ void EVENT_USB_Device_ControlRequest(void) { * * FIXME: Needs doc */ -static uint8_t keyboard_leds(void) { return keyboard_led_state; } +static uint8_t keyboard_leds(void) { + return keyboard_led_state; +} /** \brief Send Keyboard * @@ -685,17 +651,10 @@ static void send_keyboard(report_keyboard_t *report) { #ifdef BLUETOOTH_ENABLE if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef MODULE_ADAFRUIT_BLE - adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); -# elif MODULE_RN42 - serial_send(0xFD); - serial_send(0x09); - serial_send(0x01); - serial_send(report->mods); - serial_send(report->reserved); - for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - serial_send(report->keys[i]); - } +# ifdef BLUETOOTH_BLUEFRUIT_LE + bluefruit_le_send_keys(report->mods, report->keys, sizeof(report->keys)); +# elif BLUETOOTH_RN42 + rn42_send_keyboard(report); # endif return; } @@ -712,7 +671,8 @@ static void send_keyboard(report_keyboard_t *report) { #endif Endpoint_SelectEndpoint(ep); /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + while (timeout-- && !Endpoint_IsReadWriteAllowed()) + _delay_us(40); if (!Endpoint_IsReadWriteAllowed()) return; /* If we're in Boot Protocol, don't send any report ID or other funky fields */ @@ -738,19 +698,11 @@ static void send_mouse(report_mouse_t *report) { # ifdef BLUETOOTH_ENABLE if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef MODULE_ADAFRUIT_BLE +# ifdef BLUETOOTH_BLUEFRUIT_LE // FIXME: mouse buttons - adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons); -# else - serial_send(0xFD); - serial_send(0x00); - serial_send(0x03); - serial_send(report->buttons); - serial_send(report->x); - serial_send(report->y); - serial_send(report->v); // should try sending the wheel v here - serial_send(report->h); // should try sending the wheel h here - serial_send(0x00); + bluefruit_le_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons); +# elif BLUETOOTH_RN42 + rn42_send_mouse(report); # endif return; } @@ -760,7 +712,8 @@ static void send_mouse(report_mouse_t *report) { Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + while (timeout-- && !Endpoint_IsReadWriteAllowed()) + _delay_us(40); if (!Endpoint_IsReadWriteAllowed()) return; /* Write Mouse Report Data */ @@ -780,7 +733,8 @@ static void send_report(void *report, size_t size) { Endpoint_SelectEndpoint(SHARED_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + while (timeout-- && !Endpoint_IsReadWriteAllowed()) + _delay_us(40); if (!Endpoint_IsReadWriteAllowed()) return; Endpoint_Write_Stream_LE(report, size, NULL); @@ -818,18 +772,10 @@ static void send_consumer(uint16_t data) { #ifdef EXTRAKEY_ENABLE # ifdef BLUETOOTH_ENABLE if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef MODULE_ADAFRUIT_BLE - adafruit_ble_send_consumer_key(data); -# elif MODULE_RN42 - static uint16_t last_data = 0; - if (data == last_data) return; - last_data = data; - uint16_t bitmap = CONSUMER2RN42(data); - serial_send(0xFD); - serial_send(0x03); - serial_send(0x03); - serial_send(bitmap & 0xFF); - serial_send((bitmap >> 8) & 0xFF); +# ifdef BLUETOOTH_BLUEFRUIT_LE + bluefruit_le_send_consumer_key(data); +# elif BLUETOOTH_RN42 + rn42_send_consumer(data); # endif return; } @@ -939,9 +885,13 @@ USB_ClassInfo_MIDI_Device_t USB_MIDI_Interface = { // clang-format on -void send_midi_packet(MIDI_EventPacket_t *event) { MIDI_Device_SendEventPacket(&USB_MIDI_Interface, event); } +void send_midi_packet(MIDI_EventPacket_t *event) { + MIDI_Device_SendEventPacket(&USB_MIDI_Interface, event); +} -bool recv_midi_packet(MIDI_EventPacket_t *const event) { return MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, event); } +bool recv_midi_packet(MIDI_EventPacket_t *const event) { + return MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, event); +} #endif @@ -997,7 +947,8 @@ void virtser_send(const uint8_t byte) { return; } - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + while (timeout-- && !Endpoint_IsReadWriteAllowed()) + _delay_us(40); Endpoint_Write_8(byte); CDC_Device_Flush(&cdc_device); @@ -1020,7 +971,8 @@ void send_digitizer(report_digitizer_t *report) { Endpoint_SelectEndpoint(DIGITIZER_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + while (timeout-- && !Endpoint_IsReadWriteAllowed()) + _delay_us(40); if (!Endpoint_IsReadWriteAllowed()) return; Endpoint_Write_Stream_LE(report, sizeof(report_digitizer_t), NULL); @@ -1076,8 +1028,8 @@ void protocol_pre_init(void) { setup_usb(); sei(); -#if defined(MODULE_RN42) - serial_init(); +#if defined(BLUETOOTH_RN42) + rn42_init(); #endif /* wait for USB startup & debug output */ @@ -1096,7 +1048,9 @@ void protocol_pre_init(void) { #endif } -void protocol_post_init(void) { host_set_driver(&lufa_driver); } +void protocol_post_init(void) { + host_set_driver(&lufa_driver); +} void protocol_pre_task(void) { #if !defined(NO_USB_STARTUP_CHECK) @@ -1129,8 +1083,8 @@ void protocol_post_task(void) { MIDI_Device_USBTask(&USB_MIDI_Interface); #endif -#ifdef MODULE_ADAFRUIT_BLE - adafruit_ble_task(); +#ifdef BLUETOOTH_BLUEFRUIT_LE + bluefruit_le_task(); #endif #ifdef VIRTSER_ENABLE @@ -1147,4 +1101,6 @@ void protocol_post_task(void) { #endif } -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) { return get_usb_descriptor(wValue, wIndex, DescriptorAddress); } +uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) { + return get_usb_descriptor(wValue, wIndex, DescriptorAddress); +} diff --git a/tmk_core/protocol/lufa/usb_util.c b/tmk_core/protocol/lufa/usb_util.c index 9691eff1e4d2..2e3b86b80e68 100644 --- a/tmk_core/protocol/lufa/usb_util.c +++ b/tmk_core/protocol/lufa/usb_util.c @@ -22,13 +22,15 @@ void usb_disconnect(void) { USB_DeviceState = DEVICE_STATE_Unattached; } -bool usb_connected_state(void) { return USB_Device_IsAddressSet(); } +bool usb_connected_state(void) { + return USB_Device_IsAddressSet(); +} #if defined(OTGPADE) bool usb_vbus_state(void) { - USB_OTGPAD_On(); // enables VBUS pad + USB_OTGPAD_On(); // enables VBUS pad wait_us(5); - return USB_VBUS_GetStatus(); // checks state of VBUS + return USB_VBUS_GetStatus(); // checks state of VBUS } #endif diff --git a/tmk_core/protocol/midi/bytequeue/bytequeue.c b/tmk_core/protocol/midi/bytequeue/bytequeue.c index e36a9e66b1f9..0dd18680f0cb 100644 --- a/tmk_core/protocol/midi/bytequeue/bytequeue.c +++ b/tmk_core/protocol/midi/bytequeue/bytequeue.c @@ -52,7 +52,9 @@ byteQueueIndex_t bytequeue_length(byteQueue_t* queue) { } // we don't need to avoid interrupts if there is only one reader -uint8_t bytequeue_get(byteQueue_t* queue, byteQueueIndex_t index) { return queue->data[(queue->start + index) % queue->length]; } +uint8_t bytequeue_get(byteQueue_t* queue, byteQueueIndex_t index) { + return queue->data[(queue->start + index) % queue->length]; +} // we just update the start index to remove elements void bytequeue_remove(byteQueue_t* queue, byteQueueIndex_t numToRemove) { diff --git a/tmk_core/protocol/midi/bytequeue/interrupt_setting.c b/tmk_core/protocol/midi/bytequeue/interrupt_setting.c index 407cc65f4910..d9c003594663 100644 --- a/tmk_core/protocol/midi/bytequeue/interrupt_setting.c +++ b/tmk_core/protocol/midi/bytequeue/interrupt_setting.c @@ -30,7 +30,9 @@ interrupt_setting_t store_and_clear_interrupt(void) { return sreg; } -void restore_interrupt_setting(interrupt_setting_t setting) { SREG = setting; } +void restore_interrupt_setting(interrupt_setting_t setting) { + SREG = setting; +} #elif defined(__arm__) # include @@ -39,5 +41,7 @@ interrupt_setting_t store_and_clear_interrupt(void) { return 0; } -void restore_interrupt_setting(interrupt_setting_t setting) { chSysUnlock(); } +void restore_interrupt_setting(interrupt_setting_t setting) { + chSysUnlock(); +} #endif diff --git a/tmk_core/protocol/midi/midi.c b/tmk_core/protocol/midi/midi.c index 643c43722df2..f3792552f4b4 100644 --- a/tmk_core/protocol/midi/midi.c +++ b/tmk_core/protocol/midi/midi.c @@ -17,7 +17,7 @@ // along with avr-midi. If not, see . #include "midi.h" -#include //for memcpy +#include //for memcpy #define MIN(x, y) (((x) < (y)) ? (x) : (y)) @@ -25,9 +25,13 @@ # define NULL 0 #endif -bool midi_is_statusbyte(uint8_t theByte) { return (bool)(theByte & MIDI_STATUSMASK); } +bool midi_is_statusbyte(uint8_t theByte) { + return (bool)(theByte & MIDI_STATUSMASK); +} -bool midi_is_realtime(uint8_t theByte) { return (theByte >= MIDI_CLOCK); } +bool midi_is_realtime(uint8_t theByte) { + return (theByte >= MIDI_CLOCK); +} midi_packet_length_t midi_packet_length(uint8_t status) { switch (status & 0xF0) { @@ -83,7 +87,9 @@ void midi_send_noteoff(MidiDevice* device, uint8_t chan, uint8_t num, uint8_t ve device->send_func(device, 3, MIDI_NOTEOFF | (chan & MIDI_CHANMASK), num & 0x7F, vel & 0x7F); } -void midi_send_aftertouch(MidiDevice* device, uint8_t chan, uint8_t note_num, uint8_t amt) { device->send_func(device, 3, MIDI_AFTERTOUCH | (chan & MIDI_CHANMASK), note_num & 0x7F, amt & 0x7F); } +void midi_send_aftertouch(MidiDevice* device, uint8_t chan, uint8_t note_num, uint8_t amt) { + device->send_func(device, 3, MIDI_AFTERTOUCH | (chan & MIDI_CHANMASK), note_num & 0x7F, amt & 0x7F); +} // XXX does this work right? // amt in range -0x2000, 0x1fff @@ -102,34 +108,62 @@ void midi_send_pitchbend(MidiDevice* device, uint8_t chan, int16_t amt) { device->send_func(device, 3, MIDI_PITCHBEND | (chan & MIDI_CHANMASK), uAmt & 0x7F, (uAmt >> 7) & 0x7F); } -void midi_send_programchange(MidiDevice* device, uint8_t chan, uint8_t num) { device->send_func(device, 2, MIDI_PROGCHANGE | (chan & MIDI_CHANMASK), num & 0x7F, 0); } +void midi_send_programchange(MidiDevice* device, uint8_t chan, uint8_t num) { + device->send_func(device, 2, MIDI_PROGCHANGE | (chan & MIDI_CHANMASK), num & 0x7F, 0); +} -void midi_send_channelpressure(MidiDevice* device, uint8_t chan, uint8_t amt) { device->send_func(device, 2, MIDI_CHANPRESSURE | (chan & MIDI_CHANMASK), amt & 0x7F, 0); } +void midi_send_channelpressure(MidiDevice* device, uint8_t chan, uint8_t amt) { + device->send_func(device, 2, MIDI_CHANPRESSURE | (chan & MIDI_CHANMASK), amt & 0x7F, 0); +} -void midi_send_clock(MidiDevice* device) { device->send_func(device, 1, MIDI_CLOCK, 0, 0); } +void midi_send_clock(MidiDevice* device) { + device->send_func(device, 1, MIDI_CLOCK, 0, 0); +} -void midi_send_tick(MidiDevice* device) { device->send_func(device, 1, MIDI_TICK, 0, 0); } +void midi_send_tick(MidiDevice* device) { + device->send_func(device, 1, MIDI_TICK, 0, 0); +} -void midi_send_start(MidiDevice* device) { device->send_func(device, 1, MIDI_START, 0, 0); } +void midi_send_start(MidiDevice* device) { + device->send_func(device, 1, MIDI_START, 0, 0); +} -void midi_send_continue(MidiDevice* device) { device->send_func(device, 1, MIDI_CONTINUE, 0, 0); } +void midi_send_continue(MidiDevice* device) { + device->send_func(device, 1, MIDI_CONTINUE, 0, 0); +} -void midi_send_stop(MidiDevice* device) { device->send_func(device, 1, MIDI_STOP, 0, 0); } +void midi_send_stop(MidiDevice* device) { + device->send_func(device, 1, MIDI_STOP, 0, 0); +} -void midi_send_activesense(MidiDevice* device) { device->send_func(device, 1, MIDI_ACTIVESENSE, 0, 0); } +void midi_send_activesense(MidiDevice* device) { + device->send_func(device, 1, MIDI_ACTIVESENSE, 0, 0); +} -void midi_send_reset(MidiDevice* device) { device->send_func(device, 1, MIDI_RESET, 0, 0); } +void midi_send_reset(MidiDevice* device) { + device->send_func(device, 1, MIDI_RESET, 0, 0); +} -void midi_send_tcquarterframe(MidiDevice* device, uint8_t time) { device->send_func(device, 2, MIDI_TC_QUARTERFRAME, time & 0x7F, 0); } +void midi_send_tcquarterframe(MidiDevice* device, uint8_t time) { + device->send_func(device, 2, MIDI_TC_QUARTERFRAME, time & 0x7F, 0); +} // XXX is this right? -void midi_send_songposition(MidiDevice* device, uint16_t pos) { device->send_func(device, 3, MIDI_SONGPOSITION, pos & 0x7F, (pos >> 7) & 0x7F); } +void midi_send_songposition(MidiDevice* device, uint16_t pos) { + device->send_func(device, 3, MIDI_SONGPOSITION, pos & 0x7F, (pos >> 7) & 0x7F); +} -void midi_send_songselect(MidiDevice* device, uint8_t song) { device->send_func(device, 2, MIDI_SONGSELECT, song & 0x7F, 0); } +void midi_send_songselect(MidiDevice* device, uint8_t song) { + device->send_func(device, 2, MIDI_SONGSELECT, song & 0x7F, 0); +} -void midi_send_tunerequest(MidiDevice* device) { device->send_func(device, 1, MIDI_TUNEREQUEST, 0, 0); } +void midi_send_tunerequest(MidiDevice* device) { + device->send_func(device, 1, MIDI_TUNEREQUEST, 0, 0); +} -void midi_send_byte(MidiDevice* device, uint8_t b) { device->send_func(device, 1, b, 0, 0); } +void midi_send_byte(MidiDevice* device, uint8_t b) { + device->send_func(device, 1, b, 0, 0); +} void midi_send_data(MidiDevice* device, uint16_t count, uint8_t byte0, uint8_t byte1, uint8_t byte2) { // ensure that the count passed along is always 3 or lower @@ -150,32 +184,62 @@ void midi_send_array(MidiDevice* device, uint16_t count, uint8_t* array) { } } -void midi_register_cc_callback(MidiDevice* device, midi_three_byte_func_t func) { device->input_cc_callback = func; } +void midi_register_cc_callback(MidiDevice* device, midi_three_byte_func_t func) { + device->input_cc_callback = func; +} -void midi_register_noteon_callback(MidiDevice* device, midi_three_byte_func_t func) { device->input_noteon_callback = func; } +void midi_register_noteon_callback(MidiDevice* device, midi_three_byte_func_t func) { + device->input_noteon_callback = func; +} -void midi_register_noteoff_callback(MidiDevice* device, midi_three_byte_func_t func) { device->input_noteoff_callback = func; } +void midi_register_noteoff_callback(MidiDevice* device, midi_three_byte_func_t func) { + device->input_noteoff_callback = func; +} -void midi_register_aftertouch_callback(MidiDevice* device, midi_three_byte_func_t func) { device->input_aftertouch_callback = func; } +void midi_register_aftertouch_callback(MidiDevice* device, midi_three_byte_func_t func) { + device->input_aftertouch_callback = func; +} -void midi_register_pitchbend_callback(MidiDevice* device, midi_three_byte_func_t func) { device->input_pitchbend_callback = func; } +void midi_register_pitchbend_callback(MidiDevice* device, midi_three_byte_func_t func) { + device->input_pitchbend_callback = func; +} -void midi_register_songposition_callback(MidiDevice* device, midi_three_byte_func_t func) { device->input_songposition_callback = func; } +void midi_register_songposition_callback(MidiDevice* device, midi_three_byte_func_t func) { + device->input_songposition_callback = func; +} -void midi_register_progchange_callback(MidiDevice* device, midi_two_byte_func_t func) { device->input_progchange_callback = func; } +void midi_register_progchange_callback(MidiDevice* device, midi_two_byte_func_t func) { + device->input_progchange_callback = func; +} -void midi_register_chanpressure_callback(MidiDevice* device, midi_two_byte_func_t func) { device->input_chanpressure_callback = func; } +void midi_register_chanpressure_callback(MidiDevice* device, midi_two_byte_func_t func) { + device->input_chanpressure_callback = func; +} -void midi_register_songselect_callback(MidiDevice* device, midi_two_byte_func_t func) { device->input_songselect_callback = func; } +void midi_register_songselect_callback(MidiDevice* device, midi_two_byte_func_t func) { + device->input_songselect_callback = func; +} -void midi_register_tc_quarterframe_callback(MidiDevice* device, midi_two_byte_func_t func) { device->input_tc_quarterframe_callback = func; } +void midi_register_tc_quarterframe_callback(MidiDevice* device, midi_two_byte_func_t func) { + device->input_tc_quarterframe_callback = func; +} -void midi_register_realtime_callback(MidiDevice* device, midi_one_byte_func_t func) { device->input_realtime_callback = func; } +void midi_register_realtime_callback(MidiDevice* device, midi_one_byte_func_t func) { + device->input_realtime_callback = func; +} -void midi_register_tunerequest_callback(MidiDevice* device, midi_one_byte_func_t func) { device->input_tunerequest_callback = func; } +void midi_register_tunerequest_callback(MidiDevice* device, midi_one_byte_func_t func) { + device->input_tunerequest_callback = func; +} -void midi_register_sysex_callback(MidiDevice* device, midi_sysex_func_t func) { device->input_sysex_callback = func; } +void midi_register_sysex_callback(MidiDevice* device, midi_sysex_func_t func) { + device->input_sysex_callback = func; +} -void midi_register_fallthrough_callback(MidiDevice* device, midi_var_byte_func_t func) { device->input_fallthrough_callback = func; } +void midi_register_fallthrough_callback(MidiDevice* device, midi_var_byte_func_t func) { + device->input_fallthrough_callback = func; +} -void midi_register_catchall_callback(MidiDevice* device, midi_var_byte_func_t func) { device->input_catchall_callback = func; } +void midi_register_catchall_callback(MidiDevice* device, midi_var_byte_func_t func) { + device->input_catchall_callback = func; +} diff --git a/tmk_core/protocol/midi/midi.h b/tmk_core/protocol/midi/midi.h index 75f3b13b0bf5..34547077e49e 100644 --- a/tmk_core/protocol/midi/midi.h +++ b/tmk_core/protocol/midi/midi.h @@ -48,7 +48,7 @@ extern "C" { * * @param device the device to initialize */ -void midi_device_init(MidiDevice* device); // [implementation in midi_device.c] +void midi_device_init(MidiDevice* device); // [implementation in midi_device.c] /** * @brief Process input data @@ -58,7 +58,7 @@ void midi_device_init(MidiDevice* device); // [implementation in midi_device.c] * * @param device the device to process */ -void midi_device_process(MidiDevice* device); // [implementation in midi_device.c] +void midi_device_process(MidiDevice* device); // [implementation in midi_device.c] /**@}*/ @@ -115,7 +115,7 @@ void midi_send_aftertouch(MidiDevice* device, uint8_t chan, uint8_t note_num, ui * @param chan the channel to send on, 0-15 * @param amt the bend amount range: -8192..8191, 0 means no bend */ -void midi_send_pitchbend(MidiDevice* device, uint8_t chan, int16_t amt); // range -8192, 8191 +void midi_send_pitchbend(MidiDevice* device, uint8_t chan, int16_t amt); // range -8192, 8191 /** * @brief Send a program change message via the given device. diff --git a/tmk_core/protocol/midi/midi_device.c b/tmk_core/protocol/midi/midi_device.c index 58fe685e2d37..77c010b15623 100644 --- a/tmk_core/protocol/midi/midi_device.c +++ b/tmk_core/protocol/midi/midi_device.c @@ -60,12 +60,17 @@ void midi_device_init(MidiDevice* device) { void midi_device_input(MidiDevice* device, uint8_t cnt, uint8_t* input) { uint8_t i; - for (i = 0; i < cnt; i++) bytequeue_enqueue(&device->input_queue, input[i]); + for (i = 0; i < cnt; i++) + bytequeue_enqueue(&device->input_queue, input[i]); } -void midi_device_set_send_func(MidiDevice* device, midi_var_byte_func_t send_func) { device->send_func = send_func; } +void midi_device_set_send_func(MidiDevice* device, midi_var_byte_func_t send_func) { + device->send_func = send_func; +} -void midi_device_set_pre_input_process_func(MidiDevice* device, midi_no_byte_func_t pre_process_func) { device->pre_input_process_callback = pre_process_func; } +void midi_device_set_pre_input_process_func(MidiDevice* device, midi_no_byte_func_t pre_process_func) { + device->pre_input_process_callback = pre_process_func; +} void midi_device_process(MidiDevice* device) { // call the pre_input_process_callback if there is one diff --git a/tmk_core/protocol/midi/qmk_midi.c b/tmk_core/protocol/midi/qmk_midi.c index 3a454d61ae8e..f6a5d9228124 100644 --- a/tmk_core/protocol/midi/qmk_midi.c +++ b/tmk_core/protocol/midi/qmk_midi.c @@ -50,7 +50,7 @@ static void usb_send_func(MidiDevice* device, uint16_t cnt, uint8_t byte0, uint8 event.Event = MIDI_EVENT(cable, SYSEX_START_OR_CONT); break; default: - return; // invalid cnt + return; // invalid cnt } } else { // deal with 'system common' messages diff --git a/tmk_core/protocol/midi/sysex_tools.c b/tmk_core/protocol/midi/sysex_tools.c index 84bca7215819..c9a9d0328502 100644 --- a/tmk_core/protocol/midi/sysex_tools.c +++ b/tmk_core/protocol/midi/sysex_tools.c @@ -35,7 +35,7 @@ uint16_t sysex_decoded_length(uint16_t encoded_length) { } uint16_t sysex_encode(uint8_t *encoded, const uint8_t *source, const uint16_t length) { - uint16_t encoded_full = length / 7; // number of full 8 byte sections from 7 bytes of input + uint16_t encoded_full = length / 7; // number of full 8 byte sections from 7 bytes of input uint16_t i, j; // fill out the fully encoded sections diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index a43755f89911..0b992ba6c5dd 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -450,7 +450,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { #endif #ifndef USB_POLLING_INTERVAL_MS -# define USB_POLLING_INTERVAL_MS 10 +# define USB_POLLING_INTERVAL_MS 1 #endif /* diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 0f0c78f66c40..6c3424145ce5 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -200,7 +200,7 @@ enum usb_interfaces { * Endpoint numbers */ enum usb_endpoints { - __unused_epnum__ = NEXT_EPNUM, // Endpoint numbering starts at 1 + __unused_epnum__ = NEXT_EPNUM, // Endpoint numbering starts at 1 #ifndef KEYBOARD_SHARED_EP KEYBOARD_IN_EPNUM = NEXT_EPNUM, diff --git a/tmk_core/protocol/usb_device_state.c b/tmk_core/protocol/usb_device_state.c index 84f01943be4c..8d56ba4d2f94 100644 --- a/tmk_core/protocol/usb_device_state.c +++ b/tmk_core/protocol/usb_device_state.c @@ -22,7 +22,9 @@ enum usb_device_state usb_device_state = USB_DEVICE_STATE_NO_INIT; -__attribute__((weak)) void notify_usb_device_state_change_kb(enum usb_device_state usb_device_state) { notify_usb_device_state_change_user(usb_device_state); } +__attribute__((weak)) void notify_usb_device_state_change_kb(enum usb_device_state usb_device_state) { + notify_usb_device_state_change_user(usb_device_state); +} __attribute__((weak)) void notify_usb_device_state_change_user(enum usb_device_state usb_device_state) {} diff --git a/tmk_core/protocol/usb_device_state.h b/tmk_core/protocol/usb_device_state.h index c229311d4673..3be65ea7e15e 100644 --- a/tmk_core/protocol/usb_device_state.h +++ b/tmk_core/protocol/usb_device_state.h @@ -27,10 +27,10 @@ void usb_device_state_set_reset(void); void usb_device_state_init(void); enum usb_device_state { - USB_DEVICE_STATE_NO_INIT = 0, // We're in this state before calling usb_device_state_init() - USB_DEVICE_STATE_INIT = 1, // Can consume up to 100mA - USB_DEVICE_STATE_CONFIGURED = 2, // Can consume up to what is specified in configuration descriptor, typically 500mA - USB_DEVICE_STATE_SUSPEND = 3 // Can consume only suspend current + USB_DEVICE_STATE_NO_INIT = 0, // We're in this state before calling usb_device_state_init() + USB_DEVICE_STATE_INIT = 1, // Can consume up to 100mA + USB_DEVICE_STATE_CONFIGURED = 2, // Can consume up to what is specified in configuration descriptor, typically 500mA + USB_DEVICE_STATE_SUSPEND = 3 // Can consume only suspend current }; extern enum usb_device_state usb_device_state; diff --git a/tmk_core/protocol/usb_util.c b/tmk_core/protocol/usb_util.c index dd1deeaa1123..49aadedc2af9 100644 --- a/tmk_core/protocol/usb_util.c +++ b/tmk_core/protocol/usb_util.c @@ -17,7 +17,9 @@ #include "usb_util.h" __attribute__((weak)) void usb_disconnect(void) {} -__attribute__((weak)) bool usb_connected_state(void) { return true; } +__attribute__((weak)) bool usb_connected_state(void) { + return true; +} __attribute__((weak)) bool usb_vbus_state(void) { #ifdef USB_VBUS_PIN setPinInput(USB_VBUS_PIN); diff --git a/tmk_core/protocol/vusb/protocol.c b/tmk_core/protocol/vusb/protocol.c index 644e77e021a4..20d053048364 100644 --- a/tmk_core/protocol/vusb/protocol.c +++ b/tmk_core/protocol/vusb/protocol.c @@ -97,7 +97,9 @@ static void vusb_wakeup(void) { * * FIXME: Needs doc */ -static void setup_usb(void) { initForUsbConnectivity(); } +static void setup_usb(void) { + initForUsbConnectivity(); +} uint16_t sof_timer = 0; diff --git a/tmk_core/protocol/vusb/usb_util.c b/tmk_core/protocol/vusb/usb_util.c index 4ee2d3188b32..38c4352d5541 100644 --- a/tmk_core/protocol/vusb/usb_util.c +++ b/tmk_core/protocol/vusb/usb_util.c @@ -16,7 +16,9 @@ #include #include "usb_util.h" -void usb_disconnect(void) { usbDeviceDisconnect(); } +void usb_disconnect(void) { + usbDeviceDisconnect(); +} bool usb_connected_state(void) { usbPoll(); diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index bd0f1c21aa96..ebde955d3b4d 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -230,9 +230,13 @@ static void send_programmable_button(uint32_t data); static host_driver_t driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer, send_programmable_button}; -host_driver_t *vusb_driver(void) { return &driver; } +host_driver_t *vusb_driver(void) { + return &driver; +} -static uint8_t keyboard_leds(void) { return keyboard_led_state; } +static uint8_t keyboard_leds(void) { + return keyboard_led_state; +} static void send_keyboard(report_keyboard_t *report) { uint8_t next = (kbuf_head + 1) % KBUF_SIZE; @@ -348,7 +352,7 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) { last_req.kind = SET_LED; last_req.len = rq->wLength.word; } - return USB_NO_MSG; // to get data in usbFunctionWrite + return USB_NO_MSG; // to get data in usbFunctionWrite } else { dprint("UNKNOWN:"); } @@ -410,47 +414,47 @@ const PROGMEM uchar shared_hid_report[] = { #else const PROGMEM uchar keyboard_hid_report[] = { #endif - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x06, // Usage (Keyboard) - 0xA1, 0x01, // Collection (Application) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) #ifdef KEYBOARD_SHARED_EP - 0x85, REPORT_ID_KEYBOARD, // Report ID + 0x85, REPORT_ID_KEYBOARD, // Report ID #endif // Modifiers (8 bits) - 0x05, 0x07, // Usage Page (Keyboard/Keypad) - 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) - 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x08, // Report Count (8) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) + 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Reserved (1 byte) - 0x95, 0x01, // Report Count (1) - 0x75, 0x08, // Report Size (8) - 0x81, 0x03, // Input (Constant) + 0x95, 0x01, // Report Count (1) + 0x75, 0x08, // Report Size (8) + 0x81, 0x03, // Input (Constant) // Keycodes (6 bytes) - 0x05, 0x07, // Usage Page (Keyboard/Keypad) - 0x19, 0x00, // Usage Minimum (0) - 0x29, 0xFF, // Usage Maximum (255) - 0x15, 0x00, // Logical Minimum (0) - 0x26, 0xFF, 0x00, // Logical Maximum (255) - 0x95, 0x06, // Report Count (6) - 0x75, 0x08, // Report Size (8) - 0x81, 0x00, // Input (Data, Array, Absolute) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0x00, // Usage Minimum (0) + 0x29, 0xFF, // Usage Maximum (255) + 0x15, 0x00, // Logical Minimum (0) + 0x26, 0xFF, 0x00, // Logical Maximum (255) + 0x95, 0x06, // Report Count (6) + 0x75, 0x08, // Report Size (8) + 0x81, 0x00, // Input (Data, Array, Absolute) // Status LEDs (5 bits) - 0x05, 0x08, // Usage Page (LED) - 0x19, 0x01, // Usage Minimum (Num Lock) - 0x29, 0x05, // Usage Maximum (Kana) - 0x95, 0x05, // Report Count (5) - 0x75, 0x01, // Report Size (1) - 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x95, 0x05, // Report Count (5) + 0x75, 0x01, // Report Size (1) + 0x91, 0x02, // Output (Data, Variable, Absolute) // LED padding (3 bits) - 0x95, 0x01, // Report Count (1) - 0x75, 0x03, // Report Size (3) - 0x91, 0x03, // Output (Constant) - 0xC0, // End Collection + 0x95, 0x01, // Report Count (1) + 0x75, 0x03, // Report Size (3) + 0x91, 0x03, // Output (Constant) + 0xC0, // End Collection #ifndef KEYBOARD_SHARED_EP }; #endif @@ -462,135 +466,135 @@ const PROGMEM uchar shared_hid_report[] = { #ifdef MOUSE_ENABLE // Mouse report descriptor - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x02, // Usage (Mouse) - 0xA1, 0x01, // Collection (Application) - 0x85, REPORT_ID_MOUSE, // Report ID - 0x09, 0x01, // Usage (Pointer) - 0xA1, 0x00, // Collection (Physical) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x02, // Usage (Mouse) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_MOUSE, // Report ID + 0x09, 0x01, // Usage (Pointer) + 0xA1, 0x00, // Collection (Physical) // Buttons (8 bits) - 0x05, 0x09, // Usage Page (Button) - 0x19, 0x01, // Usage Minimum (Button 1) - 0x29, 0x08, // Usage Maximum (Button 8) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x08, // Report Count (8) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x05, 0x09, // Usage Page (Button) + 0x19, 0x01, // Usage Minimum (Button 1) + 0x29, 0x08, // Usage Maximum (Button 8) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) // X/Y position (2 bytes) - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x30, // Usage (X) - 0x09, 0x31, // Usage (Y) - 0x15, 0x81, // Logical Minimum (-127) - 0x25, 0x7F, // Logical Maximum (127) - 0x95, 0x02, // Report Count (2) - 0x75, 0x08, // Report Size (8) - 0x81, 0x06, // Input (Data, Variable, Relative) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x30, // Usage (X) + 0x09, 0x31, // Usage (Y) + 0x15, 0x81, // Logical Minimum (-127) + 0x25, 0x7F, // Logical Maximum (127) + 0x95, 0x02, // Report Count (2) + 0x75, 0x08, // Report Size (8) + 0x81, 0x06, // Input (Data, Variable, Relative) // Vertical wheel (1 byte) - 0x09, 0x38, // Usage (Wheel) - 0x15, 0x81, // Logical Minimum (-127) - 0x25, 0x7F, // Logical Maximum (127) - 0x95, 0x01, // Report Count (1) - 0x75, 0x08, // Report Size (8) - 0x81, 0x06, // Input (Data, Variable, Relative) + 0x09, 0x38, // Usage (Wheel) + 0x15, 0x81, // Logical Minimum (-127) + 0x25, 0x7F, // Logical Maximum (127) + 0x95, 0x01, // Report Count (1) + 0x75, 0x08, // Report Size (8) + 0x81, 0x06, // Input (Data, Variable, Relative) // Horizontal wheel (1 byte) - 0x05, 0x0C, // Usage Page (Consumer) - 0x0A, 0x38, 0x02, // Usage (AC Pan) - 0x15, 0x81, // Logical Minimum (-127) - 0x25, 0x7F, // Logical Maximum (127) - 0x95, 0x01, // Report Count (1) - 0x75, 0x08, // Report Size (8) - 0x81, 0x06, // Input (Data, Variable, Relative) - 0xC0, // End Collection - 0xC0, // End Collection + 0x05, 0x0C, // Usage Page (Consumer) + 0x0A, 0x38, 0x02, // Usage (AC Pan) + 0x15, 0x81, // Logical Minimum (-127) + 0x25, 0x7F, // Logical Maximum (127) + 0x95, 0x01, // Report Count (1) + 0x75, 0x08, // Report Size (8) + 0x81, 0x06, // Input (Data, Variable, Relative) + 0xC0, // End Collection + 0xC0, // End Collection #endif #ifdef EXTRAKEY_ENABLE // Extrakeys report descriptor - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x80, // Usage (System Control) - 0xA1, 0x01, // Collection (Application) - 0x85, REPORT_ID_SYSTEM, // Report ID - 0x19, 0x01, // Usage Minimum (Pointer) - 0x2A, 0xB7, 0x00, // Usage Maximum (System Display LCD Autoscale) - 0x15, 0x01, // Logical Minimum - 0x26, 0xB7, 0x00, // Logical Maximum - 0x95, 0x01, // Report Count (1) - 0x75, 0x10, // Report Size (16) - 0x81, 0x00, // Input (Data, Array, Absolute) - 0xC0, // End Collection - - 0x05, 0x0C, // Usage Page (Consumer) - 0x09, 0x01, // Usage (Consumer Control) - 0xA1, 0x01, // Collection (Application) - 0x85, REPORT_ID_CONSUMER, // Report ID - 0x19, 0x01, // Usage Minimum (Consumer Control) - 0x2A, 0xA0, 0x02, // Usage Maximum (AC Desktop Show All Applications) - 0x15, 0x01, // Logical Minimum - 0x26, 0xA0, 0x02, // Logical Maximum - 0x95, 0x01, // Report Count (1) - 0x75, 0x10, // Report Size (16) - 0x81, 0x00, // Input (Data, Array, Absolute) - 0xC0, // End Collection + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x80, // Usage (System Control) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_SYSTEM, // Report ID + 0x19, 0x01, // Usage Minimum (Pointer) + 0x2A, 0xB7, 0x00, // Usage Maximum (System Display LCD Autoscale) + 0x15, 0x01, // Logical Minimum + 0x26, 0xB7, 0x00, // Logical Maximum + 0x95, 0x01, // Report Count (1) + 0x75, 0x10, // Report Size (16) + 0x81, 0x00, // Input (Data, Array, Absolute) + 0xC0, // End Collection + + 0x05, 0x0C, // Usage Page (Consumer) + 0x09, 0x01, // Usage (Consumer Control) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_CONSUMER, // Report ID + 0x19, 0x01, // Usage Minimum (Consumer Control) + 0x2A, 0xA0, 0x02, // Usage Maximum (AC Desktop Show All Applications) + 0x15, 0x01, // Logical Minimum + 0x26, 0xA0, 0x02, // Logical Maximum + 0x95, 0x01, // Report Count (1) + 0x75, 0x10, // Report Size (16) + 0x81, 0x00, // Input (Data, Array, Absolute) + 0xC0, // End Collection #endif #ifdef DIGITIZER_ENABLE // Digitizer report descriptor - 0x05, 0x0D, // Usage Page (Digitizers) - 0x09, 0x01, // Usage (Digitizer) - 0xA1, 0x01, // Collection (Application) - 0x85, REPORT_ID_DIGITIZER, // Report ID - 0x09, 0x22, // Usage (Finger) - 0xA1, 0x00, // Collection (Physical) + 0x05, 0x0D, // Usage Page (Digitizers) + 0x09, 0x01, // Usage (Digitizer) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_DIGITIZER, // Report ID + 0x09, 0x22, // Usage (Finger) + 0xA1, 0x00, // Collection (Physical) // Tip Switch (1 bit) - 0x09, 0x42, // Usage (Tip Switch) - 0x15, 0x00, // Logical Minimum - 0x25, 0x01, // Logical Maximum - 0x95, 0x01, // Report Count (1) - 0x75, 0x01, // Report Size (16) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x09, 0x42, // Usage (Tip Switch) + 0x15, 0x00, // Logical Minimum + 0x25, 0x01, // Logical Maximum + 0x95, 0x01, // Report Count (1) + 0x75, 0x01, // Report Size (16) + 0x81, 0x02, // Input (Data, Variable, Absolute) // In Range (1 bit) - 0x09, 0x32, // Usage (In Range) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x09, 0x32, // Usage (In Range) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Padding (6 bits) - 0x95, 0x06, // Report Count (6) - 0x81, 0x03, // Input (Constant) + 0x95, 0x06, // Report Count (6) + 0x81, 0x03, // Input (Constant) // X/Y Position (4 bytes) - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x26, 0xFF, 0x7F, // Logical Maximum (32767) - 0x95, 0x01, // Report Count (1) - 0x75, 0x10, // Report Size (16) - 0x65, 0x33, // Unit (Inch, English Linear) - 0x55, 0x0E, // Unit Exponent (-2) - 0x09, 0x30, // Usage (X) - 0x81, 0x02, // Input (Data, Variable, Absolute) - 0x09, 0x31, // Usage (Y) - 0x81, 0x02, // Input (Data, Variable, Absolute) - 0xC0, // End Collection - 0xC0, // End Collection + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x26, 0xFF, 0x7F, // Logical Maximum (32767) + 0x95, 0x01, // Report Count (1) + 0x75, 0x10, // Report Size (16) + 0x65, 0x33, // Unit (Inch, English Linear) + 0x55, 0x0E, // Unit Exponent (-2) + 0x09, 0x30, // Usage (X) + 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x09, 0x31, // Usage (Y) + 0x81, 0x02, // Input (Data, Variable, Absolute) + 0xC0, // End Collection + 0xC0, // End Collection #endif #ifdef PROGRAMMABLE_BUTTON_ENABLE // Programmable buttons report descriptor - 0x05, 0x0C, // Usage Page (Consumer) - 0x09, 0x01, // Usage (Consumer Control) - 0xA1, 0x01, // Collection (Application) - 0x85, REPORT_ID_PROGRAMMABLE_BUTTON, // Report ID - 0x09, 0x03, // Usage (Programmable Buttons) - 0xA1, 0x04, // Collection (Named Array) - 0x05, 0x09, // Usage Page (Button) - 0x19, 0x01, // Usage Minimum (Button 1) - 0x29, 0x20, // Usage Maximum (Button 32) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x20, // Report Count (32) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) - 0xC0, // End Collection - 0xC0, // End Collection + 0x05, 0x0C, // Usage Page (Consumer) + 0x09, 0x01, // Usage (Consumer Control) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_PROGRAMMABLE_BUTTON, // Report ID + 0x09, 0x03, // Usage (Programmable Buttons) + 0xA1, 0x04, // Collection (Named Array) + 0x05, 0x09, // Usage Page (Button) + 0x19, 0x01, // Usage Minimum (Button 1) + 0x29, 0x20, // Usage Maximum (Button 32) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x20, // Report Count (32) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) + 0xC0, // End Collection + 0xC0, // End Collection #endif #ifdef SHARED_EP_ENABLE @@ -599,47 +603,47 @@ const PROGMEM uchar shared_hid_report[] = { #ifdef RAW_ENABLE const PROGMEM uchar raw_hid_report[] = { - 0x06, RAW_USAGE_PAGE_LO, RAW_USAGE_PAGE_HI, // Usage Page (Vendor Defined) - 0x09, RAW_USAGE_ID, // Usage (Vendor Defined) - 0xA1, 0x01, // Collection (Application) + 0x06, RAW_USAGE_PAGE_LO, RAW_USAGE_PAGE_HI, // Usage Page (Vendor Defined) + 0x09, RAW_USAGE_ID, // Usage (Vendor Defined) + 0xA1, 0x01, // Collection (Application) // Data to host - 0x09, 0x62, // Usage (Vendor Defined) - 0x15, 0x00, // Logical Minimum (0) - 0x26, 0xFF, 0x00, // Logical Maximum (255) - 0x95, RAW_BUFFER_SIZE, // Report Count - 0x75, 0x08, // Report Size (8) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x09, 0x62, // Usage (Vendor Defined) + 0x15, 0x00, // Logical Minimum (0) + 0x26, 0xFF, 0x00, // Logical Maximum (255) + 0x95, RAW_BUFFER_SIZE, // Report Count + 0x75, 0x08, // Report Size (8) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Data from host - 0x09, 0x63, // Usage (Vendor Defined) - 0x15, 0x00, // Logical Minimum (0) - 0x26, 0xFF, 0x00, // Logical Maximum (255) - 0x95, RAW_BUFFER_SIZE, // Report Count - 0x75, 0x08, // Report Size (8) - 0x91, 0x02, // Output (Data, Variable, Absolute) - 0xC0 // End Collection + 0x09, 0x63, // Usage (Vendor Defined) + 0x15, 0x00, // Logical Minimum (0) + 0x26, 0xFF, 0x00, // Logical Maximum (255) + 0x95, RAW_BUFFER_SIZE, // Report Count + 0x75, 0x08, // Report Size (8) + 0x91, 0x02, // Output (Data, Variable, Absolute) + 0xC0 // End Collection }; #endif #if defined(CONSOLE_ENABLE) const PROGMEM uchar console_hid_report[] = { - 0x06, 0x31, 0xFF, // Usage Page (Vendor Defined - PJRC Teensy compatible) - 0x09, 0x74, // Usage (Vendor Defined - PJRC Teensy compatible) - 0xA1, 0x01, // Collection (Application) + 0x06, 0x31, 0xFF, // Usage Page (Vendor Defined - PJRC Teensy compatible) + 0x09, 0x74, // Usage (Vendor Defined - PJRC Teensy compatible) + 0xA1, 0x01, // Collection (Application) // Data to host - 0x09, 0x75, // Usage (Vendor Defined) - 0x15, 0x00, // Logical Minimum (0x00) - 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) - 0x95, CONSOLE_BUFFER_SIZE, // Report Count - 0x75, 0x08, // Report Size (8) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x09, 0x75, // Usage (Vendor Defined) + 0x15, 0x00, // Logical Minimum (0x00) + 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) + 0x95, CONSOLE_BUFFER_SIZE, // Report Count + 0x75, 0x08, // Report Size (8) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Data from host - 0x09, 0x76, // Usage (Vendor Defined) - 0x15, 0x00, // Logical Minimum (0x00) - 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) - 0x95, CONSOLE_BUFFER_SIZE, // Report Count - 0x75, 0x08, // Report Size (8) - 0x91, 0x02, // Output (Data) - 0xC0 // End Collection + 0x09, 0x76, // Usage (Vendor Defined) + 0x15, 0x00, // Logical Minimum (0x00) + 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) + 0x95, CONSOLE_BUFFER_SIZE, // Report Count + 0x75, 0x08, // Report Size (8) + 0x91, 0x02, // Output (Data) + 0xC0 // End Collection }; #endif @@ -647,7 +651,6 @@ const PROGMEM uchar console_hid_report[] = { # define USB_MAX_POWER_CONSUMPTION 500 #endif -// TODO: change this to 10ms to match LUFA #ifndef USB_POLLING_INTERVAL_MS # define USB_POLLING_INTERVAL_MS 1 #endif @@ -940,16 +943,16 @@ USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq) { usbMsgPtr = (usbMsgPtr_t)&usbStringDescriptorZero; len = usbStringDescriptorZero.header.bLength; break; - case 1: // iManufacturer + case 1: // iManufacturer usbMsgPtr = (usbMsgPtr_t)&usbStringDescriptorManufacturer; len = usbStringDescriptorManufacturer.header.bLength; break; - case 2: // iProduct + case 2: // iProduct usbMsgPtr = (usbMsgPtr_t)&usbStringDescriptorProduct; len = usbStringDescriptorProduct.header.bLength; break; #if defined(SERIAL_NUMBER) - case 3: // iSerialNumber + case 3: // iSerialNumber usbMsgPtr = (usbMsgPtr_t)&usbStringDescriptorSerial; len = usbStringDescriptorSerial.header.bLength; break; diff --git a/users/cedrikl/cedrikl.c b/users/cedrikl/cedrikl.c new file mode 100644 index 000000000000..0479e22b5df3 --- /dev/null +++ b/users/cedrikl/cedrikl.c @@ -0,0 +1,36 @@ +/* Copyright 2021 Cedrik Lussier @cedrikl +.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin + +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 QMK_KEYBOARD_H +#include "cedrikl.h" + +// Turn on/off NUM LOCK if current state is different +void activate_numlock(bool turn_on) { + if (host_keyboard_led_state().num_lock != turn_on) { + tap_code(KC_NUMLOCK); + } +} + + +// INITIAL STARTUP + +void keyboard_post_init_user(void) { + #ifdef STARTUP_NUMLOCK_ON + activate_numlock(true); // turn on Num lock by default so that the numpad layer always has predictable results + #endif // STARTUP_NUMLOC_ON +} diff --git a/keyboards/dm9records/ergoinu/keymaps/default_jis/config.h b/users/cedrikl/cedrikl.h similarity index 72% rename from keyboards/dm9records/ergoinu/keymaps/default_jis/config.h rename to users/cedrikl/cedrikl.h index bb266f25e72d..e25d27466478 100644 --- a/keyboards/dm9records/ergoinu/keymaps/default_jis/config.h +++ b/users/cedrikl/cedrikl.h @@ -1,9 +1,5 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2018 Takuya Urakawa +/* Copyright 2021 Cedrik Lussier @cedrikl +.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin 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 @@ -21,4 +17,5 @@ along with this program. If not, see . #pragma once -#define RGBLIGHT_ANIMATIONS +// OTHER FUNCTION PROTOTYPE +void activate_numlock(bool turn_on); diff --git a/keyboards/viktus/sp111/mcp23018.h b/users/cedrikl/config.h similarity index 51% rename from keyboards/viktus/sp111/mcp23018.h rename to users/cedrikl/config.h index dc2251b72ff1..741a2fe470a1 100644 --- a/keyboards/viktus/sp111/mcp23018.h +++ b/users/cedrikl/config.h @@ -1,4 +1,5 @@ -/* Copyright 2020 zvecr +/* Copyright 2021 Cedrik Lussier @cedrikl +.* Directly inspired from the work of jonavin https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin * * 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,22 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#pragma once - -#include -#include -#define mcp23018_PORTA 0 -#define mcp23018_PORTB 1 - -#define ALL_OUTPUT 0 -#define ALL_INPUT 0xFF -#define ALL_LOW 0 -#define ALL_HIGH 0xFF +#pragma once -void mcp23018_init(uint8_t addr); -bool mcp23018_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); -bool mcp23018_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); -bool mcp23018_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB); -bool mcp23018_readPins(uint8_t slave_addraddr, uint8_t port, uint8_t* ret); -bool mcp23018_readPins_all(uint8_t slave_addr, uint16_t* ret); +#ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR + //#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_ALL + #define RGB_DISABLE_WHEN_USB_SUSPENDED + #define RGB_MATRIX_STARTUP_VAL 120 +#endif diff --git a/users/cedrikl/rules.mk b/users/cedrikl/rules.mk new file mode 100644 index 000000000000..b5ee62c43a01 --- /dev/null +++ b/users/cedrikl/rules.mk @@ -0,0 +1,4 @@ +SRC += cedrikl.c +ifeq ($(strip $(STARTUP_NUMLOCK_ON)), yes) + OPT_DEFS += -DSTARTUP_NUMLOCK_ON +endif diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index c850c5336f4d..752829e0fa27 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c @@ -953,7 +953,7 @@ void oled_driver_render_logo_left(void) { render_matrix_scan_rate(2); # endif oled_set_cursor(7, 2); -# if defined(KEYBOARD_bastardkb_charybdis) +# if defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform) render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1); // credit and thanks to jaspertandy on discord for these images diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c index 0dcfe73f346b..d0a83e2c2618 100644 --- a/users/drashna/pointing/pointing.c +++ b/users/drashna/pointing/pointing.c @@ -80,9 +80,9 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { } break; case MO(_MOUSE): -#if defined(KEYBOARD_ploopy) || defined(KEYBOARD_handwired_tractyl_manuform) +#if defined(KEYBOARD_ploopy) case DPI_CONFIG: -#elif defined(KEYBOARD_bastardkb_charybdis) && !defined(NO_CHARYBDIS_KEYCODES) +#elif (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && !defined(NO_CHARYBDIS_KEYCODES) case SAFE_RANGE ... (CHARYBDIS_SAFE_RANGE-1): #endif case KC_MS_UP ... KC_MS_WH_RIGHT: diff --git a/users/vitoni/readme.adoc b/users/vitoni/readme.adoc new file mode 100644 index 000000000000..acf65793d2de --- /dev/null +++ b/users/vitoni/readme.adoc @@ -0,0 +1,16 @@ += User functions + +Functions are mostly related to changing the RGB lights depending on user interaction and when idling. + +== utils.h + +Common functions are declared in link:utils.h[]. These function are not directly RGB related but used to modify state and calculate values. + +== rgb_matrix_effects.h + +Functions in link:rgb_matrix_effects.h[] make use of common function in `utils.h` and are used to create to RGB matrix effects such as fading or breathing. + +== vitoni.h + +The functions declared in link:vitoni.h[] are used as entry points for usage of RGB effects. +One entry point is `matrix_scan` based for regular task while the other is `process_record` based for user activity tasks. diff --git a/users/vitoni/rgb_matrix_effects.c b/users/vitoni/rgb_matrix_effects.c new file mode 100644 index 000000000000..3a13e99bc7e2 --- /dev/null +++ b/users/vitoni/rgb_matrix_effects.c @@ -0,0 +1,236 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rgb_matrix_effects.h" + +#include +#include + +#include "utils.h" + +/* + Offset used to start at the right point in th curve to avoid big jumps in brightness + 0 => 0% (signed) => 50% (unsigned) + 64 => 100% (signed) => 100% (unsigned) + 128 => 0% (signed) => 50% (unsigned) + 192 => -100% (signed) => 0% (unsigned) +*/ +enum PHASE { + PHASE_ZERO_RAISING + ,PHASE_HIGH + ,PHASE_ZERO_FALLING + ,PHASE_LOW +}; + +/** + * @brief Calculates the offset so that a specific time is aligned to a specific point in the sine curve. + * @param[in] time The time for which the offset shopuld be calculated. + * @param[in] phase Phase which should be reached with the offset + * @see PHASE + */ +uint8_t offset_for_time(const uint8_t time, const uint8_t phase) { + switch (phase) { + case PHASE_ZERO_RAISING: + return 0 - time; + case PHASE_HIGH: + return 64 - time; + case PHASE_ZERO_FALLING: + return 128 - time; + case PHASE_LOW: + return 192 - time; + default: + return 0; + } +} + +/** + * @brief Scales down `g_rgb_timer` so that it can be used for RGB effects. + * @return scaled down timer + * @see rgb_time_2_scale_w_factor() + */ +uint8_t rgb_time_2_scale(void) { + static const uint8_t factor = 1; + return rgb_time_2_scale_w_factor(factor); +} + +/* + * Used to slow down RGB speed. + */ +static const uint8_t rgb_speed_divisor = 8; + +/** + * @brief Scales down `g_rgb_timer` so that it can be used for RGB effects. + * @details Usually these calculations aredone internally by some RGB effects. + This method exposed to scaling so that all effects to have same timebase. If `rgb_matrix_config.speed` all effects are affected the same. + * @param[in] factor The factor can be used to speed up some operations in relation to others. + * @return scaled down timer taking into account the given factor + * @see g_rgb_timer + * @see rgb_matrix_config.speed + */ +uint8_t rgb_time_2_scale_w_factor(const uint8_t rgb_speed_factor) { + const uint8_t scaled_time = scale16by8(g_rgb_timer, rgb_matrix_config.speed * rgb_speed_factor / rgb_speed_divisor); + + return scaled_time; +} + +/** + * @brief Inverse function to calculate time required to execute `timer` steps. + * @details This method allows calculation of the time needed to execute N `timer`steps. + Usefull when using a scaled down time but requiring the time needed to perform these steps. + * @param[in] scaled_time scaled down timer to inverse to time + * @return time corresponding to scaled down time + * @see rgb_time_2_scale() + */ +uint16_t scale_2_rgb_time(const uint8_t scaled_time) { + const uint16_t time = scaled_time * rgb_speed_divisor * UINT8_MAX / rgb_matrix_config.speed; + + return time; +} + +bool fade_in_ranged(const uint8_t time, const uint8_t range_min, const uint8_t range_max) { + static const uint8_t max_delta = 1; + return scaled_sin_up(time, range_min, range_max, max_delta, &(rgb_matrix_config.hsv.v)); +} + +bool fade_out_ranged(const uint8_t time, const uint8_t range_min, const uint8_t range_max) { + static const uint8_t max_delta = 1; + return scaled_sin_down(time, range_min, range_max, max_delta, &(rgb_matrix_config.hsv.v)); +} + +/** + * @brief Convenience method to eventually skip the value part when setting HSV. + * @details When setting HSV this includes the value/brightness. + As changing brightness might interfer with fading or breathing effects, + this method can skip the value part of HSV (depending on the preprocessor flag: RGB_FADE_IN). + * @param[in] hue Hue + * @param[in] sat Saturation + * @param[in] hue Value (brightness) + * @see rgb_matrix_sethsv_noeeprom() + */ +void rgb_matrix_sethsv_noeeprom_user(const uint16_t hue, const uint8_t sat, const uint8_t val) { +#if defined(RGB_FADE_IN) || defined(RGB_IDLE_TIMEOUT) + rgb_matrix_config.hsv.h = hue; + rgb_matrix_config.hsv.s = sat; + // omitting setting the value to avoid interfering with effects +// rgb_matrix_config.hsv.v = val; +#else + rgb_matrix_sethsv_noeeprom(hue, sat, val); +#endif +} + +#if defined(RGB_FADE_IN) || defined(RGB_IDLE_TIMEOUT) +/** + * @brief Calculates the time offset required by fade in. + * @details Using an arbitrary timer any point on the sine curve might be pointed to. + * The offest is calculated so that + * a) the point is at the lowest point in the curve and the curve is raising + * b) the point is near the current brightness (eg. fade in might be called while fading out and the lowest value has not yet been reached). + * @param[in] time Current time usually represented by (usually scaled) timer + * @return Offset required so that time matches the current brightness + */ +uint8_t calc_fade_in_offset(const uint8_t time) { + static const uint8_t max_steps = UINT8_MAX/2; + static const uint8_t range_min = 0; + static const uint8_t range_max = RGB_MATRIX_MAXIMUM_BRIGHTNESS; + + // start at the right point in the sine curve + uint8_t time_offset = offset_for_time(time, PHASE_LOW); + + // find the right offset to match the current brightness + for (int i = 1; i < max_steps; i++) { + const uint8_t value = scaled_sin(time + time_offset + 1, range_min, range_max); + if (in_range(value, range_min, range_max) && value < rgb_matrix_config.hsv.v) { + time_offset++; + } else { + break; + } + } + + return time_offset; +} + +/** + * @brief Increases value/brightness until reaching RGB_MATRIX_MAXIMUM_BRIGHTNESS based on given timer. + * @param[in] time A (usually scaled) timer + * @return Returns `true` if RGB_MATRIX_MAXIMUM_BRIGHTNESS has been reached, `false` otherwise. + */ +bool fade_in(const uint8_t time) { + static const uint8_t range_min = 0; + static const uint8_t range_max = RGB_MATRIX_MAXIMUM_BRIGHTNESS; + + return fade_in_ranged(time, range_min, range_max); +} +#endif + +#if defined(RGB_DISABLE_WITH_FADE_OUT) || defined(RGB_IDLE_TIMEOUT) +/** + * @brief Calculates the time offset required by fade out. + * @details Using an arbitrary timer any point on the Sinus curve might be pointed to. + * The offest is calculated so that + * a) the point is at the highest point in the curve and the curve is failing + * b) the point is near the current brightness (eg. fade out might be called while on breath effect). + * @param[in] time Current time usually represented by a(usually scaled) timer + * @return Offset required so that time matches the current brightness + */ +uint8_t calc_fade_out_offset(const uint8_t time) { + static const uint8_t range_min = 0; + static const uint8_t range_max = RGB_MATRIX_MAXIMUM_BRIGHTNESS; + + // start at the right point in the sin() curve + uint8_t time_offset = offset_for_time(time, PHASE_HIGH); + + // find the right offset to match the current brightness + for (int i = 1; i < 127; i++) { + const uint8_t value = scaled_sin(time + time_offset + 1, range_min, range_max); + if (in_range(value, range_min, range_max) && rgb_matrix_config.hsv.v < value) { + time_offset++; + } else { + break; + } + } + + return time_offset; +} +#endif + +#if defined(RGB_DISABLE_WITH_FADE_OUT) +/** + * @brief Decreases value/brightness until reaching 0 based on given timer. + * @param[in] time A (usually scaled) timer + * @return Returns `true` if 0 has been reached, `false` otherwise. + */ +bool fade_out(const uint8_t time) { + static const uint8_t range_min = 0; + static const uint8_t range_max = RGB_MATRIX_MAXIMUM_BRIGHTNESS; + + return fade_out_ranged(time, range_min, range_max); +} +#endif + +#if defined(RGB_IDLE_TIMEOUT) +/** + * @brief Decreases value/brightness until reaching `RGB_IDLE_MINIMUM_BRIGHTNESS` based on given timer. + * @param[in] time A (usually scaled) timer + * @return Returns `true` if `RGB_IDLE_MINIMUM_BRIGHTNESS` has been reached, `false` otherwise. + */ +bool idle_fade_out(const uint8_t time) { + static const uint8_t range_min = RGB_IDLE_MINIMUM_BRIGHTNESS; + static const uint8_t range_max = RGB_MATRIX_MAXIMUM_BRIGHTNESS; + + return fade_out_ranged(time, range_min, range_max); +} + +#if defined(RGB_IDLE_BREATHE) +/** + * @brief Changes value/brightness to create a breathing effect based on given timer. + * @details Brightness will breathe in the range starting from `RGB_IDLE_MINIMUM_BRIGHTNESS` to `RGB_IDLE_MAXIMUM_BRIGHTNESS`. + * @param[in] time A (usually scaled) timer + */ +void idle_breathe(const uint8_t time) { + static const uint8_t range_min = RGB_IDLE_MINIMUM_BRIGHTNESS; + static const uint8_t range_max = RGB_IDLE_MAXIMUM_BRIGHTNESS; + + rgb_matrix_config.hsv.v = scaled_sin(time, range_min, range_max); +} +#endif // RGB_IDLE_BREATHE +#endif // RGB_IDLE_TIMEOUT diff --git a/users/vitoni/rgb_matrix_effects.h b/users/vitoni/rgb_matrix_effects.h new file mode 100644 index 000000000000..ed74500b1827 --- /dev/null +++ b/users/vitoni/rgb_matrix_effects.h @@ -0,0 +1,174 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +/** + * States reflecting the state of the keyboard. + * Dependeing on these states various effects can set for the RGB matrix. + */ +enum states { + REGULAR //!< when in regular use +#if defined(RGB_IDLE_TIMEOUT) + ,IDLE_FADE_OUT //!< when started idling + ,IDLE //!< when idling +#endif +#if defined(RGB_FADE_IN) || defined(RGB_IDLE_TIMEOUT) + ,FADE_IN //!< when starting initially or before going back to REGULAR +#endif +#if defined(RGB_DISABLE_WITH_FADE_OUT) + ,FADE_OUT //!< before supending +#endif + ,SUSPENDED //!< expecting to be suspended by RGB_DISABLE_TIMEOUT any time +}; + +/** + * @brief Scales down `g_rgb_timer` so that it can be used for RGB effects. + * @details Usually these calculations aredone internally by some RGB effects. + This method exposed to scaling so that all effects to have same timebase. If `rgb_matrix_config.speed` all effects are affected the same. + * @param[in] factor The factor can be used to speed up some operations in relation to others. + * @return scaled down timer taking into account the given factor + * @see g_rgb_timer + * @see rgb_matrix_config.speed + */ +uint8_t rgb_time_2_scale_w_factor(const uint8_t factor); + +/** + * @brief Scales down `g_rgb_timer` so that it can be used for RGB effects. + * @return scaled down timer + * @see rgb_time_2_scale_w_factor() + */ +uint8_t rgb_time_2_scale(void); + +/** + * @brief Inverse function to calculate time required to execute `timer` steps. + * @details This method allows calculation of the time needed to execute N `timer`steps. + Usefull when using a scaled down time but requiring the time needed to perform these steps. + * @param[in] scaled_time scaled down timer to inverse to time + * @return time corresponding to scaled down time + * @see rgb_time_2_scale() + */ +uint16_t scale_2_rgb_time(const uint8_t scaled_time); + +/** + * @brief Convenience method to eventually skip the value part when setting HSV. + * @details When setting HSV this includes the value/brightness. + As changing brightness might interfer with fading or breathing effects, + this method can skip the value part of HSV (depending on the preprocessor flag: RGB_FADE_IN). + * @param[in] hue Hue + * @param[in] sat Saturation + * @param[in] hue Value (brightness) + * @see rgb_matrix_sethsv_noeeprom() + */ +void rgb_matrix_sethsv_noeeprom_user(const uint16_t hue, const uint8_t sat, const uint8_t val); + +#if defined(RGB_FADE_IN) || defined(RGB_DISABLE_WITH_FADE_OUT) || defined(RGB_IDLE_TIMEOUT) +# if defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) +# if (RGB_MATRIX_MAXIMUM_BRIGHTNESS) < 1 +# error "RGB_MATRIX_MAXIMUM_BRIGHTNESS must not be less than ONE" +# endif +# if UINT8_MAX < (RGB_MATRIX_MAXIMUM_BRIGHTNESS) +# error "RGB_MATRIX_MAXIMUM_BRIGHTNESS must not be larger than UINT8_MAX" +# endif +# else +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +# endif +#endif + +#if defined(RGB_FADE_IN) || defined(RGB_IDLE_TIMEOUT) +/** + * @brief Calculates the time offset required by fade in. + * @details Using an arbitrary timer any point on the sine curve might be pointed to. + * The offset is calculated so that + * a) the point is at the lowest point in the curve and the curve is raising + * b) the point is near the current brightness (eg. fade in might be called while fading out and the lowest value has not yet been reached). + * @param[in] time Current time usually represented by a(usually scaled) timer + * @return Offset required so that time matches the current brightness + */ +uint8_t calc_fade_in_offset(const uint8_t time); + +/** + * @brief Increases value/brightness until reaching RGB_MATRIX_MAXIMUM_BRIGHTNESS based on given timer. + * @param[in] time A (usually scaled) timer + * @return Returns `true` if RGB_MATRIX_MAXIMUM_BRIGHTNESS has been reached, `false` otherwise. + */ +bool fade_in(const uint8_t time); +#endif + +#if defined(RGB_DISABLE_WITH_FADE_OUT) +# if !defined(RGB_DISABLE_TIMEOUT) +# warning "RGB_DISABLE_WITH_FADE_OUT expects RGB_DISABLE_TIMEOUT to be defined" +# endif +#endif + +#if defined(RGB_DISABLE_WITH_FADE_OUT) || defined(RGB_IDLE_TIMEOUT) +/** + * @brief Calculates the time offset required by fade out. + * @details Using an arbitrary timer any point on the Sinus curve might be pointed to. + * The offest is calculated so that + * a) the point is at the highest point in the curve and the curve is failing + * b) the point is near the current brightness (eg. fade out might be called while on breath effect). + * @param[in] time Current time usually represented by a(usually scaled) timer + * @return Offset required so that time matches the current brightness + */ +uint8_t calc_fade_out_offset(const uint8_t time); +#endif + +#if defined(RGB_DISABLE_WITH_FADE_OUT) +/** + * @brief Decreases value/brightness until reaching 0 based on given timer. + * @param[in] time A (usually scaled) timer + * @return Returns `true` if 0 has been reached, `false` otherwise. + */ +bool fade_out(const uint8_t time); +#endif + +#if defined(RGB_IDLE_TIMEOUT) +# if RGB_IDLE_TIMEOUT < 0 +# error "RGB_IDLE_TIMEOUT must not be less than ZERO" +# endif +# if !defined(RGB_IDLE_MINIMUM_BRIGHTNESS) + // minimum brightness when idling +# define RGB_IDLE_MINIMUM_BRIGHTNESS (RGB_MATRIX_MAXIMUM_BRIGHTNESS/5) +# endif +# if RGB_IDLE_MINIMUM_BRIGHTNESS < 0 +# error "RGB_IDLE_MINIMUM_BRIGHTNESS must not be less than ZERO" +# endif // RGB_IDLE_MINIMUM_BRIGHTNESS < 0 +# if RGB_MATRIX_MAXIMUM_BRIGHTNESS <= RGB_IDLE_MINIMUM_BRIGHTNESS +# error "RGB_IDLE_MINIMUM_BRIGHTNESS must be less than RGB_MATRIX_MAXIMUM_BRIGHTNESS" +# endif // RGB_MATRIX_MAXIMUM_BRIGHTNESS <= RGB_IDLE_MINIMUM_BRIGHTNESS + +/** + * @brief Decreases value/brightness until reaching `RGB_IDLE_MINIMUM_BRIGHTNESS` based on given timer. + * @param[in] time A (usually scaled) timer + * @return Returns `true` if `RGB_IDLE_MINIMUM_BRIGHTNESS` has been reached, `false` otherwise. + */ +bool idle_fade_out(const uint8_t time); + +#if defined(RGB_IDLE_BREATHE) +# if !defined(RGB_IDLE_MAXIMUM_BRIGHTNESS) + // maximum brightness when idling +# define RGB_IDLE_MAXIMUM_BRIGHTNESS (RGB_MATRIX_MAXIMUM_BRIGHTNESS*3/5) +# endif +# if !(0 <= RGB_IDLE_MAXIMUM_BRIGHTNESS) +# error "RGB_IDLE_MINIMUM_BRIGHTNESS must not be less than ZERO, was: " RGB_IDLE_MAXIMUM_BRIGHTNESS +# endif // RGB_IDLE_MAXIMUM_BRIGHTNESS < 0 +# if !(RGB_IDLE_MINIMUM_BRIGHTNESS < RGB_IDLE_MAXIMUM_BRIGHTNESS) +# error "RGB_IDLE_MINIMUM_BRIGHTNESS must be less than RGB_IDLE_MAXIMUM_BRIGHTNESS" +# endif // RGB_IDLE_MAXIMUM_BRIGHTNESS <= RGB_IDLE_MINIMUM_BRIGHTNESS +# if !(RGB_IDLE_MAXIMUM_BRIGHTNESS <= RGB_MATRIX_MAXIMUM_BRIGHTNESS) +# error "RGB_IDLE_MAXIMUM_BRIGHTNESS must be less than or equal to RGB_MATRIX_MAXIMUM_BRIGHTNESS" +# endif // RGB_MATRIX_MAXIMUM_BRIGHTNESS <= RGB_IDLE_MAXIMUM_BRIGHTNESS + +/** + * @brief Changes value/brightness to create a breathing effect based on given timer. + * @details Brightness will breathe in the range starting from `RGB_IDLE_MINIMUM_BRIGHTNESS` to `RGB_IDLE_MAXIMUM_BRIGHTNESS`. + * @param[in] time A (usually scaled) timer + */ +void idle_breathe(const uint8_t time); +#endif // RGB_IDLE_BREATHE + +#endif // RGB_IDLE_TIMEOUT diff --git a/users/vitoni/rules.mk b/users/vitoni/rules.mk new file mode 100644 index 000000000000..2f3b0d15e5da --- /dev/null +++ b/users/vitoni/rules.mk @@ -0,0 +1,4 @@ +SRC += \ + vitoni.c \ + utils.c \ + rgb_matrix_effects.c diff --git a/users/vitoni/utils.c b/users/vitoni/utils.c new file mode 100644 index 000000000000..fb011570e44f --- /dev/null +++ b/users/vitoni/utils.c @@ -0,0 +1,129 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "utils.h" + +#include + +/** +* @brief Changes `*value` to `new_value`. +* @param[in,out] value Pointer to variable to be changed. +* @param[in] new_value Value to be changed. +* @param[in,out] changed Flag indicating `*value` and `new_value` were different. +*/ +void update_value(uint8_t *value, const uint8_t new_value, bool *changed) { + if (new_value != (*value)) { + (*changed) = true; + (*value) = new_value; + } +} + +/** +* @brief Checks whether a value is in the given range. +* @param[in] value Value to be checked. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @return `true` if (range_min <= value <= range_max), `false` otherwise +*/ +bool in_range(const uint8_t value, const uint8_t range_min, const uint8_t range_max) { + return range_min <= value && value <= range_max; +} + +/** +* @brief Calculates the sine value based on sin8() and scales it to the given range (unsigned). +* +* Table of values for unscaled sin8() eg. a theta of 0 results to 128 and a theta of 255 (240+15) results to 125. + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + +---------------------------------------------------------------- + 0: 128 131 134 137 140 143 146 149 152 155 158 161 164 167 170 173 + 16: 177 179 182 184 187 189 192 194 197 200 202 205 207 210 212 215 + 32: 218 219 221 223 224 226 228 229 231 233 234 236 238 239 241 243 + 48: 245 245 246 246 247 248 248 249 250 250 251 251 252 253 253 254 + 64: 255 254 253 253 252 251 251 250 250 249 248 248 247 246 246 245 + 80: 245 243 241 239 238 236 234 233 231 229 228 226 224 223 221 219 + 96: 218 215 212 210 207 205 202 200 197 194 192 189 187 184 182 179 + 112: 177 173 170 167 164 161 158 155 152 149 146 143 140 137 134 131 + 128: 128 125 122 119 116 113 110 107 104 101 98 95 92 89 86 83 + 144: 79 77 74 72 69 67 64 62 59 56 54 51 49 46 44 41 + 160: 38 37 35 33 32 30 28 27 25 23 22 20 18 17 15 13 + 176: 11 11 10 10 9 8 8 7 6 6 5 5 4 3 3 2 + 192: 1 2 3 3 4 5 5 6 6 7 8 8 9 10 10 11 + 208: 11 13 15 17 18 20 22 23 25 27 28 30 32 33 35 37 + 224: 38 41 44 46 49 51 54 56 59 62 64 67 69 72 74 77 + 240: 79 83 86 89 92 95 98 101 104 107 110 113 116 119 122 125 +* +* @param[in] theta Angle (a full circle mapped to 0-255) used as input for sine calculation. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @return Calculated sine value mapped to the given range. +*/ +uint8_t scaled_sin(const uint8_t theta, const uint8_t range_min, const uint8_t range_max) { + const uint8_t range = range_max - range_min; + return scale8(sin8(theta), range) + range_min; +} + +/** +* @brief Increases the given value until reaching range_max. +* The increments occur following an upwards sine wave (scaled from range_min to range_max). +* @param[in] theta Angle (a full circle mapped to 0-255) used as input for sine calculation. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @param[in] max_delta Maximum delta between value and range_max (due to values being integers and eventually not fully matching). +* @param[in,out] value Reference of variable to be increased +* @return `true` if value and range_max are within a delta of 3 (chosen by fair dice rolling), `false` otherwise +* @see scaled_sin() +*/ +bool scaled_sin_up(const uint8_t theta, const uint8_t range_min, const uint8_t range_max, const uint8_t max_delta, uint8_t *value) { + // ensure upper range bound + if (range_max <= (*value)) { + (*value) = range_max; + return true; + } + + const uint8_t new_value = scaled_sin(theta, range_min, range_max); + if (in_range(new_value, range_min, range_max) && (*value) < new_value) { + (*value) = new_value; + + return range_max == (*value); + } + + const uint8_t delta = range_max - (*value); + if (delta <= max_delta) { + (*value) = range_max; + } + + return delta <= max_delta; +} + +/** +* @brief Decreases the given value until reaching range_min. +* The decrements occur following an downwards sinus wave (scaled from range_min to range_max). +* @param[in] theta Angle (a full circle mapped to 0-255) used as input for sinus calculation. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @param[in] max_delta Maximum delta between value and range_min (due to values being integers and eventually not fully matching). +* @param[in,out] value Reference of variable to be decreased +* @return `true` if value and range_max are within a delta of 3 (chosen by fair dice rolling), `false` otherwise +* @see scaled_sin() +*/ +bool scaled_sin_down(const uint8_t theta, const uint8_t range_min, const uint8_t range_max, const uint8_t max_delta, uint8_t *value) { + // ensure lower range bound + if ((*value) <= range_min) { + (*value) = range_min; + return true; + } + + const uint8_t new_value = scaled_sin(theta, range_min, range_max); + if (in_range(new_value, range_min, range_max) && new_value < (*value)) { + (*value) = new_value; + + return range_min == (*value); + } + + const uint8_t delta = (*value) - range_min; + if (delta <= max_delta) { + (*value) = range_min; + } + + return delta <= max_delta; +} diff --git a/users/vitoni/utils.h b/users/vitoni/utils.h new file mode 100644 index 000000000000..987b612d5828 --- /dev/null +++ b/users/vitoni/utils.h @@ -0,0 +1,80 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +/** +* @brief Changes `*value` to `new_value`. +* @param[in,out] value Pointer to variable to be changed. +* @param[in] new_value Value to be changed. +* @param[in,out] changed Flag indicating `*value` and `new_value` were different. +*/ +void update_value(uint8_t *value, const uint8_t new_value, bool *changed); + +/** +* @brief Checks whether a value is in the given range. +* @param[in] value Value to be checked. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @return `true` if (range_min <= value <= range_max), `false` otherwise +*/ +bool in_range(const uint8_t value, const uint8_t range_min, const uint8_t range_max); + +/** +* @brief Calculates the sine value based on sin8() and scales it to the given range (unsigned). +* +* Table of values for unscaled sin8() eg. a theta of 0 results to 128 and a theta of 255 (240+15) results to 125. + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + +---------------------------------------------------------------- + 0: 128 131 134 137 140 143 146 149 152 155 158 161 164 167 170 173 + 16: 177 179 182 184 187 189 192 194 197 200 202 205 207 210 212 215 + 32: 218 219 221 223 224 226 228 229 231 233 234 236 238 239 241 243 + 48: 245 245 246 246 247 248 248 249 250 250 251 251 252 253 253 254 + 64: 255 254 253 253 252 251 251 250 250 249 248 248 247 246 246 245 + 80: 245 243 241 239 238 236 234 233 231 229 228 226 224 223 221 219 + 96: 218 215 212 210 207 205 202 200 197 194 192 189 187 184 182 179 + 112: 177 173 170 167 164 161 158 155 152 149 146 143 140 137 134 131 + 128: 128 125 122 119 116 113 110 107 104 101 98 95 92 89 86 83 + 144: 79 77 74 72 69 67 64 62 59 56 54 51 49 46 44 41 + 160: 38 37 35 33 32 30 28 27 25 23 22 20 18 17 15 13 + 176: 11 11 10 10 9 8 8 7 6 6 5 5 4 3 3 2 + 192: 1 2 3 3 4 5 5 6 6 7 8 8 9 10 10 11 + 208: 11 13 15 17 18 20 22 23 25 27 28 30 32 33 35 37 + 224: 38 41 44 46 49 51 54 56 59 62 64 67 69 72 74 77 + 240: 79 83 86 89 92 95 98 101 104 107 110 113 116 119 122 125 +* +* @param[in] theta Angle (a full circle mapped to 0-255) used as input for sine calculation. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @return Calculated sine value mapped to the given range. +*/ +uint8_t scaled_sin(const uint8_t theta, const uint8_t range_min, const uint8_t range_max); + +/** +* @brief Increases the given value until reaching range_max. +* The increments occur following an upwards sine wave (scaled from range_min to range_max). +* @param[in] theta Angle (a full circle mapped to 0-255) used as input for sine calculation. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @param[in] max_delta Maximum delta between value and range_max (due to values being integers and eventually not fully matching). +* @param[in,out] value Reference of variable to be increased +* @return `true` if value and range_max are within a delta of 3 (chosen by fair dice rolling), `false` otherwise +* @see scaled_sin() +*/ +bool scaled_sin_up(const uint8_t thea, const uint8_t range_min, const uint8_t range_max, const uint8_t max_delta, uint8_t *value); + +/** +* @brief Decreases the given value until reaching range_min. +* The decrements occur following an downwards sinus wave (scaled from range_min to range_max). +* @param[in] theta Angle (a full circle mapped to 0-255) used as input for sinus calculation. +* @param[in] range_min Lower bound of range (inclusive). +* @param[in] range_max Upper bound of range (inclusive). +* @param[in] max_delta Maximum delta between value and range_min (due to values being integers and eventually not fully matching). +* @param[in,out] value Reference of variable to be decreased +* @return `true` if value and range_max are within a delta of 3 (chosen by fair dice rolling), `false` otherwise +* @see scaled_sin() +*/ +bool scaled_sin_down(const uint8_t theta, const uint8_t range_min, const uint8_t range_max, const uint8_t max_delta, uint8_t *value); diff --git a/users/vitoni/vitoni.c b/users/vitoni/vitoni.c new file mode 100644 index 000000000000..2a0ff5c46f54 --- /dev/null +++ b/users/vitoni/vitoni.c @@ -0,0 +1,131 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "vitoni.h" + +#include +#include + +#include "rgb_matrix_effects.h" +#include "utils.h" + +#if defined(RGB_FADE_IN) || defined(RGB_DISABLE_WITH_FADE_OUT) || defined(RGB_IDLE_TIMEOUT) +static uint8_t state; + +// flag used to indicate that offset calculation is needed to adjust the timer, +// so that it matches the index used for sine calculation +static bool calc_offset; + +void matrix_scan_user_rgb(void) { +#if defined(RGB_DISABLE_WITH_FADE_OUT) || defined(RGB_IDLE_TIMEOUT) + const uint8_t time = rgb_time_2_scale(); +#endif + static uint8_t time_offset; + + const uint32_t inactivity_millis = last_input_activity_elapsed(); + +#if defined(RGB_IDLE_TIMEOUT) + if (IDLE != state && RGB_IDLE_TIMEOUT <= inactivity_millis) { + update_value(&state, IDLE_FADE_OUT, &calc_offset); + } +#endif +#if defined(RGB_DISABLE_WITH_FADE_OUT) + const uint32_t fade_out_duration = scale_2_rgb_time(128); + const uint32_t start_fade_out_after_millis = (RGB_DISABLE_TIMEOUT) > fade_out_duration + ? (RGB_DISABLE_TIMEOUT) - fade_out_duration + : 0; + + if (start_fade_out_after_millis <= inactivity_millis) { + update_value(&state, FADE_OUT, &calc_offset); + } +#elif defined(RGB_DISABLE_TIMEOUT) + // having to set brightness "manually" to black as starting point for fade in + // for the time when returning from suspended state + if (RGB_DISABLE_TIMEOUT <= inactivity_millis + 15) { + rgb_matrix_config.hsv.v = 0; + state = SUSPENDED; + } +#endif + + switch(state) { +#if defined(RGB_IDLE_TIMEOUT) + case IDLE_FADE_OUT: + if (calc_offset) { + time_offset = calc_fade_out_offset(time); + + // resetting flag for subsequent calls + calc_offset = false; + } + if (idle_fade_out(time + time_offset)) { + update_value(&state, IDLE, &calc_offset); + } + break; + case IDLE: +#if defined(RGB_IDLE_BREATHE) + if (calc_offset) { + // no need to calculate time_offset since we are aligned already due to IDLE_FADE_OUT + // resetting flag for subsequent calls + calc_offset = false; + } + idle_breathe(time + time_offset); +#endif + break; +#endif +#if defined(RGB_DISABLE_WITH_FADE_OUT) + case FADE_OUT: + if (calc_offset) { + time_offset = calc_fade_out_offset(time); + + // resetting flag for subsequent calls + calc_offset = false; + } + if (fade_out(time + time_offset)) { + update_value(&state, SUSPENDED, &calc_offset); + } + break; +#endif +#if defined(RGB_FADE_IN) || defined(RGB_IDLE_TIMEOUT) + case FADE_IN: + { + // since we want to be active, fade in should be faster than e.g. fading out + const uint8_t fade_in_time = rgb_time_2_scale_w_factor(4); + if (calc_offset) { + time_offset = calc_fade_in_offset(fade_in_time); + + // resetting flag for subsequent calls + calc_offset = false; + } + if (fade_in(fade_in_time + time_offset)) { + update_value(&state, REGULAR, &calc_offset); + } + } + break; +#endif + default: + break; + } +} + +#if defined(RGB_FADE_IN) || defined(RGB_IDLE_TIMEOUT) +bool process_record_user_rgb(const uint16_t keycode, const keyrecord_t *record) { + // if we are in a non regular state we might have faded out (eventually partially) + // so we restore brightness (to max as we don't keep track of manually changed brightness) + // if (REGULAR != state && FADE_IN != state) { + if (FADE_IN != state && REGULAR != state) { + update_value(&state, FADE_IN, &calc_offset); + } + + return true; // Process all other keycodes normally +} + +void suspend_wakeup_init_user(void) { + if (FADE_IN != state) { + // setting brightness to black as starting point for fade in + rgb_matrix_config.hsv.v = 0; + + update_value(&state, FADE_IN, &calc_offset); + } +} +#endif // defined(RGB_FADE_IN) + +#endif // defined(RGB_FADE_IN) || defined(RGB_DISABLE_WITH_FADE_OUT) diff --git a/users/vitoni/vitoni.h b/users/vitoni/vitoni.h new file mode 100644 index 000000000000..1f2603713570 --- /dev/null +++ b/users/vitoni/vitoni.h @@ -0,0 +1,30 @@ +// Copyright 2021 Victor Toni (@vitoni) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include +#include + +#include + +#include "rgb_matrix_effects.h" + +/** + * @brief Executes periodic tasks, eg. fading or checking for upcoming supend. + * @details Function declaration as weak as the implementation might "disappear" depending on the RGB settings used. + * The weak declaration avoids having to change `keymap.c`. + */ +__attribute__((weak)) +void matrix_scan_user_rgb(void); + +/** + * @brief Executes tasks based on user activity, eg. fading in. + * @details Function declaration as weak as the implementation might "disappear" depending on the RGB settings used. + * The weak declaration avoids having to change `keymap.c`. + * @param[in] keycode + * @param[in] record + * @return `false` if further processing should be stopped, `true` otherwise + */ +__attribute__((weak)) +bool process_record_user_rgb(const uint16_t keycode, const keyrecord_t *record); diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index 410803512d71..de4decf78a3f 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -22,7 +22,7 @@ ifeq ($(strip $(BT)), yes) OPT_DEFS += -DBLUEFRUIT #Adafruit Bluefruit controller settings BLUETOOTH_ENABLE = yes - BLUETOOTH_DRIVER = AdafruitBLE + BLUETOOTH_DRIVER = BluefruitLE F_CPU = 8000000 CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/util/docker_cmd.sh b/util/docker_cmd.sh new file mode 100755 index 000000000000..2ea113d24a6d --- /dev/null +++ b/util/docker_cmd.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# NOTE: This script uses tabs for indentation + +errcho() { + echo "$@" >&2 +} + +USAGE="Usage: $0 " + +# Check preconditions +for arg; do + if [ "$arg" = "--help" ]; then + echo "$USAGE" + exit 0 + fi +done + +# Allow $RUNTIME to be overriden by the user as an environment variable +# Else check if either docker or podman exit and set them as runtime +# if none are found error out +if [ -z "$RUNTIME" ]; then + if command -v docker >/dev/null 2>&1; then + RUNTIME="docker" + elif command -v podman >/dev/null 2>&1; then + RUNTIME="podman" + else + errcho "Error: no compatible container runtime found." + errcho "Either podman or docker are required." + errcho "See https://podman.io/getting-started/installation" + errcho "or https://docs.docker.com/install/#supported-platforms" + errcho "for installation instructions." + exit 2 + fi +fi + + +# IF we are using docker on non Linux and docker-machine isn't working print an error +# ELSE set usb_args +if [ ! "$(uname)" = "Linux" ] && [ "$RUNTIME" = "docker" ] && ! docker-machine active >/dev/null 2>&1; then + errcho "Error: target requires docker-machine to work on your platform" + errcho "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" + exit 3 +else + usb_args="--privileged -v /dev:/dev" +fi +dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows + +if [ "$RUNTIME" = "docker" ]; then + uid_arg="--user $(id -u):$(id -g)" +fi + +# Run container and build firmware +"$RUNTIME" run --rm -it \ + $usb_args \ + $uid_arg \ + -w /qmk_firmware \ + -v "$dir":/qmk_firmware \ + qmkfm/qmk_cli \ + "$@" diff --git a/util/new_keyboard.sh b/util/new_keyboard.sh deleted file mode 100755 index 62e8cb9e133c..000000000000 --- a/util/new_keyboard.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env bash - -# This script generates a new keyboard directory under keyboards/, -# and copies the template files from data/templates/ into it. - -# Print an error message with the word "ERROR" in red. -echo_error() { - echo -e "[\033[0;91mERROR\033[m]: $1" -} - -# Print a message in bold. -echo_bold() { - echo -e "\033[1m$1\033[m" -} - -# Prompt the user for information, showing the default value in brackets. -prompt() { - local message="$1" - local default="$2" - - [ -n "$default" ] && message+=" [$default]" - message+=": " - - read -rp "$message" prompt_return - [ -z "$prompt_return" ] && prompt_return="$default" -} - -# Grab a username from Git config. -set_git_username() { - git_username="$(git config --get user.name)" -} - -# Copy the template files to the new keyboard directory. -copy_templates() { - mkdir -p "$keyboard_dir" - - echo -n "Copying base template files..." - cp -r "data/templates/base/." "${keyboard_dir}" - echo " done" - - echo -n "Copying $keyboard_type template files..." - cp -r "data/templates/${keyboard_type}/." "${keyboard_dir}" - echo " done" - - echo -n "Renaming keyboard files..." - mv "${keyboard_dir}/keyboard.c" "${keyboard_dir}/${keyboard_base_name}.c" - mv "${keyboard_dir}/keyboard.h" "${keyboard_dir}/${keyboard_base_name}.h" - echo " done" -} - -# Set the inplace editing parameter for sed. -# macOS/BSD sed expects a file extension immediately following -i. -set_sed_i() { - sed_i=(-i) - - case $(uname -a) in - *Darwin*) sed_i=(-i "") - esac -} - -# Replace a token with a value in the given list of files. -replace_placeholders() { - local replace_token="$1" - local replace_value="$2" - shift 2 - local replace_filenames=("$@") - - echo -n "Replacing $replace_token with $replace_value..." - for replace_filename in "${replace_filenames[@]}"; do - sed "${sed_i[@]}" -e "s/${replace_token}/${replace_value}/g" "$replace_filename" - done - echo " done" -} - -# Replace %YEAR% with the current year. -replace_year_placeholders() { - local replace_year_filenames=( - "${keyboard_dir}/config.h" - "${keyboard_dir}/${keyboard_base_name}.c" - "${keyboard_dir}/${keyboard_base_name}.h" - "${keyboard_dir}/keymaps/default/keymap.c" - ) - replace_placeholders "%YEAR%" "$(date +%Y)" "${replace_year_filenames[@]}" -} - -# Replace %KEYBOARD% with the keyboard name. -replace_keyboard_placeholders() { - local replace_keyboard_filenames=( - "${keyboard_dir}/config.h" - "${keyboard_dir}/info.json" - "${keyboard_dir}/readme.md" - "${keyboard_dir}/${keyboard_base_name}.c" - "${keyboard_dir}/keymaps/default/readme.md" - ) - replace_placeholders "%KEYBOARD%" "$keyboard_base_name" "${replace_keyboard_filenames[@]}" -} - -# Replace %YOUR_NAME% with the username. -replace_name_placeholders() { - local replace_name_filenames=( - "${keyboard_dir}/config.h" - "${keyboard_dir}/info.json" - "${keyboard_dir}/readme.md" - "${keyboard_dir}/${keyboard_base_name}.c" - "${keyboard_dir}/${keyboard_base_name}.h" - "${keyboard_dir}/keymaps/default/keymap.c" - ) - replace_placeholders "%YOUR_NAME%" "$username" "${replace_name_filenames[@]}" -} - -# Check if an array contains an element. -array_contains() { - local e match="$1" - shift - for e; do - [[ "$e" == "$match" ]] && return 0; - done - - return 1 -} - -# If we've been started from util/, we want to be in qmk_firmware/ -[[ "$PWD" == *util ]] && cd .. - -# The root qmk_firmware/ directory should have a subdirectory called quantum/ -if [ ! -d "quantum" ]; then - echo_error "Could not detect the QMK firmware directory!" - echo_error "Are you sure you're in the right place?" - exit 1 -fi - -echo_bold "########################################" -echo_bold "# NOTICE #" -echo_bold "# This script has been deprecated. #" -echo_bold "# Please use qmk new-keyboard instead. #" -echo_bold "########################################" -echo -echo_bold "Generating a new QMK keyboard directory" -echo - -# Keyboard name is required, so keep prompting until we get one -while [ -z "$keyboard_name" ]; do - prompt "Keyboard Name" "" - keyboard_name=$prompt_return - keyboard_base_name=$(basename $keyboard_name) -done - -keyboard_dir="keyboards/$keyboard_name" - -if [ -d "$keyboard_dir" ]; then - echo_error "Keyboard $keyboard_name already exists!" - exit 1 -fi - -KEYBOARD_TYPES=("avr" "ps2avrgb") - -prompt "Keyboard Type" "avr" -keyboard_type=$prompt_return - -if ! array_contains "$keyboard_type" "${KEYBOARD_TYPES[@]}"; then - echo_error "Keyboard type must be one of: ${KEYBOARD_TYPES[*]}" - exit 1 -fi - -set_git_username -prompt "Your Name" "$git_username" -username=$prompt_return - -echo - -copy_templates -set_sed_i -replace_year_placeholders -replace_keyboard_placeholders -[ -n "$username" ] && replace_name_placeholders - -echo -echo_bold "Created a new keyboard called $keyboard_name." -echo -echo_bold "To start working on things, cd into keyboards/$keyboard_name," -echo_bold "or open the directory in your favourite text editor." diff --git a/util/new_keymap.sh b/util/new_keymap.sh deleted file mode 100755 index c483314fdb06..000000000000 --- a/util/new_keymap.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Script to make a new keymap for a keyboard of your choosing -# This script automates the copying of the default keymap into -# your own keymap - -KB_PATH=$(echo "$1" | tr 'A-Z' 'a-z') -USERNAME=$(echo "$2" | tr 'A-Z' 'a-z') - -if [ -z "$KB_PATH" ]; then - printf "Usage: %s \n" "$0" - printf "Example: %s 1upkeyboards/1up60hse yourname\n" "$0" - exit 1 -fi - -if [ -z "$USERNAME" ]; then - printf "Usage: %s \n" "$0" - printf "Example: %s 1upkeyboards/1up60hse yourname\n" "$0" - exit 1 -fi - -cd "$(dirname "$0")/.." - -if [ ! -d "keyboards/$KB_PATH" ]; then - printf "Error! keyboards/%s does not exist!\n" "$KB_PATH" - exit 1 -fi - -if [ -d "keyboards/$KB_PATH/keymaps/$USERNAME" ]; then - printf "Error! keyboards/%s/keymaps/%s already exists!\n" "$KB_PATH" "$USERNAME" - exit 1 -fi - -# Recursively copy the chosen keyboard's default keymap -cp -r keyboards/"$KB_PATH"/keymaps/default keyboards/"$KB_PATH"/keymaps/"$USERNAME" - -printf "%s keymap directory created in: qmk_firmware/keyboards/%s/keymaps/\n\n" "$USERNAME" "$KB_PATH" - -printf "Compile a firmware file with your new keymap by typing: \n" -printf " make %s:%s\n" "$KB_PATH" "$USERNAME" -printf "from the qmk_firmware directory\n" diff --git a/util/size_regression.sh b/util/size_regression.sh index 988d1d9b5bed..d474d8d0d5f4 100755 --- a/util/size_regression.sh +++ b/util/size_regression.sh @@ -11,6 +11,8 @@ dest_ref="develop" ignore_ref="master" unset skip_zero +export SIZE_REGRESSION_EXECUTING=1 + function usage() { echo "Usage: $(basename "$0") [-h] [-j ] [-s ] [-d ] [-n] planck/rev6:default" echo " -h : Shows this usage page." @@ -23,9 +25,24 @@ function usage() { } if [[ ${#} -eq 0 ]]; then - usage + usage + exit 0 fi +unset cleanup_completed +_internal_cleanup() { + if [[ -z "${cleanup_completed:-}" ]] ; then + echo + echo + echo 'Your git repository is in an indeterminate state!' >&2 + echo 'Make sure you swap to your intended branch.' >&2 + echo + unset SIZE_REGRESSION_EXECUTING + fi + cleanup_completed=1 +} +trap _internal_cleanup EXIT HUP INT + while getopts "hj:s:d:i:n" opt "$@" ; do case "$opt" in h) usage; exit 0;; @@ -49,7 +66,8 @@ function build_executor() { revision=$(echo $line | cut -d' ' -f1) make distclean >/dev/null 2>&1 - git checkout $revision >/dev/null 2>&1 || { echo "Failed to check out revision ${revision}" >&2 ; exit 1 ; } + + git checkout -f $revision >/dev/null 2>&1 || { echo "Failed to check out revision ${revision}" >&2 ; exit 1 ; } make -j${job_count} $keyboard_target >/dev/null 2>&1 || true file_size=$(arm-none-eabi-size .build/*.elf 2>/dev/null | awk '/elf/ {print $1}' 2>/dev/null || true) diff --git a/util/update_chibios_mirror.sh b/util/update_chibios_mirror.sh index 0bf648ebfd27..e6666c55c9fd 100755 --- a/util/update_chibios_mirror.sh +++ b/util/update_chibios_mirror.sh @@ -4,13 +4,13 @@ # Configuration # The ChibiOS branches to mirror -chibios_branches="trunk stable_20.3.x stable_21.6.x" +chibios_branches="trunk stable_20.3.x stable_21.11.x" # The ChibiOS tags to mirror -chibios_tags="ver20.3.1 ver20.3.2 ver20.3.3 ver20.3.4 ver21.6.0" +chibios_tags="ver20.3.1 ver20.3.2 ver20.3.3 ver20.3.4 ver21.11.1" # The ChibiOS-Contrib branches to mirror -contrib_branches="chibios-20.3.x chibios-21.6.x" +contrib_branches="chibios-20.3.x chibios-21.11.x" ################################ # Actions @@ -88,5 +88,5 @@ echo "Updating ChibiOS-Contrib branches..." for branch in $contrib_branches ; do echo "Creating branch 'mirror/$branch' from 'upstream/$branch'..." git branch -f mirror/$branch upstream/$branch \ - && git push qmk mirror/$branch + && git push qmk mirror/$branch || true # Allow for nonexistent ChibiOS-Contrib branches -- they'll turn up eventually. done