diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..92dfc3c61 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,94 @@ +# auto for anything unspecified +* text=auto + +# sources +*.c text +*.cc text +*.cxx text +*.cpp text +*.c++ text +*.hpp text +*.h text +*.h++ text +*.hh text +*.bat text +*.coffee text +*.css text +*.htm text +*.html text +*.inc text +*.ini text +*.js text +*.jsx text +*.json text +*.less text +*.php text +*.pl text +*.py text +*.rb text +*.sass text +*.scm text +*.scss text +*.sh text +*.sql text +*.styl text +*.ts text +*.xml text +*.xhtml text + +# make files (need to always use lf for compatibility with Windows 10 bash) +Makefile eol=lf +*.mk eol=lf + +# make files (need to always use lf for compatibility with Windows 10 bash) +*.sh eol=lf + +# documentation +*.markdown text +*.md text +*.mdwn text +*.mdown text +*.mkd text +*.mkdn text +*.mdtxt text +*.mdtext text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +GRAPHICS +*.ai binary +*.bmp binary +*.eps binary +*.gif binary +*.ico binary +*.jng binary +*.jp2 binary +*.jpg binary +*.jpeg binary +*.jpx binary +*.jxr binary +*.pdf binary +*.png binary +*.psb binary +*.psd binary +*.svg text +*.svgz binary +*.tif binary +*.tiff binary +*.wbmp binary +*.webp binary + +# hex files +*.hex binary +*.eep binary diff --git a/.gitignore b/.gitignore index 849143352..07bbf13db 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ build/ .build/ *.bak .vagrant/ +quantum/version.h .idea/ CMakeLists.txt .DS_STORE @@ -26,4 +27,5 @@ CMakeLists.txt .project .settings/ .idea -.browse.VC.db* \ No newline at end of file +.browse.VC.db* +*.stackdump diff --git a/.gitmodules b/.gitmodules index 7e3c92d03..12b7cb918 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "lib/ugfx"] path = lib/ugfx url = https://bitbucket.org/Tectu/ugfx +[submodule "lib/googletest"] + path = lib/googletest + url = https://github.com/google/googletest diff --git a/.travis.yml b/.travis.yml index 26deac0ce..e74744a96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,11 @@ branches: env: global: - secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM= + matrix: + - TARGET=all-keyboards AUTOGEN=true + - TARGET=test AUTOGEN=false script: -- make all-keyboards-quick AUTOGEN=true +- make $TARGET AUTOGEN=$AUTOGEN addons: apt: packages: @@ -21,4 +24,8 @@ addons: - gcc-arm-none-eabi - binutils-arm-none-eabi - libnewlib-arm-none-eabi -after_success: bash util/travis_compiled_push.sh + - diffutils +after_success: + if [ "$AUTOGEN" == "true" ]; then + bash util/travis_compiled_push.sh; + fi diff --git a/Dockerfile b/Dockerfile index 96ace4ec6..578d009dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apt-get install --no-install-recommends -y build-essential \ RUN apt-get clean RUN rm -rf /var/lib/apt/lists/* -ENV keyboard=ergodox_ez +ENV keyboard=ergodox ENV keymap=default VOLUME /qmk diff --git a/Makefile b/Makefile index 980ab26b2..0aaf58578 100644 --- a/Makefile +++ b/Makefile @@ -2,267 +2,518 @@ ifndef VERBOSE .SILENT: endif -.DEFAULT_GOAL := all +# Never run this makefile in parallel, as it could screw things up +# It won't affect the submakes, so you still get the speedup from specifying -jx +.NOTPARALLEL: -space := $(subst ,, ) -starting_makefile := $(subst $(space),_SPACE_,$(abspath $(firstword $(MAKEFILE_LIST)))) -mkfile_path := $(subst $(space),_SPACE_,$(abspath $(lastword $(MAKEFILE_LIST)))) -abs_tmk_root := $(patsubst %/,%,$(dir $(mkfile_path))) - -ifneq (,$(findstring /keyboards/,$(starting_makefile))) - possible_keyboard:=$(patsubst %/,%,$(dir $(patsubst $(abs_tmk_root)/keyboards/%,%,$(starting_makefile)))) - ifneq (,$(findstring /keymaps/,$(possible_keyboard))) - KEYMAP_DIR:=$(lastword $(subst /keymaps/, ,$(possible_keyboard))) - KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard))) - ifneq (,$(findstring /,$(KEYBOARD_DIR))) - # SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR))) - # KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR))) - tmk_root = ../../.. - else - tmk_root = ../../../.. - endif - else - KEYMAP_DIR:=default - KEYBOARD_DIR:=$(possible_keyboard) - ifneq (,$(findstring /,$(KEYBOARD_DIR))) - # SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR))) - # KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR))) - tmk_root = ../../.. - else - tmk_root = ../.. - endif - endif -else - tmk_root = . +# Allow the silent with lower caps to work the same way as upper caps +ifdef silent + SILENT = $(silent) endif -# $(info $(KEYBOARD_DIR)) -# $(info $(KEYMAP_DIR)) -# $(info $(SUBPROJECT_DIR)) -# Directory common source filess exist -TOP_DIR = $(tmk_root) -TMK_DIR = tmk_core -TMK_PATH = $(TOP_DIR)/$(TMK_DIR) -LIB_PATH = $(TOP_DIR)/lib +ifdef SILENT + SUB_IS_SILENT := $(SILENT) +endif -QUANTUM_DIR = quantum -QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR) +# We need to make sure that silent is always turned off at the top level +# Otherwise the [OK], [ERROR] and [WARN] messags won't be displayed correctly +override SILENT := false +ON_ERROR := error_occured=1 +STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) +ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) +ROOT_DIR := $(dir $(ROOT_MAKEFILE)) +ifeq ($(ROOT_DIR),) + ROOT_DIR := . +endif +ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE)) +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)) +TEST_DIR := $(ROOT_DIR)/.build/test + +MAKEFILE_INCLUDED=yes + +# 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 beome 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)) + +# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct +# variables depending on which directory you stand in. +# It's really a very simple if else chain, if you squint enough, +# but the makefile syntax makes it very verbose. +# If we are in a subfolder of keyboards +ifeq ($(CURRENT_PATH_ELEMENT),keyboards) + $(eval $(call NEXT_PATH_ELEMENT)) + KEYBOARD := $(CURRENT_PATH_ELEMENT) + $(eval $(call NEXT_PATH_ELEMENT)) + # If we are in a subfolder of keymaps, or in other words in a keymap + # folder + ifeq ($(CURRENT_PATH_ELEMENT),keymaps) + $(eval $(call NEXT_PATH_ELEMENT)) + KEYMAP := $(CURRENT_PATH_ELEMENT) + # else if we are not in the keyboard folder itself + else ifneq ($(CURRENT_PATH_ELEMENT),) + # the we can assume it's a subproject, as no other folders + # should have make files in them + SUBPROJECT := $(CURRENT_PATH_ELEMENT) + $(eval $(call NEXT_PATH_ELEMENT)) + # if we are inside a keymap folder of a subproject + ifeq ($(CURRENT_PATH_ELEMENT),keymaps) + $(eval $(call NEXT_PATH_ELEMENT)) + KEYMAP := $(CURRENT_PATH_ELEMENT) + endif + endif +endif + +# Only consider folders with makefiles, to prevent errors in case there are extra folders +KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile))) + +#Compability with the old make variables, anything you specify directly on the command line +# always overrides the detected folders ifdef keyboard - KEYBOARD ?= $(keyboard) + KEYBOARD := $(keyboard) endif -ifdef KEYBOARD_DIR - KEYBOARD ?= $(KEYBOARD_DIR) -endif -ifndef KEYBOARD - KEYBOARD=planck -endif - -MASTER ?= left -ifdef master - MASTER = $(master) -endif - - -# converts things to keyboards/subproject -ifneq (,$(findstring /,$(KEYBOARD))) - TEMP:=$(KEYBOARD) - KEYBOARD:=$(firstword $(subst /, ,$(TEMP))) - SUBPROJECT:=$(lastword $(subst /, ,$(TEMP))) -endif - -KEYBOARD_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD) - ifdef sub - SUBPROJECT=$(sub) + SUBPROJECT := $(sub) endif ifdef subproject - SUBPROJECT=$(subproject) + SUBPROJECT := $(subproject) endif - -ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","") - KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c - ifndef ARCH - ifneq ("$(wildcard $(KEYBOARD_PATH)/Makefile)","") - include $(KEYBOARD_PATH)/Makefile - endif - endif -else -$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist) -endif - -ifdef SUBPROJECT_DEFAULT - SUBPROJECT?=$(SUBPROJECT_DEFAULT) -endif - -ifdef SUBPROJECT - SUBPROJECT_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT) - ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") - OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) - SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c - -include $(SUBPROJECT_PATH)/Makefile - else -$(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist) - endif -endif - ifdef keymap - KEYMAP ?= $(keymap) -endif -ifdef KEYMAP_DIR - KEYMAP ?= $(KEYMAP_DIR) -endif -ifndef KEYMAP - KEYMAP = default -endif -KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP) -ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","") - KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c - -include $(KEYMAP_PATH)/Makefile -else - ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/keymap.c)","") -$(error "$(KEYMAP_PATH)/keymap.c" does not exist) - else - KEYMAP_PATH = $(SUBPROJECT_PATH)/keymaps/$(KEYMAP) - KEYMAP_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/keymap.c - -include $(KEYMAP_PATH)/Makefile - endif + KEYMAP := $(keymap) endif -ifdef SUBPROJECT - TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP) -else - TARGET ?= $(KEYBOARD)_$(KEYMAP) -endif -BUILD_DIR = .build - -# Object files directory -# To put object files in current directory, use a dot (.), do NOT make -# this an empty or blank macro! -OBJDIR = $(BUILD_DIR)/obj_$(TARGET) +# Uncomment these for debugging +#$(info Keyboard: $(KEYBOARD)) +#$(info Keymap: $(KEYMAP)) +#$(info Subproject: $(SUBPROJECT)) +#$(info Keyboards: $(KEYBOARDS)) - -ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") - CONFIG_H = $(KEYMAP_PATH)/config.h -else - CONFIG_H = $(KEYBOARD_PATH)/config.h - ifdef SUBPROJECT - ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") - CONFIG_H = $(SUBPROJECT_PATH)/config.h - endif - endif +# Set the default goal depening on where we are running make from +# this handles the case where you run make without any arguments +.DEFAULT_GOAL := all +ifneq ($(KEYMAP),) + ifeq ($(SUBPROJECT),) + # Inside a keymap folder, just build the keymap, with the + # default subproject + .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP) + else + # Inside a subproject keyamp folder, build the keymap + # for that subproject + .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-$(KEYMAP) + endif +else ifneq ($(SUBPROJECT),) + # Inside a subproject folder, build all keymaps for that subproject + .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-allkm +else ifneq ($(KEYBOARD),) + # Inside a keyboard folder, build all keymaps for all subprojects + # Note that this is different from the old behaviour, which would + # build only the default keymap of the default keyboard + .DEFAULT_GOAL := $(KEYBOARD)-allsp-allkm endif -# # project specific files -SRC += $(KEYBOARD_FILE) \ - $(KEYMAP_FILE) \ - $(QUANTUM_DIR)/quantum.c \ - $(QUANTUM_DIR)/keymap_common.c \ - $(QUANTUM_DIR)/keycode_config.c \ - $(QUANTUM_DIR)/process_keycode/process_leader.c -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif +# Compare the start of the RULE variable with the first argument($1) +# If the rules equals $1 or starts with $1-, RULE_FOUND is set to true +# and $1 is removed from the RULE variable +# Otherwise the RULE_FOUND variable is set to false, and RULE left as it was +# The function is a bit tricky, since there's no built in $(startswith) function +define COMPARE_AND_REMOVE_FROM_RULE_HELPER + ifeq ($1,$$(RULE)) + RULE:= + RULE_FOUND := true + else + STARTDASH_REMOVED=$$(subst START$1-,,START$$(RULE)) + ifneq ($$(STARTDASH_REMOVED),START$$(RULE)) + RULE_FOUND := true + RULE := $$(STARTDASH_REMOVED) + else + RULE_FOUND := false + endif + endif +endef -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifdef SUBPROJECT - SRC += $(SUBPROJECT_FILE) -endif - -ifndef CUSTOM_MATRIX - SRC += $(QUANTUM_DIR)/matrix.c -endif - -ifeq ($(strip $(MIDI_ENABLE)), yes) - OPT_DEFS += -DMIDI_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c -endif - -ifeq ($(strip $(AUDIO_ENABLE)), yes) - OPT_DEFS += -DAUDIO_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_music.c - SRC += $(QUANTUM_DIR)/audio/audio.c - SRC += $(QUANTUM_DIR)/audio/voices.c - SRC += $(QUANTUM_DIR)/audio/luts.c -endif - -ifeq ($(strip $(UNICODE_ENABLE)), yes) - OPT_DEFS += -DUNICODE_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c -endif - -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) - OPT_DEFS += -DRGBLIGHT_ENABLE - SRC += $(QUANTUM_DIR)/light_ws2812.c - SRC += $(QUANTUM_DIR)/rgblight.c -endif - -ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - OPT_DEFS += -DTAP_DANCE_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c -endif - -ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) - SERIAL_DIR = $(QUANTUM_DIR)/serial_link - SERIAL_PATH = $(QUANTUM_PATH)/serial_link - SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) - SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) - SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) - OPT_DEFS += -DSERIAL_LINK_ENABLE - VAPTH += $(SERIAL_PATH) -endif - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(KEYMAP_PATH) -ifdef SUBPROJECT - VPATH += $(SUBPROJECT_PATH) -endif -VPATH += $(KEYBOARD_PATH) -VPATH += $(TOP_DIR) -VPATH += $(TMK_PATH) -VPATH += $(QUANTUM_PATH) -VPATH += $(QUANTUM_PATH)/keymap_extras -VPATH += $(QUANTUM_PATH)/audio -VPATH += $(QUANTUM_PATH)/process_keycode +# This makes it easier to call COMPARE_AND_REMOVE_FROM_RULE, since it makes it behave like +# a function that returns the value +COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND) -# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA -ifdef MCU_FAMILY - PLATFORM=CHIBIOS -else - PLATFORM=AVR -endif +# 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 -include $(TMK_PATH)/common.mk -ifeq ($(PLATFORM),AVR) - include $(TMK_PATH)/protocol/lufa.mk - include $(TMK_PATH)/avr.mk -else ifeq ($(PLATFORM),CHIBIOS) - include $(TMK_PATH)/protocol/chibios.mk - include $(TMK_PATH)/chibios.mk - OPT_OS = chibios -else - $(error Unknown platform) -endif +# A recursive helper function for finding the longest match +# $1 The list to be checed +# It works by always removing the currently matched item from the list +# and call itself recursively, until a match is found +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 recursivel + 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 -ifeq ($(strip $(VISUALIZER_ENABLE)), yes) - VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer - VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer - include $(VISUALIZER_PATH)/visualizer.mk -endif -include $(TMK_PATH)/rules.mk +# Recursively try to find the longest 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),) + RULE_FOUND := true + RULE := $$(BEST_MATCH_RULE) + MATCHED_ITEM := $$(BEST_MATCH) + else + RULE_FOUND := false + MATCHED_ITEM := + endif +endef +# Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST +TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND) + +define ALL_IN_LIST_LOOP + OLD_RULE$1 := $$(RULE) + $$(eval $$(call $1,$$(ITEM$1))) + RULE := $$(OLD_RULE$1) +endef + +define PARSE_ALL_IN_LIST + $$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1))) +endef + +# The entry point for rule parsing +# parses a rule in the format --- +# but this particular function only deals with the first part +define PARSE_RULE + RULE := $1 + COMMANDS := + # If the rule starts with allkb, then continue the parsing from + # PARSE_ALL_KEYBOARDS + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true) + $$(eval $$(call PARSE_ALL_KEYBOARDS)) + else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true) + $$(eval $$(call PARSE_TEST)) + # If the rule starts with the name of a known keyboard, then continue + # the parsing from PARSE_KEYBOARD + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) + $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM))) + # Otherwise use the KEYBOARD variable, which is determined either by + # the current directory you run make from, or passed in as an argument + else ifneq ($$(KEYBOARD),) + $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD))) + else + $$(info make: *** No rule to make target '$1'. Stop.) + # Notice the tab instead of spaces below! + exit 1 + endif +endef + +# $1 = Keyboard +# Parses a rule in the format -- +# the keyboard is already known when entering this function +define PARSE_KEYBOARD + CURRENT_KB := $1 + # A subproject is any keyboard subfolder with a makefile + SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile))) + # if the rule starts with allsp, then continue with looping over all subprojects + ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true) + $$(eval $$(call PARSE_ALL_SUBPROJECTS)) + # A special case for matching the defaultsp (default subproject) + else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true) + $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) + # If the rule starts with the name of a known subproject + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true) + $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM))) + # Try to use the SUBPROJECT variable, which is either determined by the + # directory which invoked make, or passed as an argument to make + else ifneq ($$(SUBPROJECT),) + $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT))) + # If there's no matching subproject, we assume it's the default + # This will allow you to leave the subproject part of the target out + else + $$(eval $$(call PARSE_SUBPROJECT,)) + endif +endef + +# if we are going to compile all keyboards, match the rest of the rule +# for each of them +define PARSE_ALL_KEYBOARDS + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS))) +endef + +# $1 Subproject +# When entering this, the keyboard and subproject are known, so now we need +# to determine which keymaps are going to get compiled +define PARSE_SUBPROJECT + # If we want to compile the default subproject, then we need to + # include the correct makefile to determine the actual name of it + CURRENT_SP := $1 + ifeq ($$(CURRENT_SP),) + CURRENT_SP := defaultsp + endif + ifeq ($$(CURRENT_SP),defaultsp) + SUBPROJECT_DEFAULT= + $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile) + CURRENT_SP := $$(SUBPROJECT_DEFAULT) + endif + # If current subproject is empty (the default was not defined), and we have a list of subproject + # then make all of them + ifeq ($$(CURRENT_SP),) + ifneq ($$(SUBPROJECTS),) + CURRENT_SP := allsp + endif + endif + # The special allsp is handled later + ifneq ($$(CURRENT_SP),allsp) + # get a list of all keymaps + KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) + ifneq ($$(CURRENT_SP),) + # if the subproject is defined, then also look for keymaps inside the subproject folder + SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.))) + KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS)) + endif + # if the rule after removing the start of it is empty (we haven't specified a kemap or target) + # compile all the keymaps + ifeq ($$(RULE),) + $$(eval $$(call PARSE_ALL_KEYMAPS)) + # The same if allkm was specified + else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true) + $$(eval $$(call PARSE_ALL_KEYMAPS)) + # Try to match the specified keyamp with the list of known keymaps + else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true) + $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM))) + # Otherwise try to match the keymap from the current folder, or arguments to the make command + else ifneq ($$(KEYMAP),) + $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP))) + # No matching keymap found, so we assume that the rest of the rule is the target + # If we haven't been able to parse out a subproject, then make all of them + # This is consistent with running make without any arguments from the keyboard + # folder + else ifeq ($1,) + $$(eval $$(call PARSE_ALL_SUBPROJECTS)) + # Otherwise, make all keymaps, again this is consistent with how it works without + # any arguments + else + $$(eval $$(call PARSE_ALL_KEYMAPS)) + endif + else + # As earlier mentione,d when allsb is specified, we call our self recursively + # for all of the subprojects + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS))) + endif +endef + +# If we want to parse all subprojects, but the keyboard doesn't have any, +# then use defaultsp instead +define PARSE_ALL_SUBPROJECTS + ifeq ($$(SUBPROJECTS),) + $$(eval $$(call PARSE_SUBPROJECT,defaultsp)) + else + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS))) + endif +endef + +# $1 Keymap +# This is the meat of compiling a keyboard, when entering this, everything is known +# keyboard, subproject, and keymap +# Note that we are not directly calling the command here, but instead building a list, +# which will later be processed +define PARSE_KEYMAP + CURRENT_KM = $1 + # The rest of the rule is the target + # Remove the leading "-" from the target, as it acts as a separator + MAKE_TARGET := $$(patsubst -%,%,$$(RULE)) + # We need to generate an unique indentifer to append to the COMMANDS list + COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM) + # If we are compiling a keyboard without a subproject, we want to display just the name + # of the keyboard, otherwise keyboard/subproject + ifeq ($$(CURRENT_SP),) + KB_SP := $(CURRENT_KB) + else + KB_SP := $(CURRENT_KB)/$$(CURRENT_SP) + endif + # Format it in bold + KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) + # Specify the variables that we are passing forward to submake + MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM) + # And the first part of the make command + MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f 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 + # The true version for silent output and the false version otherwise + $$(eval $$(call BUILD)) +endef + +define BUILD + MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR) + COMMANDS += $$(COMMAND) + COMMAND_true_$$(COMMAND) := \ + printf "$$(MAKE_MSG)" | \ + $$(MAKE_MSG_FORMAT); \ + LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \ + if [ $$$$? -gt 0 ]; \ + then $$(PRINT_ERROR_PLAIN); \ + elif [ "$$$$LOG" != "" ] ; \ + then $$(PRINT_WARNING_PLAIN); \ + else \ + $$(PRINT_OK); \ + fi; + COMMAND_false_$$(COMMAND) := \ + printf "$$(MAKE_MSG)\n\n"; \ + $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; \ + if [ $$$$? -gt 0 ]; \ + then error_occured=1; \ + fi; +endef + +# Just parse all the keymaps for a specifc keyboard +define PARSE_ALL_KEYMAPS + $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) +endef + +define BUILD_TEST + TEST_NAME := $1 + MAKE_TARGET := $2 + COMMAND := $1 + MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET) + MAKE_VARS := TEST=$$(TEST_NAME) + MAKE_MSG := $$(MSG_MAKE_TEST) + $$(eval $$(call BUILD)) + ifneq ($$(MAKE_TARGET),clean) + TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf + TESTS += $$(TEST_NAME) + TEST_MSG := $$(MSG_TEST) + $$(TEST_NAME)_COMMAND := \ + printf "$$(TEST_MSG)\n"; \ + $$(TEST_EXECUTABLE); \ + if [ $$$$? -gt 0 ]; \ + then error_occured=1; \ + fi; \ + printf "\n"; + endif +endef + +define PARSE_TEST + TESTS := + TEST_NAME := $$(firstword $$(subst -, ,$$(RULE))) + TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE))) + ifeq ($$(TEST_NAME),all) + MATCHED_TESTS := $$(TEST_LIST) + else + MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),)) + endif + $$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET)))) +endef + + +# Set the silent mode depending on if we are trying to compile multiple keyboards or not +# By default it's on in that case, but it can be overriden by specifying silent=false +# from the command line +define SET_SILENT_MODE + ifdef SUB_IS_SILENT + SILENT_MODE := $(SUB_IS_SILENT) + else ifeq ($$(words $$(COMMANDS)),1) + SILENT_MODE := false + else + SILENT_MODE := true + endif +endef + +include $(ROOT_DIR)/message.mk + +RUN_COMMAND = \ +$(COMMAND_$(SILENT_MODE)_$(COMMAND)) + +# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps +SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) +.PHONY: $(SUBPROJECTS) +$(SUBPROJECTS): %: %-allkm + +# Let's match everything, we handle all the rule parsing ourselves +.PHONY: % +%: + # Check if we have the CMP tool installed + cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; + # Check if the submodules are dirty, and display a warning if they are + git submodule status --recursive 2>/dev/null | \ + while IFS= read -r x; do \ + case "$$x" in \ + \ *) ;; \ + *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \ + esac \ + done + $(eval $(call PARSE_RULE,$@)) + $(eval $(call SET_SILENT_MODE)) + # Run all the commands in the same shell, notice the + at the first line + # it has to be there to allow parallel execution of the submake + # This always tries to compile everything, even if error occurs in the middle + # But we return the error code at the end, to trigger travis failures + +error_occured=0; \ + $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \ + if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\ + $(foreach TEST,$(TESTS),$($(TEST)_COMMAND)) \ + if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\ + +# All should compile everything +.PHONY: all +all: all-keyboards test-all + +# Define some shortcuts, mostly for compability with the old syntax +.PHONY: all-keyboards +all-keyboards: allkb-allsp-allkm + +.PHONY: all-keyboards-defaults +all-keyboards-defaults: allkb-allsp-default + +.PHONY: test +test: test-all + +.PHONY: test-clean +test-clean: test-all-clean + +# Generate the version.h file GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") -OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" -OPT_DEFS += -DQMK_VERSION=\"$(GIT_VERSION)\" -DQMK_BUILDDATE=\"$(BUILD_DATE)\" +$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) +$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) + +include $(ROOT_DIR)/testlist.mk \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index 8cadeaddf..389b688ae 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -91,7 +91,7 @@ Vagrant.configure(2) do |config| Or you can copy and paste the example line below. - cd /vagrant; cd keyboards; cd ergodox_ez; make clean; make + cd /vagrant; cd keyboards; cd ergodox; make clean; make EOT diff --git a/build_keyboard.mk b/build_keyboard.mk new file mode 100644 index 000000000..03a69b146 --- /dev/null +++ b/build_keyboard.mk @@ -0,0 +1,226 @@ +ifndef VERBOSE +.SILENT: +endif + +.DEFAULT_GOAL := all + +include common.mk + +ifneq ($(SUBPROJECT),) + TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP) + KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT) +else + TARGET ?= $(KEYBOARD)_$(KEYMAP) + KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD) +endif + +# Force expansion +TARGET := $(TARGET) + + +MASTER ?= left +ifdef master + MASTER = $(master) +endif + +ifeq ($(MASTER),right) + OPT_DEFS += -DMASTER_IS_ON_RIGHT +else + ifneq ($(MASTER),left) +$(error MASTER does not have a valid value(left/right)) + endif +endif + + + +KEYBOARD_PATH := keyboards/$(KEYBOARD) +KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c + +ifneq ("$(wildcard $(KEYBOARD_C))","") + include $(KEYBOARD_PATH)/rules.mk +else + $(error "$(KEYBOARD_C)" does not exist) +endif + + +ifneq ($(SUBPROJECT),) + SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT) + SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c + ifneq ("$(wildcard $(SUBPROJECT_C))","") + OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) + include $(SUBPROJECT_PATH)/rules.mk + else + $(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist) + endif +endif + +# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA +ifdef MCU_FAMILY + PLATFORM=CHIBIOS +else + PLATFORM=AVR +endif + +ifeq ($(PLATFORM),CHIBIOS) + include $(TMK_PATH)/protocol/chibios.mk + include $(TMK_PATH)/chibios.mk + OPT_OS = chibios + ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","") + OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h + else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h + else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h + else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h + endif +endif + +CONFIG_H = $(KEYBOARD_PATH)/config.h +ifneq ($(SUBPROJECT),) + ifneq ("$(wildcard $(SUBPROJECT_C))","") + CONFIG_H = $(SUBPROJECT_PATH)/config.h + endif +endif + +# Save the defines and includes here, so we don't include any keymap specific ones +PROJECT_DEFS := $(OPT_DEFS) +PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH) +PROJECT_CONFIG := $(CONFIG_H) + +MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP) +MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c +SUBPROJ_KEYMAP_PATH := $(SUBPROJECT_PATH)/keymaps/$(KEYMAP) +SUBPROJ_KEYMAP_C := $(SUBPROJ_KEYMAP_PATH)/keymap.c +ifneq ("$(wildcard $(SUBPROJ_KEYMAP_C))","") + -include $(SUBPROJ_KEYMAP_PATH)/Makefile + KEYMAP_C := $(SUBPROJ_KEYMAP_C) + KEYMAP_PATH := $(SUBPROJ_KEYMAP_PATH) +else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","") + -include $(MAIN_KEYMAP_PATH)/Makefile + KEYMAP_C := $(MAIN_KEYMAP_C) + KEYMAP_PATH := $(MAIN_KEYMAP_PATH) +else + $(error "$(MAIN_KEYMAP_C)/keymap.c" does not exist) +endif + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET) + + +ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") + CONFIG_H = $(KEYMAP_PATH)/config.h +endif + +# # project specific files +SRC += $(KEYBOARD_C) \ + $(KEYMAP_C) \ + $(QUANTUM_DIR)/quantum.c \ + $(QUANTUM_DIR)/keymap_common.c \ + $(QUANTUM_DIR)/keycode_config.c \ + $(QUANTUM_DIR)/process_keycode/process_leader.c + +ifneq ($(SUBPROJECT),) + SRC += $(SUBPROJECT_C) +endif + +ifndef CUSTOM_MATRIX + SRC += $(QUANTUM_DIR)/matrix.c +endif + +ifeq ($(strip $(MIDI_ENABLE)), yes) + OPT_DEFS += -DMIDI_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c +endif + +ifeq ($(strip $(VIRTSER_ENABLE)), yes) + OPT_DEFS += -DVIRTSER_ENABLE +endif + +ifeq ($(strip $(AUDIO_ENABLE)), yes) + OPT_DEFS += -DAUDIO_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_music.c + SRC += $(QUANTUM_DIR)/audio/audio.c + SRC += $(QUANTUM_DIR)/audio/voices.c + SRC += $(QUANTUM_DIR)/audio/luts.c +endif + +ifeq ($(strip $(UCIS_ENABLE)), yes) + OPT_DEFS += -DUCIS_ENABLE + UNICODE_ENABLE = yes +endif + +ifeq ($(strip $(UNICODE_ENABLE)), yes) + OPT_DEFS += -DUNICODE_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c +endif + +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + OPT_DEFS += -DRGBLIGHT_ENABLE + SRC += $(QUANTUM_DIR)/light_ws2812.c + SRC += $(QUANTUM_DIR)/rgblight.c +endif + +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + OPT_DEFS += -DTAP_DANCE_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c +endif + +ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) + SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) + OPT_DEFS += $(SERIAL_DEFS) + VAPTH += $(SERIAL_PATH) +endif + +# Optimize size but this may cause error "relocation truncated to fit" +#EXTRALDFLAGS = -Wl,--relax + +# Search Path +VPATH += $(KEYMAP_PATH) +ifneq ($(SUBPROJECT),) + VPATH += $(SUBPROJECT_PATH) +endif +VPATH += $(KEYBOARD_PATH) +VPATH += $(COMMON_VPATH) + + +include $(TMK_PATH)/common.mk +SRC += $(TMK_COMMON_SRC) +OPT_DEFS += $(TMK_COMMON_DEFS) +EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) + +ifeq ($(PLATFORM),AVR) + include $(TMK_PATH)/protocol/lufa.mk + include $(TMK_PATH)/avr.mk +endif + +ifeq ($(strip $(VISUALIZER_ENABLE)), yes) + VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer + VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer + include $(VISUALIZER_PATH)/visualizer.mk +endif + +OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) +$(KEYMAP_OUTPUT)_SRC := $(SRC) +$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" +$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) +$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) +$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) +$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) +$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) +$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) + +# Default target. +all: build sizeafter + +# Change the build target to build a HEX file or a library. +build: elf hex +#build: elf hex eep lss sym +#build: lib + + +include $(TMK_PATH)/rules.mk + diff --git a/build_test.mk b/build_test.mk new file mode 100644 index 000000000..ee15a4572 --- /dev/null +++ b/build_test.mk @@ -0,0 +1,57 @@ +ifndef VERBOSE +.SILENT: +endif + +.DEFAULT_GOAL := all + +include common.mk + +TARGET=test/$(TEST) + +GTEST_OUTPUT = $(BUILD_DIR)/gtest + +TEST_OBJ = $(BUILD_DIR)/test_obj + +OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT) + +GTEST_INC := \ + $(LIB_PATH)/googletest/googletest/include\ + $(LIB_PATH)/googletest/googlemock/include\ + +GTEST_INTERNAL_INC :=\ + $(LIB_PATH)/googletest/googletest\ + $(LIB_PATH)/googletest/googlemock + +$(GTEST_OUTPUT)_SRC :=\ + googletest/src/gtest-all.cc\ + googletest/src/gtest_main.cc\ + googlemock/src/gmock-all.cc + +$(GTEST_OUTPUT)_DEFS := +$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC) + +LDFLAGS += -lstdc++ -lpthread -shared-libgcc +CREATE_MAP := no + +VPATH +=\ + $(LIB_PATH)/googletest\ + $(LIB_PATH)/googlemock + +all: elf + +VPATH += $(COMMON_VPATH) + +include $(TMK_PATH)/common.mk +include $(QUANTUM_PATH)/serial_link/tests/rules.mk + +$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC) +$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC) +$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) + +include $(TMK_PATH)/native.mk +include $(TMK_PATH)/rules.mk + + +$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null) +$(shell mkdir -p $(TEST_OBJ) 2>/dev/null) + diff --git a/common.mk b/common.mk new file mode 100644 index 000000000..18751cd5a --- /dev/null +++ b/common.mk @@ -0,0 +1,26 @@ +include message.mk + +# Directory common source files exist +TOP_DIR = . +TMK_DIR = tmk_core +TMK_PATH = $(TOP_DIR)/$(TMK_DIR) +LIB_PATH = $(TOP_DIR)/lib + +QUANTUM_DIR = quantum +QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR) + +BUILD_DIR := $(TOP_DIR)/.build + +SERIAL_DIR := $(QUANTUM_DIR)/serial_link +SERIAL_PATH := $(QUANTUM_PATH)/serial_link +SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c) +SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) +SERIAL_DEFS += -DSERIAL_LINK_ENABLE + +COMMON_VPATH := $(TOP_DIR) +COMMON_VPATH += $(TMK_PATH) +COMMON_VPATH += $(QUANTUM_PATH) +COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras +COMMON_VPATH += $(QUANTUM_PATH)/audio +COMMON_VPATH += $(QUANTUM_PATH)/process_keycode +COMMON_VPATH += $(SERIAL_PATH) \ No newline at end of file diff --git a/doc/TMK_README.md b/doc/TMK_README.md index 6164dacd3..e3438eda2 100644 --- a/doc/TMK_README.md +++ b/doc/TMK_README.md @@ -34,7 +34,7 @@ You can find some keyboard specific projects under `converter` and `keyboard` di * [atomic](keyboards/atomic/) - [Atomic] Ortholinear 60% keyboard ### Ergodox EZ -* [ergodox_ez](keyboards/ergodox_ez) - [Ergodox_EZ] Assembled split keyboard +* [ergodox_ez](keyboards/ergodox/ez) - [Ergodox_EZ] Assembled split keyboard ## Other projects @@ -113,7 +113,7 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv Build Firmware and Program Controller ------------------------------------- -See [doc/build.md](tmk_core/doc/build.md), or the readme in the particular keyboards/* folder. +See [build environment setup](/readme.md#build-environment-setup), or the readme in the particular keyboards/* folder. diff --git a/doc/VAGRANT_GUIDE.md b/doc/VAGRANT_GUIDE.md index 62044b7f7..c9958e16b 100644 --- a/doc/VAGRANT_GUIDE.md +++ b/doc/VAGRANT_GUIDE.md @@ -20,7 +20,7 @@ See [/doc/keymap.md](/doc/keymap.md). ## Flashing the firmware -The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox_ez/readme.md) gives a great example. +The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox/readme.md) gives a great example. If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version. - \ No newline at end of file + diff --git a/doc/basic_how_keyboards_work.md b/doc/basic_how_keyboards_work.md new file mode 100644 index 000000000..73c3f5c5f --- /dev/null +++ b/doc/basic_how_keyboards_work.md @@ -0,0 +1,96 @@ +# How keys are registered, and interpreted by computers + +In this file, you can will learn the concepts of how keyboards work over USB, +and you'll be able to better understand what you can expect from changing your +firmware directly. + +## Schematic view + +Whenever you type on 1 particular key, here is the chain of actions taking +place: + +``` text ++------+ +-----+ +----------+ +----------+ +----+ +| User |-------->| Key |------>| Firmware |----->| USB wire |---->| OS | ++------+ +-----+ +----------+ +----------+ |----+ +``` + +This scheme is a very simple view of what's going on, and more details follow +in the next sections. + +## 1. You Press a Key + +Whenever you press a key, the firmware of your keyboard can register this event. +It can register when the key is pressed, held and released. + +This usually happens with a [periodic scan of key presses with a frequency around 100 hz](https://github.com/benblazak/ergodox-firmware/blob/master/references.md#typical-keyboard-information). +This speed often is limited by the mechanical key response time, the protocol +to transfer those key presses (here USB HID), and by the software it is used in. + +## 2. What the Firmware Sends + +The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) +tells what a keyboard can actually send through USB to have a chance to be +properly recognised. This includes a pre-defined list of keycodes which are +simple numbers from `0x00` to `0xE7`. The firmware assigns a keycode to each +key of the keyboard. + +The firmware does not send actually letters or characters, but only keycodes. +Thus, by modifying the firmware, you only can modify what keycode is sent over +USB for a given key. + +## 3. What the Operating System Does + +Once the keycode reaches the operating system, a piece of software has to have +it match an actual character thanks to a keyboard layout. For example, if your +layout is set to QWERTY, a sample of the matching table is as follow: + +``` text +| keycode | character | +|---------+-----------| +| 0x04 | a/A | +| 0x05 | b/B | +| 0x06 | c/C | +| ... | ... | +| 0x1C | y/Y | +| 0x1D | z/Z | +| ... | ... | +|---------+-----------| +``` + +## Back to the firmware + +As the layout is generally fixed (unless you create your own), the firmware can +actually call a keycode by its layout name directly to ease things for you. + +This is exactly what is done here with `KC_A` actually representing `0x04` in +QWERTY. The full list can be found in `keycode.txt`. + +## List of Characters You Can Send + +Putting aside shortcuts, having a limited set of keycodes mapped to a limited +layout means that **the list of characters you can assign to a given key only +is the ones present in the layout**. + +For example, this means that if you have a QWERTY US layout, and you want to +assign 1 key to produce `€` (euro currency symbol), you are unable to do so, +because the QWERTY US layout does not have such mapping. You could fix that by +using a QWERTY UK layout, or a QWERTY US International. + +You may wonder why a keyboard layout containing all of Unicode is not devised +then? The limited number of keycode available through USB simply disallow such +a thing. + +## How to (Maybe) Enter Unicode Characters + +You can have the firmware send *sequences of keys* to use the [software Unicode +Input +Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of +the target operating system, thus effectively entering characters independently +of the layout defined in the OS. + +Yet, it does come with multiple disadvantages: + + - Tied to a specific OS a a time (need recompilation when changing OS); + - Within a given OS, does not work in all software; + - Limited to a subset of Unicode on some systems. diff --git a/doc/keycode.txt b/doc/keycode.txt index c1134f9bf..5a42c50bf 100644 --- a/doc/keycode.txt +++ b/doc/keycode.txt @@ -2,7 +2,7 @@ Keycode Symbol Table ==================== Keycodes are defined in `common/keycode.h`. Range of 00-A4 and E0-E7 are identical with HID Usage: - + Virtual keycodes are defined out of above range to support special actions. diff --git a/doc/keymap.md b/doc/keymap.md index d1985e567..6f2a663fc 100644 --- a/doc/keymap.md +++ b/doc/keymap.md @@ -455,6 +455,35 @@ Turn the backlight on and off without changing level. +### 2.6 Swap-Hands Action +The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command key is pressed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd` + +### 2.6.1 Configuration +The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck: + +``` +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; +``` + +Note that the array indices are reversed same as the matrix and the values are of type `keypos_t` which is `{col, row}` and all values are zero-based. In the example above, `hand_swap_config[2][4]` (third row, fifth column) would return {7, 2} (third row, eighth column). + +### 2.6.2 Advanced Swap Commands +- **`ACTION_SWAP_HANDS()`** Swaps hands when pressed, returns to normal when released (momentary). +- **`ACTION_SWAP_HANDS_TOGGLE()`** Toggles swap on and off with every keypress. +- **`ACTION_SWAP_HANDS_TAP_TOGGLE()`** Toggles with a tap; momentary when held. +- **`ACTION_SWAP_HANDS_TAP_KEY(key)`** Sends `key` with a tap; momentary swap when held. +- **`ACTION_SWAP_HANDS_ON_OFF()`** Alias for `ACTION_SWAP_HANDS()` +- **`ACTION_SWAP_HANDS_OFF_ON()`** Momentarily turns off swap. +- **`ACTION_SWAP_HANDS_ON()`** Turns on swapping and leaves it on. +- **`ACTION_SWAP_HANDS_OFF()`** Turn off swapping and leaves it off. Good for returning to a known state. + + + ## 3. Layer switching Example There are some ways to switch layer with 'Layer' actions. diff --git a/keyboards/alps64/Makefile b/keyboards/alps64/Makefile index d8325e6c8..4e2a6f00f 100644 --- a/keyboards/alps64/Makefile +++ b/keyboards/alps64/Makefile @@ -1,70 +1,3 @@ - - -# Target file name (without extension). - -# project specific files -SRC = led.c - -# MCU name -MCU = atmega32u2 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/alps64/rules.mk b/keyboards/alps64/rules.mk new file mode 100644 index 000000000..c326d3e26 --- /dev/null +++ b/keyboards/alps64/rules.mk @@ -0,0 +1,66 @@ + + +# Target file name (without extension). + +# project specific files +SRC = led.c + +# MCU name +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA \ No newline at end of file diff --git a/keyboards/amj60/Makefile b/keyboards/amj60/Makefile new file mode 100644 index 000000000..4e2a6f00f --- /dev/null +++ b/keyboards/amj60/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/amj60/amj60.c b/keyboards/amj60/amj60.c new file mode 100644 index 000000000..993a5917d --- /dev/null +++ b/keyboards/amj60/amj60.c @@ -0,0 +1,30 @@ +#include "amj60.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB |= (1<<2); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1< + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6066 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Han Chen +#define PRODUCT AMJ60 +#define DESCRIPTION qmk port of AMJ60 PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { F7, F6, F5, F4, D5} +#define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7, D6, B3} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +/* Underlight configuration + */ + +#define RGB_DI_PIN E2 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/amj60/keymaps/iso_split_rshift/Makefile b/keyboards/amj60/keymaps/iso_split_rshift/Makefile new file mode 100644 index 000000000..2969ed8ae --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/Makefile @@ -0,0 +1,23 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/amj60/keymaps/iso_split_rshift/build.sh b/keyboards/amj60/keymaps/iso_split_rshift/build.sh new file mode 100755 index 000000000..6b4b4568f --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# adjust for cpu +# -j 16 gave best result on a hyperthreaded quad core core i7 + +LIMIT=10 +THREADS="-j 16" +KMAP=iso_split_rshift + +echo "We need sudo later" +sudo ls 2>&1 /dev/null + +function wait_bootloader { + echo "Waiting for Bootloader..." + local STARTTIME=$(date +"%s") + local REMIND=0 + local EXEC=dfu-programmer + local TARGET=atmega32u4 + while true + do + sudo $EXEC $TARGET get > /dev/null 2>&1 + [ $? -eq 0 ] && break + ENDTIME=$(date +"%s") + DURATION=$(($ENDTIME-$STARTTIME)) + if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ] + then + echo "Did you forget to press the reset button?" + REMIND=1 + fi + sleep 1 + done +} +make clean +make KEYMAP=${KMAP} ${THREADS} +if [[ $? -eq 0 ]] +then + echo "please trigger flashing!" + wait_bootloader + sudo make KEYMAP=${KMAP} dfu ${THREADS} +else + echo "make failed" + exit 77 +fi diff --git a/keyboards/amj60/keymaps/iso_split_rshift/keymap.c b/keyboards/amj60/keymaps/iso_split_rshift/keymap.c new file mode 100644 index 000000000..60fb0bfb0 --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/keymap.c @@ -0,0 +1,147 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "amj60.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DEF 0 +#define _SPC 1 +#define _TAB 2 +#define _SFX 3 + +// dual-role shortcuts +#define TABDUAL LT(_TAB, KC_TAB) +#define CAPSDUAL CTL_T(KC_ESC) +#define SPACEDUAL LT(_SPC, KC_SPACE) +#define ENTERDUAL CTL_T(KC_ENT) +// arrow cluster duality bottom right corner +#define ARRLEFT ALT_T(KC_LEFT) +#define ARRDOWN GUI_T(KC_DOWN) +#define ARRUP SFT_T(KC_UP) +#define ARRRIGHT CTL_T(KC_RIGHT) +// german brackets +#define GER_CUR_L RALT(KC_7) // [ +#define GER_CUR_R RALT(KC_0) // ] +#define GER_PAR_L LSFT(KC_8) // ( +#define GER_PAR_R LSFT(KC_9) // ) +#define GER_ANG_L KC_NUBS // < +#define GER_ANG_R LSFT(KC_NUBS) // > +#define GER_BRC_L RALT(KC_8) // [ +#define GER_BRC_R RALT(KC_9) // ] + +// increase readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _DEF: Default Layer + * ,-----------------------------------------------------------. + * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | + * |-----------------------------------------------------------| + * |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP + * |-----------------------------------------------------------| + * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is + * `-----------------------------------------------------------' LEFT DWN RIGHT + */ + [_DEF] = KEYMAP_ISO_SPLITRSHIFT( + 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, \ + TABDUAL, 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, \ + CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ARRUP, TG(_SFX), \ + KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT), + + /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) + * ,-----------------------------------------------------------. + * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| + * |-----------------------------------------------------------| + * | |Paus| Up| [ | ] | | | | ( | ) | | | | | + * |-----------------------------------------------------------| + * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY | + * |-----------------------------------------------------------| + * | | | | | < | > | |M0 | | | | | Vol+ | | + * |-----------------------------------------------------------| + * | | | | |Alt |Prev|Vol-|Next| + * `-----------------------------------------------------------' + */ + [_SPC] = KEYMAP_ISO_SPLITRSHIFT( + KC_PSCR, 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_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) + * ,-----------------------------------------------------------. + * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE + * |-----------------------------------------------------------| + * | | | | | | | | | { | } | | | | | + * |-----------------------------------------------------------| + * | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn | + * |-----------------------------------------------------------| + * | | | | | | | |AF2| | | | | PgUp | | + * |-----------------------------------------------------------| + * | | | | |Alt |Pos1|PgDn|End | + * `-----------------------------------------------------------' + */ + [_TAB] = KEYMAP_ISO_SPLITRSHIFT( + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + + /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) + * ,-----------------------------------------------------------. + * |RSET| | | | | | | 7| 8| 9| | | |Backsp | + * |-----------------------------------------------------------| + * | | | | | | | | 4 | 5 | 6 | | | | \ | + * |-----------------------------------------------------------| + * | | L | L | | | | | 1 | 2 | 3 | | | Return | + * |-----------------------------------------------------------| + * | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent + * |-----------------------------------------------------------| LED controlling + * |Ctrl|Win |Alt | |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + [_SFX] = KEYMAP_ISO_SPLITRSHIFT( + RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ + _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ + _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), +}; + +enum function_id { + LAUNCH, + RGBLED_TOGGLE, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_FUNCTION(LAUNCH), + [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return (record->event.pressed ? + MACRO( D(RALT), T(SPC), U(RALT), END ) + :MACRO( END )); + break; + case 1: + return (record->event.pressed ? + MACRO( D(LALT), T(F2), U(LALT), END ) + :MACRO( END )); + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/amj60/keymaps/iso_split_rshift/readme.md b/keyboards/amj60/keymaps/iso_split_rshift/readme.md new file mode 100644 index 000000000..2113d93e4 --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/readme.md @@ -0,0 +1,30 @@ +toneman77's custom spacefn Layout +===================== + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +# Features +* heavily modified ISO (!) layout with split right shift key +* spaceFn +* Dual-Role keys: +* + | Original key | when tapped | when held | + | ---------------- | ------------- | ------------- | + | Space | Space | layer change | + | Caps lock | Escape | Control | + | Tab | Tab | layer change | + | Enter | Enter | Control | + +* vim-style arrow keys on hjkl (spacefn layer) +* corresponding Home/PgDn/PgUp/End on hjkl (tab layer) +* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift +* more bonus arrow keys on wasd (spacefn layer) +* media keys prev/next/play/vol+/vol- (spacefn layer) +* firmware bootloader button +* additional brackets that only work in german layout due to horrible placement +in the default qwertz layout + + +### Additional Credits +* visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) (without the LED keys) diff --git a/keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh b/keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh new file mode 100755 index 000000000..da5457e19 --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh @@ -0,0 +1,4 @@ +#!/bin/bash +git checkout amj60 # gets you on branch amj60 +git fetch origin # gets you up to date with origin +git merge origin/master diff --git a/keyboards/amj60/readme.md b/keyboards/amj60/readme.md new file mode 100644 index 000000000..0896134e0 --- /dev/null +++ b/keyboards/amj60/readme.md @@ -0,0 +1,57 @@ +AMJ60 keyboard firmware +====================== +DIY/Assembled compact 60% keyboard. + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/amj60 +folder. Once your dev env is setup, you'll be able to type `make` to generate +your .hex - you can then use `make dfu` to program your PCB once you hit the +reset button. + +Depending on which keymap you would like to use, you will have to compile +slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to +define your favorite layout yourself. To define your own keymap create file +named `.c` in the keymaps folder, and see keymap document (you can find +in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with +`KEYMAP` option like: +`` +$ make KEYMAP=[default|jack|] +`` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` +folder. + +## Variations +KEYMAP macros for the following layouts are available: + +* default, for all the available, possible keys +* ANSI, for 60% ANSI keyboard +* ISO +* ISO w/ split right shift key +* HHKB + +Remark: all but "ISO w/ split right shift key" are untested and were done to the best of my knowledge. + +### Original tmk firmware +The original firmware that was used to port to qmk can be found [here](https://github.com/AMJKeyboard/AMJ60). + +## Further information +Since information and documentation for this board are sparse, (at least for non-chinese speaking ppl) here is everything that could be found + +* [geekhack discussion](https://geekhack.org/index.php?topic=53070.0) +* [chinese discussion](https://www.v2ex.com/t/161887) +* Board has [dedicated pinouts](https://i.imgur.com/D0sWhyh.jpg?1) for a bluetooth module +* has pins for external power [picture](https://i.imgur.com/00VrtIp.jpg?1). +* most information comes from [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/32oonr/gh60_pcb_for_your_custom_keyboard/) diff --git a/keyboards/amj60/rules.mk b/keyboards/amj60/rules.mk new file mode 100644 index 000000000..18403ac32 --- /dev/null +++ b/keyboards/amj60/rules.mk @@ -0,0 +1,66 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/arrow_pad/Makefile b/keyboards/arrow_pad/Makefile index 09fcf3e7a..4e2a6f00f 100644 --- a/keyboards/arrow_pad/Makefile +++ b/keyboards/arrow_pad/Makefile @@ -1,74 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# 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 ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/arrow_pad/readme.md b/keyboards/arrow_pad/readme.md index 5aa44cce5..2e9a64f2e 100644 --- a/keyboards/arrow_pad/readme.md +++ b/keyboards/arrow_pad/readme.md @@ -12,13 +12,15 @@ Download or clone the whole firmware and navigate to the keyboards/arrow_pad fol Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` + Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file diff --git a/keyboards/arrow_pad/rules.mk b/keyboards/arrow_pad/rules.mk new file mode 100644 index 000000000..3dca9b6ea --- /dev/null +++ b/keyboards/arrow_pad/rules.mk @@ -0,0 +1,70 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# 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 ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 \ No newline at end of file diff --git a/keyboards/atomic/Makefile b/keyboards/atomic/Makefile index 08e9205cb..4e2a6f00f 100644 --- a/keyboards/atomic/Makefile +++ b/keyboards/atomic/Makefile @@ -1,73 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/atomic/keymaps/pvc/keymap.c b/keyboards/atomic/keymaps/pvc/keymap.c index f16ec8a6e..b02e89d2c 100644 --- a/keyboards/atomic/keymaps/pvc/keymap.c +++ b/keyboards/atomic/keymaps/pvc/keymap.c @@ -154,7 +154,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* UPPER * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. - * | PRINT | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | NUM LK | / | * | | NUM LK | SCR LK | XXXXXX . PAUSE | + * | PRINT | BR TOG | BR SP+ | BR SP- | BR RST | XXXXXX | XXXXXX | NUM LK | / | * | | NUM LK | SCR LK | XXXXXX . PAUSE | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * | | F1 | F2 | F3 | F4 | | | 7 | 8 | 9 | - | | | | INS | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| @@ -180,9 +180,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * | | $ | { | [ | ( | % | # | ) | ] | } | @ | | | | INS | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| - * | | ^ | * | + | - | ; | : | _ | ' | " | ` | | XXXXXX . | HOME | + * | | ^ | * | + | - | / | \ | _ | ' | " | ` | | XXXXXX . | HOME | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| - * | | | | & | ! | ~ | / | \ | = | < | > | ? | XXXXXX . | | END | + * | | | | & | ! | ~ | ; | : | = | < | > | ? | XXXXXX . | | END | * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| * | | | | | | | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' @@ -191,16 +191,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_LOWER] = { // LOWER { _______, 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_DLR, KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT, _______, _______, _______, KC_INS }, - { _______, KC_CIRC, KC_ASTR, KC_PPLS, KC_PMNS, KC_SCLN, KC_COLN, KC_UNDS, KC_QUOT, KC_DQT, KC_GRV, _______, ________________, KC_HOME }, - { _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SLSH, KC_BSLS, KC_EQL, KC_LT, KC_GT, KC_QUES, ________________, _______, KC_END }, + { _______, KC_CIRC, KC_ASTR, KC_PPLS, KC_PMNS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT, KC_GRV, _______, ________________, KC_HOME }, + { _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL, KC_LT, KC_GT, KC_QUES, ________________, _______, KC_END }, { _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ }, }, +/* FUNCTION + * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. + * | NUM LK | | | | | | | | | | | | | XXXXXX . | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | SCR LK | F13 | F14 | F15 | F16 | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| + * | CAP LK | F17 | F18 | F19 | F20 | | | | | | | | XXXXXX . | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| + * | | F21 | F22 | F23 | F24 | | | | | | | XXXXXX . | VOL UP | MUTE | + * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | PLAY/PAUSE | | | | | | PTRACK | VOL DN | NTRACK | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + [LAYER_FUNCTION] = { // FUNCTION - { KC_NLCK, 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_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, KC_PAUS }, - { KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_PSCR }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_VOLU, KC_MUTE }, + { KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX }, + { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, + { KC_CAPS, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX, XXXXXXX }, + { _______, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ________________, KC_VOLU, KC_MUTE }, { _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT }, }, diff --git a/keyboards/atomic/readme.md b/keyboards/atomic/readme.md index ab1e7ba1f..674dcf113 100644 --- a/keyboards/atomic/readme.md +++ b/keyboards/atomic/readme.md @@ -13,13 +13,14 @@ Download or clone the whole firmware and navigate to the keyboards/atomic folder Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/atomic/rules.mk b/keyboards/atomic/rules.mk new file mode 100644 index 000000000..d0f3a3a1c --- /dev/null +++ b/keyboards/atomic/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/atreus/Makefile b/keyboards/atreus/Makefile index 95ee1d4d7..4e2a6f00f 100644 --- a/keyboards/atreus/Makefile +++ b/keyboards/atreus/Makefile @@ -1,88 +1,3 @@ - - -ifdef TEENSY2 - OPT_DEFS += -DATREUS_TEENSY2 - ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -else - OPT_DEFS += -DATREUS_ASTAR - OPT_DEFS += -DCATERINA_BOOTLOADER - ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) -endif - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -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 ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - -USB ?= /dev/cu.usbmodem1411 - -upload: build - $(ATRUES_UPLOAD_COMMAND) - \ No newline at end of file +endif \ No newline at end of file diff --git a/keyboards/atreus/keymaps/replicaJunction/atreus-replica-base-colemakdh.png b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-base-colemakdh.png new file mode 100644 index 000000000..4640f9f52 Binary files /dev/null and b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-base-colemakdh.png differ diff --git a/keyboards/atreus/keymaps/replicaJunction/atreus-replica-extend.png b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-extend.png new file mode 100644 index 000000000..08c2e6140 Binary files /dev/null and b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-extend.png differ diff --git a/keyboards/atreus/keymaps/replicaJunction/atreus-replica-function.png b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-function.png new file mode 100644 index 000000000..34ad03dec Binary files /dev/null and b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-function.png differ diff --git a/keyboards/atreus/keymaps/replicaJunction/atreus-replica-game.png b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-game.png new file mode 100644 index 000000000..14ae35b54 Binary files /dev/null and b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-game.png differ diff --git a/keyboards/atreus/keymaps/replicaJunction/atreus-replica-num.png b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-num.png new file mode 100644 index 000000000..6598acb27 Binary files /dev/null and b/keyboards/atreus/keymaps/replicaJunction/atreus-replica-num.png differ diff --git a/keyboards/atreus/keymaps/replicaJunction/config.h b/keyboards/atreus/keymaps/replicaJunction/config.h new file mode 100644 index 000000000..437aa662c --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/config.h @@ -0,0 +1,94 @@ +/* +Config file - Atreus QMK with replicaJunction layout + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Technomancy +#define PRODUCT Atreus +#define DESCRIPTION q.m.k. keyboard firmware for Atreus + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 11 + +// Change this to how you wired your keyboard +// COLS: Left to right, ROWS: Top to bottom +#if defined(ATREUS_ASTAR) +# define MATRIX_ROW_PINS { D0, D1, D3, D2 } +# define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 } +# define UNUSED_PINS +#elif defined(ATREUS_TEENSY2) +# define MATRIX_ROW_PINS { D0, D1, D2, D3 } +# define MATRIX_COL_PINS { F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0 } +# define UNUSED_PINS +#endif + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +// Default: 5 +#define DEBOUNCING_DELAY 6 + +// I don't have any locking keys, so I don't need these features + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Prevent modifiers from sticking when switching layers */ +#define PREVENT_STUCK_MODIFIERS + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/atreus/keymaps/replicaJunction/keymap.c b/keyboards/atreus/keymaps/replicaJunction/keymap.c new file mode 100644 index 000000000..52d3677fa --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/keymap.c @@ -0,0 +1,107 @@ +/* + * Keyboard: Atreus + * Keymap: replicaJunction + * Version: 0.3 + * + * This keymap is designed to complement my Ergodox keyboard layout, found in keyboards/ergodox_ez. + * The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox. I now + * have both keyboards, so I've designed these layouts in an effort to make switching between the + * two as easy as possible. + * + * Clearly, the Atreus is the limiting factor in this equation, so I've taken heavy advantage of + * function and dual-role keys. + * + * The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found + * here: https://colemakmods.github.io/mod-dh/ + */ + +#include "atreus.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +// Note that whatever is set as layer 0 will be the default layer of the keyboard. + +#define _CO 0 // Colemak +#define _QW 1 // QWERTY +#define _GA 2 // Gaming +#define _EX 3 // Extend +#define _NU 4 // Numpad +#define _FN 5 // Function + +// Some quick aliases, just to make it look pretty +#define _______ KC_TRNS +#define KCX_CA LCTL(KC_LALT) +#define KCX_CS LCTL(KC_LSFT) +#define KCX_CSA LCTL(LSFT(KC_LALT)) +#define KCX_LST LSFT(KC_TAB) +#define KX_COPY LCTL(KC_C) +#define KX_CUT LCTL(KC_X) +#define KX_PAST LCTL(KC_V) +#define KX_UNDO LCTL(KC_Z) + +; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_CO] = KEYMAP( + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, + SFT_T(KC_Z), KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, SFT_T(KC_SLSH), + KC_ESC, KC_LGUI, KC_TAB, KC_LALT, KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL +), + +[_QW] = KEYMAP( /* Qwerty */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH), + KC_ESC, KC_LGUI, KC_TAB, KC_LALT, KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL +), + +[_EX] = KEYMAP( /* Extend */ + KC_CAPS, _______, _______, _______, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, + _______, KC_LGUI, KC_LALT, KC_LCTL, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, + _______, KX_CUT, KX_COPY, _______, KX_PAST, _______, KC_TAB, KCX_LST, _______, KC_INSERT, + _______, _______, _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, KC_PSCR +), + +[_NU] = KEYMAP( /* Numbers and symbols */ + KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, + KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD, KC_PIPE, KC_4, KC_5, KC_6, KC_MINS, + KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, KC_BSLS, KC_1, KC_2, KC_3, KC_PLUS, + _______, TG(_GA), _______, MO(_FN), _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, _______ +), + +[_FN] = KEYMAP( /* Functions */ + KC_DEL, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, KC_F7, KC_F8, KC_F9, KC_F10, + KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, _______, KC_F4, KC_F5, KC_F6, KC_F11, + _______, KC_VOLU, KC_MUTE, KC_VOLD, KC_MPLY, _______, KC_F1, KC_F2, KC_F3, KC_F12, + _______, _______, _______, _______, KC_MSTP, _______, _______, _______, KC_NO, DF(_CO), DF(_QW), RESET +), + +[_GA] = KEYMAP( /* Gaming */ + _______, _______, _______, _______, _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, + _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, + KC_Z, _______, _______, _______, _______, KC_BTN3, _______, KC_MS_D, _______, _______, + _______, TG(_GA), _______, KC_LSFT, KC_SPC, KC_BSPC, KC_BTN2, KC_BTN1, _______, _______, _______, _______ +)}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/atreus/keymaps/replicaJunction/readme.md b/keyboards/atreus/keymaps/replicaJunction/readme.md new file mode 100644 index 000000000..21af48e8f --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/readme.md @@ -0,0 +1,57 @@ +# replicaJunction - Atreus Layout # + +This layout is designed to make the absolute most out of the Atreus 40% keyboard. + +I was enchanted with the idea of the Atreus keyboard after using my Ergodox for several months. I wanted something of a similar form factor that was easily portable, so I could bring and transport a keyboard to my workplace without much hassle. After building the Atreus keyboard, though, I realized very quickly that the 40% form factor requires a lot more creativity than a full-size keyboard (even one as strangely-shaped as the Ergodox). + +The default Atreus keyboard layout provides all the necessary keys in order to function with the keyboard, but as a programmer, I needed quicker access to just about everything. I noticed that the default layer didn't include any dual-role keys, and so I started on my journey to build my perfect layout for the Atreus. + +I won't claim that this layout is perfect for everyone. It does make several significant changes from the "normal" Atreus layout. In my own use, though, I've found this keyboard turbocharges my Atreus, and gives it the power of a full-size keyboard without the size. + +## Base Layer ## + +![Atreus base layout](atreus-replica-base-colemakdh.png) + +The letters on this layout are arranged in the [Colemak Mod-DH layout](https://colemakmods.github.io/mod-dh/). + +Note that there are four dual-purpose keys: Shift (Backspace), Ctrl (Delete), Alt (Enter), and Space (Number layer). In QMK, these dual-role keys can be made to hold their primary key by double-tapping the key and holding on the second tap. For example, if I wanted to insert a long string of Spaces, I would tap the Space key, then tap it again and hold. A single press and hold would trigger the secondary function of the key instead. + +The secondary Alt on the left bottom row exists to provide a single-hand Alt+Tab shortcut, which would take two rows otherwise. + +## Extend Layer ## + +![Atreus extend layer](atreus-replica-extend.png) + +This layout is designed primarily for keyboard navigation. Arrow keys are easily accessible under the right hand (a welcome change from the original Atreus layout, which places them under the left hand), along with Home/End and PgUp/PgDn. + +Modifiers are also placed under the home row of the left hand. One of the single keyboard actions I use most is Shift+Ctrl+Left/Right to select a whole word; this layer makes those keypresses simple by adding the Ctrl key in an easy-to-reach location. + +For the common Ctrl shortcuts, I also added some hotkeys to this layer over the letter keys they are associated with. This gives the Extend key some extra utility by letting it "feel" like a Ctrl key in some cases. + +The Space key exists to prevent going from this layer directly into the Number layer. Similarly, the Shift key on the left pinky helps make sure that the normal letter (Z) doesn't fire. + +## Number and Symbol Layer ## + +![Atreus number and symbol layer](atreus-replica-num.png) + +This layer provides the only way of accessing number keys on this keyboard, since it's too small for its own number row. Note that even though they are laid out in the number pad fashion, they send the "regular" number keystrokes. Games and programs that specifically use NumPad keys are not supported in this layout at the moment. + +This layer also provides plenty of symbol shortcuts. Most of these can be accessed through other means (like Shift+8 for the asterisk), but having shortcut keys to them makes for one less keypress, which adds up quickly when using these symbols on a regular basis. I've been through many revisions of this concept on my Ergodox as well as the Atreus, and I've finally arrived at this layout as the one that provides the symbols I need most frequently in places I can think to expect them. The Ordinary layout from the Ergodox-EZ keyboard in this repository was a large influence in this design. + +## Function Layer ## + +![Atreus function layer](atreus-replica-function.png) + +Function keys (F1-F12) are on this layer, as well as some more generic "functions" such as media keys. I've also set up a mirror image of the arrows from the Extend layer in case I need to use these with my left hand, but I don't do this very often. + +The reset key is on this layer, as well as a toggle from Colemak to QWERTY and back. The QWERTY layer is not currently documented, but it is functionally identical to the base layer except for letter positions. + +## Gaming Layer ## + +![Atreus gaming layer](atreus-replica-game.png) + +This is a small layer developed to allow some simple gameplay without a mouse. This layer is a toggle (from the Number layer), so it is designed to stay on while in use. + +The keys on the left hand bring Space into the left thumb's reach, as well as overriding the dual-role Shift with its standard function (Z in both QWERTY and in Colemak). This allows easy Shift presses without blocking the Z key, commonly used in games. + +I would probably not consider this a hard-core gaming keyboard, and this layout does have the huge problem of blocking access to the number keys, but for more casual games, it plays quite well. I've used it quite a bit on Minecraft, for example, and I'm quite pleased with it. \ No newline at end of file diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..b418cc9b5 --- /dev/null +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -0,0 +1,89 @@ +// This is the personal keymap of Ian Sterling (@xyverz). It is based on the keymap by +// Chris Gerber (@gerbercj), with the addition of persistent layers like the Planck and +// Preonic keyboards by Jack Humbert. + +#include "atreus.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DV 0 +#define _QW 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DV] = { /* Dvorak */ + {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L }, + {KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S }, + {SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL} + }, + [_QW] = { /* Qwerty */ + {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} + }, + [_CM] = { /* Colemak */ + {KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, + {KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O }, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} + }, + [_L1] = { /* LAYER 1 */ + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, + {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL }, + {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, + {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } + }, + [_L2] = { /* LAYER 2 */ + {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS}, + {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, + {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/atreus/readme.md b/keyboards/atreus/readme.md index 734f58f0f..a4077668e 100644 --- a/keyboards/atreus/readme.md +++ b/keyboards/atreus/readme.md @@ -174,13 +174,14 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk new file mode 100644 index 000000000..d71f50bb2 --- /dev/null +++ b/keyboards/atreus/rules.mk @@ -0,0 +1,82 @@ + + +ifdef TEENSY2 + OPT_DEFS += -DATREUS_TEENSY2 + ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +else + OPT_DEFS += -DATREUS_ASTAR + OPT_DEFS += -DCATERINA_BOOTLOADER + ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) +endif + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID + +USB ?= /dev/cu.usbmodem1411 + +upload: build + $(ATRUES_UPLOAD_COMMAND) \ No newline at end of file diff --git a/keyboards/bantam44/Makefile b/keyboards/bantam44/Makefile index 03893dbf8..4e2a6f00f 100644 --- a/keyboards/bantam44/Makefile +++ b/keyboards/bantam44/Makefile @@ -1,72 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -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 ?= yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/bantam44/readme.md b/keyboards/bantam44/readme.md index 89d7f9d05..462f67c12 100644 --- a/keyboards/bantam44/readme.md +++ b/keyboards/bantam44/readme.md @@ -12,13 +12,14 @@ Download or clone the whole firmware and navigate to the keyboards/Bantam44 fold Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file diff --git a/keyboards/bantam44/rules.mk b/keyboards/bantam44/rules.mk new file mode 100644 index 000000000..baa0e9e7a --- /dev/null +++ b/keyboards/bantam44/rules.mk @@ -0,0 +1,67 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/chibios_test/Makefile b/keyboards/chibios_test/Makefile index d9f2b8b83..4b07a6234 100644 --- a/keyboards/chibios_test/Makefile +++ b/keyboards/chibios_test/Makefile @@ -1,14 +1,5 @@ SUBPROJECT_DEFAULT = stm32_f072_onekey -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -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 -SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover -CUSTOM_MATRIX ?= yes # Custom matrix file - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c index 31319ef57..2809c9d18 100644 --- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c +++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c @@ -1,49 +1,49 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -#include "hal.h" - -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -#if HAL_USE_PAL || defined(__DOXYGEN__) -const PALConfig pal_default_config = -{ - {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, - {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, - {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, - {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, - {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, -}; -#endif - -/* - * Early initialization code. - * This initialization must be performed just after stack setup and before - * any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -/* - * Board-specific initialization code. - */ -void boardInit(void) { -} +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +#include "hal.h" + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { +} diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h index 7253e7782..b31d74307 100644 --- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h +++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h @@ -1,166 +1,166 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for a Generic STM32F103 board. - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F103 -#define BOARD_NAME "Generic STM32F103x board" - -/* - * Board frequencies. - */ -#define STM32_LSECLK 32768 -#define STM32_HSECLK 8000000 - -/* - * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. - */ -#define STM32F103xB - -/* - * IO pins assignments - */ - -/* on-board */ - -#define GPIOC_LED 13 -#define GPIOD_OSC_IN 0 -#define GPIOD_OSC_OUT 1 - -/* In case your board has a "USB enable" hardware - controlled by a pin, define it here. (It could be just - a 1.5k resistor connected to D+ line.) -*/ -/* -#define GPIOB_USB_DISC 10 -*/ - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * - * The digits have the following meaning: - * 0 - Analog input. - * 1 - Push Pull output 10MHz. - * 2 - Push Pull output 2MHz. - * 3 - Push Pull output 50MHz. - * 4 - Digital input. - * 5 - Open Drain output 10MHz. - * 6 - Open Drain output 2MHz. - * 7 - Open Drain output 50MHz. - * 8 - Digital input with PullUp or PullDown resistor depending on ODR. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. - * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. - * Please refer to the STM32 Reference Manual for details. - */ - -/* - * Port A setup. - * Everything input with pull-up except: - * PA2 - Alternate output (USART2 TX). - * PA3 - Normal input (USART2 RX). - * PA9 - Alternate output (USART1 TX). - * PA10 - Normal input (USART1 RX). - */ -#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ -#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ -#define VAL_GPIOAODR 0xFFFFFFFF - -/* - * Port B setup. - * Everything input with pull-up except: - * PB10 - Push Pull output (USB switch). - */ -#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ -#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ -#define VAL_GPIOBODR 0xFFFFFFFF - -/* - * Port C setup. - * Everything input with pull-up except: - * PC13 - Push Pull output (LED). - */ -#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ -#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ -#define VAL_GPIOCODR 0xFFFFFFFF - -/* - * Port D setup. - * Everything input with pull-up except: - * PD0 - Normal input (XTAL). - * PD1 - Normal input (XTAL). - */ -#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ -#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ -#define VAL_GPIODODR 0xFFFFFFFF - -/* - * Port E setup. - * Everything input with pull-up except: - */ -#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ -#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ -#define VAL_GPIOEODR 0xFFFFFFFF - -/* - * USB bus activation macro, required by the USB driver. - */ -/* The point is that most of the generic STM32F103* boards - have a 1.5k resistor connected on one end to the D+ line - and on the other end to some pin. Or even a slightly more - complicated "USB enable" circuit, controlled by a pin. - That should go here. - - However on some boards (e.g. one that I have), there's no - such hardware. In which case it's better to not do anything. -*/ -/* -#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) -*/ -#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); - -/* - * USB bus de-activation macro, required by the USB driver. - */ -/* -#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) -*/ -#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOC_LED 13 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk index d692c0ee4..48e0e51fe 100644 --- a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk +++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk @@ -1,5 +1,5 @@ -# List of all the board related files. -BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c - -# Required include directories -BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103 +# List of all the board related files. +BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/chibios_test/ld/MKL26Z64.ld b/keyboards/chibios_test/ld/MKL26Z64.ld index fb141f888..c4ca8b874 100644 --- a/keyboards/chibios_test/ld/MKL26Z64.ld +++ b/keyboards/chibios_test/ld/MKL26Z64.ld @@ -1,105 +1,105 @@ -/* - * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com - * (C) 2016 flabbergast - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * KL26Z64 memory setup. - */ -MEMORY -{ - flash0 : org = 0x00000000, len = 0x100 - flash1 : org = 0x00000400, len = 0x10 - flash2 : org = 0x00000410, len = 62k - 0x410 - flash3 : org = 0x0000F800, len = 2k - flash4 : org = 0x00000000, len = 0 - flash5 : org = 0x00000000, len = 0 - flash6 : org = 0x00000000, len = 0 - flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x1FFFF800, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* Flash region for the configuration bytes.*/ -SECTIONS -{ - .cfmprotect : ALIGN(4) SUBALIGN(4) - { - KEEP(*(.cfmconfig)) - } > flash1 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash0); -REGION_ALIAS("VECTORS_FLASH_LMA", flash0); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash2); -REGION_ALIAS("XTORS_FLASH_LMA", flash2); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash2); -REGION_ALIAS("TEXT_FLASH_LMA", flash2); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash2); -REGION_ALIAS("RODATA_FLASH_LMA", flash2); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash2); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash2); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -__eeprom_workarea_start__ = ORIGIN(flash3); -__eeprom_workarea_size__ = LENGTH(flash3); -__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; - -/* Generic rules inclusion.*/ -INCLUDE rules.ld +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld index 00613328e..f9bfe9c00 100644 --- a/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld +++ b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld @@ -1,88 +1,88 @@ -/* - ChibiOS - Copyright (C) 2006..2016 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. -*/ - -/* - * ST32F103xB memory setup for use with the maplemini bootloader. - * You will have to - * #define CORTEX_VTOR_INIT 0x5000 - * in your projects chconf.h - */ -MEMORY -{ - flash0 : org = 0x08002000, len = 128k - 0x2000 - flash1 : org = 0x00000000, len = 0 - flash2 : org = 0x00000000, len = 0 - flash3 : org = 0x00000000, len = 0 - flash4 : org = 0x00000000, len = 0 - flash5 : org = 0x00000000, len = 0 - flash6 : org = 0x00000000, len = 0 - flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x20000000, len = 20k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash0); -REGION_ALIAS("VECTORS_FLASH_LMA", flash0); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash0); -REGION_ALIAS("XTORS_FLASH_LMA", flash0); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash0); -REGION_ALIAS("TEXT_FLASH_LMA", flash0); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash0); -REGION_ALIAS("RODATA_FLASH_LMA", flash0); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash0); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash0); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -/* Generic rules inclusion.*/ -INCLUDE rules.ld +/* + ChibiOS - Copyright (C) 2006..2016 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. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 128k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/chibios_test/rules.mk b/keyboards/chibios_test/rules.mk new file mode 100644 index 000000000..4b5a84535 --- /dev/null +++ b/keyboards/chibios_test/rules.mk @@ -0,0 +1,8 @@ +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover +CUSTOM_MATRIX ?= yes # Custom matrix file \ No newline at end of file diff --git a/keyboards/chibios_test/stm32_f072_onekey/Makefile b/keyboards/chibios_test/stm32_f072_onekey/Makefile index eae38c4b2..191c6bb66 100644 --- a/keyboards/chibios_test/stm32_f072_onekey/Makefile +++ b/keyboards/chibios_test/stm32_f072_onekey/Makefile @@ -1,41 +1,3 @@ -# project specific files -SRC = matrix.c \ - led.c - -## chip/board settings -# the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F0xx -# linker script to use -# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F072xB -# startup code to use -# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f0xx -# it should exist either in /os/hal/boards/ -# or /boards -BOARD = ST_STM32F072B_DISCOVERY -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m0 -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 6 -# If you want to be able to jump to bootloader from firmware on STM32 MCUs, -# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in -# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have -# a custom board definition that you plan to reuse). -# If you're not setting it here, leave it commented out. -# 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 -#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 - -# Build Options -# comment out to disable the options. -# -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h index 3d877aaa2..faca3defd 100644 --- a/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h +++ b/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h @@ -1,171 +1,171 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -/* - * STM32F0xx 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: - * 3...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F0xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_HSI14_ENABLED TRUE -#define STM32_HSI48_ENABLED FALSE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED FALSE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 12 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE STM32_PPRE_DIV1 -#define STM32_ADCSW STM32_ADCSW_HSI14 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_ADCSW STM32_ADCSW_HSI14 -#define STM32_USBSW STM32_USBSW_HSI48 -#define STM32_CECSW STM32_CECSW_HSI -#define STM32_I2C1SW STM32_I2C1SW_HSI -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_RTCSEL STM32_RTCSEL_LSI - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_IRQ_PRIORITY 2 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM14 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 2 -#define STM32_GPT_TIM2_IRQ_PRIORITY 2 -#define STM32_GPT_TIM3_IRQ_PRIORITY 2 -#define STM32_GPT_TIM14_IRQ_PRIORITY 2 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 3 -#define STM32_I2C_I2C2_IRQ_PRIORITY 3 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#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_TIM3 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 3 -#define STM32_ICU_TIM2_IRQ_PRIORITY 3 -#define STM32_ICU_TIM3_IRQ_PRIORITY 3 - -/* - * 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_TIM3 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 3 -#define STM32_PWM_TIM2_IRQ_PRIORITY 3 -#define STM32_PWM_TIM3_IRQ_PRIORITY 3 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USART1_PRIORITY 3 -#define STM32_SERIAL_USART2_PRIORITY 3 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 2 -#define STM32_SPI_SPI2_IRQ_PRIORITY 2 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 2 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 3 -#define STM32_UART_USART2_IRQ_PRIORITY 3 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#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_LP_IRQ_PRIORITY 3 - -#endif /* _MCUCONF_H_ */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx 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: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#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_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * 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_TIM3 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#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_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/chibios_test/stm32_f072_onekey/rules.mk b/keyboards/chibios_test/stm32_f072_onekey/rules.mk new file mode 100644 index 000000000..eae38c4b2 --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/rules.mk @@ -0,0 +1,41 @@ +# project specific files +SRC = matrix.c \ + led.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# 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 +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# +ifndef QUANTUM_DIR + include ../../../Makefile +endif diff --git a/keyboards/chibios_test/stm32_f103_onekey/Makefile b/keyboards/chibios_test/stm32_f103_onekey/Makefile index 307ca5b19..191c6bb66 100644 --- a/keyboards/chibios_test/stm32_f103_onekey/Makefile +++ b/keyboards/chibios_test/stm32_f103_onekey/Makefile @@ -1,52 +1,3 @@ -# project specific files -SRC = matrix.c \ - led.c - -# GENERIC STM32F103C8T6 board - stm32duino bootloader -OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 -MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader -BOARD = GENERIC_STM32_F103 - -# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD) -# OPT_DEFS = -# MCU_LDSCRIPT = STM32F103x8 -# BOARD = GENERIC_STM32_F103 - -# MAPLE MINI -# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000 -# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader -# BOARD = MAPLEMINI_STM32_F103 - -## chip/board settings -# the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F1xx -# linker script to use -# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# startup code to use -# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f1xx -# it should exist either in /os/hal/boards/ -# or /boards -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m3 -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 7 -# If you want to be able to jump to bootloader from firmware on STM32 MCUs, -# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in -# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have -# a custom board definition that you plan to reuse). -# If you're not setting it here, leave it commented out. -# 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 -#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h index 626332a6a..276829216 100644 --- a/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h +++ b/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h @@ -1,209 +1,209 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -#define STM32F103_MCUCONF - -/* - * STM32F103 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. - */ - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED FALSE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 -#define STM32_PLLMUL_VALUE 9 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_USB_CLOCK_REQUIRED TRUE -#define STM32_USBPRE STM32_USBPRE_DIV1P5 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_RTCSEL STM32_RTCSEL_HSEDIV -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC1_IRQ_PRIORITY 6 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_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_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * 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_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * RTC driver system settings. - */ -#define STM32_RTC_IRQ_PRIORITY 15 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_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 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#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 - -#endif /* _MCUCONF_H_ */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define STM32F103_MCUCONF + +/* + * STM32F103 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. + */ + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED FALSE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_RTCSEL STM32_RTCSEL_HSEDIV +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC1_IRQ_PRIORITY 6 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM5 FALSE +#define STM32_GPT_USE_TIM8 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM5_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 5 +#define STM32_I2C_I2C2_IRQ_PRIORITY 5 +#define STM32_I2C_I2C1_DMA_PRIORITY 3 +#define STM32_I2C_I2C2_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_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM5_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * 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_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM5 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM5_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * RTC driver system settings. + */ +#define STM32_RTC_IRQ_PRIORITY 15 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_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 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#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 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/chibios_test/stm32_f103_onekey/rules.mk b/keyboards/chibios_test/stm32_f103_onekey/rules.mk new file mode 100644 index 000000000..307ca5b19 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/rules.mk @@ -0,0 +1,52 @@ +# project specific files +SRC = matrix.c \ + led.c + +# GENERIC STM32F103C8T6 board - stm32duino bootloader +OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000 +MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader +BOARD = GENERIC_STM32_F103 + +# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD) +# OPT_DEFS = +# MCU_LDSCRIPT = STM32F103x8 +# BOARD = GENERIC_STM32_F103 + +# MAPLE MINI +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000 +# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader +# BOARD = MAPLEMINI_STM32_F103 + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# 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 +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +ifndef QUANTUM_DIR + include ../../../Makefile +endif diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile b/keyboards/chibios_test/teensy_lc_onekey/Makefile index 43ea9d82d..191c6bb66 100644 --- a/keyboards/chibios_test/teensy_lc_onekey/Makefile +++ b/keyboards/chibios_test/teensy_lc_onekey/Makefile @@ -1,49 +1,3 @@ -# project specific files -SRC = matrix.c \ - led.c - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -MCU_FAMILY = KINETIS -MCU_SERIES = KL2x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -MCU_LDSCRIPT = MKL26Z64 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = kl2x - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -BOARD = PJRC_TEENSY_LC - -# Cortex version -# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4 -MCU = cortex-m0plus - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile endif \ No newline at end of file diff --git a/keyboards/chibios_test/teensy_lc_onekey/chconf.h b/keyboards/chibios_test/teensy_lc_onekey/chconf.h index cb36996c3..3294ac7ee 100644 --- a/keyboards/chibios_test/teensy_lc_onekey/chconf.h +++ b/keyboards/chibios_test/teensy_lc_onekey/chconf.h @@ -1,524 +1,524 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 1000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 0 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 20 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/* Use __WFI in the idle thread for waiting. Does lower the power - * consumption. */ -#define CORTEX_ENABLE_WFI_IDLE TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK TRUE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS TRUE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS TRUE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK TRUE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS TRUE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 1000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK TRUE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS TRUE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS TRUE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS TRUE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/chibios_test/teensy_lc_onekey/halconf.h b/keyboards/chibios_test/teensy_lc_onekey/halconf.h index b1d2cd550..0436408b0 100644 --- a/keyboards/chibios_test/teensy_lc_onekey/halconf.h +++ b/keyboards/chibios_test/teensy_lc_onekey/halconf.h @@ -1,187 +1,187 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h b/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h index c63659019..2764e8898 100644 --- a/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h +++ b/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h @@ -1,55 +1,55 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -#define KL2x_MCUCONF - -/* - * HAL driver system settings. - */ -#if 1 -/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */ -#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE -#define KINETIS_PLLCLK_FREQUENCY 96000000UL -#define KINETIS_SYSCLK_FREQUENCY 48000000UL -#endif - -#if 0 -/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */ -#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI -#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ -#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ -#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ -#define KINETIS_CLKDIV1_OUTDIV1 1 /* do not divide system clock */ -#endif - -/* - * SERIAL driver system settings. - */ -#define KINETIS_SERIAL_USE_UART0 TRUE - -/* - * USB driver settings - */ -#define KINETIS_USB_USE_USB0 TRUE -/* Need to redefine this, since the default is for K20x */ -/* This is for Teensy LC; you should comment it out (or change to 5) - * for Teensy 3.x */ -#define KINETIS_USB_USB0_IRQ_PRIORITY 2 - -#endif /* _MCUCONF_H_ */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define KL2x_MCUCONF + +/* + * HAL driver system settings. + */ +#if 1 +/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */ +#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE +#define KINETIS_PLLCLK_FREQUENCY 96000000UL +#define KINETIS_SYSCLK_FREQUENCY 48000000UL +#endif + +#if 0 +/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */ +#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI +#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ +#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ +#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ +#define KINETIS_CLKDIV1_OUTDIV1 1 /* do not divide system clock */ +#endif + +/* + * SERIAL driver system settings. + */ +#define KINETIS_SERIAL_USE_UART0 TRUE + +/* + * USB driver settings + */ +#define KINETIS_USB_USE_USB0 TRUE +/* Need to redefine this, since the default is for K20x */ +/* This is for Teensy LC; you should comment it out (or change to 5) + * for Teensy 3.x */ +#define KINETIS_USB_USB0_IRQ_PRIORITY 2 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/chibios_test/teensy_lc_onekey/rules.mk b/keyboards/chibios_test/teensy_lc_onekey/rules.mk new file mode 100644 index 000000000..43ea9d82d --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/rules.mk @@ -0,0 +1,49 @@ +# project specific files +SRC = matrix.c \ + led.c + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +MCU_FAMILY = KINETIS +MCU_SERIES = KL2x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +MCU_LDSCRIPT = MKL26Z64 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = kl2x + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +BOARD = PJRC_TEENSY_LC + +# Cortex version +# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4 +MCU = cortex-m0plus + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/clueboard/Makefile b/keyboards/clueboard/Makefile index ccc01ea9a..b9bada8f8 100644 --- a/keyboards/clueboard/Makefile +++ b/keyboards/clueboard/Makefile @@ -1,109 +1,5 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - SUBPROJECT_DEFAULT = rev2 -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/clueboard/config.h b/keyboards/clueboard/config.h index ceac80795..ad6832385 100644 --- a/keyboards/clueboard/config.h +++ b/keyboards/clueboard/config.h @@ -29,9 +29,6 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 diff --git a/keyboards/clueboard/keymaps/default/keymap.c b/keyboards/clueboard/keymaps/default/keymap.c index 896bc7ebc..01f158bf0 100644 --- a/keyboards/clueboard/keymaps/default/keymap.c +++ b/keyboards/clueboard/keymaps/default/keymap.c @@ -66,19 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----------------------------------------------------------------------------------' */ [_RS] = KEYMAP( - #ifdef RGBLIGHT_ENABLE KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \ 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, RGB_VAD, \ KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \ KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI), - #else - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - 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, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS), - #endif }; enum function_id { diff --git a/keyboards/clueboard/keymaps/skully/readme.md b/keyboards/clueboard/keymaps/skully/readme.md new file mode 100644 index 000000000..c1182123d --- /dev/null +++ b/keyboards/clueboard/keymaps/skully/readme.md @@ -0,0 +1,5 @@ +# skullY's Clueboard Layout + +This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. + +The most notable change from the default layout is putting Ctrl on the Capslock key. I also swap Alt and Cmd because I mostly use a Mac day to day. diff --git a/keyboards/clueboard/readme.md b/keyboards/clueboard/readme.md index aa301f020..4a76e2908 100644 --- a/keyboards/clueboard/readme.md +++ b/keyboards/clueboard/readme.md @@ -1,4 +1,97 @@ Clueboard keyboard firmware ====================== -TODO: to be updated. +DIY/Assembled compact 66% keyboard by [Clueboard](http://clueboard.co). + +For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md). + +## First Time Setup + +Download or clone the whole firmware and navigate to the keyboards/clueboard directory. Once your dev env is setup, you'll be able to generate the default .hex: + +``` +$ make +``` + +You will see a lot of output and if everything worked correctly you will see something similar to this: + +``` +Size after: + text data bss dec hex filename + 0 19992 0 19992 4e18 clueboard_rev2_default.hex +``` + +At this point you can press RESET on your Clueboard and flash your keyboard with this command: + +``` +$ make dfu +``` + +If you would like to use one of the alternative keymaps, or create your own, see below. + +## Clueboard 1.0 + +If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `rev1` to your make command, like this: + +``` +$ make rev1 +``` + +And when flashing your keyboard: + +``` +$ make rev1-dfu +``` + +If you are flashing an alternative layout to your rev1, include both `rev1` and `` in your command, for example when flashing max: + +``` +$ make rev1-max-dfu +``` + +## Alternate Keymaps + +There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `` to your command: + +``` +$ make skully +``` + +And when flashing your keyboard, put `` between "make" and "dfu": + +``` +$ make skully-dfu +``` + +### Notable Layouts + +These layouts are notable for one reason or another. If you are looking for ideas or inspiration you should look at these first: + +* [keymaps/default](keymaps/default) - The default Clueboard layout +* [keymaps/max](keymaps/max) - A maximised layout that makes use of every key and feature of the Clueboard 2.0 PCB. +* [keymaps/skully](keymaps/skully) - The layout that @skullydazed uses on his own Clueboards. + +## Create Your Own Keymap + +There are a lot of possibilities when creating your own keymap, and the primary documentation for doing that is [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md. As a way to get started, here is the procedure I recommend: + +* Copy `[keymaps/default](keymaps/default/)` to `keymaps/`. +* Compile the firmware (`$ make `) +* Flash the firmware (`$ make -dfu`) +* Make sure everything works like the default keyboard +* Modify `keymaps//readme.md` to tell others about your layout. +* Modify `keymaps//keymap.c` to reflect your desired layout. +* Compile your new custom firmware (`$ make `) +** If you have warnings you may flash without fixing them, but something may not work right. +** If you have any errors you must fix them before continuing. +* Flash the firmware (`$ make -dfu`) + +## Share Your Keymap + +Got your layout dialed in? Please share it with the world so we can benefit from your work! Simply submit a pull request with your layout and we'll include it in the official repository. Please use the following guidelines when putting together your pull request: + +* Include a readme.md that states what your primary keyboard use is, how your layout differs from the default, and highlights anything you think makes your layout particularly great. +* If your layout requires certain features (EG, RGB underlight or backlighting) ensure you have a Makefile and config.h that reflects that +* If your layout requires special hardware to be added, please describe that in the readme.md + +TODO: Write up or link quick how-to on creating and submitting a PR. (Pull requests accepted. :) diff --git a/keyboards/clueboard/rev1/Makefile b/keyboards/clueboard/rev1/Makefile index 80a942d06..191c6bb66 100644 --- a/keyboards/clueboard/rev1/Makefile +++ b/keyboards/clueboard/rev1/Makefile @@ -1,5 +1,3 @@ -BACKLIGHT_ENABLE = no - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/clueboard/rev1/rules.mk b/keyboards/clueboard/rev1/rules.mk new file mode 100644 index 000000000..80a942d06 --- /dev/null +++ b/keyboards/clueboard/rev1/rules.mk @@ -0,0 +1,5 @@ +BACKLIGHT_ENABLE = no + +ifndef QUANTUM_DIR + include ../../../Makefile +endif diff --git a/keyboards/clueboard/rev2/Makefile b/keyboards/clueboard/rev2/Makefile index cea967b79..191c6bb66 100644 --- a/keyboards/clueboard/rev2/Makefile +++ b/keyboards/clueboard/rev2/Makefile @@ -1,5 +1,3 @@ -BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h index 02982ff29..15ca4ece8 100644 --- a/keyboards/clueboard/rev2/config.h +++ b/keyboards/clueboard/rev2/config.h @@ -36,4 +36,4 @@ #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -#endif \ No newline at end of file +#endif diff --git a/keyboards/clueboard/rev2/rules.mk b/keyboards/clueboard/rev2/rules.mk new file mode 100644 index 000000000..cea967b79 --- /dev/null +++ b/keyboards/clueboard/rev2/rules.mk @@ -0,0 +1,5 @@ +BACKLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../Makefile +endif diff --git a/keyboards/clueboard/rules.mk b/keyboards/clueboard/rules.mk new file mode 100644 index 000000000..3909fbd5c --- /dev/null +++ b/keyboards/clueboard/rules.mk @@ -0,0 +1,103 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/clueboard2/clueboard2.c b/keyboards/clueboard2/clueboard2.c deleted file mode 100644 index d78ffed9b..000000000 --- a/keyboards/clueboard2/clueboard2.c +++ /dev/null @@ -1,63 +0,0 @@ -#include "clueboard2.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); - - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC1ED +#define PRODUCT_ID 0x2330 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Clueboard +#define PRODUCT ATMEGA32U4 Firmware Dev Kit +#define DESCRIPTION A small board to help you hack on QMK. + +/* key matrix size */ +#define MATRIX_ROWS 4 +#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 { F0, F5, F4, B4 } +#define MATRIX_COL_PINS { F1, F7, F6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 20 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 6 + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* Underlight configuration + */ +#define RGB_DI_PIN E6 +//#define RGBLIGHT_TIMER +#define RGBLED_NUM 4 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/cluecard/keymaps/default/Makefile b/keyboards/cluecard/keymaps/default/Makefile new file mode 100644 index 000000000..8ee841da0 --- /dev/null +++ b/keyboards/cluecard/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/cluecard/keymaps/default/config.h b/keyboards/cluecard/keymaps/default/config.h new file mode 100644 index 000000000..8893d122e --- /dev/null +++ b/keyboards/cluecard/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/cluecard/keymaps/default/keymap.c b/keyboards/cluecard/keymaps/default/keymap.c new file mode 100644 index 000000000..517afe867 --- /dev/null +++ b/keyboards/cluecard/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +#include "cluecard.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( + RGB_TOG, RGB_SAI, RGB_VAI, \ + RGB_HUD, RGB_HUI, \ + RGB_MOD, RGB_SAD, RGB_VAD, \ + BL_STEP, \ + F(0), F(1), F(2) \ + ) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(0), + [1] = ACTION_FUNCTION(1), + [2] = ACTION_FUNCTION(2) +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (record->event.pressed) { + switch (id) { + case 0: + PLAY_NOTE_ARRAY(tone_startup, false, 0); + break; + case 1: + PLAY_NOTE_ARRAY(music_scale, false, 0); + break; + case 2: + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + break; + } + } +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { +} diff --git a/keyboards/cluecard/keymaps/default/readme.md b/keyboards/cluecard/keymaps/default/readme.md new file mode 100644 index 000000000..9e3b97bea --- /dev/null +++ b/keyboards/cluecard/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cluecard diff --git a/keyboards/cluecard/readme.md b/keyboards/cluecard/readme.md new file mode 100644 index 000000000..be13fc017 --- /dev/null +++ b/keyboards/cluecard/readme.md @@ -0,0 +1,28 @@ +cluecard keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/cluecard folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make default`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + +``` +$ make [default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/cluecard/rules.mk b/keyboards/cluecard/rules.mk new file mode 100644 index 000000000..454235877 --- /dev/null +++ b/keyboards/cluecard/rules.mk @@ -0,0 +1,70 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= no # USB Nkey Rollover +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= yes # Audio output on port C6 diff --git a/keyboards/cluepad/Makefile b/keyboards/cluepad/Makefile index a331ff4dc..4e2a6f00f 100644 --- a/keyboards/cluepad/Makefile +++ b/keyboards/cluepad/Makefile @@ -1,70 +1,3 @@ - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -# CONSOLE_ENABLE ?= yes # Console for debug(+400) -# COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable numpad's backlight functionality -RGBLIGHT_ENABLE ?= yes -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/cluepad/rules.mk b/keyboards/cluepad/rules.mk new file mode 100644 index 000000000..19b16b95a --- /dev/null +++ b/keyboards/cluepad/rules.mk @@ -0,0 +1,65 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +# CONSOLE_ENABLE ?= yes # Console for debug(+400) +# COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable numpad's backlight functionality +RGBLIGHT_ENABLE ?= yes +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/ergodox/Makefile b/keyboards/ergodox/Makefile new file mode 100644 index 000000000..716535005 --- /dev/null +++ b/keyboards/ergodox/Makefile @@ -0,0 +1,5 @@ +SUBPROJECT_DEFAULT = ez + +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h new file mode 100644 index 000000000..edc60caae --- /dev/null +++ b/keyboards/ergodox/config.h @@ -0,0 +1,36 @@ +#ifndef KEYBOARDS_ERGODOX_CONFIG_H_ +#define KEYBOARDS_ERGODOX_CONFIG_H_ + +#define MOUSEKEY_DELAY 100 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 3 +#define MOUSEKEY_TIME_TO_MAX 10 + +#define TAPPING_TOGGLE 1 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +#ifdef SUBPROJECT_ez + #include "ez/config.h" +#endif +#ifdef SUBPROJECT_infinity + #include "infinity/config.h" +#endif + + +#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ diff --git a/keyboards/ergodox/ergodox.c b/keyboards/ergodox/ergodox.c new file mode 100644 index 000000000..e69de29bb diff --git a/keyboards/ergodox/ergodox.h b/keyboards/ergodox/ergodox.h new file mode 100644 index 000000000..f8ec8b5bf --- /dev/null +++ b/keyboards/ergodox/ergodox.h @@ -0,0 +1,10 @@ +#ifndef KEYBOARDS_ERGODOX_ERGODOX_H_ +#define KEYBOARDS_ERGODOX_ERGODOX_H_ +#ifdef SUBPROJECT_ez + #include "ez.h" +#endif +#ifdef SUBPROJECT_infinity + #include "infinity.h" +#endif + +#endif /* KEYBOARDS_ERGODOX_ERGODOX_H_ */ diff --git a/keyboards/ergodox_ez/190hotfix.sh b/keyboards/ergodox/ez/190hotfix.sh similarity index 100% rename from keyboards/ergodox_ez/190hotfix.sh rename to keyboards/ergodox/ez/190hotfix.sh diff --git a/keyboards/ergodox/ez/Makefile b/keyboards/ergodox/ez/Makefile new file mode 100644 index 000000000..191c6bb66 --- /dev/null +++ b/keyboards/ergodox/ez/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h new file mode 100644 index 000000000..084a044ee --- /dev/null +++ b/keyboards/ergodox/ez/config.h @@ -0,0 +1,65 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk + +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 . +*/ + +#ifndef ERGODOX_EZ_CONFIG_H +#define ERGODOX_EZ_CONFIG_H + +#include "../config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1307 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ErgoDox EZ +#define PRODUCT ErgoDox EZ +#define DESCRIPTION QMK keyboard firmware for Ergodox EZ + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 6 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +//#define DEBUG_MATRIX_SCAN_RATE + +#endif diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox/ez/ez.c similarity index 99% rename from keyboards/ergodox_ez/ergodox_ez.c rename to keyboards/ergodox/ez/ez.c index f0558d9f2..e7afc9859 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox/ez/ez.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ez.h" #include "i2cmaster.h" bool i2c_initialized = 0; diff --git a/keyboards/ergodox_ez/ergodox_ez.h b/keyboards/ergodox/ez/ez.h similarity index 100% rename from keyboards/ergodox_ez/ergodox_ez.h rename to keyboards/ergodox/ez/ez.h diff --git a/keyboards/ergodox_ez/i2cmaster.h b/keyboards/ergodox/ez/i2cmaster.h similarity index 100% rename from keyboards/ergodox_ez/i2cmaster.h rename to keyboards/ergodox/ez/i2cmaster.h diff --git a/keyboards/ergodox/ez/keymaps/steno/Makefile b/keyboards/ergodox/ez/keymaps/steno/Makefile new file mode 100644 index 000000000..b6fb9b1a8 --- /dev/null +++ b/keyboards/ergodox/ez/keymaps/steno/Makefile @@ -0,0 +1,3 @@ +VIRTSER_ENABLE = yes +# Not enough interupts, so something has to go +MOUSEKEY_ENABLE = no diff --git a/keyboards/ergodox/ez/keymaps/steno/keymap.c b/keyboards/ergodox/ez/keymaps/steno/keymap.c new file mode 100644 index 000000000..3e9830905 --- /dev/null +++ b/keyboards/ergodox/ez/keymaps/steno/keymap.c @@ -0,0 +1,324 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "sendchar.h" +#include "virtser.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define TXBOLT 3 // TxBolt Steno Virtual Serial +#define TXBOLT2 4 // TxBolt Steno Virtual Serial Alternative Layout + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | TX | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | BOLT |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(TXBOLT), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | RESET | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +// TxBolt Codes +#define Sl 0b00000001 +#define Tl 0b00000010 +#define Kl 0b00000100 +#define Pl 0b00001000 +#define Wl 0b00010000 +#define Hl 0b00100000 +#define Rl 0b01000001 +#define Al 0b01000010 +#define Ol 0b01000100 +#define X 0b01001000 +#define Er 0b01010000 +#define Ur 0b01100000 +#define Fr 0b10000001 +#define Rr 0b10000010 +#define Pr 0b10000100 +#define Br 0b10001000 +#define Lr 0b10010000 +#define Gr 0b10100000 +#define Tr 0b11000001 +#define Sr 0b11000010 +#define Dr 0b11000100 +#define Zr 0b11001000 +#define NM 0b11010000 +#define GRPMASK 0b11000000 +#define GRP0 0b00000000 +#define GRP1 0b01000000 +#define GRP2 0b10000000 +#define GRP3 0b11000000 +/* Keymap 3: TxBolt (Serial) + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | BKSPC | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | # | # | # | # | # | | | | # | # | # | # | # | # | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | S | T | P | H | * |------| |------| * | F | P | L | T | D | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | S | K | W | R | * | | | | * | R | B | G | S | Z | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | A | O |------| |------| E | U | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// TxBolt over Serial +[TXBOLT] = KEYMAP( + KC_BSPC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, M(NM), M(NM), M(NM), M(NM), M(NM), KC_NO, + KC_NO, M(Sl), M(Tl), M(Pl), M(Hl), M(X), + KC_NO, M(Sl), M(Kl), M(Wl), M(Rl), M(X), KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + M(Al), M(Ol), KC_NO, + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, M(NM), M(NM), M(NM), M(NM), M(NM), M(NM), + M(X), M(Fr), M(Pr), M(Lr), M(Tr), M(Dr), + KC_NO, M(X), M(Rr), M(Br), M(Gr), M(Sr), M(Zr), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, M(Er), M(Ur) +), +/* Keymap 4: TxBolt (Serial) Alternative + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | # | # | # | # | # | | | | # | # | # | # | # | # | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | S | T | P | H | * | | | | * | F | P | L | T | D | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | S | K | W | R | * |------| |------| * | R | B | G | S | Z | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | A | O | | E | U | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// TxBolt over Serial +[TXBOLT2] = KEYMAP( + KC_NO, M(NM), M(NM), M(NM), M(NM), M(NM), KC_NO, + KC_NO, M(Sl), M(Tl), M(Pl), M(Hl), M(X), KC_NO, + KC_NO, M(Sl), M(Kl), M(Wl), M(Rl), M(X), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, M(Al), M(Ol), + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO, + // right hand + KC_NO, M(NM), M(NM), M(NM), M(NM), M(NM), M(NM), + KC_TRNS, M(X), M(Fr), M(Pr), M(Lr), M(Tr), M(Dr), + M(X), M(Rr), M(Br), M(Gr), M(Sr), M(Zr), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + M(Er), M(Ur), KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +uint8_t chord[4] = {0,0,0,0}; +uint8_t pressed_count = 0; + +void send_chord(void) +{ + for(uint8_t i = 0; i < 4; i++) + { + if(chord[i]) + virtser_send(chord[i]); + } + virtser_send(0); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + // We need to track keypresses in all modes, in case the user + // changes mode whilst pressing other keys. + if (record->event.pressed) + pressed_count++; + else + pressed_count--; + return true; +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + + if (record->event.pressed) { + uint8_t grp = (id & GRPMASK) >> 6; + chord[grp] |= id; + } + else { + if (pressed_count == 0) { + send_chord(); + chord[0] = chord[1] = chord[2] = chord[3] = 0; + } + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/ez/keymaps/steno/readme.md b/keyboards/ergodox/ez/keymaps/steno/readme.md new file mode 100644 index 000000000..d67cde2a3 --- /dev/null +++ b/keyboards/ergodox/ez/keymaps/steno/readme.md @@ -0,0 +1,92 @@ +# ErgoDox EZ Steno Configuration + +This layout has a layer that uses the TxBolt Stenograph protocol over a Virtual Serial port. It requires something like Plover in order to function. + +In Plover, you can select TX Bolt as the Stenotype Machine, and find the COM port that was assigned. In this way, your regular keyboard will still function normally, and you can switch back and forth between the Steno and Keyboard layers. + +

+/* Keymap 0: Basic layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |   =    |   1  |   2  |   3  |   4  |   5  | LEFT |           | RIGHT|   6  |   7  |   8  |   9  |   0  |   -    |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * | Del    |   Q  |   W  |   E  |   R  |   T  |  L1  |           |  TX  |   Y  |   U  |   I  |   O  |   P  |   \    |
+ * |--------+------+------+------+------+------|      |           | BOLT |------+------+------+------+------+--------|
+ * | BkSp   |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |; / L2|' / Cmd |
+ * |--------+------+------+------+------+------| Hyper|           | Meh  |------+------+------+------+------+--------|
+ * | LShift |Z/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |//Ctrl| RShift |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |Grv/L1|  '"  |AltShf| Left | Right|                                       |  Up  | Down |   [  |   ]  | ~L1  |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        | App  | LGui |       | Alt  |Ctrl/Esc|
+ *                                 ,------|------|------|       |------+--------+------.
+ *                                 |      |      | Home |       | PgUp |        |      |
+ *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
+ *                                 |      |ace   | End  |       | PgDn |        |      |
+ *                                 `--------------------'       `----------------------'
+ */
+/* Keymap 1: Symbol Layer
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * |Version |  F1  |  F2  |  F3  |  F4  |  F5  |      |           |      |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |   F12  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &  |   1  |   2  |   3  |   \  |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |    . |   0  |   =  |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |      |
+ *                                 |      |      |------|       |------|      |      |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+/* Keymap 2: Media keys
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * | RESET  |      |      |      |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |------|           |------|      |      |      |      |      |  Play  |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |      |      |      |      |      |      |           |      |      |      | Prev | Next |      |        |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |VolUp |VolDn | Mute |      |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |Brwser|
+ *                                 |      |      |------|       |------|      |Back  |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+/* Keymap 3: TxBolt (Serial)
+ *
+ * ,--------------------------------------------------.           ,--------------------------------------------------.
+ * | BKSPC  |      |      |      |      |      |      |           |      |      |      |      |      |      |        |
+ * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+ * |        |   #  |   #  |   #  |   #  |   #  |      |           |      |   #  |   #  |   #  |   #  |   #  |   #    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   S  |   T  |   P  |   H  |   *  |------|           |------|   *  |   F  |   P  |   L  |   T  |   D    |
+ * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+ * |        |   S  |   K  |   W  |   R  |   *  |      |           |      |   *  |   R  |   B  |   G  |   S  |   Z    |
+ * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
+ *   |      |      |      |      |      |                                       |      |      |      |      |      |
+ *   `----------------------------------'                                       `----------------------------------'
+ *                                        ,-------------.       ,-------------.
+ *                                        |      |      |       |      |      |
+ *                                 ,------|------|------|       |------+------+------.
+ *                                 |      |      |      |       |      |      |      |
+ *                                 |   A  |   O  |------|       |------|   E  |   U  |
+ *                                 |      |      |      |       |      |      |      |
+ *                                 `--------------------'       `--------------------'
+ */
+
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox/ez/matrix.c similarity index 99% rename from keyboards/ergodox_ez/matrix.c rename to keyboards/ergodox/ez/matrix.c index dc29cf5cd..a19bab90b 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox/ez/matrix.c @@ -33,7 +33,7 @@ along with this program. If not, see . #include "debug.h" #include "util.h" #include "matrix.h" -#include "ergodox_ez.h" +#include "ez.h" #include "i2cmaster.h" #ifdef DEBUG_MATRIX_SCAN_RATE #include "timer.h" diff --git a/keyboards/ergodox_ez/Makefile b/keyboards/ergodox/ez/rules.mk similarity index 79% rename from keyboards/ergodox_ez/Makefile rename to keyboards/ergodox/ez/rules.mk index 54edaed6d..37e554b30 100644 --- a/keyboards/ergodox_ez/Makefile +++ b/keyboards/ergodox/ez/rules.mk @@ -70,17 +70,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ -SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= yes # Unicode ifndef QUANTUM_DIR - include ../../Makefile + include ../../../Makefile endif diff --git a/keyboards/ergodox_ez/twimaster.c b/keyboards/ergodox/ez/twimaster.c similarity index 100% rename from keyboards/ergodox_ez/twimaster.c rename to keyboards/ergodox/ez/twimaster.c diff --git a/keyboards/ergodox_ez/keymaps/german-manuneo/compile_keymap.py b/keyboards/ergodox/ez/util/compile_keymap.py similarity index 100% rename from keyboards/ergodox_ez/keymaps/german-manuneo/compile_keymap.py rename to keyboards/ergodox/ez/util/compile_keymap.py diff --git a/keyboards/ergodox_ez/util/readme.md b/keyboards/ergodox/ez/util/readme.md similarity index 100% rename from keyboards/ergodox_ez/util/readme.md rename to keyboards/ergodox/ez/util/readme.md diff --git a/keyboards/infinity_chibios/MEMO.txt b/keyboards/ergodox/infinity/MEMO.txt similarity index 100% rename from keyboards/infinity_chibios/MEMO.txt rename to keyboards/ergodox/infinity/MEMO.txt diff --git a/keyboards/ergodox/infinity/Makefile b/keyboards/ergodox/infinity/Makefile new file mode 100644 index 000000000..191c6bb66 --- /dev/null +++ b/keyboards/ergodox/infinity/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/infinity_chibios/bootloader_defs.h b/keyboards/ergodox/infinity/bootloader_defs.h similarity index 100% rename from keyboards/infinity_chibios/bootloader_defs.h rename to keyboards/ergodox/infinity/bootloader_defs.h diff --git a/keyboards/infinity_ergodox/chconf.h b/keyboards/ergodox/infinity/chconf.h similarity index 100% rename from keyboards/infinity_ergodox/chconf.h rename to keyboards/ergodox/infinity/chconf.h diff --git a/keyboards/infinity_ergodox/config.h b/keyboards/ergodox/infinity/config.h similarity index 83% rename from keyboards/infinity_ergodox/config.h rename to keyboards/ergodox/infinity/config.h index d24ee0f05..9e264083b 100644 --- a/keyboards/infinity_ergodox/config.h +++ b/keyboards/ergodox/infinity/config.h @@ -15,8 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef INFINITY_ERGODOX_CONFIG_H +#define INFINITY_ERGODOX_CONFIG_H + +#include "../config.h" /* USB Device descriptor parameter */ @@ -35,25 +37,18 @@ along with this program. If not, see . #define MATRIX_COLS 5 #define LOCAL_MATRIX_ROWS 9 +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -/* 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Keymap for Infiity prototype */ -#define INFINITY_PROTOTYPE - #define SERIAL_LINK_BAUD 562500 #define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1) // The visualizer needs gfx thread priorities diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h rename to keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk rename to keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c rename to keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h rename to keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk rename to keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c rename to keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk rename to keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c rename to keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h rename to keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk rename to keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c rename to keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h rename to keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h similarity index 100% rename from keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h rename to keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h diff --git a/keyboards/infinity_ergodox/gfxconf.h b/keyboards/ergodox/infinity/gfxconf.h similarity index 100% rename from keyboards/infinity_ergodox/gfxconf.h rename to keyboards/ergodox/infinity/gfxconf.h diff --git a/keyboards/infinity_ergodox/halconf.h b/keyboards/ergodox/infinity/halconf.h similarity index 100% rename from keyboards/infinity_ergodox/halconf.h rename to keyboards/ergodox/infinity/halconf.h diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/ergodox/infinity/infinity.c similarity index 56% rename from keyboards/infinity_ergodox/infinity_ergodox.c rename to keyboards/ergodox/infinity/infinity.c index 87ed40fab..c5793385f 100644 --- a/keyboards/infinity_ergodox/infinity_ergodox.c +++ b/keyboards/ergodox/infinity/infinity.c @@ -1,8 +1,10 @@ -#include "infinity_ergodox.h" +#include "infinity.h" #include "ch.h" #include "hal.h" #include "serial_link/system/serial_link.h" +#ifdef VISUALIZER_ENABLE #include "lcd_backlight.h" +#endif void init_serial_link_hal(void) { PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); @@ -36,7 +38,7 @@ void init_serial_link_hal(void) { // Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced // Which will reduce the brightness range #define PRESCALAR_DEFINE 0 - +#ifdef VISUALIZER_ENABLE void lcd_backlight_hal_init(void) { // Setup Backlight SIM->SCGC6 |= SIM_SCGC6_FTM0; @@ -74,3 +76,81 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { CHANNEL_GREEN.CnV = g; CHANNEL_BLUE.CnV = b; } +#endif + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +void ergodox_board_led_on(void){ +} + +void ergodox_right_led_1_on(void){ +} + +void ergodox_right_led_2_on(void){ +} + +void ergodox_right_led_3_on(void){ +} + +void ergodox_right_led_on(uint8_t led){ +} + +void ergodox_board_led_off(void){ +} + +void ergodox_right_led_1_off(void){ +} + +void ergodox_right_led_2_off(void){ +} + +void ergodox_right_led_3_off(void){ +} + +void ergodox_right_led_off(uint8_t led){ +} + +#ifdef ONEHAND_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}}, + {{0, 10}, {1, 10}, {2, 10}, {3, 10}, {4, 10}}, + {{0, 11}, {1, 11}, {2, 11}, {3, 11}, {4, 11}}, + {{0, 12}, {1, 12}, {2, 12}, {3, 12}, {4, 12}}, + {{0, 13}, {1, 13}, {2, 13}, {3, 13}, {4, 13}}, + {{0, 14}, {1, 14}, {2, 14}, {3, 14}, {4, 14}}, + {{0, 15}, {1, 15}, {2, 15}, {3, 15}, {4, 15}}, + {{0, 16}, {1, 16}, {2, 16}, {3, 16}, {4, 16}}, + {{0, 17}, {1, 17}, {2, 17}, {3, 17}, {4, 17}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}}, + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}}, + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}}, + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}}, + {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}}, +}; +#endif diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h new file mode 100644 index 000000000..fec9e565c --- /dev/null +++ b/keyboards/ergodox/infinity/infinity.h @@ -0,0 +1,110 @@ +#ifndef KEYBOARDS_ERGODOX_INFINITY_INFINITY_H_ +#define KEYBOARDS_ERGODOX_INFINITY_INFINITY_H_ + +#include "quantum.h" + +void ergodox_board_led_on(void); +void ergodox_right_led_1_on(void); +void ergodox_right_led_2_on(void); +void ergodox_right_led_3_on(void); +void ergodox_right_led_on(uint8_t led); + +void ergodox_board_led_off(void); +void ergodox_right_led_1_off(void); +void ergodox_right_led_2_off(void); +void ergodox_right_led_3_off(void); +void ergodox_right_led_off(uint8_t led); + +inline void ergodox_led_all_on(void) +{ + ergodox_board_led_on(); + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); +} + +inline void ergodox_led_all_off(void) +{ + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +} + +inline void ergodox_right_led_1_set(uint8_t n){ + if (n) { + ergodox_right_led_1_on(); + } else { + ergodox_right_led_1_off(); + } +} + +inline void ergodox_right_led_2_set(uint8_t n){ + if (n) { + ergodox_right_led_2_on(); + } else { + ergodox_right_led_2_off(); + } +} + +inline void ergodox_right_led_3_set(uint8_t n){ + if (n) { + ergodox_right_led_3_on(); + } else { + ergodox_right_led_3_off(); + } +} + +inline void ergodox_right_led_set(uint8_t led, uint8_t n){ + if (n) { + ergodox_right_led_on(led); + } else { + ergodox_right_led_off(led); + } +} + +inline void ergodox_led_all_set(uint8_t n) { + ergodox_right_led_1_set(n); + ergodox_right_led_2_set(n); + ergodox_right_led_3_set(n); +} + +#define KEYMAP( \ + A80, A70, A60, A50, A40, A30, A20, \ + A81, A71, A61, A51, A41, A31, A21, \ + A82, A72, A62, A52, A42, A32, \ + A83, A73, A63, A53, A43, A33, A23, \ + A84, A74, A64, A54, A44, \ + A13, A03, \ + A04, \ + A34, A24, A14, \ + B20, B30, B40, B50, B60, B70, B80, \ + B21, B31, B41, B51, B61, B71, B81, \ + B32, B42, B52, B62, B72, B82, \ + B23, B33, B43, B53, B63, B73, B83, \ + B44, B54, B64, B74, B84, \ + B03, B13, \ + B04, \ + B14, B24, B34 \ +) { \ + { KC_NO, KC_NO, KC_NO, A03, A04 }, \ + { KC_NO, KC_NO, KC_NO, A13, A14 }, \ + { A20, A21, KC_NO, A23, A24 }, \ + { A30, A31, A32, A33, A34 }, \ + { A40, A41, A42, A43, A44 }, \ + { A50, A51, A52, A53, A54 }, \ + { A60, A61, A62, A63, A64 }, \ + { A70, A71, A72, A73, A74 }, \ + { A80, A81, A82, A83, A84 }, \ + { KC_NO, KC_NO, KC_NO, B03, B04 }, \ + { KC_NO, KC_NO, KC_NO, B13, B14 }, \ + { B20, B21, KC_NO, B23, B24 }, \ + { B30, B31, B32, B33, B34 }, \ + { B40, B41, B42, B43, B44 }, \ + { B50, B51, B52, B53, B54 }, \ + { B60, B61, B62, B63, B64 }, \ + { B70, B71, B72, B73, B74 }, \ + { B80, B81, B82, B83, B84 } \ +} + +#endif /* KEYBOARDS_ERGODOX_INFINITY_INFINITY_H_ */ diff --git a/keyboards/infinity_ergodox/led.c b/keyboards/ergodox/infinity/led.c similarity index 100% rename from keyboards/infinity_ergodox/led.c rename to keyboards/ergodox/infinity/led.c diff --git a/keyboards/infinity_ergodox/matrix.c b/keyboards/ergodox/infinity/matrix.c similarity index 98% rename from keyboards/infinity_ergodox/matrix.c rename to keyboards/ergodox/infinity/matrix.c index 2b806cd64..1fda90484 100644 --- a/keyboards/infinity_ergodox/matrix.c +++ b/keyboards/ergodox/infinity/matrix.c @@ -63,6 +63,8 @@ void matrix_init(void) memset(matrix, 0, MATRIX_ROWS); memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS); + + matrix_init_quantum(); } uint8_t matrix_scan(void) @@ -127,6 +129,7 @@ uint8_t matrix_scan(void) } debouncing = false; } + matrix_scan_quantum(); return 1; } diff --git a/keyboards/infinity_ergodox/mcuconf.h b/keyboards/ergodox/infinity/mcuconf.h similarity index 100% rename from keyboards/infinity_ergodox/mcuconf.h rename to keyboards/ergodox/infinity/mcuconf.h diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/ergodox/infinity/rules.mk similarity index 75% rename from keyboards/infinity_ergodox/Makefile rename to keyboards/ergodox/infinity/rules.mk index 7edc03d8c..ccb735a48 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/ergodox/infinity/rules.mk @@ -52,34 +52,26 @@ ARMV = 7 # Vector table for application # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -OPT_DEFS = -DCORTEX_VTOR_INIT=0x00002000 +OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration -## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) -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 -SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover CUSTOM_MATRIX ?= yes # Custom matrix file SERIAL_LINK_ENABLE = yes -VISUALIZER_ENABLE ?= yes +VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile LCD_ENABLE ?= yes LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes +ifndef QUANTUM_DIR + include ../../../Makefile +endif + ifdef LCD_ENABLE -include drivers/gdisp/st7565ergodox/driver.mk +include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk endif ifdef LED_ENABLE -include drivers/gdisp/IS31FL3731C/driver.mk +include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk endif - -ifndef QUANTUM_DIR - include ../../Makefile -endif \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/ab/Makefile b/keyboards/ergodox/keymaps/ab/Makefile similarity index 100% rename from keyboards/ergodox_ez/keymaps/ab/Makefile rename to keyboards/ergodox/keymaps/ab/Makefile diff --git a/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.json b/keyboards/ergodox/keymaps/ab/keyboard-layout.json similarity index 100% rename from keyboards/ergodox_ez/keymaps/ab/keyboard-layout.json rename to keyboards/ergodox/keymaps/ab/keyboard-layout.json diff --git a/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.png b/keyboards/ergodox/keymaps/ab/keyboard-layout.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/ab/keyboard-layout.png rename to keyboards/ergodox/keymaps/ab/keyboard-layout.png diff --git a/keyboards/ergodox_ez/keymaps/ab/keymap.c b/keyboards/ergodox/keymaps/ab/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/ab/keymap.c rename to keyboards/ergodox/keymaps/ab/keymap.c index df6f33460..7938c9da3 100644 --- a/keyboards/ergodox_ez/keymaps/ab/keymap.c +++ b/keyboards/ergodox/keymaps/ab/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/ab/readme.md b/keyboards/ergodox/keymaps/ab/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/ab/readme.md rename to keyboards/ergodox/keymaps/ab/readme.md diff --git a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c b/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c rename to keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c index 052517d70..31ae4262b 100644 --- a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c +++ b/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german.h" diff --git a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md b/keyboards/ergodox/keymaps/adnw_k_o_y/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md rename to keyboards/ergodox/keymaps/adnw_k_o_y/readme.md diff --git a/keyboards/ergodox_ez/keymaps/alexjj/keymap.c b/keyboards/ergodox/keymaps/alexjj/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/alexjj/keymap.c rename to keyboards/ergodox/keymaps/alexjj/keymap.c index 448f62da0..ac954ba5b 100644 --- a/keyboards/ergodox_ez/keymaps/alexjj/keymap.c +++ b/keyboards/ergodox/keymaps/alexjj/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/alexjj/readme.md b/keyboards/ergodox/keymaps/alexjj/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/alexjj/readme.md rename to keyboards/ergodox/keymaps/alexjj/readme.md diff --git a/keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg b/keyboards/ergodox/keymaps/alexjj/rl-layout.jpg similarity index 100% rename from keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg rename to keyboards/ergodox/keymaps/alexjj/rl-layout.jpg diff --git a/keyboards/ergodox_ez/keymaps/algernon/COPYING b/keyboards/ergodox/keymaps/algernon/COPYING similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/COPYING rename to keyboards/ergodox/keymaps/algernon/COPYING diff --git a/keyboards/ergodox_ez/keymaps/algernon/Makefile b/keyboards/ergodox/keymaps/algernon/Makefile similarity index 75% rename from keyboards/ergodox_ez/keymaps/algernon/Makefile rename to keyboards/ergodox/keymaps/algernon/Makefile index 005f9750c..00194857a 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/Makefile +++ b/keyboards/ergodox/keymaps/algernon/Makefile @@ -4,13 +4,26 @@ SLEEP_LED_ENABLE=no UNICODE_ENABLE=no FORCE_NKRO ?= yes DEBUG_ENABLE = no -CONSOLE_ENABLE = yes +CONSOLE_ENABLE = no TAP_DANCE_ENABLE = yes +KEYLOGGER_ENABLE ?= yes + +ADORE_AUTOLOG ?= no ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO endif +ifeq (${ADORE_AUTOLOG},yes) +KEYLOGGER_ENABLE = yes +OPT_DEFS += -DADORE_AUTOLOG +endif + +ifeq (${KEYLOGGER_ENABLE},yes) +OPT_DEFS += -DKEYLOGGER_ENABLE +CONSOLE_ENABLE = yes +endif + KEYMAP_VERSION = $(shell \ if [ -d "${KEYMAP_PATH}/.git" ]; then \ cd "${KEYMAP_PATH}" && git describe --abbrev=6 --dirty --always --tags --match 'v*' 2>/dev/null; \ diff --git a/keyboards/ergodox_ez/keymaps/algernon/config.h b/keyboards/ergodox/keymaps/algernon/config.h similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/config.h rename to keyboards/ergodox/keymaps/algernon/config.h diff --git a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png new file mode 100644 index 000000000..44ad8a1eb Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/base-layer.png b/keyboards/ergodox/keymaps/algernon/images/base-layer.png new file mode 100644 index 000000000..da159fbe2 Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/base-layer.png differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png b/keyboards/ergodox/keymaps/algernon/images/heatmap.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png rename to keyboards/ergodox/keymaps/algernon/images/heatmap.png diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/hun-layer.png b/keyboards/ergodox/keymaps/algernon/images/hun-layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/images/hun-layer.png rename to keyboards/ergodox/keymaps/algernon/images/hun-layer.png diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/nav-n-media-layer.png b/keyboards/ergodox/keymaps/algernon/images/nav-n-media-layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/images/nav-n-media-layer.png rename to keyboards/ergodox/keymaps/algernon/images/nav-n-media-layer.png diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/steno-layer.png b/keyboards/ergodox/keymaps/algernon/images/steno-layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/images/steno-layer.png rename to keyboards/ergodox/keymaps/algernon/images/steno-layer.png diff --git a/keyboards/ergodox_ez/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c similarity index 75% rename from keyboards/ergodox_ez/keymaps/algernon/keymap.c rename to keyboards/ergodox/keymaps/algernon/keymap.c index 09d8dffd5..144030e2e 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -2,7 +2,7 @@ * algernon's ErgoDox EZ layout, please see the readme.md file! */ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" @@ -11,6 +11,8 @@ #include "timer.h" #include "keymap_plover.h" #include "eeconfig.h" +#include "wait.h" +#include "version.h" /* Layers */ @@ -21,8 +23,6 @@ enum { APPSEL, HUN, NMDIA, - OHLFT, - OHRGT, PLVR, }; @@ -72,13 +72,6 @@ enum { HU_UE, // Ü HU_OEE, // Ő HU_UEE, // Ű - - // One-handed layout specials - OH_BSSPC, - OH_ENTSFT, - OH_BASE, - OH_LEFT, - OH_RIGHT, }; /* Fn keys */ @@ -95,7 +88,11 @@ enum { /* Custom keycodes */ enum { - CT_CLN = 0 + CT_CLN = 0, + CT_MNS, + CT_TA, + CT_LBP, + CT_RBP }; /* States & timers */ @@ -104,18 +101,11 @@ uint16_t gui_timer = 0; uint16_t kf_timers[12]; -uint16_t oh_base_timer = 0; -uint16_t oh_bsspc_timer = 0; -uint16_t oh_entsft_timer = 0; - -#define OH_BLINK_INTERVAL 500 - -uint8_t oh_left_blink = 0; -uint16_t oh_left_blink_timer = 0; -uint8_t oh_right_blink = 0; -uint16_t oh_right_blink_timer = 0; - +#if KEYLOGGER_ENABLE bool log_enable = false; +#endif + +bool time_travel = false; /* The Keymap */ @@ -124,9 +114,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Base Layer * * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * | Next/Prev | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | + * | ~ | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| @@ -135,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | : | | - | | | | | * `-----------------------------------' `-----------------------------------' * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | + * | LAlt | GUI | | MDIA | Del | * ,------|------|------| |------+------+------. * | | | Ctrl | | LEAD | | | * |Backsp|LShift|------| |------| Enter| Space| @@ -144,9 +134,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [BASE] = KEYMAP( // left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,LT(ARRW,KC_TAB) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I + M(A_MPN) ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,KC_GRV ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I ,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) @@ -155,13 +145,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_BSPC,F(F_SFT),M(A_ESC) // right hand - ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,LT(ARRW, KC_EQL) - ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP - ,KC_MINS,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - ,OSL(NMDIA),M(OH_LEFT) + ,OSL(NMDIA),KC_DEL ,KC_LEAD ,F(F_HUN) ,KC_ENT ,KC_SPC ), @@ -169,31 +159,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 1: Adore layer * * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * | Play/Pause| 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | + * | `~ | X | W | K | L | M | ( | | ) | F | H | C | P | Y | \ | + * |-----------+------+------+------+------+------| [ | | ] |------+------+------+------+------+-----------| + * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | + * | | Z | Q | ' | , | . | : | | - | B | G | V | J | / | | * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | + * | | | | | | | | | | | | * `-----------------------------------' `-----------------------------------' * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | + * | LAlt | GUI | | MDIA | Del | * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | + * | | | Ctrl | | HUN | | | * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | + * | | | ESC | | LEAD | | | * `--------------------' `--------------------' */ [ADORE] = KEYMAP( // left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC -,LT(ARRW, KC_TAB) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U -,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) + KC_MPLY ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,KC_GRV ,KC_X ,KC_W ,KC_K ,KC_L ,KC_M ,TD(CT_LBP) +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U +,KC_NO ,KC_Z ,KC_Q ,KC_QUOT,KC_COMM,KC_DOT ,TD(CT_CLN) +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,F(F_ALT),F(F_GUI) ,F(F_CTRL) @@ -201,14 +191,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS - ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,LT(ARRW, KC_EQL) - ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP - ,KC_MINS,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,TD(CT_RBP),KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS + ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL + ,TD(CT_MNS),KC_B ,KC_G ,KC_V ,KC_J ,KC_SLSH ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC + ,OSL(NMDIA),KC_DEL + ,F(F_HUN) + ,KC_LEAD ,KC_ENT ,KC_SPC ), /* Keymap 2: Arrow layer @@ -228,7 +218,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * ,------|------|------| |------+------+------. * | | | | | | | | - * | | |------| |------| PgUp | PgDn | + * | Enter| |------| |------| PgUp | PgDn | * | | | | | | | | * `--------------------' `--------------------' */ @@ -243,7 +233,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_ENT ,KC_TRNS ,KC_TRNS // right hand ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS @@ -394,97 +384,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_MNXT ,KC_BTN1 ,KC_BTN2 ), -/* Keymap 6: One-handed, left side - * - * ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| - * |-----------+------+------+------+------+-------------| - * | Tab | ' | , | . | P | Y | [ | - * |-----------+------+------+------+------+------| | - * | - | A | O | E | U | I |------| - * |-----------+------+------+------+------+------| ( | - * | Play/Pause| ; | Q | J | K | X | | - * `-----------+------+------+------+------+-------------' - * | Home | End | Down | Up | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHLFT] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) -,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 7: One-handed, right side - * - * ,-----------------------------------------------------. - * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| - * |-----------+------+------+------+------+-------------| - * | / | L | R | C | G | F | ] | - * |-----------+------+------+------+------+------| | - * | \ | S | N | T | H | D |------| - * |-----------+------+------+------+------+------| ) | - * | Stop | Z | V | W | M | B | | - * `-----------+------+------+------+------+-------------' - * | PgDn | PgUp | Right| Left | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHRGT] = KEYMAP( -// left hand - M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) -,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC -,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D -,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN -,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 8: Steno for Plover +/* Keymap 6: Steno for Plover * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | BASE | | | | | | | | | @@ -766,7 +666,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); case APP_EMCS: - return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); + return MACRODOWN(T(G), T(N), T(U), T(SPC), T(E), T(M), T(A), T(C), T(S), T(SPC), T(2), T(4), T(ENT), END); case APP_TERM: return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); @@ -781,65 +681,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case KF_1 ... KF_11: ang_handle_kf (record, id); break; - - /* 1HAND layout */ - case OH_BASE: - if (record->event.pressed) { - oh_base_timer = timer_read (); - } else { - if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { - layer_clear (); - } else { - return MACRO (T(APP), END); - } - } - break; - - case OH_BSSPC: - if (record->event.pressed) { - oh_bsspc_timer = timer_read (); - } else { - if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { - return MACRO (T(BSPC), END); - } else { - return MACRO (T(SPC), END); - } - } - break; - - case OH_ENTSFT: - if (record->event.pressed) { - oh_entsft_timer = timer_read (); - } else { - if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT)) - unregister_code (KC_LSFT); - else - register_code (KC_LSFT); - } else { - return MACRO (T(ENT), END); - } - } - break; - - case OH_LEFT: - if (record->event.pressed) { - layer_move (OHLFT); - oh_left_blink = 1; - oh_left_blink_timer = timer_read (); - ergodox_right_led_1_on (); - } - break; - - case OH_RIGHT: - if (record->event.pressed) { - layer_move (OHRGT); - oh_right_blink = 1; - oh_right_blink_timer = timer_read (); - ergodox_right_led_3_on (); - } - break; } + return MACRO_NONE; }; @@ -852,20 +695,24 @@ void matrix_init_user(void) { ergodox_led_all_on(); for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { ergodox_led_all_set (i); - _delay_ms (5); + wait_ms (5); } - _delay_ms(1000); + wait_ms(1000); for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { ergodox_led_all_set (i); - _delay_ms (10); + wait_ms (10); } ergodox_led_all_off(); if (!eeconfig_is_enabled()) eeconfig_init(); dl = eeconfig_read_default_layer (); - if (dl == (1UL << ADORE)) + if (dl == (1UL << ADORE)) { is_adore = 1; +#if ADORE_AUTOLOG + log_enable = true; +#endif + } }; LEADER_EXTERNS(); @@ -877,41 +724,150 @@ void ang_do_unicode (void) { unregister_code (KC_U); unregister_code (KC_RSFT); unregister_code (KC_RCTL); - _delay_ms (100); + wait_ms (100); } void ang_tap (uint16_t codes[]) { for (int i = 0; codes[i] != 0; i++) { register_code (codes[i]); unregister_code (codes[i]); - _delay_ms (50); + wait_ms (50); } } -#define TAP_ONCE(code) \ +#define TAP_ONCE(code) \ register_code (code); \ unregister_code (code) -void ang_tap_dance (qk_tap_dance_state_t *state) { - switch (state->keycode) { - case TD(CT_CLN): - if (state->count == 1) { - register_code (KC_RSFT); - register_code (KC_SCLN); - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); - } else if (state->count == 2) { - register_code (KC_SCLN); - unregister_code (KC_SCLN); - reset_tap_dance (state); +void ang_tap_dance_bp_finished (qk_tap_dance_state_t *state, void *user_data) { + bool left, parens; + + if (state->count > 2) { + state->count = 0; + return; + } + + if (state->keycode == TD(CT_LBP)) + left = true; + else + left = false; + + if (state->count == 1) + parens = false; + else + parens = true; + + if (parens) { + register_code (KC_RSFT); + if (left) { + TAP_ONCE(KC_9); + } else { + TAP_ONCE(KC_0); + } + unregister_code (KC_RSFT); + } else { + if (left) { + TAP_ONCE (KC_LBRC); + } else { + TAP_ONCE (KC_RBRC); } } } -const qk_tap_dance_action_t tap_dance_actions[] = { - [CT_CLN] = ACTION_TAP_DANCE_FN (ang_tap_dance) +void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RSFT); + register_code (KC_SCLN); + } else if (state->count == 2) { + register_code (KC_SCLN); + } +} + +void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + unregister_code (KC_RSFT); + } else if (state->count == 2) { + unregister_code (KC_SCLN); + } +} + +void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_MINS); + } else if (state->count == 2) { + register_code (KC_RSFT); + register_code (KC_MINS); + } +} + +void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_MINS); + } else if (state->count == 2) { + unregister_code (KC_RSFT); + unregister_code (KC_MINS); + } +} + +typedef struct { + bool layer_toggle; + bool sticky; + bool finished_once; +} td_ta_state_t; + +void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (td_ta->finished_once) { + return; + } + + if (td_ta->sticky) { + td_ta->sticky = false; + td_ta->layer_toggle = false; + layer_off (ARRW); + return; + } + + td_ta->finished_once = true; + if (state->count == 1 && !state->pressed) { + register_code (KC_TAB); + td_ta->sticky = false; + td_ta->layer_toggle = false; + } else { + td_ta->layer_toggle = true; + layer_on (ARRW); + td_ta->sticky = (state->count == 2); + } +} + +void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (!td_ta->layer_toggle) + unregister_code (KC_TAB); + if (!td_ta->sticky) + layer_off (ARRW); + + td_ta->finished_once = false; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) + ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) + ,[CT_TA] = { + .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, + .user_data = (void *)&((td_ta_state_t) { false, false, false }) + } + ,[CT_LBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished) + ,[CT_RBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished) }; +static uint16_t uni[32]; +static uint8_t unicnt; +static bool unimagic = false; + // Runs constantly in the background, in a loop. void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); @@ -919,11 +875,6 @@ void matrix_scan_user(void) { if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) unregister_code (KC_LGUI); - if (layer != OHLFT) - oh_left_blink = 0; - if (layer != OHRGT) - oh_right_blink = 0; - if (layer == HUN) { ergodox_right_led_2_on(); ergodox_right_led_3_on(); @@ -942,39 +893,13 @@ void matrix_scan_user(void) { ergodox_right_led_2_set (LED_BRIGHTNESS_HI); } - if (layer == OHLFT || layer == OHRGT) { - ergodox_right_led_2_on(); - - if (oh_left_blink) { - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) - ergodox_right_led_1_off (); - } - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_1_on (); - oh_left_blink_timer = timer_read (); - } - } - - if (oh_right_blink) { - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) - ergodox_right_led_3_off (); - } - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_3_on (); - oh_right_blink_timer = timer_read (); - } - } - } - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { ergodox_right_led_1_set (LED_BRIGHTNESS_HI); ergodox_right_led_1_on (); } else { ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) + if (layer != NMDIA && layer != PLVR && layer != ADORE) ergodox_right_led_1_off (); } @@ -984,7 +909,7 @@ void matrix_scan_user(void) { ergodox_right_led_2_on (); } else { ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) + if (layer != HUN && layer != NMDIA && layer != PLVR && layer != ADORE) ergodox_right_led_2_off (); } @@ -994,7 +919,7 @@ void matrix_scan_user(void) { ergodox_right_led_3_on (); } else { ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) + if (layer != HUN && layer != PLVR && layer != ADORE) ergodox_right_led_3_off (); } @@ -1002,14 +927,31 @@ void matrix_scan_user(void) { leading = false; leader_end (); +#if KEYLOGGER_ENABLE SEQ_ONE_KEY (KC_D) { + ergodox_led_all_on(); + wait_ms(100); + ergodox_led_all_off(); log_enable = !log_enable; } +#endif + + SEQ_ONE_KEY (KC_T) { + time_travel = !time_travel; + } SEQ_ONE_KEY (KC_U) { ang_do_unicode (); } + SEQ_TWO_KEYS (KC_LEAD, KC_U) { + unicnt = 0; + unimagic = true; + register_code(KC_RSFT); + TAP_ONCE(KC_U); + unregister_code(KC_RSFT); + } + SEQ_ONE_KEY (KC_V) { SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); } @@ -1043,7 +985,7 @@ void matrix_scan_user(void) { unregister_code (KC_F2); unregister_code (KC_LALT); - _delay_ms (1000); + wait_ms (1000); uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; ang_tap (codes); @@ -1062,16 +1004,22 @@ void matrix_scan_user(void) { ergodox_led_all_off (); ergodox_right_led_3_on (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_2_on (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_3_off (); ergodox_right_led_1_on (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_2_off (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_1_off (); +#if ADORE_AUTOLOG + log_enable = true; +#endif } else { +#if ADORE_AUTOLOG + log_enable = false; +#endif is_adore = 0; default_layer_and (0); default_layer_or (1UL << BASE); @@ -1079,27 +1027,180 @@ void matrix_scan_user(void) { ergodox_led_all_off (); ergodox_right_led_1_on (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_2_on (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_1_off (); ergodox_right_led_3_on (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_2_off (); - _delay_ms (100); + wait_ms (100); ergodox_right_led_3_off (); } } } } -bool process_record_user (uint16_t keycode, keyrecord_t *record) { - uint8_t layer = biton32(layer_state); +static uint16_t last4[4]; - if (log_enable && layer == BASE) { +bool is_uni_seq(char *seq) { + uint8_t i; + + for (i = 0; seq[i]; i++) { + uint16_t code; + if (('1' <= seq[i]) && (seq[i] <= '9')) + code = seq[i] - '1' + KC_1; + else if (seq[i] == '0') + code = KC_0; + else + code = seq[i] - 'a' + KC_A; + + if (i > unicnt) + return false; + if (uni[i] != code) + return false; + } + + if (uni[i] == KC_ENT || uni[i] == KC_SPC) + return true; + + return false; +} + +uint16_t hex_to_keycode(uint8_t hex) +{ + if (hex == 0x0) { + return KC_0; + } else if (hex < 0xA) { + return KC_1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + +void register_hex(uint16_t hex) { + bool leading_zeros = true; + + for(int i = 3; i >= 0; i--) { + uint8_t digit = ((hex >> (i*4)) & 0xF); + if (digit != 0) + leading_zeros = false; + else if (leading_zeros) + continue; + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + wait_ms(10); + } +} + +typedef struct { + char *symbol; + uint16_t codes[4]; +} qk_ucis_symbol_t; + +static qk_ucis_symbol_t ucis_symbol_table[] = { + {"poop", {0x1, 0xf4a9, 0}}, + {"rofl", {0x1, 0xf923, 0}}, + {"kiss", {0x1, 0xf619, 0}}, + {"snowman", {0x2603, 0}}, + {NULL, {}} +}; + +bool process_record_ucis (uint16_t keycode, keyrecord_t *record) { + uint8_t i; + + if (!unimagic) + return true; + + if (!record->event.pressed) + return true; + + uni[unicnt] = keycode; + unicnt++; + + if (keycode == KC_BSPC) { + if (unicnt >= 2) { + unicnt-= 2; + return true; + } else { + unicnt--; + return false; + } + } + + if (keycode == KC_ENT || keycode == KC_SPC) { + bool symbol_found = false; + + for (i = unicnt; i > 0; i--) { + register_code (KC_BSPC); + unregister_code (KC_BSPC); + wait_ms(10); + } + + ang_do_unicode(); + wait_ms(10); + for (i = 0; ucis_symbol_table[i].symbol; i++) { + if (is_uni_seq (ucis_symbol_table[i].symbol)) { + symbol_found = true; + for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) { + register_hex(ucis_symbol_table[i].codes[j]); + } + break; + } + } + if (!symbol_found) { + for (i = 0; i < unicnt - 1; i++) { + uint8_t code; + + if (uni[i] > KF_1) + code = uni[i] - KF_1 + KC_1; + else + code = uni[i]; + TAP_ONCE(code); + wait_ms (10); + } + } + + unimagic = false; + return true; + } + return true; +} + +bool process_record_user (uint16_t keycode, keyrecord_t *record) { +#if KEYLOGGER_ENABLE + if (log_enable) { xprintf ("KL: col=%d, row=%d\n", record->event.key.col, record->event.key.row); } +#endif + + if (!process_record_ucis (keycode, record)) + return false; + + if (time_travel && !record->event.pressed) { + uint8_t p; + + // shift cache one to the left + for (p = 0; p < 3; p++) { + last4[p] = last4[p + 1]; + } + last4[3] = keycode; + + if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { + uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; + ang_tap (codes); + register_code (KC_RSFT); + register_code (KC_EQL); + unregister_code (KC_EQL); + unregister_code (KC_RSFT); + + uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; + ang_tap (codes2); + + return false; + } + } return true; } diff --git a/keyboards/ergodox_ez/keymaps/algernon/readme.md b/keyboards/ergodox/keymaps/algernon/readme.md similarity index 81% rename from keyboards/ergodox_ez/keymaps/algernon/readme.md rename to keyboards/ergodox/keymaps/algernon/readme.md index 2312dc59e..26dfddbe6 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/readme.md +++ b/keyboards/ergodox/keymaps/algernon/readme.md @@ -16,11 +16,12 @@ Some of the things in the layout only work when one uses Spacemacs and GNOME und - [ADORE layer](#adore-layer) - [Hungarian layer](#hungarian-layer) - [Navigation and media layer](#navigation-and-media-layer) - - [One-handed layer](#one-handed-layer) - [Steno layer](#steno-layer) - [LED states](#led-states) * [Tools](#tools) - [Heatmap](#heatmap) +* [Special features](#special-features) + - [Unicode Symbol Input](#unicode-symbol-input) * [Building](#building) - [Using on Windows](#using-on-windows) * [Changelog](#changelog) @@ -38,7 +39,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest * The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap. * The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. * The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. -* The **Media** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** keys are toggles. +* The **Media** and **Hun** layer keys are one-shot, the **STENO** key is a toggle. * When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. * Tapping the `:` key once yields `:`, tapping it twice yields `;`. * The **Lead** key allows me to type in a sequence of keys, and trigger some actions: @@ -50,6 +51,8 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest - `LEAD a` makes the [ADORE layer](#adore-layer) the default. - `LEAD v` prints the firmware version, the keyboard and the keymap. - `LEAD d` toggles logging keypress positions to the HID console. + - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. + - `LEAD LEAD u` enters the [Unicode symbol input][#unicode-symbol-input] mode. ## ADORE layer @@ -73,20 +76,6 @@ On this layer, the accented characters are at the same position as their base va This layer is primarily for navigating with the cursor or the mouse, and some media things. -## One-handed layer - -[![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece) - -The one-handed layer is used in situations where the right hand is occupied, by mousing around, for example. Tapping the `OTHER` key switches which side is active. For the most part, keys remain in their usual position. When the right half is active, keys are mirrored to the left half. - -The differences are as follows: - -* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier to tap. -* Most keys on the thumb cluster now have dual uses, and these do not change when switching sides: - - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held for longer than a normal tap. - - The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap. -* The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual. - ## Steno layer [![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) @@ -102,11 +91,25 @@ For the layers, the following rules apply: * When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. * When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. * When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. -* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is on and bright, and either the *red* or the *blue* one is going to slowly blink, depending on the currently active side. * For the [Steno layer](#steno-layer), all LEDs will be turned on. Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. +# Special features + +## Unicode Symbol Input + +Once in the Unicode Symbol Input mode, one is able to type in symbol names, press `Enter` or `Space`, and get the Unicode symbol itself back. When in the mode, a capital `U` is printed first. Once the sequence is finished, all of it is erased by sending enough `Backspace` taps, and the firmware starts the OS-specific unicode input sequence. Then, it looks up the symbol name, and enters the associated code. If it is not found, it will just replay the pressed keycodes. + +The currently supported symbols are: + +- `snowman`: ☃ +- `kiss`: 😙 +- `rofl`: 🤣 +- `poop`: 💩 + +This is an experimental feature, and may or may not work reliably. + # Tools ## Heatmap @@ -132,14 +135,14 @@ To make my workflow easier, this layout is maintained in [its own repository][al $ git clone https://github.com/jackhumbert/qmk_firmware.git $ cd qmk_firmware $ git clone https://github.com/algernon/ergodox-layout.git \ - keyboards/ergodox_ez/keymaps/algernon-master -$ make KEYBOARD=ergodox_ez KEYMAP=algernon-master + keyboards/ergodox/keymaps/algernon-master +$ make keyboard=ergodox keymap=algernon-master ``` From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): ``` -$ make KEYBOARD=ergodox_ez KEYMAP=algernon +$ make keyboard=ergodox keymap=algernon ``` ## Using on Windows @@ -148,6 +151,24 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the # Changelog +## v1.5 - 2016-08-12 + +* The **1HAND** layer has been removed. +* A `Delete` key is now available on the right thumb cluster. +* The [ADORE](#adore-layer) layer received a major update, see the layout image above. +* It is now possible to enable automatic logging for the [ADORE](#adore-layer) layer, by setting the `ADORE_AUTOLOG` makefile variable to `yes` when compiling the keymap. It is off by default. +* The `~` key and the `Media Next/Prev` key have been swapped on the [base layer](#base-layer). +* On the **ARROW** layer, `Backspace` has been replaced by `Enter`. +* There is some experimental support for entering Unicode symbols. + +## v1.4 - 2016-07-29 + +* When toggling the key logging on or off, the LEDs will do a little dance. +* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it. +* The `TAB`/`ARRW` key was turned into a tap-dance key, allowing one to toggle the **ARROW** layer on by double-tapping, and as such, avoid the need to hold the key. +* The `-`/`_` key was turned into a tap-dance key too. +* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`. + ## v1.3 - 2016-07-06 * Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs. diff --git a/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json b/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json new file mode 100644 index 000000000..544f61ce8 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json @@ -0,0 +1,533 @@ +[ + { + "backcolor": "#ffffff", + "name": "ErgoDox - algernon's layout: Heatmap", + "author": "Gergely Nagy ", + "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "pcb": true, + "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" + }, + [ + { + "x": 3.5, + "c": "#a7d0db", + "fa": [ + 0, + 0, + 2 + ] + }, + "#\n3\nF3", + { + "x": 10.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4, + "fa": [ + 0, + 0, + 2 + ] + }, + "*\n8\nF8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "@\n2\nF2", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "$\n4\nF4", + { + "x": 8.5 + }, + "&\n7\nF7", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "(\n9\nF9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "%\n5\nF5", + { + "c": "#f9cd31", + "a": 7, + "f": 2 + }, + "STENO", + { + "x": 4.5, + "f": 6 + }, + "", + { + "c": "#7adabd", + "a": 4, + "f": 3, + "fa": [ + 0, + 0, + 2 + ] + }, + "^\n6\nF6" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "f": 3, + "w": 1.5 + }, + "\n\n~\n`", + { + "t": "#0d0d0b" + }, + "!\n1\nF1", + { + "x": 14.5 + }, + ")\n0\nF10", + { + "a": 7, + "w": 1.5 + }, + "F11" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "L", + { + "x": 10.5 + }, + "C" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b", + "a": 4 + }, + ">\n.", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "a": 6 + }, + "W", + { + "x": 8.5 + }, + "H", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "P" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "M", + { + "c": "#93c9b7", + "a": 4, + "h": 1.5 + }, + "{\n[", + { + "x": 4.5, + "h": 1.5 + }, + "}\n]", + { + "c": "#7adabd", + "a": 6 + }, + "F" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "t": "#0d0d0b", + "f": 6, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "a": 4, + "f": 3 + }, + "<\n,", + { + "x": 14.5, + "a": 6 + }, + "Y", + { + "a": 4, + "w": 1.5 + }, + "|\n\\" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "E", + { + "x": 10.5 + }, + "T" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "O", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "n": true + }, + "I", + { + "x": 8.5, + "n": true + }, + "R", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "N" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "U", + { + "x": 6.5 + }, + "D" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "t": "#0d0d0b", + "fa": [ + 6 + ], + "w": 1.5 + }, + "\n\nTab", + { + "f": 3 + }, + "A", + { + "x": 14.5, + "f": 3 + }, + "S", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ], + "w": 1.5 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#93c9b7", + "t": "#000000", + "a": 7, + "h": 1.5 + }, + "(", + { + "x": 4.5, + "h": 1.5 + }, + ")" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#a7d0db", + "a": 4, + "f": 3 + }, + "\"\n'", + { + "x": 10.5 + }, + "V" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "Z", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "K", + { + "x": 8.5 + }, + "G", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "J" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "X", + { + "x": 6.5 + }, + "B" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "f": 9, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "t": "#0d0d0b", + "a": 4, + "f": 3 + }, + "?\n/", + { + "x": 14.5, + "a": 6 + }, + "Q", + { + "c": "#ffb07b", + "t": "#000000", + "f": 9, + "w": 1.5 + }, + "" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#d9dae0", + "g": true, + "a": 7, + "f": 3 + }, + "", + { + "x": 10.5 + }, + "" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "", + { + "x": 1, + "c": "#d4872a", + "g": false, + "a": 5 + }, + ";\n:", + { + "x": 8.5 + }, + "_\n-", + { + "x": 1, + "c": "#d9dae0", + "g": true, + "a": 7 + }, + "" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "", + {}, + "", + { + "x": 14.5 + }, + "", + {}, + "" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#f9cd31", + "g": false + }, + "Alt", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 9 + ] + }, + "\n\n\n" + ], + [ + { + "c": "#d4872a", + "a": 7, + "f": 9, + "h": 2 + }, + "", + { + "h": 2 + }, + "", + { + "c": "#f9cd31", + "f": 3 + }, + "Ctrl" + ], + [ + { + "x": 2, + "c": "#e26757" + }, + "ESC" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "MEDIA", + {}, + "1HAND" + ], + [ + { + "x": -3 + }, + "LEAD", + { + "c": "#d4872a", + "f": 9, + "h": 2 + }, + "", + { + "f": 3, + "h": 2 + }, + "SPC" + ], + [ + { + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "HUN" + ] +] diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json b/keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json rename to keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py b/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py rename to keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/max-focused b/keyboards/ergodox/keymaps/algernon/tools/max-focused similarity index 100% rename from keyboards/ergodox_ez/keymaps/algernon/tools/max-focused rename to keyboards/ergodox/keymaps/algernon/tools/max-focused diff --git a/keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c b/keyboards/ergodox/keymaps/andrew_osx/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c rename to keyboards/ergodox/keymaps/andrew_osx/keymap.c index 48257d23a..750155d98 100644 --- a/keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c +++ b/keyboards/ergodox/keymaps/andrew_osx/keymap.c @@ -1,7 +1,7 @@ // Netable differences vs. the default firmware for the ErgoDox EZ: // 1. The Cmd key is now on the right side, making Cmd+Space easier. // 2. The media keys work on OSX (But not on Windows). -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/bepo/bepo.png b/keyboards/ergodox/keymaps/bepo/bepo.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/bepo/bepo.png rename to keyboards/ergodox/keymaps/bepo/bepo.png diff --git a/keyboards/ergodox_ez/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/bepo/keymap.c rename to keyboards/ergodox/keymaps/bepo/keymap.c index 921a94d63..2d88fc10e 100644 --- a/keyboards/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_bepo.h" diff --git a/keyboards/ergodox_ez/keymaps/bepo/readme.md b/keyboards/ergodox/keymaps/bepo/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/bepo/readme.md rename to keyboards/ergodox/keymaps/bepo/readme.md diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/Makefile b/keyboards/ergodox/keymaps/coderkun_neo2/Makefile new file mode 100644 index 000000000..6c0a79b11 --- /dev/null +++ b/keyboards/ergodox/keymaps/coderkun_neo2/Makefile @@ -0,0 +1,2 @@ +SLEEP_LED_ENABLE = no +UNICODE_ENABLE = yes diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c similarity index 96% rename from keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c rename to keyboards/ergodox/keymaps/coderkun_neo2/keymap.c index d25e2b995..2ac06eef8 100644 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c @@ -1,7 +1,8 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" -#include "keymap_neo2.h" +#include "led.h" +#include "keymap_extras/keymap_neo2.h" // Layer names #define BASE 0 // default layer @@ -33,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [BASE] = KEYMAP( // left hand - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, NEO_GRV, NEO_Y, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, KC_HOME, NEO_L1_L, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O, KC_LSFT, NEO_UE, NEO_OE, NEO_AE, NEO_P, NEO_Z, TG(PMQ), @@ -42,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MINS, KC_SPC, KC_ENT, ALL_T(KC_NO), // right hand - DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + NEO_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, @@ -140,10 +141,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ ✕ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ * │ │ │ │ │ ✓ │ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤ │ │ ├─────╄─────╃─────┼─────┼─────┼───────┤ + * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ * │ │ │ │ │ │ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ │ │(MO1)│ │ │ │ │ │(MO1)│ │ │ + * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ * │ Ms← │ Ms↑ │ │ Ms↓ │ Ms→ │ * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ @@ -267,7 +268,13 @@ void matrix_scan_user(void) ergodox_right_led_3_on(); break; default: - ergodox_board_led_off(); + if(host_keyboard_leds() & (1< -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/erez_experimental/readme.md b/keyboards/ergodox/keymaps/erez_experimental/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/erez_experimental/readme.md rename to keyboards/ergodox/keymaps/erez_experimental/readme.md diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c b/keyboards/ergodox/keymaps/german-kinergo/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c rename to keyboards/ergodox/keymaps/german-kinergo/keymap.c index b1cecf0dd..971318d87 100644 --- a/keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c +++ b/keyboards/ergodox/keymaps/german-kinergo/keymap.c @@ -1,7 +1,7 @@ // German keymap derived from "german", but more closely resembling the German layout of the Kinesis Ergo Elan. // // chschmitz, 2016-01-27 -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german.h" diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/layout-code.png b/keyboards/ergodox/keymaps/german-kinergo/layout-code.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/german-kinergo/layout-code.png rename to keyboards/ergodox/keymaps/german-kinergo/layout-code.png diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/layout-media.png b/keyboards/ergodox/keymaps/german-kinergo/layout-media.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/german-kinergo/layout-media.png rename to keyboards/ergodox/keymaps/german-kinergo/layout-media.png diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/layout.png b/keyboards/ergodox/keymaps/german-kinergo/layout.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/german-kinergo/layout.png rename to keyboards/ergodox/keymaps/german-kinergo/layout.png diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/readme.md b/keyboards/ergodox/keymaps/german-kinergo/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/german-kinergo/readme.md rename to keyboards/ergodox/keymaps/german-kinergo/readme.md diff --git a/keyboards/ergodox_ez/util/compile_keymap.py b/keyboards/ergodox/keymaps/german-manuneo/compile_keymap.py similarity index 100% rename from keyboards/ergodox_ez/util/compile_keymap.py rename to keyboards/ergodox/keymaps/german-manuneo/compile_keymap.py diff --git a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c b/keyboards/ergodox/keymaps/german-manuneo/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c rename to keyboards/ergodox/keymaps/german-manuneo/keymap.c index 5fcc14d51..16e92bc23 100644 --- a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c +++ b/keyboards/ergodox/keymaps/german-manuneo/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "action_layer.h" #include "keymap.h" #include "keymap_german.h" diff --git a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md b/keyboards/ergodox/keymaps/german-manuneo/keymap.md similarity index 99% rename from keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md rename to keyboards/ergodox/keymaps/german-manuneo/keymap.md index 2c9e0a837..837b25446 100644 --- a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md +++ b/keyboards/ergodox/keymaps/german-manuneo/keymap.md @@ -12,7 +12,7 @@ Tested with python 2.7 and python 3.4 { "layout": "ergodox_ez", "keymaps_includes": [ - "ergodox_ez.h", + "ergodox.h", "action_layer.h", "keymap_common.h", "keymap_extras/keymap_german.h", diff --git a/keyboards/ergodox_ez/keymaps/german/keymap.c b/keyboards/ergodox/keymaps/german/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/german/keymap.c rename to keyboards/ergodox/keymaps/german/keymap.c index 3eab51f0e..9b2f6ffa2 100644 --- a/keyboards/ergodox_ez/keymaps/german/keymap.c +++ b/keyboards/ergodox/keymaps/german/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german.h" diff --git a/keyboards/ergodox_ez/keymaps/j3rn/keymap.c b/keyboards/ergodox/keymaps/j3rn/keymap.c similarity index 90% rename from keyboards/ergodox_ez/keymaps/j3rn/keymap.c rename to keyboards/ergodox/keymaps/j3rn/keymap.c index 6e271321d..e6f6cf44e 100644 --- a/keyboards/ergodox_ez/keymaps/j3rn/keymap.c +++ b/keyboards/ergodox/keymaps/j3rn/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" @@ -14,18 +14,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc|A / L2| S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L | ; | ' | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ~L1 | ~L2 |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * | ~L1 | Alt |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | App | Home | | PgUp |Ctrl/Esc| * ,------|------|------| |------+--------+------. * | | | End | | PgDn | | | * |Space | LGui |------| |------| Tab |Enter | - * | | |Shift | | Alt | | | + * | | | ~L2 | | ~L1 | | | * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. @@ -34,13 +34,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, - CTL_T(KC_ESC), LT(MDIA, KC_A),KC_S, KC_D, KC_F, KC_G, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_FN1, KC_FN2, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + KC_FN1, KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_HOME, KC_END, - KC_SPC, KC_LGUI, KC_LSHIFT, + KC_SPC, KC_LGUI, KC_FN2, // right hand KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -50,20 +50,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PGUP, CTL_T(KC_ESC), KC_PGDN, - KC_LALT, KC_TAB, KC_ENT + KC_FN1, KC_TAB, KC_ENT ), /* Keymap 1: Symbol Layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | + * | | | | | | | 0 | 0 | . | = | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -76,20 +76,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // SYMBOLS [SYMB] = KEYMAP( // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS @@ -97,9 +98,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 2: Media and mouse keys * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | Lclk | Rclk | | | + * | | | | | | | | | | | | Lclk | Rclk | | F12 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -117,7 +118,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // MEDIA AND MOUSE [MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -126,8 +127,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_F12, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, diff --git a/keyboards/ergodox_ez/keymaps/j3rn/readme.md b/keyboards/ergodox/keymaps/j3rn/readme.md similarity index 76% rename from keyboards/ergodox_ez/keymaps/j3rn/readme.md rename to keyboards/ergodox/keymaps/j3rn/readme.md index fc4b64042..178aba773 100644 --- a/keyboards/ergodox_ez/keymaps/j3rn/readme.md +++ b/keyboards/ergodox/keymaps/j3rn/readme.md @@ -1,4 +1,4 @@ -# J3RN's Mac-centric ErgoDox EZ keymap +# J3RN's Mac-Centric ErgoDox EZ keymap ## Motivation @@ -14,6 +14,7 @@ This layout more closely resembles that of the Mac keyboard, and has some other - **The key to the right of "0" is Backspace instead of "-"** (misleadingly labeled "delete" on the Mac's keyboard). There was no room to fit in "-" and "=" between "0" and Backspace, unfortunately. - **The key to the left of "Q" is Tab instead of Delete.** - **The rightmost big key on the left thumb is CMD (LGui) instead of Backspace.** +- **The key to the left of Alt-Shift is an Alt key**. This is close to it's position on the Mac keyboard, though slightly further left. ### Other changes @@ -23,7 +24,9 @@ This layout more closely resembles that of the Mac keyboard, and has some other - **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better. - **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold." - **The Home and End buttons have been shifted up on the left thumb, and Shift inserted below them.** This makes doing Shift-5 and other such combinations less painful. -- **The Page Up and Page Down buttons have been shifted up on the right thumb, and Alt was moved from above them to below them.** I use Alt more than Page Up or Page Down (mostly in terminal applications), and thought that it deserved a more accessible location. - +- **The Page Up and Page Down buttons have been shifted up on the right thumb.** I don't use either of these keys often, and wanted to free up some real estate. +- **The bottommost-inner keys on the left and right thumb are momentary L2 and momentary L1, respectively**. I have found that both modes are useful, and this seemed like a reasonably accessible place to put these. +- **Traditional numpad layout.** The base of most numpads is a double-wide "0" key to the left of a "." key. This is reflected in my layout by having two "0" keys to the left of a "." key. +- **The function keys (F1-F12) have been moved to L2.** They were in the way in L1. **I'm always open to feedback and/or suggestions!** diff --git a/keyboards/ergodox_ez/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/jack/keymap.c rename to keyboards/ergodox/keymaps/jack/keymap.c index 80bf9d535..dda253fa4 100644 --- a/keyboards/ergodox_ez/keymaps/jack/keymap.c +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/jacobono/img/colemak-default-layer.png b/keyboards/ergodox/keymaps/jacobono/img/colemak-default-layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/jacobono/img/colemak-default-layer.png rename to keyboards/ergodox/keymaps/jacobono/img/colemak-default-layer.png diff --git a/keyboards/ergodox_ez/keymaps/jacobono/img/number-dpad-layer.png b/keyboards/ergodox/keymaps/jacobono/img/number-dpad-layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/jacobono/img/number-dpad-layer.png rename to keyboards/ergodox/keymaps/jacobono/img/number-dpad-layer.png diff --git a/keyboards/ergodox_ez/keymaps/jacobono/img/symbol-layer.png b/keyboards/ergodox/keymaps/jacobono/img/symbol-layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/jacobono/img/symbol-layer.png rename to keyboards/ergodox/keymaps/jacobono/img/symbol-layer.png diff --git a/keyboards/ergodox_ez/keymaps/jacobono/keymap.c b/keyboards/ergodox/keymaps/jacobono/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/jacobono/keymap.c rename to keyboards/ergodox/keymaps/jacobono/keymap.c index 6b19800af..dc7382bfe 100644 --- a/keyboards/ergodox_ez/keymaps/jacobono/keymap.c +++ b/keyboards/ergodox/keymaps/jacobono/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/jacobono/readme.md b/keyboards/ergodox/keymaps/jacobono/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/jacobono/readme.md rename to keyboards/ergodox/keymaps/jacobono/readme.md diff --git a/keyboards/ergodox/keymaps/jafo/jafo-Notes b/keyboards/ergodox/keymaps/jafo/jafo-Notes new file mode 100644 index 000000000..9376125e9 --- /dev/null +++ b/keyboards/ergodox/keymaps/jafo/jafo-Notes @@ -0,0 +1,10 @@ +These are notes on how to build and deploy the firmware to Ez, but they are +from before the qmk restructuring. + +cd qmk_firmware/keyboard/ergodox_ez +make KEYMAP=jafo +cp ergodox_ez.hex keymaps/jafo/ +/tmp/teensy.64bit +Open hex keymap file +Program +Upload diff --git a/keyboards/ergodox/keymaps/jafo/jafo-layout.pdf b/keyboards/ergodox/keymaps/jafo/jafo-layout.pdf new file mode 100644 index 000000000..189b49b12 Binary files /dev/null and b/keyboards/ergodox/keymaps/jafo/jafo-layout.pdf differ diff --git a/keyboards/ergodox/keymaps/jafo/jafo_highres.png b/keyboards/ergodox/keymaps/jafo/jafo_highres.png new file mode 100644 index 000000000..e3d7cef85 Binary files /dev/null and b/keyboards/ergodox/keymaps/jafo/jafo_highres.png differ diff --git a/keyboards/ergodox/keymaps/jafo/keymap.c b/keyboards/ergodox/keymaps/jafo/keymap.c new file mode 100644 index 000000000..4f1428f2b --- /dev/null +++ b/keyboards/ergodox/keymaps/jafo/keymap.c @@ -0,0 +1,183 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Grv | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | = | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc/Cmd| A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| L2 | | L2 |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" | Del | Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Ctrl/Esc| Alt| | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(MDIA), + LT(SYMB,KC_GRV),KC_QUOT, KC_DELT, KC_LEFT,KC_RGHT, + CTL_T(KC_ESC), KC_LALT, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + TG(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| LEFT | DOWN | UP | RIGHT| | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | Lclk | Mclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/jafo/readme.md b/keyboards/ergodox/keymaps/jafo/readme.md new file mode 100644 index 000000000..c870dfd05 --- /dev/null +++ b/keyboards/ergodox/keymaps/jafo/readme.md @@ -0,0 +1,20 @@ +# ErgoDox EZ "jafo" Configuration + +This is a layout based on the ErgoDox Ez default layout, but with some +customizations I made for my use-case. I use Linux, vi and the i3 window +manager, so I made these changes: + +- Arrow keys laid out in vi positions in media layer. + +- Esc (tap) and Win (held) to the left of A. i3 uses Win key for navigation + and having that be symmetric on the left and right makes it easier. + +- Grave accent below equals, I was having a hard time using ~ + +- Layer 2 switch below the L1 switch, so I can go into a mode where I get + arrow keys under my vi motion fingers. + +- Making the Ctrl (held) and Esc (tap) on my thumbs symmetric. Not sure I + need that with the Esc left of A and Ctrl on the Z and / keys when held... + +![Jafo](jafo_highres.png) diff --git a/keyboards/ergodox_ez/keymaps/jgarr/keymap.c b/keyboards/ergodox/keymaps/jgarr/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/jgarr/keymap.c rename to keyboards/ergodox/keymaps/jgarr/keymap.c index a3ad2040f..42d58421d 100644 --- a/keyboards/ergodox_ez/keymaps/jgarr/keymap.c +++ b/keyboards/ergodox/keymaps/jgarr/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/josh/keymap.c b/keyboards/ergodox/keymaps/josh/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/josh/keymap.c rename to keyboards/ergodox/keymaps/josh/keymap.c index de5664a25..b5463873a 100644 --- a/keyboards/ergodox_ez/keymaps/josh/keymap.c +++ b/keyboards/ergodox/keymaps/josh/keymap.c @@ -1,6 +1,7 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" +#include "version.h" #define BASE 0 // default layer #define SYMB 1 // symbols diff --git a/keyboards/ergodox_ez/keymaps/josh/readme.md b/keyboards/ergodox/keymaps/josh/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/josh/readme.md rename to keyboards/ergodox/keymaps/josh/readme.md diff --git a/keyboards/ergodox_ez/keymaps/kastyle/keymap.c b/keyboards/ergodox/keymaps/kastyle/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/kastyle/keymap.c rename to keyboards/ergodox/keymaps/kastyle/keymap.c index 3982e0a19..a92085003 100644 --- a/keyboards/ergodox_ez/keymaps/kastyle/keymap.c +++ b/keyboards/ergodox/keymaps/kastyle/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/kines-ish/keymap.c b/keyboards/ergodox/keymaps/kines-ish/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/kines-ish/keymap.c rename to keyboards/ergodox/keymaps/kines-ish/keymap.c index 5063c99f2..83f5b0e2b 100644 --- a/keyboards/ergodox_ez/keymaps/kines-ish/keymap.c +++ b/keyboards/ergodox/keymaps/kines-ish/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/kines-ish/readme.md b/keyboards/ergodox/keymaps/kines-ish/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/kines-ish/readme.md rename to keyboards/ergodox/keymaps/kines-ish/readme.md diff --git a/keyboards/ergodox/keymaps/maz/keymap.c b/keyboards/ergodox/keymaps/maz/keymap.c new file mode 100644 index 000000000..6378f874b --- /dev/null +++ b/keyboards/ergodox/keymaps/maz/keymap.c @@ -0,0 +1,229 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define ARRW 2 // arrow keys +#define MDIA 3 // media keys, including mouse + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | Space| Bksp |------| |------| Tab |Enter | + * | ctrl | gui | Alt | | Alt | gui | ctrl | + * `--------------------' `----------------------' + */ + // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue + // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), + KC_TRNS, KC_TRNS, + KC_TRNS, + CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, + // right hand + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Arrow keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | |PGDOWN| PGUP | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | HOME | END | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[ARRW] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, 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_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |Mute |VolDn | VolUp| | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | Prev | Play | Next | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * |Brwser| | | | | | | + * |Back | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_WBAK, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/maz/readme.md b/keyboards/ergodox/keymaps/maz/readme.md new file mode 100644 index 000000000..000a8d000 --- /dev/null +++ b/keyboards/ergodox/keymaps/maz/readme.md @@ -0,0 +1,121 @@ +# Introduction + +## Motivation +I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. + +More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. + +## Changes +There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. +### Modifier Keys +The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. + +### Layers +* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. +* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse +* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer +* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries +** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus + +### Removal Of Keys +I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. + +## Caveats +### Thumb Cluster Range +I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: +* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are +* I have relatively large hands (I guarantee you there's no problem - I guarantee you) + +### Dangerous positioning +I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. + +# Keymap +## Keymap 0: Basic layer +``` +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+--------+------. + | | | | | | | | + | Space| Bksp |------| |------| Tab |Enter | + | ctrl | gui | Alt | | Alt | gui | ctrl | + `--------------------' `----------------------' + +``` + +## Keymap 1: Symbol Layer +The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | 0 | = | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 2: Arrow Layer +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | | | | | | | |PGDOWN| PGUP | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | | | | | | HOME | END | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 3: Media and mouse keys +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | MsUp | | | | | | | | | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |Mute |VolDn | VolUp| | | | | | | | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | Prev | Play | Next | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + |Brwser| | | | | | | + |Back | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` diff --git a/keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c b/keyboards/ergodox/keymaps/mpiechotka/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c rename to keyboards/ergodox/keymaps/mpiechotka/keymap.c index 5bfef5995..67aca4479 100644 --- a/keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c +++ b/keyboards/ergodox/keymaps/mpiechotka/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_colemak.h" diff --git a/keyboards/ergodox_ez/keymaps/mpiechotka/readme.md b/keyboards/ergodox/keymaps/mpiechotka/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/mpiechotka/readme.md rename to keyboards/ergodox/keymaps/mpiechotka/readme.md diff --git a/keyboards/ergodox_ez/keymaps/msc/img/code_layer.png b/keyboards/ergodox/keymaps/msc/img/code_layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/msc/img/code_layer.png rename to keyboards/ergodox/keymaps/msc/img/code_layer.png diff --git a/keyboards/ergodox_ez/keymaps/msc/img/main_layer.png b/keyboards/ergodox/keymaps/msc/img/main_layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/msc/img/main_layer.png rename to keyboards/ergodox/keymaps/msc/img/main_layer.png diff --git a/keyboards/ergodox_ez/keymaps/msc/img/media_layer.png b/keyboards/ergodox/keymaps/msc/img/media_layer.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/msc/img/media_layer.png rename to keyboards/ergodox/keymaps/msc/img/media_layer.png diff --git a/keyboards/ergodox_ez/keymaps/msc/keymap.c b/keyboards/ergodox/keymaps/msc/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/msc/keymap.c rename to keyboards/ergodox/keymaps/msc/keymap.c index e567e513f..c43aecf6b 100644 --- a/keyboards/ergodox_ez/keymaps/msc/keymap.c +++ b/keyboards/ergodox/keymaps/msc/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/msc/readme.md b/keyboards/ergodox/keymaps/msc/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/msc/readme.md rename to keyboards/ergodox/keymaps/msc/readme.md diff --git a/keyboards/ergodox_ez/keymaps/naps62/keymap.c b/keyboards/ergodox/keymaps/naps62/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/naps62/keymap.c rename to keyboards/ergodox/keymaps/naps62/keymap.c index d8c28423c..9064053fc 100644 --- a/keyboards/ergodox_ez/keymaps/naps62/keymap.c +++ b/keyboards/ergodox/keymaps/naps62/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/naps62/readme.md b/keyboards/ergodox/keymaps/naps62/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/naps62/readme.md rename to keyboards/ergodox/keymaps/naps62/readme.md diff --git a/keyboards/ergodox_ez/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c similarity index 58% rename from keyboards/ergodox_ez/keymaps/ordinary/keymap.c rename to keyboards/ergodox/keymaps/ordinary/keymap.c index 778cbc63c..302c41cc8 100644 --- a/keyboards/ergodox_ez/keymaps/ordinary/keymap.c +++ b/keyboards/ergodox/keymaps/ordinary/keymap.c @@ -1,23 +1,20 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" #include "action_util.h" -#include "mousekey.h" #define BASE 0 // default layer #define SYMB 1 // symbols layer #define MDIA 2 // media layer #define SPEC 3 // special layer -#define LCaps 10 // left caps-shift key -#define LSymb 11 // left symbol-shift key -#define LMdia 12 // left media-shift key -#define LSpec 13 // left special-shift key -#define RCaps 14 // right caps-shift key -#define RSymb 15 // right symbol-shift key -#define RMdia 16 // right media-shift key -#define RSpec 17 // right special-shift key +#define LSymb 10 // left symbol-shift key +#define LMdia 11 // left media-shift key +#define LSpec 12 // left special-shift key +#define RSymb 13 // right symbol-shift key +#define RMdia 14 // right media-shift key +#define RSpec 15 // right special-shift key #define MUL 20 // mouse up left #define MUR 21 // mouse up right @@ -25,123 +22,124 @@ #define MDR 23 // mouse down right /* - * The Ordinary Layout for the Ergodox EZ keyboard, v4 - * + * The Ordinary Layout for the Ergodox EZ keyboard, v4.20 + * * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com * * No rights reserved. This software is in the public domain. * Credit me if you are friendly but if you're a jerk don't bother. - * + * If you use or modify this layout I would love to hear from you. + * * Details: readme.md - * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary + * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/******* Base Layer ******************************************************************************************************** +/******* Base Layer **************************************************************************************************** * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | - * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' + * ,------------------------------------------------------. ,------------------------------------------------------. + * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | + * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| + * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | + * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| + * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | + * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| + * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | + * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Home | End | | Left | Right| + * ,------|------|------| |------+------+------. + * | | | PgUp | | Up | | | + * |Backsp| Del |------| |------| Enter| Space| + * | | | PgDn | | Down | | | + * `--------------------' `--------------------' */ [BASE] = KEYMAP( // left hand - F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC + F(LSpec) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC ,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC ,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) +,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) ,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI ,KC_HOME,KC_END ,KC_PGUP ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) - ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC + // right hand + ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) + ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) + ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) + ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT + ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_DOWN ,KC_ENT ,KC_SPC ), -/******* Symbols Layer ***************************************************************************************************** +/******* Symbols Layer ************************************************************************************************* * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| - * `-----------------------------------' `-------------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | + * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| + * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | 0 | . | = | + | Ent | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Left | Right| | Home | End | + * ,------|------|------| |------+------+------. + * | | | Up | | PgUp | | | + * |Space |Enter |------| |------|BackSp| Del | + * | | | Down | | PgDn | | | + * `--------------------' `--------------------' */ [SYMB] = KEYMAP( // left hand KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC ,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV +,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV ,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB -,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI +,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI ,KC_LEFT ,KC_RGHT ,KC_UP ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL + // right hand + ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS + ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS + ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS + ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS + ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT + ,KC_HOME ,KC_END + ,KC_PGUP + ,KC_PGDN ,KC_BSPC ,KC_DEL ), /******* Media Layer ******************************************************************************************************* * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' + * ,---------------------------------------------------------------. ,---------------------------------------------------------------. + * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | + * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| + * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | + * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| + * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | + * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| + * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | + * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' + * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| + * `---------------------------------------------' `---------------------------------------------' + * ,-------------. ,-------------. + * | Stop |Refrsh| | Prev | Next | + * ,------|------|------| |------+------+------. + * |Brwser|Brwser|Search| |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play-| + * | | | Home | |VolDn | | Pause| + * `--------------------' `--------------------' */ [MDIA] = KEYMAP( // left hand @@ -166,67 +164,63 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /******* Special Layer ***************************************************************************************************** * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | Esc | | | | | | | | | | | | Bspc | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * | | Esc | | | | | | | | | | | - | Bspc | | + * |-------------+------+------+------+------+-------------| |------+------+------+------+------+------+-------------| + * | Media Lock | | | | | | | | | | | | [ | ] | Media Lock | + * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| + * | Symbol Lock | | | | | |------| |------| | | | | | Symbol Lock | + * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| + * | Caps Lock | | | | | | | | | | | | | | Caps Lock | + * `-------------+------+------+------+------+-------------' `-------------+------+------+------+------+-------------' + * | | | | | | | | | | | | + * `------------------------------------' `------------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' */ [SPEC] = KEYMAP( // left hand KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_CAPS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_MINS ,KC_BSPC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_LBRC ,KC_RBRC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_CAPS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ) }; const uint16_t PROGMEM fn_actions[] = { // the faux shift keys are implemented as macro taps - [LCaps] = ACTION_MACRO_TAP(LCaps) - ,[LSymb] = ACTION_MACRO_TAP(LSymb) + [LSymb] = ACTION_MACRO_TAP(LSymb) ,[LMdia] = ACTION_MACRO_TAP(LMdia) ,[LSpec] = ACTION_MACRO_TAP(LSpec) - ,[RCaps] = ACTION_MACRO_TAP(RCaps) ,[RSymb] = ACTION_MACRO_TAP(RSymb) ,[RMdia] = ACTION_MACRO_TAP(RMdia) ,[RSpec] = ACTION_MACRO_TAP(RSpec) }; -uint16_t caps_shift = 0; uint16_t symb_shift = 0; uint16_t mdia_shift = 0; +uint16_t spec_shift = 0; -bool symb_lock = false; bool mdia_lock = false; +bool symb_lock = false; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -237,50 +231,28 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // only because sometimes rapid pressing led to irregular events; this way the states // are self healing during use. - case LCaps: // both caps-shift keys trigger Left Shift - case RCaps: // so they don't interfere with the magic combo - if (record->event.pressed && !record->tap.count) { - if(++caps_shift > 2) caps_shift = 2; - if(caps_shift == 2) { - register_code(KC_CAPS); - unregister_code(KC_CAPS); - } else if(caps_shift == 1) { - register_code(KC_LSFT); - } - } else { - if(--caps_shift < 0) caps_shift = 0; - if(caps_shift == 0) unregister_code(KC_LSFT); - } - break; - - case LSymb: - if (record->event.pressed) { - if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } - } else { - if(--symb_shift < 0) symb_shift = 0; - if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); + case LSymb: // + if (record->event.pressed) { // when the LSymb button is pressed + if(++symb_shift > 2) mdia_shift = 2; // increment the symb shift count, max two + if(spec_shift) symb_lock = !symb_lock; // if the Special layer is on, toggle the shift lock + layer_on(SYMB); // in any case, turn on the Symbols layer + } else { // when the LSymb button is released + if(--symb_shift < 0) symb_shift = 0; // decrement the shift count, minimum zero + if((!symb_shift) && (!symb_lock)) layer_off(SYMB); // if both shifts are released and the lock is off, turn off the Symbols layer } break; case LMdia: if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { register_code(KC_TAB); } else { + if(spec_shift) mdia_lock = !mdia_lock; if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } + layer_on(MDIA); } } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if(record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { unregister_code(KC_TAB); } else { if(--mdia_shift < 0) mdia_shift = 0; @@ -290,35 +262,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case LSpec: - if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_GRV); + if (record->event.pressed) { // when the LSpec button is pressed + if(symb_shift) symb_lock == !symb_lock; // if another layer button is engaged, then + else if(mdia_shift) mdia_lock = !mdia_lock; // lock that layer, be it caps or symb or mdia + else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) { + register_code(KC_GRV); // otherwise, if it's an uninterrupted tap, emit a char } else { - layer_on(SPEC); + if(++spec_shift > 2) spec_shift = 2; + layer_on(SPEC); // otherwise, turn on the Special layer } } else { - if(record->tap.count && !record->tap.interrupted) { + if(record->tap.count && !record->tap.interrupted && (!spec_shift)) { unregister_code(KC_GRV); } else { - layer_off(SPEC); + if(--spec_shift < 0) spec_shift = 0; + if(!spec_shift) layer_off(SPEC); } } break; case RSymb: if (record->event.pressed) { - if (record->tap.count && (!symb_shift) && (!symb_lock)) { + if (record->tap.count && (!symb_shift) && (!symb_lock) && (!spec_shift)) { register_code(KC_QUOT); } else { if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } + if(spec_shift) symb_lock = !symb_lock; + layer_on(SYMB); } } else { - if(record->tap.count && symb_shift == 0) { + if(record->tap.count && (!symb_shift) && (!symb_lock) && (!spec_shift)) { unregister_code(KC_QUOT); } else { if(--symb_shift < 0) symb_shift = 0; @@ -329,18 +302,15 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case RMdia: if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { register_code(KC_BSLS); } else { if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } + if(spec_shift) mdia_lock = !mdia_lock; + layer_on(MDIA); } } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if(record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { unregister_code(KC_BSLS); } else { if(--mdia_shift < 0) mdia_shift = 0; @@ -351,16 +321,20 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case RSpec: if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { + if(symb_shift) symb_lock = !symb_lock; + else if(mdia_shift) mdia_lock = !mdia_lock; + else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) { register_code(KC_EQL); } else { + if(++spec_shift > 2) spec_shift = 2; layer_on(SPEC); } } else { - if(record->tap.count && !record->tap.interrupted) { + if(record->tap.count && !record->tap.interrupted && (!spec_shift)) { unregister_code(KC_EQL); } else { - layer_off(SPEC); + if(--spec_shift < 0) spec_shift = 0; + if(!spec_shift) layer_off(SPEC); } } break; @@ -419,7 +393,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // none break; } - + return MACRO_NONE; }; @@ -431,7 +405,9 @@ void matrix_init_user(void) { // Runs constantly in the background, in a loop. void matrix_scan_user(void) { // shift or caps lock turns on red light - if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<mods & MOD_BIT(KC_LSFT)) + || (keyboard_report->mods & MOD_BIT(KC_RSFT)) + || (host_keyboard_leds() & (1<\n\n\nTab"], +[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"A",{x:14.5},":\n;",{c:"#c6c600",t:"#007d00",w:1.5},"\"\n'\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"], [{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], [{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], [{y:-0.875,x:5.5},"B",{x:6.5},"N"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc"},"Z",{x:14.5},"?\n/",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], +[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Z",{x:14.5},"?\n/",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], [{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], [{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Home","End"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Home","End"], [{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], [{x:2},"Page\n\n\n\n\n\nDown"], [{r:-30,rx:13,y:-1,x:-3},"Left","Right"], diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png new file mode 100644 index 000000000..5ff3f5338 Binary files /dev/null and b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt new file mode 100644 index 000000000..e1467b22e --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], +[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], +[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], +[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#1e8fff"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], +[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#1e8fff",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#9977ee"},"Print\n\n\n\n\n\nScreen"], +[{y:-0.875,c:"#000000",t:"#3f68ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#3f68ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], +[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], +[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#c6c600",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#1e8fff",t:"#000000",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], +[{y:-0.75,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"], +[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""], +[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff",fa:[0,0,0,1]},"Delete\n\n\nOption"], +[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert\n\n\nCmd",{x:1,c:"#dddd77"},"Hyper"], +[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], +[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], +[{x:2},"Home\n\n\nBrowser"], +[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], +[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#6633ee",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], +[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nDown"] + diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.png b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png new file mode 100644 index 000000000..4fb9d1d16 Binary files /dev/null and b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt new file mode 100644 index 000000000..97f40f9db --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt @@ -0,0 +1,27 @@ +[{x:3.5,a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"_\n\n\n\n\n\n-"], +[{y:-0.875,x:5.5,a:7},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], +[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#ff8500"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"{\n["], +[{y:-0.875,x:5.5,a:7},"",{h:1.5},"",{x:4.5,h:1.5},"",""], +[{y:-0.875,c:"#c6c600",t:"#002299",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"], +[{y:-0.625,x:6.5,c:"#cccccc",t:"#000000",a:7,h:1.5},"",{x:4.5,h:1.5},""], +[{y:-0.75,x:3.5},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.75,x:0.5},"","",{x:14.5},"",""], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], +[{h:2},"",{h:2},"",""], +[{x:2},""], +[{r:-30,rx:13,y:-1,x:-3},"",""], +[{x:-3},"",{h:2},"",{h:2},""], +[{x:-3},""] + diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png new file mode 100644 index 000000000..dd9086329 Binary files /dev/null and b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt new file mode 100644 index 000000000..001bf370d --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], +[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], +[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], +[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], +[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#c6c600",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"(",{x:10.5,c:"#89b087"},"5"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], +[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], +[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], +[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},"."], +[{y:-0.875,x:2.5,c:"#dddd77"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0",{x:1},"="], +[{y:-0.75,x:0.5,c:"#dddd77"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+","Enter"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Left","Right"], +[{h:2},"Space",{h:2},"Enter","Up"], +[{x:2},"Down"], +[{r:-30,rx:13,y:-1,x:-3},"Home","End"], +[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], +[{x:-3},"Page\n\n\n\n\n\nDown"] + diff --git a/keyboards/ergodox/keymaps/ordinary/readme.md b/keyboards/ergodox/keymaps/ordinary/readme.md new file mode 100644 index 000000000..820b80b45 --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/readme.md @@ -0,0 +1,90 @@ +# The Ordinary Layout, a familiar and powerful layout # + +The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. + +The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. + +Nicholas Keene +ordinarylayout@nicholaskeene.com +no rights reserved, use for any purposes, credit me if you are a nice person + +## The Base Layout ## + +* *White Keys* are all the normal characters and symbols in all the normal locations (except for the brackets). +* *Modifier Keys* are light yellow and in the traditional location: Control, Option, Command, plus Hyper and Meh. +* *Shift Keys* are dark yellow, found on the outsides of the keyboard. Capitals Shift (traditional shift) is found in the usual place and above that is found Symbol Shift, Media Shift, and Special Shift (Shift Lock). +* Several of the shift keys double for entry of characters which would typically be in those locations. +* *Thumb Keys* shown in orange are for text navigation and manipulation. +* *Escape* is red and it is always found in that location no matter what. + +![Ordinary base layout](ordinary-base.png) + +The four big orange keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. + +The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. + +## The Symbols Layer ## + +* *Symbols* shown in light green. All kinds of brackets are available on this layer. Ampersand and Pipe justapose each other. Pipe, slash, and backslash are arranged in a column. +* *F-Keys* are bright green and overlay the row of numerals. +* *Number pad* in dark green under the right hand includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads so that NumLock is not needed. +* *Thumb keys* on this layer are the *reverse* of the orange keys on the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. + +![Ordinary symbol layout](ordinary-symbol.png) + +The Symbols Layer is based on the Coder Layer from the default Ergodox EZ layout. I slightly rearranged the symbols, added some symbols, expanded the number pad, and straightened out the F-Keys. It's very handy to have the symbols directly underneath the normal typing keys. + +## The Media Layer ## + +* *Mouse Cursor Keys* are under the left hand, shown in dark blue. Diagonal keys won't automatically repeat unless combined with other keys. Buttons to left- middle- and right-click the mouse are also featured. +* *Text Cursor Keys* are under the right hand, shown in dark blue. They overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. +* *Scrolling and Paging* keys are shown in light blue and have some useful redundancy across the layout. +* Higher-order *F-Keys* are shown in bright green overylaying the numerals. +* *Application Keys* to control web browsers and audio players are dark purple but don't get too excited because these have weak support on operating systems I've looked at. Good luck. +* The light purple keys are various operating system keys such as NumLock and Mute and a button to navigate to My Computer (usually your home dir). +* The dark gray keys do nothing in case you bump them by accident + +![Ordinary media layout](ordinary-media.png) + +This layer is a substantial extension of the Media layer on the Ergodox EZ default layout. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. + +Keys to directly interact with the operating system are also found on this layer, such as volume and shutdown. + +## Switching Between Layers ## + +In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. + +Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. Lock the shift keys using the Shift Lock button, which is the same as the Special Shift button. + +Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. + +## Special Sequences ## + +![Ordinary special layout](ordinary-special.png) + +The Special Shift layer is mostly used to lock the shift keys but in order to make this layout more _ordinary_ there are a few special sequences which put some keys near their most common traditional locations. + +### Escape ### + +The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, which is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. + +The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. + +### Backspace ### + +At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence using the 0 key to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. + +### Other Characters ### + +The Escape and Backspace special sequences are so useful why not have a few more? You can find dash under 9, left bracket under o, and right bracket under p. That's pretty much all the characters from the top right corner of the keyboard which moved to make room for the columnar layout. + +**** + +The Ordinary Layout for the Ergodox EZ keyboard, v4.20 + +Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + +No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. + +Details: readme.md + https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary diff --git a/keyboards/ergodox_ez/keymaps/osx_de/keymap.c b/keyboards/ergodox/keymaps/osx_de/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/osx_de/keymap.c rename to keyboards/ergodox/keymaps/osx_de/keymap.c index 554813d7e..e3b9e11f4 100644 --- a/keyboards/ergodox_ez/keymaps/osx_de/keymap.c +++ b/keyboards/ergodox/keymaps/osx_de/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german_osx.h" diff --git a/keyboards/ergodox_ez/keymaps/osx_de/osx_de_highres.png b/keyboards/ergodox/keymaps/osx_de/osx_de_highres.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/osx_de/osx_de_highres.png rename to keyboards/ergodox/keymaps/osx_de/osx_de_highres.png diff --git a/keyboards/ergodox_ez/keymaps/osx_de/readme.md b/keyboards/ergodox/keymaps/osx_de/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/osx_de/readme.md rename to keyboards/ergodox/keymaps/osx_de/readme.md diff --git a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c b/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c rename to keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c index 687a5cb8b..6c4312a32 100644 --- a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c +++ b/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png b/keyboards/ergodox/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png rename to keyboards/ergodox/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png diff --git a/keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c b/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c rename to keyboards/ergodox/keymaps/osx_de_experimental/keymap.c index 21d695894..61b6a4fdb 100644 --- a/keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_neo2.h" diff --git a/keyboards/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental_highres.png b/keyboards/ergodox/keymaps/osx_de_experimental/osx_de_experimental_highres.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental_highres.png rename to keyboards/ergodox/keymaps/osx_de_experimental/osx_de_experimental_highres.png diff --git a/keyboards/ergodox_ez/keymaps/osx_de_experimental/readme.md b/keyboards/ergodox/keymaps/osx_de_experimental/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/osx_de_experimental/readme.md rename to keyboards/ergodox/keymaps/osx_de_experimental/readme.md diff --git a/keyboards/ergodox_ez/keymaps/osx_fr/keymap.c b/keyboards/ergodox/keymaps/osx_fr/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/osx_fr/keymap.c rename to keyboards/ergodox/keymaps/osx_fr/keymap.c index de951666d..7dee284fa 100644 --- a/keyboards/ergodox_ez/keymaps/osx_fr/keymap.c +++ b/keyboards/ergodox/keymaps/osx_fr/keymap.c @@ -1,5 +1,5 @@ // French AZERTY version of the default_osx file -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_french_osx.h" @@ -184,4 +184,4 @@ void matrix_scan_user(void) { break; } -}; \ No newline at end of file +}; diff --git a/keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c b/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c rename to keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c index 1032be549..11281df8a 100644 --- a/keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c +++ b/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c @@ -5,7 +5,7 @@ // Only default layer was remapped all others layers are standard Ergodox EZ // Very personal mapping of-course, but who knows a starting point for others. -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/plover/keymap.c b/keyboards/ergodox/keymaps/plover/keymap.c similarity index 98% rename from keyboards/ergodox_ez/keymaps/plover/keymap.c rename to keyboards/ergodox/keymaps/plover/keymap.c index a991e6082..12b3aa212 100644 --- a/keyboards/ergodox_ez/keymaps/plover/keymap.c +++ b/keyboards/ergodox/keymaps/plover/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" @@ -160,7 +160,7 @@ KEYMAP( [PLVR] = KEYMAP( // layout: layer 4: Steno for Plover // left hand KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, @@ -169,7 +169,7 @@ KEYMAP( KC_C, KC_V, KC_NO, // right hand KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, diff --git a/keyboards/ergodox_ez/keymaps/plums/keymap.c b/keyboards/ergodox/keymaps/plums/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/plums/keymap.c rename to keyboards/ergodox/keymaps/plums/keymap.c index 46eb2e42b..2853455e3 100644 --- a/keyboards/ergodox_ez/keymaps/plums/keymap.c +++ b/keyboards/ergodox/keymaps/plums/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/plums/plums.png b/keyboards/ergodox/keymaps/plums/plums.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/plums/plums.png rename to keyboards/ergodox/keymaps/plums/plums.png diff --git a/keyboards/ergodox_ez/keymaps/plums/readme.md b/keyboards/ergodox/keymaps/plums/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/plums/readme.md rename to keyboards/ergodox/keymaps/plums/readme.md diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c similarity index 98% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c rename to keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c index a66971bef..24d0c4ecb 100644 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/readme.md rename to keyboards/ergodox/keymaps/romanzolotarev-norman-osx/readme.md diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png rename to keyboards/ergodox/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c rename to keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c index 7c9f67381..9f41e5189 100644 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md rename to keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png rename to keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c rename to keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c index 9971b834c..563e24872 100644 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md rename to keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/readme.md diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png rename to keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c rename to keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c index dedac694e..5569f5c74 100644 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/readme.md rename to keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/readme.md diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png rename to keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png diff --git a/keyboards/ergodox/keymaps/sethbc/Makefile b/keyboards/ergodox/keymaps/sethbc/Makefile new file mode 100644 index 000000000..8c4ff8784 --- /dev/null +++ b/keyboards/ergodox/keymaps/sethbc/Makefile @@ -0,0 +1,14 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDox EZ +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = yes # Unicode + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/ergodox/keymaps/sethbc/keymap.c b/keyboards/ergodox/keymaps/sethbc/keymap.c new file mode 100644 index 000000000..6846c4d52 --- /dev/null +++ b/keyboards/ergodox/keymaps/sethbc/keymap.c @@ -0,0 +1,102 @@ +#include "ergodox.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define FN1 1 // symbols +#define FN2 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(FN2), + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(FN1), + KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(FN1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RGUI, + KC_RALT, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), +// FN1 +[FN1] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +// FN2 +[FN2] = KEYMAP( + 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, + // right hand + KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PAST, KC_PMNS, KC_BSPC, + KC_TRNS, KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_BSPC, + KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PENT, + KC_TRNS, KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PENT, + KC_P0, KC_PDOT, KC_SLSH, KC_PENT, KC_PENT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/sethbc/readme.md b/keyboards/ergodox/keymaps/sethbc/readme.md new file mode 100644 index 000000000..510b2f99c --- /dev/null +++ b/keyboards/ergodox/keymaps/sethbc/readme.md @@ -0,0 +1,3 @@ +# sethbc's Ergodox EZ keymap + +Largely based on the Ergodox Infinity default keymap diff --git a/keyboards/ergodox_ez/keymaps/sneako/keymap.c b/keyboards/ergodox/keymaps/sneako/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/sneako/keymap.c rename to keyboards/ergodox/keymaps/sneako/keymap.c index 0c6863102..08cadd685 100644 --- a/keyboards/ergodox_ez/keymaps/sneako/keymap.c +++ b/keyboards/ergodox/keymaps/sneako/keymap.c @@ -1,7 +1,7 @@ // Based on `default_osx` // Replace left Bksp with Ctrl/Esc // Remove the Ctrl from Z and / -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/sneako/readme.md b/keyboards/ergodox/keymaps/sneako/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/sneako/readme.md rename to keyboards/ergodox/keymaps/sneako/readme.md diff --git a/keyboards/ergodox_ez/keymaps/software_neo2/keymap.c b/keyboards/ergodox/keymaps/software_neo2/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/software_neo2/keymap.c rename to keyboards/ergodox/keymaps/software_neo2/keymap.c index 2eaba0d7d..41ace403d 100644 --- a/keyboards/ergodox_ez/keymaps/software_neo2/keymap.c +++ b/keyboards/ergodox/keymaps/software_neo2/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_neo2.h" diff --git a/keyboards/ergodox_ez/keymaps/supercoder/config_user.h b/keyboards/ergodox/keymaps/supercoder/config.h similarity index 81% rename from keyboards/ergodox_ez/keymaps/supercoder/config_user.h rename to keyboards/ergodox/keymaps/supercoder/config.h index 8da138372..2de3599f8 100644 --- a/keyboards/ergodox_ez/keymaps/supercoder/config_user.h +++ b/keyboards/ergodox/keymaps/supercoder/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H 1 -#include "config.h" +#include "../../config.h" #undef LOCKING_SUPPORT_ENABLE #undef LOCKING_RESYNC_ENABLE diff --git a/keyboards/ergodox_ez/keymaps/supercoder/images/layout.png b/keyboards/ergodox/keymaps/supercoder/images/layout.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/supercoder/images/layout.png rename to keyboards/ergodox/keymaps/supercoder/images/layout.png diff --git a/keyboards/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg b/keyboards/ergodox/keymaps/supercoder/images/supercoder_2000.jpg similarity index 100% rename from keyboards/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg rename to keyboards/ergodox/keymaps/supercoder/images/supercoder_2000.jpg diff --git a/keyboards/ergodox_ez/keymaps/supercoder/keymap.c b/keyboards/ergodox/keymaps/supercoder/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/supercoder/keymap.c rename to keyboards/ergodox/keymaps/supercoder/keymap.c index ca21d30fd..775acf2c9 100644 --- a/keyboards/ergodox_ez/keymaps/supercoder/keymap.c +++ b/keyboards/ergodox/keymaps/supercoder/keymap.c @@ -2,7 +2,7 @@ * SuperCoder 2000 layout */ -#include "ergodox_ez.h" +#include "ergodox.h" /* Layers */ diff --git a/keyboards/ergodox_ez/keymaps/supercoder/makefile.mk b/keyboards/ergodox/keymaps/supercoder/makefile.mk similarity index 100% rename from keyboards/ergodox_ez/keymaps/supercoder/makefile.mk rename to keyboards/ergodox/keymaps/supercoder/makefile.mk diff --git a/keyboards/ergodox_ez/keymaps/supercoder/readme.md b/keyboards/ergodox/keymaps/supercoder/readme.md similarity index 96% rename from keyboards/ergodox_ez/keymaps/supercoder/readme.md rename to keyboards/ergodox/keymaps/supercoder/readme.md index 97bf7f583..8ef96eddf 100644 --- a/keyboards/ergodox_ez/keymaps/supercoder/readme.md +++ b/keyboards/ergodox/keymaps/supercoder/readme.md @@ -23,7 +23,7 @@ your own: ``` $ git clone https://github.com/jackhumbert/qmk_firmware.git -$ cd qmk_firmware/keyboards/ergodox_ez +$ cd qmk_firmware/keyboards/ergodox $ git clone https://github.com/algernon/ergodox-supercoder.git keymaps/supercoder $ make KEYMAP=supercoder ``` diff --git a/keyboards/ergodox_ez/keymaps/techtomas/keymap.c b/keyboards/ergodox/keymaps/techtomas/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/techtomas/keymap.c rename to keyboards/ergodox/keymaps/techtomas/keymap.c index 1ff6618b9..93d59d487 100644 --- a/keyboards/ergodox_ez/keymaps/techtomas/keymap.c +++ b/keyboards/ergodox/keymaps/techtomas/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/techtomas/readme.md b/keyboards/ergodox/keymaps/techtomas/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/techtomas/readme.md rename to keyboards/ergodox/keymaps/techtomas/readme.md diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox/keymaps/teckinesis/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/teckinesis/keymap.c rename to keyboards/ergodox/keymaps/teckinesis/keymap.c index ec6ceb96b..2837874f7 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox/keymaps/teckinesis/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.png b/keyboards/ergodox/keymaps/teckinesis/ordinary-special.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.png rename to keyboards/ergodox/keymaps/teckinesis/ordinary-special.png diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.txt b/keyboards/ergodox/keymaps/teckinesis/ordinary-special.txt similarity index 100% rename from keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.txt rename to keyboards/ergodox/keymaps/teckinesis/ordinary-special.txt diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox/keymaps/teckinesis/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/readme.md rename to keyboards/ergodox/keymaps/teckinesis/readme.md diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json b/keyboards/ergodox/keymaps/teckinesis/teckinesis-base.json similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json rename to keyboards/ergodox/keymaps/teckinesis/teckinesis-base.json diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png b/keyboards/ergodox/keymaps/teckinesis/teckinesis-base.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png rename to keyboards/ergodox/keymaps/teckinesis/teckinesis-base.png diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json b/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.json similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json rename to keyboards/ergodox/keymaps/teckinesis/teckinesis-media.json diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png b/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png rename to keyboards/ergodox/keymaps/teckinesis/teckinesis-media.png diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json b/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.json similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json rename to keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.json diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png b/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png rename to keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.png diff --git a/keyboards/ergodox_ez/keymaps/tkuichooseyou/README.md b/keyboards/ergodox/keymaps/tkuichooseyou/README.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/tkuichooseyou/README.md rename to keyboards/ergodox/keymaps/tkuichooseyou/README.md diff --git a/keyboards/ergodox_ez/keymaps/tkuichooseyou/compiled.hex b/keyboards/ergodox/keymaps/tkuichooseyou/compiled.hex similarity index 100% rename from keyboards/ergodox_ez/keymaps/tkuichooseyou/compiled.hex rename to keyboards/ergodox/keymaps/tkuichooseyou/compiled.hex diff --git a/keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c b/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c rename to keyboards/ergodox/keymaps/tkuichooseyou/keymap.c index 87b77e42e..d1c779186 100644 --- a/keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c +++ b/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/tm2030/keymap.c b/keyboards/ergodox/keymaps/tm2030/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/tm2030/keymap.c rename to keyboards/ergodox/keymaps/tm2030/keymap.c index ca8075226..1d861ee7c 100644 --- a/keyboards/ergodox_ez/keymaps/tm2030/keymap.c +++ b/keyboards/ergodox/keymaps/tm2030/keymap.c @@ -1,5 +1,5 @@ /* TypeMatrix-2030-like keymap */ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "led.h" diff --git a/keyboards/ergodox_ez/keymaps/tm2030/readme.md b/keyboards/ergodox/keymaps/tm2030/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/tm2030/readme.md rename to keyboards/ergodox/keymaps/tm2030/readme.md diff --git a/keyboards/ergodox_ez/keymaps/tonyabra_osx/keymap.c b/keyboards/ergodox/keymaps/tonyabra_osx/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/tonyabra_osx/keymap.c rename to keyboards/ergodox/keymaps/tonyabra_osx/keymap.c index 87b9fb676..2a15fcb8d 100644 --- a/keyboards/ergodox_ez/keymaps/tonyabra_osx/keymap.c +++ b/keyboards/ergodox/keymaps/tonyabra_osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox_ez/keymaps/tonyabra_osx/readme.md b/keyboards/ergodox/keymaps/tonyabra_osx/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/tonyabra_osx/readme.md rename to keyboards/ergodox/keymaps/tonyabra_osx/readme.md diff --git a/keyboards/ergodox/keymaps/townk_osx/config.h b/keyboards/ergodox/keymaps/townk_osx/config.h new file mode 100644 index 000000000..72d3e9670 --- /dev/null +++ b/keyboards/ergodox/keymaps/townk_osx/config.h @@ -0,0 +1,44 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "../../config.h" +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +//#define DEBUG_MATRIX_SCAN_RATE +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 3000 + +#endif diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/keymap.c b/keyboards/ergodox/keymaps/townk_osx/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/townk_osx/keymap.c rename to keyboards/ergodox/keymaps/townk_osx/keymap.c index 07e58a491..5043d49a0 100644 --- a/keyboards/ergodox_ez/keymaps/townk_osx/keymap.c +++ b/keyboards/ergodox/keymaps/townk_osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "action_util.h" diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk b/keyboards/ergodox/keymaps/townk_osx/makefile.mk similarity index 54% rename from keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk rename to keyboards/ergodox/keymaps/townk_osx/makefile.mk index e757557bd..c06021b9f 100644 --- a/keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk +++ b/keyboards/ergodox/keymaps/townk_osx/makefile.mk @@ -1,4 +1,2 @@ # I don't want my keyboard blinking lights when is suppose to be asleep. -SLEEP_LED_ENABLE = no - -CONFIG_H = keymaps/$(KEYMAP)/config.h +SLEEP_LED_ENABLE = no \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/readme.md b/keyboards/ergodox/keymaps/townk_osx/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/townk_osx/readme.md rename to keyboards/ergodox/keymaps/townk_osx/readme.md diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_base.png b/keyboards/ergodox/keymaps/townk_osx/townk_osx_base.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_base.png rename to keyboards/ergodox/keymaps/townk_osx/townk_osx_base.png diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_fn.png b/keyboards/ergodox/keymaps/townk_osx/townk_osx_fn.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_fn.png rename to keyboards/ergodox/keymaps/townk_osx/townk_osx_fn.png diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_keypad.png b/keyboards/ergodox/keymaps/townk_osx/townk_osx_keypad.png similarity index 100% rename from keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_keypad.png rename to keyboards/ergodox/keymaps/townk_osx/townk_osx_keypad.png diff --git a/keyboards/ergodox_ez/keymaps/twey/keymap.c b/keyboards/ergodox/keymaps/twey/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/twey/keymap.c rename to keyboards/ergodox/keymaps/twey/keymap.c index 019930f2a..5deacd63f 100644 --- a/keyboards/ergodox_ez/keymaps/twey/keymap.c +++ b/keyboards/ergodox/keymaps/twey/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_plover.h" diff --git a/keyboards/ergodox_ez/keymaps/twey/readme.md b/keyboards/ergodox/keymaps/twey/readme.md similarity index 100% rename from keyboards/ergodox_ez/keymaps/twey/readme.md rename to keyboards/ergodox/keymaps/twey/readme.md diff --git a/keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c b/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c similarity index 99% rename from keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c rename to keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c index 8effa53b2..c05a1018d 100644 --- a/keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c +++ b/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" // readme diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..08ee5aeda --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -0,0 +1,312 @@ +/* + * About this keymap: + * + * The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak + * software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner + * keys. I've decided to continue using this layout with my ErgoDox. + * + * The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional + * keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. + * + * I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck + * layouts. + * + */ + +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _DV 0 // Dvorak layer +#define _QW 1 // Qwerty layer +#define _CM 2 // Colemak layer +#define _MD 3 // Media Layer +#define _KP 4 // Keypad Layer + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Layer 0 : Dvorak + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | P | Y | | | | F | G | C | R | L | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTL | LALT | | RALT | RCTL | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + * + */ +[_DV] = KEYMAP( + // left hand + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, + KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(_MD), + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, + XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + MO(_KP), KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_UP, KC_DOWN, KC_SLSH, KC_EQL, KC_RGUI, + KC_RALT, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), + + +/* Layer 1: QWERTY + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTL | LALT | | RALT | RCTL | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + */ +[_QW] = KEYMAP( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(_MD), + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(_KP), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_RGUI, + KC_LALT, KC_LCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), + + +/* Layer 2 : Colemak + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTL | LALT | | RALT | RCTL | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + */ +[_CM] = KEYMAP( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, XXXXXXX, + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(_MD), + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + XXXXXXX, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + MO(_KP), KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_RGUI, + KC_LALT, KC_LCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), + + +/* Layer 3 : Media layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[_MD] = KEYMAP( + // left hand + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, DVORAK, QWERTY, COLEMAK, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ + ), + + +/* Layer 4 : Keypad layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Power | | | | | | | | | | NmLk | KP = | KP / | KP * | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP - | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | KP 0 | | KP . |KP Ent| | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[_KP] = KEYMAP( + // left hand + KC_PWR, _______, _______, _______, _______, _______, _______, + KC_SLEP, _______, _______, _______, _______, _______, _______, + KC_WAKE, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, KC_NLCK, KC_PEQL, KC_PSLS, KC_PAST, _______, + _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______, + _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, + _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + KC_P0, _______, KC_PDOT, KC_PENT, _______, + _______, _______, + _______, + _______, _______, _______ + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md new file mode 100644 index 000000000..6ecdabc9e --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -0,0 +1,122 @@ +# Xyverz's ErgoDox EZ Keymap + +## About this keymap: + +The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my ErgoDox. + +The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. + +I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. + +## Still to do: + + * Need to figure out a better position for the ESC key. + * Come up with a function for the empty keys shown in the alpha layers below. + * Fix the CapsLock, NumLock, and ScrLck LEDs. + +### Layer 0: Dvorak layer + + ,--------------------------------------------------.,--------------------------------------------------. + | ] | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | [ | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Tab | ' | , | . | Y | Y | || | F | G | C | R | L | \ | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | CapsLk | A | O | E | U | I |------||------| D | H | T | N | S | - | + |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | X | || | B | M | W | V | Z | RShift | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | LCtr | LAlt || Ralt | RCtr | + ,------|------|------||------+------+------. + | | | Home || PgUp | | | + | BkSp | Del |------||------| Enter| Space| + | | | End || PgDn | | | + `--------------------'`--------------------' + +### Layer 1: QWERTY layer + + ,--------------------------------------------------.,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | || | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | CapsLk | A | S | D | F | G |------||------| H | J | K | L | ; | ' | + |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | || | N | M | , | . | / | RShift | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | LCtr | LAlt || Ralt | RCtr | + ,------|------|------||------+------+------. + | | | Home || PgUp | | | + | BkSp | Del |------||------| Enter| Space| + | | | End || PgDn | | | + `--------------------'`--------------------' + +### Keymap 2: Colemak layer + + ,--------------------------------------------------.,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Tab | Q | W | F | P | G | || | J | L | U | Y | ; | \ | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | BkSpc | A | R | S | T | D |------||------| H | N | E | I | O | ' | + |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | || | K | M | , | . | / | RShift | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | LCtr | LAlt || Ralt | RCtr | + ,------|------|------||------+------+------. + | | | Home || PgUp | | | + | BkSp | Del |------||------| Enter| Space| + | | | End || PgDn | | | + `--------------------'`--------------------' + +### layer 3 : Media layer + + ,--------------------------------------------------.,--------------------------------------------------. + | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 || F12 | F6 | F7 | F8 | F9 | F10 | | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | | | PrSc | ScLk | Paus | | || | | Mute | Vol- | Vol+ | | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | | | | | | |------||------| Stop | Prev | Play | Next | Sel | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | | |Dvorak|Qwerty|Colemk| | || | | | | | | | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | | || | | + ,------|------|------||------+------+------. + | | | || | | | + | | |------||------| | | + | | | || | | | + `--------------------'`--------------------' + + + +### Keymap 4: Keypad layer + + ,--------------------------------------------------.,--------------------------------------------------. + | Power | | | | | | || | | NmLk | KP = | KP / | KP * | | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Sleep | | | | | | || | | KP 7 | KP 8 | KP 9 | KP - | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | Wake | | | | | |------||------| | KP 4 | KP 5 | KP 6 | KP + | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | | | | | | | || | | KP 1 | KP 2 | KP 3 |KP Ent| | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | | | | | | | KP 0 | | KP . |KP Ent| | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | | || | | + ,------|------|------||------+------+------. + | | | || | | | + | | |------||------| | | + | | | || | | | + `--------------------'`--------------------' diff --git a/keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c similarity index 94% rename from keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c rename to keyboards/ergodox/keymaps/zweihander-osx/keymap.c index 3444152bc..d6d66fd55 100644 --- a/keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" @@ -11,7 +11,7 @@ #define BBED 2 // BBEdit #define TMNL 3 // Terminal #define SAFA 4 // Safari -#define ALFRED_LEAD_TIME 100 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input +#define ALFRED_LEAD_TIME 250 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | `~ | '" | | ⎋ | ⌫ | * ,------|------|------| |------+--------+------. * | | | PgUp | | PgDn | | | - * | | ⌫ |------| |------| ⇥ |Enter | + * | | ⇥ |------| |------| ⇥ |Enter | * | | | L⌥ | | L⌃ | | | * `--------------------' `----------------------' */ @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, KC_GRV, KC_QUOT, KC_PGUP, - KC_SPC,KC_BSPC,KC_LALT, + KC_SPC,KC_TAB ,KC_LALT, // right hand TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -66,25 +66,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | & | 1 | 2 | 3 | = | | + * | | | | | | = | | | | : | 1 | 2 | 3 | = | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | 0 | . | ← | → | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | Home | | | + * | | | | | | | | * | | |------| |------| | | - * | | | | | End | | | + * | | | | | | | | * `--------------------' `--------------------' */ // SYMBOLS [SYMB] = KEYMAP( // left hand KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQUO,KC_TRNS, + KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS, KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,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_EQL ,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, @@ -93,11 +93,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, + KC_TRNS, KC_COLN, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, - KC_END , KC_TRNS, KC_TRNS + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS ), /* Keymap 2: Media keys * @@ -131,13 +131,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR, + LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR , KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, + KC_END , LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) ), }; diff --git a/keyboards/ergodox/keymaps/zweihander-osx/makefile.mk b/keyboards/ergodox/keymaps/zweihander-osx/makefile.mk new file mode 100644 index 000000000..6e3d088a4 --- /dev/null +++ b/keyboards/ergodox/keymaps/zweihander-osx/makefile.mk @@ -0,0 +1,2 @@ +# Don’t do a tricolor wave when the computer is shut down in Windows +SLEEP_LED_ENABLE = no diff --git a/keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown b/keyboards/ergodox/keymaps/zweihander-osx/readme.markdown similarity index 92% rename from keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown rename to keyboards/ergodox/keymaps/zweihander-osx/readme.markdown index 7bce7c690..3b7f52941 100644 --- a/keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown +++ b/keyboards/ergodox/keymaps/zweihander-osx/readme.markdown @@ -42,4 +42,4 @@ I press C-a, C-e, and C-k all the time. It’s difficult to press these key comb ## use spreadsheets -All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. +All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. There’s also a colon there for entering times and maybe IPv6 addresses. Not that I expect people to type IPv6 addresses into a spreadsheet, but, y’know. diff --git a/keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex b/keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex new file mode 100644 index 000000000..832504b02 --- /dev/null +++ b/keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex @@ -0,0 +1,1151 @@ +:100000000C94D3020C941A030C941A030C941A0344 +:100010000C941A030C941A030C941A030C941A03EC +:100020000C941A030C941A030C94B71F0C94892097 +:100030000C941A030C941A030C941A030C941A03CC +:100040000C941A030C94FC1A0C941A030C941A03C3 +:100050000C941A030C9414160C941A030C941A039F +:100060000C941A030C941A030C941A030C941A039C +:100070000C941A030C941A030C941A030C941A038C +:100080000C941A030C941A030C941A030C941A037C +:100090000C941A030C941A030C941A030C941A036C +:1000A0000C941A030C941A030C941A03730C730C1B +:1000B000A20CA20CD80CF80C290E290E030D290E47 +:1000C000B30DB30D1A0E290E290E230EC00DC00D4F +:1000D000C00DC00DC00DC00DC00DC00DC00DC00DB8 +:1000E000C00DC00DC00DC00DC00DC00DD20DDF0D77 +:1000F000E60DED0DF70DF620182106221821062237 +:100100005D2180210622D521E821750A01E2012C1A +:10011000022C02E274FA011602160104020401091B +:1001200002090104020401150215010C020C012848 +:10013000022800750A01E2012C022C02E274FA0185 +:10014000170217010802080115021501100210011B +:100150000C020C0111021101040204010F020F0133 +:1001600028022800750A01E2012C022C02E274FA2E +:100170000105020501050205010802080107020741 +:10018000010C020C011702170128022800750A0150 +:10019000E30116021602E301E3012B022B02E30145 +:1001A000E30115021502E300750A01E301160216C8 +:1001B00002E301E3012B022B02E3000000F0A12E79 +:1001C000004C002A00E100E00000001E00140004C2 +:1001D000001D00E200E2001F001A0016001B00E3F1 +:1001E000002B00200008000700060050002C002112 +:1001F000001500090019004F004B00220017000AEB +:1002000000050000003500015301510000E300002B +:10021000003400015301510000E3000000290023D5 +:10022000001C000B00110000002A00240018000D23 +:1002300000100052004E0025000C000E0036005148 +:10024000002800260012000F0037002F002B002787 +:10025000001300334238613000E0002D00310034DB +:1002600068E5002C00000001000100010001000110 +:100270000000003A002F0036020100010001003B9F +:1002800000300037020100010001003C002F02266F +:10029000020100010001003D0030022702010001BF +:1002A0000001003E00340234002E00000001000175 +:1002B0000001000000010000000100010001000039 +:1002C000000100000001003F0038002D0033020053 +:1002D0000001004000240021001E00270001004111 +:1002E00000250022001F00370001004200260023E5 +:1002F00000200050000100430025022E022E004F76 +:10030000000100440045000100010001000000015F +:10031000000100010001000100000069000100016E +:10032000000100010001006A000100043001000129 +:1003300000010001004B004E00010001000100011E +:100340000001300100010001004A000100033001FA +:100350000002300000010001000100000001000067 +:100360000001001408010000000100000001001A53 +:100370000830082F082C0200000100350A520C50EA +:10038000002C00A9004D00350852005100AC00AA15 +:100390000019080100510C4F00AB00A8000608012D +:1003A0000001000100010001001B08A5000100AED2 +:1003B000000100010000000000000000000000003B +:1003C0000000010204060A0F17202C3A4A5D7187CB +:1003D0009DB3C7DAE9F5FCFFFCF5E9DAC7B39D8701 +:1003E000715D4A3A2C20170F0A0604020100000032 +:1003F0000000000000000016034500720067006F57 +:100400000044006F007800200045005A00000016EC +:10041000034500720067006F0044006F0078002001 +:100420000045005A0000000403090409026D00049D +:100430000100A0FA090400000103010100092111D3 +:100440000100012240000705810308000A09040198 +:10045000000103010200092111010001224D0007E2 +:1004600005820308000A09040200010300000009D4 +:1004700021110100012236000705830308000A0943 +:1004800004030001030000000921110100012239C9 +:10049000000705840310000112011001000000088C +:1004A000EDFE071301000102000105010906A1018B +:1004B000050719E029E71500250195087501810256 +:1004C0000508190129059505750191029501750326 +:1004D0009101050719002977150025019578750107 +:1004E0008102C005010980A101850216810026B79D +:1004F000001A81002AB700751095018100C0050C13 +:100500000901A1018503160100269C021A01002A97 +:100510009C02751095018100C005010902A1010925 +:1005200001A1000509190129051500250195057589 +:100530000181029501750381010501093009311519 +:1005400081257F95027508810609381581257F95DB +:100550000175088106050C0A38021581257F950171 +:1005600075088106C0C005010906A101050719E04B +:1005700029E7150025019508750181029501750887 +:10058000810105081901290595057501910295015B +:10059000750391010507190029FF150026FF009535 +:1005A0000675088100C011241FBECFEFDAE0DEBF60 +:1005B000CDBF04B603FE27C08091010290910202D4 +:1005C000A0910302B09104028730904BA740B04B3A +:1005D000D1F41092010210920202109203021092C2 +:1005E000040214BE84B7877F84BF0FB6F894A89521 +:1005F00080916000886180936000109260000FBE5F +:10060000E0E0FFE3099511E0A0E0B1E0E0EAF7E403 +:1006100002C005900D92A433B107D9F712E0A4E30C +:10062000B1E001C01D92A130B107E1F70E94FC1CAE +:100630000C94CE230C9400001092B9008AE08093B1 +:10064000B800089594EA9093BC009091BC0097FF85 +:10065000FCCF9091B900987F983021F0903111F043 +:1006600081E008958093BB0084E88093BC00809172 +:10067000BC0087FFFCCF8091B900887F883111F0E2 +:10068000803471F780E0089584E98093BC00809104 +:10069000BC0084FDFCCF08958093BB0084E8809368 +:1006A000BC008091BC0087FFFCCF9091B900987F7F +:1006B00081E0983209F480E0089584E88093BC00DA +:1006C0008091BC0087FFFCCF8091BB00089580B370 +:1006D0008C7080BB81B3836F81BB089580910101D1 +:1006E000811115C080E40E942203809301018111D1 +:1006F0000CC082E10E944C0380930101811105C06E +:100700008FEF0E944C03809301010E94440384B147 +:10071000807F84B985B1807F85B98AB1837F8AB9AA +:100720008BB1837F8BB93E98469808950C94E4046E +:100730000E942509809301010E946E030E946703B5 +:10074000A5E3B1E0E3E4F1E08EE08E0F11921D929B +:100750008E13FCCF0C940F090E9425098093010190 +:100760000E946E030E946703A5E3B1E0E3E4F1E0B9 +:100770008EE08E0F11921D928E13FCCF0895BF92C2 +:10078000CF92DF92EF92FF920F931F93CF93DF935D +:1007900080910101882379F0809134018F5F8093EB +:1007A0003401811108C00E94250980930101811143 +:1007B00002C00E94B70805E311E0C0E0D0E0EE24DB +:1007C000E394F12CDD24D39495E0C92EC730D105F4 +:1007D00000F58091010181113CC080E40E94220358 +:1007E00080930101811112C082E10E944C03809329 +:1007F000010181110BC0C7010C2E01C0880F0A94A2 +:10080000EAF780950E944C03809301010E94440303 +:1008100020C0CA30A1F028F4C83059F0C93061F0C6 +:1008200005C0CC3089F070F0CD3089F0209A28983E +:1008300010C0219A29980DC0229A2A980AC0239A9A +:100840002B9807C0529A01C0539A5B9802C03E9AF7 +:10085000469880EA8A95F1F7C730D10518F580915E +:100860000101811144C080E40E94220380930101B0 +:10087000882311F0B12C12C083E10E944C038093B5 +:1008800001018111F7CF81E40E94220380930101CD +:100890008111F0CF0E945D03B82EB0940E944403F2 +:1008A0008B2D26C08FB181708D25799902C092E081 +:1008B00001C090E0892B7C9902C024E001C020E0B7 +:1008C000822B7D9902C028E001C020E0822B7E9916 +:1008D00002C090E101C090E0892B9FB19095991FD3 +:1008E0009927991F9295990F907E892B01C080E0DE +:1008F000F8019081981719F08083C09200010E943E +:100900006E0321960F5F1F4FCE30D10509F05ECFE9 +:10091000809100018823A1F08150809300018823F9 +:1009200029F0F5E0FA95F1F700000AC0A3E4B1E080 +:10093000E5E3F1E0CF01825F91919D938E13FCCFAF +:100940000E94410681E0DF91CF911F910F91FF90AE +:10095000EF90DF90CF90BF900895E82FF0E0ED5B2F +:10096000FE4F808108950895FC016230B9F028F4AB +:10097000662341F0613061F023C06330A9F0643038 +:10098000C9F01EC082818823D9F088EA91E00895D9 +:1009900082818823A9F08DE891E0089582818823DF +:1009A00079F084E691E008958281882349F083E319 +:1009B00091E008958281882319F08AE091E00895FA +:1009C00080E090E0089508956091B0017091B101C8 +:1009D0008091B2019091B3010E94081556985E98DB +:1009E00025982D9826982E9827982F98813019F0C1 +:1009F000823021F00895259A2D9A0895269A2E9AEC +:100A0000089581E0089581E008950C9403050E9403 +:100A1000940E2FEF84E39CE0215080409040E1F75A +:100A200000C000000C9439160F931F93CF93DF93EF +:100A30008C01FC01C081D181CE010E948D13BE01C9 +:100A40000E94D807EC01B8010E940505882309F42B +:100A500012C1B801CE010E946808882309F40BC1B5 +:100A6000B801CE010E948109882309F404C1C43170 +:100A7000F0E7DF0708F0CDC0C23080E7D80708F400 +:100A8000A3C0F8018281882309F4AAC00E947215CC +:100A9000811102C00E9458150E94851590E0909324 +:100AA000F3018093F201C230F0E7DF0721F4809177 +:100AB000F201816082C0C33080E7D80721F48091C1 +:100AC000F20182607AC0C430E0E7DE0721F4809151 +:100AD000F201846072C0C530F0E7DF0719F480913D +:100AE000F20127C0C63080E7D80721F48091F201D7 +:100AF000806163C0C730E0E7DE0721F48091F20136 +:100B000080625BC0C830F0E7DF0721F48091F2011A +:100B1000806453C0C93080E7D80721F48091F20186 +:100B200080684BC0CA30E0E7DE0729F48091F2010B +:100B30008460886042C0CB30F0E7DF0721F4809109 +:100B4000F2018E7F3AC0CC3080E7D80721F4809143 +:100B5000F2018D7F32C0CD30E0E7DE0721F48091D5 +:100B6000F2018B7F2AC0CE30F0E7DF0719F48091C5 +:100B7000F20122C0CF3080E7D80721F48091F20142 +:100B80008F7E1BC0C031E0E7DE0721F48091F201C7 +:100B90008F7D13C0C131F0E7DF0721F48091F201AE +:100BA0008F7B0BC0C231D04721F48091F2018F7747 +:100BB00004C08091F2018B7F877F8093F201809146 +:100BC000F2010E94891557C0C115E0E7DE0779F0F0 +:100BD000C130D047A1F081E0809351018093520150 +:100BE000C801DF91CF911F910F910C940105F8017D +:100BF0008281882309F43FC00E9407053CC0F801A8 +:100C000082818823C1F18091CD0181608093CD01E3 +:100C100032C0CB3380E7D807A1F4F8018281882362 +:100C200021F01092510182E016C080915101811192 +:100C300006C086E20E940C0B86E20E94DF0B82E077 +:100C400018C0CC33D04739F6F8018281882331F0BF +:100C50001092520180E20E942E0C0DC08091520130 +:100C6000811106C087E20E940C0B87E20E94DF0B15 +:100C700080E20E94350C80E0DF91CF911F910F91AF +:100C800008950C94960308950C9443060C9444061E +:100C900026E0729FF001112444E5849FE00DF11DD0 +:100CA0001124E60FF11DEE0FFF1FE154FE4F859159 +:100CB00094910E94EA07811560E49607B0F58115CA +:100CC00070E3970708F0E6C0803E9105D8F4803CB9 +:100CD000910508F06CC0883A910578F4853A910541 +:100CE00008F06BC08130910509F460C108F417C1A8 +:100CF0008430910508F05AC112C18D3B910508F46A +:100D000067C00DC18F3F910509F048F4803F910500 +:100D100008F0B5C0883E910508F448C100C18115AE +:100D200020E2920708F0ADC00895811543E59407CD +:100D300090F4811562E5960708F0D0C0811571E541 +:100D4000970708F0C6C0811520E5920708F0A5C0F6 +:100D50009F70906A0895811545E59407D8F4811530 +:100D600064E5960708F0D0C0482F4695469570E296 +:100D7000479FA00111248370992721E030E0B90139 +:100D800002C0660F771F8A95E2F7CB01842B952B63 +:100D90009A680895811576E5970708F4BAC09C0112 +:100DA00030562115304108F0BAC09F70B6C0FC0122 +:100DB000EE0FFF1FE55CFF4F6AC0853A910509F40D +:100DC000B1C0863A910509F0B0C082E890E4089578 +:100DD000883A910509F4ACC0893A910509F4ABC091 +:100DE0008A3A910509F4AAC08B3A910509F4A9C081 +:100DF0008C3A910509F4A8C08B3B910509F4A7C072 +:100E00008C3B910509F4A6C08D3A910509F4A5C063 +:100E1000803B910509F4A4C08E3A910509F4A3C062 +:100E20008F3A910509F4A2C0813B910509F4A1C054 +:100E3000823B910509F4A0C0833B910509F49FC052 +:100E4000843B910509F49EC0853B910509F49DC042 +:100E5000863B910509F49CC0873B910509F49BC032 +:100E6000883B910509F49AC0893B910509F499C022 +:100E70008A3B910509F498C080E094E40895906558 +:100E80000895FC01FF70EE0FFF1FE554FE4F8591A2 +:100E9000949108959927906C0895482F437021E00C +:100EA00030E002C0220F331F4A95E2F73C68AC01E4 +:100EB00064E0569547956A95E1F74370342B8F703F +:100EC0008695869560E2869FC0011124822B932B24 +:100ED0000895982F8827816F906A0895482F469526 +:100EE000469570E2479FA00111248370992721E065 +:100EF00030E0B90102C0660F771F8A95E2F7CB0197 +:100F0000842B952B9C680895982F8827846F906A6E +:100F100008958F719927982F88279062089580E00F +:100F200090E0089581E890E4089583E890E40895BE +:100F300082EE94E4089589EE94E408958AEE94E4B0 +:100F4000089585EB94E4089586EB94E4089583EB8B +:100F500094E4089584EB94E4089587EB94E4089571 +:100F60008CEC94E408958DEC94E4089583E895E482 +:100F700008958AE895E4089582E995E4089584E95E +:100F800095E4089581E296E4089583E296E4089555 +:100F900084E296E4089585E296E4089586E296E474 +:100FA000089587E296E408958AE296E40895089504 +:100FB00096E0799FF001112494E5899FE00DF11DE1 +:100FC0001124E60FF11DEE0FFF1FE154FE4F859136 +:100FD000949108958238910549F1B0F481339105D7 +:100FE00009F458C048F48932910509F44EC08A3298 +:100FF000910509F454C008958533910509F440C062 +:101000008933910599F00895833E910529F138F4CB +:10101000803E910591F0823E9105A1F00895863EB3 +:101020009105F9F0873E910531F108952091F20183 +:1010300020FD3AC021FD38C008958091F20180FD65 +:1010400035C032C08091F20182FF32C08091F2013E +:1010500084FD30C083EE39C08091F20182FD28C04A +:10106000F5CF8091F20183FF27C08091F20184FDCA +:1010700021C087EE2AC08091F20183FD1DC0F5CF0B +:101080008091F20185FD1AC01BC08091F20185FD9F +:1010900017C014C08091F20186FD14C015C0809164 +:1010A000F20186FD11C00EC080EE0FC089E30DC0B5 +:1010B00082EE0BC080E009C086EE07C089E205C061 +:1010C00085E303C08AE201C081E390E008950895BA +:1010D0000F931F93CF93FB012281211102C0C1E026 +:1010E00041C08C01C0916001C11125C0843190477D +:1010F000B1F70E94670881E0809360010E94DE15CD +:1011000090935F0180935E011092530110925501FC +:1011100010925401109257011092560110925901E9 +:101120001092580110925B0110925A0110925D01C9 +:1011300010925C0117C080915E0190915F010E9446 +:10114000EA15883C910558F690915301E92FF0E09B +:10115000EE0FFF1FEC5AFE4F118300839F5F9093A9 +:101160005301C0E08C2FCF911F910F910895569895 +:101170005E9825982D9826982E9827982F988FEF6F +:1011800090E0909389008093880090938B008093E7 +:101190008A0090938D0080938C00259A2D9A2FEFD2 +:1011A00080E792E0215080409040E1F700C00000CD +:1011B000269A2E9A2FEF80E792E0215080409040AF +:1011C000E1F700C00000279A2F9A2FEF80E792E006 +:1011D000215080409040E1F700C0000025982D98F4 +:1011E0002FEF80E792E0215080409040E1F700C06F +:1011F000000026982E982FEF80E792E02150804043 +:101200009040E1F700C0000027982F9856985E980C +:1012100025982D9826982E9827982F98089589EA32 +:101220008093800089E08093810024982C983F98D7 +:101230008AB18F748AB96E98479A8BB1806B8BB9DB +:10124000769A0E94B7080C94E30480E2809301012F +:101250008091610181110EC00E941C0381E0809386 +:1012600061012FEF83ED90E3215080409040E1F742 +:1012700000C0000080E40E942203809301018111DC +:101280002EC00E944C0380930101811128C00E944E +:101290004C0380930101811122C08FE30E944C0313 +:1012A0008093010181111BC00E94440380E40E94CD +:1012B000220380930101811112C08CE00E944C0333 +:1012C0008093010181110BC00E944C0380930101A6 +:1012D000811105C08FE30E944C03809301010E949D +:1012E0004403809101010895282F882339F090E06C +:1012F0002A3010F44D9608950697089587E290E0FD +:101300000895FF920F931F93CF93DF93813020E8CE +:10131000920708F44DC0FB012281222309F448C042 +:10132000EC01DF7780916201813079F050F08230FA +:10133000C1F482EE0E940C0B87E50E940C0B87E53E +:101340000EC082EE0E940C0B0CC080EE0E940C0BB3 +:1013500081EE0E940C0B88E10E940C0B88E10E9438 +:10136000DF0B0CE010E0CE01002E02C096958795B1 +:101370000A94E2F78F700E947409F82E0E940C0BF9 +:101380008F2D0E94DF0B045011090C3FFFEF1F0748 +:1013900051F780916201813029F010F0823041F4E0 +:1013A00082EE04C080EE0E94DF0B81EE0E94DF0B14 +:1013B00081E0DF91CF911F910F91FF90089590935D +:1013C0006801809367010895E0916701F0916801D9 +:1013D000309721F00190F081E02D099480E008958C +:1013E000E0916701F0916801309721F00280F3816C +:1013F000E02D09940895E0916701F091680130971C +:1014000021F00480F581E02D099408952091650173 +:10141000309166018217930771F090936601809373 +:101420006501E0916701F0916801309721F0068035 +:10143000F781E02D099408952091630130916401B2 +:101440008217930771F09093640180936301E09198 +:101450006701F0916801309721F00084F185E02D5B +:101460000994089508950C94320A0E94D5150E949B +:1014700098030C945B16CF92DF92EF92FF920F933A +:101480001F93CF93DF93CDB7DEB72B970FB6F894AA +:10149000DEBF0FBECDBF0E94BF038AE6C82E81E02B +:1014A000D82E00E010E0E02E802F0E94AD04F6015F +:1014B00041916F01F42EF826B1F40F5F1F4F0E30EB +:1014C000110589F78FEF89838A831B820E94DE15BD +:1014D0008160782F9D838C8349815A816B818D81B6 +:1014E0000E94DE0A40C09091CD0191FF04C08B871D +:1014F0000E94B3048B8520E030E04F2D50E0922F06 +:10150000BA01022E02C0759567950A94E2F760FF52 +:1015100024C02E83EF8221E030E0690102C0CC0CB0 +:10152000DD1C9A95E2F790E08C219D21892B09F42E +:1015300020E028870E94DE158160782F9A878987AE +:101540004E815F8168858A850E94DE0AF801E6592E +:10155000FE4F8081C826C08206C02F5F3F4F2630D5 +:10156000310569F6AACF0E94F317109169010E9414 +:10157000E4091817A1F00E94E409809369012B96F1 +:101580000FB6F894DEBF0FBECDBFDF91CF911F9194 +:101590000F91FF90EF90DF90CF900C9446062B9622 +:1015A0000FB6F894DEBF0FBECDBFDF91CF911F9174 +:1015B0000F91FF90EF90DF90CF900895CF93DF933E +:1015C000CDB7DEB72B970FB6F894DEBF0FBECDBFF9 +:1015D0004F83588769877A878B87DE01119686E06B +:1015E000FD0111928A95E9F785E0FE013796019099 +:1015F0000D928A95E1F749815A816B817C818D81B9 +:101600009E810E9432112B960FB6F894DEBF0FBE5A +:10161000CDBFDF91CF910895CF93882309F4CDC03A +:10162000C82F823859F40E94E40981FDC6C089E3BD +:101630000E940C140E94D91489E30CC0833879F4F9 +:101640000E94E40980FDB9C083E50E940C140E9449 +:10165000D91483E50E944E14CF910C94D914843888 +:1016600059F40E94E40982FDA8C087E40E940C148A +:101670000E94D91487E4EECF8CEF8C0F813A48F4A6 +:101680008C2F0E943D1A811198C08C2F0E940C143F +:10169000E3CF80E28C0F883048F4C77081E001C04E +:1016A000880FCA95EAF70E949214D6CF8BE58C0F6B +:1016B000833078F4C53A29F0C63A31F083E890E0F7 +:1016C00005C081E890E002C082E890E0CF910C94E0 +:1016D000060A88E58C0F853108F06FC0C83A61F1C1 +:1016E000C93A69F1CA3A71F1CB3A79F1CC3A81F150 +:1016F000CB3B89F1CC3B91F1CD3A99F1C03BA1F1C3 +:10170000CE3AA9F1CF3AB1F1C13BB9F1C23BC1F137 +:10171000C33BC9F1C43BD1F1C53BD9F1C63BE1F1B3 +:10172000C73BE9F1C83BF1F1C93BF9F1CA3B09F408 +:101730003FC080E090E03EC082EE90E03BC089EE8A +:1017400090E038C08AEE90E035C085EB90E032C082 +:1017500086EB90E02FC083EB90E02CC084EB90E010 +:1017600029C087EB90E026C08CEC90E023C08DEC84 +:1017700090E020C083E891E01DC08AE891E01AC0A3 +:1017800082E991E017C084E991E014C081E292E01F +:1017900011C083E292E00EC084E292E00BC085E2C9 +:1017A00092E008C086E292E005C087E292E002C0C3 +:1017B0008AE292E0CF910C941C0ACF91089588237D +:1017C00009F44BC0823859F40E94E40981FF45C0F6 +:1017D00089E30E940C140E94D91489E30CC0833859 +:1017E00071F40E94E40980FF38C083E50E940C1464 +:1017F0000E94D91483E50E944E140C94D9148438A5 +:1018000059F40E94E40982FF28C087E40E940C1466 +:101810000E94D91487E4EFCF9CEF980F913A58F3C8 +:1018200090E2980F983050F4877091E001C0990FC2 +:101830008A95EAF7892F0E949814DFCF9BE5980FCD +:10184000933020F480E090E00C94060A885A8531A9 +:1018500020F480E090E00C941C0A0895882321F085 +:101860000E9492140C94D9140895882321F00E94A8 +:1018700098140C94D91408957F928F929F92AF92EE +:10188000BF92CF92DF92EF92FF920F931F93CF936D +:10189000DF931F92CDB7DEB77C01C62E772EFC01F9 +:1018A000058102950F70128111110E94AF140E94E0 +:1018B0000514882379F0112369F080E28C0D8830BB +:1018C00048F082E00E94EE130E94051491E0D82EA9 +:1018D000D92601C0D12CE72DE295EF70F0E0EA5A4D +:1018E000FF4F0C947F23872D807F072D0F70882357 +:1018F00011F00295007F112389F0002309F490C1B3 +:1019000080E28C0D883020F4802F0E94921403C056 +:10191000802F0E94A2140E94D91482C18C2D0E9493 +:10192000DF0B002309F495C180E28C0D883020F490 +:10193000802F0E94981403C0802F0E94A8140E9438 +:10194000D91487C1972D907F872D8F70903211F019 +:101950008295807FCC2021F0F1E0CF16B1F01EC03F +:10196000112349F0002309F414C1013009F011C119 +:101970000E94C2146EC1002319F0013009F469C13C +:1019800089830E94C51489810AC1112321F0023084 +:1019900008F05FC1FEC001115CC101C1112321F03B +:1019A000002309F4F6C03CC1002309F4F8C03EC18D +:1019B000872D86958695837090E0009719F00197A2 +:1019C00061F047C1112321F08C2D972D937002C037 +:1019D00080E090E00E94060A3CC1112321F08C2D8A +:1019E000972D937002C080E090E00E941C0A31C1E4 +:1019F0008C2D112319F00E94FB1602C00E94631760 +:101A00000E94E81726C1872D837009F052C011117A +:101A100020C18C2D829586958770880F880F9C2D0C +:101A20009F70892E912CA12CB12C082E04C0880CFB +:101A3000991CAA1CBB1C0A94D2F7C4FE14C00FE068 +:101A400010E020E030E0B901A80104C0440F551FA8 +:101A5000661F771F8A95D2F7CB01BA016095709502 +:101A60008095909503C060E070E0CB01272D26950E +:101A70002695237030E02230310569F0233031059E +:101A800089F0682979298A299B292130310571F04B +:101A90000E947A12DEC0682979298A299B290E942E +:101AA0009612D7C00E947A12C501B4010E945E123C +:101AB000D0C0112319F0872D817001C0869588232D +:101AC00009F4C7C08C2D829586958770880F880F82 +:101AD0009C2D9F70892E912CA12CB12C082E04C016 +:101AE000880C991CAA1CBB1C0A94D2F7C4FE14C013 +:101AF0000FE010E020E030E0B901A80104C0440F7D +:101B0000551F661F771F8A95D2F7CB01BA016095E2 +:101B100070958095909503C060E070E0CB01272D13 +:101B2000269526952370422F50E04230510569F0EA +:101B30004330510589F0682979298A299B29413048 +:101B4000510571F00E94541384C0682979298A29AB +:101B50009B290E9470137DC00E945413C501B401DB +:101B60000E94381376C08C2D90E0FC01E05EF109F4 +:101B7000E531F10508F050C0EA59FF4F0C947F237E +:101B80000C2D0F70872D8F71112331F00E94D1120F +:101B9000802F0E942E0C5DC00E94F212802F0E94A6 +:101BA000350C57C0112339F0011153C0872D8F71A7 +:101BB0000E9417134EC0023008F04BC0F7CF11231C +:101BC00039F0872D8F710E94D11243C01123C9F3C0 +:101BD000872D8F710E94F2123CC0112329F0872DAE +:101BE0008F710E94BC1235C00E94B21232C0112304 +:101BF00051F0172D1F71812F0E94D11263E0812FA8 +:101C00000E94E51326C081E00E94EE13023008F125 +:101C100082E00E94EE131DC0112331F0002389F2EF +:101C20008C2D0E940C0B15C0002391F28C2D0E946C +:101C3000DF0B0FC0472D4F706C2DC7010E94B404FD +:101C40000E94D61106C0472D4F706C2DC7010E940F +:101C5000D707DD20F9F00E94E11380FD1BC0F701DA +:101C600012820E94DB130E94D112C7010E94590EFA +:101C70000E94DB130F90DF91CF911F910F91FF9086 +:101C8000EF90DF90CF90BF90AF909F908F907F901C +:101C90000C94F2120F90DF91CF911F910F91FF9052 +:101CA000EF90DF90CF90BF90AF909F908F907F90FC +:101CB00008950F931F93CF93DF93EC01888199814F +:101CC0002B813C81232BB9F09F3F11F48F3F99F07A +:101CD000CE010E941405882371F0688179818A8180 +:101CE0000E94D7138C010E948C130E945312B801DA +:101CF000CE010E943C0CDF91CF911F910F9108956E +:101D00000E94AF140E94BF140E9484140E94D91430 +:101D10000E9499180E94E81780E090E00E94060A4D +:101D200080E090E00C941C0A0E949F140C94800E9A +:101D30000E94CC13292F22952F7030E02C303105D2 +:101D40004CF42A3031056CF422503109223031052F +:101D5000A8F407C02C30310569F02F30310551F05F +:101D60000DC0803F69F018F4803E40F409C0843F04 +:101D700029F406C093FB882780F9089580E0089530 +:101D800081E00895CF93DF9300D000D01F92CDB7AC +:101D9000DEB70F900F900F900F900F90DF91CF91C3 +:101DA0000895CF93DF9300D000D000D0CDB7DEB739 +:101DB00026960FB6F894DEBF0FBECDBFDF91CF9150 +:101DC00008951F93CF93DF93C091780116E080911F +:101DD0007901C81799F0D0E01C9FF0011D9FF00D0C +:101DE0001124E658FE4F40815181628173818481C4 +:101DF00095810E94D10E2196C770E9CFDF91CF91D6 +:101E00001F9108954091AA015091AB016091AC01DE +:101E10007091AD018091AE019091AF010C94D10E03 +:101E20008091AF0182958F7009F054C08091AC0110 +:101E3000882309F44FC080917801A09179016091C5 +:101E4000AA017091AB014091AD015091AE01B6E095 +:101E50008A1709F43FC090E041155105C1F17F3F59 +:101E600011F46F3FA1F1B89FF001B99FF00D11245B +:101E7000E658FE4F218172132AC02081621327C0C9 +:101E80002281211124C0238134812417350710F4C5 +:101E900021503109241B350B283C3105C0F4209119 +:101EA000AF012F7020612093AF0126E0289FF00141 +:101EB000299FF00D1124E158FE4F80818F708061C1 +:101EC00080838AEA91E00E94590E0C94E10E0196FB +:101ED0008770BECF0895CF92DF92EF92FF920F935B +:101EE0001F93CF93DF93CDB7DEB762970FB6F89409 +:101EF000DEBF0FBECDBF8C0185E0F801DE011D966F +:101F000001900D928A95E1F7D8014C9111965C9160 +:101F1000119712966C9112971396CD90DC901497AE +:101F20003091AA017091AB018091AD019091AE0109 +:101F3000009709F46BC17F3F19F43F3F09F466C174 +:101F4000E090AC01EE2009F4C0C02091AF01C816AA +:101F5000D90628F0F601E81BF90BCF0104C08095E3 +:101F600090958C0D9D1DFF24F394883C910578F08D +:101F7000F12C207F09F0C6C07C2DD98AC88A8989B6 +:101F80000E94C20E8AEA91E00E94590EB1C0822FCF +:101F9000807F09F046C0751314C0341312C061115C +:101FA00010C02F7020612093AF010E94020F8AEAB7 +:101FB00091E00E94590E8091AF01D80115968C9343 +:101FC0002EC0CD2819F15F3F11F44F3FF9F0F62EE6 +:101FD00061111CC0809178012091790136E082174F +:101FE00009F45AC090E0389FF001399FF00D112498 +:101FF000E658FE4F7181571306C07081471303C026 +:102000007281711103C001968770E9CFF62E6623A5 +:1020100009F418C18091AF0181608093AF01F12C68 +:1020200011C1751308C0341306C0611104C080913A +:10203000AF01D801C3C04D875E878D859E856A8BB1 +:102040000E94980E6A898823E1F16623D1F12091DC +:10205000AF01822F82958F7090E0029774F080918B +:10206000AA019091AB0198878F831986DB86CA8677 +:102070002C87CE0107960E94590E86E0F801AAEA45 +:10208000B1E001900D928A95E1F70E94100F0E9435 +:10209000020FFF24F394D6C04D875E878D859E8501 +:1020A0000E94CC13292F22952F7030E02230310569 +:1020B0000CF0BCC09F7009F0B6C0805E883008F498 +:1020C000C1C0C8010E94590EE4CFC816D90608F451 +:1020D00053C0F601E81BF90BCF01883C910508F4C9 +:1020E00050C0F12C7C2DD98AC88A89890E94C20EE1 +:1020F000EAEAF1E086E0DF011D928A95E9F70E94A5 +:10210000020FA0C0751314C0341312C0611110C0A7 +:102110008091AF01F8018583C8010E94590E86E0C5 +:10212000EAEAF1E0DF011D928A95E9F7FE2C8AC008 +:102130004D875E878D859E856A8B0E94980E6A8981 +:10214000882309F4BECF662309F4BBCF2091AF01E9 +:10215000822F82958F7090E002970CF48ECF809141 +:10216000AA019091AB019A8389831B82DD82CC8284 +:102170002E83CE0101967FCF809590958C0D9D1D6D +:10218000ACCFF62E662309F49CCF75132EC0341302 +:102190002CC02091AF0120FD1FC0822F82958F702F +:1021A000D9F0D80115962C9315978F3049F08F5F91 +:1021B000982F9295907F822F8F70892B15968C93F4 +:1021C000C8010E94590E86E0F801AAEAB1E0019028 +:1021D0000D928A95E1F793CF86E0F801AAEAB1E083 +:1021E00001900D928A95E1F72DC04D875E878D8510 +:1021F0009E850E94980E811140CF8091AF01816031 +:102200008093AF01C8010E94590E1CC0662309F4D7 +:1022100058CF4D875E878D859E850E94980E8823B6 +:1022200009F44FCF2ACF811148CF0CC0243031059B +:102230000CF047CF9F7009F440CFF8019581907F53 +:1022400009F03BCF8F2D62960FB6F894DEBF0FBE1C +:10225000CDBFDF91CF911F910F91FF90EF90DF9055 +:10226000CF9008951F93CF93DF93CDB7DEB72C9710 +:102270000FB6F894DEBF0FBECDBF4F835887698776 +:102280007A878B879C87CE0107960E946B0F8823E5 +:1022900069F08F8198852A853B85232BF1F19F3F3B +:1022A00009F063C08F3F09F060C037C086E0FE01CF +:1022B0003796DE01119601900D928A95E1F76F81B4 +:1022C0007885EA85FB85309741F17F3F11F46F3FB8 +:1022D00021F12091790130E0C90101968770992799 +:1022E0004091780150E08417950709F447C069834D +:1022F0007A83FD83EC8396E0929FD001939FB00D8B +:102300001124A658BE4FFE01319601900D929A9568 +:10231000E1F7809379010E94E10E16E08091780147 +:10232000909179018917C1F1189FC0011124865835 +:102330009E4F0E946B0F882379F1E09178011E9FD8 +:10234000F0011124E658FE4F408151816281738172 +:10235000848195810E94D10E8091780190E0019650 +:102360008770992780937801D9CF4F8158856985E7 +:102370007A858B859C850E94D10ECFCF0E94940ECA +:102380001092790110927801EAEAF1E086E0DF012B +:102390001D928A95E9F7C1CF2C960FB6F894DEBF4F +:1023A0000FBECDBFDF91CF911F910895EF92FF92A5 +:1023B0000F931F93CF93DF938C01892B09F46CC08B +:1023C000F12CEE24E394E8012196F80184918437FE +:1023D00040F4843008F051C0813081F0823019F12E +:1023E0005BC0853709F444C0A8F19CE7980F90378B +:1023F00008F052C08F770E94DF0B41C00E5F1F4F65 +:10240000FE01C49180E28C0F883048F4C7708E2D95 +:1024100001C0880FCA95EAF70E94B21414C08C2F2D +:102420000E940C0B2DC00E5F1F4FFE01C49180E275 +:102430008C0F883058F4C7708E2D01C0880FCA9554 +:10244000EAF70E94B8140E94D9141AC08C2F0E9477 +:10245000DF0B16C00E5F1F4FFE01C491CC2381F02D +:102460008FE99FE00197F1F700C00000C150F6CF5F +:102470000E5F1F4FFE01F49003C00E940C0B8E01F3 +:102480008F2D882309F49FCFEFE9FFE03197F1F713 +:1024900000C000008150F5CFDF91CF911F910F91C7 +:1024A000FF90EF90089508956093B4017093B50183 +:1024B0008093B6019093B7010C94800E0F931F93F5 +:1024C0000091B4011091B5012091B6013091B7018E +:1024D000DC01CB01802B912BA22BB32B8093B40179 +:1024E0009093B501A093B601B093B7011F910F91DE +:1024F0000C94800E0F931F930091B4011091B501BD +:102500002091B6013091B701DC01CB0180239123EA +:10251000A223B3238093B4019093B501A093B60195 +:10252000B093B7011F910F910C94800E0F931F93DE +:102530000091B4011091B5012091B6013091B7011D +:10254000DC01CB0180279127A227B3278093B40118 +:102550009093B501A093B601B093B7011F910F916D +:102560000C94800E1092B0011092B1011092B20141 +:102570001092B3010C94800E41E050E060E070E0F6 +:1025800004C0440F551F661F771F8A95D2F74093EA +:10259000B0015093B1016093B2017093B3010C94F8 +:1025A000800E41E050E060E070E004C0440F551F31 +:1025B000661F771F8A95D2F78091B0019091B10183 +:1025C000A091B201B091B301482B592B6A2B7B2B00 +:1025D0004093B0015093B1016093B2017093B30185 +:1025E0000C94800E41E050E060E070E004C0440FC5 +:1025F000551F661F771F8A95D2F7409550956095B5 +:1026000070958091B0019091B101A091B201B0910B +:10261000B301482359236A237B234093B00150938D +:10262000B1016093B2017093B3010C94800E41E04C +:1026300050E060E070E004C0440F551F661F771F34 +:102640008A95D2F78091B0019091B101A091B20129 +:10265000B091B301482759276A277B274093B001DF +:102660005093B1016093B2017093B3010C94800E4A +:102670000F931F930091B0011091B1012091B2010D +:102680003091B301DC01CB01802B912BA22BB32B1A +:102690008093B0019093B101A093B201B093B301C4 +:1026A0001F910F910C94800E0F931F930091B00116 +:1026B0001091B1012091B2013091B301DC01CB0145 +:1026C00080239123A223B3238093B0019093B1017F +:1026D000A093B201B093B3011F910F910C94800E9F +:1026E0000F931F930091B0011091B1012091B2019D +:1026F0003091B301DC01CB0180279127A227B327BA +:102700008093B0019093B101A093B201B093B30153 +:102710001F910F910C94800E0895CF92DF92EF924B +:10272000FF920F931F93CF93DF938C01C090B4015E +:10273000D090B501E090B601F090B7018091B00162 +:102740009091B101A091B201B091B301C82AD92AE8 +:10275000EA2AFB2ACFE1D0E0D701C6010C2E04C043 +:10276000B695A795979587950A94D2F780FF06C0EE +:10277000B8018C2F0E944806019721F4219760F739 +:1027800080E001C08C2FDF91CF911F910F91FF90BE +:10279000EF90DF90CF900895CF93DF93EC010E94EC +:1027A0008D13BE010E944806DF91CF910895CB01A1 +:1027B0000E94CC1308958091B801859585958595E3 +:1027C00008958091B8018770089598E0899F9001DD +:1027D0001124262B2093B8010C94D1122091B8011A +:1027E000809582238093B801982F977069F430E028 +:1027F000482F552747FD50952417350729F0859513 +:10280000859585950C94F21208959091B801977072 +:1028100081E009F480E0089590911501992321F059 +:1028200090910201911109C020910301309104019E +:10283000F90132969FEF40E01FC0982F969596952C +:1028400096959F3050F5E0910301F0910401E90F56 +:10285000F11D877021E030E0A90102C0440F551F2F +:102860008A95E2F7CA019181892B818308959F3F60 +:1028700039F04F5F4E3041F051915813F8CF0DC0F1 +:102880005111F7CF942FF5CF9F3F39F0F901E90FA0 +:10289000F11D97FDFA958283089508959091150191 +:1028A000992321F090910201911109C02091030117 +:1028B00030910401F9013296205F3F4F1FC0982FDD +:1028C0009695969596959F30F0F4E0910301F091DE +:1028D0000401E90FF11D877021E030E0A90102C079 +:1028E000440F551F8A95E2F7CA018095918189238B +:1028F000818308953196E217F30729F090819813A8 +:10290000F9CF1082F7CF089581E090E0E0910301C4 +:10291000F0910401E80FF91F1082019680319105B2 +:10292000A9F708959091CC01892B8093CC0108954B +:1029300080959091CC0189238093CC0108951092C9 +:10294000CC0108959091CB01892B8093CB01089500 +:1029500080959091CB0189238093CB0108951092AB +:10296000CB0108959091CA01892B8093CA010895E3 +:1029700080959091CA0189238093CA01089510928D +:10298000CA0108958093B90108951092B90108957C +:102990008091030190910401FC0131969C01205F1C +:1029A0003F4F80E0919191118F5FE217F307D1F7CC +:1029B0000895E0910301F09104018091CC0180839E +:1029C000E0910301F091040190818091CB01892B6A +:1029D0008083E0910301F091040190818091CA010C +:1029E000892B80838091B901882361F0E0910301F4 +:1029F000F09104019081892B80830E94C814811179 +:102A00001092B90180910301909104010C94F00996 +:102A1000CF92DF92EF92FF926C01EE24FF24C1145B +:102A2000D104E104F10421F0C701B60120E101C0A5 +:102A300020E0C72ED82EE92EFF24C114D104E104D2 +:102A4000F10419F0285FC701B6016B017C0154E065 +:102A5000F694E794D794C7945A95D1F7C114D1044A +:102A6000E104F10419F02C5FC701B6016B017C0190 +:102A700042E0F694E794D794C7944A95D1F7C114ED +:102A8000D104E104F10419F02E5FC701B601DC01A5 +:102A9000CB01B695A79597958795892B8A2B8B2B7C +:102AA00009F02F5F822FFF90EF90DF90CF90089575 +:102AB0006DEE7EEF80E090E00E94B82360E082E05F +:102AC00090E00E94A72360E083E090E00E94A723AB +:102AD00060E084E090E00E94A72360E085E090E061 +:102AE0000C94A72380E090E00E94A12321E08D3E7A +:102AF0009E4F09F020E0822F089582E090E00C9430 +:102B0000992383E090E00C94992384E090E00C9466 +:102B10009923682F84E090E00C94A7238091F8011A +:102B2000843039F11092CE0120E488E190E00FB6B4 +:102B3000F894A895809360000FBE2093600080E019 +:102B40000E94460683B7817F846083BF83B781601C +:102B500083BF7894889583B78E7F83BF0FB6F89430 +:102B6000A895809160008861809360001092600059 +:102B70000FBE08950895CF930E94AC030E94BF0337 +:102B80000E94BA15C0E08C2F0E94AD04811104C0D0 +:102B9000CF5FCE30C1F701C081E0CF9108950E9490 +:102BA000940E0E94E4090C94460682E084BD93E0F2 +:102BB00095BD9AEF97BD80936E0008952FB7F89456 +:102BC0008091CF019091D001A091D101B091D2011B +:102BD0002FBF0895CF92DF92EF92FF920F931F9332 +:102BE0002FB7F8944091CF015091D0016091D1015D +:102BF0007091D2012FBF6A017B01EE24FF248C016A +:102C000020E030E0C016D106E206F30610F4415091 +:102C100051099A01281B390BC9011F910F91FF908F +:102C2000EF90DF90CF9008951F920F920FB60F9202 +:102C300011248F939F93AF93BF938091CF01909175 +:102C4000D001A091D101B091D2010196A11DB11D79 +:102C50008093CF019093D001A093D101B093D20182 +:102C6000BF91AF919F918F910F900FBE0F901F90CA +:102C700018950E943C1FF8942FEF87EA91E62150A7 +:102C800080409040E1F700C0000087E090EBDC015D +:102C90008093010290930202A0930302B093040276 +:102CA0009CE088E10FB6F894A895809360000FBE71 +:102CB00090936000FFCF0E947215811102C00E94A4 +:102CC00058150E947D158093CD010E94851590E0D6 +:102CD0009093F3018093F20187FB882780F980931A +:102CE00002010E948115682F70E080E090E00C9452 +:102CF00054128091D50180FF0BC06091080185E0DE +:102D0000689FB001112475956795759567952BC0DF +:102D100081FF09C06091080185E0689FB00111241E +:102D20007595679520C082FF07C06091080185E016 +:102D3000689FB001112417C09091D6019923D1F05A +:102D400060910701961788F72091080185E0289F78 +:102D500090011124929FA001939F500D112470E0C7 +:102D6000CA010E946B236038710540F4611571053A +:102D700039F002C065E070E0862F08958FE708956E +:102D800081E008958091D50180FF08C0609106011F +:102D900070E0759567957595679521C081FF06C0B0 +:102DA0006091060170E07595679519C082FF04C0B7 +:102DB0006091060170E010C09091D6019923C1F096 +:102DC000609105019617A0F780910601899FC001C7 +:102DD000112470E00E946B236038710528F461159E +:102DE000710521F0862F08958FE7089581E00895F9 +:102DF00061E070E0F4CF803F21F40E947916819564 +:102E000004C0813F29F40E9479168093D901089566 +:102E1000823F21F40E947916819504C0833F29F4F2 +:102E20000E9479168093D8010895893F19F40E9471 +:102E3000C21605C08A3F31F40E94C2168195809364 +:102E4000DA0108958B3F21F40E94C216819504C0D7 +:102E50008C3F29F40E94C2168093DB010895843FC1 +:102E600021F48091D701816017C0853F21F48091C2 +:102E7000D701826011C0863F21F48091D701846020 +:102E80000BC0873F21F48091D701886005C0883F3F +:102E900031F48091D70180618093D70108958D3FEF +:102EA00021F48091D50181600BC08E3F21F4809187 +:102EB000D501826005C08F3F29F48091D5018460DF +:102EC0008093D5010895803F39F48091D90187FF1F +:102ED0006CC01092D90169C0813F29F48091D90159 +:102EE0001816BCF362C09091D801823F29F497FF75 +:102EF0005CC01092D80159C0833F19F41916CCF365 +:102F000054C0893F41F48091DA0118160CF04DC08D +:102F10001092DA014AC08A3F29F48091DA0187FFD2 +:102F200044C0F6CF8B3F39F48091DB0187FF3DC071 +:102F30001092DB013AC08C3F29F48091DB01181616 +:102F4000BCF333C0843F21F48091D7018E7F17C03A +:102F5000853F21F48091D7018D7F11C0863F21F4F8 +:102F60008091D7018B7F0BC0873F21F48091D701DF +:102F7000877F05C0883F31F48091D7018F7E809391 +:102F8000D70113C08D3F21F48091D5018E7F0BC0F6 +:102F90008E3F21F48091D5018D7F05C08F3F29F4AC +:102FA0008091D5018B7F8093D5018091D8018111CB +:102FB0000EC08091D90181110AC08091DA0181117E +:102FC00006C08091DB01811102C01092D6010895E4 +:102FD00087ED91E00E94FB090E94DE159093D401D9 +:102FE0008093D30108951F93CF93DF938091D301F2 +:102FF0009091D4010E94EA15AC019091D6019923D9 +:1030000021F02091090130E006C020910A018AE0F8 +:10301000289F900111244217530708F486C080911D +:10302000D801C091D901D091DA011091DB01811151 +:1030300007C0C11176C0D11174C0111172C075C022 +:103040009F3F19F09F5F9093D601181624F40E94B9 +:1030500079168093D8018091D80187FF05C00E941E +:10306000791681958093D8011C1624F40E94791654 +:103070008093D9018091D90187FF05C00E947916FC +:1030800081958093D9016091D801662339F1C0916F +:10309000D901CC2319F1772767FD7095872F972FDA +:1030A0000E94722223E333E343E35FE30E94D622CC +:1030B0000E943A226093D8016C2F772767FD7095A4 +:1030C000872F972F0E94722223E333E343E35FE3CA +:1030D0000E94D6220E943A226093D9011D1624F440 +:1030E0000E94C2168093DA018091DA0187FF05C041 +:1030F0000E94C21681958093DA01111624F40E9471 +:10310000C2168093DB018091DB0187FF05C00E941E +:10311000C21681958093DB01DF91CF911F910C94B2 +:10312000E8179F3F09F08ECF96CFDF91CF911F9187 +:103130000895E7EDF1E085E0DF011D928A95E9F75A +:103140001092D6011092D5010895833081F128F4B0 +:10315000813059F08230D1F00895853009F449C0AA +:10316000B8F1863009F456C0089580910A01262FDF +:1031700030E0280F311D2F3F310524F4680F609394 +:103180000A0108958FEF80930A0108958091090143 +:10319000262F30E0280F311D2F3F310524F4680F12 +:1031A0006093090108958FEF80930901089580913C +:1031B0000801262F30E0280F311D2F3F310524F460 +:1031C000680F6093080108958FEF809308010895B8 +:1031D00080910701262F30E0280F311D2F3F310548 +:1031E00024F4680F6093070108958FEF809307011F +:1031F000089580910601262F30E0280F311D2F3FC2 +:10320000310524F4680F6093060108958FEF8093D1 +:103210000601089580910501262F30E0280F311D09 +:103220002F3F310524F4680F6093050108958FEF57 +:10323000809305010895833011F128F4813049F01D +:10324000823091F00895853081F120F18630C1F10E +:10325000089580910A01681720F4861B80930A0163 +:10326000089510920A01089580910901681720F4C9 +:10327000861B809309010895109209010895809199 +:103280000801681720F4861B8093080108951092A6 +:103290000801089580910701681720F4861B809328 +:1032A000070108951092070108958091060168179B +:1032B00020F4861B8093060108951092060108955C +:1032C00080910501681720F4861B809305010895FD +:1032D0001092050108950F931F938D3109F471C069 +:1032E00008F045C0803109F485C008F5873009F43D +:1032F0006FC068F4863009F0ADC08091CD01817F48 +:103300008E7F8093CD0181E08093DD01A4C08B305E +:1033100009F49EC08E3009F09DC08091CD0182FBE2 +:10332000222720F991E0922790FB82F96CC0863128 +:1033300009F48EC060F4813109F08CC00E94940EB3 +:103340009091020181E089278093020181C0893137 +:1033500009F47EC08B3109F07DC08091CD0181FBE5 +:10336000222720F991E0922790FB81F94CC0853308 +:1033700009F466C048F4873209F462C008F44FC00B +:10338000893209F45DC066C0833438F48A3308F0AA +:1033900044C0883309F45CC05DC0833409F450C074 +:1033A000883409F057C00E94940E0FEF13ED20E30C +:1033B000015010402040E1F700C000000E94391683 +:1033C00047C00E94F51A0E94E4090E94460640C0C8 +:1033D0009091CD01892F8095817080FB90F929F023 +:1033E000966098609093CD0136C0997F977F9093B7 +:1033F000CD012EC08091CD0183FB222720F991E0E1 +:10340000922790FB83F98093CD01992309F1809154 +:10341000CD0181608093CD011BC0895301C08D51C6 +:1034200041E050E060E070E08A019B0104C0000FC1 +:10343000111F221F331F8A95D2F7C901B80104C09A +:1034400061E070E080E090E00E9454120E94940ECF +:1034500081E001C080E01F910F91089580E0089500 +:1034600080E008958E518A3030F4E82FF0E0EA5E73 +:10347000FE4F8081089580E00895CF93C82F8091FA +:10348000DD01813079F018F08230E9F186C0E091F9 +:103490000301F09104018081813169F0823209F0E9 +:1034A0007EC009C0E0910301F09104018081813167 +:1034B00011F0823261F48C2F0E942E1A811104C007 +:1034C0008C2F0E946B191DC081E090E01AC08C2FD8 +:1034D0000E94301A811114C0C43179F048F4CB3005 +:1034E00079F0C03109F05FC082E08093DD0108C04F +:1034F000C93219F0C83321F056C01092DD0153C013 +:1035000081E0817052C0C93281F110F5C43169F196 +:10351000A8F4C73009F045C08AE080930A0194E11D +:103520009093090193E0909308018093070188E04C +:103530008093060188E28093050133C082EE8C0FF0 +:10354000863078F58C2F0E94321A8093DC0129C0D6 +:10355000CE34E9F020F4CB3421F56AE013C0C13554 +:1035600079F0C235F1F461E00DC08091DC0188236F +:1035700019F01092DC0115C081E08093DD0115C0C7 +:1035800061E006C08091DC010E94A5180AC06AE0D3 +:103590008091DC010E941B1904C01092DD0180E0C3 +:1035A00004C081E002C080E0ACCFCF910895E1E893 +:1035B000F0E08081886080838081816080838FB724 +:1035C000F89493E09093890090ED909388008FBFDA +:1035D0000895EFE6F0E08081826080830895EFE651 +:1035E000F0E080818D7F80830895EFE6F0E09081A8 +:1035F00082E08927808308951F920F920FB60F9261 +:1036000011242F933F934F935F936F937F938F93E7 +:103610009F93AF93BF93EF93FF938091DE019091BF +:10362000DF0101969093DF018093DE01811103C0D9 +:1036300082E00E944606E091DF01E695E695F0E023 +:10364000E954FC4FE4918091DE018E1303C080E0C9 +:103650000E944606FF91EF91BF91AF919F918F918C +:103660007F916F915F914F913F912F910F900FBE7E +:103670000F901F9018958091F0010895CF93DF93DC +:1036800000D01F92CDB7DEB79C018091F801843045 +:1036900019F593E099833B832A839093E9008FEF98 +:1036A0009091E800815095FD06C095ED9A95F1F74F +:1036B00000008111F5CF8091E80085FF0DC040E04A +:1036C00050E063E070E0CE0101960E94A71D80915A +:1036D000E8008E778093E8000F900F900F90DF91B5 +:1036E000CF910895CF93DF9300D01F92CDB7DEB76F +:1036F0002091F801243021F522E029839B838A83DD +:1037000083E08093E9008FEF9091E800815095FD70 +:1037100006C095ED9A95F1F700008111F5CF8091E3 +:10372000E80085FF0DC040E050E063E070E0CE01AE +:1037300001960E94A71D8091E8008E778093E80093 +:103740000F900F900F90DF91CF9108952091F80185 +:103750002430F1F422E02093E9002FEF3091E800CB +:10376000215035FD06C035ED3A95F1F700002111E5 +:10377000F5CF2091E80025FF0BC040E050E065E068 +:1037800070E00E94A71D8091E8008E778093E8008A +:103790000895CF93DF93EC019091F801943009F0F4 +:1037A00046C0809115018823D9F0809102018823B9 +:1037B000B9F09093E9008FEF9091E800815095FD6A +:1037C00006C095E19A95F1F700008111F5CF80913F +:1037D000E80085FF2CC040E050E060E170E017C0D9 +:1037E00081E08093E9008FEF9091E800815095FD92 +:1037F00006C095ED9A95F1F700008111F5CF809103 +:10380000E80085FF14C040E050E068E070E0CE01C1 +:103810000E94A71D8091E8008E778093E80080E1E8 +:10382000FE01A0EEB1E001900D928A95E1F7DF91E3 +:10383000CF9108958091F701811109C00E943C1F2A +:103840000E94991F8091E20084608093E2000895B5 +:103850001092F701089508950C94E91A0E94CF156B +:103860000E94EF1A0E94E4090C94460642E061ECC3 +:1038700081E00E94B61E42E061EC82E00E94B61E2A +:1038800042E061EC83E00E94B61E42E161EC84E01C +:103890000C94B61E8091FA01833009F455C030F4BF +:1038A000813071F0823009F48EC008958A3009F4B5 +:1038B0007AC08B3009F460C0893009F09CC020C008 +:1038C0008091F901813A09F096C08091E800877FE4 +:1038D0008093E8008091FD019091FE01892B21F4F5 +:1038E00060E180EE91E003C060E080E090E070E095 +:1038F0000E94F21D8091E8008B778093E800089584 +:103900008091F901813209F076C08091FD0190919A +:10391000FE01009719F0039709F06DC08091E8004F +:10392000877F8093E8008091E80082FD05C0809148 +:10393000F8018111F8CF5FC08091F1008093F00110 +:103940008091E8008B7753C08091F901813A09F0AA +:1039500052C08091FD019091FE01892B09F04BC06E +:103960008091E800877F8093E8008091E80080FFE5 +:10397000FCCF8091150136C08091F9018132D9F5D3 +:103980008091FD019091FE01892BA9F58091E800BD +:10399000877F8093E8000E94EB1E8091FB0180935B +:1039A00015010C94940E8091F901813221F58091DA +:1039B000E800877F8093E8000E94EB1E8091FC0165 +:1039C0008093F10108958091F901813AA1F48091E9 +:1039D000E800877F8093E8008091E80080FFFCCFBB +:1039E0008091F1018093F1008091E8008E778093BF +:1039F000E8000C94EB1E089584B7877F84BF0FB650 +:103A0000F894A8958091600088618093600010927E +:103A100060000FBE80E880936100109261000E94F8 +:103A2000330A0E943C1F0E94991F8091E20084602B +:103A30008093E20078940E941F220E94350A8BE056 +:103A400091E00E94DF090E94D71A8091F801853029 +:103A500069F40E948E158091F6018823B1F30E94CB +:103A6000BB15882391F30E94911DEFCF0E943B0A62 +:103A7000ECCF292F332723303105C9F064F42130EE +:103A8000310581F02230310509F043C08DE690E028 +:103A90002BE234E042C021323105F1F0223231050F +:103AA00041F137C082E190E028E934E036C099273F +:103AB0008130910541F08230910541F0892B49F523 +:103AC000E7E2F4E005C0EFE0F4E002C0E7EFF3E086 +:103AD000849190E09F0121C06430D8F4E62FF0E09B +:103AE000EE0FFF1FE45DFE4F2081318189E090E001 +:103AF00014C0643070F470E0FB01EE0FFF1FEC5D4A +:103B0000FE4F20813181FB01E05EFE4F808190E01D +:103B100004C080E090E020E030E0FA0131832083AF +:103B2000089580E189BD82E189BD09B400FEFDCF21 +:103B30008091D8008F7D8093D8008091E0008260D2 +:103B40008093E0008091E00081FDFCCF0895CF924A +:103B5000DF92EF92FF920F931F93CF93DF93EC01CD +:103B60008B016A010E940A1F811133C0C114D10464 +:103B700039F0F60180819181081B190BC80FD91FFC +:103B8000E12CF12C0115110519F18091E80085FD5A +:103B900016C08091E8008E778093E800C114D104AC +:103BA00049F0F60180819181E80EF91EF182E082F0 +:103BB00085E00FC00E940A1F882321F30AC0899163 +:103BC0008093F10001501109FFEFEF1AFF0ADACFDD +:103BD00080E0DF91CF911F910F91FF90EF90DF90E8 +:103BE000CF9008952091FF013091000226173707EA +:103BF00048F06115710539F42091E8002E77209383 +:103C0000E80001C0B90140E061157105A9F12091FA +:103C1000F801222309F443C0253009F442C0209161 +:103C2000E80023FD40C02091E80022FD32C0209131 +:103C3000E80020FFE9CF4091F3002091F20030E04E +:103C4000342BFC01CF016115710559F02830310585 +:103C500040F481918093F100615071092F5F3F4FD3 +:103C6000F1CF41E02830310509F040E02091E80033 +:103C70002E772093E800C8CF4111C9CF0AC08091A8 +:103C8000F801882361F0853061F08091E80083FDC0 +:103C90000AC08091E80082FFF2CF80E0089582E0C0 +:103CA000089583E0089581E008952091FF01309107 +:103CB00000022617370748F06115710539F4209185 +:103CC000E8002E772093E80001C0B901FC0120E054 +:103CD0006115710591F18091F801882309F440C0C4 +:103CE000853009F43FC08091E80083FD3DC080919C +:103CF000E80082FD2FC08091E80080FFE9CF20918D +:103D0000F3008091F20090E0922B6115710559F05B +:103D10008830910540F424912093F1003196615050 +:103D200071090196F2CF21E0089709F020E0809117 +:103D3000E8008E778093E800CBCF2111CCCF0AC06A +:103D40008091F801882361F0853061F08091E8006E +:103D500083FD0AC08091E80082FFF2CF80E00895E1 +:103D600082E0089583E0089581E00895982F9730C8 +:103D700058F59093E900981739F07091EC00209174 +:103D8000ED005091F00003C0242F762F50E021FF6A +:103D900019C03091EB003E7F3093EB003091ED0085 +:103DA0003D7F3093ED003091EB0031603093EB00BC +:103DB0007093EC002093ED005093F0002091EE0002 +:103DC00027FF07C09F5FD3CF8F708093E90081E00A +:103DD000089580E008958091F90187FF11C08091D6 +:103DE000E80082FD05C08091F8018111F8CF11C073 +:103DF0008091E8008B770BC08091F801882349F00F +:103E00008091E80080FFF8CF8091E8008E77809362 +:103E1000E80008952091E4003091E50095E6409196 +:103E2000EC00842F817040FF22C08091E80080FD6B +:103E30001CC08091F801882391F0853091F0809129 +:103E4000EB0085FD10C04091E4005091E500421761 +:103E5000530729F39A01915011F784E0089582E005 +:103E6000089583E0089581E0089580E008954091E9 +:103E7000E80042FFDECF08950E94AA1F0E94B21FF1 +:103E8000E0EEF0E0808181608083E8EDF0E0808109 +:103E90008F77808319BCA7EDB0E08C918E7F8C93D7 +:103EA00080818F7E80831092F70108950F931F9376 +:103EB000CF93DF930E94AA1F0E94B21FC8EDD0E0EB +:103EC00088818F77888388818068888388818F7DC7 +:103ED000888319BC1092F8011092F4011092F60137 +:103EE0001092F50100EE10E0F80180818B7F808355 +:103EF00088818160888342E060E080E00E94B61E95 +:103F0000E1EEF0E080818E7F8083E2EEF0E0808160 +:103F100081608083808188608083F80180818E7FCA +:103F20008083888180618883DF91CF911F910F9179 +:103F30000895E8EDF0E080818F7E8083E7EDF0E08A +:103F400080818160808384E082BF81E08093F7017B +:103F50000C94561FE8EDF0E080818E7F80831092F4 +:103F6000E20008951092DA001092E10008951F9285 +:103F70000F920FB60F9211242F933F934F935F939D +:103F80006F937F938F939F93AF93BF93EF93FF9321 +:103F90008091E10082FF0BC08091E20082FF07C0A8 +:103FA0008091E1008B7F8093E1000E941E2280912E +:103FB000DA0080FF1FC08091D80080FF1BC0809175 +:103FC000DA008E7F8093DA008091D90080FF0DC0E7 +:103FD00080E189BD82E189BD09B400FEFDCF81E0A9 +:103FE0008093F8010E941A1C05C019BC1092F801B8 +:103FF0000E94281C8091E10080FF19C08091E2009E +:1040000080FF15C08091E2008E7F8093E200809156 +:10401000E20080618093E2008091D800806280930A +:10402000D80019BC85E08093F8010E942C1C809177 +:10403000E10084FF30C08091E20084FF2CC080E169 +:1040400089BD82E189BD09B400FEFDCF8091D80011 +:104050008F7D8093D8008091E1008F7E8093E10076 +:104060008091E2008F7E8093E2008091E200816087 +:104070008093E2008091F401882311F084E007C06E +:104080008091E30087FD02C081E001C083E080935E +:10409000F8010E942E1C8091E10083FF29C08091CD +:1040A000E20083FF25C08091E100877F8093E100DB +:1040B00082E08093F8011092F4018091E1008E7FFC +:1040C0008093E1008091E2008E7F8093E2008091F6 +:1040D000E20080618093E20042E060E080E00E94C4 +:1040E000B61E8091F00088608093F0000E942B1C27 +:1040F000FF91EF91BF91AF919F918F917F916F91C0 +:104100005F914F913F912F910F900FBE0F901F9095 +:1041100018951F920F920FB60F9211242F933F9371 +:104120004F935F936F937F938F939F93AF93BF93BF +:10413000CF93DF93EF93FF93C091E900CF7080910D +:10414000EC00D82FD17080FDD0E81092E90080916A +:10415000F000877F8093F00078940E94CD20109229 +:10416000E9008091F00088608093F000CD2BCF7043 +:10417000C093E900FF91EF91DF91CF91BF91AF9193 +:104180009F918F917F916F915F914F913F912F916F +:104190000F900FBE0F901F9018951F93CF93DF9332 +:1041A000CDB7DEB7AA970FB6F894DEBF0FBECDBF6E +:1041B000E9EFF1E088E08E0F9091F10091938E137A +:1041C000FBCF0E944A1C8091E80083FF1FC18091B1 +:1041D000F9019091FA01492F50E04A30510508F059 +:1041E00015C1FA01E558FF4F0C947F23803881F008 +:1041F000823809F00BC18091FD018F708093E90036 +:104200008091EB0085FB882780F91092E90006C0B9 +:104210008091F5019091F601911182609091E800F2 +:10422000977F9093E8008093F1001092F100C8C04E +:10423000282F2D7F09F0EAC0882319F0823061F021 +:10424000E5C08091FB01813009F0E0C0933009F0B6 +:1042500080E08093F6012BC08091FB01811127C083 +:104260008091FD018F7009F4D1C08093E900209105 +:10427000EB0020FF1CC0933021F48091EB008062A2 +:1042800014C09091EB0090619093EB0021E030E03E +:10429000A90102C0440F551F8A95E2F74093EA0036 +:1042A0001092EA008091EB0088608093EB001092FE +:1042B000E9008091E800877F86C08111A7C0109136 +:1042C000FB011F778091E3008078812B8093E300CE +:1042D0008091E800877F8093E8000E94EB1E809128 +:1042E000E80080FFFCCF8091E30080688093E300CA +:1042F000111102C082E001C083E08093F80186C002 +:104300008058823008F082C08091FB019091FC01BE +:104310008C3D53E0950779F583E08A838AE28983AF +:104320004FB7F894DE01139620E03EE051E2E32F10 +:10433000F0E050935700E49120FF03C0E295EF7046 +:104340003F5FEF708E2F90E0EA3010F0C79601C00B +:10435000C0968D939D932F5F243149F74FBF809175 +:10436000E800877F8093E8006AE270E0CE01019662 +:104370000E94F21D14C0AE014F5F5F4F6091FD01BE +:104380000E94391DBC01892B09F440C09091E800BE +:10439000977F9093E80089819A810E94551E8091B1 +:1043A000E8008B778093E80031C0803879F5809100 +:1043B000E800877F8093E8008091F4018093F1000A +:1043C0008091E8008E778093E8000E94EB1E1EC06B +:1043D00081111CC09091FB019230C0F48091E800E3 +:1043E000877F8093E8009093F4010E94EB1E8091F8 +:1043F000F401811106C08091E30087FD02C081E0D5 +:1044000001C084E08093F8010E94361C8091E8008E +:1044100083FF0AC08091E800877F8093E800809145 +:10442000EB0080628093EB00AA960FB6F894DEBF93 +:104430000FBECDBFDF91CF911F9108950895CF9307 +:104440008091F8018823A1F0C091E900CF7090918C +:10445000EC00892F817090FD80E8C82B1092E90054 +:104460008091E80083FD0E94CD20CF70C093E900C9 +:10447000CF9108950E9441226894B1110C94D022EA +:1044800008950E94B52288F09F5798F0B92F992778 +:10449000B751B0F0E1F0660F771F881F991F1AF02F +:1044A000BA95C9F714C0B13091F00E94CF22B1E0A3 +:1044B00008950C94CF22672F782F8827B85F39F0A2 +:1044C000B93FCCF3869577956795B395D9F73EF4C8 +:1044D00090958095709561957F4F8F4F9F4F089570 +:1044E000E89409C097FB3EF490958095709561958E +:1044F0007F4F8F4F9F4F9923A9F0F92F96E9BB2744 +:104500009395F695879577956795B795F111F8CFBF +:10451000FAF4BB0F11F460FF1BC06F5F7F4F8F4F2A +:104520009F4F16C0882311F096E911C0772321F020 +:104530009EE8872F762F05C0662371F096E8862FB8 +:1045400070E060E02AF09A95660F771F881FDAF70F +:10455000880F9695879597F9089557FD9058440FC1 +:10456000551F59F05F3F71F04795880F97FB991FD2 +:1045700061F09F3F79F0879508951216130614068F +:10458000551FF2CF4695F1DF08C01616170618061C +:10459000991FF1CF86957105610508940895E894F7 +:1045A000BB2766277727CB0197F908950E94E92258 +:1045B0000C945A230E944C2338F00E94532320F07D +:1045C000952311F00C9443230C94492311240C944B +:1045D000D0220E94AD2270F3959FC1F3950F50E059 +:1045E000551F629FF001729FBB27F00DB11D639FA5 +:1045F000AA27F00DB11DAA1F649F6627B00DA11D4B +:10460000661F829F2227B00DA11D621F739FB00DF0 +:10461000A11D621F839FA00D611D221F749F332760 +:10462000A00D611D231F849F600D211D822F762FF9 +:104630006A2F11249F5750409AF0F1F088234AF0D6 +:10464000EE0FFF1FBB1F661F771F881F9150504042 +:10465000A9F79E3F510580F00C9443230C94D0227F +:104660005F3FE4F3983ED4F3869577956795B795C9 +:10467000F795E7959F5FC1F7FE2B880F911D9695E3 +:10468000879597F9089597F99F6780E870E060E053 +:1046900008959FEF80EC089500240A9416161706DB +:1046A00018060906089500240A9412161306140623 +:1046B00005060895092E0394000C11F4882352F086 +:1046C000BB0F40F4BF2B11F460FF04C06F5F7F4F3E +:1046D0008F4F9F4F089597FB072E16F4009407D035 +:1046E00077FD09D00E94852307FC05D03EF4909504 +:1046F00081959F4F0895709561957F4F0895EE0FB6 +:10470000FF1F0590F491E02D0994AA1BBB1B51E1FA +:1047100007C0AA1FBB1FA617B70710F0A61BB70B31 +:10472000881F991F5A95A9F780959095BC01CD01D6 +:104730000895F999FECF92BD81BDF89A992780B569 +:104740000895A8E1B0E042E050E00C94C023262F89 +:10475000F999FECF92BD81BDF89A019700B4021677 +:1047600031F020BD0FB6F894FA9AF99A0FBE089569 +:104770000196272F0E94A8230C94A723DC01CB01CC +:10478000FC01F999FECF06C0F2BDE1BDF89A319661 +:1047900000B40D9241505040B8F70895F894FFCFFF +:1047A000052001BA0128080A03140A3B1BC91BA6ED +:1047B0001B721B3E1B0101020304050607080900CA +:1047C000404D363966051905E304AA043D04560434 +:0447D0006F048804E6 +:00000001FF diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md new file mode 100644 index 000000000..3bbe98fd6 --- /dev/null +++ b/keyboards/ergodox/readme.md @@ -0,0 +1,165 @@ +# The Easy Way + +If you can find firmware someone else has made that does what you want, that +is the easiest way to customize your ErgoDox. It requires no programming +experience or the setup of a build environment. + +Quickstart: + + - Find and download an existing firmware + [from Other Firmware Options](#other-firmware-options) + + - Then flash the firmware to your [ErgoDox Ez](#ergodox-ez) + or [ErgoDox Infinity](#ergodox-infinity) + +# Customizing Keymaps + +There are many existing keymaps in the "keymaps" directory. If you just want +to use one of them, you don't need to modify keymaps and can just build and +flash the firmware as described below. These directories each have a +"readme.md" file which describe them. + +If none of the existing keymaps suit you, you can create your own custom +keymap. This will require some experience with coding. Follow these steps +to customize a keymap: + + - Read the [qmk firmware README](https://github.com/jackhumbert/qmk_firmware) from top to bottom. Then come back here. :) + + - Clone the qmk_firmware repository + + - Set up your build environment (see below). + + - Make a new directory under "keymaps" to hold your customizations. + + - Copy an existing keymap that is close to what you want, such as + "keymaps/default/keymap.c". + + - Use an editor to modify the new "keymap.c". See "Finding the keycodes you + need" below). Try to edit the comments as well, so the "text graphics" + represent your layout correctly. + + - Compile your new firmware (see below) + + - Flash your firmware (see below) + + - Test the changes. + + - Submit your keymap as a pull request to the qmk_firmware repository so + others can use it. You will want to add a "readme.md" that describes the + keymap. + +# Build Dependencies + +Before you can build, you will need the build dependencies. There is a script +to try to do this for Linux: + + - Run the `util/install_dependencies.sh` script as root. + +For the Infinity, you need the chibios submodules to be checked out or you +will receive errors about the build process being unable to find the chibios +files. Check them out with: + + - Go to the top level repo directory and run: `git submodule update --init --recursive` + +# Flashing Firmware + +## ErgoDox Ez + +The Ez uses the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). + +Linux users need to modify udev rules as described on the Teensy Linux page. +Some distributions provide a binary, maybe called `teensy-loader-cli`). + +To flash the firmware: + + - Build the firmware with `make keymapname`, for example `make default` + - This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g. + `ergodox_ez_default.hex` + + - Start the teensy loader. + + - Load the .hex file into it. + + - Press the Reset button by inserting a paperclip gently into the reset hole + in the top right corder. + + - Click the button in the Teensy app to download the firmware. + +## ErgoDox Infinity + +The Infinity is two completely independent keyboards, and needs to be flashed +for the left and right halves seperately. To flash them: + + - Build the firmware with `make 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 infinity-keymapname-dfu-util` + + - Build left hand firmware with `make infinity-keymapname MASTER=right` + + - Plug in the right hand keyboard only. + + - Press the program button (back of keyboard, above thumb pad). + + - Install the firmware with `sudo make infinity-keymapname-dfu-util MASTER=right` + +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) + +### Infinity Master/Two Halves + +The Infinity is two completely independent keyboards, that can connect together. +You have a few options in how you flash the firmware: + +- Flash the left half, rebuild the firmware with "MASTER=right" and then flash + the right half. This allows you to plug in either half directly to the + computer and is what the above instructions do. + +- Flash the left half, then flash the same firmware on the right. This only + works when the left half is plugged directly to the computer and the keymap + is mirrored. It saves the small extra step of rebuilding with + "MASTER=right". + +- The same as the previous one but with "MASTER=right" when you build the + firmware, then flash the same firmware to both halves. You just have to + directly connect the right half to the computer. + +- For minor changes such as changing only the keymap without having updated + any part of the firmware code itself, you can program only the MASTER half. + It is safest to program both halves though. + +# Contributing your keymap + +The QMK firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed dozens of user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. + +1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). +2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. +3. `readme.md` - a readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :) +4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link, just like I did with the default layout. + +# Finding the keycodes you need + +Let's say you want a certain key in your layout to send a colon; to figure out what keycode to use to make it do that, you're going to need `quantum/keymap_common.h`. + +That file contains a big list of all of the special, fancy keys (like, being able to send % on its own and whatnot). + +If you want to send a plain vanilla key, you can look up its code under `doc/keycode.txt`. That's where all the boring keys hang out. + +# Other Firmware Options + +There are external tools for customizing the layout, but those do not use +the featurs of this qmk firmware. These sites include: + + - [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) for Ez + - [Input Club configurator](https://input.club/configurator-ergodox) for Infinity, provides left and right files + +You can also find an existing firmware that you like, for example from: + + - [Dozens of community-contributed keymaps](http://qmk.fm/keyboards/ergodox/) + +This qmk firmware also provides the ability to customize keymaps, but requires +a toolchain to build the firmware. See below for instructions on building +firmware and customizing keymaps. diff --git a/keyboards/ergodox/rules.mk b/keyboards/ergodox/rules.mk new file mode 100644 index 000000000..ac63d4eff --- /dev/null +++ b/keyboards/ergodox/rules.mk @@ -0,0 +1,28 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make = Make software. +# +# make clean = Clean out built project files. +# +# That's pretty much all you need. To compile, always go make clean, +# followed by make. +# +# For advanced users only: +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +#---------------------------------------------------------------------------- +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ +SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= yes # Unicode diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png deleted file mode 100644 index 3df68ea53..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png deleted file mode 100644 index 7b25a05b3..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png deleted file mode 100644 index 698d11e5f..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile b/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile deleted file mode 100644 index e7b2d0a65..000000000 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile +++ /dev/null @@ -1 +0,0 @@ -UNICODE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-base.png b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-base.png deleted file mode 100644 index 9c561a10a..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-base.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png deleted file mode 100644 index 99e5ed80b..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt deleted file mode 100644 index 4eccc9f35..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], -[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], -[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#ffb063"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#e6e067"},"Print\n\n\n\n\n\nScreen"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#e6e067",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#ff0000",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], -[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#e6e067"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#2277ff",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], -[{y:-0.75,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#ffb063"},"End",{x:1},"Page\n\n\n\n\n\nDown"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Mute",{x:6.5,c:"#737373",a:7},""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#ffb063",fa:[0,0,0,1]},"Delete\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#ff8500"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#ffb063"},"Insert\n\n\nCmd",{x:1,c:"#77aaff"},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ccbb00"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], -[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], -[{x:2},"Home\n\n\nBrowser"], -[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ccbb00",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nDown"] - diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png deleted file mode 100644 index e4de64a96..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt deleted file mode 100644 index e199f5c59..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], -[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], -[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb"},"!",{x:14.5,c:"#89b087"},"/",{c:"#2277ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"(",{x:10.5,c:"#89b087"},"5"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#54d6de",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], -[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb"},"%",{x:14.5,c:"#89b087"},"-",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},".\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#77aaff"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0\n\n\nCmd",{x:1},"=\n\n\nHyper"], -[{y:-0.75,x:0.5,c:"#77aaff"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+\n\n\nMeh","Enter\n\n\nCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Left","Right"], -[{h:2},"Space",{h:2},"Enter","Up"], -[{x:2},"Down"], -[{r:-30,rx:13,y:-1,x:-3},"Home","End"], -[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], -[{x:-3},"Page\n\n\n\n\n\nDown"] - diff --git a/keyboards/ergodox_ez/keymaps/ordinary/readme.md b/keyboards/ergodox_ez/keymaps/ordinary/readme.md deleted file mode 100644 index 6465cd79e..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/readme.md +++ /dev/null @@ -1,103 +0,0 @@ -# The Ordinary Layout, a familiar and powerful layout # - -The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. - -The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. - -Nicholas Keene -ordinarylayout@nicholaskeene.com -no rights reserved, use for any purposes, credit me if you are a nice person - -## The Base Layout ## - -* The light blue keys are modifiers: traditional Control, Option, and Command keys, plus Hyper and Meh -* The dark blue keys are Shift keys: Capitals Shift (traditional shift), Symbol Shift, and Media Shift; plus a Shift Lock key -* Several dark blue keys double for entry of characters which would typically be in those locations -* The turquoise keys are text navigation and manipulation -* The red keys is Escape and it is always found in that location no matter what - -![Ordinary base layout](ordinary-base.png) - -This layout puts the modifier keys along the bottom of the keyboard where they are on most keyboards. They are in the regular order, with the addition of Hyper and Meh keys. The modifier keys are all in the same place on all layers, although some layers also assign symbols on those buttons. On the outside edges are the Shift keys. The traditional shift key is called Capitals Shift and it is in the normal location. Above that are Symbols Shift and Media Shift. Each Shift key momentarily switches the layout to that layer, and if you use the Shift Lock button you can lock the layout to that layer. - -Touch typists will also find tilde, tab, equals/plus, slash/pipe, and quote/double-quote sharing space on those Shift keys where they would probably be on a common keyboard. Other than the turquoise keys the only buttons which move to new locations are the Brackets and Dash and Escape. Most touch typists dont touch-type brackets or dash anyway so only Escape really requires retraining of muscle memory, and see below for the Special Escape Sequence. - -The four big turquoise keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. - -The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. - -## The Symbols Layer ## - -* The light green keys are the eponymous symbols -* The bright green keys are F-Keys -* The dark green keys constitute a number pad -* The turquoise keys are the *reverse* of the turquoise keys on the base layer - -![Ordinary symbol layout](ordinary-symbol.png) - -The Ergodox EZ ships with the "Coder Layer" which I like to call the Symbols layer. There are some significant improvements in The Ordinary Layout over the default layout. - -The symbol keys are mostly the same as on the default layout, which did a good job in this regard, but with a few enhancements: - -* Angle brackets on this layer mean that curly, square, and angle brackets are all available on different layers of the same two buttons. Also, they mean that all kinds of brackets, including parentheses, are available on both the Base and Symbols layers. -* The slash, backslash, and pipe characters are grouped together as a memory aid. -* The & and | symbols are juxtaposed as a memory aid - -The number pad area here, in green, includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads, because this layout does not use a Num Lock key to switch the buttons between numeric keycodes and navigational keycodes. See the explanation in The Media Layout section about navigation using these same buttons. - -Finally, consider the turquoise text-nav keys. Here in the Symbols layer, these are *reversed* from the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. - -## The Media Layer ## - -* The dark orange keys on the left move the mouse cursor -* The dark orange keys on the right move the text cursor -* The light orange keys are for scrolling and paging -* The bright green keys are more F-keys -* The dark yellow keys signal Web and Audio applications -* The light yellow keys signal the operating system -* The dark gray keys do nothing in case you bump them by accident - -![Ordinary media layout](ordinary-media.png) - -This layer was inspired by the Media layer on the Ergodox EZ but takes it farther. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. - -Moreover, the orange keys on the right overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. - -Alas, the yellow keys have at best spotty success with common software. Good luck with those but don't expect too much. - -## Switching Between Layers ## - -In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. - -Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. If you press both of a pair of shift keys, the layer will lock on until you press both shift keys again. For instance, the widely and rightly loathed Caps Lock is engaged by pressing both Capitals Shift buttons. All the Shift keys work this way. - -Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. - -## Special Sequences ## - -![Ordinary special layout](ordinary-special.png) - -### Escape ### - -The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, whnich is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. - -The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. - -### Backspace ### - -At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. - -### RShift ### - -The Ordinary Layout locks layers by pressing both of a pair of shift keys. This interferes with the QMK firmware magic sequence, which is LShift+RShift. To work around this, both of the Capitals Shift keys produce a *Left Shift* keystroke. If for some reason a person needs *Right Shift* they can find it by pressing a Special Shift key, then the Capitals Shift key on the right side of the keyboard. - -**** - -The Ordinary Layout for the Ergodox EZ keyboard, v4 - -Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - -No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. - -Details: readme.md - https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png deleted file mode 100644 index 6eecf447e..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt deleted file mode 100644 index a08827c6d..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], -[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.375,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""], -[{y:-0.75,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{c:"#2277ff",w:1.5},"RShift"], -[{y:-0.375,x:3.5,c:"#cccccc"},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], -[{h:2},"",{h:2},"",""], -[{x:2},""], -[{r:-30,rx:13,y:-1,x:-3},"",""], -[{x:-3},"",{h:2},"",{h:2},""], -[{x:-3},""] - diff --git a/keyboards/ergodox_ez/readme.md b/keyboards/ergodox_ez/readme.md deleted file mode 100644 index 67a5fb095..000000000 --- a/keyboards/ergodox_ez/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# Getting started - -There are two main ways you could customize the ErgoDox EZ. - -## The Easy Way: Use an existing firmware file and just flash it - -1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. -2. Find a firmware file you like. You can find a few if these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. -3. Download the firmware file -4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. - -## More technical: create your own totally custom firmware by editing the source files. - -This requires a little bit of familiarity with coding. - -1. Go to https://github.com/jackhumbert/qmk_firmware and read the readme at the base of this repository, top to bottom. Then come back here :) -2. Clone the repository (download it) -3. Set up a build environment as per [the build guide](/doc/BUILD_GUIDE.md) - - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` -4. Copy `keyboards/ergodox_ez/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) -5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. -6. Compile your firmware by running `make keymap=your_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_your_name.hex`, e.g. `ergodox_ez_german.hex`. -6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy keymap=your_name`. -7. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. - -Good luck! :) - -## Contributing your keymap - -The ErgoDox EZ firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed almost 20 user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox EZ. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. - -1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). -2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. -3. `readme.md` - a readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :) -4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link, just like I did with the default layout. - - -## Finding the keycodes you need - -Let's say you want a certain key in your layout to send a colon; to figure out what keycode to use to make it do that, you're going to need `quantum/keymap_common.h`. - -That file contains a big list of all of the special, fancy keys (like, being able to send % on its own and whatnot). - -If you want to send a plain vanilla key, you can look up its code under `doc/keycode.txt`. That's where all the boring keys hang out. diff --git a/keyboards/gh60/Makefile b/keyboards/gh60/Makefile index 39a9cc0ae..57b2ef62e 100644 --- a/keyboards/gh60/Makefile +++ b/keyboards/gh60/Makefile @@ -1,74 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -# CONSOLE_ENABLE ?= yes # Console for debug(+400) -# COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR - include ../../Makefile -endif - +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/gh60/config.h b/keyboards/gh60/config.h index 4813c4e78..97753bc06 100644 --- a/keyboards/gh60/config.h +++ b/keyboards/gh60/config.h @@ -1,161 +1,161 @@ -/* -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER geekhack -#define PRODUCT GH60 -#define DESCRIPTION t.m.k. keyboard firmware for GH60 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * 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, D1, D2, D3, D5 } -// Rev A -// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } -// Rev B/C - #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -/* 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 - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER geekhack +#define PRODUCT GH60 +#define DESCRIPTION t.m.k. keyboard firmware for GH60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * 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, D1, D2, D3, D5 } +// Rev A +// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } +// Rev B/C + #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/gh60/gh60.c b/keyboards/gh60/gh60.c index 255d87de9..f5a158e12 100644 --- a/keyboards/gh60/gh60.c +++ b/keyboards/gh60/gh60.c @@ -1,25 +1,25 @@ -#include "gh60.h" - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - if (usb_led & (1< - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER geekhack -#define PRODUCT GH60 -#define DESCRIPTION t.m.k. keyboard firmware for GH60 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * 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, D1, D2, D3, D5 } -// Rev A -// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } -// Rev B/C - #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -/* 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 - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -/* - * RGB Underglow - * These settings are for the F4 by default: - * - * - * #define ws2812_PORTREG PORTF - * #define ws2812_DDRREG DDRF - * #define ws2812_pin PF4 - * #define RGBLED_NUM 14 // Number of LEDs - * #define RGBLIGHT_HUE_STEP 10 - * #define RGBLIGHT_SAT_STEP 17 - * #define RGBLIGHT_VAL_STEP 17 - * - * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. - * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. - * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c -*/ - -/* Deprecated code below -#define ws2812_PORTREG PORTF -#define ws2812_DDRREG DDRF -#define ws2812_pin PF4 -*/ -#define RGB_DI_PIN F4 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 8 // Number of LEDs -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER geekhack +#define PRODUCT GH60 +#define DESCRIPTION t.m.k. keyboard firmware for GH60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * 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, D1, D2, D3, D5 } +// Rev A +// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } +// Rev B/C + #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * RGB Underglow + * These settings are for the F4 by default: + * + * + * #define ws2812_PORTREG PORTF + * #define ws2812_DDRREG DDRF + * #define ws2812_pin PF4 + * #define RGBLED_NUM 14 // Number of LEDs + * #define RGBLIGHT_HUE_STEP 10 + * #define RGBLIGHT_SAT_STEP 17 + * #define RGBLIGHT_VAL_STEP 17 + * + * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. + * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. + * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c +*/ + +/* Deprecated code below +#define ws2812_PORTREG PORTF +#define ws2812_DDRREG DDRF +#define ws2812_pin PF4 +*/ +#define RGB_DI_PIN F4 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/gh60/pinout.txt b/keyboards/gh60/pinout.txt index 3787f938e..e9bf1983a 100644 --- a/keyboards/gh60/pinout.txt +++ b/keyboards/gh60/pinout.txt @@ -1,18 +1,18 @@ - /* Column pin configuration - * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - * pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C) - */ - - /* Row pin configuration - * row: 0 1 2 3 4 - * pin: D0 D1 D2 D3 D5 - */ - - GPIO pads - 0 F7 WASD LEDs - 1 F6 ESC LED - 2 F5 FN LED - 3 F4 POKER Arrow LEDs - - B2 Capslock LED + /* Column pin configuration + * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + * pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C) + */ + + /* Row pin configuration + * row: 0 1 2 3 4 + * pin: D0 D1 D2 D3 D5 + */ + + GPIO pads + 0 F7 WASD LEDs + 1 F6 ESC LED + 2 F5 FN LED + 3 F4 POKER Arrow LEDs + + B2 Capslock LED B0 not connected \ No newline at end of file diff --git a/keyboards/gh60/readme.md b/keyboards/gh60/readme.md index 92302d507..8c744bfd3 100644 --- a/keyboards/gh60/readme.md +++ b/keyboards/gh60/readme.md @@ -1,60 +1,62 @@ -## gh60 Rev C keyboard firmware - -![gh60 Rev C PCB](gh60revc.jpg) - - /* Column pin configuration - * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - * pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C) - */ - - /* Row pin configuration - * row: 0 1 2 3 4 - * pin: D0 D1 D2 D3 D5 - */ - - GPIO pads - 0 F7 WASD LEDs - 1 F6 ESC LED - 2 F5 FN LED - 3 F4 POKER Arrow LEDs - - B2 Capslock LED - B0 not connected - -Functions to controls LED clusters - - gh60_caps_led_on() - gh60_poker_leds_on() - gh60_fn_led_on() - gh60_esc_led_on() - gh60_wasd_leds_on() - - gh60_caps_led_off() - gh60_poker_leds_off() - gh60_fn_led_off() - gh60_esc_led_off() - gh60_wasd_leds_off() - -====================== - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/readme.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default -To build with the default keymap, simply run `make`. - -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. +## gh60 Rev C keyboard firmware + +![gh60 Rev C PCB](gh60revc.jpg) + + /* Column pin configuration + * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + * pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C) + */ + + /* Row pin configuration + * row: 0 1 2 3 4 + * pin: D0 D1 D2 D3 D5 + */ + + GPIO pads + 0 F7 WASD LEDs + 1 F6 ESC LED + 2 F5 FN LED + 3 F4 POKER Arrow LEDs + + B2 Capslock LED + B0 not connected + +Functions to controls LED clusters + + gh60_caps_led_on() + gh60_poker_leds_on() + gh60_fn_led_on() + gh60_esc_led_on() + gh60_wasd_leds_on() + + gh60_caps_led_off() + gh60_poker_leds_off() + gh60_fn_led_off() + gh60_esc_led_off() + gh60_wasd_leds_off() + +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make default`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + +``` +$ make [default|jack|] +``` + +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/gh60/rules.mk b/keyboards/gh60/rules.mk new file mode 100644 index 000000000..aba680e45 --- /dev/null +++ b/keyboards/gh60/rules.mk @@ -0,0 +1,66 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +# CONSOLE_ENABLE ?= yes # Console for debug(+400) +# COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/handwired/CMD60/Makefile b/keyboards/handwired/CMD60/Makefile index 711759917..191c6bb66 100644 --- a/keyboards/handwired/CMD60/Makefile +++ b/keyboards/handwired/CMD60/Makefile @@ -1,73 +1,3 @@ - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/handwired/CMD60/rules.mk b/keyboards/handwired/CMD60/rules.mk new file mode 100644 index 000000000..711759917 --- /dev/null +++ b/keyboards/handwired/CMD60/rules.mk @@ -0,0 +1,73 @@ + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif + + diff --git a/keyboards/handwired/Makefile b/keyboards/handwired/Makefile index 57493a47c..4e2a6f00f 100644 --- a/keyboards/handwired/Makefile +++ b/keyboards/handwired/Makefile @@ -1,3 +1,3 @@ -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/handwired/fivethirteen/Makefile b/keyboards/handwired/fivethirteen/Makefile index 711759917..191c6bb66 100644 --- a/keyboards/handwired/fivethirteen/Makefile +++ b/keyboards/handwired/fivethirteen/Makefile @@ -1,73 +1,3 @@ - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/handwired/fivethirteen/rules.mk b/keyboards/handwired/fivethirteen/rules.mk new file mode 100644 index 000000000..711759917 --- /dev/null +++ b/keyboards/handwired/fivethirteen/rules.mk @@ -0,0 +1,73 @@ + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif + + diff --git a/keyboards/handwired/minorca/Makefile b/keyboards/handwired/minorca/Makefile new file mode 100644 index 000000000..191c6bb66 --- /dev/null +++ b/keyboards/handwired/minorca/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/config.h b/keyboards/handwired/minorca/config.h similarity index 59% rename from keyboards/ergodox_ez/keymaps/townk_osx/config.h rename to keyboards/handwired/minorca/config.h index 58ba690af..4cdafcbd2 100644 --- a/keyboards/ergodox_ez/keymaps/townk_osx/config.h +++ b/keyboards/handwired/minorca/config.h @@ -1,6 +1,5 @@ /* Copyright 2012 Jun Wako -Copyright 2013 Oleg Kostyuk 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 @@ -23,25 +22,20 @@ along with this program. If not, see . /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1307 +#define PRODUCT_ID 0x6660 #define DEVICE_VER 0x0001 -#define MANUFACTURER ErgoDox EZ -#define PRODUCT ErgoDox EZ -#define DESCRIPTION t.m.k. keyboard firmware for Ergodox +#define MANUFACTURER ME +#define PRODUCT MinOrca +#define DESCRIPTION Tiny Whale /* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 6 +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 -#define MOUSEKEY_DELAY 100 -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_MAX_SPEED 3 -#define MOUSEKEY_TIME_TO_MAX 10 - -#define TAPPING_TOGGLE 1 - -#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } -#define ROWS (int []){ D0, D5, B5, B6 } +/* MinOrca PCB default pin-out */ +#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } +#define MATRIX_ROW_PINS { B0, B1, B2, B3 } +#define UNUSED_PINS /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -53,9 +47,7 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 2 -#define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#define DEBOUNCING_DELAY 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -64,8 +56,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) /* @@ -74,10 +65,10 @@ along with this program. If not, see . */ /* disable debug print */ -// #define NO_DEBUG +//#define NO_DEBUG /* disable print */ -// #define NO_PRINT +//#define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER @@ -85,8 +76,5 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -//#define DEBUG_MATRIX_SCAN_RATE -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 3000 #endif diff --git a/keyboards/handwired/minorca/keymaps/default/Makefile b/keyboards/handwired/minorca/keymaps/default/Makefile new file mode 100644 index 000000000..a573488a5 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../../Makefile +endif diff --git a/keyboards/handwired/minorca/keymaps/default/config.h b/keyboards/handwired/minorca/keymaps/default/config.h new file mode 100644 index 000000000..bf40376c1 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* bootmagic salt key */ +#define BOOTMAGIC_KEY_SALT KC_ESC + +/* skip bootmagic and eeconfig */ +#define BOOTMAGIC_KEY_SKIP KC_SPACE + +#endif diff --git a/keyboards/handwired/minorca/keymaps/default/keymap.c b/keyboards/handwired/minorca/keymaps/default/keymap.c new file mode 100644 index 000000000..a55d578e4 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "minorca.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Base */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT }, + {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO } + }, + [1] = { /* First */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, + {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI }, + {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } + }, + [2] = { /* Second */ + {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, + {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT }, + {KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } + }, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to First overlay + [1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay + +}; \ No newline at end of file diff --git a/keyboards/handwired/minorca/keymaps/default/readme.md b/keyboards/handwired/minorca/keymaps/default/readme.md new file mode 100644 index 000000000..6ed31f82b --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# The Default Minorca Layout + +Copied from https://github.com/pancinteractive/qmk_firmware/blob/master/keyboard/minorca_mkV/keymaps/default/keymap.c + +It looks incomplete. \ No newline at end of file diff --git a/keyboards/handwired/minorca/keymaps/readme.md b/keyboards/handwired/minorca/keymaps/readme.md new file mode 100644 index 000000000..058923ba2 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/readme.md @@ -0,0 +1,23 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of Minorca keymaps + +* **default** default Minorca layout +* **rgb** layout with WS2812b control diff --git a/keyboards/handwired/minorca/keymaps/rgb/Makefile b/keyboards/handwired/minorca/keymaps/rgb/Makefile new file mode 100644 index 000000000..2b2af1335 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../../Makefile +endif diff --git a/keyboards/handwired/minorca/keymaps/rgb/config.h b/keyboards/handwired/minorca/keymaps/rgb/config.h new file mode 100644 index 000000000..deaac2e26 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/config.h @@ -0,0 +1,20 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* bootmagic salt key */ +#define BOOTMAGIC_KEY_SALT KC_ESC + +/* skip bootmagic and eeconfig */ +#define BOOTMAGIC_KEY_SKIP KC_SPACE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D5 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 13 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/handwired/minorca/keymaps/rgb/example.jpg b/keyboards/handwired/minorca/keymaps/rgb/example.jpg new file mode 100644 index 000000000..a04c8d37d Binary files /dev/null and b/keyboards/handwired/minorca/keymaps/rgb/example.jpg differ diff --git a/keyboards/handwired/minorca/keymaps/rgb/keymap.c b/keyboards/handwired/minorca/keymaps/rgb/keymap.c new file mode 100644 index 000000000..9002afbb8 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/keymap.c @@ -0,0 +1,65 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "minorca.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _TB 3 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)}, + {KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL} +}, + +[_RAISE] = { + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)}, + {KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT}, + {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY} +}, + +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS}, + {KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT}, + {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END} +}, + +[_TB] = { /* Tab */ + {KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS}, + {KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT}, + {BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB), + [1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), + [3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), +}; diff --git a/keyboards/handwired/minorca/keymaps/rgb/readme.md b/keyboards/handwired/minorca/keymaps/rgb/readme.md new file mode 100644 index 000000000..f50dfa546 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/readme.md @@ -0,0 +1,25 @@ +#RGB backlight for MinOrca + +![wiring](example.jpg) + +Example of adding WS2812b LEDs to a MinOrca. + +http://www.40percent.club/2016/08/tiny-whale.html + +The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key. + +* Tab + Z Toggle on/off +* Tab + X Mode +* Tab + C Hue+ +* Tab + V Hue- +* Tab + B Saturation+ +* Tab + N Saturation- +* Tab + M Brightness+ +* Tab + , Brightness- + +Example wiring: + +WS2812 data pin is connected to D5 + +![wiring](wiring1.jpg) +![wiring closeup](wiring2.jpg) diff --git a/keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg b/keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg new file mode 100644 index 000000000..7dcbe80c5 Binary files /dev/null and b/keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg differ diff --git a/keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg b/keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg new file mode 100644 index 000000000..fd91d3e1c Binary files /dev/null and b/keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg differ diff --git a/keyboards/handwired/minorca/minorca.c b/keyboards/handwired/minorca/minorca.c new file mode 100644 index 000000000..24e72c2a5 --- /dev/null +++ b/keyboards/handwired/minorca/minorca.c @@ -0,0 +1,6 @@ +#include "minorca.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} \ No newline at end of file diff --git a/keyboards/handwired/minorca/minorca.h b/keyboards/handwired/minorca/minorca.h new file mode 100644 index 000000000..158e5b4c5 --- /dev/null +++ b/keyboards/handwired/minorca/minorca.h @@ -0,0 +1,6 @@ +#ifndef MINORCA_H +#define MINORCA_H + +#include "quantum.h" + +#endif diff --git a/keyboards/handwired/minorca/readme.md b/keyboards/handwired/minorca/readme.md new file mode 100644 index 000000000..93c767954 --- /dev/null +++ b/keyboards/handwired/minorca/readme.md @@ -0,0 +1,33 @@ +minorca keyboard firmware +====================== +Handwired 40% keyboard + +http://www.panc.co/blog/minorcasebright-information-page + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. + +### Notable forks (which some of the keymap files are from) +- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) +- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) +- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) +- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) diff --git a/keyboards/handwired/minorca/rules.mk b/keyboards/handwired/minorca/rules.mk new file mode 100644 index 000000000..c51371a78 --- /dev/null +++ b/keyboards/handwired/minorca/rules.mk @@ -0,0 +1,67 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/handwired/onekey/Makefile b/keyboards/handwired/onekey/Makefile index c6d10856a..191c6bb66 100644 --- a/keyboards/handwired/onekey/Makefile +++ b/keyboards/handwired/onekey/Makefile @@ -1,65 +1,3 @@ - - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile endif \ No newline at end of file diff --git a/keyboards/handwired/onekey/rules.mk b/keyboards/handwired/onekey/rules.mk new file mode 100644 index 000000000..c6d10856a --- /dev/null +++ b/keyboards/handwired/onekey/rules.mk @@ -0,0 +1,65 @@ + + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/handwired/rules.mk b/keyboards/handwired/rules.mk new file mode 100644 index 000000000..e69de29bb diff --git a/keyboards/handwired/traveller/Makefile b/keyboards/handwired/traveller/Makefile index 12a4b71f4..191c6bb66 100644 --- a/keyboards/handwired/traveller/Makefile +++ b/keyboards/handwired/traveller/Makefile @@ -1,89 +1,3 @@ - -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# for avr upload -USB ?= /dev/cu.usbmodem1421 -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - - -ifdef TEENSY2 - OPT_DEFS += -DATREUS_TEENSY2 - ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -else - OPT_DEFS += -DATREUS_ASTAR - OPT_DEFS += -DCATERINA_BOOTLOADER - ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) -endif -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# MCU name - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -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 -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile -endif - -upload: build - $(ATREUS_UPLOAD_COMMAND) - +endif \ No newline at end of file diff --git a/keyboards/handwired/traveller/rules.mk b/keyboards/handwired/traveller/rules.mk new file mode 100644 index 000000000..12a4b71f4 --- /dev/null +++ b/keyboards/handwired/traveller/rules.mk @@ -0,0 +1,89 @@ + +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# for avr upload +USB ?= /dev/cu.usbmodem1421 +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +ifdef TEENSY2 + OPT_DEFS += -DATREUS_TEENSY2 + ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +else + OPT_DEFS += -DATREUS_ASTAR + OPT_DEFS += -DCATERINA_BOOTLOADER + ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) +endif +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# MCU name + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +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 +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../Makefile +endif + +upload: build + $(ATREUS_UPLOAD_COMMAND) + diff --git a/keyboards/hhkb/Makefile b/keyboards/hhkb/Makefile index 6fe973e1e..4e2a6f00f 100644 --- a/keyboards/hhkb/Makefile +++ b/keyboards/hhkb/Makefile @@ -1,90 +1,3 @@ - - -# project specific files -SRC = matrix.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -#OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# as per original hasu settings -OPT_DEFS += -DBOOTLOADER_SIZE=512 - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -CUSTOM_MATRIX ?= yes # Custom matrix file for the HHKB -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - -ifneq (, $(findstring yes, $(HHKB_JP))) - OPT_DEFS += -DHHKB_JP -endif - -debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION -debug-on: all - -debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT -debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS)) -debug-off: all +endif \ No newline at end of file diff --git a/keyboards/hhkb/keymaps/shela/Makefile b/keyboards/hhkb/keymaps/shela/Makefile new file mode 100644 index 000000000..d0586bda6 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/Makefile @@ -0,0 +1 @@ +SRC += action_pseudo_lut.c diff --git a/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c new file mode 100644 index 000000000..b205968c7 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c @@ -0,0 +1,142 @@ +#include "quantum.h" +#include "action_pseudo_lut.h" + +static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; + +/* + * Pseudo layout action. + * This action converts a keycode in order to output the character according to the keymap you specified + * still your keyboard layout recognized wrongly on your OS. + * Memo: Using other layer keymap to get keycode + */ +void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) { + static uint8_t prev_shift; + uint16_t keycode; + uint16_t pseudo_keycode; + + /* get keycode from keymap you specified */ + keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); + + prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + + if (record->event.pressed) { + /* when magic commands entered, keycode does not converted */ + if (IS_COMMAND()) { + if (prev_shift) { + add_shift_bit(keycode); + } + register_code(keycode); + return; + } + + if (prev_shift) { + pseudo_keycode = convert_keycode(keymap, keycode, true); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + add_shift_bit(keycode); + + if (IS_LSFT(pseudo_keycode)) { + register_code(QK_LSFT ^ pseudo_keycode); + } else { + /* delete shift mod temporarily */ + del_mods(prev_shift); + send_keyboard_report(); + register_code(pseudo_keycode); + add_mods(prev_shift); + send_keyboard_report(); + } + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + + if (IS_LSFT(pseudo_keycode)) { + add_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + register_code(QK_LSFT ^ pseudo_keycode); + /* on Windows, prevent key repeat to avoid unintended output */ + unregister_code(QK_LSFT ^ pseudo_keycode); + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } else { + register_code(pseudo_keycode); + } + } + } else { + if (get_shift_bit(keycode)) { + del_shift_bit(keycode); + pseudo_keycode = convert_keycode(keymap, keycode, true); + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + } + dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); + + if (IS_LSFT(pseudo_keycode)) { + unregister_code(QK_LSFT ^ pseudo_keycode); + } else { + unregister_code(pseudo_keycode); + } + } +} + +uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded) +{ + uint16_t pseudo_keycode; + + switch (keycode) { + case KC_A ... KC_CAPSLOCK: +#if defined(__AVR__) + if (shift_modded) { + pseudo_keycode = pgm_read_word(&keymap[keycode][1]); + } else { + pseudo_keycode = pgm_read_word(&keymap[keycode][0]); + } +#else + if (shift_modded) { + pseudo_keycode = keymap[keycode][1]; + } else { + pseudo_keycode = keymap[keycode][0]; + } +#endif + /* if undefined, use got keycode as it is */ + if (pseudo_keycode == 0x00) { + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + } + break; + default: + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + break; + } + return pseudo_keycode; +} + +uint8_t get_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); + } else { + dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); + return 0; + } +} + +void add_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); + } else { + dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); + } +} + +void del_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); + } else { + dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); + } +} diff --git a/keyboards/hhkb/keymaps/shela/action_pseudo_lut.h b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.h new file mode 100644 index 000000000..681252440 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.h @@ -0,0 +1,15 @@ +#ifndef ACTION_PSEUDO_LUT_H +#define ACTION_PSEUDO_LUT_H + +#define SHIFT_BIT_SIZE (0xE7 / 8 + 1) // 1bit per 1key + +#define IS_LSFT(kc) ((QK_LSFT & (kc)) == QK_LSFT) + +void action_pseudo_lut(keyrecord_t *, uint8_t, const uint16_t (*)[2]); +uint16_t convert_keycode(const uint16_t (*)[2], uint16_t, bool); + +uint8_t get_shift_bit(uint16_t); +void add_shift_bit(uint16_t); +void del_shift_bit(uint16_t); + +#endif diff --git a/keyboards/hhkb/keymaps/shela/config.h b/keyboards/hhkb/keymaps/shela/config.h new file mode 100644 index 000000000..08cc1fb46 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_SHELA_H +#define CONFIG_SHELA_H + +#include "../../config.h" + +#undef TAPPING_TERM +#define TAPPING_TERM 230 + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 2000 + +#endif diff --git a/keyboards/hhkb/keymaps/shela/keymap.c b/keyboards/hhkb/keymaps/shela/keymap.c new file mode 100644 index 000000000..c286b99de --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/keymap.c @@ -0,0 +1,179 @@ +/* + * HHKB Pro 2 US Layout for shela + */ +#include "hhkb.h" +#include "keymap_jis2us.h" +#include "action_pseudo_lut.h" + +enum keymap_layout { + BASE = 0, + PSEUDO_US, + DVORAK, + MOUSE, + TENKEY, + HHKB, + SPACE_FN, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0: Default Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------| + * | Control | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LAlt | LGui | SpaceFN | RGui |RAlt | + * `-----------------------------------------------------------------' + */ + [BASE] = + KEYMAP(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_GRV, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ + KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ + OSM(MOD_LSFT),KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_FN0, \ + KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT), + + /* Layer 1: Pseudo US Layout Layer */ + [PSEUDO_US] = + KEYMAP(KC_ESC, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_BSPC, \ + KC_TAB, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, \ + KC_LCTL,KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_ENT, \ + OSM(MOD_LSFT),KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_RSFT,KC_FN0, \ + KC_LGUI,KC_FN3, KC_FN2, KC_FN4 ,KC_RGUI), + + /* Layer 2: Dvorak Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | ` | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | \ | + * |-----------------------------------------------------------------------------------------| + * | Control | A | O | E | U | I | D | H | T | N | S | - | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LAlt | LGui | SpaceFN | RGui |RAlt | + * `-----------------------------------------------------------------' + */ + [DVORAK] = + KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC,KC_RBRC,KC_GRV, KC_BSPC, \ + KC_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,KC_EQL, KC_BSLS, \ + KC_LCTL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,KC_ENT, \ + KC_LSFT,KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,KC_FN0, \ + KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT), + + /* Layer 3: Mouse layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | MwL | MwD | MwU | MwR | | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | McL | McD | McU | McR | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | Mb1 | Mb2 | Mb3 | | | | Fn0 | + * `-----------------------------------------------------------------------------------------' + * | | | Mb1 | | | + * `-----------------------------------------------------------------' + */ + [MOUSE] = + KEYMAP(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_NO, KC_TRNS, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1,KC_BTN2,KC_BTN3,KC_NO, KC_NO, KC_TRNS,KC_FN0, \ + KC_TRNS,KC_TRNS, KC_BTN1, KC_TRNS,KC_TRNS), + + /* Layer 4: Tenkey layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | | | | | | | | | | / | * | - | | BSp | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | | 7 | 8 | 9 | + | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | | 4 | 5 | 6 | Enter | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | 1 | 2 | 3 | + | Fn0 | + * `-----------------------------------------------------------------------------------------' + * | | | SpaceFN | 0 | . | + * `-----------------------------------------------------------------' + */ + [TENKEY] = + KEYMAP(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSLS,KC_PAST,KC_PMNS,KC_NO, KC_BSPC, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_7,KC_KP_8,KC_KP_9,KC_PPLS,KC_NO, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_4,KC_KP_5,KC_KP_6,KC_PENT, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_1,KC_KP_2,KC_KP_3,KC_PPLS,KC_FN0, \ + KC_TRNS,KC_TRNS, KC_FN2, KC_KP_0,KC_PDOT), + + /* Layer 5: HHKB mode (HHKB Fn) + * ,-----------------------------------------------------------------------------------------. + * | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------| + * | Caps | Fn5 | Fn6 | Fn7 | Fn8 | Fn9 | | | Psc | Slk | Pus | Up | | BSp | + * |-----------------------------------------------------------------------------------------| + * | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | + | - | End | PgD | Dow | | | + * `-----------------------------------------------------------------------------------------' + * | | | | | | + * `-----------------------------------------------------------------' + */ + [HHKB] = + KEYMAP(KC_PWR, 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_DEL, \ + KC_CAPS,KC_FN5, KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_UP, KC_TRNS,KC_BSPC, \ + KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS), + + /* Layer 6: SpaceFN + * ,-----------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del | + * |-----------------------------------------------------------------------------------------| + * | | End | Up | Hom | | | | Hom | Up | End | Psc | Slk | Pau | Ins | + * |-----------------------------------------------------------------------------------------| + * | | Lef | Dow | Rig | PgU | | PgU | Lef | Dow | Rig | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | PgD | | Spc | PgD | ` | ~ | | | | | + * `-----------------------------------------------------------------------------------------' + * | | | | | | + * `-----------------------------------------------------------------' + */ + [SPACE_FN] = + KEYMAP(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_NO, KC_DEL, \ + KC_TRNS,KC_END, KC_UP, KC_HOME,KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_PSCR,KC_SLCK,KC_PAUS,KC_INS, \ + KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_PGUP,KC_NO, KC_PGUP,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS,KC_NO, KC_NO, KC_PGDN,KC_NO, KC_SPC, KC_PGDN,KC_GRV, KC_TILD,KC_NO, KC_NO, KC_TRNS,KC_NO, \ + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS), +}; + +/* + * user defined action function + */ +enum function_id { + PSEUDO_US_FUNCTION, +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + + switch (id) { + case PSEUDO_US_FUNCTION: + action_pseudo_lut(record, BASE, keymap_jis2us); + break; + } +} + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(HHKB), + [1] = ACTION_FUNCTION(PSEUDO_US_FUNCTION), + [2] = ACTION_LAYER_TAP_KEY(SPACE_FN, KC_SPACE), + [3] = ACTION_MODS_TAP_KEY(MOD_LALT, KC_MHEN), + [4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_KANA), + [5] = ACTION_DEFAULT_LAYER_SET(BASE), + [6] = ACTION_DEFAULT_LAYER_SET(PSEUDO_US), + [7] = ACTION_DEFAULT_LAYER_SET(MOUSE), + [8] = ACTION_DEFAULT_LAYER_SET(TENKEY), + [9] = ACTION_DEFAULT_LAYER_SET(DVORAK), +}; diff --git a/keyboards/hhkb/keymaps/shela/keymap_jis2us.h b/keyboards/hhkb/keymaps/shela/keymap_jis2us.h new file mode 100644 index 000000000..cf2bd4f0e --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/keymap_jis2us.h @@ -0,0 +1,32 @@ +#ifndef KEYMAP_JIS2US_H +#define KEYMAP_JIS2US_H + +/* keymap for convert from JIS to US */ +const uint16_t PROGMEM keymap_jis2us[][2] = { + [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ + + [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ + [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ + [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ + [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ + [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ + [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ + [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ + [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ + [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ + [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ + [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ + [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ + [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ + [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ + [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ + [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ + [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ + [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ + [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ + [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ + [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ + [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ +}; + +#endif diff --git a/keyboards/hhkb/keymaps/shela/readme.md b/keyboards/hhkb/keymaps/shela/readme.md new file mode 100644 index 000000000..5a06a8363 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/readme.md @@ -0,0 +1,14 @@ +# Shela's HHKB Layout + +Layer 0: US Layout +Layer 1: Pseudo US Layout +Layer 2: Dvorak Layout +Layer 3: Mouse +Layer 4: Tenkey +Layer 5: HHKB Fn Key +Layer 6: SpaceFN + +## Pseudo US Layout + +On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings. +But, you can use HHKB like a US layout keyboard as it is. diff --git a/keyboards/hhkb/readme.md b/keyboards/hhkb/readme.md index 39d49b32a..367c0a08f 100644 --- a/keyboards/hhkb/readme.md +++ b/keyboards/hhkb/readme.md @@ -168,13 +168,15 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` + Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/hhkb/rules.mk b/keyboards/hhkb/rules.mk new file mode 100644 index 000000000..b43b5e23f --- /dev/null +++ b/keyboards/hhkb/rules.mk @@ -0,0 +1,84 @@ + + +# project specific files +SRC = matrix.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +#OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# as per original hasu settings +OPT_DEFS += -DBOOTLOADER_SIZE=512 + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +CUSTOM_MATRIX ?= yes # Custom matrix file for the HHKB +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID + +ifneq (, $(findstring yes, $(HHKB_JP))) + OPT_DEFS += -DHHKB_JP +endif + +debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION +debug-on: all + +debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT +debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS)) +debug-off: all diff --git a/keyboards/infinity_ergodox/MEMO.txt b/keyboards/infinity60/MEMO.txt similarity index 100% rename from keyboards/infinity_ergodox/MEMO.txt rename to keyboards/infinity60/MEMO.txt diff --git a/keyboards/infinity60/Makefile b/keyboards/infinity60/Makefile new file mode 100644 index 000000000..4e2a6f00f --- /dev/null +++ b/keyboards/infinity60/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/infinity_ergodox/bootloader_defs.h b/keyboards/infinity60/bootloader_defs.h similarity index 100% rename from keyboards/infinity_ergodox/bootloader_defs.h rename to keyboards/infinity60/bootloader_defs.h diff --git a/keyboards/infinity_chibios/chconf.h b/keyboards/infinity60/chconf.h similarity index 96% rename from keyboards/infinity_chibios/chconf.h rename to keyboards/infinity60/chconf.h index b886c383b..43c845739 100644 --- a/keyboards/infinity_chibios/chconf.h +++ b/keyboards/infinity60/chconf.h @@ -1,524 +1,524 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 1000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 0 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 20 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/* Use __WFI in the idle thread for waiting. Does lower the power - * consumption. */ -#define CORTEX_ENABLE_WFI_IDLE TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 1000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/infinity_chibios/config.h b/keyboards/infinity60/config.h similarity index 81% rename from keyboards/infinity_chibios/config.h rename to keyboards/infinity60/config.h index cb9022205..f8346fe16 100644 --- a/keyboards/infinity_chibios/config.h +++ b/keyboards/infinity60/config.h @@ -18,6 +18,7 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H +#define PREVENT_STUCK_MODIFIERS /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -25,11 +26,10 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 /* in python2: list(u"whatever".encode('utf-16-le')) */ /* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "TMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' -#define PRODUCT "Infinity keyboard/TMK" -#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00' - +#define MANUFACTURER "Input Club" +#define USBSTR_MANUFACTURER 'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00' +#define PRODUCT "Infinity keyboard/QMK" +#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00' /* key matrix size */ #define MATRIX_ROWS 9 #define MATRIX_COLS 7 @@ -50,9 +50,11 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* Keymap for Infiity prototype */ -#define INFINITY_PROTOTYPE +/* Keymap for Infinity prototype */ +//#define INFINITY_PROTOTYPE +/* Keymap for Infinity 1.1a (first revision with LED support) */ +//#define INFINITY_LED /* * Feature disable options diff --git a/keyboards/infinity_chibios/halconf.h b/keyboards/infinity60/halconf.h similarity index 96% rename from keyboards/infinity_chibios/halconf.h rename to keyboards/infinity60/halconf.h index 53538de14..46b37a4f4 100644 --- a/keyboards/infinity_chibios/halconf.h +++ b/keyboards/infinity60/halconf.h @@ -1,353 +1,353 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/infinity_chibios/infinity_chibios.c b/keyboards/infinity60/infinity60.c similarity index 95% rename from keyboards/infinity_chibios/infinity_chibios.c rename to keyboards/infinity60/infinity60.c index 845eda01b..e471250fe 100644 --- a/keyboards/infinity_chibios/infinity_chibios.c +++ b/keyboards/infinity60/infinity60.c @@ -14,4 +14,4 @@ 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 "infinity_chibios.h" +#include "infinity60.h" diff --git a/keyboards/infinity_chibios/infinity_chibios.h b/keyboards/infinity60/infinity60.h similarity index 53% rename from keyboards/infinity_chibios/infinity_chibios.h rename to keyboards/infinity60/infinity60.h index a44c68b82..f1ba15e48 100644 --- a/keyboards/infinity_chibios/infinity_chibios.h +++ b/keyboards/infinity60/infinity60.h @@ -29,15 +29,15 @@ along with this program. If not, see . K54, K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, \ K06, K16, K26, K36, K46, K56, K66, K76 \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26 }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46 }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56 }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66 }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76 }, \ - { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86 } \ + { K00, K01, K02, K03, K04, K05, K06 }, \ + { K10, K11, K12, K13, K14, K15, K16 }, \ + { K20, K21, K22, K23, K24, K25, K26 }, \ + { K30, K31, K32, K33, K34, K35, K36 }, \ + { K40, K41, K42, K43, K44, K45, K46 }, \ + { K50, K51, K52, K53, K54, K55, K56 }, \ + { K60, K61, K62, K63, K64, K65, K66 }, \ + { K70, K71, K72, K73, K74, K75, K76 }, \ + { K80, K81, K82, K83, K84, K85, K86 } \ } #else @@ -50,15 +50,15 @@ along with this program. If not, see . K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, K06, \ K16, K26, K36, K46, K56, K66, K76, K86 \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26 }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46 }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56 }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66 }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76 }, \ - { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86 } \ + { K00, K01, K02, K03, K04, K05, K06 }, \ + { K10, K11, K12, K13, K14, K15, K16 }, \ + { K20, K21, K22, K23, K24, K25, K26 }, \ + { K30, K31, K32, K33, K34, K35, K36 }, \ + { K40, K41, K42, K43, K44, K45, K46 }, \ + { K50, K51, K52, K53, K54, K55, K56 }, \ + { K60, K61, K62, K63, K64, K65, K66 }, \ + { K70, K71, K72, K73, K74, K75, K76 }, \ + { K80, K81, K82, K83, K84, K85, K86 } \ } #endif diff --git a/keyboards/infinity_chibios/keymaps/default/keymap.c b/keyboards/infinity60/keymaps/default/keymap.c similarity index 57% rename from keyboards/infinity_chibios/keymaps/default/keymap.c rename to keyboards/infinity60/keymaps/default/keymap.c index 2acf72849..443412857 100644 --- a/keyboards/infinity_chibios/keymaps/default/keymap.c +++ b/keyboards/infinity60/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "infinity_chibios.h" +#include "infinity60.h" const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer @@ -14,12 +14,12 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,FN0, \ - NO, LGUI,LALT, SPC, RALT,RGUI,NO, NO), + [0] = KEYMAP( + 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_GRV, \ + 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_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_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,MO(1), \ + KC_NO, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_NO, KC_NO), /* Layer 1: HHKB mode (HHKB Fn) * ,-----------------------------------------------------------. @@ -34,15 +34,15 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = - KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC, \ - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), + [1] = KEYMAP( + KC_PWR, 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_DEL, \ + KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ + KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), }; const uint16_t fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), + }; diff --git a/keyboards/infinity60/keymaps/depariel/keymap.c b/keyboards/infinity60/keymaps/depariel/keymap.c new file mode 100755 index 000000000..7412b9b9d --- /dev/null +++ b/keyboards/infinity60/keymaps/depariel/keymap.c @@ -0,0 +1,82 @@ +#include "infinity60.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bksp| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| + * |-----------------------------------------------------------' + * |Fn2 |Gui |Alt | Space |RAlt|Prv|PlPs|Next| + * `-----------------------------------------------------------' + */ + [0] = KEYMAP( + 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_GRV, \ + 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_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, LT(5, KC_ENT), \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(4), \ + MO(4), KC_LGUI, KC_LALT, LT(3, KC_SPC), KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT), + + /* Layer 1: "Toggle" off SpaceFn for League of Legends + */ + [1] = KEYMAP( + 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_GRV, \ + 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_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_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, MO(4), \ + MO(4), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT), + + /* Layer 2: "Toggle" off SpaceFn for MapleRoyals + */ + [2] = KEYMAP( + 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_GRV, \ + 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_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_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_LSFT, \ + MO(4), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Layer 3: FN layer 1 + */ + [3] = KEYMAP( + KC_NO, 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_NO, KC_NO, \ + KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, LALT(KC_F4), KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_UP, KC_NO, KC_LPRN, KC_RPRN, KC_DEL, \ + MO(6), KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_END, KC_PGDN, KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, \ + LGUI(KC_SPC), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_CALC, KC_MENU, KC_TRNS, TG(4), \ + KC_TRNS, KC_TRNS, KC_TRNS, LT(3, KC_SPC), KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU), + + /* Layer 4: FN layer 2 + */ + [4] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_PSLS, TG(2), \ + KC_CAPS, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_NO, KC_P7, KC_P8, KC_P9, KC_PAST, KC_BSPC, \ + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_RSFT, MO(4), \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_PDOT, KC_NO, TG(1)), + + /* Layer 5: FN layer 3 + */ + [5] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TAB , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F13, KC_F14, KC_F15, KC_F16, KC_NO, KC_TRNS, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F17, KC_F18, KC_F19, KC_F20, LT(5, KC_ENT), \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F21, KC_F22, KC_F23, KC_F24, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_NO, KC_NO, KC_NO), + + /* Layer 6: FN layer 4 + */ + [6] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + LCTL(LSFT(KC_TAB)), KC_NO, LGUI(KC_UP), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + MO(6), LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_RGHT), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + diff --git a/keyboards/infinity60/keymaps/hasu/keymap.c b/keyboards/infinity60/keymaps/hasu/keymap.c new file mode 100644 index 000000000..d3728869a --- /dev/null +++ b/keyboards/infinity60/keymaps/hasu/keymap.c @@ -0,0 +1,113 @@ +#include "infinity60.h" + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| + * |-----------------------------------------------------------' + * | |Gui|Alt | Space |Alt |Gui| | | + * `-----------------------------------------------------------' + */ + [0] = KEYMAP( + 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_GRV, \ + 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_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \ + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, LT(2, KC_SLSH), KC_RSFT,TG(1), \ + KC_NO, KC_LGUI,KC_LALT, LT(4, KC_SPC), MO(4), KC_RGUI,KC_NO, KC_NO), + + /* Layer 1: HHKB mode (HHKB Fn) + * ,-----------------------------------------------------------. + * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| + * |-----------------------------------------------------------| + * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs| + * |-----------------------------------------------------------| + * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | + * |-----------------------------------------------------------| + * | | | | | | | +| -|End|PgD|Dow| | | + * `-----------------------------------------------------------' + * | |Gui|Alt | Space |Alt |Gui| | | + * `-----------------------------------------------------------' + */ + [1] = KEYMAP( + KC_PWR, 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_DEL, \ + KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS,KC_BSPC, \ + KC_LCTL,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_ENT, \ + KC_LSFT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_RSFT,KC_TRNS, \ + KC_TRNS,KC_LGUI,KC_LALT, KC_TRNS, KC_RALT,KC_RGUI,KC_TRNS,KC_TRNS), + + /* Layer 2: Vi mode[Slash] + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| + * |-----------------------------------------------------------| + * |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd| | | |Backs| + * |-----------------------------------------------------------| + * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return | + * |-----------------------------------------------------------| + * |Shift | | | | | |Hom|PgD|PgUlEnd|Fn0|Shift | | + * `-----------------------------------------------------------' + * |Gui|Alt | Space |Alt |Gui| + * `-------------------------------------------' + */ + [2] = KEYMAP( + 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_INS, KC_DEL, \ + KC_TAB, KC_HOME,KC_PGDN,KC_UP, KC_PGUP,KC_END, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_NO, KC_NO, KC_NO, KC_BSPC, \ + KC_LCTL,KC_NO, KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_NO, KC_NO, KC_ENT, \ + KC_LSFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME,KC_PGDN,KC_PGUP,KC_END, LT(2, KC_SLSH), KC_RSFT,KC_TRNS, \ + KC_TRNS,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_TRNS, KC_TRNS), + + /* Layer 3: Mouse mode(IJKL)[Semicolon] + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| + * |-----------------------------------------------------------| + * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| + * |-----------------------------------------------------------| + * |Contro| | | | | |Mb2|McL|McD|McR|Fn | |Return | + * |-----------------------------------------------------------| + * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | + * `-----------------------------------------------------------' + * |Gui |Alt | Mb1 |Fn |Fn | + * `--------------------------------------------' + * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel + */ + [3] = KEYMAP( + 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_INS, KC_DEL, \ + LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R, ALT_T(KC_LEFT), ALT_T(KC_RGHT),LALT(KC_TAB), \ + KC_LCTL, KC_ACL0,KC_ACL1,KC_ACL2,KC_ACL2,KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, LT(3, KC_SCLN), KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT), ALT_T(KC_RGHT), KC_NO, KC_RSFT, KC_TRNS, \ + KC_TRNS, KC_LGUI,KC_LALT, KC_BTN1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + /* Layer 4: Mouse mode(IJKL)[Space] + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| + * |-----------------------------------------------------------| + * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| + * |-----------------------------------------------------------| + * |Contro| | | | | |Mb2|McL|McD|McR|Mb1| |Return | + * |-----------------------------------------------------------| + * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | + * `-----------------------------------------------------------' + * |Gui |Alt | Mb1 |Fn |Fn | + * `--------------------------------------------' + * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel + */ + [4] = KEYMAP( + 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_INS, KC_DEL, \ + LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R,KC_BTN4,KC_BTN5,LALT(KC_TAB), \ + KC_LCTL, KC_VOLD,KC_VOLU,KC_MUTE,KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, KC_BTN1,KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT),ALT_T(KC_RGHT),KC_NO, KC_RSFT,KC_TRNS, \ + KC_TRNS, KC_LGUI,KC_LALT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS), + +}; + +/* + * Fn action definition + */ +const uint16_t fn_actions[] = { + +}; diff --git a/keyboards/infinity_chibios/led.c b/keyboards/infinity60/led.c similarity index 100% rename from keyboards/infinity_chibios/led.c rename to keyboards/infinity60/led.c diff --git a/keyboards/infinity_chibios/matrix.c b/keyboards/infinity60/matrix.c similarity index 67% rename from keyboards/infinity_chibios/matrix.c rename to keyboards/infinity60/matrix.c index 2c68ea83a..62c165aa5 100644 --- a/keyboards/infinity_chibios/matrix.c +++ b/keyboards/infinity60/matrix.c @@ -12,9 +12,12 @@ * Infinity Pinusage: * Column pins are input with internal pull-down. Row pins are output and strobe with high. * Key is high or 1 when it turns on. - * + * INFINITY PRODUCTION (NO LED) * col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 } * row: { PTB0, PTB1, PTB2, PTB3, PTB16, PTB17, PTC4, PTC5, PTD0 } + * INFINITY PRODUCTION (WITH LED) + * col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 } + * row: { PTC0, PTC1, PTC2, PTC3, PTC4, PTC5, PTC6, PTC7, PTD0 } */ /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -34,6 +37,18 @@ void matrix_init(void) palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN); +#ifdef INFINITY_LED + /* Row(strobe) */ + palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 4, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); +#else /* Row(strobe) */ palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); @@ -44,7 +59,7 @@ void matrix_init(void) palSetPadMode(GPIOC, 4, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); - +#endif memset(matrix, 0, MATRIX_ROWS); memset(matrix_debouncing, 0, MATRIX_ROWS); } @@ -53,7 +68,20 @@ uint8_t matrix_scan(void) { for (int row = 0; row < MATRIX_ROWS; row++) { matrix_row_t data = 0; - + #ifdef INFINITY_LED + // strobe row + switch (row) { + case 0: palSetPad(GPIOC, 0); break; + case 1: palSetPad(GPIOC, 1); break; + case 2: palSetPad(GPIOC, 2); break; + case 3: palSetPad(GPIOC, 3); break; + case 4: palSetPad(GPIOC, 4); break; + case 5: palSetPad(GPIOC, 5); break; + case 6: palSetPad(GPIOC, 6); break; + case 7: palSetPad(GPIOC, 7); break; + case 8: palSetPad(GPIOD, 0); break; + } + #else // strobe row switch (row) { case 0: palSetPad(GPIOB, 0); break; @@ -66,12 +94,26 @@ uint8_t matrix_scan(void) case 7: palSetPad(GPIOC, 5); break; case 8: palSetPad(GPIOD, 0); break; } + #endif wait_us(1); // need wait to settle pin state // read col data data = (palReadPort(GPIOD)>>1); - + #ifdef INFINITY_LED + // un-strobe row + switch (row) { + case 0: palClearPad(GPIOC, 0); break; + case 1: palClearPad(GPIOC, 1); break; + case 2: palClearPad(GPIOC, 2); break; + case 3: palClearPad(GPIOC, 3); break; + case 4: palClearPad(GPIOC, 4); break; + case 5: palClearPad(GPIOC, 5); break; + case 6: palClearPad(GPIOC, 6); break; + case 7: palClearPad(GPIOC, 7); break; + case 8: palClearPad(GPIOD, 0); break; + } + #else // un-strobe row switch (row) { case 0: palClearPad(GPIOB, 0); break; @@ -84,6 +126,7 @@ uint8_t matrix_scan(void) case 7: palClearPad(GPIOC, 5); break; case 8: palClearPad(GPIOD, 0); break; } + #endif if (matrix_debouncing[row] != data) { matrix_debouncing[row] = data; diff --git a/keyboards/infinity_chibios/mcuconf.h b/keyboards/infinity60/mcuconf.h similarity index 97% rename from keyboards/infinity_chibios/mcuconf.h rename to keyboards/infinity60/mcuconf.h index 66b6ce25d..f453304b7 100644 --- a/keyboards/infinity_chibios/mcuconf.h +++ b/keyboards/infinity60/mcuconf.h @@ -1,55 +1,55 @@ -/* - ChibiOS - Copyright (C) 2006..2015 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. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -#define K20x_MCUCONF - -/* - * HAL driver system settings. - */ - -/* Select the MCU clocking mode below by enabling the appropriate block. */ - -#define KINETIS_NO_INIT FALSE - -/* FEI mode - 48 MHz with internal 32.768 kHz crystal */ -#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI -#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ -#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ -#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ -#define KINETIS_CLKDIV1_OUTDIV1 1 -#define KINETIS_CLKDIV1_OUTDIV2 1 -#define KINETIS_CLKDIV1_OUTDIV4 2 -#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY -#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2 - -/* - * SERIAL driver system settings. - */ -#define KINETIS_SERIAL_USE_UART0 TRUE - -/* - * USB driver settings - */ -#define KINETIS_USB_USE_USB0 TRUE -/* Need to redefine this, since the default is for K20x */ -/* This is for Teensy LC; you should comment it out (or change to 5) - * for Teensy 3.x */ -#define KINETIS_USB_USB0_IRQ_PRIORITY 2 - -#endif /* _MCUCONF_H_ */ +/* + ChibiOS - Copyright (C) 2006..2015 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. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +#define K20x_MCUCONF + +/* + * HAL driver system settings. + */ + +/* Select the MCU clocking mode below by enabling the appropriate block. */ + +#define KINETIS_NO_INIT FALSE + +/* FEI mode - 48 MHz with internal 32.768 kHz crystal */ +#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI +#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ +#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ +#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ +#define KINETIS_CLKDIV1_OUTDIV1 1 +#define KINETIS_CLKDIV1_OUTDIV2 1 +#define KINETIS_CLKDIV1_OUTDIV4 2 +#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY +#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2 + +/* + * SERIAL driver system settings. + */ +#define KINETIS_SERIAL_USE_UART0 TRUE + +/* + * USB driver settings + */ +#define KINETIS_USB_USE_USB0 TRUE +/* Need to redefine this, since the default is for K20x */ +/* This is for Teensy LC; you should comment it out (or change to 5) + * for Teensy 3.x */ +#define KINETIS_USB_USB0_IRQ_PRIORITY 2 + +#endif /* _MCUCONF_H_ */ diff --git a/keyboards/infinity60/readme.md b/keyboards/infinity60/readme.md new file mode 100644 index 000000000..97457b407 --- /dev/null +++ b/keyboards/infinity60/readme.md @@ -0,0 +1,29 @@ +Infinity 60% keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme](/). + +## Keymaps + +Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` + + +## Compiling + +Download or clone the whole firmware and navigate to the keyboards/infinity60 folder. Once your dev env is setup, you'll be able to use the `make` command to both compile your keymap and flash it to your keyboard. + +To just compile, which generates the output files in the `.build` folder at the root of the repository, run `make keymap`, where keymap is the name of the keymap that you want to compile. + +## Flashing + +To flash the firmware to the keyboard + +1. First press the flash button on the bottom of the keyboard. If you already have a flah button mapped in a keyboard layout running on the keyboard, you can also use that. +2. Then run `make keymap-dfu-util`, where keymap is the name of the keymap you want to flash. On Linux based operating systems you might need to run the comamnd as root, for example `sudo make keymap-dfu-util` on Ubuntu. + +**Tip** `make keymap-dfu-util` will also compile the keymap if needed, so you can skip the compilation step if you want to. + diff --git a/keyboards/infinity_chibios/Makefile b/keyboards/infinity60/rules.mk similarity index 95% rename from keyboards/infinity_chibios/Makefile rename to keyboards/infinity60/rules.mk index 649b43e64..56d6470b5 100644 --- a/keyboards/infinity_chibios/Makefile +++ b/keyboards/infinity60/rules.mk @@ -63,8 +63,4 @@ CONSOLE_ENABLE ?= yes # Console for debug COMMAND_ENABLE ?= yes # Commands for debug and configuration SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend NKRO_ENABLE ?= yes # USB Nkey Rollover -CUSTOM_MATRIX ?= yes # Custom matrix file - -ifndef QUANTUM_DIR - include ../../Makefile -endif \ No newline at end of file +CUSTOM_MATRIX ?= yes # Custom matrix file \ No newline at end of file diff --git a/keyboards/infinity_chibios/keymaps/hasu/keymap.c b/keyboards/infinity_chibios/keymaps/hasu/keymap.c deleted file mode 100644 index e9a212f0e..000000000 --- a/keyboards/infinity_chibios/keymaps/hasu/keymap.c +++ /dev/null @@ -1,199 +0,0 @@ -#include "infinity_chibios.h" - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| - * |-----------------------------------------------------------' - * | |Gui|Alt | Space |Alt |Gui| | | - * `-----------------------------------------------------------' - */ - [0] = - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,FN6, \ - FN7, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ - NO, LGUI,LALT, FN4, FN5, RGUI,NO, NO), - - /* Layer 1: HHKB mode (HHKB Fn) - * ,-----------------------------------------------------------. - * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs| - * |-----------------------------------------------------------| - * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * | | | | | | | +| -|End|PgD|Dow| | | - * `-----------------------------------------------------------' - * | |Gui|Alt | Space |Alt |Gui| | | - * `-----------------------------------------------------------' - */ - [1] = - KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS,BSPC, \ - LCTL,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, \ - LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,RSFT,TRNS, \ - TRNS,LGUI,LALT, TRNS, RALT,RGUI,TRNS,TRNS), - - /* Layer 2: Vi mode[Slash] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd| | | |Backs| - * |-----------------------------------------------------------| - * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | | |Hom|PgD|PgUlEnd|Fn0|Shift | | - * `-----------------------------------------------------------' - * |Gui|Alt | Space |Alt |Gui| - * `-------------------------------------------' - */ - [2] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, \ - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT,TRNS, \ - TRNS,LGUI,LALT, SPC, RALT,RGUI,TRNS,TRNS), - - /* Layer 3: Mouse mode(IJKL)[Semicolon] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Fn | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Fn |Fn | - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - [3] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,FN9, FN10,FN8, \ - LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,FN3, NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,TRNS, \ - TRNS,LGUI,LALT, BTN1, TRNS,TRNS,TRNS,TRNS), - - /* Layer 4: Mouse mode(IJKL)[Space] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Mb1| |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Fn |Fn | - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - [4] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5,FN8, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,TRNS, \ - TRNS,LGUI,LALT, TRNS, TRNS,TRNS,TRNS,TRNS), - -}; - -/* id for user defined functions */ -enum function_id { - LSHIFT_LPAREN, -}; - -enum macro_id { - HELLO, - VOLUP, - ALT_TAB, -}; - -/* - * Fn action definition - */ -const uint16_t fn_actions[] = { - [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) - [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) - [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* - [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN), // Mousekey layer with Semicolon* - [4] = ACTION_LAYER_TAP_KEY(4, KC_SPC), // Mousekey layer with Space - [5] = ACTION_LAYER_MOMENTARY(4), // Mousekey layer(IJKL) - [6] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT), // RControl with tap Enter - [7] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift - [8] = ACTION_MACRO(ALT_TAB), // Application switching - [9] = ACTION_MODS_KEY(MOD_LALT, KC_LEFT), - [10] = ACTION_MODS_KEY(MOD_LALT, KC_RIGHT), -}; - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case HELLO: - return (record->event.pressed ? - MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) : - MACRO_NONE ); - case VOLUP: - return (record->event.pressed ? - MACRO( D(VOLU), U(VOLU), END ) : - MACRO_NONE ); - case ALT_TAB: - return (record->event.pressed ? - MACRO( D(LALT), D(TAB), END ) : - MACRO( U(TAB), END )); - } - return MACRO_NONE; -} - - - -/* - * user defined action function - */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (record->event.pressed) dprint("P"); else dprint("R"); - dprintf("%d", record->tap.count); - if (record->tap.interrupted) dprint("i"); - dprint("\n"); - - switch (id) { - case LSHIFT_LPAREN: - // Shift parentheses example: LShft + tap '(' - // http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses - // http://geekhack.org/index.php?topic=41989.msg1304899#msg1304899 - if (record->event.pressed) { - if (record->tap.count > 0 && !record->tap.interrupted) { - if (record->tap.interrupted) { - dprint("tap interrupted\n"); - register_mods(MOD_BIT(KC_LSHIFT)); - } - } else { - register_mods(MOD_BIT(KC_LSHIFT)); - } - } else { - if (record->tap.count > 0 && !(record->tap.interrupted)) { - add_weak_mods(MOD_BIT(KC_LSHIFT)); - send_keyboard_report(); - register_code(KC_9); - unregister_code(KC_9); - del_weak_mods(MOD_BIT(KC_LSHIFT)); - send_keyboard_report(); - record->tap.count = 0; // ad hoc: cancel tap - } else { - unregister_mods(MOD_BIT(KC_LSHIFT)); - } - } - break; - } -} diff --git a/keyboards/infinity_ergodox/infinity_ergodox.h b/keyboards/infinity_ergodox/infinity_ergodox.h deleted file mode 100644 index de7267594..000000000 --- a/keyboards/infinity_ergodox/infinity_ergodox.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ -#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ - -#include "quantum.h" - -#define KEYMAP( \ - A80, A70, A60, A50, A40, A30, A20, \ - A81, A71, A61, A51, A41, A31, A21, \ - A82, A72, A62, A52, A42, A32, \ - A83, A73, A63, A53, A43, A33, A23, \ - A84, A74, A64, A54, A44, \ - A13, A03, \ - A04, \ - A34, A24, A14, \ - B20, B30, B40, B50, B60, B70, B80, \ - B21, B31, B41, B51, B61, B71, B81, \ - B32, B42, B52, B62, B72, B82, \ - B23, B33, B43, B53, B63, B73, B83, \ - B44, B54, B64, B74, B84, \ - B03, B13, \ - B04, \ - B14, B24, B34 \ -) { \ - { KC_NO, KC_NO, KC_NO, KC_##A03, KC_##A04 }, \ - { KC_NO, KC_NO, KC_NO, KC_##A13, KC_##A14 }, \ - { KC_##A20, KC_##A21, KC_NO, KC_##A23, KC_##A24 }, \ - { KC_##A30, KC_##A31, KC_##A32, KC_##A33, KC_##A34 }, \ - { KC_##A40, KC_##A41, KC_##A42, KC_##A43, KC_##A44 }, \ - { KC_##A50, KC_##A51, KC_##A52, KC_##A53, KC_##A54 }, \ - { KC_##A60, KC_##A61, KC_##A62, KC_##A63, KC_##A64 }, \ - { KC_##A70, KC_##A71, KC_##A72, KC_##A73, KC_##A74 }, \ - { KC_##A80, KC_##A81, KC_##A82, KC_##A83, KC_##A84 }, \ - { KC_NO, KC_NO, KC_NO, KC_##B03, KC_##B04 }, \ - { KC_NO, KC_NO, KC_NO, KC_##B13, KC_##B14 }, \ - { KC_##B20, KC_##B21, KC_NO, KC_##B23, KC_##B24 }, \ - { KC_##B30, KC_##B31, KC_##B32, KC_##B33, KC_##B34 }, \ - { KC_##B40, KC_##B41, KC_##B42, KC_##B43, KC_##B44 }, \ - { KC_##B50, KC_##B51, KC_##B52, KC_##B53, KC_##B54 }, \ - { KC_##B60, KC_##B61, KC_##B62, KC_##B63, KC_##B64 }, \ - { KC_##B70, KC_##B71, KC_##B72, KC_##B73, KC_##B74 }, \ - { KC_##B80, KC_##B81, KC_##B82, KC_##B83, KC_##B84 } \ -} - -#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */ diff --git a/keyboards/infinity_ergodox/keymaps/default/keymap.c b/keyboards/infinity_ergodox/keymaps/default/keymap.c deleted file mode 100644 index f1e6b1c8a..000000000 --- a/keyboards/infinity_ergodox/keymaps/default/keymap.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2016 Fred Sundvik -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 "infinity_ergodox.h" - -// Workaround for old keymap format -#define KC_RESET RESET - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP( // layer 0 : default - // left hand - EQL, 1, 2, 3, 4, 5, ESC, - BSLS,Q, W, E, R, T, FN1, - TAB, A, S, D, F, G, - LSFT,Z, X, C, V, B, FN0, - LGUI,GRV, BSLS,LEFT,RGHT, - LCTL,LALT, - HOME, - BSPC,DEL, END, - // right hand - FN2, 6, 7, 8, 9, 0, MINS, - LBRC,Y, U, I, O, P, RBRC, - H, J, K, L, SCLN,QUOT, - FN0, N, M, COMM,DOT, SLSH,RSFT, - LEFT,DOWN,UP, RGHT,RGUI, - RALT,RCTL, - PGUP, - PGDN,ENT, SPC - ), - - KEYMAP( // layer 1 : function and symbol keys - // left hand - TRNS,F1, F2, F3, F4, F5, F11, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - F12, F6, F7, F8, F9, F10, TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), - - KEYMAP( // layer 2 : keyboard functions - // left hand - RESET,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), - - KEYMAP( // layer 3: numpad - // left hand - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, - TRNS,NO, P7, P8, P9, PMNS,BSPC, - NO, P4, P5, P6, PPLS,PENT, - TRNS,NO, P1, P2, P3, PPLS,PENT, - P0, PDOT,SLSH,PENT,PENT, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), -}; -const uint16_t fn_actions[] = { - ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1 - ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2 - ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer - ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0 -}; diff --git a/keyboards/infinity_ergodox/keymaps/default/visualizer.c b/keyboards/infinity_ergodox/keymaps/default/visualizer.c deleted file mode 100644 index c0d335ce6..000000000 --- a/keyboards/infinity_ergodox/keymaps/default/visualizer.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2016 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 . -*/ - -// Currently we are assuming that both the backlight and LCD are enabled -// But it's entirely possible to write a custom visualizer that use only -// one of them -#ifndef LCD_BACKLIGHT_ENABLE -#error This visualizer needs that LCD backlight is enabled -#endif - -#ifndef LCD_ENABLE -#error This visualizer needs that LCD is enabled -#endif - -#include "visualizer.h" -#include "led_test.h" - -static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; - -// Just an example how to write custom keyframe functions, we could have moved -// all this into the init function -bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { - (void)animation; - // Read the uGFX documentation for information how to use the displays - // http://wiki.ugfx.org/index.php/Main_Page - gdispClear(White); - // You can use static variables for things that can't be found in the animation - // or state structs - gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); - gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); - // Always remember to flush the display - gdispFlush(); - // you could set the backlight color as well, but we won't do it here, since - // it's part of the following animation - // lcd_backlight_color(hue, saturation, intensity); - // We don't need constant updates, just drawing the screen once is enough - return false; -} - -// Feel free to modify the animations below, or even add new ones if needed - -// Don't worry, if the startup animation is long, you can use the keyboard like normal -// during that time -static keyframe_animation_t startup_animation = { - .num_frames = 4, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization - }, -}; - -// The color animation animates the LCD color when you change layers -static keyframe_animation_t color_animation = { - .num_frames = 2, - .loop = false, - // Note that there's a 200 ms no-operation frame, - // this prevents the color from changing when activating the layer - // momentarily - .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, - .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, -}; - -// The LCD animation alternates between the layer name display and a -// bitmap that displays all active layers -static keyframe_animation_t lcd_animation = { - .num_frames = 2, - .loop = true, - .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, - .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, -}; - -static keyframe_animation_t suspend_animation = { - .num_frames = 3, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, - .frame_functions = { - keyframe_display_layer_text, - keyframe_animate_backlight_color, - keyframe_disable_lcd_and_backlight, - }, -}; - -static keyframe_animation_t resume_animation = { - .num_frames = 5, - .loop = false, - .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - keyframe_enable_lcd_and_backlight, - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization, - }, -}; - -void initialize_user_visualizer(visualizer_state_t* state) { - // The brightness will be dynamically adjustable in the future - // But for now, change it here. - lcd_backlight_brightness(0x50); - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&startup_animation); - start_keyframe_animation(&led_test_animation); -} - -void update_user_visualizer_state(visualizer_state_t* state) { - // Add more tests, change the colors and layer texts here - // Usually you want to check the high bits (higher layers first) - // because that's the order layers are processed for keypresses - // You can for check for example: - // state->status.layer - // state->status.default_layer - // state->status.leds (see led.h for available statuses) - if (state->status.layer & 0x8) { - state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); - state->layer_text = "Numpad"; - } - else if (state->status.layer & 0x4) { - state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); - state->layer_text = "KBD functions"; - } - else if (state->status.layer & 0x2) { - state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); - state->layer_text = "Function keys"; - } - else { - state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); - state->layer_text = "Default"; - } - // You can also stop existing animations, and start your custom ones here - // remember that you should normally have only one animation for the LCD - // and one for the background. But you can also combine them if you want. - start_keyframe_animation(&lcd_animation); - start_keyframe_animation(&color_animation); -} - -void user_visualizer_suspend(visualizer_state_t* state) { - state->layer_text = "Suspending..."; - uint8_t hue = LCD_HUE(state->current_lcd_color); - uint8_t sat = LCD_SAT(state->current_lcd_color); - state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); -} - -void user_visualizer_resume(visualizer_state_t* state) { - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&resume_animation); - start_keyframe_animation(&led_test_animation); -} diff --git a/keyboards/jd45/Makefile b/keyboards/jd45/Makefile index 75d544f16..4e2a6f00f 100644 --- a/keyboards/jd45/Makefile +++ b/keyboards/jd45/Makefile @@ -1,71 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -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 ?= yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/jd45/keymaps/jeebak/config.h b/keyboards/jd45/keymaps/jeebak/config.h new file mode 100644 index 000000000..53a1f0a30 --- /dev/null +++ b/keyboards/jd45/keymaps/jeebak/config.h @@ -0,0 +1,16 @@ +#include "../../config.h" + +/** + *JD45 keymap definition macro + */ +#define KEYMAP_JD45( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ + K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ + K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ + K38, K39, K40, K41, K42, K43, K44, K45, K46, K47 \ +) { \ + { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13 }, \ + { K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, KC_NO }, \ + { K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, KC_NO }, \ + { K38, K39, K40, K41, K42, KC_NO, K43, KC_NO, K44, K45, K46, K47, KC_NO } \ +} diff --git a/keyboards/jd45/keymaps/jeebak/keymap.c b/keyboards/jd45/keymaps/jeebak/keymap.c new file mode 100644 index 000000000..8d26cbde1 --- /dev/null +++ b/keyboards/jd45/keymaps/jeebak/keymap.c @@ -0,0 +1,423 @@ +#include "jd45.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _TOUCHCURSOR 6 +#define _MOUSECURSOR 7 +#define _ADJUST 16 + +// Keycodes +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +enum macro_keycodes { + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, + KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper +#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI +#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab +#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab +#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings +#define AG_AGAIN M(KC_AG_AGAIN) +#define AG_UNDO M(KC_AG_UNDO) +#define AG_CUT M(KC_AG_CUT) +#define AG_COPY M(KC_AG_COPY) +#define AG_PASTE M(KC_AG_PASTE) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed + +/* Qwerty + * + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QWERTY] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_BSPC, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + CTL_ESC , KC_A, KC_S,LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_RGUI , KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLD , KC_VOLU , KC_MPLY), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Colemak + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | Z | X | C | V | B | K | M | , | . | / | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ +[_COLEMAK] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_BSPC, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + CTL_ESC , KC_A, KC_R,LT_MC(KC_S), KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_RGUI , KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLD , KC_VOLU , KC_MPLY), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Dvorak + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * |Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ +[_DVORAK] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_BSPC, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + CTL_ESC , KC_A, KC_O,LT_MC(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_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_RGUI , KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLD , KC_VOLU , KC_MPLY), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Lower + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Brite | | | | | | | Prev | Next | Mute | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ +[_LOWER] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_BSPC, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + KC_LBRC , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_RBRC , KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Raise + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Brite | | | | | | | Prev | Next | Mute | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ +[_RAISE] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | | | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. + */ + +[_TOUCHCURSOR] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, _______, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______ ,KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,AG_UNDO, AG_CUT, AG_COPY,AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R,CMD_SLSH, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, _______), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Mouse Layer + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | | | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ + +[_MOUSECURSOR] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______, _______, +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______ ,KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5 , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Plover layer (http://opensteno.org) + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * | # | # | # | # | # | # | # | # | # | # | # | # | # | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | TogOut | S | K | W | R | * | * | R | B | G | S | Z | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Exit | | A | O | | | E | U | | | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ + +[_PLOVER] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_1 , KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + XXXXXXX , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + XXXXXXX , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + EXT_PLV , XXXXXXX, KC_C, KC_V, XXXXXXX , XXXXXXX , KC_N, KC_M, XXXXXXX, XXXXXXX), +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + +/* Adjust (Lower + Raise) + * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + * | | | | | | | | | | | | | Del | + * |---------`------`------`------`------`------`------`------`------`------`------`------`------| + * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | | | | | | | | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | | Reset | + * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' + */ +[_ADJUST] = KEYMAP_JD45( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, RESET) +/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + default_layer_set(1UL<<_DVORAK); + } + 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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: + // quantum/quantum.c + if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. + } + + switch (id) { + case KC_ALT_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + case KC_CMD_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + + case KC_CTL_TAB: + return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + + case KC_AG_FIND: + return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); + case KC_AG_AGAIN: + return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); + case KC_AG_UNDO: + return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); + case KC_AG_CUT: + return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); + case KC_AG_COPY: + return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); + case KC_AG_PASTE: + return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); + + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); + } + + return MACRO_NONE; +} diff --git a/keyboards/jd45/keymaps/jeebak/readme.md b/keyboards/jd45/keymaps/jeebak/readme.md new file mode 100644 index 000000000..2e45a46d9 --- /dev/null +++ b/keyboards/jd45/keymaps/jeebak/readme.md @@ -0,0 +1,129 @@ +jeebak's JD45 layout +======================= +NOTE: This is a port of jeebak's planck layout, for jd45. + +This WIP keymap attempts to minimize fingers straying away from the home row. +To aid in this endeavor, when additional modifyer keys to switch layers are +needed, they will be mapped to home row keys. The `keymap.c` file will contain +the exact changes. The diagrams in this README shows the highlights of the +changes from the default mappings. + +I also decided to change all calls to `persistant_default_layer_set()` to +`default_layer_set()` since this is my personal perference. + +## Macros +``` +#define ALT_TAB M(KC_ALT_TAB) +``` + +## Base Layers (Qwerty/Colemak/Dvorak) +These base layers are mostly the same as the default mappings. The interesting +changes are shown below. + +- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, +- `GUI/;` as `;` and `GUI`, +- `Alt/"` as `"` and `Alt`, +- `Sft/Ent` as `Enter` and `Shift`, and +- `Hyper/Tab` as `Tab` and `Hyper` + +A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. +The arrow keys, which have been moved to the +[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been +replaced with the Media keys as shown. The `MC/kc` key activates the +`MouseCursor` layer when held, and emits the corresponding `kc` for its layer, +when tapped. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | [ | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`------`------| + | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | + `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' +``` + +## Lower Layer (Symbols and Function Keys) +The symbols and functions keys are essentially the same as the default mapping. +The most notable changes are that the symbol keys from the `RAISE` layer have +been moved here. The remaining Media keys replace those that are now on the +base layers. The `BACKLIT` key has also been moved here. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`------`------| + | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Brite | | | | | | | Prev | Next | Mute | + `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' +``` + +## Raise Layer (Numbers and Arithmetic Operators) +All of the numbers and arithmetic operators are available on this layer. Some +keys are duplicated for the convenience of their positions. The `0` and `$` +keys at the far left are for quick access to beginning and end of line in vim. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`------`------| + | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Brite | | | | | | | Prev | Next | Mute | + `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' +``` + +## TouchCursor layer plus personal customizations +[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key +as the modifier, with the `IJKL` home row keys representing the inverted-T of +the arrow keys. All of the default TouchCursor keymappings for the right hand +are represented below. My personalizations include all of the keys shown for +the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key +from the base layers) readily accessible from the home row allows quick word +jumps and highlighting when used in conjunction with the arrow keys. The +`Alt-Tab` macro is not only useful under Windows, but also under Mac when used +with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). +The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in +this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` +keycodes do not seem to work. There are macros in place that'll "automatically" +choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, +etc.) depending on which layout you've currently selected (`AG_NORM` or +`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I +use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and +`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as +Google Chrome. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | | + |---------`------`------`------`------`------`------`------`------`------`------`------`------| + | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | | | | | | | | | | | + `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' +``` + +## Mouse Layer +The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. +The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the +mouse from the `doc/keycode.txt` file are represented, and logically located, +IMHO. The left and right click buttons are duplicated; on the right hand side, +for a quick click here and there, and again on the left hand side for when the +buttons need to be held for dragging things or highlighting text, thus allowing +the right hand to be free to use the up/down/left/right actions. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+------+------. + | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | + |---------`------`------`------`------`------`------`------`------`------`------`------`------| + | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | | | | | | | | | | | + `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' +``` diff --git a/keyboards/jd45/rules.mk b/keyboards/jd45/rules.mk new file mode 100644 index 000000000..2f1e266a1 --- /dev/null +++ b/keyboards/jd45/rules.mk @@ -0,0 +1,67 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID \ No newline at end of file diff --git a/keyboards/kc60/Makefile b/keyboards/kc60/Makefile index b00a488b9..57b2ef62e 100644 --- a/keyboards/kc60/Makefile +++ b/keyboards/kc60/Makefile @@ -1,76 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# 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 -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif - diff --git a/keyboards/kc60/kc60.h b/keyboards/kc60/kc60.h index 34eab4b2a..c3a0165c0 100644 --- a/keyboards/kc60/kc60.h +++ b/keyboards/kc60/kc60.h @@ -3,21 +3,92 @@ #include "quantum.h" +// K49 key is for the key at row 1 and column 15 when you split the backspace in 2 1U key. + // This a shortcut to help you visually see your layout. // The first section contains all of the arguements // The second converts the arguments into a multi-dimensional array +/* + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | K49 | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | + * |-----------------------------------------------------------------------------------------+ + * | K30 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3D | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K45 | K4A | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ #define KEYMAP( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ + K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ ) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO,K4A, K4B, K4C, K4D } \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \ } #endif + +/* Default layout + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | + * |-----------------------------------------------------------------------------------------+ + * | K30 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K45 | K4A | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ + +/* Mini Lshift + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | + * |-----------------------------------------------------------------------------------------+ + * | K30 |K31| K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K45 | K4A | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ + +/* Mini Rshift + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | + * |-----------------------------------------------------------------------------------------+ + * | K30 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | K3D | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K45 | K4A | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ + +/* Mini Enter + * ,-----------------------------------------------------------------------------------------. + * | K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | + * |-----------------------------------------------------------------------------------------+ + * | K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | + * |-----------------------------------------------------------------------------------------+ + * | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K17 | K28 | K29 | K2A | K2B | K2C | K2D | + * |-----------------------------------------------------------------------------------------+ + * | K30 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | + * |-----------------------------------------------------------------------------------------+ + * | K40 | K41 | K42 | K45 | K4A | K4B | K4C | K4D | + * `-----------------------------------------------------------------------------------------' + */ \ No newline at end of file diff --git a/keyboards/kc60/keymaps/dbroqua/keymap.c b/keyboards/kc60/keymaps/dbroqua/keymap.c new file mode 100644 index 000000000..e17827fad --- /dev/null +++ b/keyboards/kc60/keymaps/dbroqua/keymap.c @@ -0,0 +1,103 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "kc60.h" + +#define _QWERTY 0 +#define _FNCAPS 1 +#define _FNRIGHTSHIFT 2 + +// Fillers to make layering more clear +#define ______ KC_TRNS +#define XXXXXXX KC_NO + +// Func macro definitions. +#define S_LED FUNC(0) +#define S_LEDI FUNC(1) +#define S_LEDD FUNC(2) + +// Enable these functions using FUNC(n) macro. +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_BACKLIGHT_TOGGLE(), + [1] = ACTION_BACKLIGHT_INCREASE(), + [2] = ACTION_BACKLIGHT_DECREASE() + }; + +/* + * | | | + * | | | + * | | | + * | | | + * | | + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | Bksp| + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Caps/FN1| A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Up | FN2 | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Gui | Alt | Space | AltGr | Left | Down | Right | + * `-----------------------------------------------------------------------------------------' + */ + [0] = KEYMAP( /* Basic QWERTY */ + 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_GRV, \ + 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, \ + LT(_FNCAPS, 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_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_FNRIGHTSHIFT), KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_BSPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT \ + ), + +/* Layer 1 + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | Psc | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | Led | Led-| Led+| | Mute| Vol+| Vol-| | | | Play | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | Prev | Stop | Next | + * `-----------------------------------------------------------------------------------------' + */ + [_FNCAPS] = KEYMAP( /* Layer 1 */ + ______, 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_PSCR,______, ______, ______, ______, ______, ______, \ + ______, ______, S_LED, S_LEDI, S_LEDD,______,KC_MUTE,KC_VOLU,KC_VOLD,______, ______, ______, ______,KC_MPLY, \ + ______, ______, ______, ______, KC_DEL, ______, KC_MPRV, KC_MSTP, KC_MNXT \ + ), + +/* Layer 2 + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | Home | PgDown| End | + * `-----------------------------------------------------------------------------------------' + */ + [_FNRIGHTSHIFT] = KEYMAP( /* Layer 2 */ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, \ + ______, ______, ______, ______, ______, ______, KC_HOME,KC_PGDN,KC_END \ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + return MACRO_NONE; +}; diff --git a/keyboards/kc60/keymaps/dbroqua/readme.md b/keyboards/kc60/keymaps/dbroqua/readme.md new file mode 100644 index 000000000..b71d10ab0 --- /dev/null +++ b/keyboards/kc60/keymaps/dbroqua/readme.md @@ -0,0 +1,11 @@ +# Dbroqua Layout + +* Online keyboard layout editor: http://www.keyboard-layout-editor.com/#/gists/24fa7821d4955ec3c76037c8e159a199 +* Online keyboard layout editor (caps layer): http://www.keyboard-layout-editor.com/#/gists/4136d4d1555d6f0d9403c21aaf50fd37 +* Online keyboard layout editor (fn2 layer): http://www.keyboard-layout-editor.com/#/gists/cf4955f73f339020dbb41c15364e7e4f + +# Programming Instructions: +Enter into programming mode and run the following command. +``` +$ sudo KEYMAP=dbroqua make dfu +``` \ No newline at end of file diff --git a/keyboards/kc60/keymaps/default/keymap.c b/keyboards/kc60/keymaps/default/keymap.c index 6f8352c69..293ff3ab4 100644 --- a/keyboards/kc60/keymaps/default/keymap.c +++ b/keyboards/kc60/keymaps/default/keymap.c @@ -9,7 +9,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, RESET \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_RGUI, KC_RALT, KC_RCTL, RESET \ ), }; diff --git a/keyboards/kc60/keymaps/sgoodwin/keymap.c b/keyboards/kc60/keymaps/sgoodwin/keymap.c index 99e95c232..3192b2514 100644 --- a/keyboards/kc60/keymaps/sgoodwin/keymap.c +++ b/keyboards/kc60/keymaps/sgoodwin/keymap.c @@ -13,21 +13,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ MO(2), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, DF(1) \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_RGUI, KC_RALT, KC_RCTL, DF(1) \ ), [1] = KEYMAP( /* Basic QWERTY */ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ MO(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, DF(0) \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_RGUI, KC_RALT, KC_RCTL, DF(0) \ ), [2] = KEYMAP( /* KBP v60-like arrows, media keys, etc */ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, BL_INC, BL_DEC, BL_STEP, \ KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_TRNS, \ KC_TRNS, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, DEBUG, RESET, KC_TRNS, KC_NO \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_NO, DEBUG, RESET, KC_TRNS, KC_NO \ ), }; diff --git a/keyboards/kc60/keymaps/stanleylai/keymap.c b/keyboards/kc60/keymaps/stanleylai/keymap.c index 057c73bf4..212fa88bd 100644 --- a/keyboards/kc60/keymaps/stanleylai/keymap.c +++ b/keyboards/kc60/keymaps/stanleylai/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, \ LT(_FL, 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_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, MO(_FL), KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI,KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_RGUI,KC_LEFT, KC_DOWN, KC_RGHT), // Function layer [_FL] = KEYMAP( @@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_MPRV,KC_UP, KC_MNXT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR,KC_SLCK, KC_PAUS, KC_INS, \ KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TRNS,KC_NO, KC_MUTE,KC_VOLD,KC_VOLU,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, LT(_RGBL, KC_PGUP),\ - KC_TRNS,KC_TRNS,KC_TRNS, KC_MPLY, KC_TRNS,KC_HOME, KC_PGDN, KC_END), + KC_TRNS,KC_TRNS,KC_TRNS, KC_MPLY, KC_NO, KC_TRNS,KC_HOME, KC_PGDN, KC_END), // RGB Layer [_RGBL] = KEYMAP( @@ -39,13 +39,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TRNS,KC_NO, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,BL_STEP,BL_TOGG, KC_TRNS, KC_TRNS,\ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_NO, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS), #else RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_STEP,BL_TOGG, KC_TRNS, KC_TRNS,\ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_NO, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS), #endif }; diff --git a/keyboards/kc60/keymaps/wigguno/keymap.c b/keyboards/kc60/keymaps/wigguno/keymap.c index 50b1d0f98..dca2826eb 100644 --- a/keyboards/kc60/keymaps/wigguno/keymap.c +++ b/keyboards/kc60/keymaps/wigguno/keymap.c @@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_RALT, MO(1), KC_RGUI, KC_RCTL \ ), /* @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, \ - RESET, KC_TRNS, KC_TRNS, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + RESET, KC_TRNS, KC_TRNS, BL_TOGG, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), }; diff --git a/keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png b/keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png new file mode 100644 index 000000000..cc6a630a5 Binary files /dev/null and b/keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png differ diff --git a/keyboards/kc60/keymaps/workman-dead/keymap.c b/keyboards/kc60/keymaps/workman-dead/keymap.c new file mode 100644 index 000000000..9e3b9bb65 --- /dev/null +++ b/keyboards/kc60/keymaps/workman-dead/keymap.c @@ -0,0 +1,183 @@ +#include "kc60.h" + +#define _WM 0 +#define _QW 1 +#define _DK 2 +#define _FUN 3 +#define _MS 4 + +#define _______ KC_NO +#define XXXXXXX KC_TRNS + +#define _DK_ACT 0 +#define _DK_REL 1 +#define _KC_COMS 2 +#define _KC_CENT 3 + +#define DK_ACT M(_DK_ACT) // activate dead key layer +#define DK_REL M(_DK_REL) // release dead key layer +#define KC_COMS M(_KC_COMS) // comma + space +#define KC_CENT M(_KC_CENT) // comma + enter +#define KC_TABM LT(_MS, KC_TAB) // press for tab, hold for mouse layer +#define KC_SPFN LT(_FUN, KC_SPC) // press for space, hold for function layer (aka spacefn) +#define KC_DFQW DF(_QW) // set default layer to qwerty +#define KC_DFWM DF(_WM) // set default layer to workman +#define KC_CMDQ LGUI(KC_Q) // command + q +#define KC_CMDD LGUI(KC_D) // command + d +#define KC_CMDA LGUI(KC_A) // command + a +#define KC_CMDS LGUI(KC_S) // command + s +#define KC_CMDZ LGUI(KC_Z) // command + z +#define KC_CMDX LGUI(KC_X) // command + x +#define KC_CMDC LGUI(KC_C) // command + c +#define KC_CMDV LGUI(KC_V) // command + v +#define KC_CSTB S(RCTL(KC_TAB)) // shift + control + tab +#define KC_C_TB RCTL(KC_TAB) // control + tab +#define KC_C_LF RCTL(KC_LEFT) // control + left +#define KC_C_RT RCTL(KC_RGHT) // control + right + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Workman +/* +* ,-----------------------------------------------------------. +* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp | +* |-----------------------------------------------------------| +* |Tab/M| Q| D| R| W| B| J| F| U| P| ;| [| ]| \ | +* |-----------------------------------------------------------| +* |Ctrl | A| S| H| T| G| Y| N| E| O| I| '| Return | +* |-----------------------------------------------------------| +* |Shift | Z| X| M| C| V| K| L| ,| .| /| Shift | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | Space/FN | Alt | GUI | Ctrl | qwerty | +* `-----------------------------------------------------------' +*/ +[_WM] = KEYMAP( /* Workman */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TABM, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_LCTL, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, _______, KC_ENT, \ + KC_LSFT, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, DK_ACT, KC_DOT, KC_SLSH, _______, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPFN, _______, KC_RALT, KC_RGUI, KC_RCTL, KC_DFQW), + +// QWERTY +/* +* ,-----------------------------------------------------------. +* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp | +* |-----------------------------------------------------------| +* |Tab/M| Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | +* |-----------------------------------------------------------| +* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | +* |-----------------------------------------------------------| +* |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | Space/FN | Alt | GUI | Ctrl | workman | +* `-----------------------------------------------------------' +*/ +[_QW] = KEYMAP( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TABM, 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_LCTL, 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, DK_ACT, KC_DOT, KC_SLSH, _______, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPFN, _______, KC_RALT, KC_RGUI, KC_RCTL, KC_DFWM), + +// dead key layer +/* +* ,-----------------------------------------------------------. +* | | | | | | | | | | | | | | Bsp | +* |-----------------------------------------------------------| +* | | %| &| ?| +| @| $| _| [| ]| !| ~| ^| | +* |-----------------------------------------------------------| +* | | #| (| =| 0| {| }| 1| *| )| -| `| Return | +* |-----------------------------------------------------------| +* | | 6| 7| 8| 9| || \| 2| 3| 4| 5| | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | , | Alt | GUI | Ctrl | | +* `-----------------------------------------------------------' +*/ +[_DK] = KEYMAP( /* dead key layer */ + XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, \ + XXXXXXX, KC_PERC, KC_AMPR, KC_QUES, KC_PLUS, KC_AT, KC_DLR, KC_UNDS, KC_LBRC, KC_RBRC, KC_EXLM, KC_TILD, KC_CIRC, _______, \ + _______, KC_HASH, KC_LPRN, KC_EQL, KC_0, KC_LCBR, KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, KC_GRV, _______, KC_CENT, \ + _______, _______, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_BSLS, KC_2, DK_REL, KC_4, KC_5, _______, _______, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_COMS, _______, KC_RALT, KC_RGUI, KC_RCTL, _______), + +// function layer +/* +* ,-----------------------------------------------------------. +* | | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|Del | +* |-----------------------------------------------------------| +* |Esc | Cq| Cd|cstb|ctb| | |pgd| up|pgu| | | |ins | +* |-----------------------------------------------------------| +* |Shift | Ca| Cs|clt|crt| | | lt| dw| rt|home|end| Bsp | +* |-----------------------------------------------------------| +* |Shift | Cz| Cx| | Cc| Cv| V-| V+|mute| | | | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | | Alt | GUI | Ctrl | Reset | +* `-----------------------------------------------------------' +*/ +[_FUN] = KEYMAP( /* function layer */ + KC_TRNS, 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_ESC, KC_CMDQ, KC_CMDD, KC_CSTB, KC_C_TB, _______, _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, _______, KC_INS, \ + KC_LSFT, KC_CMDA, KC_CMDS, KC_C_LF, KC_C_RT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, KC_END, _______, KC_BSPC, \ + KC_LSFT, _______, KC_CMDZ, KC_CMDX, _______, KC_CMDC, KC_CMDV, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, _______, KC_RALT, KC_RGUI, KC_RCTL, RESET), + +// mouse layer +/* +* ,-----------------------------------------------------------. +* | | | | | | | | | | | | | | | +* |-----------------------------------------------------------| +* | |fast|med|slow| | | | | up| | | | | | +* |-----------------------------------------------------------| +* | | | | | | | | lt| dw| rt| rc| | | +* |-----------------------------------------------------------| +* | | | | | | | | | | | | | +* |-----------------------------------------------------------| +* | | | | lc | | | | | +* `-----------------------------------------------------------' +*/ +[_MS] = KEYMAP( /* mouse layer */ + XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + XXXXXXX, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN2, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _KC_COMS: + if (record->event.pressed) { + return MACRO(T(COMM), T(SPC), END); // comma + space + } + break; + case _KC_CENT: + if (record->event.pressed) { + return MACRO(T(COMM), T(ENT), END); // comma + enter + } + break; + case _DK_ACT: + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || keyboard_report->mods & MOD_BIT(KC_RSFT)) { // act as comma when shift is pressed (eg <) + register_code(KC_COMM); + } else { // activate oneshot dead key layer otherwise + layer_on(_DK); + set_oneshot_layer(_DK, ONESHOT_START); + } + } else { // make sure to deactive dead key layer on key release + clear_oneshot_layer_state(ONESHOT_PRESSED); + unregister_code(KC_COMM); + } + break; + case _DK_REL: + if (record->event.pressed) { // act as 3 on keypress + register_code(KC_3); + } else { // make sure to deactive dead key layer on key release + clear_oneshot_layer_state(ONESHOT_PRESSED); + unregister_code(KC_3); + } + break; + } + + return MACRO_NONE; +}; diff --git a/keyboards/kc60/keymaps/workman-dead/readme.md b/keyboards/kc60/keymaps/workman-dead/readme.md new file mode 100644 index 000000000..f1fcdc960 --- /dev/null +++ b/keyboards/kc60/keymaps/workman-dead/readme.md @@ -0,0 +1,17 @@ +# Workman dead with spacefn (kc60 @ QMK) + +## Layout reference +![workman dead with spacefn](./kc60-wm-dead.png) + +## Build + +To build this keymap, simply run `make KEYMAP=workman-dead`. + +## Notes + +* the default layout is `workman` (try it out, it's awesome!), but it can be changed to `qwerty` with the `rebel` key (the function layer won't change though) +* `comma` acts as a dead key, that means tapping/holding it will activate the **oneshot** `dead key` layer (marked red in the reference) +* hold `space` to access the `function` layer (marked blue in the reference) +* hold `tab` to activate the mouse layer +* the `function` layer contains mostly osx specific shortcuts +* on the right side of the bottom row `alt` and `super` are switched compared to a standard layout diff --git a/keyboards/kc60/keymaps/ws2812/keymap.c b/keyboards/kc60/keymaps/ws2812/keymap.c index 1c0574df0..ae11ebf91 100644 --- a/keyboards/kc60/keymaps/ws2812/keymap.c +++ b/keyboards/kc60/keymaps/ws2812/keymap.c @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT,KC_RGUI, MO(_FL), KC_RCTL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_RALT,KC_RGUI, MO(_FL), KC_RCTL), /* Keymap _FL: Function Layer * ,-----------------------------------------------------------. @@ -53,13 +53,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, 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, RESET), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, RESET), #else KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, RESET), #endif }; diff --git a/keyboards/kc60/led.c b/keyboards/kc60/led.c new file mode 100644 index 000000000..50659d724 --- /dev/null +++ b/keyboards/kc60/led.c @@ -0,0 +1,31 @@ +/* +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 . +*/ + +#include +#include "stdint.h" +#include "led.h" + + +void led_set(uint8_t usb_led) +{ + if (usb_led & (1<.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` + Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. ## WS2812 Support ![Image of KC60 with RGB Underglow](keymaps/ws2812/ws2812_example.jpg) -Build with WS2812 Support by running `make KEYMAP=ws2812`. +Build with WS2812 Support by running `make ws2812`. + +## Warning +For those who want to use 2x1U instead of classic backspace you need to use K0D and K49 like this: +* K0D represents the key at the right of =. +* K49 represents the last key of the row (is wired at the right of the space key on the PCB) + +In kc60.h I've put several definitions' examples of possible layouts proposed by online editor (http://123.57.250.164:9128/). diff --git a/keyboards/kc60/rules.mk b/keyboards/kc60/rules.mk new file mode 100644 index 000000000..a935ed19e --- /dev/null +++ b/keyboards/kc60/rules.mk @@ -0,0 +1,71 @@ +# project specific files +SRC = led.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# 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 +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 diff --git a/keyboards/kinesis/Makefile b/keyboards/kinesis/Makefile index ca077e636..4e2a6f00f 100644 --- a/keyboards/kinesis/Makefile +++ b/keyboards/kinesis/Makefile @@ -1,79 +1,3 @@ - -## Project specific files - -SRC= matrix.c - -# MCU name -MCU = at90usb1286 -#MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=1024 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no -# 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 -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming -CUSTOM_MATRIX=yes # need to do our own thing with the matrix - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - - +endif \ No newline at end of file diff --git a/keyboards/kinesis/readme.md b/keyboards/kinesis/readme.md index a990f9cb9..79c86581e 100644 --- a/keyboards/kinesis/readme.md +++ b/keyboards/kinesis/readme.md @@ -27,16 +27,16 @@ Depending on which keymap you would like to use, you will have to compile slight ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: ``` -$ make keymap=[default|jack|] +$ make [default|jack|] ``` Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/kinesis/rules.mk b/keyboards/kinesis/rules.mk new file mode 100644 index 000000000..a4a2b7d15 --- /dev/null +++ b/keyboards/kinesis/rules.mk @@ -0,0 +1,73 @@ + +## Project specific files + +SRC= matrix.c + +# MCU name +MCU = at90usb1286 +#MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no +# 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 +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming +CUSTOM_MATRIX=yes # need to do our own thing with the matrix diff --git a/keyboards/kitten_paw/Makefile b/keyboards/kitten_paw/Makefile new file mode 100644 index 000000000..57b2ef62e --- /dev/null +++ b/keyboards/kitten_paw/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/kitten_paw/config.h b/keyboards/kitten_paw/config.h new file mode 100644 index 000000000..d7089734a --- /dev/null +++ b/keyboards/kitten_paw/config.h @@ -0,0 +1,162 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Costar +#define PRODUCT Majestouch + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +/* + * 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 or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/kitten_paw/keymaps/default/keymap.c b/keyboards/kitten_paw/keymaps/default/keymap.c new file mode 100644 index 000000000..64aa672d0 --- /dev/null +++ b/keyboards/kitten_paw/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +#include "kitten_paw.h" + +enum layers { + DEFAULT, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = KEYMAP(\ + 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_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_DEL, KC_END,KC_PGDN, 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_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_P1, KC_P2, KC_P3,KC_PENT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/kitten_paw/keymaps/ickerwx/config.h b/keyboards/kitten_paw/keymaps/ickerwx/config.h new file mode 100644 index 000000000..04a2d253c --- /dev/null +++ b/keyboards/kitten_paw/keymaps/ickerwx/config.h @@ -0,0 +1,31 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#undef MOUSEKEY_MOVE_MAX +#define MOUSEKEY_MOVE_MAX 127 +#undef MOUSEKEY_WHEEL_MAX +#define MOUSEKEY_WHEEL_MAX 110 +#undef MOUSEKEY_MOVE_DELTA +#define MOUSEKEY_MOVE_DELTA 5 +#undef MOUSEKEY_WHEEL_DELTA +#define MOUSEKEY_WHEEL_DELTA 1 +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 50 +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 20 +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 4 +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 30 +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 3 +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#define MOUSEKEY_WHEEL_TIME_TO_MAX 1000 +#undef ONESHOT_TIMEOUT +#define ONESHOT_TIMEOUT 500 +#undef TAPPING_TOGGLE +#define TAPPING_TOGGLE 2 + +#endif diff --git a/keyboards/kitten_paw/keymaps/ickerwx/keymap.c b/keyboards/kitten_paw/keymaps/ickerwx/keymap.c new file mode 100644 index 000000000..9a00c80dc --- /dev/null +++ b/keyboards/kitten_paw/keymaps/ickerwx/keymap.c @@ -0,0 +1,242 @@ +#include "kitten_paw.h" +#include "mousekey.h" + +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define C(kc) LCTL(KC_##kc) +#define RA(kc) RALT(KC_##kc) +#define KC_SLCT KC_SELECT +#define MEDAPP LT(MEDIA, KC_APP) +#undef S +#define S(kc) LSFT(KC_##kc) + +uint8_t current_layer_global = 255; + +enum layers { + DEFAULT, + PROG1, + PROG2, + MEDIA, + MOUSE1, + MOUSE2, + MISC, +}; + +enum function_id { + LSHFT_PAREN, + RSHFT_PAREN, + LCTRL_BRACKET, + RCTRL_BRACKET, + LALT_CURLY, + RALT_CURLY, + CTRL_CLICK +}; + +enum macro_id { + GRV, + CFLEX +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = KEYMAP(\ + 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_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_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \ + F(0), 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, \ + F(8),KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, F(9), KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ + F(1),KC_LGUI, F(3), LT(MISC, KC_SPC), F(4), F(5), MEDAPP, F(2), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), + /* Layer 1: Programming Layer 1, emulating US l ayout */ + [PROG1] = KEYMAP(\ + KC_ESC,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + M(GRV),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_SLSH, S(0),_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______, KC_Z,_______,_______,_______,_______, RA(8), RA(9),RA(MINS), _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,S(COMM),S(BSLS), _______, _______,_______,_______, \ + MO(PROG2),_______, KC_Y,_______,_______,_______,_______,_______,_______,_______,_______, S(7), MO(PROG2), _______, _______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), + /* Layer 2: programming layer 2 + all keys that are not FN keys are sent as LSFT+key on this layer + */ + [PROG2] = KEYMAP(\ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + RA(RBRC),_______, RA(Q),KC_BSLS,_______,_______,M(CFLEX), S(6),S(RBRC), S(8), S(9),S(SLSH),KC_RBRC,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RA(7), RA(0),RA(NUBS), _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, S(DOT), S(2), _______, _______,_______,_______, \ + _______,S(NUBS),_______,_______,_______,_______,_______,_______,_______,KC_NUBS,S(NUBS),S(MINS), _______, _______, _______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), + /* Layer 3: media layer */ + [MEDIA] = KEYMAP(\ + KC_PWR,KC_SLEP,KC_WAKE,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, KC_MPRV,KC_MPLY,KC_MNXT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_VOLD,KC_MUTE,KC_VOLU, 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, KC_EJCT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,_______,XXXXXXX, KC_MRWD,KC_MSTP,KC_MFFD, XXXXXXX,XXXXXXX), + /* Layer 4: Mouse layer */ + [MOUSE1] = KEYMAP(\ + F(6),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,KC_ACL0,KC_ACL1,KC_ACL2,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,KC_BTN4,KC_WH_D,KC_MS_U,KC_WH_U,_______, C(Z),_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,KC_BTN5,KC_MS_L,KC_MS_D,KC_MS_R, F(7),KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,_______,_______, _______, _______,_______,_______, \ + MO(MOUSE2),_______, C(Y), C(X), C(C), C(V),_______,KC_BTN2,KC_BTN3,C(PGUP),C(PGDN),_______, KC_RSFT, _______, _______,_______,_______,_______, \ + KC_LCTL,_______,KC_LALT, KC_BTN1, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, _______,_______,_______, _______,_______), + /* Layer 5: Mouse layer 2*/ + [MOUSE2] = KEYMAP(\ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,KC_BTN2,KC_WH_U,KC_BTN3,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,KC_WH_L,KC_WH_D,KC_WH_R,_______,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,_______,_______, _______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), + /* Layer 6: Misc layer */ + [MISC] = KEYMAP(\ + _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,KC_SLCT, C(W), KC_UP,_______,_______,_______,_______,KC_BSPC, KC_DEL,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,KC_HOME,KC_PGDN,KC_PGUP,_______,_______,_______, _______, _______,_______,_______, \ + KC_LSFT,_______, C(Y), C(X), C(C), C(V), KC_SPC, KC_END,_______,C(PGUP),C(PGDN),_______, _______, _______, _______,_______,_______,_______, \ + _______,_______,_______, LT(MISC, KC_SPC), _______,_______,_______,_______, _______,_______,_______, _______,_______), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_TOGGLE(MOUSE1), // tap-toggle mouse layer (4) + [1] = ACTION_FUNCTION_TAP(LCTRL_BRACKET), // tap to print [ + [2] = ACTION_FUNCTION_TAP(RCTRL_BRACKET), // tap to print ] + [3] = ACTION_FUNCTION_TAP(LALT_CURLY), // tap to print { + [4] = ACTION_FUNCTION_TAP(RALT_CURLY), // tap to print } + [5] = ACTION_LAYER_TAP_TOGGLE(PROG1), // tap-toggle programming layer 1 + [6] = ACTION_LAYER_SET_CLEAR(DEFAULT), + [7] = ACTION_FUNCTION_TAP(CTRL_CLICK), + [8] = ACTION_FUNCTION_TAP(LSHFT_PAREN), // tap to print ( + [9] = ACTION_FUNCTION_TAP(RSHFT_PAREN), // tap to print ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case GRV: // macro to print accent grave + return (record->event.pressed ? + MACRO( D(LSFT), T(EQL), U(RALT), T(SPC), END) : + MACRO_NONE ); + case CFLEX: // print accent circonflex + return (record->event.pressed ? + MACRO( T(GRV), T(SPC), END ) : + MACRO_NONE ); + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + uint8_t layer; + layer = biton32(layer_state); + + if (current_layer_global != layer) { + current_layer_global = layer; + + // unset CAPSLOCK and SCROLL LOCK LEDs + led_set_kb(host_keyboard_leds() & ~(1<event.pressed) { + if (record->tap.count > 0 && !record->tap.interrupted) { + if (record->tap.interrupted) { + register_mods(MOD_BIT(orig_mod)); + } + } else { + register_mods(MOD_BIT(orig_mod)); + } + } else { + if (record->tap.count > 0 && !(record->tap.interrupted)) { + add_weak_mods(MOD_BIT(macro_mod)); + send_keyboard_report(); + register_code(macro_kc); + unregister_code(macro_kc); + del_weak_mods(MOD_BIT(macro_mod)); + send_keyboard_report(); + record->tap.count = 0; // ad hoc: cancel tap + } else { + unregister_mods(MOD_BIT(orig_mod)); + } + } +} + +/* if LCTRL is tabbed, print (, or ) if RCTRL is tabbed, same for LALT/RALT and [/] */ +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + // The code is copied from keymap_hasu.c in the tmk keyboards hhkb folder + switch (id) { + case LCTRL_BRACKET: + tap_helper(record, KC_LCTL, KC_RALT, KC_8); + break; + case RCTRL_BRACKET: + tap_helper(record, KC_RCTL, KC_RALT, KC_9); + break; + case LALT_CURLY: + tap_helper(record, KC_LALT, KC_RALT, KC_7); + break; + case RALT_CURLY: + tap_helper(record, KC_RALT, KC_RALT, KC_0); + break; + case LSHFT_PAREN: + tap_helper(record, KC_LSFT, KC_LSFT, KC_8); + break; + case RSHFT_PAREN: + tap_helper(record, KC_RSFT, KC_LSFT, KC_9); + break; + case CTRL_CLICK: + if (record->event.pressed) { + mousekey_clear(); + register_mods(MOD_BIT(KC_LCTL)); + send_keyboard_report(); + wait_ms(5); + mousekey_on(KC_BTN1); + mousekey_send(); + wait_ms(10); + mousekey_off(KC_BTN1); + mousekey_send(); + wait_ms(5); + unregister_mods(MOD_BIT(KC_LCTL)); + send_keyboard_report(); + } + break; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t layer; + layer = biton32(layer_state); + if (layer == PROG2) { + if (keycode >= KC_A && keycode <= KC_EXSEL && \ + !( // do not send LSFT + these keycodes, they are needed for emulating the US layout + keycode == KC_NONUS_BSLASH || + keycode == KC_RBRC || + keycode == KC_BSLS || + keycode == KC_GRV + )) { + // LSFT is the modifier for this layer, so we set LSFT for every key to get the expected behavior + if (record->event.pressed) { + register_mods(MOD_LSFT); + } else { + unregister_mods(MOD_LSFT); + } + } + } + return true; +} diff --git a/keyboards/kitten_paw/keymaps/ickerwx/readme.md b/keyboards/kitten_paw/keymaps/ickerwx/readme.md new file mode 100644 index 000000000..0d23be4ea --- /dev/null +++ b/keyboards/kitten_paw/keymaps/ickerwx/readme.md @@ -0,0 +1,18 @@ +# My personal keymap for the Kitten Paw controller + +This keymap only works correctly when you have your OS configured with a German keymap. Use the keymap however you like. It's most likely a living thing that will never be quite finished. + +## Description of the layers +Layer 0 (DEFAULT) works just like you would expect a keyboard to work, mostly, except: +Caps Lock switches to the mouse layer, RGUI and APP are switches to the programming layer and media layer. +Mouse and programming layer switches can be held or double-tapped to lock. +Holding space switches to the MISC layer where I currently accumulate useful shortcuts. +Tapping left and right Shift, Ctrl and Alt will send (), [] and {} respectively. + +Layers 1 and 2 (PROG1 and PROG2) emulate the US layout while still using a German OS keymap setting. I was annoyed of having to change the OS settings every time I wanted to use the US layout for coding, so I made these layers to behave just like the US layout even though the OS still uses German. The shift keys were a bit tricky, I had to use them as MO(PROG2) switches, so to get the actual expected behavior I enable LSFT for almost every keypress on PROG2 in ```process_record_user```. Since the shift keys are MO() function keys, they do not print () at the moment, which sucks. I'm working on it. + +Layer 3 (MEDIA) just has a couple of media keys on it, mainly around the cursor keys and nav key cluster. + +Layers 4 and 5 (MOUSE1 and MOUSE2) are mouse layers. Move the cursor using ESDF, scroll using HJKL, Space for left click, N and M for right and middle click. There's more, look at the keymap. + +Layer 6 is a layer I don't have a good name for, so I call it MISC. You'll find cursor keys at ESDF, other navigation keys around the HJKL cluster and F12 to F24 on the F-keys. For now. \ No newline at end of file diff --git a/keyboards/kitten_paw/kitten_paw.c b/keyboards/kitten_paw/kitten_paw.c new file mode 100644 index 000000000..92f64b06b --- /dev/null +++ b/keyboards/kitten_paw/kitten_paw.c @@ -0,0 +1,43 @@ +#include "kitten_paw.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + CONFIG_LED_IO; + CONFIG_LED_IO; + print_dec(usb_led); + if (usb_led & (1< + + 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 +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif +static uint8_t debouncing = DEBOUNCING_DELAY; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(void); +static void select_col(uint8_t col); + +inline uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +/* Column pin configuration + * + * col: 0 1 2 3 4 5 6 7 + * pin: PC7 PD5 PD3 PD1 PC2 PD6 PD4 PD2 + * + * Rrr pin configuration + * + * These rrrs uses one 74HC154 4 to 16 bit demultiplexer (low + * active), together with 2 rrrs driven directly from the micro + * controller, to control the 18 rrrs. The rrrs are driven from + * pins B6,5,4,3,2,1,0. + */ +void matrix_init(void) { + DDRC &= ~0b10000100; // Row input pins + DDRD &= ~0b01111110; + PORTC |= 0b10000100; + PORTD |= 0b01111110; + + DDRB |= 0b01111111; // Column output pins + + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + uint8_t rows = read_rows(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/kitten_paw/rules.mk b/keyboards/kitten_paw/rules.mk new file mode 100644 index 000000000..b0c909d11 --- /dev/null +++ b/keyboards/kitten_paw/rules.mk @@ -0,0 +1,72 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 + OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +CUSTOM_MATRIX = yes +SRC += matrix.c diff --git a/keyboards/lets_split/Makefile b/keyboards/lets_split/Makefile index b9f07636b..4e2a6f00f 100644 --- a/keyboards/lets_split/Makefile +++ b/keyboards/lets_split/Makefile @@ -1,78 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= yes # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/lets_split/pro_micro.h b/keyboards/lets_split/pro_micro.h index 09e219b7b..f9e7ed75d 100644 --- a/keyboards/lets_split/pro_micro.h +++ b/keyboards/lets_split/pro_micro.h @@ -111,18 +111,18 @@ static const uint8_t SCK = 15; // Mapping of analog pins as digital I/O // A6-A11 share with digital pins -static const uint8_t A0 = 18; -static const uint8_t A1 = 19; -static const uint8_t A2 = 20; -static const uint8_t A3 = 21; -static const uint8_t A4 = 22; -static const uint8_t A5 = 23; -static const uint8_t A6 = 24; // D4 -static const uint8_t A7 = 25; // D6 -static const uint8_t A8 = 26; // D8 -static const uint8_t A9 = 27; // D9 -static const uint8_t A10 = 28; // D10 -static const uint8_t A11 = 29; // D12 +static const uint8_t ADC0 = 18; +static const uint8_t ADC1 = 19; +static const uint8_t ADC2 = 20; +static const uint8_t ADC3 = 21; +static const uint8_t ADC4 = 22; +static const uint8_t ADC5 = 23; +static const uint8_t ADC6 = 24; // D4 +static const uint8_t ADC7 = 25; // D6 +static const uint8_t ADC8 = 26; // D8 +static const uint8_t ADC9 = 27; // D9 +static const uint8_t ADC10 = 28; // D10 +static const uint8_t ADC11 = 29; // D12 #define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) #define digitalPinToPCICRbit(p) 0 @@ -220,26 +220,26 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = { PC, // D5 - PC6 PD, // D6 - PD7 PE, // D7 - PE6 - + PB, // D8 - PB4 PB, // D9 - PB5 PB, // D10 - PB6 PB, // D11 - PB7 PD, // D12 - PD6 PC, // D13 - PC7 - + PB, // D14 - MISO - PB3 PB, // D15 - SCK - PB1 PB, // D16 - MOSI - PB2 PB, // D17 - SS - PB0 - + PF, // D18 - A0 - PF7 PF, // D19 - A1 - PF6 PF, // D20 - A2 - PF5 PF, // D21 - A3 - PF4 PF, // D22 - A4 - PF1 PF, // D23 - A5 - PF0 - + PD, // D24 - PD5 PD, // D25 / D6 - A7 - PD7 PB, // D26 / D8 - A8 - PB4 @@ -257,26 +257,26 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { _BV(6), // D5 - PC6 _BV(7), // D6 - PD7 _BV(6), // D7 - PE6 - + _BV(4), // D8 - PB4 _BV(5), // D9 - PB5 _BV(6), // D10 - PB6 _BV(7), // D11 - PB7 _BV(6), // D12 - PD6 _BV(7), // D13 - PC7 - + _BV(3), // D14 - MISO - PB3 _BV(1), // D15 - SCK - PB1 _BV(2), // D16 - MOSI - PB2 _BV(0), // D17 - SS - PB0 - + _BV(7), // D18 - A0 - PF7 _BV(6), // D19 - A1 - PF6 _BV(5), // D20 - A2 - PF5 _BV(4), // D21 - A3 - PF4 _BV(1), // D22 - A4 - PF1 _BV(0), // D23 - A5 - PF0 - + _BV(5), // D24 - PD5 _BV(7), // D25 / D6 - A7 - PD7 _BV(4), // D26 / D8 - A8 - PB4 @@ -286,24 +286,24 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { }; const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { - NOT_ON_TIMER, + NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, TIMER0B, /* 3 */ NOT_ON_TIMER, TIMER3A, /* 5 */ TIMER4D, /* 6 */ - NOT_ON_TIMER, - - NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, TIMER1A, /* 9 */ TIMER1B, /* 10 */ TIMER0A, /* 11 */ - - NOT_ON_TIMER, + + NOT_ON_TIMER, TIMER4A, /* 13 */ - - NOT_ON_TIMER, + + NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, @@ -324,11 +324,11 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { 7, // A0 PF7 ADC7 - 6, // A1 PF6 ADC6 - 5, // A2 PF5 ADC5 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 4, // A3 PF4 ADC4 - 1, // A4 PF1 ADC1 - 0, // A5 PF0 ADC0 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 8, // A6 D4 PD4 ADC8 10, // A7 D6 PD7 ADC10 11, // A8 D8 PB4 ADC11 diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk new file mode 100644 index 000000000..6961fbd55 --- /dev/null +++ b/keyboards/lets_split/rules.mk @@ -0,0 +1,74 @@ +SRC += matrix.c \ + i2c.c \ + split_util.c \ + serial.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= yes # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes \ No newline at end of file diff --git a/keyboards/phantom/Makefile b/keyboards/phantom/Makefile index 3a71fd0ee..4e2a6f00f 100644 --- a/keyboards/phantom/Makefile +++ b/keyboards/phantom/Makefile @@ -1,74 +1,3 @@ - - -SRC = led.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/phantom/keymaps/xyverz/keymap.c b/keyboards/phantom/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..4a1522638 --- /dev/null +++ b/keyboards/phantom/keymaps/xyverz/keymap.c @@ -0,0 +1,104 @@ +#include "phantom.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define _DV 1 +#define _CM 2 +#define _FL 3 + +// Macro name shortcuts +#define QWERTY M(_QW) +#define DVORAK M(_DV) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QW] = { /* Layer 0: Qwerty */ + {KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS}, + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, 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, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, + {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT} + }, + +[_DV] = { /* Layer 1: Dvorak */ + {KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS}, + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP}, + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, + {KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_LSFT, XXXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, + {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT} + }, + +[_CM] = { /* Layer 2: Colemak */ + {KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS}, + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP}, + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, + {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT} + }, + +[_FL] = { /* Layer 3: Functions */ + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RESET, KC_MPRV, KC_MPLY, KC_MNXT}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX}, + {_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX}, + {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______}, + }, + + +}; + +enum function_id { + SHIFT_ESC, +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/clueboard2/Makefile b/keyboards/phantom/rules.mk similarity index 93% rename from keyboards/clueboard2/Makefile rename to keyboards/phantom/rules.mk index e9367a90d..c6b8ca6c3 100644 --- a/keyboards/clueboard2/Makefile +++ b/keyboards/phantom/rules.mk @@ -1,5 +1,7 @@ +SRC = led.c + # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -59,13 +61,9 @@ EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= yes # Console for debug(+400) COMMAND_ENABLE ?= yes # Commands for debug and configuration NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150) MIDI_ENABLE ?= no # MIDI controls AUDIO_ENABLE ?= no UNICODE_ENABLE ?= no # Unicode BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR - include ../../Makefile -endif diff --git a/keyboards/planck/Makefile b/keyboards/planck/Makefile index 23944f92e..7d49c5ef9 100644 --- a/keyboards/planck/Makefile +++ b/keyboards/planck/Makefile @@ -1,74 +1,5 @@ - SUBPROJECT_DEFAULT = rev4 -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index 7db3197a7..69d164b8c 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -1,5 +1,4 @@ - -#include "planck.h" +#include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif diff --git a/keyboards/planck/keymaps/callum/Makefile b/keyboards/planck/keymaps/callum/Makefile new file mode 100644 index 000000000..1d76966a6 --- /dev/null +++ b/keyboards/planck/keymaps/callum/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c new file mode 100644 index 000000000..ed187df1d --- /dev/null +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -0,0 +1,138 @@ +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _MOVE 1 +#define _SYMB 2 +#define _FUNC 3 + +enum planck_keycodes { + BASE = SAFE_RANGE, + MOVE, + SYMB, + FUNC +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BASE + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Func | GUI | Alt | Ctrl | Symb |Enter |Space | Move | GUI | Alt | Ctrl |Caps | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS} +}, + +/* MOVE + * ,-----------------------------------------------------------------------------------. + * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | | Left | Down |Right | | | Left | Down |Right | | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | |Pg Up |Pg Dn | | |Pg Dn |Pg Up | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOVE] = { + {KC_ESC, _______, KC_HOME, KC_UP, KC_END, _______, _______, KC_HOME, KC_UP, KC_END, _______, KC_ESC}, + {KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL}, + {_______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* SYMB + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | + * |-----------------------------------------------------------------------------------. + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_SYMB] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC }, + {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |-----------------------------------------------------------------------------------. + * | | Play | Prev | Next | BL+ | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Mute | Vol- | Vol+ | BL- | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |Reset | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = { + {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, + {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, _______, _______, _______, _______, _______}, + {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } +} + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MOVE: + if (record->event.pressed) { + layer_on(_MOVE); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } else { + layer_off(_MOVE); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } + return false; + break; + case SYMB: + if (record->event.pressed) { + layer_on(_SYMB); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } else { + layer_off(_SYMB); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md new file mode 100644 index 000000000..030def7f7 --- /dev/null +++ b/keyboards/planck/keymaps/callum/readme.md @@ -0,0 +1,48 @@ +# callum’s planck layout + +This is a layout for the grid planck, built with a few ideals in mind. These ideals are just my opinion mind! The great thing about *qmk* is that we can all afford to have different opinions about what makes a good layout: + +- Minimal response times should be maintained. i.e. keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided --- since they inevitably send their keycode later than a normal key, interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording. +- The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible. +- There should be two of every modifier (one on each side), since otherwise certain long key combinations become hard to make. +- Backspace should be in the “capslock position” as God intended. +- The keyboard should be usable without any firmware changes on any operating system. In my case that means it should work on *Windows* and *Linux* without any software modifications, while I can change the behaviour slightly on *macOS* in software since that’s my home OS. The images reflect the intended use on *macOS* **after** minor software tweaks; which will be noted. + +We have four layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys. + +## The `BASE` layer +![](http://i.imgur.com/aEXOlWl.png) + +This is the default layer; in [colemak](https://colemak.com). `esc` and `del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home. + +The `MOVE` and `SYMB` layers are reached by holding down the `move` and `symb` keys respectively. The `FUNC` layer is reached by holding down both the `move` and `symb` keys simultaneosly, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls. + +The `ctrl`, `alt`, `cmd` cluster is asymmetric around the centre so that at least one of each of the modifiers can be reached with the thumbs. The intended use is to always hit the left `cmd` and the right `ctrl`, unless an awkward key combination dictates otherwise. + +In firmware `ctrl` and `cmd`/`GUI` are swapped with respect to the image above --- I swap them to the illustrated location when using *macOS* and leave them be for *Windows* and *Linux*. (so that `cmd-z,x,c,v,...` becomes `ctrl-z,x,c,v,...` saving me some confusion) + +## The `MOVE` layer +![](http://i.imgur.com/KXRSuHT.png) + +This is fairly self explanatory. I almost exclusively use the right hand cluster so that movement is a one handed affair, but the left hand cluster is there if it’s needed. + +On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ticking *Use PC Style Home/End #2* and *Use PC Style PageUp/PageDown* so that `home` and `end` jump you to the beginning and end of the line respectively and so that `pg up` and `pg dn` move the cursor instead of just scrolling. + +None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected. + +## The `SYMB` layer +![](http://i.imgur.com/thh1ne2.png) + +The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, arranged roughly so that the most used symbols are accessible with the strongest fingers. + +`esc` and `del` are repeated here since I wanted to be able to reach either, one handed, with either hand. + +Again none of the modifiers are overwritten so that shortcuts involving numbers or symbols work as expected. + +## The `FUNC` layer +![](http://i.imgur.com/skxRZiH.png) + +The only thing of note here is that `bl+` and `bl-` are short for *backlight up* and *backlight down* respectively, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. + +## Other changes from the default +I have LEDs and sound disabled, simply because I have no need of them. \ No newline at end of file diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index 14a5be170..70eaefb7b 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c @@ -4,6 +4,7 @@ #endif #include "config.h" #include "quantum.h" +#include "version.h" /* Each layer is given a name to aid in readability, which is then used in the keymap matrix below. The underscores do not denote diff --git a/keyboards/planck/keymaps/circuit/Makefile b/keyboards/planck/keymaps/circuit/Makefile new file mode 100644 index 000000000..1ed0ff956 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/Makefile @@ -0,0 +1,25 @@ + +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/circuit/Readme.md b/keyboards/planck/keymaps/circuit/Readme.md new file mode 100644 index 000000000..cbdf5de4e --- /dev/null +++ b/keyboards/planck/keymaps/circuit/Readme.md @@ -0,0 +1,44 @@ +##Design goals: +1. Arrow keys always available. +2. As close to a to my US layout 107-key QWERTY keyboard as I could manage, (i.e. as few arbitrary decisions as possible). +3. Togglable DVORAK keyboard. +4. most frequently used things in the easiest to reach places. +5. Ability to game on it, just for fun. + +My layout differs from most in the placement the ARROW keys, `ESC`, VOL keys, use of double-tap `CAPS`, and the GAME LOCK function. + +I put the layer buttons in the usual spots. I originally wanted only function/symbols layer, but that proved detrimental. I use some timed press actions to save some space, but this has been accounted for, (see GAME LOCK below). I'm not fully satisfied with the current product (see NOTES below), so it may change in the future. + +##Effective layers: +* Default later is obviously your letters and modifiers. +* Lower layer [NUMBER] is your numbers and punctuation. +* Upper layer [ACTION] is your symbols and actions. +* Function layer is the infrequently used function keys, layout toggle, game lock, and reset. + +There is also a toggle for the DVORAK/QWERTY layers, but in normal typing this is not of concern. + +###Special keys: +* `RSHFT` and `ENTER` are combined. Tap once for `ENTER` and hold for `RSHFT`. `ENTER` will be registered on release if released within 200 ms, else `RSHFT` is registered starting at 201 ms until release. +* If for some reason, this interferes with the normal usage of the `ENTER` key in any way, (some problem that may never happen), I have added a regular non-modified `ENTER` key on the same key in the [ACTION] layer. +* `LSHFT` and `CAPS` are also combined. The key works like a normal `LSHFT` unless double-tapped, in which case it counts as `CAPS`. This functionality unfortunately delays all key presses by at most 200 ms, but I have added ways to disable this both temporarily or permanently, described below. +* A failsafe `CAPS` key is on the same key in the [ACTION] layer. +* There are `UNDO`, `CUT`, `COPY`, and `PASTE` keys. This was intended to be a universal way to use these commands since in macOS cut is `⌘ + C` but in Windows it is `⌃ + C`. Unfortunately these special keys only work in Windows. ¯\\\_(ツ)\_/¯ + +##Game lock: +**TL;DR** the game lock toggle disables the double-tap `CAPS`, and disables `GUI` keys (WINDOWS key). + +I wished for this keyboard to be fully usable in the most demanding of games. The most demanding game I know of is ARMA 3 which has a binding to practically every individual key of a 107-key keyboard. This means I need to have pretty much every key possible somewhere. I also wanted the keyboard to be responsive in games for every critical keypress. This means having a way to disable features that introduce an inherent delay to registering keys, such as double-tap. + +I do not expect to see this used by the pros, but I enjoyed making it. As for use in ARMA 3, I got a little ways into the APEX campaign, but I found a few flaws. For Example, I cannot enable my HUD GPS since that requires `RCTRL`+`M` but `RCTRL` is not bound. The obvious fix is to rebind the action to a new key, but I still take this as a shortcoming of my layout. + +###If you wish to disable double-tap +####Disable it temporarily +Turn on the game lock. While on, it registers as normal `LSHFT` and has no delay. Whether in game mode or not, `CAPS` is on the same key in the [ACTION] layer. + +####Disable it permanently +Open the `Makefile` and set `TAP_DANCE_ENABLE = no`. I wrote the layout to compensate for this change, and no further changes to the code should be necessary. Whether or not it's disabled, `CAPS` is on the same key in the [ACTION] layer. + +##Notes: +* `ALT` and `GUI` are reversed compared to the normal US layout. I will also be using my Planck on my mac, and that's the standard in the Apple ecosystem. I may add a special compiler flag in the future to swap the two. +* The DVORAK `Z` key is to the right of the `S` key instead of under it as part of a compromise I made to keep the ARROW keys available on the default layer. I prioritize the ARROW keys, so the DVORAK layout is the one to suffer. +* I also support the little tones that the default Planck layout features, identical to them too, (minus those for layouts I don't support). To enable it, open the `Makefile` and set `AUDIO_ENABLE = yes`. diff --git a/keyboards/planck/keymaps/circuit/config.h b/keyboards/planck/keymaps/circuit/config.h new file mode 100644 index 000000000..22244f4a7 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/config.h @@ -0,0 +1,91 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* Tap-dance interval definition */ +#define TAPPING_TERM 200 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Planck Keyboard +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D0, D5, B5, B6 } +#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#ifdef SUBPROJECT_rev3 + #include "rev3/config.h" +#endif +#ifdef SUBPROJECT_rev4 + #include "rev4/config.h" +#endif + +#endif diff --git a/keyboards/planck/keymaps/circuit/keyboard-layout.png b/keyboards/planck/keymaps/circuit/keyboard-layout.png new file mode 100644 index 000000000..e9296a6d9 Binary files /dev/null and b/keyboards/planck/keymaps/circuit/keyboard-layout.png differ diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c new file mode 100644 index 000000000..63e01f389 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -0,0 +1,258 @@ +// Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _DVORAK 1 +#define _LOCKED 2 +#define _NUMBER 3 +#define _ACTION 4 +#define _FUNCTN 5 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + NUMBER, + ACTION +}; + +// Key code names +#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift +#define LOCK FUNC(1) +#define KC_PSTE KC_PASTE +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#ifdef TAP_DANCE_ENABLE +#define SFT_CAP TD(0) // Left shift, double tap for caps +#endif +#ifndef TAP_DANCE_ENABLE +#define SFT_CAP KC_LSFT // Regular left shift +#endif + +// Tap Dance Definitions +#ifdef TAP_DANCE_ENABLE +qk_tap_dance_action_t tap_dance_actions[] = { + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; +#endif + +// Function definitions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [1] = ACTION_LAYER_TOGGLE(_LOCKED) +}; + +// Layout definitions +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | BKSP | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |*Shift| Z | X | C | V | B | N | M | , | . | Up |SftEnt| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | Alt | Cmd | Vol- | ACTN | Space | NUMS | Vol+ | Left | Down | Left | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, + {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT} +}, + +/* DVORAK + * ,-----------------------------------------------------------------------------------. + * | | ' | , | . | P | Y | F | G | C | R | L | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | A | O | E | U | I | D | H | T | N | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ; | Q | J | K | X | B | M | W | V | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, + {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z }, + {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* LOCK + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | NULL | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOCKED] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* NUMBERS + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ~ | NULL | NULL | NULL | | | _ | + | { | } | ? | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ` | NULL | NULL | NULL | \ | - | = | [ | ] | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | NULL | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMBER] = { + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH}, + {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______}, + {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} +}, + +/* ACTIONS + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | Undo | Cut | Copy | Paste| NULL | NULL | NULL | NULL | NULL | PgUp | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | Mute | | NULL | | NULL | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_ACTION] = { + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT }, + {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END } +}, + +/* FUNCTIONS + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NULL | NULL | NULL | NULL | NULL |QWERTY|DVORAK| NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Reset| NULL | Lock | NULL | | NULL | | NULL | NULL | NULL | NULL | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTN] = { + {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, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} +} + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_DVORAK)) { +#ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); +#endif + layer_off(_DVORAK); + } + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + if (!IS_LAYER_ON(_DVORAK)) { +#ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); +#endif + layer_on(_DVORAK); + } + } + return false; + break; + case NUMBER: + if (record->event.pressed) { + layer_on(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + case ACTION: + if (record->event.pressed) { + layer_on(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/dbroqua/keymap.c b/keyboards/planck/keymaps/dbroqua/keymap.c new file mode 100644 index 000000000..33929cb3a --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/keymap.c @@ -0,0 +1,234 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MULTIMEDIA 3 +#define _ADJUST 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Func macro definitions. +#define SFT_TAB FUNC(0) // Tap for Enter, hold for Shift + +// Enable these functions using FUNC(n) macro. +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_MULTIMEDIA, KC_TAB) + }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | AltGr| Alt | Lower| Space | Raise| Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {SFT_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LCTL, KC_LGUI, KC_RALT, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | ( | ) | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | | | | | | | | | { | } | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | [ | ] | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home | PgDwn| PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LPRN, KC_RPRN}, + {BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | - | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | ` | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | \ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {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_GRV}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* _MULTIMEDIA + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Psc | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Mute | Vol+ | Vol- | | | |Insert| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Play | Next | Del | + * `-----------------------------------------------------------------------------------' + */ +[_MULTIMEDIA] = { + {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_VOLU, KC_VOLD, _______, _______, _______, KC_INS}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_DEL} +}, + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/dbroqua/layout.png b/keyboards/planck/keymaps/dbroqua/layout.png new file mode 100644 index 000000000..37b74cdc5 Binary files /dev/null and b/keyboards/planck/keymaps/dbroqua/layout.png differ diff --git a/keyboards/planck/keymaps/dbroqua/readme.md b/keyboards/planck/keymaps/dbroqua/readme.md new file mode 100644 index 000000000..777c76abd --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/readme.md @@ -0,0 +1,14 @@ +# Dbroqua Layout + +![Layout](layout.png "Dbroqua Keymap") + +* Online keyboard layout editor: http://www.keyboard-layout-editor.com/#/gists/e77306f9d14cc93fa26123b93b106474 +* Online keyboard layout editor (lower layer): http://www.keyboard-layout-editor.com/#/gists/786e03f6fbd274cb4f4e77a3d67f85fa +* Online keyboard layout editor (raise layer): http://www.keyboard-layout-editor.com/#/gists/2e22c71f6910103c20d595d1caa713d6 +* Online keyboard layout editor (multimedia layer): http://www.keyboard-layout-editor.com/#/gists/132ebf8053508a7a81dfa8e0756edb40 + +# Programming Instructions: +Enter into programming mode and run the following command. +``` +$ sudo KEYMAP=dbroqua make dfu +``` \ No newline at end of file diff --git a/keyboards/planck/keymaps/default/Makefile b/keyboards/planck/keymaps/default/Makefile index 38a504a27..0f4953888 100644 --- a/keyboards/planck/keymaps/default/Makefile +++ b/keyboards/planck/keymaps/default/Makefile @@ -11,7 +11,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = yes # MIDI controls +MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID @@ -22,4 +22,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/experimental/Makefile b/keyboards/planck/keymaps/experimental/Makefile index 877c4aed0..3a8250a9b 100644 --- a/keyboards/planck/keymaps/experimental/Makefile +++ b/keyboards/planck/keymaps/experimental/Makefile @@ -16,6 +16,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +ONEHAND_ENABLE = yes # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index d9303fcae..569dbcc8a 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -8,6 +8,7 @@ #endif #include "eeconfig.h" +#include "version.h" extern keymap_config_t keymap_config; @@ -69,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_FN0, KC_FN0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Colemak @@ -87,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_FN0, KC_FN0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak @@ -105,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {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_ESC, 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_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_FN0, KC_FN0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower @@ -185,7 +186,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - + ACTION_SWAP_HANDS_TAP_KEY(KC_SPC), }; #ifdef AUDIO_ENABLE diff --git a/keyboards/planck/keymaps/jeebak/Makefile b/keyboards/planck/keymaps/jeebak/Makefile new file mode 100644 index 000000000..581e08cd0 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c new file mode 100644 index 000000000..cb7ccb588 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -0,0 +1,459 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _TOUCHCURSOR 6 +#define _MOUSECURSOR 7 +#define _ADJUST 16 + +// Keycodes +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +enum macro_keycodes { + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, + KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper +#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI +#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab +#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab +#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings +#define AG_AGAIN M(KC_AG_AGAIN) +#define AG_UNDO M(KC_AG_UNDO) +#define AG_CUT M(KC_AG_CUT) +#define AG_COPY M(KC_AG_COPY) +#define AG_PASTE M(KC_AG_PASTE) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+--------| + * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + * |----------+------+------+------+------+------|------+------+------+------+------+--------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | + * |----------+------+------+------+------+------+------+------+------+------+------+--------| + * | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, + {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------------. + * | Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+--------| + * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | + * |----------+------+------+------+------+------|------+------+------+------+------+--------| + * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | + * |----------+------+------+------+------+------+------+------+------+------+------+--------| + * | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {CTL_ESC, KC_A, KC_R, LT_MC(KC_S),KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, + {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------------. + * | Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+--------| + * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | + * |----------+------+------+------+------+------|------+------+------+------+------+--------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | + * |----------+------+------+------+------+------+------+------+------+------+------+--------| + * | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {CTL_ESC, KC_A, KC_O, LT_MC(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_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, + {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite | | | | | | | Prev | Stop | Slct | Mute | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_LBRC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {KC_RBRC, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite | | | | | | | Prev | Stop | Slct | Mute | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE}, + {KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS}, + {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} +}, + +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,-----------------------------------------------------------------------------------. + * |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. + */ + +[_TOUCHCURSOR] = { + {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, + {_______, KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R }, + {_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R, CMD_SLSH,_______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Mouse Layer + * ,-----------------------------------------------------------------------------------. + * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = { + {_______, _______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, + {_______, KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5}, + {_______, _______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |Reset | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + default_layer_set(1UL<<_DVORAK); + } + 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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: + // quantum/quantum.c + if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. + } + + switch (id) { + case KC_ALT_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + case KC_CMD_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + + case KC_CTL_TAB: + return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + + case KC_AG_FIND: + return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); + case KC_AG_AGAIN: + return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); + case KC_AG_UNDO: + return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); + case KC_AG_CUT: + return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); + case KC_AG_COPY: + return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); + case KC_AG_PASTE: + return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); + + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); + } + + return MACRO_NONE; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md new file mode 100644 index 000000000..e1dd1dca5 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -0,0 +1,127 @@ +jeebak's layout +======================= +This WIP keymap attempts to minimize fingers straying away from the home row. +To aid in this endeavor, when additional modifyer keys to switch layers are +needed, they will be mapped to home row keys. The `keymap.c` file will contain +the exact changes. The diagrams in this README shows the highlights of the +changes from the default mappings. + +I also decided to change all calls to `persistant_default_layer_set()` to +`default_layer_set()` since this is my personal perference. + +## Macros +``` +#define ALT_TAB M(KC_ALT_TAB) +``` + +## Base Layers (Qwerty/Colemak/Dvorak) +These base layers are mostly the same as the default mappings. The interesting +changes are shown below. + +- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, +- `GUI/;` as `;` and `GUI`, +- `Alt/"` as `"` and `Alt`, +- `Sft/Ent` as `Enter` and `Shift`, and +- `Hyper/Tab` as `Tab` and `Hyper` + +A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. +The arrow keys, which have been moved to the +[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been +replaced with the Media keys as shown. The `MC/kc` key activates the +`MouseCursor` layer when held, and emits the corresponding `kc` for its layer, +when tapped. +``` + ,-----------------------------------------------------------------------------------------. + | Hyper/Tab| | | | | | | | | | | | + |----------+------+------+------+------+-------------+------+------+------+------+--------| + | Ctrl/Esc | | |MC/kc | | | | | | |GUI/; | Alt/" | + |----------+------+------+------+------+------|------+------+------+------+------+--------| + | | | | | | | | | | | |Sft/Ent | + |----------+------+------+------+------+------+------+------+------+------+------+--------| + | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------------' +``` + +## Lower Layer (Symbols and Function Keys) +The symbols and functions keys are essentially the same as the default mapping. +The most notable changes are that the symbol keys from the `RAISE` layer have +been moved here. The remaining Media keys replace those that are now on the +base layers. The `BACKLIT` key has also been moved here. +``` + ,-----------------------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + |Brite | | | | | | | Prev | Stop | Slct | Mute | + `-----------------------------------------------------------------------------------' +``` + +## Raise Layer (Numbers and Arithmetic Operators) +All of the numbers and arithmetic operators are available on this layer. Some +keys are duplicated for the convenience of their positions. The `0` and `$` +keys at the far left are for quick access to beginning and end of line in vim. +``` + ,-----------------------------------------------------------------------------------. + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + |Brite | | | | | | | Prev | Stop | Slct | Mute | + `-----------------------------------------------------------------------------------' +``` + +## TouchCursor layer plus personal customizations +[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key +as the modifier, with the `IJKL` home row keys representing the inverted-T of +the arrow keys. All of the default TouchCursor keymappings for the right hand +are represented below. My personalizations include all of the keys shown for +the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key +from the base layers) readily accessible from the home row allows quick word +jumps and highlighting when used in conjunction with the arrow keys. The +`Alt-Tab` macro is not only useful under Windows, but also under Mac when used +with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). +The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in +this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` +keycodes do not seem to work. There are macros in place that'll "automatically" +choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, +etc.) depending on which layout you've currently selected (`AG_NORM` or +`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I +use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and +`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as +Google Chrome. +``` + ,-----------------------------------------------------------------------------------. + |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| + |------+------+------+------+------+------|------+------+------+------+------+------| + | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` + +## Mouse Layer +The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. +The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the +mouse from the `doc/keycode.txt` file are represented, and logically located, +IMHO. The left and right click buttons are duplicated; on the right hand side, +for a quick click here and there, and again on the left hand side for when the +buttons need to be held for dragging things or highlighting text, thus allowing +the right hand to be free to use the up/down/left/right actions. +``` + ,-----------------------------------------------------------------------------------. + | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/planck/keymaps/jhenahan/Makefile b/keyboards/planck/keymaps/jhenahan/Makefile new file mode 100644 index 000000000..de01ad240 --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/jhenahan/config.h b/keyboards/planck/keymaps/jhenahan/config.h new file mode 100644 index 000000000..cd3adc41c --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define FORCE_NKRO +#define WORKMAN_SOUND COLEMAK_SOUND + +#endif diff --git a/keyboards/planck/keymaps/jhenahan/keymap.c b/keyboards/planck/keymaps/jhenahan/keymap.c new file mode 100644 index 000000000..2bda4b695 --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/keymap.c @@ -0,0 +1,314 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _WORKMAN 0 +#define _DEAD 1 +#define _QWERTY 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + WORKMAN = SAFE_RANGE, + DEAD, + QWERTY, + LOWER, + RAISE, + PLOVER, + EXT_PLV, + TOG_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +/* Workman + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | H | T | G | Y | N | E | O | I | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | M | C | V | K | L | Dead | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_WORKMAN] = { + {KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC}, + {MT(MOD_LCTL,KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, DEAD, KC_DOT, KC_SLSH, KC_ENT}, + {KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Workman Dead Layer + * ,-----------------------------------------------------------------------------------. + * | | % | & | ? | + | @ | $ | _ | [ | ] | ! | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | / | ( | = | 0 | { | } | 1 | * | ) | - | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | 6 | 7 | 8 | 9 | | | \ | 2 | 3 | 4 | 5 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | < | ~ | ` | , | # | ^ | > | | | + * `-----------------------------------------------------------------------------------' + */ +[_DEAD] = { + {XXXXXXX, KC_PERC, KC_AMPR, KC_QUES, KC_PLUS, KC_AT, KC_DLR, KC_UNDS, KC_LBRC, KC_RBRC, KC_EXLM, XXXXXXX}, + {XXXXXXX, KC_SLSH, KC_LPRN, KC_EQL, KC_0, KC_LCBR, KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, XXXXXXX}, + {XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_BSLS, KC_2, KC_3, KC_4, KC_5, XXXXXXX}, + {XXXXXXX, XXXXXXX, KC_LT, KC_TILD, KC_GRV, KC_COMM, KC_COMM, KC_HASH, KC_CIRC, KC_GT, XXXXXXX, XXXXXXX} +}, + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {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_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | Vol+ |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Next | Vol- | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS), _______, KC_VOLU, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_MPLY} +}, + +/* Raise - KWM Interaction + * ,-----------------------------------------------------------------------------------. + * |Restrt| |TgSplt|Flotng|Parent|FlScrn|InsMrk| InsW | InsS | InsN | InsE | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Mark |Rotate|Prefix| Term | BSP |SwpMrk|SwapW |SwapS |SwapN |SwapE | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |MarkW |MarkS |MarkN |MarkE |Monocl|Float |FocusW|FocusS|FocusN|FocusE| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {LCAG(KC_Q), XXXXXXX, LCAG(KC_S), LCAG(KC_W), LCAG(KC_D), LCAG(KC_F), LCTL(S(KC_X)), LCTL(S(KC_H)), LCTL(S(KC_J)), LCTL(S(KC_K)), LCTL(S(KC_L)), XXXXXXX}, + {XXXXXXX, LCAG(KC_M), LGUI(LCTL(KC_R)), LCAG(KC_DOT), LCAG(KC_T), LGUI(LCTL(KC_A)), LCTL(LALT(KC_M)), LCTL(LALT(KC_H)), LCTL(LALT(KC_J)), LCTL(LALT(KC_K)), LCTL(LALT(KC_L)), XXXXXXX}, + {_______, LCAG(KC_H), LCAG(KC_J), LCAG(KC_K), LCAG(KC_L), LGUI(LCTL(KC_S)), LGUI(LCTL(KC_D)), LGUI(LALT(KC_H)), LGUI(LALT(KC_J)), LGUI(LALT(KC_K)), LGUI(LALT(KC_L)), _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC}, + {TOG_PLV, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_M, KC_C, XXXXXXX, XXXXXXX, KC_L, KC_COMM, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Workmn|Plover| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, PLOVER, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_workman[][2] = SONG(WORKMAN_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_workman, false, 0); + #endif + persistant_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case DEAD: + if (record->event.pressed) { + layer_on(_DEAD); + set_oneshot_layer(_DEAD, ONESHOT_START); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_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 PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + case TOG_PLV: + if (record->event.pressed) { + register_code(KC_R); + register_code(KC_W); + register_code(KC_T); + register_code(KC_C); + register_code(KC_P); + register_code(KC_O); + clear_keyboard(); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/jhenahan/readme.md b/keyboards/planck/keymaps/jhenahan/readme.md new file mode 100644 index 000000000..a80506fc9 --- /dev/null +++ b/keyboards/planck/keymaps/jhenahan/readme.md @@ -0,0 +1,41 @@ +# jhenahan's layout + +## Layout + +The base layer is based on the +[Workman Dead](https://github.com/ojbucao/Workman/tree/master/mac) layout. The +primary interaction layer is a slightly modified Workman layout with a 'dead' +key on the third row under the middle finger. The dead key activates a layer of +special characters. + +## [Layers](http://www.keyboard-layout-editor.com/#/gists/2b875f7d5d76fe4408c0a5b3bd76ddae) +### Function Layer + +This is very slightly modified from the default, mainly just to rearrange the media keys. + +### [KWM](https://github.com/koekeishiya/kwm) Interaction Layer + +`kwm` is a tiling window manager for OS X. The keys defined in my keymap +correspond to the settings I use in +[my `kwmrc` file](https://github.com/jhenahan/dotfiles/blob/master/kwm/kwmrc). + +### QWERTY + +Just in case. + +### [Plover](http://www.openstenoproject.org/plover/) + +This layout functions exactly as a Workman layout unless you're running the Plover +application. Includes a key for toggling Plover while it's running. + +Add this in the appropriate section of your `plover.cfg` to allow this altered layout: + +``` ini +[System: English Stenotype] +keymap[keyboard] = [["#", ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "="]], ["S-", ["q", "a"]], ["T-", ["d"]], ["K-", ["s"]], ["P-", ["r"]], ["W-", ["h"]], ["H-", ["w"]], ["R-", ["t"]], ["A-", ["m"]], ["O-", ["c"]], ["*", ["y", "g", "j", "b"]], ["-E", ["l"]], ["-U", [","]], ["-F", ["f"]], ["-R", ["n"]], ["-P", ["u"]], ["-B", ["e"]], ["-L", ["p"]], ["-G", ["o"]], ["-T", [";"]], ["-S", ["i"]], ["-D", ["BackSpace"]], ["-Z", ["'"]], ["no-op", ["\\", "]", "x", ".", "/"]], ["arpeggiate", ["space"]]] +``` + +### Adjust Layer + +This layer is only slightly modified from the default to remove Dvorak and +Colemak and replace them with Workman. diff --git a/keyboards/planck/keymaps/premek/Makefile b/keyboards/planck/keymaps/premek/Makefile new file mode 100644 index 000000000..0f4953888 --- /dev/null +++ b/keyboards/planck/keymaps/premek/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/premek/keymap.c b/keyboards/planck/keymaps/premek/keymap.c new file mode 100644 index 000000000..9b212ab25 --- /dev/null +++ b/keyboards/planck/keymaps/premek/keymap.c @@ -0,0 +1,231 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH}, + {KC_LGUI, _______, _______, KC_LALT, LOWER, KC_SPC, KC_ENT, KC_SPC, RAISE, KC_RALT, _______, KC_RGUI} +}, +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_DVORAK] = { + {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_ESC, 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_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0}, + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END }, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F12, KC_PLUS, KC_PIPE, KC_LCBR, KC_RCBR}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, +[_RAISE] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, + {_______, _______, _______, KC_QUOT, KC_MINS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}, + {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, _______, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + 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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/premek/readme.md b/keyboards/planck/keymaps/premek/readme.md new file mode 100644 index 000000000..16debdd63 --- /dev/null +++ b/keyboards/planck/keymaps/premek/readme.md @@ -0,0 +1,4 @@ +# Split Layout +Inspired by TECK + +[Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=gateron&switchType=KS-3-Tea&pcb:true%3B&@_c=%23e6e6e6&t=%23757575&a:7&fa@:5%3B%3B&=Esc&_a:4&fa@:5&:0&:0&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A!%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%0A%2F@%0A2%0A%0A%0A%0A%0A%0AW&=%0A%0A%23%0A3%0A%0A%0A%0A%0A%0AE&=%0A%0A$%0A4%0A%0A%0A%0A%0A%0AR&=%0A%0A%25%0A5%0A%0A%0A%0A%0A%0AT&_c=%23e3b02d&a:7%3B&=Del&_c=%23e6e6e6&a:4%3B&=%0A%0A%5E%0A6%0A%0A%0A%0A%0A%0AY&=%0A%0A%2F&%0A7%0A%0A%0A%0A%0A%0AU&=%0A%0A*%0A8%0A%0A%0A%0A%0A%0AI&=%0A%0A(%0A9%0A%0A%0A%0A%0A%0AO&=%0A%0A)%0A0%0A%0A%0A%0A%0A%0AP%3B&@_a:7%3B&=Shift&_a:4%3B&=%0A%0A%0AF1%0A%0A%0A%0A%0A%0AA&=%0A%0A%0AF2%0A%0A%0A%0A%0A%0AS&=%0A%0A'%0AF3%0A%0A%0A%0A%0A%0AD&_c=%23e3b02d&n:true%3B&=%0A%0A-%0AF4%0A%0A%0A%0A%0A%0AF&_c=%23e6e6e6%3B&=%0A%0A%0AF5%0A%0A%0A%0A%0A%0AG&_c=%23e3b02d&a:7%3B&=Tab&_c=%23e6e6e6&a:4%3B&=%0A%0A%0AF6%0A%0A%0A%0A%0A%0AH&_c=%23e3b02d&n:true%3B&=%0A%0A%2F&larr%2F%3B%0AHom%0A%0A%0A%0A%0A%0AJ&_c=%23e6e6e6%3B&=%0A%0A%2F&darr%2F%3B%0APgD%0A%0A%0A%0A%0A%0AK&=%0A%0A%2F&uarr%2F%3B%0APgU%0A%0A%0A%0A%0A%0AL&=%0A%0A%2F&rarr%2F%3B%0AEnd%0A%0A%0A%0A%0A%0A%2F%3B%3B&@_a:7%3B&=Ctrl&_a:4%3B&=%0A%0A~%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%60%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A+%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%2F=%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%7C%0AF11%0A%0A%0A%0A%0A%0AB&_c=%23e3b02d&a:7%3B&=BSp&_c=%23e6e6e6&a:4%3B&=%0A%0A%5C%0AF12%0A%0A%0A%0A%0A%0AN&=%0A%0A%5B%0A%0A%0A%0A%0A%0A%0AM&=%0A%0A%5D%0A%0A%0A%0A%0A%0A%0A,&=%0A%0A%7B%0A%0A%0A%0A%0A%0A%0A.&=%0A%0A%7D%0A%0A%0A%0A%0A%0A%0A%2F%2F%3B&@_a:7%3B&=&=&=&=Alt&_c=%23e3b02d%3B&=%2F&dArr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&crarr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&uArr%2F%3B&_c=%23e6e6e6%3B&=Alt&=&=) diff --git a/keyboards/planck/keymaps/pvc/keymap.c b/keyboards/planck/keymaps/pvc/keymap.c index 2fc5f0da1..0bb7f0def 100644 --- a/keyboards/planck/keymaps/pvc/keymap.c +++ b/keyboards/planck/keymaps/pvc/keymap.c @@ -166,9 +166,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * .-----------------------------------------------------------------------------------------------------------. * | | $ | { | [ | ( | % | # | ) | ] | } | @ | PG UP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | ^ | * | + | - | ; | : | _ | ' | " | ` | PG DN | + * | | ^ | * | + | - | / | \ | _ | ' | " | ` | PG DN | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | & | ! | ~ | / | \ | = | < | > | ? | HOME | + * | | | | & | ! | ~ | ; | : | = | < | > | ? | HOME | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * | | | | | | | | | | | | END | * '-----------------------------------------------------------------------------------------------------------' @@ -176,27 +176,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_LOWER] = { // LOWER { _______, KC_DLR, KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT, KC_PGUP }, - { _______, KC_CIRC, KC_ASTR, KC_PPLS, KC_PMNS, KC_SCLN, KC_COLN, KC_UNDS, KC_QUOT, KC_DQT, KC_GRV, KC_PGDN }, - { _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SLSH, KC_BSLS, KC_EQL, KC_LT, KC_GT, KC_QUES, KC_HOME }, + { _______, KC_CIRC, KC_ASTR, KC_PPLS, KC_PMNS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT, KC_GRV, KC_PGDN }, + { _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL, KC_LT, KC_GT, KC_QUES, KC_HOME }, { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END }, }, /* FUNCTION * .-----------------------------------------------------------------------------------------------------------. - * | NUM LK | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | PAUSE | + * | NUM LK | F13 | F14 | F15 | F16 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | PAUSE | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAP LK | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | PRINT | + * | CAP LK | F17 | F18 | F19 | F20 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | PRINT | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SCR LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | MUTE | + * | SCR LK | F21 | F22 | F23 | F24 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | MUTE | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | LCTRL | LWIN | FN | LALT | UPPER | PLAY | PLAY | LOWER | VOL UP | VOL DN | NEXT | PREV | * '-----------------------------------------------------------------------------------------------------------' */ [LAYER_FUNCTION] = { // FUNCTION - { KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PAUS }, - { KC_CAPS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_PSCR }, - { KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE }, + { KC_NLCK, KC_F13, KC_F14, KC_F15, KC_F16, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS }, + { KC_CAPS, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR }, + { KC_SLCK, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE }, { _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, KC_VOLU, KC_VOLD, KC_MPRV, KC_MNXT }, }, diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..192933b18 --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -0,0 +1,262 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {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_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, + {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + 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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/xyverz/makefile.mk b/keyboards/planck/keymaps/xyverz/makefile.mk new file mode 100644 index 000000000..93a89bb4a --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/makefile.mk @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/planck.c b/keyboards/planck/planck.c index 8d70bb4e5..645b450d1 100644 --- a/keyboards/planck/planck.c +++ b/keyboards/planck/planck.c @@ -1,5 +1,15 @@ #include "planck.h" +#ifdef ONEHAND_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; +#endif + void matrix_init_kb(void) { // Turn status LED on DDRE |= (1<<6); diff --git a/keyboards/planck/readme.md b/keyboards/planck/readme.md index f89fdeb93..4b24a690e 100644 --- a/keyboards/planck/readme.md +++ b/keyboards/planck/readme.md @@ -13,15 +13,17 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` + Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. ### Notable forks (which some of the keymap files are from) diff --git a/keyboards/planck/rev3/Makefile b/keyboards/planck/rev3/Makefile index 3ed1445e4..191c6bb66 100644 --- a/keyboards/planck/rev3/Makefile +++ b/keyboards/planck/rev3/Makefile @@ -1,5 +1,3 @@ -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile endif \ No newline at end of file diff --git a/keyboards/planck/rev3/rules.mk b/keyboards/planck/rev3/rules.mk new file mode 100644 index 000000000..3ed1445e4 --- /dev/null +++ b/keyboards/planck/rev3/rules.mk @@ -0,0 +1,5 @@ +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/planck/rev4/Makefile b/keyboards/planck/rev4/Makefile index ed09f85a4..191c6bb66 100644 --- a/keyboards/planck/rev4/Makefile +++ b/keyboards/planck/rev4/Makefile @@ -1,5 +1,3 @@ -AUDIO_ENABLE ?= yes # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../../Makefile endif \ No newline at end of file diff --git a/keyboards/planck/rev4/rules.mk b/keyboards/planck/rev4/rules.mk new file mode 100644 index 000000000..ed09f85a4 --- /dev/null +++ b/keyboards/planck/rev4/rules.mk @@ -0,0 +1,5 @@ +AUDIO_ENABLE ?= yes # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk new file mode 100644 index 000000000..25db53a31 --- /dev/null +++ b/keyboards/planck/rules.mk @@ -0,0 +1,67 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/preonic/Makefile b/keyboards/preonic/Makefile index 08e9205cb..4e2a6f00f 100644 --- a/keyboards/preonic/Makefile +++ b/keyboards/preonic/Makefile @@ -1,73 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/0xdec/Makefile b/keyboards/preonic/keymaps/0xdec/Makefile new file mode 100644 index 000000000..6600e3689 --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/Makefile @@ -0,0 +1,21 @@ +# Build Options + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/preonic/keymaps/0xdec/README.md b/keyboards/preonic/keymaps/0xdec/README.md new file mode 100644 index 000000000..603d3d455 --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/README.md @@ -0,0 +1,30 @@ +Ergonomic Colemak Keymap +======================== +An ergonomically optimized Colemak keymap for the grid-layout Preonic + +Modes +---------- + +#### Colemak + +> Base layer + +- All alphanumerics and symbols available on the base layer + +---------- + +#### Game + +> QWERTY layout for use with games or number entry + +- Standard QWERTY layout +- Integrated right-hand numpad in phone layout + +---------- + +#### Function (Raise) + +> Functions and mode switching + +- Turns NEIO into arrow cluster, with nav cluster below (Home, Page Down, Page Up, End) +- Reset key at lower left (Esc) diff --git a/keyboards/preonic/keymaps/0xdec/config.h b/keyboards/preonic/keymaps/0xdec/config.h new file mode 100644 index 000000000..5fc9b6f34 --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/config.h @@ -0,0 +1,10 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// Number of backlight levels +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 5 + +#endif diff --git a/keyboards/preonic/keymaps/0xdec/keymap.c b/keyboards/preonic/keymaps/0xdec/keymap.c new file mode 100644 index 000000000..6c4b8a6fa --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/keymap.c @@ -0,0 +1,173 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Layer names +#define _COLEMAK 0 +#define _GAME 1 +#define _RAISE 2 + +enum preonic_keycodes { + COLEMAK = SAFE_RANGE, + GAME, + RAISE +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | = | Q | W | F | P | G | J | L | U | Y | [ | ] | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | - | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ; | Z | X | C | V | B | K | M | , | . | / | ENTER| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | ALT | GUI | SHIFT| CTRL | BKSP | SPACE| RAISE| SHIFT| | DEL | TAB | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_BSLS}, + {KC_EQL ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_LBRC,KC_RBRC}, + {KC_MINS,KC_A ,KC_R ,KC_S ,KC_T ,KC_D ,KC_H ,KC_N ,KC_E ,KC_I ,KC_O ,KC_QUOT}, + {KC_SCLN,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_K ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_ENT }, + {KC_ESC ,KC_LALT,KC_LGUI,KC_LSFT,KC_LCTL,KC_BSPC,KC_SPC ,RAISE ,KC_RSFT,_______,KC_DEL ,KC_TAB } +}, + +/* Game + * ,-----------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 |NUM LK| ÷ | × | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | TAB | Q | W | E | R | T | Y | U | 1 | 2 | 3 | + | + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | CTRL | A | S | D | F | G | H | J | 4 | 5 | 6 | = | + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | SHIFT| Z | X | C | V | B | N | M | 7 | 8 | 9 | ENTER| + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | | ALT | GUI | SPACE| CTRL | BKSP | SPACE| RAISE| , | 0 | . | TAB | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = { + {KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,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_P1 ,KC_P2 ,KC_P3 ,KC_PPLS}, + {KC_LCTL,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PEQL}, + {KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PENT}, + {XXXXXXX,KC_LALT,KC_LGUI,KC_SPC ,KC_LCTL,KC_BSPC,KC_SPC ,RAISE ,KC_PCMM,KC_P0 ,KC_PDOT,KC_TAB } +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | SLEEP| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |PRTSCR| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | SYM | F11 | F12 | |AU TOG| VOL+ |BL INC|COLMAK| GAME | MUSIC| MENU |SCRLCK| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | PREV | STOP | PLAY | NEXT | VOL- |BL DEC| LEFT | DOWN | UP | RIGHT| PAUSE| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | BACK | STOP | RFRSH| FRWRD| MUTE |BL TOG| HOME | PGDN | PGUP | END |INSERT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RESET| | | | | DEL | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_SLEP,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_PSCR}, + {XXXXXXX,KC_F11 ,KC_F12 ,XXXXXXX,AU_TOG ,KC_VOLU,BL_INC ,COLEMAK,GAME ,MU_TOG ,KC_MENU,KC_SLCK}, + {KC_CAPS,KC_MPRV,KC_MSTP,KC_MPLY,KC_MNXT,KC_VOLD,BL_DEC ,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_PAUS}, + {XXXXXXX,KC_WBAK,KC_WSTP,KC_WREF,KC_WFWD,KC_MUTE,BL_TOGG,KC_HOME,KC_PGDN,KC_PGUP,KC_END ,KC_INS }, + {RESET ,_______,_______,_______,_______,KC_DEL ,_______,_______,_______,_______,_______,_______} +} + +}; + + + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_game[][2] = { + {NOTE_E6, 10} ,{NOTE_E6, 10} ,{NOTE_REST, 10} ,{NOTE_E6, 10} , + {NOTE_REST, 10} ,{NOTE_C6, 10} ,{NOTE_E6, 10} ,{NOTE_REST, 10} , + {NOTE_G6, 10} ,{NOTE_REST, 30}, + {NOTE_G5, 10} ,{NOTE_REST, 30} +}; +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +void startup_user() { + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} +void shutdown_user() { + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) { + music_scale_user(); +} +void music_scale_user(void) { + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif + + + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case GAME: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_game, false, STACCATO); + #endif + persistant_default_layer_set(1UL<<_GAME); + } + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + break; + default: + return true; + break; + } + + return false; +}; diff --git a/keyboards/preonic/keymaps/jacwib/Makefile b/keyboards/preonic/keymaps/jacwib/Makefile new file mode 100644 index 000000000..3e87d41d3 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/Makefile @@ -0,0 +1,20 @@ + + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/preonic/keymaps/jacwib/config.h b/keyboards/preonic/keymaps/jacwib/config.h new file mode 100644 index 000000000..23e9e0ed2 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define FORCE_NKRO 1 + +#endif diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c new file mode 100644 index 000000000..cf441bf30 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -0,0 +1,215 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "keymap_nordic.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Å | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | Ö | Ä | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| < | Z | X | C | V | B | N | M | . | , | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |AltGr |Lower | Space| Enter|Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_BSPC}, + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH}, + {KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS}, + {KC_LCTL, KC_LGUI, KC_LALT, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | @ | £ | $ | | | { | [ | ] | } | \ | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | |VolUp | | | ~ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |LastS |PauseP|NextS | | * | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | |VolDwn| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | |Bspc | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD}, + {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, LSFT(KC_BSLS)}, + {_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ! | " | # | ¤ | % | & | / | ( | ) | = | ? | Ins | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Mouse^| | | | |ScrlUp| | | ^ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | |Mouse<|MouseV|Mouse>| | |MLC |MMC |MRC | ' | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | > | | | | | | |ScrlDown| : | ; | _ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |Bspc | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {LSFT(KC_1),NO_QUO2,LSFT(KC_3), NO_BULT,LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL, NO_QUES, KC_INS}, + {_______, _______, _______, KC_MS_U, _______, _______, _______, _______, KC_WH_U, _______, _______, NO_CIRC}, + {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, NO_APOS, NO_QUOT}, + {_______, NO_GRTR, _______, _______, _______, _______, _______, _______, KC_WH_D, NO_COLN, NO_SCLN, NO_UNDS}, + {_______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Reset| | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | |Rsft | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |MusOn |MusOff| | | | | | | | | Reset| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {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_RSFT}, + {_______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, RESET }, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +}; + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/preonic/keymaps/jacwib/readme.md b/keyboards/preonic/keymaps/jacwib/readme.md new file mode 100644 index 000000000..066031235 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/readme.md @@ -0,0 +1,3 @@ +# Jacwib's preonic keymap. + +Designed for use with a swedish language. diff --git a/keyboards/preonic/keymaps/kinesis/Makefile b/keyboards/preonic/keymaps/kinesis/Makefile new file mode 100644 index 000000000..6c8d2897c --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/Makefile @@ -0,0 +1,27 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +TAP_DANCE_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/ergodox_ez/config.h b/keyboards/preonic/keymaps/kinesis/config.h similarity index 64% rename from keyboards/ergodox_ez/config.h rename to keyboards/preonic/keymaps/kinesis/config.h index 2bb56731b..086baa84f 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/preonic/keymaps/kinesis/config.h @@ -1,6 +1,5 @@ /* Copyright 2012 Jun Wako -Copyright 2013 Oleg Kostyuk 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 @@ -23,22 +22,25 @@ along with this program. If not, see . /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1307 +#define PRODUCT_ID 0x6061 #define DEVICE_VER 0x0001 -#define MANUFACTURER ErgoDox EZ -#define PRODUCT ErgoDox EZ -#define DESCRIPTION QMK keyboard firmware for Ergodox EZ +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Preonic Keyboard +#define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 6 +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 -#define MOUSEKEY_DELAY 100 -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_MAX_SPEED 3 -#define MOUSEKEY_TIME_TO_MAX 10 +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D2, D5, B5, B6, D3 } +#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define UNUSED_PINS -#define TAPPING_TOGGLE 1 +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -47,9 +49,7 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 -#define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#define DEBOUNCING_DELAY 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -58,15 +58,24 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* ws2812 RGB LED */ +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 28 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + /* * Feature disable options * These options are also useful to firmware size reduction. */ +#define TAPPING_TERM 200 + /* disable debug print */ // #define NO_DEBUG @@ -79,6 +88,5 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -//#define DEBUG_MATRIX_SCAN_RATE #endif diff --git a/keyboards/preonic/keymaps/kinesis/keymap.c b/keyboards/preonic/keymaps/kinesis/keymap.c new file mode 100644 index 000000000..9691be91d --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/keymap.c @@ -0,0 +1,144 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _FN 1 +#define _ULCK 2 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define HYP_TIC ALL_T(KC_GRV) +#define EQ_LOCK TD(TD_EQ_LOCK) +#define MIN_ULK TD(TD_MIN_ULOCK) + +//Tap Dance Declarations +enum { + TD_EQ_LOCK = 0, + TD_MIN_ULOCK +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | FN | ` | Alt | LGUI | Back | ESC |ENTER | SPCE | RGUI | [ | ] | FN | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = { + {EQ_LOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MIN_ULK }, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS }, + {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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC }, + {MO(_FN), HYP_TIC, KC_LALT, KC_LGUI, KC_BSPC, KC_ESC, KC_ENT, KC_SPC, KC_RGUI, KC_LBRC, KC_RBRC, MO(_FN) } + }, + + /* Fn + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | VOL- | VOL+ | MUTE |BLtogg| | LEFT | DOWN | UP | RGHT | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | BL- | BL+ |Aud on|AudOff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff| | |PLY/PS| | PREV | NEXT | | + * `-----------------------------------------------------------------------------------' + */ + [_FN] = { + {_______, 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, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______ }, + {_______, KC_VOLD, KC_VOLU, KC_MUTE, BL_TOGG, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______ }, + {_______, BL_DEC, BL_INC, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______ }, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, KC_MPLY, _______, KC_MPRV, KC_MNXT, _______ } + } + +}; + +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +/*bool process_record_user(uint16_t keycode, keyrecord_t *record) {*/ + /*return true;*/ + /*[>switch (keycode) {<]*/ + /*[>case QWERTY:<]*/ + /*[>return true;<]*/ + /*[>}<]*/ +/*};*/ + +void matrix_init_user(void) { + startup_user(); +} + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + + +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for equal, twice for hyper + X (alfred lock) + [TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)), + //Tap once for minus, twice for time.heals.nothing + [TD_MIN_ULOCK] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, M(_ULCK)) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _ULCK: + if (record->event.pressed) { + /* time.heals.nothing */ + return MACRO( I(220), T(T), T(I), T(M), T(E), T(DOT), T(H), T(E), T(A), T(L), T(S), T(DOT), T(N), T(O), T(T), T(H), T(I), T(N), T(G), END); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/preonic/keymaps/kinesis/readme.md b/keyboards/preonic/keymaps/kinesis/readme.md new file mode 100644 index 000000000..e911968dd --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/readme.md @@ -0,0 +1 @@ +# The default Preonic layout - largely based on the Planck's \ No newline at end of file diff --git a/keyboards/preonic/keymaps/xyverz/keymap.c b/keyboards/preonic/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..adc7392e5 --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/keymap.c @@ -0,0 +1,342 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MUSIC 5 +#define _ADJUST 16 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define COLEMAK M(_COLEMAK) +#define DVORAK M(_DVORAK) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) +#define M_BL 5 +#define AUD_OFF M(6) +#define AUD_ON M(7) +#define MUS_OFF M(8) +#define MUS_ON M(9) +#define VC_IN M(10) +#define VC_DE M(11) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | - | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, 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_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, + {KC_MINS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Music (reserved for process_action_user) + * + */ +[_MUSIC] = { + {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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {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_DEL}, + {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, + {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +#ifdef AUDIO_ENABLE +float start_up[][2] = { + {440.0*pow(2.0,(14)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8}, + {440.0*pow(2.0,(18)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + break; + case _COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case _DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + 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); + } + 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); + } + break; + case M_BL: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + case 6: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_off(); + #endif + } + break; + case 7: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_on(); + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif + } + break; + case 8: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + layer_off(_MUSIC); + stop_all_notes(); + #endif + } + break; + case 9: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(music_scale, false, 0); + layer_on(_MUSIC); + #endif + } + break; + case 10: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_iterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + case 11: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_deiterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif +} + +#ifdef AUDIO_ENABLE + +uint8_t starting_note = 0x0C; +int offset = 7; + +void process_action_user(keyrecord_t *record) { + + if (IS_LAYER_ON(_MUSIC)) { + if (record->event.pressed) { + play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); + } else { + stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); + } + } + +} + +void play_goodbye_tone() +{ + PLAY_NOTE_ARRAY(goodbye, false, 0); + _delay_ms(150); +} + +#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/xyverz/makefile.mk b/keyboards/preonic/keymaps/xyverz/makefile.mk new file mode 100644 index 000000000..628167ff6 --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/makefile.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = yes \ No newline at end of file diff --git a/keyboards/preonic/preonic.c b/keyboards/preonic/preonic.c index 889c3fc8f..d9c119b8d 100644 --- a/keyboards/preonic/preonic.c +++ b/keyboards/preonic/preonic.c @@ -1,5 +1,16 @@ #include "preonic.h" +#ifdef ONEHAND_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + {{11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, +}; +#endif + void matrix_init_kb(void) { // Turn status LED on diff --git a/keyboards/preonic/readme.md b/keyboards/preonic/readme.md index f0be255a0..10763ee97 100644 --- a/keyboards/preonic/readme.md +++ b/keyboards/preonic/readme.md @@ -13,13 +13,15 @@ Download or clone the whole firmware and navigate to the keyboards/preonic folde Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap, create a file in the keymaps folder named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` + Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk new file mode 100644 index 000000000..d0f3a3a1c --- /dev/null +++ b/keyboards/preonic/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/readme.md b/keyboards/readme.md index e97986546..81a23c7e5 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -9,37 +9,47 @@ These keyboards are manufactured by the maintainers of QMK. What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and killer tactile feel. These are available through [olkb.com](http://olkb.com) as well as through [Massdrop](http://massdrop.com) from time to time, as easy to assemble kits. -* [Planck](/keyboards/planck/) - A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine. -* [Preonic](/keyboards/preonic/) - Like the Planck, but bigger. 50%. -* [Atomic](/keyboards/atomic/) - Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard. +* [Planck](/keyboards/planck/) — A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine. +* [Preonic](/keyboards/preonic/) — Like the Planck, but bigger. 50%. +* [Atomic](/keyboards/atomic/) — Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard. ### ErgoDox EZ - Erez Zukerman Made in Taiwan using advanced robotic manufacturing, the ErgoDox EZ is a fully-assembled, premium ergonomic keyboard. Its split design allows you to place both halves shoulder width, and its custom-made wrist rests and tilt/tent kit make for incredibly comfortable typing. Available on [ergodox-ez.com](https://ergodox-ez.com). -* [ErgoDox EZ](/keyboards/ergodox_ez/) - Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types. +* [ErgoDox EZ](/keyboards/ergodox/) — Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types. ### Clueboard - Zach White Designed and built in Felton, CA, Clueboards keyboard emphasize quality and locally sourced components, available on [clueboard.co](http://clueboard.co) -* [Clueboard](/keyboards/clueboard/) - The 66% custom keyboard. -* [Cluepad](/keyboards/cluepad/) - A mechanical numpad with QMK superpowers. +* [Clueboard](/keyboards/clueboard/) — The 66% custom keyboard. +* [Cluecard](/keyboards/cluecard/) — A small board to help you hack on QMK. +* [Cluepad](/keyboards/cluepad/) — A mechanical numpad with QMK superpowers. ## Community-supported QMK Keyboards These keyboards are part of the QMK repository, but their manufacturers are not official maintainers of the repository. -* [alps64](/keyboards/alps64/) — A 60% keyboard for Alps keyswitches. -* [arrow_pad](/keyboards/arrow_pad) — A custom creation by IBNobody. -* [atreus](/keyboards/atreus) — Made by Technomancy. -* [bantam44](/keyboards/bantam44) — It is a 44-key 40% staggered keyboard. -* [gh60](/keyboards/gh60) — A 60% Geekhack community-driven project. -* [hhkb](/keyboards/hhkb) — The Happy Hacking keyboard can be hacked with a custom controller to run QMK. -* [jd45](/keyboards/jd45) — Another Geekhack community project, designed by jdcarpe. -* [kc60](/keyboards/kc60) — A programmable Chinese-made keyboard, lost in the mists of time. -* [phantom](/keyboards/phantom) — A tenkeyless kit by Teel, also from Geekhack. -* [retro_refit](/keyboards/retro_refit) — Another creation by IBNobody. -* [satan](/keyboards/satan) — A GH60 variant. -* [sixkeyboard](/keyboards/sixkeyboard) — A 6-key keyboard made by TechKeys. +* [Alps64](/keyboards/alps64) — A 60% keyboard for Alps keyswitches. +* [AMJ60](/keyboards/amj60) — DIY/Assembled compact 60% keyboard. +* [Arrow Pad](/keyboards/arrow_pad) — A custom creation by IBNobody. +* [Atreus](/keyboards/atreus) — Made by Technomancy. +* [Bantam44](/keyboards/bantam44) — It is a 44-key 40% staggered keyboard. +* [Ergodox Infinity](/keyboards/ergodox) - Ergonomic Split Keyboard by Input Club. +* [GH60](/keyboards/gh60) — A 60% Geekhack community-driven project. +* [Happy Hacking Keyboard](/keyboards/hhkb) — The Happy Hacking keyboard can be hacked with a custom controller to run QMK. +* [Infinity 60%](/keyboards/infinity60) - — Compact community keyboard by Input Club. +* [JD45](/keyboards/jd45) — Another Geekhack community project, designed by jdcarpe. +* [KC60](/keyboards/kc60) — A programmable Chinese-made keyboard, lost in the mists of time. +* [Kinesis Advantage](/keyboards/kinesis) — Contoured ergonomic keyboard by Kinesis Computer Ergonomics. +* [The Kitten Paw](/keyboards/kitten_paw) — A replacement controller (2016 revision) for the Filco Majestouch by [Bathroom Epiphanies](https://github.com/BathroomEpiphanies). +* [Lets Split](/keyboards/lets_split) - Split ortholinear 40% keyboard. +* [Phantom](/keyboards/phantom) — A tenkeyless kit by Teel, also from Geekhack. +* [Retro Refit](/keyboards/retro_refit) — Another creation by IBNobody. +* [S60-x](/keyboards/s60-x) — DIY compact keyboard designed by VinnyCordeiro for Sentraq. +* [Satan](/keyboards/satan) — A GH60 variant. +* [SixKeyBoard](/keyboards/sixkeyboard) — A 6-key keyboard made by TechKeys. +* [TheVan 44](/keyboars/tv44) — A 44-key staggered keybard by Evangs. +* [Vision Division](/keyboards/vision_division) — Full Size / Split Linear Keyboard by IBNobody. diff --git a/keyboards/retro_refit/Makefile b/keyboards/retro_refit/Makefile index 2dd8cc5f7..4e2a6f00f 100644 --- a/keyboards/retro_refit/Makefile +++ b/keyboards/retro_refit/Makefile @@ -1,74 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/retro_refit/readme.md b/keyboards/retro_refit/readme.md index b01a1a9ca..77df861ce 100644 --- a/keyboards/retro_refit/readme.md +++ b/keyboards/retro_refit/readme.md @@ -12,13 +12,15 @@ Download or clone the whole firmware and navigate to the keyboards/retro_refit f Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + ``` -$ make KEYMAP=[default|jack|] +$ make [default|jack|] ``` + Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file diff --git a/keyboards/retro_refit/rules.mk b/keyboards/retro_refit/rules.mk new file mode 100644 index 000000000..10fbfa5c9 --- /dev/null +++ b/keyboards/retro_refit/rules.mk @@ -0,0 +1,68 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/s60-x/Makefile b/keyboards/s60-x/Makefile new file mode 100644 index 000000000..4e2a6f00f --- /dev/null +++ b/keyboards/s60-x/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/s60-x/config.h b/keyboards/s60-x/config.h new file mode 100644 index 000000000..ac7951c24 --- /dev/null +++ b/keyboards/s60-x/config.h @@ -0,0 +1,164 @@ +/* +Copyright 2012 Jun Wako +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Massdrop +#define PRODUCT S60-X +#define DESCRIPTION q.m.k. keyboard firmware for S60-X + +/* key matrix size */ +#define MATRIX_ROWS 5 +#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 { B7, B3, B2, B1, B0 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 } +#define UNUSED_PINS { F0 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/Makefile b/keyboards/s60-x/keymaps/ansi_qwertz/Makefile new file mode 100644 index 000000000..6a078bcc3 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/config.h b/keyboards/s60-x/keymaps/ansi_qwertz/config.h new file mode 100644 index 000000000..6c01d579f --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/config.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// keymap needs oneshot functionality +#undef NO_ACTION_ONESHOT + +#undef IS_COMMAND +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png new file mode 100644 index 000000000..168780c82 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg new file mode 100644 index 000000000..f03858993 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg @@ -0,0 +1,1046 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ˝ + ¯ + ˛ + ˘ + o + . + ˇ + ˙ + + + diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg new file mode 100644 index 000000000..2304b2a4c --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg @@ -0,0 +1,1049 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ˝ + ¯ + ˛ + ˘ + o + . + ˇ + ˙ + + + diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png new file mode 100644 index 000000000..875eb3652 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg new file mode 100644 index 000000000..1ca6a9c87 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg @@ -0,0 +1,935 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG b/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG new file mode 100644 index 000000000..c730c2d65 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG b/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG new file mode 100644 index 000000000..fae2439ca Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG b/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG new file mode 100644 index 000000000..59b202be2 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c b/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c new file mode 100644 index 000000000..317a245be --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c @@ -0,0 +1,237 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 "s60-x.h" + +//make keymap a little easier to read +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 1 + +//uncomment to activate dead keys +//#define DONT_REVIVE_DEADKEYS 1 + +//Function keycodes for better readability +//SpaceFN +//OneShot LeftShift +//GamingMode Lock (disables SpaceFn and OneShot LShift) +//Function +//Mute microphone +#define KC_SPACEFN KC_FN0 +#define KC_OSLS KC_FN3 +#define KC_GMLK KC_FN1 +#define KC_FUNC KC_FN2 +#define MICMUTE RCTL(KC_LCTL) + +enum function_codes { + F_SPACEFN = 0, + F_OSLS = 3, + F_GMLK = 1, + F_FUNC = 2 +}; + +enum layer_names { + DEFAULT, + GAMING, + FUNCTION +}; + +enum languages { + GERMAN +}; + +#define LANGUAGE GERMAN + +enum custom_keycodes { + KC_CM_A = SAFE_RANGE, +// KC_CM_B, + KC_CM_C, +// KC_CM_D, + KC_CM_E, +// KC_CM_F, + KC_CM_G, +// KC_CM_H, + KC_CM_I, +// KC_CM_J, + KC_CM_K, + KC_CM_L, + KC_CM_M, + KC_CM_N, + KC_CM_O, + KC_CM_P, +// KC_CM_Q, + KC_CM_R, + KC_CM_S, +// KC_CM_T, + KC_CM_U, +// KC_CM_V, + KC_CM_W, +// KC_CM_X, + KC_CM_Y, + KC_CM_Z +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft| + * |-----------------------------------------------------------| + * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + [DEFAULT] = KEYMAP( + 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_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, 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_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ + KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Layout 1: Gaming Layer, SpaceFn disabled + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | |Fn1 | + * |-----------------------------------------------------------| + * | |RSft| | Space | | | | | + * `-----------------------------------------------------------' + */ + [GAMING] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \ + _______, KC_RSFT, _______, KC_SPC, _______, _______, _______, _______ + ), + + /* Layout 2: Function Layer + * MicMute requires special software to be installed. Check readme.md for more information + * ,-----------------------------------------------------------. + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES| + * |-----------------------------------------------------------| + * | | | | |Prv|Ply|Nxt| | | | |Prt|Slk|Pau | + * |-----------------------------------------------------------| + * | | | | |Vl-|Mut|Vl+| | | | | |PEnt | + * |-----------------------------------------------------------| + * | | | | |MicMut|Cal| | | | |Pau |PUp |Fn1 | + * |-----------------------------------------------------------| + * | | | | | |Home|PDn |End | + * `-----------------------------------------------------------' + */ + [FUNCTION] = KEYMAP( + 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_INS, RESET, \ + _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, KC_CM_A, KC_CM_S, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_CM_K, KC_CM_L, _______, _______, _______, KC_PENT, \ + _______, _______, KC_CM_Y, _______, KC_CM_C, MICMUTE, KC_CALC, KC_CM_N, KC_CM_M, _______, _______, _______, _______, KC_PGUP, KC_GMLK, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1 + [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift + [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1 + [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_german(uint16_t keycode, keyrecord_t *record) { + uint16_t send_code = 0; + if (record->event.pressed) { + switch (keycode) { + case KC_CM_A: + send_code = KC_Q; + break; + case KC_CM_O: + send_code = KC_P; + break; + case KC_CM_U: + send_code = KC_Y; + break; + case KC_CM_S: + send_code = KC_S; + break; + } + + if (send_code == 0) { + return true; + } + else { + register_code(KC_RALT); + register_code(send_code); + unregister_code(send_code); + unregister_code(KC_RALT); + return false; + } + } + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //revive dead keys +#ifndef DONT_REVIVE_DEADKEYS + bool shift_active = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_LSFT)); + bool altgr_active = keyboard_report->mods & (MOD_BIT(KC_RALT)); + if ((keycode == KC_QUOT && !altgr_active) || + keycode == KC_GRV || + (keycode == KC_6 && shift_active)) + { + if (record->event.pressed) { + register_code(keycode); + unregister_code(keycode); + register_code(KC_SPACE); + unregister_code(KC_SPACE); + } + return false; + } +#endif +#if LANGUAGE == GERMAN + return process_german(keycode, record); +#else + return true; +#endif +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md new file mode 100644 index 000000000..b22010612 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -0,0 +1,94 @@ +# ANSI_QWERTZ + +[Click here to go to the layers directly.](readme.md#1-layers) + +This keymap was specifically designed to support keycaps with ANSI layout and legends, while retaining the possibility of inputting characters +with diacritics that are normally not used in the english language. + +It currently relies on the US-International keyboard layout, which can be installed in any current operating system without the use of third party hardware. + +##0 Features +* Input of letters with diacritics on familiar QWERTZ layout +* Support for ANSI-legend keycaps +* Option to "revive" all dead keys +* Dedicated arrow cluster +* SpaceFN for easy access to Function keys and diacritic input +* Locking "Gaming Mode" that disables SpaceFN and allows to bind GUI key in Games +* Reset key binding, no need to press hardware reset button to program +* Microphone Mute key (requires 3rd-party software, see below) + +###0.0 Languages +The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters when using that layout. +All diacritic characters are input by either holding `Space` or `Fn` and pressing the corresponding key. For languages that aren't yet supported explicitly, +one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#04-revive-dead-keys). + +The illustration below shows the "US International" layout available in the Language settings of Windows, Linux and Mac OS. + +![KB_US-International](docs/KB_US-International.png) + +Not all languages are supported by this layout. Linux also offers the "US International Alternative" layout, +which contains more dead keys to input pretty much every diacritic character in a language using latin letters. More information can be found [here](http://web.archive.org/web/20160818101234/http://dry.sailingissues.com/us-international-keyboard-layout.html). + +![KB_US-International-Alternative](docs/KB_US-International-Alternative.png) + +####0.0.0 Explicitly Supported Languages +* German + +####0.0.1 Implicitly Supported Languages +This list only applies to Windows. Linux systems support all languages, see above. This list might be incomplete! Please add your language if you find it's supported. + +* French + +###0.1 SpaceFN +SpaceFN basically means that `Space` acts as a normal spacebar when tapped, but acts as a layer-key when held down. +This means that you can't hold space to output multiple spaces consecutively and that space only registers once released. +The advantage is that the spacebar is easier to reach than any other `Fn`-key could be. + +###0.2 "Gaming Mode" +To alleviate the problems SpaceFN would cause when gaming, the Gaming Mode is pretty much a layer that can be turned on by pressing Fn+RShift. +This will turn the double-role Spacebar into a normal one, so the Fn-layer (and thus function and media keys) can only be accessed with the Fn-key. +It also turns the GUI-key (aka Win-key aka Super-key) into Right Shift, so it can be bound in Games. This is especially useful when playing with ESDF instead of WASD. + +###0.3 Mute Microphone +The function layer has a "Mute Microphone"-key. As this is not an existing media key and you can't normally set a shortcut to this function, +you need to set this up in software before using it, see below. This key is bound to `RCtrl+LCtrl`, a keycombination that +no other program in existence uses for anything, at least to my knowledge. It also can't be pressed with this keymap in any other way. + +####0.3.0 Linux +Follow [these instructions](http://askubuntu.com/a/13364). + +#####0.3.1 Windows (Requires 3rd Party Software) +*DISCLAIMER: I take no responsibility for any potential harm caused by third party applications!* + +You'll need a utility called "MicMute". It is available on [Sourceforge](https://sourceforge.net/projects/micmute/). +After installing and running the tool, you only need to use the "Setup Shortcut" option to bind the key to muting the microphone +and check whether your microphone is selected under "Devices". + +###0.4 Revive Dead Keys +Some diacritics that are commonly used are dead keys on the international layouts, for example `` ` ``, `'`, or `"`. +The dead keys on the regular international layout (shown in red [here](readme.md#00-languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. +If you don't want this to be the case, uncomment the following line in `keymap.c` prior to compiling: +``` +//#define DONT_REVIVE_DEADKEYS 1 +``` + +##1 Layers +###1.0 Base Layer +The base layer is shown here for ANSI keysm, HHKB-style right shift and split backspace. If you use a 2U backspace key there, `Del` will not be available. +Again, the Y and Z keys are swapped, so you get the QWERTZ-positions of Y and Z when using the US-International layout. + +![base_layer](docs/base_layer.PNG) + +###1.1 Gaming layer +To turn this layer on, please use the combination `Fn+RShift`, not `Space+RShift`. If you do the latter, the Function layer will become stuck. You can press `Fn` once to unstick it if this happens to you. A solution is being worked on. + +![gaming_layer](docs/gaming_layer.PNG) + +###1.2 Function Layer +This is the function layer for German diacritics. It can be accessed via the `Fn` or by holding `Space` on the base layer. + +![function_layer](docs/function_layer.PNG) + + + + diff --git a/keyboards/s60-x/keymaps/custom/keymap.c b/keyboards/s60-x/keymaps/custom/keymap.c new file mode 100644 index 000000000..fb2a40b85 --- /dev/null +++ b/keyboards/s60-x/keymaps/custom/keymap.c @@ -0,0 +1,28 @@ +#include "s60-x.h" + +/* Main layer: Test layout, using all keys. + + 0 1 2 3 4 5 6 7 8 9 A B C D E + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + 0 │GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PGUP │BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 1 │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 2 │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PGDN │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 3 │LSHFT│HOME │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ END │RSHFT│ UP │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 4 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + LEGACY_KEYMAP(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, PGUP, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, PGDN, ENT , \ + LSFT, HOME, Z, X, C, V, B, N, M, COMM, DOT, SLSH, END, RSFT, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), +}; +const uint16_t PROGMEM fn_actions[] = {}; + diff --git a/keyboards/s60-x/keymaps/custom/readme.md b/keyboards/s60-x/keymaps/custom/readme.md new file mode 100644 index 000000000..cf87bd915 --- /dev/null +++ b/keyboards/s60-x/keymaps/custom/readme.md @@ -0,0 +1,15 @@ +### 8 Custom +The custom keymap - [keymap_custom.c](keymap_custom.c) - is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. + +#### 8.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PgUp │BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PgDwn│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│Home │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ End │Shift│ Up │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/default/keymap.c b/keyboards/s60-x/keymaps/default/keymap.c new file mode 100644 index 000000000..eb0c6b056 --- /dev/null +++ b/keyboards/s60-x/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +#include "s60-x.h" + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + LEGACY_KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT , \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, FN0, APP, RCTL), + +/* 1: Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; diff --git a/keyboards/s60-x/keymaps/default/readme.md b/keyboards/s60-x/keymaps/default/readme.md new file mode 100644 index 000000000..01cda9df9 --- /dev/null +++ b/keyboards/s60-x/keymaps/default/readme.md @@ -0,0 +1,27 @@ +### 1 Standard - ANSI +The standard keymap is the one that is pre-flashed on the S60-X. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 1.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/hasu/keymap.c b/keyboards/s60-x/keymaps/hasu/keymap.c new file mode 100644 index 000000000..cbeaae028 --- /dev/null +++ b/keyboards/s60-x/keymaps/hasu/keymap.c @@ -0,0 +1,182 @@ +#include "s60-x.h" + +/* + * Hasu + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn2 │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Fn1 │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ Fn3 │ Fn3 │ Fn0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, FN2, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, FN1, NO, FN9, NO, \ + LCTL, LGUI, LALT, SPC, RALT, FN3, FN3, FN0), + /* Keymap 1: colemak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ Fn0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, R, S, T, D, H, N, E, I, O, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, K, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, FN0), + /* Keymap 2: dvorak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ FN0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, NO, BSPC, \ + TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, SLSH, EQL, BSLS, \ + CAPS, A, O, E, U, I, D, H, T, N, S, MINS, NO, ENT, \ + LSFT, NO, SCLN, Q, J, K, X, B, M, W, V, Z, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, FN0), + /* Keymap 3: workman +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ D │ E │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ M │ C │ V │ K │ L │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ FN0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, D, R, W, B, J, F, U, P, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, S, H, T, G, Y, N, E, O, I, QUOT, NO, ENT, \ + LSFT, NO, Z, X, M, C, V, K, L, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, FN0), + /* Overlay 4: HHKB mode +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ │ │ │ │ │ │ │ Psc │ Slk │Pause│ Up │ │ Ins │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ VoD │ VoU │Mute │ │ │NP_* │NP_/ │Home │PgUp │Left │Right│▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ │ │ │ │ │NP_+ │NP_- │ End │PgDwn│Down │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│Space│█████│█████│█████│R_ALT│R_GUI│ App │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, INS, \ + LCTL, VOLD, VOLU, MUTE, TRNS, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, TRNS, ENT, \ + LSFT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PPLS, PMNS, END, PGDN, DOWN, TRNS, RSFT, TRNS, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, FN4, TRNS), + /* Overlay 5: Vi mode (Slash) +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│BkSpc│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │Home │PgDwn│ Up │PgUp │ End │Home │PgDwn│PgUp │ End │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ │Left │Down │Right│ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ │ │ │ │ │Home │PgDwn│PgUp │ End │ │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│Space│█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, BSPC, \ + TAB, HOME, PGDN, UP, PGUP, END, HOME, PGDN, PGUP, END, TRNS, TRNS, TRNS, TRNS, \ + LCTL, TRNS, LEFT, DOWN, RGHT, TRNS, LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, ENT, \ + LSFT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END, TRNS, TRNS, RSFT, TRNS, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), + /* Overlay 6: Mouse mode (Semicolon/App) +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│BkSpc│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │ │ │ │ │ │ MwL │ MwD │ MwU │ MwR │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ │ Ac0 │ Ac1 │ Ac2 │ │ McL │ McD │ McU │ McR │ │ │▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSFHT│▒▒▒▒▒│ │ │ │ │ Mb3 │ Mb2 │ Mb1 │ Mb4 │ Mb5 │ │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ Mb1 │█████│█████│█████│ │ │ │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel + */ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, BSPC, \ + TAB, TRNS, TRNS, TRNS, TRNS, TRNS, WH_L, WH_D, WH_U, WH_R, TRNS, TRNS, TRNS, TRNS, \ + LCTL, TRNS, ACL0, ACL1, ACL2, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, TRNS, ENT, \ + LSFT, TRNS, TRNS, TRNS, TRNS, TRNS, BTN3, BTN2, BTN1, BTN4, BTN5, TRNS, TRNS, RSFT, TRNS, \ + LCTL, LGUI, LALT, BTN1, TRNS, TRNS, TRNS, RCTL), + /* Overlay 7: Layout selector +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Lq │ Lc │ Ld │ Lw │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Lq │ Lw │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ Ld │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ Lc │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +Lq: set Qwerty layout +Lc: set Colemak layout +Ld: set Dvorak layout +Lw: set Workman layout + + */ + LEGACY_KEYMAP( + FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN6, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(4), + [1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH), + [2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN), + [3] = ACTION_LAYER_MOMENTARY(6), + [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector + [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout + [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout + [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout + [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout + [9] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV), +}; diff --git a/keyboards/s60-x/keymaps/hasu/readme.md b/keyboards/s60-x/keymaps/hasu/readme.md new file mode 100644 index 000000000..64969b616 --- /dev/null +++ b/keyboards/s60-x/keymaps/hasu/readme.md @@ -0,0 +1,4 @@ +### 5. Hasu +This is Hasu's favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail. + +(Hasu is the initial creator of the TMK firmware, in case you weren't aware.) \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/hhkb/keymap.c b/keyboards/s60-x/keymaps/hhkb/keymap.c new file mode 100644 index 000000000..9afd1247f --- /dev/null +++ b/keyboards/s60-x/keymaps/hhkb/keymap.c @@ -0,0 +1,52 @@ +#include "s60-x.h" + +/* + * HHKB Layout + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Default layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│ Fn │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSLS, GRV, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSPC, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, FN0, \ + NO, LGUI, LALT, SPC, NO, RALT, RGUI, NO), + /* 1: HHKB Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ │ │ │ │ │ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ VoD │ VoU │ Mut │ Ejc │ │NP_* │NP_/ │Home │PgUp │Left │Right│▒▒▒▒▒│NPEnt│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │NP_+ │NP_- │ End │PgDwn│Down │▒▒▒▒▒│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ + CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, TRNS, \ + TRNS, VOLD, VOLU, MUTE, EJCT, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, NO, PENT, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PPLS, PMNS, END, PGDN, DOWN, NO, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), +}; diff --git a/keyboards/s60-x/keymaps/hhkb/readme.md b/keyboards/s60-x/keymaps/hhkb/readme.md new file mode 100644 index 000000000..2bceb26dd --- /dev/null +++ b/keyboards/s60-x/keymaps/hhkb/readme.md @@ -0,0 +1,26 @@ +### 7. HHKB +[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers. +#### 7.0: Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│ Fn │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 7.1: HHKB Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ │ │ │ │ │ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ VoD │ VoU │ Mut │ Ejc │ │ * │ / │Home │PgUp │Left │Right│▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ + │ - │ End │PgDwn│Down │▒▒▒▒▒│ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/iso/keymap.c b/keyboards/s60-x/keymaps/iso/keymap.c new file mode 100644 index 000000000..43a9c48b0 --- /dev/null +++ b/keyboards/s60-x/keymaps/iso/keymap.c @@ -0,0 +1,48 @@ +#include "s60-x.h" + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + LEGACY_KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NO, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT , \ + LSFT, BSLS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, FN0, APP, RCTL), + +/* 1: Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; diff --git a/keyboards/s60-x/keymaps/iso/readme.md b/keyboards/s60-x/keymaps/iso/readme.md new file mode 100644 index 000000000..2c06bf86f --- /dev/null +++ b/keyboards/s60-x/keymaps/iso/readme.md @@ -0,0 +1,28 @@ +### 2 Standard - ISO +The same as the standard keymap, but with additional ISO keys. + + +#### 2.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 2.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/jpec/keymap.c b/keyboards/s60-x/keymaps/jpec/keymap.c new file mode 100644 index 000000000..c8fc13328 --- /dev/null +++ b/keyboards/s60-x/keymaps/jpec/keymap.c @@ -0,0 +1,92 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 "s60-x.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Fn1 |Gui |Alt | SpaceFn |Alt |Gui |App |Ctrl| + * `-----------------------------------------------------------' + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT, \ + LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + FN1, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), + + /* Layout 1: Function Layer + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | + * |-----------------------------------------------------------| + * | |Prv|Ply|Nxt|Stp| | |PUp|Up |PDn| |Slk|Pau|Ins | + * |-----------------------------------------------------------| + * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | + * |-----------------------------------------------------------| + * | |Prt|Cut|Cop|Pst|Cal| | | | | |CapsLock | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + LEGACY_KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + TRNS, MPRV, MPLY, MNXT, MSTP, TRNS, TRNS, PGUP, UP, PGDN, TRNS, SLCK, PAUS, INS, \ + TRNS, VOLD, MUTE, VOLU, TRNS, TRNS, HOME, LEFT, DOWN, RGHT, END, TRNS, TRNS, PENT, \ + TRNS, TRNS, PSCR, FN2, FN3, FN4, CALC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), /* SpaceFn layout 1 */ + [1] = ACTION_LAYER_MOMENTARY(1), /* Momentary layout 1 */ + [2] = ACTION_MODS_KEY(MOD_LSFT, KC_DEL), /* Cut */ + [3] = ACTION_MODS_KEY(MOD_LCTL, KC_INS), /* Copy */ + [4] = ACTION_MODS_KEY(MOD_LSFT, KC_INS), /* Paste */ +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/jpec/readme.md b/keyboards/s60-x/keymaps/jpec/readme.md new file mode 100644 index 000000000..73318dad7 --- /dev/null +++ b/keyboards/s60-x/keymaps/jpec/readme.md @@ -0,0 +1 @@ +# The default keymap for s60-x \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/plain/keymap.c b/keyboards/s60-x/keymaps/plain/keymap.c new file mode 100644 index 000000000..790ac88e7 --- /dev/null +++ b/keyboards/s60-x/keymaps/plain/keymap.c @@ -0,0 +1,25 @@ +#include "s60-x.h" + +/* Main layer: +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + LEGACY_KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), +}; +const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/s60-x/keymaps/plain/readme.md b/keyboards/s60-x/keymaps/plain/readme.md new file mode 100644 index 000000000..ab13323e3 --- /dev/null +++ b/keyboards/s60-x/keymaps/plain/readme.md @@ -0,0 +1,16 @@ +### 4. Plain +Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. +See [keymap_plain.c](keymap_plain.c) for detail. + +#### 4.0 Plain Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/poker/keymap.c b/keyboards/s60-x/keymaps/poker/keymap.c new file mode 100644 index 000000000..0a8691792 --- /dev/null +++ b/keyboards/s60-x/keymaps/poker/keymap.c @@ -0,0 +1,180 @@ +#include "s60-x.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 1: colemak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, R, S, T, D, H, N, E, I, O, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, K, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 2: dvorak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, NO, BSPC, \ + TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, SLSH, EQL, BSLS, \ + CAPS, A, O, E, U, I, D, H, T, N, S, MINS, NO, ENT, \ + LSFT, NO, SCLN, Q, J, K, X, B, M, W, V, Z, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 3: workman +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ D │ E │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ M │ C │ V │ K │ L │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, D, R, W, B, J, F, U, P, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, S, H, T, G, Y, N, E, O, I, QUOT, NO, ENT, \ + LSFT, NO, Z, X, M, C, V, K, L, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 4: Poker with Arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, RGHT), + /* 5: Poker with Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + /* 6: Poker Fn +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ FnL │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +Fn: to Fn overlay +FnL: to Layout selector overaly +FnQ: toggle Esc overlay +FnS: toggle Arrow overlay + + */ + LEGACY_KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN2, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, FN4, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN3, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), + /* 7: Layout selector +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Lq │ Lc │ Ld │ Lw │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Lq │ Lw │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ Ld │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ Lc │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +Lq: set Qwerty layout +Lc: set Colemak layout +Ld: set Dvorak layout +Lw: set Workman layout + + */ + LEGACY_KEYMAP( + FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN6, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + /* Poker Layout */ + [0] = ACTION_LAYER_MOMENTARY(6), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(4), // toggle arrow overlay + [2] = ACTION_LAYER_TOGGLE(5), // toggle Esc overlay + [3] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // Task(RControl,RShift+Esc) + [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector + [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout + [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout + [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout + [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout +}; diff --git a/keyboards/s60-x/keymaps/poker/readme.md b/keyboards/s60-x/keymaps/poker/readme.md new file mode 100644 index 000000000..0d8be9d0f --- /dev/null +++ b/keyboards/s60-x/keymaps/poker/readme.md @@ -0,0 +1,31 @@ +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/poker_bit/keymap.c b/keyboards/s60-x/keymaps/poker_bit/keymap.c new file mode 100644 index 000000000..7626038f4 --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_bit/keymap.c @@ -0,0 +1,110 @@ +#include "s60-x.h" + +// Poker fix with toggle and bit operation +// Fn + Esc = ` +// Fn + {left, down, up, right} = {home, pgdown, pgup, end} +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 4: Poker Default + Fn'd +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ Fn2 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn4 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn1 │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + [4] = LEGACY_KEYMAP( + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + CAPS, FN2, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN4, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), + /* 5: Poker with Arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│PgUp │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn3 │Home │PgDwn│ End │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN3, HOME, PGDN, END), + /* 6: Poker with Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + /* 7: Poker with Arrow + Fn'd +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, RGHT), +}; +const uint16_t PROGMEM fn_actions[] = { + /* Poker Layout */ + [0] = ACTION_LAYER_BIT_XOR(1, 0b0101, ON_BOTH), // Poker Fn(with fix for Esc) + [1] = ACTION_LAYER_TOGGLE(5), // Poker Arrow toggle + [2] = ACTION_LAYER_TOGGLE(6), // Poker Esc toggle + [3] = ACTION_LAYER_BIT_XOR(1, 0b1101, ON_BOTH), // Poker Fn(with fix for Arrow) + [4] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN3 Task(RControl,RShift+Esc) +}; diff --git a/keyboards/s60-x/keymaps/poker_bit/readme.md b/keyboards/s60-x/keymaps/poker_bit/readme.md new file mode 100644 index 000000000..0d8be9d0f --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_bit/readme.md @@ -0,0 +1,31 @@ +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/poker_set/keymap.c b/keyboards/s60-x/keymaps/poker_set/keymap.c new file mode 100644 index 000000000..09423e75b --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_set/keymap.c @@ -0,0 +1,178 @@ +#include "s60-x.h" + +// Poker fix with set(state transition) +// Fn + Esc = ` +// Fn + {left, down, up, right} = {home, pgdown, pgup, end} +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 1: Poker with Arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn1 │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN1, LEFT, DOWN, RGHT), + /* 2: Poker with Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn2 │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS), + /* 3: Poker with Arrow and Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn3 │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN3, LEFT, DOWN, RGHT), + /* 4: Poker Fn'd +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn6 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn5 │█████│█████│█████│ Fn4 │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN6, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN5, FN4, TRNS, TRNS, TRNS), + /* 5: Poker Fn'd arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn7 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│PgUp │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn4 │█████│█████│█████│ Fn5 │Home │PgDwn│ End │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN7, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, PGUP, TRNS, \ + TRNS, TRNS, TRNS, FN4, FN5, HOME, PGDN, END), + /* 6: Poker Fn'd Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn4 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn7 │█████│█████│█████│ Fn6 │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN4, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, FN6, TRNS, TRNS, TRNS), + /* 7: Poker Fn'd Arrow + Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn5 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│PgUp │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn6 │█████│█████│█████│ Fn7 │Home │PgDwn│ End │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN5, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, PGUP, TRNS, \ + TRNS, TRNS, TRNS, FN6, FN7, HOME, PGDN, END), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + /* Poker Layout */ + [0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press + [1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press + [2] = ACTION_LAYER_SET(6, ON_PRESS), // FN2 move to Fn'd Esc when press + [3] = ACTION_LAYER_SET(7, ON_PRESS), // FN3 move to Fn'd arrow + Esc when press + + //[4] = ACTION_LAYER_CLEAR(ON_RELEASE), // FN4 clear overlay when release + [4] = ACTION_LAYER_SET(0, ON_RELEASE), // FN4 clear overlay when release + [5] = ACTION_LAYER_SET(1, ON_RELEASE), // FN5 move to arrow when release + [6] = ACTION_LAYER_SET(2, ON_RELEASE), // FN6 move to Esc when release + [7] = ACTION_LAYER_SET(3, ON_RELEASE), // FN7 move to arrow + Esc when release + + [8] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN8 Task(RControl,RShift+Esc) +}; diff --git a/keyboards/s60-x/keymaps/poker_set/readme.md b/keyboards/s60-x/keymaps/poker_set/readme.md new file mode 100644 index 000000000..0d8be9d0f --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_set/readme.md @@ -0,0 +1,31 @@ +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/spacefn/keymap.c b/keyboards/s60-x/keymaps/spacefn/keymap.c new file mode 100644 index 000000000..b6dc7ca7e --- /dev/null +++ b/keyboards/s60-x/keymaps/spacefn/keymap.c @@ -0,0 +1,55 @@ +#include "s60-x.h" + +/* + * SpaceFN + * http://geekhack.org/index.php?topic=51069.0 + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████Spc/Fn0█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), + + /* Overlay 1: SpaceFN +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ Esc │ │ │ │Home │ Up │ End │Pscr │Slck │Pause│ Ins │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │PgUp │Left │Down │Right│ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │Space│PgDwn│ ` │ ~ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + LEGACY_KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + TRNS, TRNS, TRNS, ESC, TRNS, TRNS, TRNS, HOME, UP, END, PSCR, SLCK, PAUS, INS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, SPC, PGDN, GRV, FN1, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), + [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde +}; diff --git a/keyboards/s60-x/keymaps/spacefn/readme.md b/keyboards/s60-x/keymaps/spacefn/readme.md new file mode 100644 index 000000000..d04bd9486 --- /dev/null +++ b/keyboards/s60-x/keymaps/spacefn/readme.md @@ -0,0 +1,27 @@ +### 6. SpaceFN +This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). + +#### 6.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│████ Space/Fn ███│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 6.1 SpaceFN layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │Home │ Up │ End │ Psc │ Slk │Pause│ Ins │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │PgUp │Left │Down │Right│ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │Space│PgDwn│ ` │ ~ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ Fn │█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md new file mode 100644 index 000000000..94ce82922 --- /dev/null +++ b/keyboards/s60-x/readme.md @@ -0,0 +1,260 @@ +S60-x keyboard firmware +====================== +DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps are based on GH60 code. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/VinnyCordeiro/tmk_keyboard). + +## S60X Resources +- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) + +## Quickstart + +If you just want to test a few layouts, the archive [s60-x_precompiled.zip](s60-x_precompiled.zip) contains pre-compiled .hex-files for all available keymaps. Not all of them are tested. +You only need to flash them onto your keyboard, which is explained below, there's no need to setup a build environment. For a full list + +## Flashing your keyboard +The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows). + +[QMK Firmware Flasher](https://github.com/jackhumbert/qmk_firmware_flasher/releases) may work, as the S60-X keyboard uses the ATMega32U4 microcontroller, but it is untested. Use at your own risk. + +[Easy AVR USB Keyboard Firmware](https://deskthority.net/wiki/Easy_AVR_USB_Keyboard_Firmware) also supports S60-X, but it is completely unrelated to TMK firmware. Use at your own risk. + +**Programming the firmware (Windows)** + +1. download and install FLIP (http://www.atmel.com/tools/FLIP.aspx) +2. connect the keyboard, press the program button on the underside of the board (S1) and wait until it enumerates (you'll hear the "disconnect" and "connect" sound) +3. go to device manager, find the atmega32u4 chip and click "update driver" +4. choose location manually: folder named "usb" inside the installation directory of FLIP +5. once the driver is installed, run flip +6. Device -> Select: choose ATMega32U4 +7. Settings -> Communication -> USB, FLIP should show the signature at this point (58 1E 95 87) +8. File -> Load HEX file: choose the hex firmware: .hex +9. click "Run" +10. after programming is done, disconnect the device from USB and connect again. + + +**Programming the firmware (Linux)** + +1. Download and install/compile/unpack dfu-programmer from http://dfu-programmer.sourceforge.net/. +2. Issue the following commands in the command prompt after connecting the device and pressing the programming button (S1). You may need root permissions or udev rules to do that. + 1. `sudo dfu-programmer atmega32u4 erase` + 2. `sudo dfu-programmer atmega32u4 flash .hex` + 3. `sudo dfu-programmer atmega32u4 start` +3. The keyboard should start working. If it doesn't, reconnect the cable. + +## Building the firmware + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + + $ make [custom|poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|] + +For a more detailed explanation of the build process and the environment setup, see the ["Getting Started" section](/readme.md#getting-started). + +## List of included Keymaps + +Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. +To define your own keymap, copy the [default keymap template](/quantum/template/keymaps/default) directory into the `keymaps` directory and start modifying the `keymap.c` file. Some options might require you to change the `config.h` or `Makefile` as well, refer to the main documentation for more information on those. +If you want to later merge your finalised keymap into this repository to make it available for everyone, make sure to also modify the `readme.md` in your keymap directory to show a visual version of your keymap. + +Here's a list of the standard layouts that are provided with the precompiled .hex-files. + +### 0 Initial explanations +The █████ blocks on the layouts hides the switch positions that do not exist physically on the PCB. If you feel like hacking the keyboard and adding new keys, those are the positions that can be used. You'll have to modify the [keymap_common.h](keymap_common.h) file for that. + +The ▒▒▒▒▒ blocks hides switch positions not used on this particular layout, but they do exist on the PCB. + +There is no LED support on the PCB at the moment, but I'll let the code for that untouched. + + +### 1 [Standard - ANSI (default layout)](keymaps/default/keymap.c) +The standard keymap is the one that is pre-flashed on the S60-X. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 1.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 2 [Standard - ISO](keymaps/iso/keymap.c) +The same as the standard keymap, but with additional ISO keys. + + +#### 2.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 2.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 3 Poker +[The poker keymap](keymaps/poker/keymap.c) emulates original Vortex Poker layers +while both [poker_bit](keymaps/poker_bit/keymap.c) and [poker_set](keymap/poker_set/keymap.c) implement the same layout in a slightly different way, fix a minor issue of the original poker Layout and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 4. [Plain](keymaps/plain/keymap.c) +Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. + +#### 4.0 Plain Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 5. [Hasu](keymaps/hasu/keymap.c) +This is Hasu's favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. + +(Hasu is the creator of the TMK firmware, for those who do not know that.) + + +### 6. [SpaceFN](keymaps/spacefn/keymap.c) +This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. Check the sourcefile and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0) for more information. + +#### 6.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│████ Space/Fn ███│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 6.1 SpaceFN layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │Home │ Up │ End │ Psc │ Slk │Pause│ Ins │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │PgUp │Left │Down │Right│ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │Space│PgDwn│ ` │ ~ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ Fn │█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 7. [HHKB](keymap/hhkb/keymap.c) +The HHKB keymap emulates original HHKB layers. +#### 7.0: Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│ Fn │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 7.1: HHKB Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ │ │ │ │ │ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ VoD │ VoU │ Mut │ Ejc │ │ * │ / │Home │PgUp │Left │Right│▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ + │ - │ End │PgDwn│Down │▒▒▒▒▒│ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 8 [Custom](keymaps/custom/keymap.c) +The custom keymap is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. + +#### 8.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PgUp │BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PgDwn│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│Home │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ End │Shift│ Up │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +### 9. [ANSI_QWERTZ](keymaps/ansi_qwertz/keymap.c) + +This keymap was designed for inputting characters with diacritics with ANSI keycaps. +It provides toggleable SpaceFn functionality, a dedicated arrow cluster and a microphone mute key on the function layer as well as a bootloader reset key. + +For more info, [check here](keymaps/ansi_qwertz/readme.md). diff --git a/keyboards/s60-x/rules.mk b/keyboards/s60-x/rules.mk new file mode 100644 index 000000000..7ec93933a --- /dev/null +++ b/keyboards/s60-x/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 \ No newline at end of file diff --git a/keyboards/s60-x/s60-x.c b/keyboards/s60-x/s60-x.c new file mode 100644 index 000000000..417358140 --- /dev/null +++ b/keyboards/s60-x/s60-x.c @@ -0,0 +1,28 @@ +#include "s60-x.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/s60-x/s60-x.h b/keyboards/s60-x/s60-x.h new file mode 100644 index 000000000..29a2a27b2 --- /dev/null +++ b/keyboards/s60-x/s60-x.h @@ -0,0 +1,69 @@ +/* +Copyright 2012,2013 Jun Wako +Copyright 2015 Vincius Nery Cordeiro +Copyright 2016 Felix Uhl + +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 . +*/ + +#ifndef S60X_H +#define S60X_H + +#include "quantum.h" + +#ifdef __INTELLISENSE__ +#define PROGMEM +#include "config.h" +#endif + +/* S60-X keymap definition macro +* K31 is the extra key next to short left ISO shift +* K2C is the moved key next to enter on ISO boards +* K3C is the extra key next to short right JIS shift +* K0D is extra key from split backspace +* K3E is extra key from HHKB-style split right shift +*/ + +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, KC_NO } \ +} + +/*This special definition is used for S60-X keymaps that were ported from TMK + * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended + */ +#define LEGACY_KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_NO } \ +} + +#endif diff --git a/keyboards/s60-x/s60-x_precompiled.zip b/keyboards/s60-x/s60-x_precompiled.zip new file mode 100644 index 000000000..00d99ca8a Binary files /dev/null and b/keyboards/s60-x/s60-x_precompiled.zip differ diff --git a/keyboards/satan/Makefile b/keyboards/satan/Makefile index a0879fc9c..4e2a6f00f 100644 --- a/keyboards/satan/Makefile +++ b/keyboards/satan/Makefile @@ -1,70 +1,3 @@ - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif +endif \ No newline at end of file diff --git a/keyboards/satan/keymaps/default/keymap.c b/keyboards/satan/keymaps/default/keymap.c index 3806137e7..2bf49d2e6 100644 --- a/keyboards/satan/keymaps/default/keymap.c +++ b/keyboards/satan/keymaps/default/keymap.c @@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | * `-----------------------------------------------------------' */ -[_BL] = KEYMAP( +[_BL] = KEYMAP_ANSI( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_FL] = KEYMAP( +[_FL] = KEYMAP_ANSI( #ifdef RGBLIGHT_ENABLE KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG, \ diff --git a/keyboards/satan/keymaps/denolfe/Makefile b/keyboards/satan/keymaps/denolfe/Makefile new file mode 100644 index 000000000..c4adab737 --- /dev/null +++ b/keyboards/satan/keymaps/denolfe/Makefile @@ -0,0 +1,20 @@ + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/denolfe/README.md b/keyboards/satan/keymaps/denolfe/README.md new file mode 100644 index 000000000..30b94fcdd --- /dev/null +++ b/keyboards/satan/keymaps/denolfe/README.md @@ -0,0 +1,12 @@ +# denolfe's Layout +Customized Satan keymap + +![Layout](keyboard-layout.png "Practical Keymap") + +## Programming Instructions: +`cd` into keymap directory, `make dfu` + +## Features +- Movement keys with CapsLock + h, j, k, l +- Media Keys +- Backlight control diff --git a/keyboards/satan/keymaps/denolfe/keyboard-layout.png b/keyboards/satan/keymaps/denolfe/keyboard-layout.png new file mode 100644 index 000000000..d6d6ad57f Binary files /dev/null and b/keyboards/satan/keymaps/denolfe/keyboard-layout.png differ diff --git a/keyboards/satan/keymaps/denolfe/keymap.c b/keyboards/satan/keymaps/denolfe/keymap.c new file mode 100644 index 000000000..5f189d78a --- /dev/null +++ b/keyboards/satan/keymaps/denolfe/keymap.c @@ -0,0 +1,171 @@ +#include "satan.h" + +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 +#define _SL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP_ANSI( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(_FL), 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_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_RCTL), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | RESET| + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_FL] = KEYMAP_ANSI( + #ifdef RGBLIGHT_ENABLE + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #else + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, KC_END, KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_HOME, LCTL(KC_LEFT), LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, F(9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #endif + +[_SL] = KEYMAP_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_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, LSFT(KC_END), KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RIGHT), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, LSFT(KC_HOME), LCTL(LSFT(KC_LEFT)), LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)), KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +enum function_id { + SHIFT_ESC, + #ifdef RGBLIGHT_ENABLE + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL + #endif +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), + #ifdef RGBLIGHT_ENABLE + [1] = ACTION_FUNCTION(RGBLED_TOGGLE), + [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + #endif + [9] = ACTION_LAYER_MODS(2, MOD_LSFT) +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + //led operations + #ifdef RGBLIGHT_ENABLE + case RGBLED_TOGGLE: + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + #endif + } +} diff --git a/keyboards/satan/keymaps/iso_split_rshift/.gitignore b/keyboards/satan/keymaps/iso_split_rshift/.gitignore new file mode 100644 index 000000000..4d652661c --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/.gitignore @@ -0,0 +1,3 @@ +updatemerge.sh +clear_flash.hex +resetboard.sh diff --git a/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg b/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg new file mode 100644 index 000000000..7616693f9 Binary files /dev/null and b/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg differ diff --git a/keyboards/satan/keymaps/iso_split_rshift/Makefile b/keyboards/satan/keymaps/iso_split_rshift/Makefile new file mode 100644 index 000000000..d1e07da3f --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/Makefile @@ -0,0 +1,16 @@ +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/iso_split_rshift/build.sh b/keyboards/satan/keymaps/iso_split_rshift/build.sh new file mode 100755 index 000000000..6b4b4568f --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# adjust for cpu +# -j 16 gave best result on a hyperthreaded quad core core i7 + +LIMIT=10 +THREADS="-j 16" +KMAP=iso_split_rshift + +echo "We need sudo later" +sudo ls 2>&1 /dev/null + +function wait_bootloader { + echo "Waiting for Bootloader..." + local STARTTIME=$(date +"%s") + local REMIND=0 + local EXEC=dfu-programmer + local TARGET=atmega32u4 + while true + do + sudo $EXEC $TARGET get > /dev/null 2>&1 + [ $? -eq 0 ] && break + ENDTIME=$(date +"%s") + DURATION=$(($ENDTIME-$STARTTIME)) + if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ] + then + echo "Did you forget to press the reset button?" + REMIND=1 + fi + sleep 1 + done +} +make clean +make KEYMAP=${KMAP} ${THREADS} +if [[ $? -eq 0 ]] +then + echo "please trigger flashing!" + wait_bootloader + sudo make KEYMAP=${KMAP} dfu ${THREADS} +else + echo "make failed" + exit 77 +fi diff --git a/keyboards/satan/keymaps/iso_split_rshift/config.h b/keyboards/satan/keymaps/iso_split_rshift/config.h new file mode 100644 index 000000000..27c1372da --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/config.h @@ -0,0 +1,27 @@ +/* +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// only change +#undef RGB_DI_PIN +#define RGB_DI_PIN B2 + +#endif diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c new file mode 100644 index 000000000..cf938e07d --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -0,0 +1,209 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "satan.h" +// TODO: replace your ugly german brckets with #defines + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DEF 0 +#define _SPC 1 +#define _TAB 2 +#define _SFX 3 + +// dual-role shortcuts +#define TABDUAL LT(_TAB, KC_TAB) +#define CAPSDUAL CTL_T(KC_ESC) +#define SPACEDUAL LT(_SPC, KC_SPACE) +#define ENTERDUAL CTL_T(KC_ENT) +// arrow cluster duality bottom right corner +#define ARRLEFT ALT_T(KC_LEFT) +#define ARRDOWN GUI_T(KC_DOWN) +#define ARRUP SFT_T(KC_UP) +#define ARRRIGHT CTL_T(KC_RIGHT) +// german brackets +#define GER_CUR_L RALT(KC_7) // [ +#define GER_CUR_R RALT(KC_0) // ] +#define GER_PAR_L LSFT(KC_8) // ( +#define GER_PAR_R LSFT(KC_9) // ) +#define GER_ANG_L KC_NUBS // < +#define GER_ANG_R LSFT(KC_NUBS) // > +#define GER_BRC_L RALT(KC_8) // [ +#define GER_BRC_R RALT(KC_9) // ] + +// increase readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _DEF: Default Layer + * ,-----------------------------------------------------------. + * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | + * |-----------------------------------------------------------| + * |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP + * |-----------------------------------------------------------| + * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is + * `-----------------------------------------------------------' LEFT DWN RIGHT + */ + [_DEF] = KEYMAP_ISO_SPLITRSHIFT( + 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, \ + TABDUAL, 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, \ + CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ARRUP, TG(_SFX), \ + KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT), + + /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) + * ,-----------------------------------------------------------. + * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| + * |-----------------------------------------------------------| + * | |Paus| Up| [ | ] | | | | ( | ) | | | | | + * |-----------------------------------------------------------| + * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY | + * |-----------------------------------------------------------| + * | | | | | < | > | |M0 | | | | | Vol+ | | + * |-----------------------------------------------------------| + * | | | | |Alt |Prev|Vol-|Next| + * `-----------------------------------------------------------' + */ + [_SPC] = KEYMAP_ISO_SPLITRSHIFT( + KC_PSCR, 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_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) + * ,-----------------------------------------------------------. + * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE + * |-----------------------------------------------------------| + * | | | | | | | | | { | } | | | | | + * |-----------------------------------------------------------| + * | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn | + * |-----------------------------------------------------------| + * | | | | | | | |AF2| | | | | PgUp | | + * |-----------------------------------------------------------| + * | | | | |Alt |Pos1|PgDn|End | + * `-----------------------------------------------------------' + */ + [_TAB] = KEYMAP_ISO_SPLITRSHIFT( + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + + /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) + * ,-----------------------------------------------------------. + * |RSET| | | | | | | 7| 8| 9| | | |Backsp | + * |-----------------------------------------------------------| + * | | | | | | | | 4 | 5 | 6 | | | | \ | + * |-----------------------------------------------------------| + * | | L | L | | | | | 1 | 2 | 3 | | | Return | + * |-----------------------------------------------------------| + * | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent + * |-----------------------------------------------------------| LED controlling + * |Ctrl|Win |Alt | |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + [_SFX] = KEYMAP_ISO_SPLITRSHIFT( + RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ + _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ + _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), +}; + +enum function_id { + LAUNCH, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_FUNCTION(LAUNCH), + [2] = ACTION_FUNCTION(RGBLED_TOGGLE), + [3] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return (record->event.pressed ? + MACRO( D(RALT), T(SPC), U(RALT), END ) + :MACRO( END )); + break; + case 1: + return (record->event.pressed ? + MACRO( D(LALT), T(F2), U(LALT), END ) + :MACRO( END )); + break; + } + return MACRO_NONE; +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + } +} diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md new file mode 100644 index 000000000..ec6123d8a --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -0,0 +1,36 @@ +toneman77's Satan Layout +===================== + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +* heavily modified ISO (!) layout with split right shift key +* spaceFn +* Dual-Role keys: +* + | Original key | when tapped | when held | + | ---------------- | ------------- | ------------- | + | Space | Space | layer change | + | Caps lock | Escape | Control | + | Tab | Tab | layer change | + | Enter | Enter | Control | + +* Lockable layer for LED functions and numpad +* vim-style arrow keys on hjkl (spacefn layer) +* corresponding Home/PgDn/PgUp/End on hjkl (tab layer) +* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift +* more bonus arrow keys on wasd (spacefn layer) +* media keys prev/next/play/vol+/vol- (spacefn layer) +* firmware bootloader button +* WS2812 RGB Underglow Support (not needed anymore to solder directly to the atmega) +* additional brackets that only work in german layout due to horrible placement +in the default qwertz layout + + +### Additional Credits +* Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) +* nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) +* no-need-to-solder-on-chip picture: +![no need to solder directly on the chip anymore](LEDpinSatan.jpg) +* special thanks to /u/TerryMathews who suggested the pin PB2, so soldering +directly on the atmega is not needed anymore. Happened on [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra) diff --git a/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh b/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh new file mode 100755 index 000000000..d955ccf54 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sudo dfu-programmer atmega32u4 erase --force +sudo dfu-programmer atmega32u4 flash clear_flash.hex +sudo dfu-programmer atmega32u4 reset diff --git a/keyboards/satan/keymaps/poker/keymap.c b/keyboards/satan/keymaps/poker/keymap.c index 8181955cf..9da7d29b7 100644 --- a/keyboards/satan/keymaps/poker/keymap.c +++ b/keyboards/satan/keymaps/poker/keymap.c @@ -25,12 +25,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | * `-----------------------------------------------------------' */ -[_BL] = KEYMAP( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_RL), MO(_FL), KC_RCTL), +[_BL] = KEYMAP_ANSI( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_RL), MO(_FL), KC_RCTL), /* Keymap _FL: Function Layer * ,-----------------------------------------------------------. @@ -45,12 +45,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_FL] = KEYMAP( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_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,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, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[_FL] = KEYMAP_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_DEL, \ + 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, 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, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), /* Keymap _RL: Function Layer * ,-----------------------------------------------------------. @@ -65,19 +65,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_RL] = KEYMAP( +[_RL] = KEYMAP_ANSI( #ifdef RGBLIGHT_ENABLE - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,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_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, 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), #else - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #endif }; diff --git a/keyboards/satan/keymaps/stanleylai/config.h b/keyboards/satan/keymaps/stanleylai/config.h index ae2bd36db..7f4bb441c 100644 --- a/keyboards/satan/keymaps/stanleylai/config.h +++ b/keyboards/satan/keymaps/stanleylai/config.h @@ -1,20 +1,15 @@ #include "../../config.h" -// USB Device descriptor parameter -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0003 -#define MANUFACTURER Custom -#define PRODUCT GH60 rev.CHN -#define DESCRIPTION QMK keyboard firmware for GH60 with WS2812 support - // Backlight configuration +#undef BACKLIGHT_LEVELS #define BACKLIGHT_LEVELS 3 // Underlight configuration -#define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#undef RGBLED_NUM #define RGBLED_NUM 6 // Number of LEDs +#undef RGBLIGHT_HUE_STEP #define RGBLIGHT_HUE_STEP 8 +#undef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 8 +#undef RGBLIGHT_VAL_STEP #define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/satan/keymaps/stanleylai/keymap.c b/keyboards/satan/keymaps/stanleylai/keymap.c index 623427e97..979c122e5 100644 --- a/keyboards/satan/keymaps/stanleylai/keymap.c +++ b/keyboards/satan/keymaps/stanleylai/keymap.c @@ -26,25 +26,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Function layer [_FL] = KEYMAP_HHKB( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \ - KC_NO, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LT(_RGBL, KC_PGUP), KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \ + KC_NO, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LT(_RGBL, KC_PGUP), KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_HOME, KC_PGDN, KC_END), // RGB Layer [_RGBL] = KEYMAP_HHKB( #ifdef RGBLIGHT_ENABLE RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_TRNS, KC_TRNS,\ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS,\ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #endif }; diff --git a/keyboards/satan/rules.mk b/keyboards/satan/rules.mk new file mode 100644 index 000000000..1102584d8 --- /dev/null +++ b/keyboards/satan/rules.mk @@ -0,0 +1,66 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h index 513446bf3..f3cbd5305 100644 --- a/keyboards/satan/satan.h +++ b/keyboards/satan/satan.h @@ -3,15 +3,18 @@ #include "quantum.h" -/* Satan GH60 matrix layout +// readability +#define XXX KC_NO + +/* Satan GH60 matrix layout (3c is right of 3d, 3d is shift) * ,-----------------------------------------------------------. - * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d| 49| * |-----------------------------------------------------------| * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | * |-----------------------------------------------------------| - * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d | * |-----------------------------------------------------------| - * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | + * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c | * |-----------------------------------------------------------| * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | * `-----------------------------------------------------------' @@ -19,18 +22,45 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49,\ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d}, \ - {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d}, \ - {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ +} +/* Satan GH60 ANSI layout + * ,-----------------------------------------------------------. + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * |-----------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | + * |-----------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | + * |-----------------------------------------------------------| + * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | + * |-----------------------------------------------------------| + * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | + * `-----------------------------------------------------------' + */ +#define KEYMAP_ANSI( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } /* Satan HHKB matrix layout @@ -51,17 +81,46 @@ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d}, \ - {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ - {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } +/* ISO w/ split right shift key matrix layout + * ,-----------------------------------------------------------. + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * |-----------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | + * |-----------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d | + * |-----------------------------------------------------------| + * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c| + * |-----------------------------------------------------------| + * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | + * `-----------------------------------------------------------' + + swap 3c and 3d. 3c is right of 3d in reality + */ +#define KEYMAP_ISO_SPLITRSHIFT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ +} void matrix_init_user(void); void matrix_scan_user(void); diff --git a/keyboards/sixkeyboard/Makefile b/keyboards/sixkeyboard/Makefile index 6f273064a..4e2a6f00f 100644 --- a/keyboards/sixkeyboard/Makefile +++ b/keyboards/sixkeyboard/Makefile @@ -1,75 +1,3 @@ - - -SRC = matrix.c - -# MCU name -#MCU = at90usb1287 -MCU = atmega16u2 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -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 -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -CUSTOM_MATRIX = yes - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - +endif \ No newline at end of file diff --git a/keyboards/sixkeyboard/rules.mk b/keyboards/sixkeyboard/rules.mk new file mode 100644 index 000000000..2c99985a9 --- /dev/null +++ b/keyboards/sixkeyboard/rules.mk @@ -0,0 +1,70 @@ + + +SRC = matrix.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega16u2 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +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 +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +CUSTOM_MATRIX = yes \ No newline at end of file diff --git a/keyboards/tv44/Makefile b/keyboards/tv44/Makefile new file mode 100644 index 000000000..4e2a6f00f --- /dev/null +++ b/keyboards/tv44/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/tv44/config.h b/keyboards/tv44/config.h new file mode 100644 index 000000000..0ae93c095 --- /dev/null +++ b/keyboards/tv44/config.h @@ -0,0 +1,162 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEAE +#define PRODUCT_ID 0x8844 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Evan Sailer +#define PRODUCT TheVan 44 +#define DESCRIPTION keyboard firmware for TV44 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * 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 { D7, B5, F7, D4 } +#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/tv44/keymaps/default/Makefile b/keyboards/tv44/keymaps/default/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/tv44/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/default/config.h b/keyboards/tv44/keymaps/default/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/tv44/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/default/keymap.c b/keyboards/tv44/keymaps/default/keymap.c new file mode 100644 index 000000000..f3f989f2d --- /dev/null +++ b/keyboards/tv44/keymaps/default/keymap.c @@ -0,0 +1,97 @@ +#include "tv44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _QW 0 +#define _DV 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 +#define _L3 5 + +// Macro name shortcuts +#define QWERTY M(_QW) +#define DVORAK M(_DV) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = { /* Qwerty */ + {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(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1) }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_DV] = { /* Dvorak */ + {KC_TAB, KC_SLSH, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC }, + {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1) }, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_CM] = { /* Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, + {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1) }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_L1] = { /* LAYER 1 */ + {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, + {_______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, + {_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } + }, + [_L2] = { /* LAYER 2 */ + {_______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______ }, + {KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_4, KC_5, KC_6, KC_VOLU, KC_ENT }, + {_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______ }, + {_______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } + }, + [_L3] = { /* LAYER 3 */ + {_______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______ }, + {KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______ }, + {KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______ }, + {_______, KC_LSFT, KC_B, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_C, _______, _______, XXXXXXX, _______ } + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/tv44/keymaps/default/readme.md b/keyboards/tv44/keymaps/default/readme.md new file mode 100644 index 000000000..ac84c08cf --- /dev/null +++ b/keyboards/tv44/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/tv44/keymaps/jeebak/Makefile b/keyboards/tv44/keymaps/jeebak/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/tv44/keymaps/jeebak/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/jeebak/config.h b/keyboards/tv44/keymaps/jeebak/config.h new file mode 100644 index 000000000..a59ef2b70 --- /dev/null +++ b/keyboards/tv44/keymaps/jeebak/config.h @@ -0,0 +1,21 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/** + *TV44 keymap definition macro + */ +#define KEYMAP_TV44( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \ + K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \ + K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \ + K37, K38, K39, K40, K41, K42, K43, K44 \ +) { \ + { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, }, \ + { K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, }, \ + { K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, }, \ + { K37, K38, K39, K40, KC_NO, KC_NO, KC_NO, K41, K42, K43, KC_NO, K44 } \ +} + +#endif diff --git a/keyboards/tv44/keymaps/jeebak/keymap.c b/keyboards/tv44/keymaps/jeebak/keymap.c new file mode 100644 index 000000000..1bb1015c3 --- /dev/null +++ b/keyboards/tv44/keymaps/jeebak/keymap.c @@ -0,0 +1,425 @@ +#include "tv44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _TOUCHCURSOR 6 +#define _MOUSECURSOR 7 +#define _ADJUST 16 + +// Keycodes +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +enum macro_keycodes { + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, + KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper +#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI +#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab +#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab +#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings +#define AG_AGAIN M(KC_AG_AGAIN) +#define AG_UNDO M(KC_AG_UNDO) +#define AG_CUT M(KC_AG_CUT) +#define AG_COPY M(KC_AG_COPY) +#define AG_PASTE M(KC_AG_PASTE) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_QWERTY] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_S,LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Colemak + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | Z | X | C | V | B | K | M | , | . | / | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_COLEMAK] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_R,LT_MC(KC_S), KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Dvorak + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * |Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_DVORAK] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_O,LT_MC(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_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Lower + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Brite | | | | | | Vol- | Mute | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_LOWER] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + KC_LBRC , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_RBRC , KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Raise + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Brite | | | | | | Vol- | Mute | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_RAISE] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. + */ + +[_TOUCHCURSOR] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______ , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,AG_UNDO, AG_CUT, AG_COPY,AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R,CMD_SLSH, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Mouse Layer + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ + +[_MOUSECURSOR] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + _______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______ , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5 , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Plover layer (http://opensteno.org) + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | TogOut | S | K | W | R | * | * | R | B | G | S | Z | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Exit | A | O | | | E | U | | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ + +[_PLOVER] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + KC_1 , KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + XXXXXXX , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + XXXXXXX , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + EXT_PLV , KC_C , KC_V , XXXXXXX , XXXXXXX , KC_N , KC_M , XXXXXXX ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Adjust (Lower + Raise) + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | | | | | | | | | | | | Del | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | | | | | | | | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | Reset | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_ADJUST] = KEYMAP_TV44( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , RESET ) +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + default_layer_set(1UL<<_DVORAK); + } + 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 BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: + // quantum/quantum.c + if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. + } + + switch (id) { + case KC_ALT_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + case KC_CMD_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + + case KC_CTL_TAB: + return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + + case KC_AG_FIND: + return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); + case KC_AG_AGAIN: + return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); + case KC_AG_UNDO: + return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); + case KC_AG_CUT: + return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); + case KC_AG_COPY: + return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); + case KC_AG_PASTE: + return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); + + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); + } + + return MACRO_NONE; +} diff --git a/keyboards/tv44/keymaps/jeebak/readme.md b/keyboards/tv44/keymaps/jeebak/readme.md new file mode 100644 index 000000000..43d20958a --- /dev/null +++ b/keyboards/tv44/keymaps/jeebak/readme.md @@ -0,0 +1,129 @@ +jeebak's TV44 layout +======================= +NOTE: This is a port of jeebak's planck layout, for tv44. + +This WIP keymap attempts to minimize fingers straying away from the home row. +To aid in this endeavor, when additional modifyer keys to switch layers are +needed, they will be mapped to home row keys. The `keymap.c` file will contain +the exact changes. The diagrams in this README shows the highlights of the +changes from the default mappings. + +I also decided to change all calls to `persistant_default_layer_set()` to +`default_layer_set()` since this is my personal perference. + +## Macros +``` +#define ALT_TAB M(KC_ALT_TAB) +``` + +## Base Layers (Qwerty/Colemak/Dvorak) +These base layers are mostly the same as the default mappings. The interesting +changes are shown below. + +- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, +- `GUI/;` as `;` and `GUI`, +- `Alt/"` as `"` and `Alt`, +- `Sft/Ent` as `Enter` and `Shift`, and +- `Hyper/Tab` as `Tab` and `Hyper` + +A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. +The arrow keys, which have been moved to the +[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been +replaced with the Media keys as shown. The `MC/kc` key activates the +`MouseCursor` layer when held, and emits the corresponding `kc` for its layer, +when tapped. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## Lower Layer (Symbols and Function Keys) +The symbols and functions keys are essentially the same as the default mapping. +The most notable changes are that the symbol keys from the `RAISE` layer have +been moved here. The remaining Media keys replace those that are now on the +base layers. The `BACKLIT` key has also been moved here. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Brite | | | | | | Vol- | Mute | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## Raise Layer (Numbers and Arithmetic Operators) +All of the numbers and arithmetic operators are available on this layer. Some +keys are duplicated for the convenience of their positions. The `0` and `$` +keys at the far left are for quick access to beginning and end of line in vim. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Brite | | | | | | Vol- | Mute | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## TouchCursor layer plus personal customizations +[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key +as the modifier, with the `IJKL` home row keys representing the inverted-T of +the arrow keys. All of the default TouchCursor keymappings for the right hand +are represented below. My personalizations include all of the keys shown for +the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key +from the base layers) readily accessible from the home row allows quick word +jumps and highlighting when used in conjunction with the arrow keys. The +`Alt-Tab` macro is not only useful under Windows, but also under Mac when used +with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). +The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in +this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` +keycodes do not seem to work. There are macros in place that'll "automatically" +choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, +etc.) depending on which layout you've currently selected (`AG_NORM` or +`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I +use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and +`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as +Google Chrome. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | | | | | | | | | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## Mouse Layer +The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. +The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the +mouse from the `doc/keycode.txt` file are represented, and logically located, +IMHO. The left and right click buttons are duplicated; on the right hand side, +for a quick click here and there, and again on the left hand side for when the +buttons need to be held for dragging things or highlighting text, thus allowing +the right hand to be free to use the up/down/left/right actions. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | | | | | | | | | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` diff --git a/keyboards/tv44/keymaps/xyverz/Makefile b/keyboards/tv44/keymaps/xyverz/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/config.h b/keyboards/tv44/keymaps/xyverz/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/keymap.c b/keyboards/tv44/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..8cbcf8d35 --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/keymap.c @@ -0,0 +1,92 @@ +#include "tv44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _DV 0 +#define _QW 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DV] = { /* 0: Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC }, + {MO(_L1), 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_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_QW] = { /* 1: Qwerty */ + {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(_L1), 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_CM] = { /* 2: Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, + {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_L1] = {/* 1: FN 1 */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, + {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, + {KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, _______, _______ } + }, + + [_L2] = { /* 2: FN 2 */ + {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ESC }, + {_______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_VOLU, KC_ENT }, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, + {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ } + } + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; + + diff --git a/keyboards/tv44/keymaps/xyverz/readme.md b/keyboards/tv44/keymaps/xyverz/readme.md new file mode 100644 index 000000000..ac84c08cf --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/readme.md @@ -0,0 +1 @@ +# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/tv44/readme.md b/keyboards/tv44/readme.md new file mode 100644 index 000000000..4f691a4ca --- /dev/null +++ b/keyboards/tv44/readme.md @@ -0,0 +1,28 @@ +tv44 keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/tv44 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make default`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + +``` +$ make [default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file diff --git a/keyboards/tv44/rules.mk b/keyboards/tv44/rules.mk new file mode 100644 index 000000000..dbba6bace --- /dev/null +++ b/keyboards/tv44/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 diff --git a/keyboards/tv44/tv44.c b/keyboards/tv44/tv44.c new file mode 100644 index 000000000..6dc0efd28 --- /dev/null +++ b/keyboards/tv44/tv44.c @@ -0,0 +1,28 @@ +#include "tv44.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/tv44/tv44.h b/keyboards/tv44/tv44.h new file mode 100644 index 000000000..65c0b4593 --- /dev/null +++ b/keyboards/tv44/tv44.h @@ -0,0 +1,22 @@ +#ifndef TV44_H +#define TV44_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K37, K38, K39, K3A, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ + +#endif diff --git a/keyboards/vision_division/Makefile b/keyboards/vision_division/Makefile new file mode 100644 index 000000000..4e2a6f00f --- /dev/null +++ b/keyboards/vision_division/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/vision_division/Potential Layouts.txt b/keyboards/vision_division/Potential Layouts.txt new file mode 100644 index 000000000..f715ac8c6 --- /dev/null +++ b/keyboards/vision_division/Potential Layouts.txt @@ -0,0 +1,84 @@ +/* Numeric Max / Numeric Normal - Full Grid + * .-----------------------------------. .--------------------------------------------------------------_--------------------------------------------------------------. .-----------------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' + * .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------| + * | | | | | o | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' + */ + +//* Numeric Max / Homing Normal - Full Grid + * .-----------------------------------. .--------------------------------------------------------------_--------------------------------------------------------------. .--------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '--------------------------' + * .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .--------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------| + * | | | | | o | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '--------------------------' + */ + +//* Numeric Max / Homing Normal - Traditional + * .-----------------------------------. .-----------------------------------. .-----------------_-----------------. .-----------------------------------. .--------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------' '-----------------------------------' '-----------------------------------' '--------------------------' + * .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .--------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------| + * | | | | | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+ | o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| '--------+--------+--------' + * | | | | | o | | | | | | | | | | | | | | | + * |--------+--------+--------+--------| o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| .--------. + * | | | | | | | | | | | | | | | | | | | | + * |--------+--------+--------+ | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| .--------+--------+--------. + * | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '--------------------------' + */ + +/* Numeric Max / Numeric Normal + * .-----------------------------------. .--------------------------------------------------------------_--------------------------------------------------------------. .-----------------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' + * .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. + * | | | | | | 1U / 2U | | | | | | | | | | | 1U / 2U | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------| + * | 1U | | | 1U | | | | | | | | | | | | | | | | | 1U | | | 1U | + * | / +--------+--------+ / | o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | / +--------+--------+ / | + * | 2U | | | 2U | o | 1U / 2U | | | | | | | | | | | | | 2U | | | 2U | + * |--------+--------+--------+--------| o |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| |--------+--------+--------+--------| + * | | | | | | 1U / 2U | | | | | | | | | | | 1U / 2U | | | | | | + * | '--------+--------' | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | '--------+--------' | + * | 1U / 2UH / 2UV | 1U / 2UH / 2UV | | | | | | | | 1U / 2U | | | | | | | | 1U / 2UH / 2UV | 1U / 2UH / 2UV | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' + */ + +/* Numeric Max / Numeric Max + * .-----------------------------------. .-----------------------------------------------------------------------_-----------------------------------------------------------------------. .-----------------------------------. + * | | | | | | | | | | | | | | | | | | | | | | | | | | | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' + * .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. + * | | | | | | 1U / 2U | | | | | | | | | | | | | 1U / 2U | | | | | | + * |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------| + * | 1U | | | 1U | | | | | | | | | | | | | | | | | | | 1U | | | 1U | + * | / +--------+--------+ / | o |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | / +--------+--------+ / | + * | 2U | | | 2U | o | 1U / 2U | | | | | | | | | | | | | | | 2U | | | 2U | + * |--------+--------+--------+--------| o |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| |--------+--------+--------+--------| + * | | | | | | 1U / 2U | | | | | | | | | | | | | 1U / 2U | | | | | | + * | '--------+--------' | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | '--------+--------' | + * | 1U / 2UH / 2UV | 1U / 2UH / 2UV | | | | | | | | 1U / 2U | 1U / 2U | | | | | | | | 1U / 2UH / 2UV | 1U / 2UH / 2UV | + * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' + */ diff --git a/keyboards/vision_division/config.h b/keyboards/vision_division/config.h new file mode 100644 index 000000000..f50378ffa --- /dev/null +++ b/keyboards/vision_division/config.h @@ -0,0 +1,139 @@ +/* +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +// Due to the configurability of this keyboard, matrix sizes are determined in the keymap's config.h + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/vision_division/keymaps/default/Makefile b/keyboards/vision_division/keymaps/default/Makefile new file mode 100644 index 000000000..ecbe7e1ab --- /dev/null +++ b/keyboards/vision_division/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/vision_division/keymaps/default/config.h b/keyboards/vision_division/keymaps/default/config.h new file mode 100644 index 000000000..16740fb15 --- /dev/null +++ b/keyboards/vision_division/keymaps/default/config.h @@ -0,0 +1,59 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" +#include "matrix_types.h" + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID GET_PID(NUMERIC_NORMAL, HOMING_MAX_TEENSY) +#define DEVICE_VER 0x0001 +#define MANUFACTURER IBNobody +#define PRODUCT Vision Division +#define DESCRIPTION Full / Split Keyboard + + +#define MATRIX_ROWS 6 +#define MATRIX_ROW_PINS { C2, C3, F4, F5, F6, F7 } + +#define MATRIX_COLS GET_MATRIX_COLS(NUMERIC_NORMAL, HOMING_MAX_TEENSY) +#define MATRIX_COL_PINS GET_MATRIX_COL_PINS(NUMERIC_NORMAL, HOMING_MAX_TEENSY) + +#define UNUSED_PINS + +/*#define KEYMAP( \ + k101, k102, k103, k104, k105, k106, k107, k108, k109, k10A, k10B, k10C, k111, k112, k113, k114, k115, k116, k117, k118, k119, k11A, k11B, k11C, \ + k201, k202, k203, k204, k205, k206, k207, k208, k209, k20A, k20B, k20C, k211, k212, k213, k214, k215, k216, k217, k218, k219, k21A, k21B, k21C, \ + k301, k302, k303, k304, k305, k306, k307, k308, k309, k30A, k30B, k30C, k311, k312, k313, k314, k315, k316, k317, k318, k319, k31A, k31B, k31C, \ + k401, k402, k403, k404, k405, k406, k407, k408, k409, k40A, k40B, k40C, k411, k412, k413, k414, k415, k416, k417, k418, k419, k41A, k41B, k41C, \ + k501, k502, k503, k504, k505, k506, k507, k508, k509, k50A, k50B, k50C, k511, k512, k513, k514, k515, k516, k517, k518, k519, k51A, k51B, k51C, \ + k601, k602, k603, k604, k605, k606, k607, k608, k609, k60A, k60B, k60C, k611, k612, k613, k614, k615, k616, k617, k618, k619, k61A, k61B, k61C \ +) \ +KEYMAP_MASTER(NUMERIC_MAX_TEENSY, NUMERIC_MAX, \ + k101, k102, k103, k104, k105, k106, k107, k108, k109, k10A, k10B, k10C, k111, k112, k113, k114, k115, k116, k117, k118, k119, k11A, k11B, k11C, \ + k201, k202, k203, k204, k205, k206, k207, k208, k209, k20A, k20B, k20C, k211, k212, k213, k214, k215, k216, k217, k218, k219, k21A, k21B, k21C, \ + k301, k302, k303, k304, k305, k306, k307, k308, k309, k30A, k30B, k30C, k311, k312, k313, k314, k315, k316, k317, k318, k319, k31A, k31B, k31C, \ + k401, k402, k403, k404, k405, k406, k407, k408, k409, k40A, k40B, k40C, k411, k412, k413, k414, k415, k416, k417, k418, k419, k41A, k41B, k41C, \ + k501, k502, k503, k504, k505, k506, k507, k508, k509, k50A, k50B, k50C, k511, k512, k513, k514, k515, k516, k517, k518, k519, k51A, k51B, k51C, \ + k601, k602, k603, k604, k605, k606, k607, k608, k609, k60A, k60B, k60C, k611, k612, k613, k614, k615, k616, k617, k618, k619, k61A, k61B, k61C \ +)*/ + +#define KEYMAP( \ + k101, k102, k103, k104, k105, k106, k107, k108, k109, k10A, k111, k112, k113, k114, k115, k116, k117, k118, k119, k11A, k11B, \ + k201, k202, k203, k204, k205, k206, k207, k208, k209, k20A, k211, k212, k213, k214, k215, k216, k217, k218, k219, k21A, k21B, \ + k301, k302, k303, k304, k305, k306, k307, k308, k309, k30A, k311, k312, k313, k314, k315, k316, k317, k318, k319, k31A, k31B, \ + k401, k402, k403, k404, k405, k406, k407, k408, k409, k40A, k411, k412, k413, k414, k415, k416, k417, k418, k419, k41A, k41B, \ + k501, k502, k503, k504, k505, k506, k507, k508, k509, k50A, k511, k512, k513, k514, k515, k516, k517, k518, k519, k51A, k51B, \ + k601, k602, k603, k604, k605, k606, k607, k608, k609, k60A, k611, k612, k613, k614, k615, k616, k617, k618, k619, k61A, k61B \ +) \ +KEYMAP_MASTER(NUMERIC_NORMAL, HOMING_MAX_TEENSY, \ + k101, k102, k103, k104, k105, k106, k107, k108, k109, k10A, KC_NO, KC_NO, k111, k112, k113, k114, k115, k116, k117, k118, k119, k11A, k11B, KC_NO, \ + k201, k202, k203, k204, k205, k206, k207, k208, k209, k20A, KC_NO, KC_NO, k211, k212, k213, k214, k215, k216, k217, k218, k219, k21A, k21B, KC_NO, \ + k301, k302, k303, k304, k305, k306, k307, k308, k309, k30A, KC_NO, KC_NO, k311, k312, k313, k314, k315, k316, k317, k318, k319, k31A, k31B, KC_NO, \ + k401, k402, k403, k404, k405, k406, k407, k408, k409, k40A, KC_NO, KC_NO, k411, k412, k413, k414, k415, k416, k417, k418, k419, k41A, k41B, KC_NO, \ + k501, k502, k503, k504, k505, k506, k507, k508, k509, k50A, KC_NO, KC_NO, k511, k512, k513, k514, k515, k516, k517, k518, k519, k51A, k51B, KC_NO, \ + k601, k602, k603, k604, k605, k606, k607, k608, k609, k60A, KC_NO, KC_NO, k611, k612, k613, k614, k615, k616, k617, k618, k619, k61A, k61B, KC_NO \ +) + +#endif \ No newline at end of file diff --git a/keyboards/vision_division/keymaps/default/keymap.c b/keyboards/vision_division/keymaps/default/keymap.c new file mode 100644 index 000000000..b8cef9c75 --- /dev/null +++ b/keyboards/vision_division/keymaps/default/keymap.c @@ -0,0 +1,630 @@ +#include "vision_division.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "led.h" + +#ifdef AUDIO_ENABLE + #include "audio.h" + #include "song_list.h" +#endif + +#define LAYER_QWERTY 0 +#define LAYER_COLEMAK 1 +#define LAYER_DVORAK 2 +#define LAYER_UPPER 3 +#define LAYER_LOWER 4 +#define LAYER_FUNCTION 5 +#define LAYER_MOUSE 6 +#define LAYER_ADJUST 7 + +#define MACRO_QWERTY 0 +#define MACRO_COLEMAK 1 +#define MACRO_DVORAK 2 +#define MACRO_UPPER 3 +#define MACRO_LOWER 4 +#define MACRO_FUNCTION 5 +#define MACRO_MOUSE 6 +#define MACRO_TIMBRE_1 7 +#define MACRO_TIMBRE_2 8 +#define MACRO_TIMBRE_3 9 +#define MACRO_TIMBRE_4 10 +#define MACRO_TEMPO_U 11 +#define MACRO_TEMPO_D 12 +#define MACRO_TONE_DEFAULT 13 +#define MACRO_MUSIC_TOGGLE 14 +#define MACRO_AUDIO_TOGGLE 16 +#define MACRO_INC_VOICE 18 +#define MACRO_DEC_VOICE 19 +#define MACRO_BACKLIGHT 20 +#define MACRO_BREATH_TOGGLE 21 +#define MACRO_BREATH_SPEED_INC 23 +#define MACRO_BREATH_SPEED_DEC 24 +#define MACRO_BREATH_DEFAULT 25 + +#define M_QWRTY M(MACRO_QWERTY) +#define M_COLMK M(MACRO_COLEMAK) +#define M_DVORK M(MACRO_DVORAK) +#define M_UPPER M(MACRO_UPPER) +#define M_LOWER M(MACRO_LOWER) +#define M_FUNCT M(MACRO_FUNCTION) +#define M_MOUSE M(MACRO_MOUSE) +#define TIMBR_1 M(MACRO_TIMBRE_1) +#define TIMBR_2 M(MACRO_TIMBRE_2) +#define TIMBR_3 M(MACRO_TIMBRE_3) +#define TIMBR_4 M(MACRO_TIMBRE_4) +#define TMPO_UP M(MACRO_TEMPO_U) +#define TMPO_DN M(MACRO_TEMPO_D) +#define TMPO_DF M(MACRO_TONE_DEFAULT) +#define M_BACKL M(MACRO_BACKLIGHT) +#define M_BRTOG M(MACRO_BREATH_TOGGLE) +#define M_BSPDU M(MACRO_BREATH_SPEED_INC) +#define M_BSPDD M(MACRO_BREATH_SPEED_DEC) +#define M_BDFLT M(MACRO_BREATH_DEFAULT) + + +#define VC_UP M(MACRO_INC_VOICE) +#define VC_DOWN M(MACRO_DEC_VOICE) + + +#define SC_UNDO LCTL(KC_Z) +#define SC_REDO LCTL(KC_Y) +#define SC_CUT LCTL(KC_X) +#define SC_COPY LCTL(KC_C) +#define SC_PSTE LCTL(KC_V) +#define SC_SELA LCTL(KC_A) +#define SC_SAVE LCTL(KC_S) +#define SC_OPEN LCTL(KC_O) +#define SC_ACLS LALT(KC_F4) +#define SC_CCLS LCTL(KC_F4) + +#define OS_SHFT KC_FN0 + +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define ________________ _______, _______ +#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +KEYMAP( \ + KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TAB, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_CAPS, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, KC_LSFT, 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, XXXXXXX, KC_UP, XXXXXXX, \ + KC_KP_0, KC_KP_0, KC_PDOT, KC_PENT, KC_LCTL, KC_LCTL, XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, KC_SPC, KC_SPC, XXXXXXX, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ +) + + +// [LAYER_QWERTY] = { // QWERTY +// { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC }, +// { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_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_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_RSFT, KC_UP, KC_PGDN }, +// { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, +// }, + + +// /* Numeric Max / Homing Normal - Traditional +// * .-----------------------------------. .-----------------------------------. .-----------------_-----------------. .-----------------------------------. .--------------------------. +// * | | | | | | | | | | | | | | | | | | | | | | | | +// * '-----------------------------------' '-----------------------------------' '-----------------------------------' '-----------------------------------' '--------------------------' +// * .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .--------------------------. +// * | | | | | | ESC | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | | | | | | +// * |--------+--------+--------+--------| | -------+ -------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------| +// * | | | | | | TAB | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | | | | | | +// * |--------+--------+--------+ | o | -------+ -------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| '--------+--------+--------' +// * | | | | | o | CAPS | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | | +// * |--------+--------+--------+--------| o | -------+ -------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---+--------| .--------. +// * | | | | | | LSHIFT | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX | | | | +// * |--------+--------+--------+ | | -------+ -------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+--------+--------| .--------+--------+--------. +// * | | | | | LCTRL | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | | | | | | +// * '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '--------------------------' +// */ + + +// /* QWERTY +// * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. +// * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +// * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| +// * | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| +// * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN | +// * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| +// * | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT | +// * '--------------------------------------------------------------------------------------------------------------------------------------' +// */ + +// [LAYER_QWERTY] = { // QWERTY +// { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC }, +// { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_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_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_RSFT, KC_UP, KC_PGDN }, +// { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, +// }, + +// /* COLEMAK +// * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. +// * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +// * | TAB | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | DEL | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| +// * | BACKSP | A | R | S | T | D | H | N | E | I | O | ' | XXXXXX . ENTER | PG UP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| +// * | LSHIFT | Z | X | C | V | B | K | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN | +// * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| +// * | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT | +// * '--------------------------------------------------------------------------------------------------------------------------------------' +// */ + +// [LAYER_COLEMAK] = { // COLEMAK +// { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC }, +// { KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL }, +// { KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP }, +// { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN }, +// { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, +// }, + +// /* DVORAK +// * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. +// * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | XXXXXX . BACKSP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +// * | TAB | ' | , | . | P | Y | F | G | C | R | L | / | = | \ | DEL | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| +// * | CAPS | A | O | E | U | I | D | H | T | N | S | - | XXXXXX . ENTER | PG UP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| +// * | LSHIFT | ; | Q | J | K | X | B | M | W | V | Z | XXXXXX . RSHIFT | UP | PG DN | +// * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| +// * | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT | +// * '--------------------------------------------------------------------------------------------------------------------------------------' +// */ + +// [LAYER_DVORAK] = { // DVORAK +// { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_BSPC }, +// { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL }, +// { KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_ENT, KC_PGUP }, +// { KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN }, +// { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, +// }, + +// /* UPPER +// * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. +// * | PRINT | BR TOG | BR SP+ | BR SP- | BR RST | XXXXXX | XXXXXX | NUM LK | / | * | | NUM LK | SCR LK | XXXXXX . PAUSE | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +// * | | F1 | F2 | F3 | F4 | | | 7 | 8 | 9 | - | | | | INS | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| +// * | CAP LK | F5 | F6 | F7 | F8 | | | 4 | 5 | 6 | + | | XXXXXX . | HOME | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| +// * | | F9 | F10 | F11 | F12 | | | 1 | 2 | 3 | ENTER | XXXXXX . | | END | +// * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| +// * | | | | | | 0 | | RALT | . | ENTER | | | | | +// * '--------------------------------------------------------------------------------------------------------------------------------------' +// */ + +// [LAYER_UPPER] = { // UPPER +// { KC_PSCR, M_BRTOG, M_BSPDU, M_BSPDD, M_BDFLT, XXXXXXX, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, XXXXXXX, XXXXXXX, KC_SLCK, KC_PAUS, KC_PAUS }, +// { _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, KC_INS }, +// { KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, ________________, KC_HOME }, +// { _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, ________________, _______, KC_END }, +// { _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, _______, KC_RALT, KC_PDOT, KC_PENT, _______, _______, _______, _______ }, +// }, + +// /* LOWER +// * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. +// * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . BACKSP | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +// * | | $ | { | [ | ( | % | # | ) | ] | } | @ | | | | INS | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| +// * | | ^ | * | + | - | / | \ | _ | ' | " | ` | | XXXXXX . | HOME | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| +// * | | | | & | ! | ~ | ; | : | = | < | > | ? | XXXXXX . | | END | +// * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| +// * | | | | | | | | | | | | | | | +// * '--------------------------------------------------------------------------------------------------------------------------------------' +// */ + +// [LAYER_LOWER] = { // LOWER +// { _______, 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_DLR, KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT, _______, _______, _______, KC_INS }, +// { _______, KC_CIRC, KC_ASTR, KC_PPLS, KC_PMNS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT, KC_GRV, _______, ________________, KC_HOME }, +// { _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL, KC_LT, KC_GT, KC_QUES, ________________, _______, KC_END }, +// { _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ }, +// }, + +// /* FUNCTION +// * .---------------------------------------------------------------------------------------------------------------------- 2u ------------. +// * | NUM LK | | | | | | | | | | | | | XXXXXX . | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +// * | SCR LK | F13 | F14 | F15 | F16 | | | | | | | | | | | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------| +// * | CAP LK | F17 | F18 | F19 | F20 | | | | | | | | XXXXXX . | | +// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------| +// * | | F21 | F22 | F23 | F24 | | | | | | | XXXXXX . | VOL UP | MUTE | +// * |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------| +// * | | | | | | PLAY/PAUSE | | | | | | PTRACK | VOL DN | NTRACK | +// * '--------------------------------------------------------------------------------------------------------------------------------------' +// */ + +// [LAYER_FUNCTION] = { // FUNCTION +// { KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX }, +// { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, +// { KC_CAPS, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX, XXXXXXX }, +// { _______, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ________________, KC_VOLU, KC_MUTE }, +// { _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT }, +// }, + +// #ifdef MOUSEKEY_ENABLE + +// [LAYER_MOUSE] = { // MOUSE +// { _______, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX }, +// { XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, +// { XXXXXXX, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX, KC_WH_U }, +// { _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ________________, KC_MS_U, KC_WH_D }, +// { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, +// }, + +// #endif + +// [LAYER_ADJUST] = { // ADJUST +// { _______, TIMBR_1, TIMBR_2, TIMBR_3, TIMBR_4, TMPO_UP, TMPO_DN, TMPO_DF, _______, _______, _______, MU_TOG, AU_TOG, ________________ }, +// { _______, M_QWRTY, M_COLMK, M_DVORK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, +// { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______ }, +// { _______, _______, _______, _______, M_BACKL, RESET, _______, M_MOUSE, _______, _______, _______, ________________, MUV_IN, _______ }, +// { _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, MUV_DE, _______ }, +// }, + + +// /* +// [LAYER_EMPTY] = { // LAYER +// { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________ }, +// { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, +// { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______ }, +// { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______, _______ }, +// { _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ }, +// }, +// */ + +}; + +#ifdef AUDIO_ENABLE + +float tone_my_startup[][2] = SONG(ODE_TO_JOY); +float tone_my_goodbye[][2] = SONG(ROCK_A_BYE_BABY); + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float tone_audio_on[][2] = SONG(CLOSE_ENCOUNTERS_5_NOTE); +float tone_music_on[][2] = SONG(DOE_A_DEER); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND); +float tone_caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND); +float tone_numlk_on[][2] = SONG(NUM_LOCK_ON_SOUND); +float tone_numlk_off[][2] = SONG(NUM_LOCK_OFF_SOUND); +float tone_scroll_on[][2] = SONG(SCROLL_LOCK_ON_SOUND); +float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND); + +#endif /* AUDIO_ENABLE */ + +void persistant_default_layer_set(uint16_t default_layer) +{ + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_MODS_ONESHOT(MOD_LSFT), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + + // MACRODOWN only works in this function + switch(id) + { + + // case MACRO_BREATH_TOGGLE: + // if (record->event.pressed) + // { + // breathing_toggle(); + // } + // break; + + // case MACRO_BREATH_SPEED_INC: + // if (record->event.pressed) + // { + // breathing_speed_inc(1); + // } + // break; + + // case MACRO_BREATH_SPEED_DEC: + // if (record->event.pressed) + // { + // breathing_speed_dec(1); + // } + // break; + + // case MACRO_BREATH_DEFAULT: + // if (record->event.pressed) + // { + // breathing_defaults(); + // } + // break; + + case MACRO_QWERTY: + if (record->event.pressed) + { + persistant_default_layer_set(1UL<event.pressed) + { + persistant_default_layer_set(1UL<event.pressed) + { + persistant_default_layer_set(1UL<event.pressed) + { + layer_on(LAYER_UPPER); + // breathing_speed_set(2); + // breathing_pulse(); + update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); + } + else + { + layer_off(LAYER_UPPER); + update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); + } + break; + + case MACRO_LOWER: + if (record->event.pressed) + { + layer_on(LAYER_LOWER); + // breathing_speed_set(2); + // breathing_pulse(); + update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); + } + else + { + layer_off(LAYER_LOWER); + update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); + } + break; + + case MACRO_FUNCTION: + if (record->event.pressed) + { + // breathing_speed_set(3); + // breathing_enable(); + layer_on(LAYER_FUNCTION); + } + else + { + // breathing_speed_set(1); + // breathing_self_disable(); + layer_off(LAYER_FUNCTION); + } + break; + +#ifdef MOUSEKEY_ENABLE + + case MACRO_MOUSE: + if (record->event.pressed) + { + layer_invert(LAYER_MOUSE); + } + break; + +#endif /* MOUSEKEY_ENABLE */ + +#ifdef AUDIO_ENABLE + + case MACRO_TIMBRE_1: + if (record->event.pressed) set_timbre(TIMBRE_12); + break; + + case MACRO_TIMBRE_2: + if (record->event.pressed) set_timbre(TIMBRE_25); + break; + + case MACRO_TIMBRE_3: + if (record->event.pressed) set_timbre(TIMBRE_50); + break; + + case MACRO_TIMBRE_4: + if (record->event.pressed) set_timbre(TIMBRE_75); + break; + + case MACRO_TEMPO_U: + if (record->event.pressed) increase_tempo(10); + break; + + case MACRO_TEMPO_D: + if (record->event.pressed) decrease_tempo(10); + break; + + case MACRO_TONE_DEFAULT: + if (record->event.pressed) + { + set_timbre(TIMBRE_DEFAULT); + set_tempo(TEMPO_DEFAULT); + } + break; + +/* + case MACRO_AUDIO_TOGGLE: + if (record->event.pressed) + { + if (is_audio_on()) + { + audio_off(); + } + else + { + audio_on(); + PLAY_NOTE_ARRAY(tone_audio_on, false, STACCATO); + } + } + break; + + case MACRO_MUSIC_TOGGLE: + if (record->event.pressed) + { + if (IS_LAYER_ON(LAYER_MUSIC)) + { + layer_off(LAYER_MUSIC); + stop_all_notes(); + } + else + { + PLAY_NOTE_ARRAY(tone_music_on, false, STACCATO); + layer_on(LAYER_MUSIC); + } + } + break; + case MACRO_INC_VOICE: + if (record->event.pressed) + { + #ifdef AUDIO_ENABLE + voice_iterate(); + PLAY_NOTE_ARRAY(music_scale, false, STACCATO); + #endif + } + break; + + case MACRO_DEC_VOICE: + if (record->event.pressed) + { + #ifdef AUDIO_ENABLE + voice_deiterate(); + PLAY_NOTE_ARRAY(music_scale, false, STACCATO); + #endif + } + break; +*/ + +#endif /* AUDIO_ENABLE */ + +#ifdef BACKLIGHT_ENABLE + case MACRO_BACKLIGHT: + if (record->event.pressed) + { + backlight_step(); + } +#endif + + default: + break; + + } + return MACRO_NONE; +}; + + +#ifdef AUDIO_ENABLE + +void matrix_init_user(void) +{ + set_voice(default_voice); + startup_user(); + println("Matrix Init"); +} + +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + + _delay_ms(10); // gets rid of tick + + if (!is_playing_notes()) + { + if ((usb_led & (1<] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file diff --git a/keyboards/vision_division/rules.mk b/keyboards/vision_division/rules.mk new file mode 100644 index 000000000..063fba29b --- /dev/null +++ b/keyboards/vision_division/rules.mk @@ -0,0 +1,70 @@ + + +# MCU name +MCU = at90usb1286 +# MCU = at90usb1287 +# MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 \ No newline at end of file diff --git a/keyboards/vision_division/vision_division.c b/keyboards/vision_division/vision_division.c new file mode 100644 index 000000000..eb9336fa3 --- /dev/null +++ b/keyboards/vision_division/vision_division.c @@ -0,0 +1,28 @@ +#include "vision_division.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/vision_division/vision_division.h b/keyboards/vision_division/vision_division.h new file mode 100644 index 000000000..a1f3195e9 --- /dev/null +++ b/keyboards/vision_division/vision_division.h @@ -0,0 +1,6 @@ +#ifndef VISION_DIVISION_H +#define VISION_DIVISION_H + +#include "quantum.h" + +#endif diff --git a/lib/googletest b/lib/googletest new file mode 160000 index 000000000..ec44c6c16 --- /dev/null +++ b/lib/googletest @@ -0,0 +1 @@ +Subproject commit ec44c6c1675c25b9827aacd08c02433cccde7780 diff --git a/message.mk b/message.mk new file mode 100644 index 000000000..fa051fd71 --- /dev/null +++ b/message.mk @@ -0,0 +1,79 @@ +COLOR ?= true + +ifeq ($(COLOR),true) + NO_COLOR=\033[0m + OK_COLOR=\033[32;01m + ERROR_COLOR=\033[31;01m + WARN_COLOR=\033[33;01m + BLUE=\033[0;34m + BOLD=\033[1m +endif + +ifneq ($(shell awk --version 2>/dev/null),) + AWK=awk +else + AWK=cat && test +endif + +ON_ERROR ?= exit 1 + +OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n +ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n +WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n + +TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }' +TAB_LOG_PLAIN = printf "$$LOG\n" +AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' +AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }' +PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && $(ON_ERROR) +PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) +PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && $(ON_ERROR) +PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) +PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) +BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; +MAKE_MSG_FORMAT = $(AWK) '{ printf "%-118s", $$0;}' + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_ERRORS = $(ERROR_COLOR)Make finished with errors\n$(NO_COLOR) +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_BIN = Creating binary load file for Flash: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling: +MSG_COMPILING_CPP = Compiling: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: +MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ + Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\ + git submodule sync --recursive\n\ + git submodule update --init --recursive$(NO_COLOR)\n\n\ + You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\ + or if you have modified the ChibiOS libraries yourself. \n\n +MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR) + +define GENERATE_MSG_MAKE_KB + MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR) + ifneq ($$(MAKE_TARGET),) + MSG_MAKE_KB_ACTUAL += and target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR) + endif +endef +MSG_MAKE_KB = $(eval $(call GENERATE_MSG_MAKE_KB))$(MSG_MAKE_KB_ACTUAL) +define GENERATE_MSG_MAKE_TEST + MSG_MAKE_TEST_ACTUAL := Making test $(BOLD)$(TEST_NAME)$(NO_COLOR) + ifneq ($$(MAKE_TARGET),) + MSG_MAKE_TEST_ACTUAL += with target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR) + endif +endef +MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL) +MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index fc6fcdeef..8022ca672 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -28,6 +28,14 @@ Q__NOTE(_E4), Q__NOTE(_C4), \ Q__NOTE(_E4), +/* Requires: PLAY_NOTE_ARRAY(..., ..., STACCATO); */ +#define IN_LIKE_FLINT \ + E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), \ + E__NOTE(_AS4), E__NOTE(_B4), QD_NOTE(_CS4), \ + E__NOTE(_B4), E__NOTE(_CS4), QD_NOTE(_DS4), \ + E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \ + E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), + #define GOODBYE_SOUND \ E__NOTE(_E7), \ E__NOTE(_A6), \ diff --git a/quantum/config_common.h b/quantum/config_common.h index 09a4fe701..8ed5f4a10 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -45,6 +45,15 @@ #define F5 0xF5 #define F6 0xF6 #define F7 0xF7 +#define A0 0x00 +#define A1 0x01 +#define A2 0x02 +#define A3 0x03 +#define A4 0x04 +#define A5 0x05 +#define A6 0x06 +#define A7 0x07 + /* USART configuration */ #ifdef BLUETOOTH_ENABLE diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h new file mode 100644 index 000000000..a3ad61bc7 --- /dev/null +++ b/quantum/dynamic_macro.h @@ -0,0 +1,226 @@ +/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ +#ifndef DYNAMIC_MACROS_H +#define DYNAMIC_MACROS_H + +#include "action_layer.h" + +#ifndef DYNAMIC_MACRO_SIZE +/* May be overridden with a custom value. Be aware that the effective + * macro length is half of this value: each keypress is recorded twice + * because of the down-event and up-event. This is not a bug, it's the + * intended behavior. */ +#define DYNAMIC_MACRO_SIZE 256 +#endif + +/* DYNAMIC_MACRO_RANGE must be set as the last element of user's + * "planck_keycodes" enum prior to including this header. This allows + * us to 'extend' it. + */ +enum dynamic_macro_keycodes { + DYN_REC_START1 = DYNAMIC_MACRO_RANGE, + DYN_REC_START2, + DYN_MACRO_PLAY1, + DYN_MACRO_PLAY2, +}; + +/* Blink the LEDs to notify the user about some event. */ +void dynamic_macro_led_blink(void) +{ + backlight_toggle(); + _delay_ms(100); + backlight_toggle(); +} + +/** + * Start recording of the dynamic macro. + * + * @param[out] macro_pointer The new macro buffer iterator. + * @param[in] macro_buffer The macro buffer used to initialize macro_pointer. + */ +void dynamic_macro_record_start( + keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) +{ + dynamic_macro_led_blink(); + + clear_keyboard(); + layer_clear(); + *macro_pointer = macro_buffer; +} + +/** + * Play the dynamic macro. + * + * @param macro_buffer[in] The beginning of the macro buffer being played. + * @param macro_end[in] The element after the last macro buffer element. + * @param direction[in] Either +1 or -1, which way to iterate the buffer. + */ +void dynamic_macro_play( + keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction) +{ + uint32_t saved_layer_state = layer_state; + + clear_keyboard(); + layer_clear(); + + while (macro_buffer != macro_end) { + process_record(macro_buffer); + macro_buffer += direction; + } + + clear_keyboard(); + + layer_state = saved_layer_state; +} + +/** + * Record a single key in a dynamic macro. + * + * @param macro_pointer[in,out] The current buffer position. + * @param macro_end2[in] The end of the other macro which shouldn't be overwritten. + * @param direction[in] Either +1 or -1, which way to iterate the buffer. + * @param record[in] The current keypress. + */ +void dynamic_macro_record_key( + keyrecord_t **macro_pointer, + keyrecord_t *macro_end2, + int8_t direction, + keyrecord_t *record) +{ + if (*macro_pointer + direction != macro_end2) { + **macro_pointer = *record; + *macro_pointer += direction; + } else { + /* Notify about the end of buffer. The blinks are paired + * because they should happen on both down and up events. */ + backlight_toggle(); + } +} + +/** + * End recording of the dynamic macro. Essentially just update the + * pointer to the end of the macro. + */ +void dynamic_macro_record_end(keyrecord_t *macro_pointer, keyrecord_t **macro_end) +{ + dynamic_macro_led_blink(); + + *macro_end = macro_pointer; +} + +/* Handle the key events related to the dynamic macros. Should be + * called from process_record_user() like this: + * + * bool process_record_user(uint16_t keycode, keyrecord_t *record) { + * if (!process_record_dynamic_macro(keycode, record)) { + * return false; + * } + * <...THE REST OF THE FUNCTION...> + * } + */ +bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) +{ + /* Both macros use the same buffer but read/write on different + * ends of it. + * + * Macro1 is written left-to-right starting from the beginning of + * the buffer. + * + * Macro2 is written right-to-left starting from the end of the + * buffer. + * + * ¯o_buffer macro_end + * v v + * +------------------------------------------------------------+ + * |>>>>>> MACRO1 >>>>>>| |<<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| + * +------------------------------------------------------------+ + * ^ ^ + * r_macro_end r_macro_buffer + * + * During the recording when one macro encounters the end of the + * other macro, the recording is stopped. Apart from this, there + * are no arbitrary limits for the macros' length in relation to + * each other: for example one can either have two medium sized + * macros or one long macro and one short macro. Or even one empty + * and one using the whole buffer. + */ + static keyrecord_t macro_buffer[DYNAMIC_MACRO_SIZE]; + + /* Pointer to the first buffer element after the first macro. + * Initially points to the very beginning of the buffer since the + * macro is empty. */ + static keyrecord_t *macro_end = macro_buffer; + + /* The other end of the macro buffer. Serves as the beginning of + * the second macro. */ + static keyrecord_t *const r_macro_buffer = macro_buffer + DYNAMIC_MACRO_SIZE - 1; + + /* Like macro_end but for the second macro. */ + static keyrecord_t *r_macro_end = r_macro_buffer; + + /* A persistent pointer to the current macro position (iterator) + * used during the recording. */ + static keyrecord_t *macro_pointer = NULL; + + /* 0 - no macro is being recorded right now + * 1,2 - either macro 1 or 2 is being recorded */ + static uint8_t macro_id = 0; + + if (macro_id == 0) { + /* No macro recording in progress. */ + if (!record->event.pressed) { + switch (keycode) { + case DYN_REC_START1: + dynamic_macro_record_start(¯o_pointer, macro_buffer); + macro_id = 1; + return false; + case DYN_REC_START2: + dynamic_macro_record_start(¯o_pointer, r_macro_buffer); + macro_id = 2; + return false; + case DYN_MACRO_PLAY1: + dynamic_macro_play(macro_buffer, macro_end, +1); + return false; + case DYN_MACRO_PLAY2: + dynamic_macro_play(r_macro_buffer, r_macro_end, -1); + return false; + } + } + } else { + /* A macro is being recorded right now. */ + switch (keycode) { + case MO(_DYN): + /* Use the layer key used to access the macro recording as + * a stop button. */ + if (record->event.pressed) { /* Ignore the initial release + * just after the recoding + * starts. */ + switch (macro_id) { + case 1: + dynamic_macro_record_end(macro_pointer, ¯o_end); + break; + case 2: + dynamic_macro_record_end(macro_pointer, &r_macro_end); + break; + } + macro_id = 0; + } + return false; + default: + /* Store the key in the macro buffer and process it normally. */ + switch (macro_id) { + case 1: + dynamic_macro_record_key(¯o_pointer, r_macro_end, +1, record); + break; + case 2: + dynamic_macro_record_key(¯o_pointer, macro_end, -1, record); + break; + } + return true; + break; + } + } + + return true; +} + +#endif diff --git a/quantum/keymap.h b/quantum/keymap.h index a15865183..f2d94d75c 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -156,16 +156,16 @@ enum quantum_keycodes { BL_INC, BL_TOGG, BL_STEP, - - // RGB functionality - RGB_TOG, - RGB_MOD, - RGB_HUI, - RGB_HUD, - RGB_SAI, - RGB_SAD, - RGB_VAI, - RGB_VAD, + + // RGB functionality + RGB_TOG, + RGB_MOD, + RGB_HUI, + RGB_HUD, + RGB_SAI, + RGB_SAD, + RGB_VAI, + RGB_VAD, // Left shift, open paren KC_LSPO, @@ -309,7 +309,7 @@ enum quantum_keycodes { #define OSL(layer) (layer | QK_ONE_SHOT_LAYER) // One-shot mod -#define OSM(layer) (layer | QK_ONE_SHOT_MOD) +#define OSM(mod) (mod | QK_ONE_SHOT_MOD) // M-od, T-ap - 256 keycode max #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0xF) << 8)) diff --git a/quantum/keymap_extras/keymap_russian.h b/quantum/keymap_extras/keymap_russian.h new file mode 100644 index 000000000..237e9abde --- /dev/null +++ b/quantum/keymap_extras/keymap_russian.h @@ -0,0 +1,77 @@ +#ifndef KEYMAP_RUSSIAN_H +#define KEYMAP_RUSSIAN_H + +#include "keymap.h" + +// Normal Chracters // reg SHIFT +#define RU_A KC_F // а and А +#define RU_BE KC_COMM // б and Б +#define RU_VE KC_D // в and В +#define RU_GHE KC_U // г and Г +#define RU_DE KC_L // д and Д +#define RU_IE KC_T // е and Е +#define RU_IO KC_GRV // ё and Ё +#define RU_ZHE KC_SCLN // ж and Ж +#define RU_ZE KC_P // з and З +#define RU_I KC_B // и and И +#define RU_SRT_I KC_Q // й and Й +#define RU_KA KC_R // к and К +#define RU_EL KC_K // л and Л +#define RU_EM KC_V // м and М +#define RU_EN KC_Y // н and Н +#define RU_O KC_J // о and О +#define RU_PE KC_G // п and П +#define RU_ER KC_H // р and Р +#define RU_ES KC_C // с and С +#define RU_TE KC_N // т and Т +#define RU_U KC_E // у and У +#define RU_EF KC_A // ф and Ф +#define RU_HA KC_LBRC // х and Х +#define RU_TSE KC_W // ц and Ц +#define RU_CHE KC_X // ч and Ч +#define RU_SHA KC_I // ш and Ш +#define RU_SHCHA KC_O // щ and Щ +#define RU_HSIGN KC_RBRC // ъ and Ъ +#define RU_YERU KC_S // ы and Ы +#define RU_SSIGN KC_M // ь and Ь +#define RU_E KC_QUOT // э and Э +#define RU_YU KC_DOT // ю and Ю +#define RU_YA KC_Z // я and Я + +#define RU_1 KC_1 // 1 and ! +#define RU_2 KC_2 // 2 and " +#define RU_3 KC_3 // 3 and № +#define RU_4 KC_4 // 4 and ; +#define RU_5 KC_5 // 5 and % +#define RU_6 KC_6 // 6 and : +#define RU_7 KC_7 // 7 and ? +#define RU_8 KC_8 // 8 and * +#define RU_9 KC_9 // 9 and ( +#define RU_0 KC_0 // 0 and ) + +#define RU_MINS KC_MINS // - and _ +#define RU_EQL KC_EQL // = and + +#define RU_BSLS KC_BSLS // \ and / +#define RU_DOT KC_SLSH // . and , + +// Shifted Chracters +#define RU_EXLM LSFT(RU_1) // ! +#define RU_DQUT LSFT(RU_2) // " +#define RU_NMRO LSFT(RU_3) // № +#define RU_SCLN LSFT(RU_4) // ; +#define RU_PERC LSFT(RU_5) // % +#define RU_COLN LSFT(RU_6) // : +#define RU_QUES LSFT(RU_7) // ? +#define RU_ASTR LSFT(RU_8) // * +#define RU_LPRN LSFT(RU_9) // ( +#define RU_RPRN LSFT(RU_0) // ) + +#define RU_UNDR LSFT(RU_MINS) // _ +#define RU_PLUS LSFT(RU_EQL) // + +#define RU_SLSH LSFT(RU_BSLS) // / +#define RU_COMM LSFT(RU_DOT) // , + +// Alt Gr-ed characters +#define RU_RUBL RALT(RU_8) // ₽ + +#endif diff --git a/quantum/keymap_extras/keymap_unicode_cyrillic.h b/quantum/keymap_extras/keymap_unicode_cyrillic.h new file mode 100644 index 000000000..a40626d91 --- /dev/null +++ b/quantum/keymap_extras/keymap_unicode_cyrillic.h @@ -0,0 +1,163 @@ +#ifndef KEYMAP_CYRILLIC_H +#define KEYMAP_CYRILLIC_H + +#include "keymap.h" + +/* + * This is based off of + * https://en.wikipedia.org/wiki/Cyrillic_script + * + * Unicode is iffy, a software implementation is preferred + */ + +// Capital Char russian/ukrainian/bulgarian +#define CY_A UC(0x0410) // А rus ukr bul +#define CY_BE UC(0x0411) // Б rus ukr bul +#define CY_VE UC(0x0412) // В rus ukr bul +#define CY_GHE UC(0x0413) // Г rus ukr bul +#define CY_GHEUP UC(0x0490) // Ґ ukr +#define CY_DE UC(0x0414) // Д rus ukr bul +#define CY_DJE UC(0x0402) // Ђ +#define CY_GJE UC(0x0403) // Ѓ +#define CY_IE UC(0x0415) // Е rus ukr bul +#define CY_IO UC(0x0401) // Ё rus +#define CY_UIE UC(0x0404) // Є ukr +#define CY_ZHE UC(0x0416) // Ж rus ukr bul +#define CY_ZE UC(0x0417) // З rus ukr bul +#define CY_DZE UC(0x0405) // Ѕ +#define CY_I UC(0x0418) // И rus ukr bul +#define CY_B_U_I UC(0x0406) // І ukr +#define CY_YI UC(0x0407) // Ї ukr +#define CY_SRT_I UC(0x0419) // Й rus ukr bul +#define CY_JE UC(0x0408) // Ј +#define CY_KA UC(0x041a) // К rus ukr bul +#define CY_EL UC(0x041b) // Л rus ukr bul +#define CY_LJE UC(0x0409) // Љ +#define CY_EM UC(0x041c) // М rus ukr bul +#define CY_EN UC(0x041d) // Н rus ukr bul +#define CY_NJE UC(0x040a) // Њ +#define CY_O UC(0x041e) // О rus ukr bul +#define CY_PE UC(0x041f) // П rus ukr bul +#define CY_ER UC(0x0420) // Р rus ukr bul +#define CY_ES UC(0x0421) // С rus ukr bul +#define CY_TE UC(0x0422) // Т rus ukr bul +#define CY_TSHE UC(0x040b) // Ћ +#define CY_KJE UC(0x040c) // Ќ +#define CY_U UC(0x0423) // У rus ukr bul +#define CY_SRT_U UC(0x040e) // Ў +#define CY_EF UC(0x0424) // Ф rus ukr bul +#define CY_HA UC(0x0425) // Х rus bul +#define CY_TSE UC(0x0426) // Ц rus ukr bul +#define CY_CHE UC(0x0427) // Ч rus ukr bul +#define CY_DZHE UC(0x040f) // Џ +#define CY_SHA UC(0x0428) // Ш rus ukr bul +#define CY_SHCHA UC(0x0429) // Щ rus ukr bul +#define CY_HSIGN UC(0x042a) // Ъ rus bul +#define CY_YERU UC(0x042b) // Ы rus +#define CY_SSIGN UC(0x042c) // Ь rus ukr bul +#define CY_E UC(0x042d) // Э rus +#define CY_YU UC(0x042e) // Ю rus ukr bul +#define CY_YA UC(0x042f) // Я rus ukr bul +// Important Cyrillic non-Slavic letters +#define CY_PALOCHKA UC(0x04c0) // Ӏ +#define CY_SCHWA UC(0x04d8) // Ә +#define CY_GHE_S UC(0x0492) // Ғ +#define CY_ZE_D UC(0x0498) // Ҙ +#define CY_ES_D UC(0x04aa) // Ҫ +#define CY_BR_KA UC(0x04a0) // Ҡ +#define CY_ZHE_D UC(0x0496) // Җ +#define CY_KA_D UC(0x049a) // Қ +#define CY_EN_D UC(0x04a2) // Ң +#define CY_ENGHE UC(0x04a4) // Ҥ +#define CY_BRD_O UC(0x04e8) // Ө +#define CY_STR_U UC(0x04ae) // Ү +#define CY_S_U_S UC(0x04b0) // Ұ +#define CY_SHHA UC(0x04ba) // Һ +#define CY_HA_D UC(0x04b2) // Ҳ + + +// Small +#define CY_a UC(0x0430) // a rus ukr bul +#define CY_be UC(0x0431) // б rus ukr bul +#define CY_ve UC(0x0432) // в rus ukr bul +#define CY_ghe UC(0x0433) // г rus ukr bul +#define CY_gheup UC(0x0491) // ґ ukr +#define CY_de UC(0x0434) // д rus ukr bul +#define CY_dje UC(0x0452) // ђ +#define CY_gje UC(0x0453) // ѓ +#define CY_ie UC(0x0435) // е rus ukr bul +#define CY_io UC(0x0451) // ё rus +#define CY_uie UC(0x0454) // є ukr +#define CY_zhe UC(0x0436) // ж rus ukr bul +#define CY_ze UC(0x0437) // з rus ukr bul +#define CY_dze UC(0x0455) // ѕ +#define CY_i UC(0x0438) // и rus ukr bul +#define CY_b_u_i UC(0x0456) // і ukr +#define CY_yi UC(0x0457) // ї ukr +#define CY_srt_i UC(0x0439) // й rus ukr bul +#define CY_je UC(0x0458) // ј +#define CY_ka UC(0x043a) // к rus ukr bul +#define CY_el UC(0x043b) // л rus ukr bul +#define CY_lje UC(0x0459) // љ +#define CY_em UC(0x043c) // м rus ukr bul +#define CY_en UC(0x043d) // н rus ukr bul +#define CY_nje UC(0x045a) // њ +#define CY_o UC(0x043e) // о rus ukr bul +#define CY_pe UC(0x043f) // п rus ukr bul +#define CY_er UC(0x0440) // р rus ukr bul +#define CY_es UC(0x0441) // с rus ukr bul +#define CY_te UC(0x0442) // т rus ukr bul +#define CY_tshe UC(0x045b) // ћ +#define CY_kje UC(0x045c) // ќ +#define CY_u UC(0x0443) // у rus ukr bul +#define CY_srt_u UC(0x045e) // ў +#define CY_ef UC(0x0444) // ф rus ukr bul +#define CY_ha UC(0x0445) // х rus ukr bul +#define CY_tse UC(0x0446) // ц rus ukr bul +#define CY_che UC(0x0447) // ч rus ukr bul +#define CY_dzhe UC(0x045f) // џ +#define CY_sha UC(0x0448) // ш rus ukr bul +#define CY_shcha UC(0x0449) // щ rus ukr bul +#define CY_hsign UC(0x044a) // ъ rus bul +#define CY_yeru UC(0x044b) // ы rus +#define CY_ssign UC(0x044c) // ь rus ukr bul +#define CY_e UC(0x044d) // э rus +#define CY_yu UC(0x044e) // ю rus ukr bul +#define CY_ya UC(0x044f) // я rus ukr bul +// Important Cyrillic non-Slavic letters +#define CY_palochka UC(0x04cf) // ӏ +#define CY_schwa UC(0x04d9) // ә +#define CY_ghe_s UC(0x0493) // ғ +#define CY_ze_d UC(0x0499) // ҙ +#define CY_es_d UC(0x04ab) // ҫ +#define CY_br_ka UC(0x04a1) // ҡ +#define CY_zhe_d UC(0x0497) // җ +#define CY_ka_d UC(0x049b) // қ +#define CY_en_d UC(0x04a3) // ң +#define CY_enghe UC(0x04a5) // ҥ +#define CY_brd_o UC(0x04e9) // ө +#define CY_str_u UC(0x04af) // ү +#define CY_s_u_s UC(0x04b1) // ұ +#define CY_shha UC(0x04bb) // һ +#define CY_ha_d UC(0x04b3) // ҳ + + +// Extra +#define CY_slr_ve UC(0x1c80) // ᲀ CYRILLIC SMALL LETTER ROUNDED VE +#define CY_ll_de UC(0x1c81) // ᲁ CYRILLIC SMALL LETTER LONG-LEGGED DE +#define CY_ZEMLYA UC(0xa640) // Ꙁ CYRILLIC CAPITAL LETTER ZEMLYA +#define CY_zemlya UC(0xa641) // ꙁ CYRILLIC SMALL LETTER ZEMLYA +#define CY_RV_DZE UC(0xa644) // Ꙅ CYRILLIC CAPITAL LETTER REVERSED DZE +#define CY_rv_DZE UC(0xa645) // ꙅ CYRILLIC SMALL LETTER REVERSED DZE +#define CY_slw_es UC(0x1c83) // ᲃ CYRILLIC SMALL LETTER WIDE ES +#define CY_st_te UC(0x1c84) // ᲄ CYRILLIC SMALL LETTER TALL TE +#define CY_3l_te UC(0x1c85) // ᲅ CYRILLIC SMALL LETTER THREE-LEGGED TE +#define CY_thsign UC(0x1c86) // ᲆ CYRILLIC SMALL LETTER TALL HARD SIGN +#define CY_YERUBY UC(0xa650) // Ꙑ CYRILLIC CAPITAL LETTER YERU WITH BACK YER +#define CY_yeruby UC(0xa651) // ꙑ CYRILLIC SMALL LETTER YERU WITH BACK YER +#define CY_RUBL UC(0x20bd) // ₽ +#define CY_NMRO UC(0x2116) // № + +// The letters Zje and Sje are made for other letters and accent marks + +#endif diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index d240dc2e6..07de3ecb8 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -1,14 +1,16 @@ #include "quantum.h" +#include "action_tapping.h" -static qk_tap_dance_state_t qk_tap_dance_state; +static uint16_t last_td; +static int8_t highest_td = -1; void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; if (state->count == 1) { - register_code (pair->kc1); + register_code16 (pair->kc1); } else if (state->count == 2) { - register_code (pair->kc2); + register_code16 (pair->kc2); } } @@ -16,102 +18,117 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; if (state->count == 1) { - unregister_code (pair->kc1); + unregister_code16 (pair->kc1); } else if (state->count == 2) { - unregister_code (pair->kc2); + unregister_code16 (pair->kc2); } } static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, - void *user_data, - qk_tap_dance_user_fn_t fn) + void *user_data, + qk_tap_dance_user_fn_t fn) { if (fn) { fn(state, user_data); } } -static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t action) +static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t *action) { - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap); + _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) +static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t *action) { - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished); + if (action->state.finished) + return; + action->state.finished = true; + _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished); } -static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t action) +static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *action) { - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_reset); + _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset); } bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { - bool r = true; uint16_t idx = keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action; + qk_tap_dance_action_t *action; + + if (last_td && last_td != keycode) { + (&tap_dance_actions[last_td - QK_TAP_DANCE])->state.interrupted = true; + } switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - action = tap_dance_actions[idx]; + if ((int16_t)idx > highest_td) + highest_td = idx; + action = &tap_dance_actions[idx]; - process_tap_dance_action_on_each_tap (action); - if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { - process_tap_dance_action_on_dance_finished (action); - } else if (qk_tap_dance_state.active && qk_tap_dance_state.pressed) { - reset_tap_dance (&qk_tap_dance_state); - } else { - r = false; - } - - qk_tap_dance_state.active = true; - qk_tap_dance_state.pressed = record->event.pressed; + action->state.keycode = keycode; + action->state.pressed = record->event.pressed; if (record->event.pressed) { - qk_tap_dance_state.keycode = keycode; - qk_tap_dance_state.timer = timer_read (); - qk_tap_dance_state.count++; + action->state.count++; + action->state.timer = timer_read(); + + if (last_td && last_td != keycode) { + qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE]; + paction->state.interrupted = true; + process_tap_dance_action_on_dance_finished (paction); + reset_tap_dance (&paction->state); + } } + last_td = keycode; + break; default: - if (qk_tap_dance_state.keycode) { - // if we are here, the tap dance was interrupted by a different key - idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; - action = tap_dance_actions[idx]; + if (!record->event.pressed) + return true; - process_tap_dance_action_on_each_tap (action); + if (highest_td == -1) + return true; + + for (int i = 0; i <= highest_td; i++) { + action = &tap_dance_actions[i]; + if (action->state.count == 0) + continue; + action->state.interrupted = true; process_tap_dance_action_on_dance_finished (action); - reset_tap_dance (&qk_tap_dance_state); - qk_tap_dance_state.active = false; + reset_tap_dance (&action->state); } break; } - return r; + return true; } void matrix_scan_tap_dance () { - if (qk_tap_dance_state.active && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { - // if we are here, the tap dance was timed out - uint16_t idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action = tap_dance_actions[idx]; + if (highest_td == -1) + return; - process_tap_dance_action_on_dance_finished (action); - reset_tap_dance (&qk_tap_dance_state); + for (int i = 0; i <= highest_td; i++) { + qk_tap_dance_action_t *action = &tap_dance_actions[i]; + + if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) { + process_tap_dance_action_on_dance_finished (action); + reset_tap_dance (&action->state); + } } } void reset_tap_dance (qk_tap_dance_state_t *state) { - uint16_t idx = state->keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action; + qk_tap_dance_action_t *action; if (state->pressed) return; - action = tap_dance_actions[idx]; + action = &tap_dance_actions[state->keycode - QK_TAP_DANCE]; + process_tap_dance_action_on_reset (action); - state->keycode = 0; state->count = 0; - state->active = false; + state->interrupted = false; + state->finished = false; + last_td = 0; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index e2c74efe9..d7b857bdc 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -11,8 +11,9 @@ typedef struct uint8_t count; uint16_t keycode; uint16_t timer; - bool active:1; - bool pressed:1; + bool interrupted; + bool pressed; + bool finished; } qk_tap_dance_state_t; #define TD(n) (QK_TAP_DANCE + n) @@ -26,6 +27,7 @@ typedef struct qk_tap_dance_user_fn_t on_dance_finished; qk_tap_dance_user_fn_t on_reset; } fn; + qk_tap_dance_state_t state; void *user_data; } qk_tap_dance_action_t; @@ -48,7 +50,7 @@ typedef struct .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ } -extern const qk_tap_dance_action_t tap_dance_actions[]; +extern qk_tap_dance_action_t tap_dance_actions[]; /* To be used internally */ diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index ad5d7f86b..06c1694f2 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -13,45 +13,196 @@ uint16_t hex_to_keycode(uint8_t hex) } } -void set_unicode_mode(uint8_t os_target) +void set_unicode_input_mode(uint8_t os_target) { input_mode = os_target; } +__attribute__((weak)) +void unicode_input_start (void) { + switch(input_mode) { + case UC_OSX: + register_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + break; + case UC_WIN: + register_code(KC_LALT); + register_code(KC_PPLS); + unregister_code(KC_PPLS); + break; + } + wait_ms(UNICODE_TYPE_DELAY); +} + +__attribute__((weak)) +void unicode_input_finish (void) { + switch(input_mode) { + case UC_OSX: + case UC_WIN: + unregister_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_SPC); + unregister_code(KC_SPC); + break; + } +} + +void register_hex(uint16_t hex) { + for(int i = 3; i >= 0; i--) { + uint8_t digit = ((hex >> (i*4)) & 0xF); + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + } +} + bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { uint16_t unicode = keycode & 0x7FFF; - switch(input_mode) { - case UC_OSX: - register_code(KC_LALT); - break; - case UC_LNX: - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_U); - unregister_code(KC_U); - break; - case UC_WIN: - register_code(KC_LALT); - register_code(KC_PPLS); - unregister_code(KC_PPLS); - break; - } - for(int i = 3; i >= 0; i--) { - uint8_t digit = ((unicode >> (i*4)) & 0xF); - register_code(hex_to_keycode(digit)); - unregister_code(hex_to_keycode(digit)); - } - switch(input_mode) { - case UC_OSX: - case UC_WIN: - unregister_code(KC_LALT); - break; - case UC_LNX: - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - } + unicode_input_start(); + register_hex(unicode); + unicode_input_finish(); } return true; -} \ No newline at end of file +} + +#ifdef UCIS_ENABLE +qk_ucis_state_t qk_ucis_state; + +void qk_ucis_start(void) { + qk_ucis_state.count = 0; + qk_ucis_state.in_progress = true; + + qk_ucis_start_user(); +} + +__attribute__((weak)) +void qk_ucis_start_user(void) { + unicode_input_start(); + register_hex(0x2328); + unicode_input_finish(); +} + +static bool is_uni_seq(char *seq) { + uint8_t i; + + for (i = 0; seq[i]; i++) { + uint16_t code; + if (('1' <= seq[i]) && (seq[i] <= '0')) + code = seq[i] - '1' + KC_1; + else + code = seq[i] - 'a' + KC_A; + + if (i > qk_ucis_state.count || qk_ucis_state.codes[i] != code) + return false; + } + + return (qk_ucis_state.codes[i] == KC_ENT || + qk_ucis_state.codes[i] == KC_SPC); +} + +__attribute__((weak)) +void qk_ucis_symbol_fallback (void) { + for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { + uint8_t code = qk_ucis_state.codes[i]; + register_code(code); + unregister_code(code); + wait_ms(UNICODE_TYPE_DELAY); + } +} + +void register_ucis(const char *hex) { + for(int i = 0; hex[i]; i++) { + uint8_t kc = 0; + char c = hex[i]; + + switch (c) { + case '0': + kc = KC_0; + break; + case '1' ... '9': + kc = c - '1' + KC_1; + break; + case 'a' ... 'f': + kc = c - 'a' + KC_A; + break; + case 'A' ... 'F': + kc = c - 'A' + KC_A; + break; + } + + if (kc) { + register_code (kc); + unregister_code (kc); + wait_ms (UNICODE_TYPE_DELAY); + } + } +} + +bool process_ucis (uint16_t keycode, keyrecord_t *record) { + uint8_t i; + + if (!qk_ucis_state.in_progress) + return true; + + if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && + !(keycode == KC_BSPC || keycode == KC_ESC || keycode == KC_SPC || keycode == KC_ENT)) { + return false; + } + + if (!record->event.pressed) + return true; + + qk_ucis_state.codes[qk_ucis_state.count] = keycode; + qk_ucis_state.count++; + + if (keycode == KC_BSPC) { + if (qk_ucis_state.count >= 2) { + qk_ucis_state.count -= 2; + return true; + } else { + qk_ucis_state.count--; + return false; + } + } + + if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) { + bool symbol_found = false; + + for (i = qk_ucis_state.count; i > 0; i--) { + register_code (KC_BSPC); + unregister_code (KC_BSPC); + wait_ms(UNICODE_TYPE_DELAY); + } + + if (keycode == KC_ESC) { + qk_ucis_state.in_progress = false; + return false; + } + + unicode_input_start(); + for (i = 0; ucis_symbol_table[i].symbol; i++) { + if (is_uni_seq (ucis_symbol_table[i].symbol)) { + symbol_found = true; + register_ucis(ucis_symbol_table[i].code + 2); + break; + } + } + if (!symbol_found) { + qk_ucis_symbol_fallback(); + } + unicode_input_finish(); + + qk_ucis_state.in_progress = false; + return false; + } + return true; +} +#endif diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index ca17f8f66..02ce3dd7e 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -8,10 +8,48 @@ #define UC_WIN 2 #define UC_BSD 3 +#ifndef UNICODE_TYPE_DELAY +#define UNICODE_TYPE_DELAY 10 +#endif + void set_unicode_input_mode(uint8_t os_target); +void unicode_input_start(void); +void unicode_input_finish(void); +void register_hex(uint16_t hex); bool process_unicode(uint16_t keycode, keyrecord_t *record); +#ifdef UCIS_ENABLE +#ifndef UCIS_MAX_SYMBOL_LENGTH +#define UCIS_MAX_SYMBOL_LENGTH 32 +#endif + +typedef struct { + char *symbol; + char *code; +} qk_ucis_symbol_t; + +typedef struct { + uint8_t count; + uint16_t codes[UCIS_MAX_SYMBOL_LENGTH]; + bool in_progress:1; +} qk_ucis_state_t; + +extern qk_ucis_state_t qk_ucis_state; + +#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}} +#define UCIS_SYM(name, code) {name, #code} + +extern const qk_ucis_symbol_t ucis_symbol_table[]; + +void qk_ucis_start(void); +void qk_ucis_start_user(void); +void qk_ucis_symbol_fallback (void); +void register_ucis(const char *hex); +bool process_ucis (uint16_t keycode, keyrecord_t *record); + +#endif + #define UC_BSPC UC(0x0008) #define UC_SPC UC(0x0020) @@ -119,4 +157,4 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record); #define UC_TILD UC(0x007E) #define UC_DEL UC(0x007F) -#endif \ No newline at end of file +#endif diff --git a/quantum/quantum.c b/quantum/quantum.c index bc2da510f..e3a20f43e 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -1,5 +1,42 @@ #include "quantum.h" +static void do_code16 (uint16_t code, void (*f) (uint8_t)) { + switch (code) { + case QK_MODS ... QK_MODS_MAX: + break; + default: + return; + } + + if (code & QK_LCTL) + f(KC_LCTL); + if (code & QK_LSFT) + f(KC_LSFT); + if (code & QK_LALT) + f(KC_LALT); + if (code & QK_LGUI) + f(KC_LGUI); + + if (code & QK_RCTL) + f(KC_RCTL); + if (code & QK_RSFT) + f(KC_RSFT); + if (code & QK_RALT) + f(KC_RALT); + if (code & QK_RGUI) + f(KC_RGUI); +} + +void register_code16 (uint16_t code) { + do_code16 (code, register_code); + register_code (code); +} + +void unregister_code16 (uint16_t code) { + unregister_code (code); + do_code16 (code, unregister_code); +} + __attribute__ ((weak)) bool process_action_kb(keyrecord_t *record) { return true; @@ -46,18 +83,20 @@ bool process_record_quantum(keyrecord_t *record) { uint16_t keycode; #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) - uint8_t layer; + /* TODO: Use store_or_get_action() or a similar function. */ + if (!disable_action_cache) { + uint8_t layer; - if (record->event.pressed) { - layer = layer_switch_get_layer(key); - update_source_layers_cache(key, layer); - } else { - layer = read_source_layers_cache(key); - } - keycode = keymap_key_to_keycode(layer, key); - #else - keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key); + if (record->event.pressed) { + layer = layer_switch_get_layer(key); + update_source_layers_cache(key, layer); + } else { + layer = read_source_layers_cache(key); + } + keycode = keymap_key_to_keycode(layer, key); + } else #endif + keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key); // This is how you use actions here // if (keycode == KC_LEAD) { @@ -86,6 +125,9 @@ bool process_record_quantum(keyrecord_t *record) { #endif #ifdef UNICODE_ENABLE process_unicode(keycode, record) && + #endif + #ifdef UCIS_ENABLE + process_ucis(keycode, record) && #endif true)) { return false; diff --git a/quantum/quantum.h b/quantum/quantum.h index 7ebfb24e3..0c6046649 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -25,6 +25,7 @@ #include "led.h" #include "action_util.h" #include +#include "print.h" extern uint32_t default_layer_state; @@ -82,6 +83,9 @@ void reset_keyboard(void); void startup_user(void); void shutdown_user(void); +void register_code16 (uint16_t code); +void unregister_code16 (uint16_t code); + #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); diff --git a/quantum/rgblight.c b/quantum/rgblight.c index b1b0f035d..f82e3ec55 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -7,24 +7,41 @@ #include "debug.h" const uint8_t DIM_CURVE[] PROGMEM = { - 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, - 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, - 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, - 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, - 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, - 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, - 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, - 83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109, - 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144, - 146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190, - 193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255, + 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, + 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, + 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, + 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, + 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, + 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, + 83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109, + 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144, + 146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190, + 193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255 +}; +const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = { + 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9, + 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35, + 37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76, + 79, 82, 85, 88, 90, 93, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, + 127, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 162, 165, 167, 170, 173, + 176, 179, 182, 185, 188, 190, 193, 196, 198, 201, 203, 206, 208, 211, 213, 215, + 218, 220, 222, 224, 226, 228, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244, + 245, 246, 248, 249, 250, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255, + 255, 255, 255, 255, 254, 254, 254, 253, 253, 252, 251, 250, 250, 249, 248, 246, + 245, 244, 243, 241, 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, 222, 220, + 218, 215, 213, 211, 208, 206, 203, 201, 198, 196, 193, 190, 188, 185, 182, 179, + 176, 173, 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, 140, 137, 134, 131, + 128, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, 93, 90, 88, 85, 82, + 79, 76, 73, 70, 67, 65, 62, 59, 57, 54, 52, 49, 47, 44, 42, 40, + 37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, 12, 11, + 10, 9, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0 }; -const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = {0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,9,10,11,12,14,15,17,18,20,21,23,25,27,29,31,33,35,37,40,42,44,47,49,52,54,57,59,62,65,67,70,73,76,79,82,85,88,90,93,97,100,103,106,109,112,115,118,121,124,127,131,134,137,140,143,146,149,152,155,158,162,165,167,170,173,176,179,182,185,188,190,193,196,198,201,203,206,208,211,213,215,218,220,222,224,226,228,230,232,234,235,237,238,240,241,243,244,245,246,248,249,250,250,251,252,253,253,254,254,254,255,255,255,255,255,255,255,254,254,254,253,253,252,251,250,250,249,248,246,245,244,243,241,240,238,237,235,234,232,230,228,226,224,222,220,218,215,213,211,208,206,203,201,198,196,193,190,188,185,182,179,176,173,170,167,165,162,158,155,152,149,146,143,140,137,134,131,128,124,121,118,115,112,109,106,103,100,97,93,90,88,85,82,79,76,73,70,67,65,62,59,57,54,52,49,47,44,42,40,37,35,33,31,29,27,25,23,21,20,18,17,15,14,12,11,10,9,7,6,5,5,4,3,2,2,1,1,1,0,0,0}; const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; @@ -38,63 +55,56 @@ uint8_t rgblight_inited = 0; void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { - /* convert hue, saturation and brightness ( HSB/HSV ) to RGB - The DIM_CURVE is used only on brightness/value and on saturation (inverted). - This looks the most natural. - */ - uint8_t r = 0, g = 0, b = 0; + // Convert hue, saturation, and value (HSV/HSB) to RGB. DIM_CURVE is used only + // on value and saturation (inverted). This looks the most natural. + uint8_t r = 0, g = 0, b = 0, base, color; val = pgm_read_byte(&DIM_CURVE[val]); - sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); + sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); - uint8_t base; + if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. + r = val; + g = val; + b = val; + } else { + base = ((255 - sat) * val) >> 8; + color = (val - base) * (hue % 60) / 60; - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. - r = val; - g = val; - b = val; - } else { - base = ((255 - sat) * val) >> 8; + switch (hue / 60) { + case 0: + r = val; + g = base + color; + b = base; + break; + case 1: + r = val - color; + g = val; + b = base; + break; + case 2: + r = base; + g = val; + b = base + color; + break; + case 3: + r = base; + g = val - color; + b = val; + break; + case 4: + r = base + color; + g = base; + b = val; + break; + case 5: + r = val; + g = base; + b = val - color; + break; + } + } - switch (hue / 60) { - case 0: - r = val; - g = (((val - base)*hue) / 60) + base; - b = base; - break; - - case 1: - r = (((val - base)*(60 - (hue % 60))) / 60) + base; - g = val; - b = base; - break; - - case 2: - r = base; - g = val; - b = (((val - base)*(hue % 60)) / 60) + base; - break; - - case 3: - r = base; - g = (((val - base)*(60 - (hue % 60))) / 60) + base; - b = val; - break; - - case 4: - r = (((val - base)*(hue % 60)) / 60) + base; - g = base; - b = val; - break; - - case 5: - r = val; - g = base; - b = (((val - base)*(60 - (hue % 60))) / 60) + base; - break; - } - } - setrgb(r,g,b, led1); + setrgb(r, g, b, led1); } void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1) { @@ -111,44 +121,44 @@ void eeconfig_update_rgblight(uint32_t val) { eeprom_update_dword(EECONFIG_RGBLIGHT, val); } void eeconfig_update_rgblight_default(void) { - dprintf("eeconfig_update_rgblight_default\n"); - rgblight_config.enable = 1; - rgblight_config.mode = 1; - rgblight_config.hue = 200; - rgblight_config.sat = 204; - rgblight_config.val = 204; - eeconfig_update_rgblight(rgblight_config.raw); + dprintf("eeconfig_update_rgblight_default\n"); + rgblight_config.enable = 1; + rgblight_config.mode = 1; + rgblight_config.hue = 200; + rgblight_config.sat = 204; + rgblight_config.val = 204; + eeconfig_update_rgblight(rgblight_config.raw); } void eeconfig_debug_rgblight(void) { - dprintf("rgblight_config eprom\n"); - dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); - dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); - dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); - dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); - dprintf("rgblight_config.val = %d\n", rgblight_config.val); + dprintf("rgblight_config eprom\n"); + dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); + dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); + dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); + dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); + dprintf("rgblight_config.val = %d\n", rgblight_config.val); } void rgblight_init(void) { debug_enable = 1; // Debug ON! - dprintf("rgblight_init called.\n"); + dprintf("rgblight_init called.\n"); rgblight_inited = 1; - dprintf("rgblight_init start!\n"); + dprintf("rgblight_init start!\n"); if (!eeconfig_is_enabled()) { - dprintf("rgblight_init eeconfig is not enabled.\n"); + dprintf("rgblight_init eeconfig is not enabled.\n"); eeconfig_init(); - eeconfig_update_rgblight_default(); + eeconfig_update_rgblight_default(); } rgblight_config.raw = eeconfig_read_rgblight(); - if (!rgblight_config.mode) { - dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); - eeconfig_update_rgblight_default(); - rgblight_config.raw = eeconfig_read_rgblight(); - } - eeconfig_debug_rgblight(); // display current eeprom values + if (!rgblight_config.mode) { + dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); + eeconfig_update_rgblight_default(); + rgblight_config.raw = eeconfig_read_rgblight(); + } + eeconfig_debug_rgblight(); // display current eeprom values - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_init(); // setup the timer - #endif + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_init(); // setup the timer + #endif if (rgblight_config.enable) { rgblight_mode(rgblight_config.mode); @@ -156,58 +166,57 @@ void rgblight_init(void) { } void rgblight_increase(void) { - uint8_t mode = 0; + uint8_t mode = 0; if (rgblight_config.mode < RGBLIGHT_MODES) { mode = rgblight_config.mode + 1; } - rgblight_mode(mode); + rgblight_mode(mode); } - void rgblight_decrease(void) { - uint8_t mode = 0; - if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized. - mode = rgblight_config.mode-1; + uint8_t mode = 0; + // Mode will never be < 1. If it ever is, eeprom needs to be initialized. + if (rgblight_config.mode > 1) { + mode = rgblight_config.mode - 1; } - rgblight_mode(mode); + rgblight_mode(mode); } - void rgblight_step(void) { - uint8_t mode = 0; + uint8_t mode = 0; mode = rgblight_config.mode + 1; if (mode > RGBLIGHT_MODES) { mode = 1; } - rgblight_mode(mode); + rgblight_mode(mode); } void rgblight_mode(uint8_t mode) { - if (!rgblight_config.enable) { - return; - } - if (mode<1) { - rgblight_config.mode = 1; - } else if (mode > RGBLIGHT_MODES) { - rgblight_config.mode = RGBLIGHT_MODES; - } else { - rgblight_config.mode = mode; - } + if (!rgblight_config.enable) { + return; + } + if (mode < 1) { + rgblight_config.mode = 1; + } else if (mode > RGBLIGHT_MODES) { + rgblight_config.mode = RGBLIGHT_MODES; + } else { + rgblight_config.mode = mode; + } eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight mode: %u\n", rgblight_config.mode); - if (rgblight_config.mode == 1) { - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_disable(); - #endif - } else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) { - // MODE 2-5, breathing - // MODE 6-8, rainbow mood - // MODE 9-14, rainbow swirl - // MODE 15-20, snake - // MODE 21-23, knight + if (rgblight_config.mode == 1) { + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_disable(); + #endif + } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { + // MODE 2-5, breathing + // MODE 6-8, rainbow mood + // MODE 9-14, rainbow swirl + // MODE 15-20, snake + // MODE 21-23, knight - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_enable(); - #endif - } + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_enable(); + #endif + } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } @@ -215,306 +224,318 @@ void rgblight_toggle(void) { rgblight_config.enable ^= 1; eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable); - if (rgblight_config.enable) { - rgblight_mode(rgblight_config.mode); - } else { - - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_disable(); - #endif - _delay_ms(50); - rgblight_set(); - } + if (rgblight_config.enable) { + rgblight_mode(rgblight_config.mode); + } else { + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_disable(); + #endif + _delay_ms(50); + rgblight_set(); + } } -void rgblight_increase_hue(void){ - uint16_t hue; +void rgblight_increase_hue(void) { + uint16_t hue; hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); } -void rgblight_decrease_hue(void){ - uint16_t hue; - if (rgblight_config.hue-RGBLIGHT_HUE_STEP <0 ) { - hue = (rgblight_config.hue+360-RGBLIGHT_HUE_STEP) % 360; - } else { - hue = (rgblight_config.hue-RGBLIGHT_HUE_STEP) % 360; - } +void rgblight_decrease_hue(void) { + uint16_t hue; + if (rgblight_config.hue-RGBLIGHT_HUE_STEP < 0) { + hue = (rgblight_config.hue + 360 - RGBLIGHT_HUE_STEP) % 360; + } else { + hue = (rgblight_config.hue - RGBLIGHT_HUE_STEP) % 360; + } rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); } void rgblight_increase_sat(void) { - uint8_t sat; + uint8_t sat; if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { sat = 255; } else { - sat = rgblight_config.sat+RGBLIGHT_SAT_STEP; + sat = rgblight_config.sat + RGBLIGHT_SAT_STEP; } rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); } -void rgblight_decrease_sat(void){ - uint8_t sat; +void rgblight_decrease_sat(void) { + uint8_t sat; if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { sat = 0; } else { - sat = rgblight_config.sat-RGBLIGHT_SAT_STEP; + sat = rgblight_config.sat - RGBLIGHT_SAT_STEP; } rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); } -void rgblight_increase_val(void){ - uint8_t val; +void rgblight_increase_val(void) { + uint8_t val; if (rgblight_config.val + RGBLIGHT_VAL_STEP > 255) { val = 255; } else { - val = rgblight_config.val+RGBLIGHT_VAL_STEP; + val = rgblight_config.val + RGBLIGHT_VAL_STEP; } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); } void rgblight_decrease_val(void) { - uint8_t val; + uint8_t val; if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { val = 0; } else { - val = rgblight_config.val-RGBLIGHT_VAL_STEP; + val = rgblight_config.val - RGBLIGHT_VAL_STEP; } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); } -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val){ - inmem_config.raw = rgblight_config.raw; +void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { + inmem_config.raw = rgblight_config.raw; if (rgblight_config.enable) { struct cRGB tmp_led; sethsv(hue, sat, val, &tmp_led); - inmem_config.hue = hue; - inmem_config.sat = sat; - inmem_config.val = val; + inmem_config.hue = hue; + inmem_config.sat = sat; + inmem_config.val = val; // dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val); rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } } -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val){ +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { if (rgblight_config.enable) { - if (rgblight_config.mode == 1) { - // same static color - rgblight_sethsv_noeeprom(hue, sat, val); - } else { - // all LEDs in same color - if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { - // breathing mode, ignore the change of val, use in memory value instead - val = rgblight_config.val; - } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { - // rainbow mood and rainbow swirl, ignore the change of hue - hue = rgblight_config.hue; - } - } - rgblight_config.hue = hue; - rgblight_config.sat = sat; - rgblight_config.val = val; - eeconfig_update_rgblight(rgblight_config.raw); - xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + if (rgblight_config.mode == 1) { + // same static color + rgblight_sethsv_noeeprom(hue, sat, val); + } else { + // all LEDs in same color + if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + // breathing mode, ignore the change of val, use in memory value instead + val = rgblight_config.val; + } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { + // rainbow mood and rainbow swirl, ignore the change of hue + hue = rgblight_config.hue; + } + } + rgblight_config.hue = hue; + rgblight_config.sat = sat; + rgblight_config.val = val; + eeconfig_update_rgblight(rgblight_config.raw); + xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } } -void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b){ +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { // dprintf("rgblight set rgb: %u,%u,%u\n", r,g,b); - for (uint8_t i=0;i>8)&0xff; - OCR3AL = RGBLED_TIMER_TOP&0xff; - SREG = sreg; + static uint8_t rgblight_timer_is_init = 0; + if (rgblight_timer_is_init) { + return; + } + rgblight_timer_is_init = 1; + /* Timer 3 setup */ + TCCR3B = _BV(WGM32) //CTC mode OCR3A as TOP + | _BV(CS30); //Clock selelct: clk/1 + /* Set TOP value */ + uint8_t sreg = SREG; + cli(); + OCR3AH = (RGBLED_TIMER_TOP >> 8) & 0xff; + OCR3AL = RGBLED_TIMER_TOP & 0xff; + SREG = sreg; } void rgblight_timer_enable(void) { - TIMSK3 |= _BV(OCIE3A); - dprintf("TIMER3 enabled.\n"); + TIMSK3 |= _BV(OCIE3A); + dprintf("TIMER3 enabled.\n"); } void rgblight_timer_disable(void) { - TIMSK3 &= ~_BV(OCIE3A); - dprintf("TIMER3 disabled.\n"); + TIMSK3 &= ~_BV(OCIE3A); + dprintf("TIMER3 disabled.\n"); } void rgblight_timer_toggle(void) { - TIMSK3 ^= _BV(OCIE3A); - dprintf("TIMER3 toggled.\n"); + TIMSK3 ^= _BV(OCIE3A); + dprintf("TIMER3 toggled.\n"); } ISR(TIMER3_COMPA_vect) { - // Mode = 1, static light, do nothing here - if (rgblight_config.mode>=2 && rgblight_config.mode<=5) { - // mode = 2 to 5, breathing mode - rgblight_effect_breathing(rgblight_config.mode-2); - - } else if (rgblight_config.mode>=6 && rgblight_config.mode<=8) { - rgblight_effect_rainbow_mood(rgblight_config.mode-6); - } else if (rgblight_config.mode>=9 && rgblight_config.mode<=14) { - rgblight_effect_rainbow_swirl(rgblight_config.mode-9); - } else if (rgblight_config.mode>=15 && rgblight_config.mode<=20) { - rgblight_effect_snake(rgblight_config.mode-15); - } else if (rgblight_config.mode>=21 && rgblight_config.mode<=23) { - rgblight_effect_knight(rgblight_config.mode-21); - } + // mode = 1, static light, do nothing here + if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + // mode = 2 to 5, breathing mode + rgblight_effect_breathing(rgblight_config.mode - 2); + } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) { + // mode = 6 to 8, rainbow mood mod + rgblight_effect_rainbow_mood(rgblight_config.mode - 6); + } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) { + // mode = 9 to 14, rainbow swirl mode + rgblight_effect_rainbow_swirl(rgblight_config.mode - 9); + } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) { + // mode = 15 to 20, snake mode + rgblight_effect_snake(rgblight_config.mode - 15); + } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { + // mode = 21 to 23, knight mode + rgblight_effect_knight(rgblight_config.mode - 21); + } } -// effects +// Effects void rgblight_effect_breathing(uint8_t interval) { - static uint8_t pos = 0; - static uint16_t last_timer = 0; + static uint8_t pos = 0; + static uint16_t last_timer = 0; - if (timer_elapsed(last_timer)=RGBLED_NUM) k=RGBLED_NUM-1; - if (i==k) { - sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); - } - } - } - if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) { - for (i=0;iRGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH) { - pos = RGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH-1; - increament = 1; - } else { - pos += 1; - } - } - + static int8_t pos = 0; + static uint16_t last_timer = 0; + uint8_t i, j, cur; + int8_t k; + struct cRGB preled[RGBLED_NUM]; + static int8_t increment = -1; + if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { + return; + } + last_timer = timer_read(); + for (i = 0; i < RGBLED_NUM; i++) { + preled[i].r = 0; + preled[i].g = 0; + preled[i].b = 0; + for (j = 0; j < RGBLIGHT_EFFECT_KNIGHT_LENGTH; j++) { + k = pos + j * increment; + if (k < 0) { + k = 0; + } + if (k >= RGBLED_NUM) { + k = RGBLED_NUM - 1; + } + if (i == k) { + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); + } + } + } + if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) { + for (i = 0; i < RGBLED_NUM; i++) { + cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM; + led[i].r = preled[cur].r; + led[i].g = preled[cur].g; + led[i].b = preled[cur].b; + } + } + rgblight_set(); + if (increment == 1) { + if (pos - 1 < 0 - RGBLIGHT_EFFECT_KNIGHT_LENGTH) { + pos = 0 - RGBLIGHT_EFFECT_KNIGHT_LENGTH; + increment = -1; + } else { + pos -= 1; + } + } else { + if (pos + 1 > RGBLED_NUM + RGBLIGHT_EFFECT_KNIGHT_LENGTH) { + pos = RGBLED_NUM + RGBLIGHT_EFFECT_KNIGHT_LENGTH - 1; + increment = 1; + } else { + pos += 1; + } + } } -#endif \ No newline at end of file +#endif diff --git a/quantum/serial_link/protocol/byte_stuffer.c b/quantum/serial_link/protocol/byte_stuffer.c index fb4c45a8d..2c87d64c2 100644 --- a/quantum/serial_link/protocol/byte_stuffer.c +++ b/quantum/serial_link/protocol/byte_stuffer.c @@ -31,9 +31,6 @@ SOFTWARE. // https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing // http://www.stuartcheshire.org/papers/COBSforToN.pdf -#define MAX_FRAME_SIZE 1024 -#define NUM_LINKS 2 - typedef struct byte_stuffer_state { uint16_t next_zero; uint16_t data_pos; diff --git a/quantum/serial_link/protocol/byte_stuffer.h b/quantum/serial_link/protocol/byte_stuffer.h index 2cc88beb4..97e896856 100644 --- a/quantum/serial_link/protocol/byte_stuffer.h +++ b/quantum/serial_link/protocol/byte_stuffer.h @@ -27,6 +27,9 @@ SOFTWARE. #include +#define MAX_FRAME_SIZE 1024 +#define NUM_LINKS 2 + void init_byte_stuffer(void); void byte_stuffer_recv_byte(uint8_t link, uint8_t data); void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size); diff --git a/quantum/serial_link/protocol/transport.c b/quantum/serial_link/protocol/transport.c index f418d11ce..ff795fe20 100644 --- a/quantum/serial_link/protocol/transport.c +++ b/quantum/serial_link/protocol/transport.c @@ -31,6 +31,10 @@ SOFTWARE. static remote_object_t* remote_objects[MAX_REMOTE_OBJECTS]; static uint32_t num_remote_objects = 0; +void reinitialize_serial_link_transport(void) { + num_remote_objects = 0; +} + void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { unsigned int i; for(i=0;i<_num_remote_objects;i++) { diff --git a/quantum/serial_link/protocol/transport.h b/quantum/serial_link/protocol/transport.h index 9a052d880..2c5d890b2 100644 --- a/quantum/serial_link/protocol/transport.h +++ b/quantum/serial_link/protocol/transport.h @@ -82,7 +82,7 @@ typedef struct { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ + return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ @@ -112,7 +112,7 @@ typedef struct { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ + return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } #define SLAVE_TO_MASTER_OBJECT(name, type) \ @@ -139,12 +139,13 @@ typedef struct { \ uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ + return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); +void reinitialize_serial_link_transport(void); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); void update_transport(void); diff --git a/quantum/serial_link/tests/byte_stuffer_tests.c b/quantum/serial_link/tests/byte_stuffer_tests.cpp similarity index 52% rename from quantum/serial_link/tests/byte_stuffer_tests.c rename to quantum/serial_link/tests/byte_stuffer_tests.cpp index 64b170e8c..ff49d727b 100644 --- a/quantum/serial_link/tests/byte_stuffer_tests.c +++ b/quantum/serial_link/tests/byte_stuffer_tests.cpp @@ -22,70 +22,90 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include -#include +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include +#include +extern "C" { #include "serial_link/protocol/byte_stuffer.h" -#include "serial_link/protocol/byte_stuffer.c" #include "serial_link/protocol/frame_validator.h" #include "serial_link/protocol/physical.h" - -static uint8_t sent_data[MAX_FRAME_SIZE*2]; -static uint16_t sent_data_size; - -Describe(ByteStuffer); -BeforeEach(ByteStuffer) { - init_byte_stuffer(); - sent_data_size = 0; -} -AfterEach(ByteStuffer) {} - -void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { - mock(data, size); } -void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - memcpy(sent_data + sent_data_size, data, size); - sent_data_size += size; +using testing::_; +using testing::ElementsAreArray; +using testing::Args; + +class ByteStuffer : public ::testing::Test{ +public: + ByteStuffer() { + Instance = this; + init_byte_stuffer(); + } + + ~ByteStuffer() { + Instance = nullptr; + } + + MOCK_METHOD3(validator_recv_frame, void (uint8_t link, uint8_t* data, uint16_t size)); + + void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + std::copy(data, data + size, std::back_inserter(sent_data)); + } + std::vector sent_data; + + static ByteStuffer* Instance; +}; + +ByteStuffer* ByteStuffer::Instance = nullptr; + +extern "C" { + void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { + ByteStuffer::Instance->validator_recv_frame(link, data, size); + } + + void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + ByteStuffer::Instance->send_data(link, data, size); + } } -Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { - never_expect(validator_recv_frame); +TEST_F(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .Times(0); byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { - never_expect(validator_recv_frame); +TEST_F(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .Times(0); byte_stuffer_recv_byte(0, 0xFF); } -Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { - never_expect(validator_recv_frame); +TEST_F(ByteStuffer, receives_no_frame_for_a_single_random_byte) { + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .Times(0); byte_stuffer_recv_byte(0, 0x4A); } -Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { - never_expect(validator_recv_frame); +TEST_F(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .Times(0); byte_stuffer_recv_byte(0, 1); byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_single_byte_valid_frame) { +TEST_F(ByteStuffer, receives_single_byte_valid_frame) { uint8_t expected[] = {0x37}; - expect(validator_recv_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(expected, 1)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 2); byte_stuffer_recv_byte(0, 0x37); byte_stuffer_recv_byte(0, 0); } - -Ensure(ByteStuffer, receives_three_bytes_valid_frame) { +TEST_F(ByteStuffer, receives_three_bytes_valid_frame) { uint8_t expected[] = {0x37, 0x99, 0xFF}; - expect(validator_recv_frame, - when(size, is_equal_to(3)), - when(data, is_equal_to_contents_of(expected, 3)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 4); byte_stuffer_recv_byte(0, 0x37); byte_stuffer_recv_byte(0, 0x99); @@ -93,23 +113,19 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_single_zero_valid_frame) { +TEST_F(ByteStuffer, receives_single_zero_valid_frame) { uint8_t expected[] = {0}; - expect(validator_recv_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(expected, 1)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 1); byte_stuffer_recv_byte(0, 1); byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { +TEST_F(ByteStuffer, receives_valid_frame_with_zeroes) { uint8_t expected[] = {5, 0, 3, 0}; - expect(validator_recv_frame, - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(expected, 4)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 2); byte_stuffer_recv_byte(0, 5); byte_stuffer_recv_byte(0, 2); @@ -118,17 +134,14 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_two_valid_frames) { + +TEST_F(ByteStuffer, receives_two_valid_frames) { uint8_t expected1[] = {5, 0}; uint8_t expected2[] = {3}; - expect(validator_recv_frame, - when(size, is_equal_to(2)), - when(data, is_equal_to_contents_of(expected1, 2)) - ); - expect(validator_recv_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(expected2, 1)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected1))); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected2))); byte_stuffer_recv_byte(1, 2); byte_stuffer_recv_byte(1, 5); byte_stuffer_recv_byte(1, 1); @@ -138,12 +151,10 @@ Ensure(ByteStuffer, receives_two_valid_frames) { byte_stuffer_recv_byte(1, 0); } -Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { +TEST_F(ByteStuffer, receives_valid_frame_after_unexpected_zero) { uint8_t expected[] = {5, 7}; - expect(validator_recv_frame, - when(size, is_equal_to(2)), - when(data, is_equal_to_contents_of(expected, 2)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(1, 3); byte_stuffer_recv_byte(1, 1); byte_stuffer_recv_byte(1, 0); @@ -153,12 +164,10 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { byte_stuffer_recv_byte(1, 0); } -Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { +TEST_F(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { uint8_t expected[] = {5, 7}; - expect(validator_recv_frame, - when(size, is_equal_to(2)), - when(data, is_equal_to_contents_of(expected, 2)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 2); byte_stuffer_recv_byte(0, 9); byte_stuffer_recv_byte(0, 4); // This should have been zero @@ -169,16 +178,14 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { +TEST_F(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { uint8_t expected[254]; int i; for (i=0;i<254;i++) { expected[i] = i + 1; } - expect(validator_recv_frame, - when(size, is_equal_to(254)), - when(data, is_equal_to_contents_of(expected, 254)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { byte_stuffer_recv_byte(0, i+1); @@ -186,17 +193,15 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_ byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { +TEST_F(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { uint8_t expected[255]; int i; for (i=0;i<254;i++) { expected[i] = i + 1; } expected[254] = 7; - expect(validator_recv_frame, - when(size, is_equal_to(255)), - when(data, is_equal_to_contents_of(expected, 255)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { byte_stuffer_recv_byte(0, i+1); @@ -206,17 +211,15 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { +TEST_F(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { uint8_t expected[255]; int i; for (i=0;i<254;i++) { expected[i] = i + 1; } expected[254] = 0; - expect(validator_recv_frame, - when(size, is_equal_to(255)), - when(data, is_equal_to_contents_of(expected, 255)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { byte_stuffer_recv_byte(0, i+1); @@ -226,7 +229,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { +TEST_F(ByteStuffer, receives_two_long_frames_and_some_more) { uint8_t expected[515]; int i; int j; @@ -238,10 +241,8 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { for (i=0;i<7;i++) { expected[254*2+i] = i + 1; } - expect(validator_recv_frame, - when(size, is_equal_to(515)), - when(data, is_equal_to_contents_of(expected, 510)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { byte_stuffer_recv_byte(0, i+1); @@ -261,12 +262,10 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { byte_stuffer_recv_byte(0, 0); } -Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { +TEST_F(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { uint8_t expected[MAX_FRAME_SIZE] = {}; - expect(validator_recv_frame, - when(size, is_equal_to(MAX_FRAME_SIZE)), - when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) - ); + EXPECT_CALL(*this, validator_recv_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); int i; byte_stuffer_recv_byte(0, 1); for(i=0;i(ElementsAreArray(expected))); int i; byte_stuffer_recv_byte(0, 1); for(i=0;i(ElementsAreArray(original_data))); int i; - for(i=0;i(ElementsAreArray(original_data))); int i; - for(i=0;i(ElementsAreArray(original_data))); + for(auto& d : sent_data) { + byte_stuffer_recv_byte(1, d); } } -Ensure(ByteStuffer, sends_and_receives_full_roundtrip_256_bytes) { +TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_256_bytes) { uint8_t original_data[256]; int i; for(i=0;i<254;i++) { @@ -479,16 +460,14 @@ Ensure(ByteStuffer, sends_and_receives_full_roundtrip_256_bytes) { original_data[254] = 22; original_data[255] = 23; byte_stuffer_send_frame(0, original_data, sizeof(original_data)); - expect(validator_recv_frame, - when(size, is_equal_to(sizeof(original_data))), - when(data, is_equal_to_contents_of(original_data, sizeof(original_data))) - ); - for(i=0;i(ElementsAreArray(original_data))); + for(auto& d : sent_data) { + byte_stuffer_recv_byte(1, d); } } -Ensure(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes_and_then_zero) { +TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes_and_then_zero) { uint8_t original_data[255]; int i; for(i=0;i<254;i++) { @@ -496,11 +475,9 @@ Ensure(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes_and_then_zero) { } original_data[254] = 0; byte_stuffer_send_frame(0, original_data, sizeof(original_data)); - expect(validator_recv_frame, - when(size, is_equal_to(sizeof(original_data))), - when(data, is_equal_to_contents_of(original_data, sizeof(original_data))) - ); - for(i=0;i(ElementsAreArray(original_data))); + for(auto& d : sent_data) { + byte_stuffer_recv_byte(1, d); } } diff --git a/quantum/serial_link/tests/frame_router_tests.c b/quantum/serial_link/tests/frame_router_tests.c deleted file mode 100644 index 6c806fa93..000000000 --- a/quantum/serial_link/tests/frame_router_tests.c +++ /dev/null @@ -1,231 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include -#include "serial_link/protocol/byte_stuffer.c" -#include "serial_link/protocol/frame_validator.c" -#include "serial_link/protocol/frame_router.c" -#include "serial_link/protocol/transport.h" - -static uint8_t received_data[256]; -static uint16_t received_data_size; - -typedef struct { - uint8_t sent_data[256]; - uint16_t sent_data_size; -} receive_buffer_t; - -typedef struct { - receive_buffer_t send_buffers[2]; -} router_buffer_t; - -router_buffer_t router_buffers[8]; - -router_buffer_t* current_router_buffer; - - -Describe(FrameRouter); -BeforeEach(FrameRouter) { - init_byte_stuffer(); - memset(router_buffers, 0, sizeof(router_buffers)); - current_router_buffer = 0; -} -AfterEach(FrameRouter) {} - -typedef struct { - uint32_t data; - uint8_t extra[16]; -} frame_buffer_t; - - -void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - receive_buffer_t* buffer = ¤t_router_buffer->send_buffers[link]; - memcpy(buffer->sent_data + buffer->sent_data_size, data, size); - buffer->sent_data_size += size; -} - -static void receive_data(uint8_t link, uint8_t* data, uint16_t size) { - int i; - for(i=0;i to) { - receive_data(DOWN_LINK, - router_buffers[from].send_buffers[UP_LINK].sent_data, - router_buffers[from].send_buffers[UP_LINK].sent_data_size); - } - else if(to > from) { - receive_data(UP_LINK, - router_buffers[from].send_buffers[DOWN_LINK].sent_data, - router_buffers[from].send_buffers[DOWN_LINK].sent_data_size); - } -} - -void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { - mock(from, data, size); -} - - -Ensure(FrameRouter, master_broadcast_is_received_by_everyone) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(0); - router_send_frame(0xFF, (uint8_t*)&data, 4); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(0, 1); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 2); - assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, master_send_is_received_by_targets) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(0); - router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - simulate_transport(0, 1); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 2); - assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(2, 3); - assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, first_link_sends_to_master) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(1); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(1)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 0); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, second_link_sends_to_master) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(2); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - simulate_transport(2, 1); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(2)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 0); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, master_sends_to_master_does_nothing) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(0); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, link_sends_to_other_link_does_nothing) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(1); - router_send_frame(2, (uint8_t*)&data, 4); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, master_receives_on_uplink_does_nothing) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(1); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - never_expect(transport_recv_frame); - activate_router(0); - receive_data(UP_LINK, - router_buffers[1].send_buffers[UP_LINK].sent_data, - router_buffers[1].send_buffers[UP_LINK].sent_data_size); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); -} diff --git a/quantum/serial_link/tests/frame_router_tests.cpp b/quantum/serial_link/tests/frame_router_tests.cpp new file mode 100644 index 000000000..2bd5bf830 --- /dev/null +++ b/quantum/serial_link/tests/frame_router_tests.cpp @@ -0,0 +1,229 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include +extern "C" { + #include "serial_link/protocol/transport.h" + #include "serial_link/protocol/byte_stuffer.h" + #include "serial_link/protocol/frame_router.h" +} + +using testing::_; +using testing::ElementsAreArray; +using testing::Args; + +class FrameRouter : public testing::Test { +public: + FrameRouter() : + current_router_buffer(nullptr) + { + Instance = this; + init_byte_stuffer(); + } + + ~FrameRouter() { + Instance = nullptr; + } + + void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + auto& buffer = current_router_buffer->send_buffers[link]; + std::copy(data, data + size, std::back_inserter(buffer)); + } + + void receive_data(uint8_t link, uint8_t* data, uint16_t size) { + int i; + for(i=0;i to) { + receive_data(DOWN_LINK, + router_buffers[from].send_buffers[UP_LINK].data(), + router_buffers[from].send_buffers[UP_LINK].size()); + } + else if(to > from) { + receive_data(UP_LINK, + router_buffers[from].send_buffers[DOWN_LINK].data(), + router_buffers[from].send_buffers[DOWN_LINK].size()); + } + } + + MOCK_METHOD3(transport_recv_frame, void (uint8_t from, uint8_t* data, uint16_t size)); + + std::vector received_data; + + struct router_buffer { + std::vector send_buffers[2]; + }; + + router_buffer router_buffers[8]; + router_buffer* current_router_buffer; + + static FrameRouter* Instance; +}; + +FrameRouter* FrameRouter::Instance = nullptr; + + +typedef struct { + std::array data; + uint8_t extra[16]; +} frame_buffer_t; + + +extern "C" { + void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + FrameRouter::Instance->send_data(link, data, size); + } + + + void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { + FrameRouter::Instance->transport_recv_frame(from, data, size); + } +} + +TEST_F(FrameRouter, master_broadcast_is_received_by_everyone) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(0); + router_send_frame(0xFF, (uint8_t*)&data, 4); + EXPECT_GT(router_buffers[0].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0); + EXPECT_CALL(*this, transport_recv_frame(0, _, _)) + .With(Args<1, 2>(ElementsAreArray(data.data))); + simulate_transport(0, 1); + EXPECT_GT(router_buffers[1].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0); + + EXPECT_CALL(*this, transport_recv_frame(0, _, _)) + .With(Args<1, 2>(ElementsAreArray(data.data))); + simulate_transport(1, 2); + EXPECT_GT(router_buffers[2].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[2].send_buffers[UP_LINK].size(), 0); +} + +TEST_F(FrameRouter, master_send_is_received_by_targets) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(0); + router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4); + EXPECT_GT(router_buffers[0].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0); + + simulate_transport(0, 1); + EXPECT_GT(router_buffers[1].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0); + + EXPECT_CALL(*this, transport_recv_frame(0, _, _)) + .With(Args<1, 2>(ElementsAreArray(data.data))); + simulate_transport(1, 2); + EXPECT_GT(router_buffers[2].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[2].send_buffers[UP_LINK].size(), 0); + + EXPECT_CALL(*this, transport_recv_frame(0, _, _)) + .With(Args<1, 2>(ElementsAreArray(data.data))); + simulate_transport(2, 3); + EXPECT_GT(router_buffers[3].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[3].send_buffers[UP_LINK].size(), 0); +} + +TEST_F(FrameRouter, first_link_sends_to_master) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(1); + router_send_frame(0, (uint8_t*)&data, 4); + EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0); + + EXPECT_CALL(*this, transport_recv_frame(1, _, _)) + .With(Args<1, 2>(ElementsAreArray(data.data))); + simulate_transport(1, 0); + EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0); +} + +TEST_F(FrameRouter, second_link_sends_to_master) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(2); + router_send_frame(0, (uint8_t*)&data, 4); + EXPECT_GT(router_buffers[2].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[2].send_buffers[DOWN_LINK].size(), 0); + + simulate_transport(2, 1); + EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0); + + EXPECT_CALL(*this, transport_recv_frame(2, _, _)) + .With(Args<1, 2>(ElementsAreArray(data.data))); + simulate_transport(1, 0); + EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0); + EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0); +} + +TEST_F(FrameRouter, master_sends_to_master_does_nothing) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(0); + router_send_frame(0, (uint8_t*)&data, 4); + EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0); +} + +TEST_F(FrameRouter, link_sends_to_other_link_does_nothing) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(1); + router_send_frame(2, (uint8_t*)&data, 4); + EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0); +} + +TEST_F(FrameRouter, master_receives_on_uplink_does_nothing) { + frame_buffer_t data; + data.data = {0xAB, 0x70, 0x55, 0xBB}; + activate_router(1); + router_send_frame(0, (uint8_t*)&data, 4); + EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0); + + EXPECT_CALL(*this, transport_recv_frame(_, _, _)) + .Times(0); + activate_router(0); + receive_data(UP_LINK, + router_buffers[1].send_buffers[UP_LINK].data(), + router_buffers[1].send_buffers[UP_LINK].size()); + EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0); + EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0); +} diff --git a/quantum/serial_link/tests/frame_validator_tests.c b/quantum/serial_link/tests/frame_validator_tests.cpp similarity index 52% rename from quantum/serial_link/tests/frame_validator_tests.c rename to quantum/serial_link/tests/frame_validator_tests.cpp index d20947e2c..9223af83b 100644 --- a/quantum/serial_link/tests/frame_validator_tests.c +++ b/quantum/serial_link/tests/frame_validator_tests.cpp @@ -22,24 +22,47 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include -#include -#include "serial_link/protocol/frame_validator.c" +#include "gtest/gtest.h" +#include "gmock/gmock.h" +extern "C" { +#include "serial_link/protocol/frame_validator.h" +} +using testing::_; +using testing::ElementsAreArray; +using testing::Args; + +class FrameValidator : public testing::Test { +public: + FrameValidator() { + Instance = this; + } + + ~FrameValidator() { + Instance = nullptr; + } + + MOCK_METHOD3(route_incoming_frame, void (uint8_t link, uint8_t* data, uint16_t size)); + MOCK_METHOD3(byte_stuffer_send_frame, void (uint8_t link, uint8_t* data, uint16_t size)); + + static FrameValidator* Instance; +}; + +FrameValidator* FrameValidator::Instance = nullptr; + +extern "C" { void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) { - mock(data, size); + FrameValidator::Instance->route_incoming_frame(link, data, size); } void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) { - mock(data, size); + FrameValidator::Instance->byte_stuffer_send_frame(link, data, size); +} } -Describe(FrameValidator); -BeforeEach(FrameValidator) {} -AfterEach(FrameValidator) {} - -Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { - never_expect(route_incoming_frame); +TEST_F(FrameValidator, doesnt_validate_frames_under_5_bytes) { + EXPECT_CALL(*this, route_incoming_frame(_, _, _)) + .Times(0); uint8_t data[] = {1, 2}; validator_recv_frame(0, 0, 1); validator_recv_frame(0, data, 2); @@ -47,55 +70,46 @@ Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { validator_recv_frame(0, data, 4); } -Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { +TEST_F(FrameValidator, validates_one_byte_frame_with_correct_crc) { uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; - expect(route_incoming_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(data, 1)) - ); + EXPECT_CALL(*this, route_incoming_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(data, 1))); validator_recv_frame(0, data, 5); } -Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { +TEST_F(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { uint8_t data[] = {0x44, 0, 0, 0, 0}; - never_expect(route_incoming_frame); + EXPECT_CALL(*this, route_incoming_frame(_, _, _)) + .Times(0); validator_recv_frame(1, data, 5); } -Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { +TEST_F(FrameValidator, validates_four_byte_frame_with_correct_crc) { uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA}; - expect(route_incoming_frame, - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(data, 4)) - ); + EXPECT_CALL(*this, route_incoming_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(data, 4))); validator_recv_frame(1, data, 8); } -Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { +TEST_F(FrameValidator, validates_five_byte_frame_with_correct_crc) { uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; - expect(route_incoming_frame, - when(size, is_equal_to(5)), - when(data, is_equal_to_contents_of(data, 5)) - ); + EXPECT_CALL(*this, route_incoming_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(data, 5))); validator_recv_frame(0, data, 9); } -Ensure(FrameValidator, sends_one_byte_with_correct_crc) { +TEST_F(FrameValidator, sends_one_byte_with_correct_crc) { uint8_t original[] = {0x44, 0, 0, 0, 0}; uint8_t expected[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; - expect(byte_stuffer_send_frame, - when(size, is_equal_to(sizeof(expected))), - when(data, is_equal_to_contents_of(expected, sizeof(expected))) - ); + EXPECT_CALL(*this, byte_stuffer_send_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); validator_send_frame(0, original, 1); } -Ensure(FrameValidator, sends_five_bytes_with_correct_crc) { +TEST_F(FrameValidator, sends_five_bytes_with_correct_crc) { uint8_t original[] = {1, 2, 3, 4, 5, 0, 0, 0, 0}; uint8_t expected[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; - expect(byte_stuffer_send_frame, - when(size, is_equal_to(sizeof(expected))), - when(data, is_equal_to_contents_of(expected, sizeof(expected))) - ); + EXPECT_CALL(*this, byte_stuffer_send_frame(_, _, _)) + .With(Args<1, 2>(ElementsAreArray(expected))); validator_send_frame(0, original, 5); } diff --git a/quantum/serial_link/tests/rules.mk b/quantum/serial_link/tests/rules.mk new file mode 100644 index 000000000..b81515bc5 --- /dev/null +++ b/quantum/serial_link/tests/rules.mk @@ -0,0 +1,22 @@ +serial_link_byte_stuffer_SRC :=\ + $(SERIAL_PATH)/tests/byte_stuffer_tests.cpp \ + $(SERIAL_PATH)/protocol/byte_stuffer.c + +serial_link_frame_validator_SRC := \ + $(SERIAL_PATH)/tests/frame_validator_tests.cpp \ + $(SERIAL_PATH)/protocol/frame_validator.c + +serial_link_frame_router_SRC := \ + $(SERIAL_PATH)/tests/frame_router_tests.cpp \ + $(SERIAL_PATH)/protocol/byte_stuffer.c \ + $(SERIAL_PATH)/protocol/frame_validator.c \ + $(SERIAL_PATH)/protocol/frame_router.c + +serial_link_triple_buffered_object_SRC := \ + $(SERIAL_PATH)/tests/triple_buffered_object_tests.cpp \ + $(SERIAL_PATH)/protocol/triple_buffered_object.c + +serial_link_transport_SRC := \ + $(SERIAL_PATH)/tests/transport_tests.cpp \ + $(SERIAL_PATH)/protocol/transport.c \ + $(SERIAL_PATH)/protocol/triple_buffered_object.c diff --git a/quantum/serial_link/tests/testlist.mk b/quantum/serial_link/tests/testlist.mk new file mode 100644 index 000000000..a80e88884 --- /dev/null +++ b/quantum/serial_link/tests/testlist.mk @@ -0,0 +1,6 @@ +TEST_LIST +=\ + serial_link_byte_stuffer\ + serial_link_frame_validator\ + serial_link_frame_router\ + serial_link_triple_buffered_object\ + serial_link_transport \ No newline at end of file diff --git a/quantum/serial_link/tests/transport_tests.c b/quantum/serial_link/tests/transport_tests.c deleted file mode 100644 index 358e1b9fd..000000000 --- a/quantum/serial_link/tests/transport_tests.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include -#include "serial_link/protocol/transport.c" -#include "serial_link/protocol/triple_buffered_object.c" - -void signal_data_written(void) { - mock(); -} - -static uint8_t sent_data[2048]; -static uint16_t sent_data_size; - -void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { - mock(destination); - memcpy(sent_data + sent_data_size, data, size); - sent_data_size += size; -} - -typedef struct { - uint32_t test; -} test_object1_t; - -typedef struct { - uint32_t test1; - uint32_t test2; -} test_object2_t; - -MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t); -MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t); -SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); - -static remote_object_t* test_remote_objects[] = { - REMOTE_OBJECT(master_to_slave), - REMOTE_OBJECT(master_to_single_slave), - REMOTE_OBJECT(slave_to_master), -}; - -Describe(Transport); -BeforeEach(Transport) { - add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); - sent_data_size = 0; -} -AfterEach(Transport) {} - -Ensure(Transport, write_to_local_signals_an_event) { - begin_write_master_to_slave(); - expect(signal_data_written); - end_write_master_to_slave(); - begin_write_slave_to_master(); - expect(signal_data_written); - end_write_slave_to_master(); - begin_write_master_to_single_slave(1); - expect(signal_data_written); - end_write_master_to_single_slave(1); -} - -Ensure(Transport, writes_from_master_to_all_slaves) { - update_transport(); - test_object1_t* obj = begin_write_master_to_slave(); - obj->test = 5; - expect(signal_data_written); - end_write_master_to_slave(); - expect(router_send_frame, - when(destination, is_equal_to(0xFF))); - update_transport(); - transport_recv_frame(0, sent_data, sent_data_size); - test_object1_t* obj2 = read_master_to_slave(); - assert_that(obj2, is_not_equal_to(NULL)); - assert_that(obj2->test, is_equal_to(5)); -} - -Ensure(Transport, writes_from_slave_to_master) { - update_transport(); - test_object1_t* obj = begin_write_slave_to_master(); - obj->test = 7; - expect(signal_data_written); - end_write_slave_to_master(); - expect(router_send_frame, - when(destination, is_equal_to(0))); - update_transport(); - transport_recv_frame(3, sent_data, sent_data_size); - test_object1_t* obj2 = read_slave_to_master(2); - assert_that(read_slave_to_master(0), is_equal_to(NULL)); - assert_that(obj2, is_not_equal_to(NULL)); - assert_that(obj2->test, is_equal_to(7)); -} - -Ensure(Transport, writes_from_master_to_single_slave) { - update_transport(); - test_object1_t* obj = begin_write_master_to_single_slave(3); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_single_slave(3); - expect(router_send_frame, - when(destination, is_equal_to(4))); - update_transport(); - transport_recv_frame(0, sent_data, sent_data_size); - test_object1_t* obj2 = read_master_to_single_slave(); - assert_that(obj2, is_not_equal_to(NULL)); - assert_that(obj2->test, is_equal_to(7)); -} - -Ensure(Transport, ignores_object_with_invalid_id) { - update_transport(); - test_object1_t* obj = begin_write_master_to_single_slave(3); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_single_slave(3); - expect(router_send_frame, - when(destination, is_equal_to(4))); - update_transport(); - sent_data[sent_data_size - 1] = 44; - transport_recv_frame(0, sent_data, sent_data_size); - test_object1_t* obj2 = read_master_to_single_slave(); - assert_that(obj2, is_equal_to(NULL)); -} - -Ensure(Transport, ignores_object_with_size_too_small) { - update_transport(); - test_object1_t* obj = begin_write_master_to_slave(); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_slave(); - expect(router_send_frame); - update_transport(); - sent_data[sent_data_size - 2] = 0; - transport_recv_frame(0, sent_data, sent_data_size - 1); - test_object1_t* obj2 = read_master_to_slave(); - assert_that(obj2, is_equal_to(NULL)); -} - -Ensure(Transport, ignores_object_with_size_too_big) { - update_transport(); - test_object1_t* obj = begin_write_master_to_slave(); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_slave(); - expect(router_send_frame); - update_transport(); - sent_data[sent_data_size + 21] = 0; - transport_recv_frame(0, sent_data, sent_data_size + 22); - test_object1_t* obj2 = read_master_to_slave(); - assert_that(obj2, is_equal_to(NULL)); -} diff --git a/quantum/serial_link/tests/transport_tests.cpp b/quantum/serial_link/tests/transport_tests.cpp new file mode 100644 index 000000000..21b7b165f --- /dev/null +++ b/quantum/serial_link/tests/transport_tests.cpp @@ -0,0 +1,188 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "gtest/gtest.h" +#include "gmock/gmock.h" + +using testing::_; +using testing::ElementsAreArray; +using testing::Args; + +extern "C" { +#include "serial_link/protocol/transport.h" +} + +struct test_object1 { + uint32_t test; +}; + +struct test_object2 { + uint32_t test1; + uint32_t test2; +}; + +MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1); +MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1); +SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1); + +static remote_object_t* test_remote_objects[] = { + REMOTE_OBJECT(master_to_slave), + REMOTE_OBJECT(master_to_single_slave), + REMOTE_OBJECT(slave_to_master), +}; + +class Transport : public testing::Test { +public: + Transport() { + Instance = this; + add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); + } + + ~Transport() { + Instance = nullptr; + reinitialize_serial_link_transport(); + } + + MOCK_METHOD0(signal_data_written, void ()); + MOCK_METHOD1(router_send_frame, void (uint8_t destination)); + + void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { + router_send_frame(destination); + std::copy(data, data + size, std::back_inserter(sent_data)); + } + + static Transport* Instance; + + std::vector sent_data; +}; + +Transport* Transport::Instance = nullptr; + +extern "C" { +void signal_data_written(void) { + Transport::Instance->signal_data_written(); +} + +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { + Transport::Instance->router_send_frame(destination, data, size); +} +} + +TEST_F(Transport, write_to_local_signals_an_event) { + begin_write_master_to_slave(); + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_slave(); + begin_write_slave_to_master(); + EXPECT_CALL(*this, signal_data_written()); + end_write_slave_to_master(); + begin_write_master_to_single_slave(1); + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_single_slave(1); +} + +TEST_F(Transport, writes_from_master_to_all_slaves) { + update_transport(); + test_object1* obj = begin_write_master_to_slave(); + obj->test = 5; + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_slave(); + EXPECT_CALL(*this, router_send_frame(0xFF)); + update_transport(); + transport_recv_frame(0, sent_data.data(), sent_data.size()); + test_object1* obj2 = read_master_to_slave(); + EXPECT_NE(obj2, nullptr); + EXPECT_EQ(obj2->test, 5); +} + +TEST_F(Transport, writes_from_slave_to_master) { + update_transport(); + test_object1* obj = begin_write_slave_to_master(); + obj->test = 7; + EXPECT_CALL(*this, signal_data_written()); + end_write_slave_to_master(); + EXPECT_CALL(*this, router_send_frame(0)); + update_transport(); + transport_recv_frame(3, sent_data.data(), sent_data.size()); + test_object1* obj2 = read_slave_to_master(2); + EXPECT_EQ(read_slave_to_master(0), nullptr); + EXPECT_NE(obj2, nullptr); + EXPECT_EQ(obj2->test, 7); +} + +TEST_F(Transport, writes_from_master_to_single_slave) { + update_transport(); + test_object1* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_single_slave(3); + EXPECT_CALL(*this, router_send_frame(4)); + update_transport(); + transport_recv_frame(0, sent_data.data(), sent_data.size()); + test_object1* obj2 = read_master_to_single_slave(); + EXPECT_NE(obj2, nullptr); + EXPECT_EQ(obj2->test, 7); +} + +TEST_F(Transport, ignores_object_with_invalid_id) { + update_transport(); + test_object1* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_single_slave(3); + EXPECT_CALL(*this, router_send_frame(4)); + update_transport(); + sent_data[sent_data.size() - 1] = 44; + transport_recv_frame(0, sent_data.data(), sent_data.size()); + test_object1* obj2 = read_master_to_single_slave(); + EXPECT_EQ(obj2, nullptr); +} + +TEST_F(Transport, ignores_object_with_size_too_small) { + update_transport(); + test_object1* obj = begin_write_master_to_slave(); + obj->test = 7; + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_slave(); + EXPECT_CALL(*this, router_send_frame(_)); + update_transport(); + sent_data[sent_data.size() - 2] = 0; + transport_recv_frame(0, sent_data.data(), sent_data.size() - 1); + test_object1* obj2 = read_master_to_slave(); + EXPECT_EQ(obj2, nullptr); +} + +TEST_F(Transport, ignores_object_with_size_too_big) { + update_transport(); + test_object1* obj = begin_write_master_to_slave(); + obj->test = 7; + EXPECT_CALL(*this, signal_data_written()); + end_write_master_to_slave(); + EXPECT_CALL(*this, router_send_frame(_)); + update_transport(); + sent_data.resize(sent_data.size() + 22); + sent_data[sent_data.size() - 1] = 0; + transport_recv_frame(0, sent_data.data(), sent_data.size()); + test_object1* obj2 = read_master_to_slave(); + EXPECT_EQ(obj2, nullptr); +} diff --git a/quantum/serial_link/tests/triple_buffered_object_tests.c b/quantum/serial_link/tests/triple_buffered_object_tests.cpp similarity index 63% rename from quantum/serial_link/tests/triple_buffered_object_tests.c rename to quantum/serial_link/tests/triple_buffered_object_tests.cpp index 6f7c82b46..7724bbee9 100644 --- a/quantum/serial_link/tests/triple_buffered_object_tests.c +++ b/quantum/serial_link/tests/triple_buffered_object_tests.cpp @@ -22,53 +22,55 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include -#include "serial_link/protocol/triple_buffered_object.c" +#include "gtest/gtest.h" +extern "C" { +#include "serial_link/protocol/triple_buffered_object.h" +} -typedef struct { +struct test_object{ uint8_t state; uint32_t buffer[3]; -}test_object_t; +}; -test_object_t test_object; +test_object test_object; -Describe(TripleBufferedObject); -BeforeEach(TripleBufferedObject) { - triple_buffer_init((triple_buffer_object_t*)&test_object); -} -AfterEach(TripleBufferedObject) {} +class TripleBufferedObject : public testing::Test { +public: + TripleBufferedObject() { + triple_buffer_init((triple_buffer_object_t*)&test_object); + } +}; - -Ensure(TripleBufferedObject, writes_and_reads_object) { +TEST_F(TripleBufferedObject, writes_and_reads_object) { *triple_buffer_begin_write(&test_object) = 0x3456ABCC; triple_buffer_end_write(&test_object); - assert_that(*triple_buffer_read(&test_object), is_equal_to(0x3456ABCC)); + EXPECT_EQ(*triple_buffer_read(&test_object), 0x3456ABCC); } -Ensure(TripleBufferedObject, does_not_read_empty) { - assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); +TEST_F(TripleBufferedObject, does_not_read_empty) { + EXPECT_EQ(triple_buffer_read(&test_object), nullptr); } -Ensure(TripleBufferedObject, writes_twice_and_reads_object) { +TEST_F(TripleBufferedObject, writes_twice_and_reads_object) { *triple_buffer_begin_write(&test_object) = 0x3456ABCC; triple_buffer_end_write(&test_object); *triple_buffer_begin_write(&test_object) = 0x44778899; triple_buffer_end_write(&test_object); - assert_that(*triple_buffer_read(&test_object), is_equal_to(0x44778899)); + EXPECT_EQ(*triple_buffer_read(&test_object), 0x44778899); } -Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { +TEST_F(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { *triple_buffer_begin_write(&test_object) = 1; triple_buffer_end_write(&test_object); uint32_t* read = triple_buffer_read(&test_object); *triple_buffer_begin_write(&test_object) = 2; triple_buffer_end_write(&test_object); - assert_that(*read, is_equal_to(1)); - assert_that(*triple_buffer_read(&test_object), is_equal_to(2)); - assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); + EXPECT_EQ(*read, 1); + EXPECT_EQ(*triple_buffer_read(&test_object), 2); + EXPECT_EQ(triple_buffer_read(&test_object), nullptr); } -Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { +TEST_F(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { *triple_buffer_begin_write(&test_object) = 1; triple_buffer_end_write(&test_object); uint32_t* read = triple_buffer_read(&test_object); @@ -76,7 +78,7 @@ Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { triple_buffer_end_write(&test_object); *triple_buffer_begin_write(&test_object) = 3; triple_buffer_end_write(&test_object); - assert_that(*read, is_equal_to(1)); - assert_that(*triple_buffer_read(&test_object), is_equal_to(3)); - assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); + EXPECT_EQ(*read, 1); + EXPECT_EQ(*triple_buffer_read(&test_object), 3); + EXPECT_EQ(triple_buffer_read(&test_object), nullptr); } diff --git a/quantum/template/Makefile b/quantum/template/Makefile index 3f6d133c9..4e2a6f00f 100644 --- a/quantum/template/Makefile +++ b/quantum/template/Makefile @@ -1,75 +1,3 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR +ifndef MAKEFILE_INCLUDED include ../../Makefile -endif - - +endif \ No newline at end of file diff --git a/quantum/template/readme.md b/quantum/template/readme.md index b2fb4dd98..b16f4cd76 100644 --- a/quantum/template/readme.md +++ b/quantum/template/readme.md @@ -3,7 +3,7 @@ ## Quantum MK Firmware -For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). +For the full Quantum feature list, see [the parent readme](/). ## Building @@ -13,16 +13,16 @@ Depending on which keymap you would like to use, you will have to compile slight ### Default -To build with the default keymap, simply run `make`. +To build with the default keymap, simply run `make default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: ``` -$ make keymap=[default|jack|] +$ make [default|jack|] ``` -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/quantum/template/rules.mk b/quantum/template/rules.mk new file mode 100644 index 000000000..55898147d --- /dev/null +++ b/quantum/template/rules.mk @@ -0,0 +1,67 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 diff --git a/readme.md b/readme.md index affee1b62..70725bf81 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@ For an easy-to-read version of this document and the repository, check out [http * [Planck](/keyboards/planck/) * [Preonic](/keyboards/preonic/) * [Atomic](/keyboards/atomic/) -* [ErgoDox EZ](/keyboards/ergodox_ez/) +* [ErgoDox EZ](/keyboards/ergodox/) * [Clueboard](/keyboards/clueboard/) * [Cluepad](/keyboards/cluepad/) @@ -31,7 +31,7 @@ The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/j This is not a tiny project. While this is the main readme, there are many other files you might want to consult. Here are some points of interest: -* The readme for your own keyboard: This is found under `keyboards//`. So for the ErgoDox EZ, it's [here](keyboards/ergodox_ez/); for the Planck, it's [here](keyboards/planck/) and so on. +* The readme for your own keyboard: This is found under `keyboards//`. So for the ErgoDox EZ, it's [here](keyboards/ergodox/ez/); for the Planck, it's [here](keyboards/planck/) and so on. * The list of possible keycodes you can use in your keymap is actually spread out in a few different places: * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes. * [quantum/keymap.h](quantum/keymap.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap.h` is where they're actually defined. @@ -43,14 +43,38 @@ Before you are able to compile, you'll need to install an environment for AVR de ## Build Environment Setup +### Windows 10 + +It's still recommended to use the method for Vista and later below. The reason for this is that the Windows 10 Subsystem for Linux lacks [USB support](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13355724-unable-to-access-usb-devices-from-bash), so it's not possible to flash the firmware to the keyboard. Please add your vote to the link! + +That said, it's still possible to use it for compilation. And recommended, if you need to compile much, since it's much faster than at least Cygwin (which is also supported, but currently lacking documentation). I haven't tried the method below, so I'm unable to tell. + +Here are the steps + +1. Install the Windows 10 subsystem for Linux, following [these instructions](http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/). +2. If you have previously cloned the repository using the normal Git bash, you will need to clean up the line endings. If you have cloned it after 20th of August 2016, you are likely fine. To clean up the line endings do the following + 1. Make sure that you have no changes you haven't committed by running `git status`, if you do commit them first + 2. From within the Git bash run `git rm --cached -r .` + 3. Followed by `git reset --hard` +3. Start the "Bash On Ubuntu On Windows" from the start menu +4. With the bash open, navigate to your Git checkout. The harddisk can be accessed from `/mnt` for example `/mnt/c` for the `c:\` drive. +5. Run `sudo util/install_dependencies.sh`. +6. After a while the installation will finish, and you are good to go + +**Note** From time to time, the dependencies might change, so just run `install_dependencies.sh` again if things are not working. + +**Warning:** If you edit Makefiles or shell scripts, make sure you are using an editor that saves the files with Unix line endings. Otherwise the compilation might not work. + + ### Windows (Vista and later) 1. If you have ever installed WinAVR, uninstall it. 2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. -3. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. -4. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. -5. Double-click on the 1-setup-path-win batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. -6. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! -7. Future build commands should be run from the MHV AVR Shell, which sets up an environment compatible with colorful build output. The standard Command Prompt will also work, but add `COLOR=false` to the end of all make commands when using it. +3. If you are going to flash Infinity based keyboards you will need to install dfu-util, refer to the instructions by [Input Club](https://github.com/kiibohd/controller/wiki/Loading-DFU-Firmware). +4. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. +5. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. +6. Double-click on the 1-setup-path-win batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. +7. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! +8. Future build commands should be run from the MHV AVR Shell, which sets up an environment compatible with colorful build output. The standard Command Prompt will also work, but add `COLOR=false` to the end of all make commands when using it. ### Mac If you're using [homebrew,](http://brew.sh/) you can use the following commands: @@ -67,13 +91,41 @@ You can also try these instructions: 2. Install the Command Line Tools from `Xcode->Preferences->Downloads`. 3. Install [DFU-Programmer][dfu-prog]. +If you are going to flash Infinity based keyboards you will also need dfu-util + + brew install dfu-util + ### Linux -Install AVR GCC, AVR libc, and dfu-progammer with your favorite package manager. + +To ensure you are always up to date, you can just run `sudo utils/install_dependencies.sh`. That should always install all the dependencies needed. + +You can also install things manually, but this documentation might not be always up to date with all requirements. + +The current requirements are the following, but not all might be needed depending on what you do. Also note that some systems might not have all the dependencies available as packages, or they might be named differently. + +``` +build-essential +gcc +unzip +wget +zip +gcc-avr +binutils-avr +avr-libc +dfu-programmer +dfu-util +gcc-arm-none-eabi +binutils-arm-none-eabi +libnewlib-arm-none-eabi +git +``` + +Install the dependencies with your favorite package manager. Debian/Ubuntu example: sudo apt-get update - sudo apt-get install gcc-avr avr-libc dfu-programmer + sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi ### Docker @@ -82,9 +134,9 @@ If this is a bit complex for you, Docker might be the turn-key solution you need ```bash # You'll run this every time you want to build a keymap # modify the keymap and keyboard assigment to compile what you want -# defaults are ergodox_ez/default +# defaults are ergodox/default -docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware +docker run -e keymap=gwen -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware ``` @@ -110,44 +162,103 @@ In every keymap folder, the following files are recommended: ## The `make` command -The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards//`), or your keymap folder (`/keyboards//keymaps//`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)). +The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). -By default, this will generate a `_.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests. +**NOTE:** To abort a make command press `Ctrl-c` -Below are some definitions that will be useful: +The following instruction refers to these folders. -* The "root" (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc. -* The "keyboard" folder is any keyboard project's folder, like `/keyboards/planck`. -* The "keymap" folder is any keymap's folder, like `/keyboards/planck/keymaps/default`. +* The `root` (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc. +* The `keyboard` folder is any keyboard project's folder, like `/keyboards/planck`. +* The `keymap` folder is any keymap's folder, like `/keyboards/planck/keymaps/default`. +* The `subproject` folder is the subproject folder of a keyboard, like `/keyboards/ergodox/ez` -Below is a list of the useful `make` commands in QMK: +### Simple instructions for building and uploading a keyboard -* `make` - cleans automatically and builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder - * `make keyboard=` - specifies the keyboard (only to be used in root) - * `make keymap=` - specifies the keymap (only to be used in root and keyboard folder - not needed when in keymap folder) -* `make quick` - skips the clean step (cannot be used immediately after modifying config.h or Makefiles) -* `make dfu` - (requires dfu-programmer) builds and flashes the keymap to your keyboard once placed in reset/dfu mode (button or press `KC_RESET`). This does not work for Teensy-based keyboards like the ErgoDox EZ. - * `keyboard=` and `keymap=` are compatible with this -* `make all-keyboards` - builds all keymaps for all keyboards and outputs status of each (use in root) -* `make all-keyboards-default` - builds all default keymaps for all keyboards and outputs status of each (use in root) -* `make all-keymaps [keyboard=]` - builds all of the keymaps for whatever keyboard folder you're in, or specified by `` -* `make all-keyboards-quick`, `make all-keyboards-default-quick` and `make all-keymaps-quick [keyboard=]` - like the normal "make-all-*" commands, but they skip the clean steps +**Most keyboards have more specific instructions in the keyboard specific readme.md file, so please check that first** -Other, less useful functionality: +If the `keymap` folder contains a file name `Makefile` + +1. Change the directory to the `keymap` folder +2. Run `make -` + +Otherwise, if there's no `Makefile` in the `keymap` folder + +1. Enter the `keyboard` folder +2. Run `make --` + +In the above commands, replace: + +* `` with the name of your keymap +* `` with the name of the subproject (revision or sub-model of your keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`. + * If the keyboard doesn't have a subproject, or if you are happy with the default (defined in `rules.mk` file of the `keyboard` folder), you can leave it out. But remember to also remove the dash (`-`) from the command. +* `` The programmer to use. Most keyboards use `dfu`, but some use `teensy`. Infinity keyboards use `dfu-util`. Check the readme file in the keyboard folder to find out which programmer to use. + * If you don't add `----`, where: + +* `` is the name of the keyboard, for example `planck` + * Use `allkb` to compile all keyboards +* `` is the name of the subproject (revision or sub-model of the keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`. + * If the keyboard doesn't have any subprojects, it can be left out + * To compile the default subproject, you can leave it out, or specify `defaultsp` + * Use `allsp` to compile all subprojects +* `` is the name of the keymap, for example `algernon` + * Use `allkm` to compile all keymaps +* `` will be explained in more detail below. + +**Note:** When you leave some parts of the command out, you should also remove the dash (`-`). + +As mentioned above, there are some shortcuts, when you are in a: + +* `keyboard` folder, the command will automatically fill the `` part. So you only need to type `--` +* `subproject` folder, it will fill in both `` and `` +* `keymap` folder, then `` and `` will be filled in. If you need to specify the `` use the following syntax `-` + * Note in order to support this shortcut, the keymap needs its own Makefile (see the example [here](/doc/keymap_makefile_example.mk)) +* `keymap` folder of a `subproject`, then everything except the `` will be filled in + +The `` means the following +* If no target is given, then it's the same as `all` below +* `all` compiles the keyboard and generates a `_.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests. +* `dfu`, `teensy` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for Infinity keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme. **Note** that some operating systems needs root access for these commands to work, so in that case you need to run for example `sudo make dfu`. +* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems. + +Some other targets are supported but, but not important enough to be documented here. Check the source code of the make files for more information. + +You can also add extra options at the end of the make command line, after the target * `make COLOR=false` - turns off color output * `make SILENT=true` - turns off output besides errors/warnings -* `make VERBOSE=true` - outputs all of the avr-gcc stuff (not interesting) +* `make VERBOSE=true` - outputs all of the gcc stuff (not interesting, unless you need to debug) + +The make command itself also has some additional options, type `make --help` for more information. The most useful is probably `-jx`, which specifies that you want to compile using more than one CPU, the `x` represents the number of CPUs that you want to use. Setting that can greatly reduce the compile times, especially if you are compiling many keyboards/keymaps. I usually set it to one less than the number of CPUs that I have, so that I have some left for doing other things while it's compiling. Note that not all operating systems and make versions supports that option. + +Here are some examples commands + +* `make allkb-allsp-allkm` builds everything (all keyboards, all subprojects, all keymaps). Running just `make` from the `root` will also run this. +* `make` from within a `keyboard` directory, is the same as `make keyboard-allsp-allkm`, which compiles all subprojects and keymaps of the keyboard. **NOTE** that this behaviour has changed. Previously it compiled just the default keymap. +* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard. This example uses the full syntax and can be run from any folder with a `Makefile` +* `make dfu COLOR=false` from within a keymap folder, builds and uploads the keymap, but without color output. ## The `Makefile` -There are 3 different `make` and `Makefile` locations: +There are 5 different `make` and `Makefile` locations: * root (`/`) * keyboard (`/keyboards//`) * keymap (`/keyboards//keymaps//`) +* subproject (`/keyboards//`) +* subproject keymap (`/keyboards///keymaps/`) -The root contains the code used to automatically figure out which keymap or keymaps to compile based on your current directory and commandline arguments. It's considered stable, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. **It is required if you want to run `make` in the keymap folder.** +The root contains the code used to automatically figure out which keymap or keymaps to compile based on your current directory and commandline arguments. It's considered stable, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. **The file is required if you want to run `make` in the keymap folder.** + +For keyboards and subprojects, the make files are split in two parts `Makefile` and `rules.mk`. All settings can be found in the `rules.mk` file, while the `Makefile` is just there for support and including the root `Makefile`. Keymaps contain just one `Makefile` for simplicity. ### Makefile options @@ -229,10 +340,18 @@ For a value of `4` for this imaginary setting. So we `undef` it first, then `def You can then override any settings, rather than having to copy and paste the whole thing. -## Going beyond the keycodes +# Going beyond the keycodes Aside from the [basic keycodes](doc/keycode.txt), your keymap can include shortcuts to common operations. +## Quick aliases to common actions + +Your keymap can include shortcuts to common operations (called "function actions" in tmk). + +These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk `ACTION_*` functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/doc/keymap.md#2-action). + +Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. + ### Switching and toggling layers `MO(layer)` - momentary switch to *layer*. As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer. When you apply this to a key, that same key must be set as `KC_TRNS` on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent). You can only switch to layers *above* your current layer. If you're on layer 0 and you use `MO(1)`, that will switch to layer 1 just fine. But if you include `MO(3)` on layer 5, that won't do anything for you -- because layer 3 is lower than layer 5 on the stack. @@ -310,7 +429,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. -### Space Cadet Shift: The future, built in +## Space Cadet Shift: The future, built in Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. @@ -335,7 +454,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time. -### The Leader key: A new kind of modifier +## The Leader key: A new kind of modifier If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen. @@ -373,7 +492,7 @@ void matrix_scan_user(void) { As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. -### Tap Dance: A single key can do 3, 5, or 100 different things +## Tap Dance: A single key can do 3, 5, or 100 different things Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/jackhumbert/qmk_firmware/pull/451). Here's how algernon describes the feature: @@ -409,7 +528,32 @@ Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-danc For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros. -In the end, let's see a full example! +### Examples + +Here's a simple example for a single definition: + +1. In your `makefile`, add `TAP_DANCE_ENABLE = yes` +2. In your `config.h` (which you can copy from `qmk_firmware/keyboards/planck/config.h` to your keymap directory), add `#define TAPPING_TERM 200` +3. In your `keymap.c` file, define the variables and definitions, then add to your keymap: + +```c +//Tap Dance Declarations +enum { + TD_ESC_CAPS = 0 +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) +// Other declarations would go here, separated by commas, if you have them +}; + +//In Layer declaration, add tap dance item in place of a key code +TD(TD_ESC_CAPS) +``` + +Here's a more complex example involving custom actions: ```c enum { @@ -485,7 +629,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { ergodox_right_led_3_off(); } -const qk_tap_dance_action_t tap_dance_actions[] = { +qk_tap_dance_action_t tap_dance_actions[] = { [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset) ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) @@ -493,11 +637,11 @@ const qk_tap_dance_action_t tap_dance_actions[] = { }; ``` -### Temporarily setting the default layer +## Temporarily setting the default layer `DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. -### Prevent stuck modifiers +## Prevent stuck modifiers Consider the following scenario: @@ -518,12 +662,6 @@ This option uses 5 bytes of memory per every 8 keys on the keyboard rounded up (5 bits per key). For example on Planck (48 keys) it uses (48/8)\*5 = 30 bytes. -### Remember: These are just aliases - -These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/doc/keymap.md#2-action). - -Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. - ## Macro shortcuts: Send a whole string when pressing just one key Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c). @@ -669,6 +807,53 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste. +## Dynamic macros: record and replay macros in runtime + +In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 128 keypresses. + +To enable them, first add a new element to the `planck_keycodes` enum -- `DYNAMIC_MACRO_RANGE`: + + enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + DYNAMIC_MACRO_RANGE, + }; + +Afterwards create a new layer called `_DYN`: + + #define _DYN 6 /* almost any other free number should be ok */ + +Below these two modifications include the `dynamic_macro.h` header: + + #include "dynamic_macro.h"` + +Then define the `_DYN` layer with the following keys: `DYN_REC_START1`, `DYN_MACRO_PLAY1`,`DYN_REC_START2` and `DYN_MACRO_PLAY2`. It may also contain other keys, it doesn't matter apart from the fact that you won't be able to record these keys in the dynamic macros. + + [_DYN]= { + {_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + }, + +Add the following code to the very beginning of your `process_record_user()` function: + + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + +To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `_DYN` layer button. The handler awaits specifically for the `MO(_DYN)` keycode as the "stop signal" so please don't use any fancy ways to access this layer, use the regular `MO()` modifier. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`. + +If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 256; please read the comments for it in the header). + +For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header. + ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: @@ -710,7 +895,7 @@ Enable the backlight from the Makefile. All of these functions are available in the `*_kb()` or `*_user()` variety. `kb` ones should only be used in the `/.c` file, and `user` ones should only be used in the `keymap.c`. The keyboard ones call the user ones - it's necessary to keep these calls to allow the keymap functions to work correctly. -## `void martix_init_*(void)` +## `void matrix_init_*(void)` This function gets called when the matrix is initiated, and can contain start-up code for your keyboard/keymap. @@ -957,3 +1142,54 @@ Here is where you can (optionally) define your `KEYMAP` function to remap your m ``` Each of the `kxx` variables needs to be unique, and usually follows the format `k`. You can place `KC_NO` where your dead keys are in your matrix. + +# Unit Testing + +If you are new to unit testing, then you can find many good resources on internet. However most of it is scattered around in small pieces here and there, and there's also many different opinions, so I won't give any recommendations. + +Instead I recommend these two books, explaining two different styles of Unit Testing in detail. + +* "Test Driven Development: By Example: Kent Beck" +* "Growing Object-Oriented Software, Guided By Tests: Steve Freeman, Nat Pryce" + +If you prefer videos there are Uncle Bob's [Clean Coders Videos](https://cleancoders.com/), which unfortunately cost quite a bit, especially if you want to watch many of them. But James Shore has a free [Let's Play](http://www.jamesshore.com/Blog/Lets-Play) video series. + +## Google Test and Google Mock +It's possible to Unit Test your code using [Google Test](https://github.com/google/googletest). The Google Test framework also includes another component for writing testing mocks and stubs, called "Google Mock". For information how to write the actual tests, please refer to the documentation on that site. + +## Use of C++ + +Note that Google Test and therefore any test has to be written in C++, even if the rest of the QMK codebases is written in C. This should hopefully not be a problem even if you don't know any C++, since there's quite clear documentation and examples of the required C++ features, and you can write the rest of the test code almost as you would write normal C. Note that some compiler errors which you might get can look quite scary, but just read carefully what it says, and you should be ok. + +One thing to remember, is that you have to append `extern "C"` around all of your C file includes. + +## Adding tests for new or existing features + +If you want to unit test some feature, then take a look at the existing serial_link tests, in the `quantum/serial_link/tests folder`, and follow the steps below to create a similar structure. + +1. If it doesn't already exist, add a test subfolder to the folder containing the feature. +2. Create a `testlist.mk` and a `rules.mk` file in that folder. +3. Include those files from the root folder `testlist.mk`and `build_test.mk` respectively. +4. Add a new name for your testgroup to the `testlist.mk` file. Each group defined there will be a separate executable. And that's how you can support mocking out different parts. Note that it's worth adding some common prefix, just like it's done for the serial_link tests. The reason for that is that the make command allows substring filtering, so this way you can easily run a subset of the tests. +5. Define the source files and required options in the `rules.mk` file. + * `_SRC` for source files + * `_DEFS` for additional defines + * `_INC` for additional include folders +6. Write the tests in a new cpp file inside the test folder you created. That file has to be one of the files included from the `rules.mk` file. + +Note how there's several different tests, each mocking out a separate part. Also note that each of them only compiles the very minimum that's needed for the tests. It's recommend that you try to do the same. For a relevant video check out [Matt Hargett "Advanced Unit Testing in C & C++](https://www.youtube.com/watch?v=Wmy6g-aVgZI) + +## Running the tests + +To run all the tests in the codebase, type `make test`. You can also run test matching a substring by typing `make test-matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer. + +## Debugging the tests + +If there are problems with the tests, you can find the executable in the `./build/test` folder. You should be able to run those with GDB or a similar debugger. + +## Full Integration tests + +It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing. + +In that model you would emulate the input, and expect a certain output from the emulated keyboard. + diff --git a/testlist.mk b/testlist.mk new file mode 100644 index 000000000..1884d6d3f --- /dev/null +++ b/testlist.mk @@ -0,0 +1,13 @@ +include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk + +define VALIDATE_TEST_LIST + ifneq ($1,) + ifeq ($$(findstring -,$1),-) + $$(error Test names can't contain '-', but '$1' does) + else + $$(eval $$(call VALIDATE_TEST_LIST,$$(firstword $2),$$(wordlist 2,9999,$2))) + endif + endif +endef + +$(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST)))) \ No newline at end of file diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 6c03e1650..b48173341 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -138,6 +138,11 @@ else endif dfu-programmer $(MCU) reset +# Convert hex to bin. +flashbin: $(BUILD_DIR)/$(TARGET).hex + $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin + $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; + $(COPY) $(BUILD_DIR)/$(TARGET).bin FLASH.bin; # Generate avr-gdb config/init file which does the following: # define the reset signal, load the target file, connect to target, and set diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index cb67ac6f2..062a712bd 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -89,9 +89,9 @@ CHIBISRC = $(STARTUPSRC) \ $(STARTUPASM) \ $(PORTASM) \ $(OSALASM) - -SRC += $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC)) +CHIBISRC := $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC)) + EXTRAINCDIRS += $(CHIBIOS)/os/license \ $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ @@ -143,14 +143,6 @@ MCUFLAGS = -mcpu=$(MCU) DEBUG = gdb -# Define ASM defines here -# bootloader definitions may be used in the startup .s file -ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","") - OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h -else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","") - OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h -endif - # List any extra directories to look for libraries here. EXTRALIBDIRS = $(RULESPATH)/ld diff --git a/tmk_core/common.mk b/tmk_core/common.mk index aa05b9491..f826a7b54 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -5,7 +5,7 @@ else ifeq ($(PLATFORM),CHIBIOS) PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios endif -SRC += $(COMMON_DIR)/host.c \ +TMK_COMMON_SRC += $(COMMON_DIR)/host.c \ $(COMMON_DIR)/keyboard.c \ $(COMMON_DIR)/action.c \ $(COMMON_DIR)/action_tapping.c \ @@ -21,97 +21,89 @@ SRC += $(COMMON_DIR)/host.c \ $(PLATFORM_COMMON_DIR)/bootloader.c \ ifeq ($(PLATFORM),AVR) - SRC += $(PLATFORM_COMMON_DIR)/xprintf.S + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S endif ifeq ($(PLATFORM),CHIBIOS) - SRC += $(PLATFORM_COMMON_DIR)/printf.c - SRC += $(PLATFORM_COMMON_DIR)/eeprom.c + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c endif # Option modules ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) - OPT_DEFS += -DBOOTMAGIC_ENABLE - SRC += $(COMMON_DIR)/bootmagic.c + TMK_COMMON_DEFS += -DBOOTMAGIC_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/bootmagic.c else - OPT_DEFS += -DMAGIC_ENABLE - SRC += $(COMMON_DIR)/magic.c + TMK_COMMON_DEFS += -DMAGIC_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/magic.c endif ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) - SRC += $(COMMON_DIR)/mousekey.c - OPT_DEFS += -DMOUSEKEY_ENABLE - OPT_DEFS += -DMOUSE_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c + TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE + TMK_COMMON_DEFS += -DMOUSE_ENABLE endif ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) - OPT_DEFS += -DEXTRAKEY_ENABLE + TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE endif ifeq ($(strip $(CONSOLE_ENABLE)), yes) - OPT_DEFS += -DCONSOLE_ENABLE + TMK_COMMON_DEFS += -DCONSOLE_ENABLE else - OPT_DEFS += -DNO_PRINT - OPT_DEFS += -DNO_DEBUG + TMK_COMMON_DEFS += -DNO_PRINT + TMK_COMMON_DEFS += -DNO_DEBUG endif ifeq ($(strip $(COMMAND_ENABLE)), yes) - SRC += $(COMMON_DIR)/command.c - OPT_DEFS += -DCOMMAND_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/command.c + TMK_COMMON_DEFS += -DCOMMAND_ENABLE endif ifeq ($(strip $(NKRO_ENABLE)), yes) - OPT_DEFS += -DNKRO_ENABLE + TMK_COMMON_DEFS += -DNKRO_ENABLE endif ifeq ($(strip $(USB_6KRO_ENABLE)), yes) - OPT_DEFS += -DUSB_6KRO_ENABLE + TMK_COMMON_DEFS += -DUSB_6KRO_ENABLE endif ifeq ($(strip $(SLEEP_LED_ENABLE)), yes) - SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c - OPT_DEFS += -DSLEEP_LED_ENABLE - OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c + TMK_COMMON_DEFS += -DSLEEP_LED_ENABLE + TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN endif ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) - SRC += $(COMMON_DIR)/backlight.c - OPT_DEFS += -DBACKLIGHT_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/backlight.c + TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE endif ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) - OPT_DEFS += -DBLUETOOTH_ENABLE + TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE +endif + +ifeq ($(strip $(ONEHAND_ENABLE)), yes) + TMK_COMMON_DEFS += -DONEHAND_ENABLE endif ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) - OPT_DEFS += -DKEYMAP_SECTION_ENABLE + TMK_COMMON_DEFS += -DKEYMAP_SECTION_ENABLE ifeq ($(strip $(MCU)),atmega32u2) - EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x + TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x else ifeq ($(strip $(MCU)),atmega32u4) - EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x + TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x else - EXTRALDFLAGS = $(error no ldscript for keymap section) + TMK_COMMON_LDFLAGS = $(error no ldscript for keymap section) endif endif -ifeq ($(MASTER),right) - OPT_DEFS += -DMASTER_IS_ON_RIGHT -else - ifneq ($(MASTER),left) -$(error MASTER does not have a valid value(left/right)) - endif -endif - - -# Version string -OPT_DEFS += -DVERSION=$(GIT_VERSION) - # Bootloader address ifdef STM32_BOOTLOADER_ADDRESS - OPT_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) + TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) endif # Search Path diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index be6dea2b7..08ef22eb9 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -41,6 +41,12 @@ void action_exec(keyevent_t event) dprint("EVENT: "); debug_event(event); dprintln(); } +#ifdef ONEHAND_ENABLE + if (!IS_NOEVENT(event)) { + process_hand_swap(&event); + } +#endif + keyrecord_t record = { .event = event }; #ifndef NO_ACTION_TAPPING @@ -53,6 +59,26 @@ void action_exec(keyevent_t event) #endif } +#ifdef ONEHAND_ENABLE +bool swap_hands = false; + +void process_hand_swap(keyevent_t *event) { + static swap_state_row_t swap_state[MATRIX_ROWS]; + + keypos_t pos = event->key; + swap_state_row_t col_bit = (swap_state_row_t)1<pressed ? swap_hands : + swap_state[pos.row] & (col_bit); + + if (do_swap) { + event->key = hand_swap_config[pos.row][pos.col]; + swap_state[pos.row] |= col_bit; + } else { + swap_state[pos.row] &= ~(col_bit); + } +} +#endif + #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) bool disable_action_cache = false; @@ -440,6 +466,54 @@ void process_action(keyrecord_t *record, action_t action) #endif case ACT_COMMAND: break; +#ifdef ONEHAND_ENABLE + case ACT_SWAP_HANDS: + switch (action.swap.code) { + case OP_SH_TOGGLE: + if (event.pressed) { + swap_hands = !swap_hands; + } + break; + case OP_SH_ON_OFF: + swap_hands = event.pressed; + break; + case OP_SH_OFF_ON: + swap_hands = !event.pressed; + break; + case OP_SH_ON: + if (!event.pressed) { + swap_hands = true; + } + break; + case OP_SH_OFF: + if (!event.pressed) { + swap_hands = false; + } + break; + #ifndef NO_ACTION_TAPPING + case OP_SH_TAP_TOGGLE: + /* tap toggle */ + if (tap_count > 0) { + if (!event.pressed) { + swap_hands = !swap_hands; + } + } else { + swap_hands = event.pressed; + } + break; + default: + if (tap_count > 0) { + if (event.pressed) { + register_code(action.swap.code); + } else { + unregister_code(action.swap.code); + } + } else { + swap_hands = event.pressed; + } + #endif + } +#endif #ifndef NO_ACTION_FUNCTION case ACT_FUNCTION: action_function(record, action.func.id, action.func.opt); @@ -652,6 +726,13 @@ bool is_tap_key(keypos_t key) return true; } return false; + case ACT_SWAP_HANDS: + switch (action.swap.code) { + case 0x00 ... 0xdf: + case OP_SH_TAP_TOGGLE: + return true; + } + return false; case ACT_MACRO: case ACT_FUNCTION: if (action.func.opt & FUNC_TAP) { return true; } @@ -692,6 +773,7 @@ void debug_action(action_t action) case ACT_MACRO: dprint("ACT_MACRO"); break; case ACT_COMMAND: dprint("ACT_COMMAND"); break; case ACT_FUNCTION: dprint("ACT_FUNCTION"); break; + case ACT_SWAP_HANDS: dprint("ACT_SWAP_HANDS"); break; default: dprint("UNKNOWN"); break; } dprintf("[%X:%02X]", action.kind.param>>8, action.kind.param&0xff); diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index e8aa12a7c..b9bdfe642 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -65,6 +65,24 @@ bool process_record_quantum(keyrecord_t *record); #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) extern bool disable_action_cache; #endif + +/* Code for handling one-handed key modifiers. */ +#ifdef ONEHAND_ENABLE +extern bool swap_hands; +extern const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; +#if (MATRIX_COLS <= 8) +typedef uint8_t swap_state_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t swap_state_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t swap_state_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +void process_hand_swap(keyevent_t *record); +#endif + void process_record_nocache(keyrecord_t *record); void process_record(keyrecord_t *record); void process_action(keyrecord_t *record, action_t action); diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index ca729aaec..33da35f35 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -108,6 +108,8 @@ enum action_kind_id { /* Other Keys */ ACT_USAGE = 0b0100, ACT_MOUSEKEY = 0b0101, + /* One-hand Support */ + ACT_SWAP_HANDS = 0b0110, /* Layer Actions */ ACT_LAYER = 0b1000, ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */ @@ -178,6 +180,11 @@ typedef union { uint8_t opt :4; uint8_t kind :4; } func; + struct action_swap { + uint8_t code :8; + uint8_t opt :4; + uint8_t kind :4; + } swap; } action_t; @@ -295,6 +302,7 @@ enum backlight_opt { BACKLIGHT_STEP = 3, BACKLIGHT_LEVEL = 4, }; + /* Macro */ #define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) #define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) @@ -306,7 +314,7 @@ enum backlight_opt { #define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8) #define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | (level)) /* Command */ -#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr)) +#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (id)) /* Function */ enum function_opts { FUNC_TAP = 0x8, /* indciates function is tappable */ @@ -314,5 +322,23 @@ enum function_opts { #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_pram_tap_op { + OP_SH_TOGGLE = 0xF0, + OP_SH_TAP_TOGGLE, + OP_SH_ON_OFF, + OP_SH_OFF_ON, + OP_SH_OFF, + OP_SH_ON, +}; + +#define ACTION_SWAP_HANDS() ACTION_SWAP_HANDS_ON_OFF() +#define ACTION_SWAP_HANDS_TOGGLE() ACTION(ACT_SWAP_HANDS, OP_SH_TOGGLE) +#define ACTION_SWAP_HANDS_TAP_TOGGLE() ACTION(ACT_SWAP_HANDS, OP_SH_TAP_TOGGLE) +#define ACTION_SWAP_HANDS_TAP_KEY(key) ACTION(ACT_SWAP_HANDS, key) +#define ACTION_SWAP_HANDS_ON_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_ON_OFF) +#define ACTION_SWAP_HANDS_OFF_ON() ACTION(ACT_SWAP_HANDS, OP_SH_OFF_ON) +#define ACTION_SWAP_HANDS_ON() ACTION(ACT_SWAP_HANDS, OP_SH_ON) +#define ACTION_SWAP_HANDS_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_OFF) #endif /* ACTION_CODE_H */ diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 63fa2b5ae..a3c757964 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -111,7 +111,7 @@ void layer_debug(void) #endif #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) -uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {0}; +uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {{0}}; void update_source_layers_cache(keypos_t key, uint8_t layer) { diff --git a/tmk_core/common/avr/xprintf.S b/tmk_core/common/avr/xprintf.S index 0cec70ce2..06434b98d 100644 --- a/tmk_core/common/avr/xprintf.S +++ b/tmk_core/common/avr/xprintf.S @@ -1,500 +1,500 @@ -;---------------------------------------------------------------------------; -; Extended itoa, puts, printf and atoi (C)ChaN, 2011 -;---------------------------------------------------------------------------; - - // Base size is 152 bytes -#define CR_CRLF 0 // Convert \n to \r\n (+10 bytes) -#define USE_XPRINTF 1 // Enable xprintf function (+194 bytes) -#define USE_XSPRINTF 0 // Add xsprintf function (+78 bytes) -#define USE_XFPRINTF 0 // Add xfprintf function (+54 bytes) -#define USE_XATOI 0 // Enable xatoi function (+182 bytes) - - -#if FLASHEND > 0x1FFFF -#error xitoa module does not support 256K devices -#endif - -.nolist -#include // Include device specific definitions. -.list - -#ifdef SPM_PAGESIZE // Recent devices have "lpm Rd,Z+" and "movw". -.macro _LPMI reg - lpm \reg, Z+ -.endm -.macro _MOVW dh,dl, sh,sl - movw \dl, \sl -.endm -#else // Earlier devices do not have "lpm Rd,Z+" nor "movw". -.macro _LPMI reg - lpm - mov \reg, r0 - adiw ZL, 1 -.endm -.macro _MOVW dh,dl, sh,sl - mov \dl, \sl - mov \dh, \sh -.endm -#endif - - - -;--------------------------------------------------------------------------- -; Stub function to forward to user output function -; -;Prototype: void xputc (char chr // a character to be output -; ); -;Size: 12/12 words - -.section .bss -.global xfunc_out ; xfunc_out must be initialized before using this module. -xfunc_out: .ds.w 1 -.section .text - - -.func xputc -.global xputc -xputc: -#if CR_CRLF - cpi r24, 10 ;LF --> CRLF - brne 1f ; - ldi r24, 13 ; - rcall 1f ; - ldi r24, 10 ;/ -1: -#endif - push ZH - push ZL - lds ZL, xfunc_out+0 ;Pointer to the registered output function. - lds ZH, xfunc_out+1 ;/ - sbiw ZL, 0 ;Skip if null - breq 2f ;/ - icall -2: pop ZL - pop ZH - ret -.endfunc - - - -;--------------------------------------------------------------------------- -; Direct ROM string output -; -;Prototype: void xputs (const char *str_p // rom string to be output -; ); - -.func xputs -.global xputs -xputs: - _MOVW ZH,ZL, r25,r24 ; Z = pointer to rom string -1: _LPMI r24 - cpi r24, 0 - breq 2f - rcall xputc - rjmp 1b -2: ret -.endfunc - - -;--------------------------------------------------------------------------- -; Extended direct numeral string output (32bit version) -; -;Prototype: void xitoa (long value, // value to be output -; char radix, // radix -; char width); // minimum width -; - -.func xitoa -.global xitoa -xitoa: - ;r25:r22 = value, r20 = base, r18 = digits - clr r31 ;r31 = stack level - ldi r30, ' ' ;r30 = sign - ldi r19, ' ' ;r19 = filler - sbrs r20, 7 ;When base indicates signd format and the value - rjmp 0f ;is minus, add a '-'. - neg r20 ; - sbrs r25, 7 ; - rjmp 0f ; - ldi r30, '-' ; - com r22 ; - com r23 ; - com r24 ; - com r25 ; - adc r22, r1 ; - adc r23, r1 ; - adc r24, r1 ; - adc r25, r1 ;/ -0: sbrs r18, 7 ;When digits indicates zero filled, - rjmp 1f ;filler is '0'. - neg r18 ; - ldi r19, '0' ;/ - ;----- string conversion loop -1: ldi r21, 32 ;r26 = r25:r22 % r20 - clr r26 ;r25:r22 /= r20 -2: lsl r22 ; - rol r23 ; - rol r24 ; - rol r25 ; - rol r26 ; - cp r26, r20 ; - brcs 3f ; - sub r26, r20 ; - inc r22 ; -3: dec r21 ; - brne 2b ;/ - cpi r26, 10 ;r26 is a numeral digit '0'-'F' - brcs 4f ; - subi r26, -7 ; -4: subi r26, -'0' ;/ - push r26 ;Stack it - inc r31 ;/ - cp r22, r1 ;Repeat until r25:r22 gets zero - cpc r23, r1 ; - cpc r24, r1 ; - cpc r25, r1 ; - brne 1b ;/ - - cpi r30, '-' ;Minus sign if needed - brne 5f ; - push r30 ; - inc r31 ;/ -5: cp r31, r18 ;Filler - brcc 6f ; - push r19 ; - inc r31 ; - rjmp 5b ;/ - -6: pop r24 ;Flush stacked digits and exit - rcall xputc ; - dec r31 ; - brne 6b ;/ - - ret -.endfunc - - - -;---------------------------------------------------------------------------; -; Formatted string output (16/32bit version) -; -;Prototype: -; void __xprintf (const char *format_p, ...); -; void __xsprintf(char*, const char *format_p, ...); -; void __xfprintf(void(*func)(char), const char *format_p, ...); -; - -#if USE_XPRINTF - -.func xvprintf -xvprintf: - ld ZL, Y+ ;Z = pointer to format string - ld ZH, Y+ ;/ - -0: _LPMI r24 ;Get a format char - cpi r24, 0 ;End of format string? - breq 90f ;/ - cpi r24, '%' ;Is format? - breq 20f ;/ -1: rcall xputc ;Put a normal character - rjmp 0b ;/ -90: ret - -20: ldi r18, 0 ;r18: digits - clt ;T: filler - _LPMI r21 ;Get flags - cpi r21, '%' ;Is a %? - breq 1b ;/ - cpi r21, '0' ;Zero filled? - brne 23f ; - set ;/ -22: _LPMI r21 ;Get width -23: cpi r21, '9'+1 ; - brcc 24f ; - subi r21, '0' ; - brcs 90b ; - lsl r18 ; - mov r0, r18 ; - lsl r18 ; - lsl r18 ; - add r18, r0 ; - add r18, r21 ; - rjmp 22b ;/ - -24: brtc 25f ;get value (low word) - neg r18 ; -25: ld r24, Y+ ; - ld r25, Y+ ;/ - cpi r21, 'c' ;Is type character? - breq 1b ;/ - cpi r21, 's' ;Is type RAM string? - breq 50f ;/ - cpi r21, 'S' ;Is type ROM string? - breq 60f ;/ - _MOVW r23,r22,r25,r24 ;r25:r22 = value - clr r24 ; - clr r25 ; - clt ;/ - cpi r21, 'l' ;Is long int? - brne 26f ; - ld r24, Y+ ;get value (high word) - ld r25, Y+ ; - set ; - _LPMI r21 ;/ -26: cpi r21, 'd' ;Is type signed decimal? - brne 27f ;/ - ldi r20, -10 ; - brts 40f ; - sbrs r23, 7 ; - rjmp 40f ; - ldi r24, -1 ; - ldi r25, -1 ; - rjmp 40f ;/ -27: cpi r21, 'u' ;Is type unsigned decimal? - ldi r20, 10 ; - breq 40f ;/ - cpi r21, 'X' ;Is type hexdecimal? - ldi r20, 16 ; - breq 40f ;/ - cpi r21, 'b' ;Is type binary? - ldi r20, 2 ; - breq 40f ;/ - ret ;abort -40: push ZH ;Output the value - push ZL ; - rcall xitoa ; -42: pop ZL ; - pop ZH ; - rjmp 0b ;/ - -50: push ZH ;Put a string on the RAM - push ZL - _MOVW ZH,ZL, r25,r24 -51: ld r24, Z+ - cpi r24, 0 - breq 42b - rcall xputc - rjmp 51b - -60: push ZH ;Put a string on the ROM - push ZL - rcall xputs - rjmp 42b -.endfunc - - -.func __xprintf -.global __xprintf -__xprintf: - push YH - push YL - in YL, _SFR_IO_ADDR(SPL) -#ifdef SPH - in YH, _SFR_IO_ADDR(SPH) -#else - clr YH -#endif - adiw YL, 5 ;Y = pointer to arguments - rcall xvprintf - pop YL - pop YH - ret -.endfunc - - -#if USE_XSPRINTF - -.func __xsprintf -putram: - _MOVW ZH,ZL, r15,r14 - st Z+, r24 - _MOVW r15,r14, ZH,ZL - ret -.global __xsprintf -__xsprintf: - push YH - push YL - in YL, _SFR_IO_ADDR(SPL) -#ifdef SPH - in YH, _SFR_IO_ADDR(SPH) -#else - clr YH -#endif - adiw YL, 5 ;Y = pointer to arguments - lds ZL, xfunc_out+0 ;Save registered output function - lds ZH, xfunc_out+1 ; - push ZL ; - push ZH ;/ - ldi ZL, lo8(pm(putram));Set local output function - ldi ZH, hi8(pm(putram)); - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - push r15 ;Initialize pointer to string buffer - push r14 ; - ld r14, Y+ ; - ld r15, Y+ ;/ - rcall xvprintf - _MOVW ZH,ZL, r15,r14 ;Terminate string - st Z, r1 ; - pop r14 ; - pop r15 ;/ - pop ZH ;Restore registered output function - pop ZL ; - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - pop YL - pop YH - ret -.endfunc -#endif - - -#if USE_XFPRINTF -.func __xfprintf -.global __xfprintf -__xfprintf: - push YH - push YL - in YL, _SFR_IO_ADDR(SPL) -#ifdef SPH - in YH, _SFR_IO_ADDR(SPH) -#else - clr YH -#endif - adiw YL, 5 ;Y = pointer to arguments - lds ZL, xfunc_out+0 ;Save registered output function - lds ZH, xfunc_out+1 ; - push ZL ; - push ZH ;/ - ld ZL, Y+ ;Set output function - ld ZH, Y+ ; - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - rcall xvprintf - pop ZH ;Restore registered output function - pop ZL ; - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - pop YL - pop YH - ret -.endfunc -#endif - -#endif - - - -;--------------------------------------------------------------------------- -; Extended numeral string input -; -;Prototype: -; char xatoi ( /* 1: Successful, 0: Failed */ -; const char **str, /* pointer to pointer to source string */ -; long *res /* result */ -; ); -; - - -#if USE_XATOI -.func xatoi -.global xatoi -xatoi: - _MOVW r1, r0, r23, r22 - _MOVW XH, XL, r25, r24 - ld ZL, X+ - ld ZH, X+ - clr r18 ;r21:r18 = 0; - clr r19 ; - clr r20 ; - clr r21 ;/ - clt ;T = 0; - - ldi r25, 10 ;r25 = 10; - rjmp 41f ;/ -40: adiw ZL, 1 ;Z++; -41: ld r22, Z ;r22 = *Z; - cpi r22, ' ' ;if(r22 == ' ') continue - breq 40b ;/ - brcs 70f ;if(r22 < ' ') error; - cpi r22, '-' ;if(r22 == '-') { - brne 42f ; T = 1; - set ; continue; - rjmp 40b ;} -42: cpi r22, '9'+1 ;if(r22 > '9') error; - brcc 70f ;/ - cpi r22, '0' ;if(r22 < '0') error; - brcs 70f ;/ - brne 51f ;if(r22 > '0') cv_start; - ldi r25, 8 ;r25 = 8; - adiw ZL, 1 ;r22 = *(++Z); - ld r22, Z ;/ - cpi r22, ' '+1 ;if(r22 <= ' ') exit; - brcs 80f ;/ - cpi r22, 'b' ;if(r22 == 'b') { - brne 43f ; r25 = 2; - ldi r25, 2 ; cv_start; - rjmp 50f ;} -43: cpi r22, 'x' ;if(r22 != 'x') error; - brne 51f ;/ - ldi r25, 16 ;r25 = 16; - -50: adiw ZL, 1 ;Z++; - ld r22, Z ;r22 = *Z; -51: cpi r22, ' '+1 ;if(r22 <= ' ') break; - brcs 80f ;/ - cpi r22, 'a' ;if(r22 >= 'a') r22 =- 0x20; - brcs 52f ; - subi r22, 0x20 ;/ -52: subi r22, '0' ;if((r22 -= '0') < 0) error; - brcs 70f ;/ - cpi r22, 10 ;if(r22 >= 10) { - brcs 53f ; r22 -= 7; - subi r22, 7 ; if(r22 < 10) - cpi r22, 10 ; - brcs 70f ;} -53: cp r22, r25 ;if(r22 >= r25) error; - brcc 70f ;/ -60: ldi r24, 33 ;r21:r18 *= r25; - sub r23, r23 ; -61: brcc 62f ; - add r23, r25 ; -62: lsr r23 ; - ror r21 ; - ror r20 ; - ror r19 ; - ror r18 ; - dec r24 ; - brne 61b ;/ - add r18, r22 ;r21:r18 += r22; - adc r19, r24 ; - adc r20, r24 ; - adc r21, r24 ;/ - rjmp 50b ;repeat - -70: ldi r24, 0 - rjmp 81f -80: ldi r24, 1 -81: brtc 82f - clr r22 - com r18 - com r19 - com r20 - com r21 - adc r18, r22 - adc r19, r22 - adc r20, r22 - adc r21, r22 -82: st -X, ZH - st -X, ZL - _MOVW XH, XL, r1, r0 - st X+, r18 - st X+, r19 - st X+, r20 - st X+, r21 - clr r1 - ret -.endfunc -#endif - - +;---------------------------------------------------------------------------; +; Extended itoa, puts, printf and atoi (C)ChaN, 2011 +;---------------------------------------------------------------------------; + + // Base size is 152 bytes +#define CR_CRLF 0 // Convert \n to \r\n (+10 bytes) +#define USE_XPRINTF 1 // Enable xprintf function (+194 bytes) +#define USE_XSPRINTF 0 // Add xsprintf function (+78 bytes) +#define USE_XFPRINTF 0 // Add xfprintf function (+54 bytes) +#define USE_XATOI 0 // Enable xatoi function (+182 bytes) + + +#if FLASHEND > 0x1FFFF +#error xitoa module does not support 256K devices +#endif + +.nolist +#include // Include device specific definitions. +.list + +#ifdef SPM_PAGESIZE // Recent devices have "lpm Rd,Z+" and "movw". +.macro _LPMI reg + lpm \reg, Z+ +.endm +.macro _MOVW dh,dl, sh,sl + movw \dl, \sl +.endm +#else // Earlier devices do not have "lpm Rd,Z+" nor "movw". +.macro _LPMI reg + lpm + mov \reg, r0 + adiw ZL, 1 +.endm +.macro _MOVW dh,dl, sh,sl + mov \dl, \sl + mov \dh, \sh +.endm +#endif + + + +;--------------------------------------------------------------------------- +; Stub function to forward to user output function +; +;Prototype: void xputc (char chr // a character to be output +; ); +;Size: 12/12 words + +.section .bss +.global xfunc_out ; xfunc_out must be initialized before using this module. +xfunc_out: .ds.w 1 +.section .text + + +.func xputc +.global xputc +xputc: +#if CR_CRLF + cpi r24, 10 ;LF --> CRLF + brne 1f ; + ldi r24, 13 ; + rcall 1f ; + ldi r24, 10 ;/ +1: +#endif + push ZH + push ZL + lds ZL, xfunc_out+0 ;Pointer to the registered output function. + lds ZH, xfunc_out+1 ;/ + sbiw ZL, 0 ;Skip if null + breq 2f ;/ + icall +2: pop ZL + pop ZH + ret +.endfunc + + + +;--------------------------------------------------------------------------- +; Direct ROM string output +; +;Prototype: void xputs (const char *str_p // rom string to be output +; ); + +.func xputs +.global xputs +xputs: + _MOVW ZH,ZL, r25,r24 ; Z = pointer to rom string +1: _LPMI r24 + cpi r24, 0 + breq 2f + rcall xputc + rjmp 1b +2: ret +.endfunc + + +;--------------------------------------------------------------------------- +; Extended direct numeral string output (32bit version) +; +;Prototype: void xitoa (long value, // value to be output +; char radix, // radix +; char width); // minimum width +; + +.func xitoa +.global xitoa +xitoa: + ;r25:r22 = value, r20 = base, r18 = digits + clr r31 ;r31 = stack level + ldi r30, ' ' ;r30 = sign + ldi r19, ' ' ;r19 = filler + sbrs r20, 7 ;When base indicates signd format and the value + rjmp 0f ;is minus, add a '-'. + neg r20 ; + sbrs r25, 7 ; + rjmp 0f ; + ldi r30, '-' ; + com r22 ; + com r23 ; + com r24 ; + com r25 ; + adc r22, r1 ; + adc r23, r1 ; + adc r24, r1 ; + adc r25, r1 ;/ +0: sbrs r18, 7 ;When digits indicates zero filled, + rjmp 1f ;filler is '0'. + neg r18 ; + ldi r19, '0' ;/ + ;----- string conversion loop +1: ldi r21, 32 ;r26 = r25:r22 % r20 + clr r26 ;r25:r22 /= r20 +2: lsl r22 ; + rol r23 ; + rol r24 ; + rol r25 ; + rol r26 ; + cp r26, r20 ; + brcs 3f ; + sub r26, r20 ; + inc r22 ; +3: dec r21 ; + brne 2b ;/ + cpi r26, 10 ;r26 is a numeral digit '0'-'F' + brcs 4f ; + subi r26, -7 ; +4: subi r26, -'0' ;/ + push r26 ;Stack it + inc r31 ;/ + cp r22, r1 ;Repeat until r25:r22 gets zero + cpc r23, r1 ; + cpc r24, r1 ; + cpc r25, r1 ; + brne 1b ;/ + + cpi r30, '-' ;Minus sign if needed + brne 5f ; + push r30 ; + inc r31 ;/ +5: cp r31, r18 ;Filler + brcc 6f ; + push r19 ; + inc r31 ; + rjmp 5b ;/ + +6: pop r24 ;Flush stacked digits and exit + rcall xputc ; + dec r31 ; + brne 6b ;/ + + ret +.endfunc + + + +;---------------------------------------------------------------------------; +; Formatted string output (16/32bit version) +; +;Prototype: +; void __xprintf (const char *format_p, ...); +; void __xsprintf(char*, const char *format_p, ...); +; void __xfprintf(void(*func)(char), const char *format_p, ...); +; + +#if USE_XPRINTF + +.func xvprintf +xvprintf: + ld ZL, Y+ ;Z = pointer to format string + ld ZH, Y+ ;/ + +0: _LPMI r24 ;Get a format char + cpi r24, 0 ;End of format string? + breq 90f ;/ + cpi r24, '%' ;Is format? + breq 20f ;/ +1: rcall xputc ;Put a normal character + rjmp 0b ;/ +90: ret + +20: ldi r18, 0 ;r18: digits + clt ;T: filler + _LPMI r21 ;Get flags + cpi r21, '%' ;Is a %? + breq 1b ;/ + cpi r21, '0' ;Zero filled? + brne 23f ; + set ;/ +22: _LPMI r21 ;Get width +23: cpi r21, '9'+1 ; + brcc 24f ; + subi r21, '0' ; + brcs 90b ; + lsl r18 ; + mov r0, r18 ; + lsl r18 ; + lsl r18 ; + add r18, r0 ; + add r18, r21 ; + rjmp 22b ;/ + +24: brtc 25f ;get value (low word) + neg r18 ; +25: ld r24, Y+ ; + ld r25, Y+ ;/ + cpi r21, 'c' ;Is type character? + breq 1b ;/ + cpi r21, 's' ;Is type RAM string? + breq 50f ;/ + cpi r21, 'S' ;Is type ROM string? + breq 60f ;/ + _MOVW r23,r22,r25,r24 ;r25:r22 = value + clr r24 ; + clr r25 ; + clt ;/ + cpi r21, 'l' ;Is long int? + brne 26f ; + ld r24, Y+ ;get value (high word) + ld r25, Y+ ; + set ; + _LPMI r21 ;/ +26: cpi r21, 'd' ;Is type signed decimal? + brne 27f ;/ + ldi r20, -10 ; + brts 40f ; + sbrs r23, 7 ; + rjmp 40f ; + ldi r24, -1 ; + ldi r25, -1 ; + rjmp 40f ;/ +27: cpi r21, 'u' ;Is type unsigned decimal? + ldi r20, 10 ; + breq 40f ;/ + cpi r21, 'X' ;Is type hexdecimal? + ldi r20, 16 ; + breq 40f ;/ + cpi r21, 'b' ;Is type binary? + ldi r20, 2 ; + breq 40f ;/ + ret ;abort +40: push ZH ;Output the value + push ZL ; + rcall xitoa ; +42: pop ZL ; + pop ZH ; + rjmp 0b ;/ + +50: push ZH ;Put a string on the RAM + push ZL + _MOVW ZH,ZL, r25,r24 +51: ld r24, Z+ + cpi r24, 0 + breq 42b + rcall xputc + rjmp 51b + +60: push ZH ;Put a string on the ROM + push ZL + rcall xputs + rjmp 42b +.endfunc + + +.func __xprintf +.global __xprintf +__xprintf: + push YH + push YL + in YL, _SFR_IO_ADDR(SPL) +#ifdef SPH + in YH, _SFR_IO_ADDR(SPH) +#else + clr YH +#endif + adiw YL, 5 ;Y = pointer to arguments + rcall xvprintf + pop YL + pop YH + ret +.endfunc + + +#if USE_XSPRINTF + +.func __xsprintf +putram: + _MOVW ZH,ZL, r15,r14 + st Z+, r24 + _MOVW r15,r14, ZH,ZL + ret +.global __xsprintf +__xsprintf: + push YH + push YL + in YL, _SFR_IO_ADDR(SPL) +#ifdef SPH + in YH, _SFR_IO_ADDR(SPH) +#else + clr YH +#endif + adiw YL, 5 ;Y = pointer to arguments + lds ZL, xfunc_out+0 ;Save registered output function + lds ZH, xfunc_out+1 ; + push ZL ; + push ZH ;/ + ldi ZL, lo8(pm(putram));Set local output function + ldi ZH, hi8(pm(putram)); + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + push r15 ;Initialize pointer to string buffer + push r14 ; + ld r14, Y+ ; + ld r15, Y+ ;/ + rcall xvprintf + _MOVW ZH,ZL, r15,r14 ;Terminate string + st Z, r1 ; + pop r14 ; + pop r15 ;/ + pop ZH ;Restore registered output function + pop ZL ; + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + pop YL + pop YH + ret +.endfunc +#endif + + +#if USE_XFPRINTF +.func __xfprintf +.global __xfprintf +__xfprintf: + push YH + push YL + in YL, _SFR_IO_ADDR(SPL) +#ifdef SPH + in YH, _SFR_IO_ADDR(SPH) +#else + clr YH +#endif + adiw YL, 5 ;Y = pointer to arguments + lds ZL, xfunc_out+0 ;Save registered output function + lds ZH, xfunc_out+1 ; + push ZL ; + push ZH ;/ + ld ZL, Y+ ;Set output function + ld ZH, Y+ ; + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + rcall xvprintf + pop ZH ;Restore registered output function + pop ZL ; + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + pop YL + pop YH + ret +.endfunc +#endif + +#endif + + + +;--------------------------------------------------------------------------- +; Extended numeral string input +; +;Prototype: +; char xatoi ( /* 1: Successful, 0: Failed */ +; const char **str, /* pointer to pointer to source string */ +; long *res /* result */ +; ); +; + + +#if USE_XATOI +.func xatoi +.global xatoi +xatoi: + _MOVW r1, r0, r23, r22 + _MOVW XH, XL, r25, r24 + ld ZL, X+ + ld ZH, X+ + clr r18 ;r21:r18 = 0; + clr r19 ; + clr r20 ; + clr r21 ;/ + clt ;T = 0; + + ldi r25, 10 ;r25 = 10; + rjmp 41f ;/ +40: adiw ZL, 1 ;Z++; +41: ld r22, Z ;r22 = *Z; + cpi r22, ' ' ;if(r22 == ' ') continue + breq 40b ;/ + brcs 70f ;if(r22 < ' ') error; + cpi r22, '-' ;if(r22 == '-') { + brne 42f ; T = 1; + set ; continue; + rjmp 40b ;} +42: cpi r22, '9'+1 ;if(r22 > '9') error; + brcc 70f ;/ + cpi r22, '0' ;if(r22 < '0') error; + brcs 70f ;/ + brne 51f ;if(r22 > '0') cv_start; + ldi r25, 8 ;r25 = 8; + adiw ZL, 1 ;r22 = *(++Z); + ld r22, Z ;/ + cpi r22, ' '+1 ;if(r22 <= ' ') exit; + brcs 80f ;/ + cpi r22, 'b' ;if(r22 == 'b') { + brne 43f ; r25 = 2; + ldi r25, 2 ; cv_start; + rjmp 50f ;} +43: cpi r22, 'x' ;if(r22 != 'x') error; + brne 51f ;/ + ldi r25, 16 ;r25 = 16; + +50: adiw ZL, 1 ;Z++; + ld r22, Z ;r22 = *Z; +51: cpi r22, ' '+1 ;if(r22 <= ' ') break; + brcs 80f ;/ + cpi r22, 'a' ;if(r22 >= 'a') r22 =- 0x20; + brcs 52f ; + subi r22, 0x20 ;/ +52: subi r22, '0' ;if((r22 -= '0') < 0) error; + brcs 70f ;/ + cpi r22, 10 ;if(r22 >= 10) { + brcs 53f ; r22 -= 7; + subi r22, 7 ; if(r22 < 10) + cpi r22, 10 ; + brcs 70f ;} +53: cp r22, r25 ;if(r22 >= r25) error; + brcc 70f ;/ +60: ldi r24, 33 ;r21:r18 *= r25; + sub r23, r23 ; +61: brcc 62f ; + add r23, r25 ; +62: lsr r23 ; + ror r21 ; + ror r20 ; + ror r19 ; + ror r18 ; + dec r24 ; + brne 61b ;/ + add r18, r22 ;r21:r18 += r22; + adc r19, r24 ; + adc r20, r24 ; + adc r21, r24 ;/ + rjmp 50b ;repeat + +70: ldi r24, 0 + rjmp 81f +80: ldi r24, 1 +81: brtc 82f + clr r22 + com r18 + com r19 + com r20 + com r21 + adc r18, r22 + adc r19, r22 + adc r20, r22 + adc r21, r22 +82: st -X, ZH + st -X, ZL + _MOVW XH, XL, r1, r0 + st X+, r18 + st X+, r19 + st X+, r20 + st X+, r21 + clr r1 + ret +.endfunc +#endif + + diff --git a/tmk_core/common/avr/xprintf.h b/tmk_core/common/avr/xprintf.h index 59c6f2531..e53c0dd8e 100644 --- a/tmk_core/common/avr/xprintf.h +++ b/tmk_core/common/avr/xprintf.h @@ -1,111 +1,111 @@ -/*--------------------------------------------------------------------------- - Extended itoa, puts and printf (C)ChaN, 2011 ------------------------------------------------------------------------------*/ - -#ifndef XPRINTF_H -#define XPRINTF_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern void (*xfunc_out)(uint8_t); -#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func) - -/* This is a pointer to user defined output function. It must be initialized - before using this modle. -*/ - -void xputc(char chr); - -/* This is a stub function to forward outputs to user defined output function. - All outputs from this module are output via this function. -*/ - - -/*-----------------------------------------------------------------------------*/ -void xputs(const char *string_p); - -/* The string placed in the ROM is forwarded to xputc() directly. -*/ - - -/*-----------------------------------------------------------------------------*/ -void xitoa(long value, char radix, char width); - -/* Extended itoa(). - - value radix width output - 100 10 6 " 100" - 100 10 -6 "000100" - 100 10 0 "100" - 4294967295 10 0 "4294967295" - 4294967295 -10 0 "-1" - 655360 16 -8 "000A0000" - 1024 16 0 "400" - 0x55 2 -8 "01010101" -*/ - - -/*-----------------------------------------------------------------------------*/ -#define xprintf(format, ...) __xprintf(PSTR(format), ##__VA_ARGS__) -#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__) -#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__) - -void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */ -void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */ -void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */ - -/* Format string is placed in the ROM. The format flags is similar to printf(). - - %[flag][width][size]type - - flag - A '0' means filled with '0' when output is shorter than width. - ' ' is used in default. This is effective only numeral type. - width - Minimum width in decimal number. This is effective only numeral type. - Default width is zero. - size - A 'l' means the argument is long(32bit). Default is short(16bit). - This is effective only numeral type. - type - 'c' : Character, argument is the value - 's' : String placed on the RAM, argument is the pointer - 'S' : String placed on the ROM, argument is the pointer - 'd' : Signed decimal, argument is the value - 'u' : Unsigned decimal, argument is the value - 'X' : Hexdecimal, argument is the value - 'b' : Binary, argument is the value - '%' : '%' - -*/ - - -/*-----------------------------------------------------------------------------*/ -char xatoi(char **str, long *ret); - -/* Get value of the numeral string. - - str - Pointer to pointer to source string - - "0b11001010" binary - "0377" octal - "0xff800" hexdecimal - "1250000" decimal - "-25000" decimal - - ret - Pointer to return value -*/ - -#ifdef __cplusplus -} -#endif - -#endif - +/*--------------------------------------------------------------------------- + Extended itoa, puts and printf (C)ChaN, 2011 +-----------------------------------------------------------------------------*/ + +#ifndef XPRINTF_H +#define XPRINTF_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern void (*xfunc_out)(uint8_t); +#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func) + +/* This is a pointer to user defined output function. It must be initialized + before using this modle. +*/ + +void xputc(char chr); + +/* This is a stub function to forward outputs to user defined output function. + All outputs from this module are output via this function. +*/ + + +/*-----------------------------------------------------------------------------*/ +void xputs(const char *string_p); + +/* The string placed in the ROM is forwarded to xputc() directly. +*/ + + +/*-----------------------------------------------------------------------------*/ +void xitoa(long value, char radix, char width); + +/* Extended itoa(). + + value radix width output + 100 10 6 " 100" + 100 10 -6 "000100" + 100 10 0 "100" + 4294967295 10 0 "4294967295" + 4294967295 -10 0 "-1" + 655360 16 -8 "000A0000" + 1024 16 0 "400" + 0x55 2 -8 "01010101" +*/ + + +/*-----------------------------------------------------------------------------*/ +#define xprintf(format, ...) __xprintf(PSTR(format), ##__VA_ARGS__) +#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__) +#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__) + +void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */ +void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */ +void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */ + +/* Format string is placed in the ROM. The format flags is similar to printf(). + + %[flag][width][size]type + + flag + A '0' means filled with '0' when output is shorter than width. + ' ' is used in default. This is effective only numeral type. + width + Minimum width in decimal number. This is effective only numeral type. + Default width is zero. + size + A 'l' means the argument is long(32bit). Default is short(16bit). + This is effective only numeral type. + type + 'c' : Character, argument is the value + 's' : String placed on the RAM, argument is the pointer + 'S' : String placed on the ROM, argument is the pointer + 'd' : Signed decimal, argument is the value + 'u' : Unsigned decimal, argument is the value + 'X' : Hexdecimal, argument is the value + 'b' : Binary, argument is the value + '%' : '%' + +*/ + + +/*-----------------------------------------------------------------------------*/ +char xatoi(char **str, long *ret); + +/* Get value of the numeral string. + + str + Pointer to pointer to source string + + "0b11001010" binary + "0377" octal + "0xff800" hexdecimal + "1250000" decimal + "-25000" decimal + + ret + Pointer to return value +*/ + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 084c9fe15..476fc6fe3 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -34,6 +34,7 @@ along with this program. If not, see . #include "command.h" #include "backlight.h" #include "quantum.h" +#include "version.h" #ifdef MOUSEKEY_ENABLE #include "mousekey.h" @@ -180,7 +181,7 @@ static void print_version(void) print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " "VER: " STR(DEVICE_VER) "\n"); - print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n"); + print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); /* build options */ print("OPTIONS:" diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 0368bcd4a..a1352527f 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -29,7 +29,9 @@ #include #include "util.h" - +#if defined(PROTOCOL_CHIBIOS) +#define PSTR(x) x +#endif #ifndef NO_PRINT diff --git a/tmk_core/common/virtser.h b/tmk_core/common/virtser.h new file mode 100644 index 000000000..74891b6ae --- /dev/null +++ b/tmk_core/common/virtser.h @@ -0,0 +1,10 @@ +#ifndef _VIRTSER_H_ +#define _VIRTSER_H_ + +/* Define this function in your code to process incoming bytes */ +void virtser_recv(const uint8_t ch); + +/* Call this to send a character over the Virtual Serial Device */ +void virtser_send(const uint8_t byte); + +#endif diff --git a/tmk_core/native.mk b/tmk_core/native.mk new file mode 100644 index 000000000..50232ee9b --- /dev/null +++ b/tmk_core/native.mk @@ -0,0 +1,24 @@ +CC = gcc +OBJCOPY = +OBJDUMP = +SIZE = +AR = +NM = +HEX = +EEP = +BIN = + + +COMPILEFLAGS += -funsigned-char +COMPILEFLAGS += -funsigned-bitfields +COMPILEFLAGS += -ffunction-sections +COMPILEFLAGS += -fdata-sections +COMPILEFLAGS += -fshort-enums + +CFLAGS += $(COMPILEFLAGS) +CFLAGS += -fno-inline-small-functions +CFLAGS += -fno-strict-aliasing + +CPPFLAGS += $(COMPILEFLAGS) +CPPFLAGS += -fno-exceptions +CPPFLAGS += -std=gnu++11 \ No newline at end of file diff --git a/tmk_core/protocol/iwrap/suart.S b/tmk_core/protocol/iwrap/suart.S index 1b0290963..a873515e1 100644 --- a/tmk_core/protocol/iwrap/suart.S +++ b/tmk_core/protocol/iwrap/suart.S @@ -1,156 +1,156 @@ -;---------------------------------------------------------------------------; -; Software implemented UART module ; -; (C)ChaN, 2005 (http://elm-chan.org/) ; -;---------------------------------------------------------------------------; -; Bit rate settings: -; -; 1MHz 2MHz 4MHz 6MHz 8MHz 10MHz 12MHz 16MHz 20MHz -; 2.4kbps 138 - - - - - - - - -; 4.8kbps 68 138 - - - - - - - -; 9.6kbps 33 68 138 208 - - - - - -; 19.2kbps - 33 68 102 138 173 208 - - -; 38.4kbps - - 33 50 68 85 102 138 172 -; 57.6kbps - - 21 33 44 56 68 91 114 -; 115.2kbps - - - - 21 27 33 44 56 - -.nolist -#include -.list - -#define BPS 102 /* Bit delay. (see above table) */ -#define BIDIR 0 /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */ - -#define OUT_1 sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */ -#define OUT_0 cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */ -#define SKIP_IN_1 sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 1 */ -#define SKIP_IN_0 sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 0 */ - - - -#ifdef SPM_PAGESIZE -.macro _LPMI reg - lpm \reg, Z+ -.endm -.macro _MOVW dh,dl, sh,sl - movw \dl, \sl -.endm -#else -.macro _LPMI reg - lpm - mov \reg, r0 - adiw ZL, 1 -.endm -.macro _MOVW dh,dl, sh,sl - mov \dl, \sl - mov \dh, \sh -.endm -#endif - - - -;---------------------------------------------------------------------------; -; Transmit a byte in serial format of N81 -; -;Prototype: void xmit (uint8_t data); -;Size: 16 words - -.global xmit -.func xmit -xmit: -#if BIDIR - ldi r23, BPS-1 ;Pre-idle time for bidirectional data line -5: dec r23 ; - brne 5b ;/ -#endif - in r0, _SFR_IO_ADDR(SREG) ;Save flags - - com r24 ;C = start bit - ldi r25, 10 ;Bit counter - cli ;Start critical section - -1: ldi r23, BPS-1 ;----- Bit transferring loop -2: dec r23 ;Wait for a bit time - brne 2b ;/ - brcs 3f ;MISO = bit to be sent - OUT_1 ; -3: brcc 4f ; - OUT_0 ;/ -4: lsr r24 ;Get next bit into C - dec r25 ;All bits sent? - brne 1b ; no, coutinue - - out _SFR_IO_ADDR(SREG), r0 ;End of critical section - ret -.endfunc - - - -;---------------------------------------------------------------------------; -; Receive a byte -; -;Prototype: uint8_t rcvr (void); -;Size: 19 words - -.global rcvr -.func rcvr -rcvr: - in r0, _SFR_IO_ADDR(SREG) ;Save flags - - ldi r24, 0x80 ;Receiving shift reg - cli ;Start critical section - -1: SKIP_IN_1 ;Wait for idle - rjmp 1b -2: SKIP_IN_0 ;Wait for start bit - rjmp 2b - ldi r25, BPS/2 ;Wait for half bit time -3: dec r25 - brne 3b - -4: ldi r25, BPS ;----- Bit receiving loop -5: dec r25 ;Wait for a bit time - brne 5b ;/ - lsr r24 ;Next bit - SKIP_IN_0 ;Get a data bit into r24.7 - ori r24, 0x80 - brcc 4b ;All bits received? no, continue - - out _SFR_IO_ADDR(SREG), r0 ;End of critical section - ret -.endfunc - - -; Not wait for start bit. This should be called after detecting start bit. -.global recv -.func recv -recv: - in r0, _SFR_IO_ADDR(SREG) ;Save flags - - ldi r24, 0x80 ;Receiving shift reg - cli ;Start critical section - -;1: SKIP_IN_1 ;Wait for idle -; rjmp 1b -;2: SKIP_IN_0 ;Wait for start bit -; rjmp 2b - ldi r25, BPS/2 ;Wait for half bit time -3: dec r25 - brne 3b - -4: ldi r25, BPS ;----- Bit receiving loop -5: dec r25 ;Wait for a bit time - brne 5b ;/ - lsr r24 ;Next bit - SKIP_IN_0 ;Get a data bit into r24.7 - ori r24, 0x80 - brcc 4b ;All bits received? no, continue - - ldi r25, BPS/2 ;Wait for half bit time -6: dec r25 - brne 6b -7: SKIP_IN_1 ;Wait for stop bit - rjmp 7b - - out _SFR_IO_ADDR(SREG), r0 ;End of critical section - ret -.endfunc +;---------------------------------------------------------------------------; +; Software implemented UART module ; +; (C)ChaN, 2005 (http://elm-chan.org/) ; +;---------------------------------------------------------------------------; +; Bit rate settings: +; +; 1MHz 2MHz 4MHz 6MHz 8MHz 10MHz 12MHz 16MHz 20MHz +; 2.4kbps 138 - - - - - - - - +; 4.8kbps 68 138 - - - - - - - +; 9.6kbps 33 68 138 208 - - - - - +; 19.2kbps - 33 68 102 138 173 208 - - +; 38.4kbps - - 33 50 68 85 102 138 172 +; 57.6kbps - - 21 33 44 56 68 91 114 +; 115.2kbps - - - - 21 27 33 44 56 + +.nolist +#include +.list + +#define BPS 102 /* Bit delay. (see above table) */ +#define BIDIR 0 /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */ + +#define OUT_1 sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */ +#define OUT_0 cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */ +#define SKIP_IN_1 sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 1 */ +#define SKIP_IN_0 sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 0 */ + + + +#ifdef SPM_PAGESIZE +.macro _LPMI reg + lpm \reg, Z+ +.endm +.macro _MOVW dh,dl, sh,sl + movw \dl, \sl +.endm +#else +.macro _LPMI reg + lpm + mov \reg, r0 + adiw ZL, 1 +.endm +.macro _MOVW dh,dl, sh,sl + mov \dl, \sl + mov \dh, \sh +.endm +#endif + + + +;---------------------------------------------------------------------------; +; Transmit a byte in serial format of N81 +; +;Prototype: void xmit (uint8_t data); +;Size: 16 words + +.global xmit +.func xmit +xmit: +#if BIDIR + ldi r23, BPS-1 ;Pre-idle time for bidirectional data line +5: dec r23 ; + brne 5b ;/ +#endif + in r0, _SFR_IO_ADDR(SREG) ;Save flags + + com r24 ;C = start bit + ldi r25, 10 ;Bit counter + cli ;Start critical section + +1: ldi r23, BPS-1 ;----- Bit transferring loop +2: dec r23 ;Wait for a bit time + brne 2b ;/ + brcs 3f ;MISO = bit to be sent + OUT_1 ; +3: brcc 4f ; + OUT_0 ;/ +4: lsr r24 ;Get next bit into C + dec r25 ;All bits sent? + brne 1b ; no, coutinue + + out _SFR_IO_ADDR(SREG), r0 ;End of critical section + ret +.endfunc + + + +;---------------------------------------------------------------------------; +; Receive a byte +; +;Prototype: uint8_t rcvr (void); +;Size: 19 words + +.global rcvr +.func rcvr +rcvr: + in r0, _SFR_IO_ADDR(SREG) ;Save flags + + ldi r24, 0x80 ;Receiving shift reg + cli ;Start critical section + +1: SKIP_IN_1 ;Wait for idle + rjmp 1b +2: SKIP_IN_0 ;Wait for start bit + rjmp 2b + ldi r25, BPS/2 ;Wait for half bit time +3: dec r25 + brne 3b + +4: ldi r25, BPS ;----- Bit receiving loop +5: dec r25 ;Wait for a bit time + brne 5b ;/ + lsr r24 ;Next bit + SKIP_IN_0 ;Get a data bit into r24.7 + ori r24, 0x80 + brcc 4b ;All bits received? no, continue + + out _SFR_IO_ADDR(SREG), r0 ;End of critical section + ret +.endfunc + + +; Not wait for start bit. This should be called after detecting start bit. +.global recv +.func recv +recv: + in r0, _SFR_IO_ADDR(SREG) ;Save flags + + ldi r24, 0x80 ;Receiving shift reg + cli ;Start critical section + +;1: SKIP_IN_1 ;Wait for idle +; rjmp 1b +;2: SKIP_IN_0 ;Wait for start bit +; rjmp 2b + ldi r25, BPS/2 ;Wait for half bit time +3: dec r25 + brne 3b + +4: ldi r25, BPS ;----- Bit receiving loop +5: dec r25 ;Wait for a bit time + brne 5b ;/ + lsr r24 ;Next bit + SKIP_IN_0 ;Get a data bit into r24.7 + ori r24, 0x80 + brcc 4b ;All bits received? no, continue + + ldi r25, BPS/2 ;Wait for half bit time +6: dec r25 + brne 6b +7: SKIP_IN_1 ;Wait for stop bit + rjmp 7b + + out _SFR_IO_ADDR(SREG), r0 ;End of critical section + ret +.endfunc diff --git a/tmk_core/protocol/iwrap/suart.h b/tmk_core/protocol/iwrap/suart.h index 72725b998..7d92be069 100644 --- a/tmk_core/protocol/iwrap/suart.h +++ b/tmk_core/protocol/iwrap/suart.h @@ -1,8 +1,8 @@ -#ifndef SUART -#define SUART - -void xmit(uint8_t); -uint8_t rcvr(void); -uint8_t recv(void); - -#endif /* SUART */ +#ifndef SUART +#define SUART + +void xmit(uint8_t); +uint8_t rcvr(void); +uint8_t recv(void); + +#endif /* SUART */ diff --git a/tmk_core/protocol/iwrap/wd.h b/tmk_core/protocol/iwrap/wd.h index 99058f033..12395bf69 100644 --- a/tmk_core/protocol/iwrap/wd.h +++ b/tmk_core/protocol/iwrap/wd.h @@ -1,159 +1,159 @@ -/* This is from http://www.mtcnet.net/~henryvm/wdt/ */ -#ifndef _AVR_WD_H_ -#define _AVR_WD_H_ - -#include - -/* -Copyright (c) 2009, Curt Van Maanen - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - -include usage- - #include "wd.h" //if in same directory as project - #include //if wd.h is in avr directory - -set watchdog modes and prescale - -usage- - WD_SET(mode,[timeout]); //prescale always set - -modes- - WD_OFF disabled - WD_RST normal reset mode - WD_IRQ interrupt only mode (if supported) - WD_RST_IRQ interrupt+reset mode (if supported) - -timeout- - WDTO_15MS default if no timeout provided - WDTO_30MS - WDTO_60MS - WDTO_120MS - WDTO_250MS - WDTO_500MS - WDTO_1S - WDTO_2S - WDTO_4S (if supported) - WDTO_8S (if supported) - -examples- - WD_SET(WD_RST,WDTO_1S); //reset mode, 1s timeout - WD_SET(WD_OFF); //watchdog disabled (if not fused on) - WD_SET(WD_RST); //reset mode, 15ms (default timeout) - WD_SET(WD_IRQ,WDTO_120MS); //interrupt only mode, 120ms timeout - WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout - - -for enhanced watchdogs, if the watchdog is not being used WDRF should be -cleared on every power up or reset, along with disabling the watchdog- - WD_DISABLE(); //clear WDRF, then turn off watchdog - -*/ - -//reset registers to the same name (MCUCSR) -#if !defined(MCUCSR) -#define MCUCSR MCUSR -#endif - -//watchdog registers to the same name (WDTCSR) -#if !defined(WDTCSR) -#define WDTCSR WDTCR -#endif - -//if enhanced watchdog, define irq values, create disable macro -#if defined(WDIF) -#define WD_IRQ 0xC0 -#define WD_RST_IRQ 0xC8 -#define WD_DISABLE() do{ \ - MCUCSR &= ~(1< + +/* +Copyright (c) 2009, Curt Van Maanen + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +include usage- + #include "wd.h" //if in same directory as project + #include //if wd.h is in avr directory + +set watchdog modes and prescale + +usage- + WD_SET(mode,[timeout]); //prescale always set + +modes- + WD_OFF disabled + WD_RST normal reset mode + WD_IRQ interrupt only mode (if supported) + WD_RST_IRQ interrupt+reset mode (if supported) + +timeout- + WDTO_15MS default if no timeout provided + WDTO_30MS + WDTO_60MS + WDTO_120MS + WDTO_250MS + WDTO_500MS + WDTO_1S + WDTO_2S + WDTO_4S (if supported) + WDTO_8S (if supported) + +examples- + WD_SET(WD_RST,WDTO_1S); //reset mode, 1s timeout + WD_SET(WD_OFF); //watchdog disabled (if not fused on) + WD_SET(WD_RST); //reset mode, 15ms (default timeout) + WD_SET(WD_IRQ,WDTO_120MS); //interrupt only mode, 120ms timeout + WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout + + +for enhanced watchdogs, if the watchdog is not being used WDRF should be +cleared on every power up or reset, along with disabling the watchdog- + WD_DISABLE(); //clear WDRF, then turn off watchdog + +*/ + +//reset registers to the same name (MCUCSR) +#if !defined(MCUCSR) +#define MCUCSR MCUSR +#endif + +//watchdog registers to the same name (WDTCSR) +#if !defined(WDTCSR) +#define WDTCSR WDTCR +#endif + +//if enhanced watchdog, define irq values, create disable macro +#if defined(WDIF) +#define WD_IRQ 0xC0 +#define WD_RST_IRQ 0xC8 +#define WD_DISABLE() do{ \ + MCUCSR &= ~(1< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml index 6f3312b76..f56aba69f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml @@ -1,156 +1,156 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml index 9394b1353..c67b9419e 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml @@ -1,123 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S index 6844d4b01..91fc94966 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S @@ -1,102 +1,102 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -#if AUX_BOOT_SECTION_SIZE > 0 -#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation). - -; Trampoline to jump over the AUX bootloader section to the start of the bootloader, -; on devices where an AUX bootloader section is used. -.section .boot_aux_trampoline, "ax" -.global Boot_AUX_Trampoline -Boot_AUX_Trampoline: - jmp BOOT_START_ADDR -#endif - -; Trampolines to actual API implementations if the target address is outside the -; range of a rjmp instruction (can happen with large bootloader sections) -.section .apitable_trampolines, "ax" -.global BootloaderAPI_Trampolines -BootloaderAPI_Trampolines: - - BootloaderAPI_ErasePage_Trampoline: - jmp BootloaderAPI_ErasePage - BootloaderAPI_WritePage_Trampoline: - jmp BootloaderAPI_WritePage - BootloaderAPI_FillWord_Trampoline: - jmp BootloaderAPI_FillWord - BootloaderAPI_ReadSignature_Trampoline: - jmp BootloaderAPI_ReadSignature - BootloaderAPI_ReadFuse_Trampoline: - jmp BootloaderAPI_ReadFuse - BootloaderAPI_ReadLock_Trampoline: - jmp BootloaderAPI_ReadLock - BootloaderAPI_WriteLock_Trampoline: - jmp BootloaderAPI_WriteLock - BootloaderAPI_UNUSED1: - ret - BootloaderAPI_UNUSED2: - ret - BootloaderAPI_UNUSED3: - ret - BootloaderAPI_UNUSED4: - ret - BootloaderAPI_UNUSED5: - ret - - - -; API function jump table -.section .apitable_jumptable, "ax" -.global BootloaderAPI_JumpTable -BootloaderAPI_JumpTable: - - rjmp BootloaderAPI_ErasePage_Trampoline - rjmp BootloaderAPI_WritePage_Trampoline - rjmp BootloaderAPI_FillWord_Trampoline - rjmp BootloaderAPI_ReadSignature_Trampoline - rjmp BootloaderAPI_ReadFuse_Trampoline - rjmp BootloaderAPI_ReadLock_Trampoline - rjmp BootloaderAPI_WriteLock_Trampoline - rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 - rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 - rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 - rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 - rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 - - - -; Bootloader table signatures and information -.section .apitable_signatures, "ax" -.global BootloaderAPI_Signatures -BootloaderAPI_Signatures: - - .long BOOT_START_ADDR ; Start address of the bootloader - .word 0xDF30 ; Signature for the MS class bootloader, V1 - .word 0xDCFB ; Signature for a LUFA class bootloader +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +#if AUX_BOOT_SECTION_SIZE > 0 +#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation). + +; Trampoline to jump over the AUX bootloader section to the start of the bootloader, +; on devices where an AUX bootloader section is used. +.section .boot_aux_trampoline, "ax" +.global Boot_AUX_Trampoline +Boot_AUX_Trampoline: + jmp BOOT_START_ADDR +#endif + +; Trampolines to actual API implementations if the target address is outside the +; range of a rjmp instruction (can happen with large bootloader sections) +.section .apitable_trampolines, "ax" +.global BootloaderAPI_Trampolines +BootloaderAPI_Trampolines: + + BootloaderAPI_ErasePage_Trampoline: + jmp BootloaderAPI_ErasePage + BootloaderAPI_WritePage_Trampoline: + jmp BootloaderAPI_WritePage + BootloaderAPI_FillWord_Trampoline: + jmp BootloaderAPI_FillWord + BootloaderAPI_ReadSignature_Trampoline: + jmp BootloaderAPI_ReadSignature + BootloaderAPI_ReadFuse_Trampoline: + jmp BootloaderAPI_ReadFuse + BootloaderAPI_ReadLock_Trampoline: + jmp BootloaderAPI_ReadLock + BootloaderAPI_WriteLock_Trampoline: + jmp BootloaderAPI_WriteLock + BootloaderAPI_UNUSED1: + ret + BootloaderAPI_UNUSED2: + ret + BootloaderAPI_UNUSED3: + ret + BootloaderAPI_UNUSED4: + ret + BootloaderAPI_UNUSED5: + ret + + + +; API function jump table +.section .apitable_jumptable, "ax" +.global BootloaderAPI_JumpTable +BootloaderAPI_JumpTable: + + rjmp BootloaderAPI_ErasePage_Trampoline + rjmp BootloaderAPI_WritePage_Trampoline + rjmp BootloaderAPI_FillWord_Trampoline + rjmp BootloaderAPI_ReadSignature_Trampoline + rjmp BootloaderAPI_ReadFuse_Trampoline + rjmp BootloaderAPI_ReadLock_Trampoline + rjmp BootloaderAPI_WriteLock_Trampoline + rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 + rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 + rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 + rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 + rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 + + + +; Bootloader table signatures and information +.section .apitable_signatures, "ax" +.global BootloaderAPI_Signatures +BootloaderAPI_Signatures: + + .long BOOT_START_ADDR ; Start address of the bootloader + .word 0xDF30 ; Signature for the MS class bootloader, V1 + .word 0xDCFB ; Signature for a LUFA class bootloader diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml index f1d550d1e..700ffa26f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml @@ -1,156 +1,156 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile index 91bb4038e..a0edb2c4f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile @@ -1,68 +1,68 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2014. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# -# -------------------------------------- -# LUFA Project Makefile. -# -------------------------------------- - -# Run "make help" for target help. - -MCU = at90usb1287 -ARCH = AVR8 -BOARD = USBKEY -F_CPU = 8000000 -F_USB = $(F_CPU) -OPTIMIZATION = s -TARGET = BootloaderMassStorage -SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) -LUFA_PATH = ../../LUFA -CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) - -# Flash size and bootloader section sizes of the target, in KB. These must -# match the target's total FLASH size and the bootloader size set in the -# device's fuses. -FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 8 - -# Bootloader address calculation formulas -# Do not modify these macros, but rather modify the dependent values above. -CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) -BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) -BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) - -# Bootloader linker section flags for relocating the API table sections to -# known FLASH addresses - these should not normally be user-edited. -BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) -BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) - -# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the -# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum -# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices. -ifeq ($(BOOT_SECTION_SIZE_KB),8) - CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0 -else - AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB)) - - CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)' - LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16)) - LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024) -endif - -# Default target -all: - -# Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa_core.mk -include $(LUFA_PATH)/Build/lufa_sources.mk -include $(LUFA_PATH)/Build/lufa_build.mk -include $(LUFA_PATH)/Build/lufa_cppcheck.mk -include $(LUFA_PATH)/Build/lufa_doxygen.mk -include $(LUFA_PATH)/Build/lufa_avrdude.mk -include $(LUFA_PATH)/Build/lufa_atprogram.mk +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = at90usb1287 +ARCH = AVR8 +BOARD = USBKEY +F_CPU = 8000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = BootloaderMassStorage +SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) +LUFA_PATH = ../../LUFA +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) + +# Flash size and bootloader section sizes of the target, in KB. These must +# match the target's total FLASH size and the bootloader size set in the +# device's fuses. +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 8 + +# Bootloader address calculation formulas +# Do not modify these macros, but rather modify the dependent values above. +CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) +BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) +BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) + +# Bootloader linker section flags for relocating the API table sections to +# known FLASH addresses - these should not normally be user-edited. +BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) +BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) + +# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the +# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum +# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices. +ifeq ($(BOOT_SECTION_SIZE_KB),8) + CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0 +else + AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB)) + + CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)' + LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16)) + LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024) +endif + +# Default target +all: + +# Include LUFA build script makefiles +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_sources.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_avrdude.mk +include $(LUFA_PATH)/Build/lufa_atprogram.mk diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S index ec499b74e..88c51da82 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S @@ -1,91 +1,91 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -; Trampolines to actual API implementations if the target address is outside the -; range of a rjmp instruction (can happen with large bootloader sections) -.section .apitable_trampolines, "ax" -.global BootloaderAPI_Trampolines -BootloaderAPI_Trampolines: - - BootloaderAPI_ErasePage_Trampoline: - jmp BootloaderAPI_ErasePage - BootloaderAPI_WritePage_Trampoline: - jmp BootloaderAPI_WritePage - BootloaderAPI_FillWord_Trampoline: - jmp BootloaderAPI_FillWord - BootloaderAPI_ReadSignature_Trampoline: - jmp BootloaderAPI_ReadSignature - BootloaderAPI_ReadFuse_Trampoline: - jmp BootloaderAPI_ReadFuse - BootloaderAPI_ReadLock_Trampoline: - jmp BootloaderAPI_ReadLock - BootloaderAPI_WriteLock_Trampoline: - jmp BootloaderAPI_WriteLock - BootloaderAPI_UNUSED1: - ret - BootloaderAPI_UNUSED2: - ret - BootloaderAPI_UNUSED3: - ret - BootloaderAPI_UNUSED4: - ret - BootloaderAPI_UNUSED5: - ret - - - -; API function jump table -.section .apitable_jumptable, "ax" -.global BootloaderAPI_JumpTable -BootloaderAPI_JumpTable: - - rjmp BootloaderAPI_ErasePage_Trampoline - rjmp BootloaderAPI_WritePage_Trampoline - rjmp BootloaderAPI_FillWord_Trampoline - rjmp BootloaderAPI_ReadSignature_Trampoline - rjmp BootloaderAPI_ReadFuse_Trampoline - rjmp BootloaderAPI_ReadLock_Trampoline - rjmp BootloaderAPI_WriteLock_Trampoline - rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 - rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 - rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 - rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 - rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 - - - -; Bootloader table signatures and information -.section .apitable_signatures, "ax" -.global BootloaderAPI_Signatures -BootloaderAPI_Signatures: - - .long BOOT_START_ADDR ; Start address of the bootloader - .word 0xDF20 ; Signature for the Printer class bootloader - .word 0xDCFB ; Signature for a LUFA class bootloader +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +; Trampolines to actual API implementations if the target address is outside the +; range of a rjmp instruction (can happen with large bootloader sections) +.section .apitable_trampolines, "ax" +.global BootloaderAPI_Trampolines +BootloaderAPI_Trampolines: + + BootloaderAPI_ErasePage_Trampoline: + jmp BootloaderAPI_ErasePage + BootloaderAPI_WritePage_Trampoline: + jmp BootloaderAPI_WritePage + BootloaderAPI_FillWord_Trampoline: + jmp BootloaderAPI_FillWord + BootloaderAPI_ReadSignature_Trampoline: + jmp BootloaderAPI_ReadSignature + BootloaderAPI_ReadFuse_Trampoline: + jmp BootloaderAPI_ReadFuse + BootloaderAPI_ReadLock_Trampoline: + jmp BootloaderAPI_ReadLock + BootloaderAPI_WriteLock_Trampoline: + jmp BootloaderAPI_WriteLock + BootloaderAPI_UNUSED1: + ret + BootloaderAPI_UNUSED2: + ret + BootloaderAPI_UNUSED3: + ret + BootloaderAPI_UNUSED4: + ret + BootloaderAPI_UNUSED5: + ret + + + +; API function jump table +.section .apitable_jumptable, "ax" +.global BootloaderAPI_JumpTable +BootloaderAPI_JumpTable: + + rjmp BootloaderAPI_ErasePage_Trampoline + rjmp BootloaderAPI_WritePage_Trampoline + rjmp BootloaderAPI_FillWord_Trampoline + rjmp BootloaderAPI_ReadSignature_Trampoline + rjmp BootloaderAPI_ReadFuse_Trampoline + rjmp BootloaderAPI_ReadLock_Trampoline + rjmp BootloaderAPI_WriteLock_Trampoline + rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 + rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 + rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 + rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 + rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 + + + +; Bootloader table signatures and information +.section .apitable_signatures, "ax" +.global BootloaderAPI_Signatures +BootloaderAPI_Signatures: + + .long BOOT_START_ADDR ; Start address of the bootloader + .word 0xDF20 ; Signature for the Printer class bootloader + .word 0xDCFB ; Signature for a LUFA class bootloader diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml index 86a56911e..b5c0c6b3a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml @@ -1,159 +1,159 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile index 0716c3bbe..0db035de3 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile @@ -1,55 +1,55 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2014. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# -# -------------------------------------- -# LUFA Project Makefile. -# -------------------------------------- - -# Run "make help" for target help. - -MCU = at90usb1287 -ARCH = AVR8 -BOARD = USBKEY -F_CPU = 8000000 -F_USB = $(F_CPU) -OPTIMIZATION = s -TARGET = BootloaderPrinter -SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) -LUFA_PATH = ../../LUFA -CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) - -# Flash size and bootloader section sizes of the target, in KB. These must -# match the target's total FLASH size and the bootloader size set in the -# device's fuses. -FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 8 - -# Bootloader address calculation formulas -# Do not modify these macros, but rather modify the dependent values above. -CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) -BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) -BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) - -# Bootloader linker section flags for relocating the API table sections to -# known FLASH addresses - these should not normally be user-edited. -BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) -BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) - -# Default target -all: - -# Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa_core.mk -include $(LUFA_PATH)/Build/lufa_sources.mk -include $(LUFA_PATH)/Build/lufa_build.mk -include $(LUFA_PATH)/Build/lufa_cppcheck.mk -include $(LUFA_PATH)/Build/lufa_doxygen.mk -include $(LUFA_PATH)/Build/lufa_avrdude.mk -include $(LUFA_PATH)/Build/lufa_atprogram.mk +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = at90usb1287 +ARCH = AVR8 +BOARD = USBKEY +F_CPU = 8000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = BootloaderPrinter +SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) +LUFA_PATH = ../../LUFA +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) + +# Flash size and bootloader section sizes of the target, in KB. These must +# match the target's total FLASH size and the bootloader size set in the +# device's fuses. +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 8 + +# Bootloader address calculation formulas +# Do not modify these macros, but rather modify the dependent values above. +CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) +BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) +BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) + +# Bootloader linker section flags for relocating the API table sections to +# known FLASH addresses - these should not normally be user-edited. +BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) +BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) + +# Default target +all: + +# Include LUFA build script makefiles +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_sources.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_avrdude.mk +include $(LUFA_PATH)/Build/lufa_atprogram.mk diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile b/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile index 9fd188c93..e839ba6b1 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile @@ -1,42 +1,42 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2014. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# -# -------------------------------------- -# LUFA Project Makefile. -# -------------------------------------- - -# Run "make help" for target help. - -MCU = at90usb1287 -ARCH = AVR8 -F_CPU = 1000000 -F_USB = $(F_CPU) -OPTIMIZATION = s -TARGET = HID_EEPROM_Loader -SRC = $(TARGET).c -LUFA_PATH = ../../../LUFA -CC_FLAGS = -LD_FLAGS = -OBJECT_FILES = InputEEData.o - -# Default target -all: - -# Determine the AVR sub-architecture of the build main application object file -FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) - -# Create a linkable object file with the input binary EEPROM data stored in the FLASH section -InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) - @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" - avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ - -# Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa_core.mk -include $(LUFA_PATH)/Build/lufa_build.mk -include $(LUFA_PATH)/Build/lufa_cppcheck.mk -include $(LUFA_PATH)/Build/lufa_doxygen.mk -include $(LUFA_PATH)/Build/lufa_hid.mk +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = at90usb1287 +ARCH = AVR8 +F_CPU = 1000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = HID_EEPROM_Loader +SRC = $(TARGET).c +LUFA_PATH = ../../../LUFA +CC_FLAGS = +LD_FLAGS = +OBJECT_FILES = InputEEData.o + +# Default target +all: + +# Determine the AVR sub-architecture of the build main application object file +FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) + +# Create a linkable object file with the input binary EEPROM data stored in the FLASH section +InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) + @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" + avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ + +# Include LUFA build script makefiles +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_hid.mk diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml index fd65db283..e952714e1 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Template for a LUFA USB device mode application. - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + Template for a LUFA USB device mode application. + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml index c1996ec71..c3860c056 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml @@ -1,41 +1,41 @@ - - - - - - - - - - - - - - - - Template for a LUFA USB host mode application. - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Template for a LUFA USB host mode application. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt b/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt index 7ddfa1be3..0ae1dd678 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt @@ -1,975 +1,975 @@ -/** \file - * - * This file contains special DoxyGen information for the generation of the main page and other special - * documentation pages. It is not a project source file. - */ - -/** \page Page_BuildSystem The LUFA Build System - * - * \section Sec_BuildSystem_Overview Overview of the LUFA Build System - * The LUFA build system is an attempt at making a set of re-usable, modular build make files which - * can be referenced in a LUFA powered project, to minimize the amount of code required in an - * application makefile. The system is written in GNU Make, and each module is independent of - * one-another. - * - * For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA - * build system, see \ref Sec_CompilingApps_Prerequisites. - * - * To use a LUFA build system module, simply add an include to your project makefile. All user projects - * should at a minimum include \ref Page_BuildModule_CORE for base functionality: - * \code - * include $(LUFA_PATH)/Build/lufa_core.mk - * \endcode - * - * Once included in your project makefile, the associated build module targets will be added to your - * project's build makefile targets automatically. To call a build target, run make {TARGET_NAME} - * from the command line, substituting in the appropriate target name. - * - * \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile. - * - * Each build module may have one or more mandatory parameters (GNU Make variables) which must - * be supplied in the project makefile for the module to work, and one or more optional parameters which - * may be defined and which will assume a sensible default if not. - * - * \section SSec_BuildSystem_Modules Available Modules - * - * The following modules are included in this LUFA release: - * - * \li \subpage Page_BuildModule_ATPROGRAM - Device Programming - * \li \subpage Page_BuildModule_AVRDUDE - Device Programming - * \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking - * \li \subpage Page_BuildModule_CORE - Core Build System Functions - * \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis - * \li \subpage Page_BuildModule_DFU - Device Programming - * \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation - * \li \subpage Page_BuildModule_HID - Device Programming - * \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables - * - * If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps. - */ - - /** \page Page_BuildModule_BUILD The BUILD build module - * - * The BUILD LUFA build system module, providing targets for the compilation, - * assembling and linking of an application from source code into binary files - * suitable for programming into a target device, using the GCC compiler. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_build.mk - * \endcode - * - * \section SSec_BuildModule_BUILD_Requirements Requirements - * This module requires the the architecture appropriate binaries of the GCC compiler are available in your - * system's PATH variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio - * 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages. - * - * \section SSec_BuildModule_BUILD_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
sizeDisplay size of the compiled application FLASH and SRAM segments.
symbol-sizesDisplay a size-sorted list of symbols from the compiled application, in decimal bytes.
libBuild and archive all source files into a library A binary file.
allBuild and link the application into ELF debug and HEX binary files.
elfBuild and link the application into an ELF debug file.
binBuild and link the application and produce a BIN binary file.
hexBuild and link the application and produce HEX and EEP binary files.
lssBuild and link the application and produce a LSS source code/assembly code mixed listing file.
cleanRemove all intermediary files and binary output files.
mostlycleanRemove all intermediary files but preserve any binary output files.
<filename>.sCreate an assembly listing of a given input C/C++ source file.
- * - * \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
TARGETName of the application output file prefix (e.g. TestApplication).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
MCUName of the Atmel processor model (e.g. at90usb1287).
SRCList of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.
F_USBSpeed in Hz of the input clock frequency to the target's USB controller.
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
- * - * \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
BOARDLUFA board hardware drivers to use (see \ref Page_DeviceSupport).
OPTIMIZATIONOptimization level to use when compiling source files (see GCC manual).
C_STANDARDVersion of the C standard to apply when compiling C++ source files (see GCC manual).
CPP_STANDARDVersion of the C++ standard to apply when compiling C++ source files (see GCC manual).
DEBUG_FORMATFormat of the debug information to embed in the generated object files (see GCC manual).
DEBUG_LEVELLevel of the debugging information to embed in the generated object files (see GCC manual).
F_CPUSpeed of the processor CPU clock, in Hz.
C_FLAGSFlags to pass to the C compiler only, after the automatically generated flags.
CPP_FLAGSFlags to pass to the C++ compiler only, after the automatically generated flags.
ASM_FLAGSFlags to pass to the assembler only, after the automatically generated flags.
CC_FLAGSCommon flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.
COMPILER_PATHDirectory where the C/C++ toolchain is located, if not available in the system PATH.
LD_FLAGSFlags to pass to the linker, after the automatically generated flags.
LINKER_RELAXATIONSEnables or disables linker relaxations when linking the application binary. This can reduce the total size - * of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible. - * \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you - * receive a link error relocation truncated to fit: R_AVR_13_PCREL, disable this setting.
OBJDIRDirectory to place the generated object and dependency files. If set to "." the same folder as the source file will be used. - * \note When this option is enabled, all source filenames must be unique.
OBJECT_FILESList of additional object files that should be linked into the resulting binary.
- * - * \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_CORE The CORE build module - * - * The core LUFA build system module, providing common build system help and information targets. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_core.mk - * \endcode - * - * \section SSec_BuildModule_CORE_Requirements Requirements - * This module has no requirements outside a standard *nix shell like environment; the sh - * shell, GNU make and *nix CoreUtils (echo, printf, etc.). - * - * \section SSec_BuildModule_CORE_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
helpDisplay build system help and configuration information.
list_targetsList all available build targets from the build system.
list_modulesList all available build modules from the build system.
list_mandatoryList all mandatory parameters required by the included modules.
list_optionalList all optional parameters required by the included modules.
list_providedList all variables provided by the included modules.
list_macrosList all macros provided by the included modules.
- * - * \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module - * - * The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_atprogram.mk - * \endcode - * - * \section SSec_BuildModule_ATPROGRAM_Requirements Requirements - * This module requires the atprogram.exe utility to be available in your system's PATH - * variable. The atprogram.exe utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x - * inside the application install folder's "\atbackend" subdirectory. - * - * \section SSec_BuildModule_ATPROGRAM_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
atprogramProgram the device FLASH memory with the application's executable data.
atprogram-eeProgram the device EEPROM memory with the application's EEPROM data.
- * - * \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ATPROGRAM_PROGRAMMERName of the Atmel programmer or debugger tool to communicate with (e.g. jtagice3).
ATPROGRAM_INTERFACEName of the programming interface to use when programming the target (e.g. spi).
ATPROGRAM_PORTName of the communication port to use when when programming with a serially connected tool (e.g. COM2).
- * - * \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module - * - * The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_avrdude.mk - * \endcode - * - * \section SSec_BuildModule_AVRDUDE_Requirements Requirements - * This module requires the avrdude utility to be available in your system's PATH - * variable. The avrdude utility is distributed in the old WinAVR project releases for - * Windows (http://winavr.sourceforge.net) or can be installed on *nix systems via the project's - * source code (https://savannah.nongnu.org/projects/avrdude) or through the package manager. - * - * \section SSec_BuildModule_AVRDUDE_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
avrdudeProgram the device FLASH memory with the application's executable data.
avrdude-eeProgram the device EEPROM memory with the application's EEPROM data.
- * - * \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
AVRDUDE_PROGRAMMERName of the programmer or debugger tool to communicate with (e.g. jtagicemkii).
AVRDUDE_PORTName of the communication port to use when when programming with the connected tool (e.g. COM2, /dev/ttyUSB0 or usb).
AVRDUDE_FLAGSAdditional flags to pass to avrdude when programming, applied after the automatically generated flags.
- * - * \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module - * - * The CPPCHECK programming utility LUFA build system module, providing targets to statically - * analyze C and C++ source code for errors and performance/style issues. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_cppcheck.mk - * \endcode - * - * \section SSec_BuildModule_CPPCHECK_Requirements Requirements - * This module requires the cppcheck utility to be available in your system's PATH - * variable. The cppcheck utility is distributed through the project's home page - * (http://cppcheck.sourceforge.net) for Windows, and can be installed on *nix systems via - * the project's source code or through the package manager. - * - * \section SSec_BuildModule_CPPCHECK_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
cppcheckStatically analyze the project source code for issues.
cppcheck-configCheck the cppcheck configuration - scan source code and warn about missing header files and other issues.
- * - * \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - *
SRCList of source files to statically analyze.
- * - * \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
CPPCHECK_INCLUDESPath of extra directories to check when attemting to resolve C/C++ header file includes.
CPPCHECK_EXCLUDESPaths or path fragments to exclude when analyzing.
CPPCHECK_MSG_TEMPLATEOutput message template to use when printing errors, warnings and information (see cppcheck documentation).
CPPCHECK_ENABLEAnalysis rule categories to enable (see cppcheck documentation).
CPPCHECK_SUPPRESSSpecific analysis rules to suppress (see cppcheck documentation).
CPPCHECK_FAIL_ON_WARNINGSet to Y to fail the analysis job with an error exit code if warnings are found, N to continue without failing.
CPPCHECK_QUIETSet to Y to suppress all output except warnings and errors, N to show verbose output information.
CPPCHECK_FLAGSExtra flags to pass to cppcheck, after the automatically generated flags.
- * - * \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_DFU The DFU build module - * - * The DFU programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * This module requires a DFU class bootloader to be running in the target, compatible with - * the DFU bootloader protocol as published by Atmel. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_dfu.mk - * \endcode - * - * \section SSec_BuildModule_DFU_Requirements Requirements - * This module requires either the batchisp utility from Atmel's FLIP utility, or the open - * source dfu-programmer utility (http://dfu-programmer.sourceforge.net/) to be - * available in your system's PATH variable. On *nix systems the dfu-programmer utility - * can be installed via the project's source code or through the package manager. - * - * \section SSec_BuildModule_DFU_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
dfuProgram the device FLASH memory with the application's executable data using dfu-programmer.
dfu-eeProgram the device EEPROM memory with the application's EEPROM data using dfu-programmer.
flipProgram the device FLASH memory with the application's executable data using batchisp.
flip-eeProgram the device EEPROM memory with the application's EEPROM data using batchisp.
- * - * \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_DFU_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module - * - * The DOXYGEN code documentation utility LUFA build system module, providing targets to generate - * project HTML and other format documentation from a set of source files that include special - * Doxygen comments. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_doxygen.mk - * \endcode - * - * \section SSec_BuildModule_DOXYGEN_Requirements Requirements - * This module requires the doxygen utility from the Doxygen website - * (http://www.doxygen.org/) to be available in your system's PATH variable. On *nix - * systems the doxygen utility can be installed via the project's source code or through - * the package manager. - * - * \section SSec_BuildModule_DOXYGEN_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
doxygenGenerate project documentation.
doxygen_createCreate a new Doxygen configuration file using the latest template.
doxygen_upgradeUpgrade an existing Doxygen configuration file to the latest template
- * - * \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
- * - * \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
DOXYGEN_CONFName and path of the base Doxygen configuration file for the project.
DOXYGEN_FAIL_ON_WARNINGSet to Y to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, N to continue without failing.
DOXYGEN_OVERRIDE_PARAMSExtra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. QUIET=YES).
- * - * \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_HID The HID build module - * - * The HID programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor's FLASH memory with a project's compiled binary output file. This module - * requires a HID class bootloader to be running in the target, using a protocol compatible - * with the PJRC "HalfKay" protocol (http://www.pjrc.com/teensy/halfkay_protocol.html). - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_hid.mk - * \endcode - * - * \section SSec_BuildModule_HID_Requirements Requirements - * This module requires either the hid_bootloader_cli utility from the included LUFA HID - * class bootloader API subdirectory, or the teensy_loader_cli utility from PJRC - * (http://www.pjrc.com/teensy/loader_cli.html) to be available in your system's PATH - * variable. - * - * \section SSec_BuildModule_HID_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
hidProgram the device FLASH memory with the application's executable data using hid_bootloader_cli.
hid-eeProgram the device EEPROM memory with the application's EEPROM data using hid_bootloader_cli and - * a temporary AVR application programmed into the target's FLASH. - * \note This will erase the currently loaded application in the target.
teensyProgram the device FLASH memory with the application's executable data using teensy_loader_cli.
teensy-eeProgram the device EEPROM memory with the application's EEPROM data using teensy_loader_cli and - * a temporary AVR application programmed into the target's FLASH. - * \note This will erase the currently loaded application in the target.
- * - * \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_HID_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_SOURCES The SOURCES build module - * - * The SOURCES LUFA build system module, providing variables listing the various LUFA source files - * required to be build by a project for a given LUFA module. This module gives a way to reference - * LUFA source files symbolically, so that changes to the library structure do not break the library - * makefile. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_sources.mk - * \endcode - * - * \section SSec_BuildModule_SOURCES_Requirements Requirements - * None. - * - * \section SSec_BuildModule_SOURCES_Targets Targets - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
- * - * \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
LUFA_SRC_USBList of LUFA USB driver source files.
LUFA_SRC_USBCLASSList of LUFA USB Class driver source files.
LUFA_SRC_TEMPERATUREList of LUFA temperature sensor driver source files.
LUFA_SRC_SERIALList of LUFA Serial U(S)ART driver source files.
LUFA_SRC_TWIList of LUFA TWI driver source files.
LUFA_SRC_PLATFORMList of LUFA architecture specific platform management source files.
- * - * \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildTroubleshooting Troubleshooting Information - * - * LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these - * features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different - * errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ProblemResolution
Error "relocation truncated to fit: R_AVR_13_PCREL against symbol {X}" shown when compiling.Try compiling with the setting LINKER_RELAXATIONS=N in your LUFA Build System 2.0 makefile, or remove the line -Wl,--relax - * from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.
Error "error: ld terminated with signal 11 [Segmentation fault]" shown when compiling.Try compiling with the setting DEBUG_LEVEL=2 in your LUFA Build System 2.0 makefile, or make sure you are using binutils version 2.22 or later.
Error "EMERGENCY ABORT: INFINITE RECURSION DETECTED" shown when compiling.Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with - * GNU make or other variants of Make causing an infinitely recursive build.
Error "Unsupported architecture "{X}"" shown when compiling.Ensure your makefile's ARCH setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.
Error "Makefile {X} value not set" shown when compiling.The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA - * build system modules. Define the value in your project makefile and try again.
Error "Makefile {X} option cannot be blank" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration - * option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.
Error "Makefile {X} option must be Y or N" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No"). - * This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.
Error "Unknown input source file formats: {X}" shown when compiling.The nominated source files, specified in your project's makefile in the SRC configuration option, has an extension that the LUFA build system does not - * recognise. The file extensions are case sensitive, and must be one of the supported formats (*.c, *.cpp or *.S).
Error "Cannot build with OBJDIR parameter set - one or more object file name is not unique" shown when compiling.When a project is built with a non-empty OBJDIR object directory name set, all input source files must have unique names, excluding extension and path. - * This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.
Error "Source file does not exist: {X}" shown when compiling.The nominated input source file, specified in the user project's SRC parameter, could not be found. Ensure the source file exists and the absolute or - * relative path given in the user project makefile is correct and try again.
Error "Doxygen configuration file {X} does not exist" shown when upgrading a Doxygen configuration file.The nominated Doxygen configuration file, specified in the user project's DOXYGEN_CONF parameter, could not be found. Ensure the configuration file exists - * and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration - * file.
Error "avr-gcc: error: unrecognized option '{X}'" shown when compiling.An unrecognised option was supplied to the compiler, usually in the C_FLAGS, CPP_FLAGS, ASM_FLAGS or CC_FLAGS configuration - * options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or - * upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.
Error "makefile:{X}: {Y}.mk: No such file or directory" shown when make is invoked.The path to the nominated makefile module was incorrect. This usually indicates that the makefile LUFA_PATH option is not set to a valid relative or - * absolute path to the LUFA library core.
Error "fatal error: LUFAConfig.h: No such file or directory" shown when compiling.The USE_LUFA_CONFIG_HEADER compile time option was set in the user project makefile, but the user supplied LUFAConfig.h header could not be - * found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile CC_FLAGS - * parameter.
Error "ld.exe: section .apitable_trampolines loaded at {X} overlaps section .text" shown when compiling a bootloader.The bootloader is compiling too large for the given FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB parameters set in the bootloader makefile. This - * usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the - * compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.
Error "unknown MCU '{X}' specified" shown when compiling.The specified microcontroller device model name set in the user application's makefile as the MCU parameter is incorrect, or unsupported by the - * version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.
Error "undefined reference to `{X}'" shown when compiling.This is usually caused by a missing source file in the user application's SRC configuration parameter. If the indicated symbol is one from the LUFA - * library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).
- * - * For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp. - */ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + +/** \page Page_BuildSystem The LUFA Build System + * + * \section Sec_BuildSystem_Overview Overview of the LUFA Build System + * The LUFA build system is an attempt at making a set of re-usable, modular build make files which + * can be referenced in a LUFA powered project, to minimize the amount of code required in an + * application makefile. The system is written in GNU Make, and each module is independent of + * one-another. + * + * For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA + * build system, see \ref Sec_CompilingApps_Prerequisites. + * + * To use a LUFA build system module, simply add an include to your project makefile. All user projects + * should at a minimum include \ref Page_BuildModule_CORE for base functionality: + * \code + * include $(LUFA_PATH)/Build/lufa_core.mk + * \endcode + * + * Once included in your project makefile, the associated build module targets will be added to your + * project's build makefile targets automatically. To call a build target, run make {TARGET_NAME} + * from the command line, substituting in the appropriate target name. + * + * \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile. + * + * Each build module may have one or more mandatory parameters (GNU Make variables) which must + * be supplied in the project makefile for the module to work, and one or more optional parameters which + * may be defined and which will assume a sensible default if not. + * + * \section SSec_BuildSystem_Modules Available Modules + * + * The following modules are included in this LUFA release: + * + * \li \subpage Page_BuildModule_ATPROGRAM - Device Programming + * \li \subpage Page_BuildModule_AVRDUDE - Device Programming + * \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking + * \li \subpage Page_BuildModule_CORE - Core Build System Functions + * \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis + * \li \subpage Page_BuildModule_DFU - Device Programming + * \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation + * \li \subpage Page_BuildModule_HID - Device Programming + * \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables + * + * If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps. + */ + + /** \page Page_BuildModule_BUILD The BUILD build module + * + * The BUILD LUFA build system module, providing targets for the compilation, + * assembling and linking of an application from source code into binary files + * suitable for programming into a target device, using the GCC compiler. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_build.mk + * \endcode + * + * \section SSec_BuildModule_BUILD_Requirements Requirements + * This module requires the the architecture appropriate binaries of the GCC compiler are available in your + * system's PATH variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio + * 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages. + * + * \section SSec_BuildModule_BUILD_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
sizeDisplay size of the compiled application FLASH and SRAM segments.
symbol-sizesDisplay a size-sorted list of symbols from the compiled application, in decimal bytes.
libBuild and archive all source files into a library A binary file.
allBuild and link the application into ELF debug and HEX binary files.
elfBuild and link the application into an ELF debug file.
binBuild and link the application and produce a BIN binary file.
hexBuild and link the application and produce HEX and EEP binary files.
lssBuild and link the application and produce a LSS source code/assembly code mixed listing file.
cleanRemove all intermediary files and binary output files.
mostlycleanRemove all intermediary files but preserve any binary output files.
<filename>.sCreate an assembly listing of a given input C/C++ source file.
+ * + * \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
TARGETName of the application output file prefix (e.g. TestApplication).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
MCUName of the Atmel processor model (e.g. at90usb1287).
SRCList of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.
F_USBSpeed in Hz of the input clock frequency to the target's USB controller.
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
+ * + * \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
BOARDLUFA board hardware drivers to use (see \ref Page_DeviceSupport).
OPTIMIZATIONOptimization level to use when compiling source files (see GCC manual).
C_STANDARDVersion of the C standard to apply when compiling C++ source files (see GCC manual).
CPP_STANDARDVersion of the C++ standard to apply when compiling C++ source files (see GCC manual).
DEBUG_FORMATFormat of the debug information to embed in the generated object files (see GCC manual).
DEBUG_LEVELLevel of the debugging information to embed in the generated object files (see GCC manual).
F_CPUSpeed of the processor CPU clock, in Hz.
C_FLAGSFlags to pass to the C compiler only, after the automatically generated flags.
CPP_FLAGSFlags to pass to the C++ compiler only, after the automatically generated flags.
ASM_FLAGSFlags to pass to the assembler only, after the automatically generated flags.
CC_FLAGSCommon flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.
COMPILER_PATHDirectory where the C/C++ toolchain is located, if not available in the system PATH.
LD_FLAGSFlags to pass to the linker, after the automatically generated flags.
LINKER_RELAXATIONSEnables or disables linker relaxations when linking the application binary. This can reduce the total size + * of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible. + * \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you + * receive a link error relocation truncated to fit: R_AVR_13_PCREL, disable this setting.
OBJDIRDirectory to place the generated object and dependency files. If set to "." the same folder as the source file will be used. + * \note When this option is enabled, all source filenames must be unique.
OBJECT_FILESList of additional object files that should be linked into the resulting binary.
+ * + * \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_CORE The CORE build module + * + * The core LUFA build system module, providing common build system help and information targets. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_core.mk + * \endcode + * + * \section SSec_BuildModule_CORE_Requirements Requirements + * This module has no requirements outside a standard *nix shell like environment; the sh + * shell, GNU make and *nix CoreUtils (echo, printf, etc.). + * + * \section SSec_BuildModule_CORE_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
helpDisplay build system help and configuration information.
list_targetsList all available build targets from the build system.
list_modulesList all available build modules from the build system.
list_mandatoryList all mandatory parameters required by the included modules.
list_optionalList all optional parameters required by the included modules.
list_providedList all variables provided by the included modules.
list_macrosList all macros provided by the included modules.
+ * + * \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CORE_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module + * + * The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_atprogram.mk + * \endcode + * + * \section SSec_BuildModule_ATPROGRAM_Requirements Requirements + * This module requires the atprogram.exe utility to be available in your system's PATH + * variable. The atprogram.exe utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x + * inside the application install folder's "\atbackend" subdirectory. + * + * \section SSec_BuildModule_ATPROGRAM_Targets Targets + * + * + * + * + * + * + * + * + * + * + *
atprogramProgram the device FLASH memory with the application's executable data.
atprogram-eeProgram the device EEPROM memory with the application's EEPROM data.
+ * + * \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ATPROGRAM_PROGRAMMERName of the Atmel programmer or debugger tool to communicate with (e.g. jtagice3).
ATPROGRAM_INTERFACEName of the programming interface to use when programming the target (e.g. spi).
ATPROGRAM_PORTName of the communication port to use when when programming with a serially connected tool (e.g. COM2).
+ * + * \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module + * + * The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_avrdude.mk + * \endcode + * + * \section SSec_BuildModule_AVRDUDE_Requirements Requirements + * This module requires the avrdude utility to be available in your system's PATH + * variable. The avrdude utility is distributed in the old WinAVR project releases for + * Windows (http://winavr.sourceforge.net) or can be installed on *nix systems via the project's + * source code (https://savannah.nongnu.org/projects/avrdude) or through the package manager. + * + * \section SSec_BuildModule_AVRDUDE_Targets Targets + * + * + * + * + * + * + * + * + * + * + *
avrdudeProgram the device FLASH memory with the application's executable data.
avrdude-eeProgram the device EEPROM memory with the application's EEPROM data.
+ * + * \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
AVRDUDE_PROGRAMMERName of the programmer or debugger tool to communicate with (e.g. jtagicemkii).
AVRDUDE_PORTName of the communication port to use when when programming with the connected tool (e.g. COM2, /dev/ttyUSB0 or usb).
AVRDUDE_FLAGSAdditional flags to pass to avrdude when programming, applied after the automatically generated flags.
+ * + * \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module + * + * The CPPCHECK programming utility LUFA build system module, providing targets to statically + * analyze C and C++ source code for errors and performance/style issues. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_cppcheck.mk + * \endcode + * + * \section SSec_BuildModule_CPPCHECK_Requirements Requirements + * This module requires the cppcheck utility to be available in your system's PATH + * variable. The cppcheck utility is distributed through the project's home page + * (http://cppcheck.sourceforge.net) for Windows, and can be installed on *nix systems via + * the project's source code or through the package manager. + * + * \section SSec_BuildModule_CPPCHECK_Targets Targets + * + * + * + * + * + * + * + * + * + * + *
cppcheckStatically analyze the project source code for issues.
cppcheck-configCheck the cppcheck configuration - scan source code and warn about missing header files and other issues.
+ * + * \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + *
SRCList of source files to statically analyze.
+ * + * \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
CPPCHECK_INCLUDESPath of extra directories to check when attemting to resolve C/C++ header file includes.
CPPCHECK_EXCLUDESPaths or path fragments to exclude when analyzing.
CPPCHECK_MSG_TEMPLATEOutput message template to use when printing errors, warnings and information (see cppcheck documentation).
CPPCHECK_ENABLEAnalysis rule categories to enable (see cppcheck documentation).
CPPCHECK_SUPPRESSSpecific analysis rules to suppress (see cppcheck documentation).
CPPCHECK_FAIL_ON_WARNINGSet to Y to fail the analysis job with an error exit code if warnings are found, N to continue without failing.
CPPCHECK_QUIETSet to Y to suppress all output except warnings and errors, N to show verbose output information.
CPPCHECK_FLAGSExtra flags to pass to cppcheck, after the automatically generated flags.
+ * + * \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_DFU The DFU build module + * + * The DFU programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. + * This module requires a DFU class bootloader to be running in the target, compatible with + * the DFU bootloader protocol as published by Atmel. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_dfu.mk + * \endcode + * + * \section SSec_BuildModule_DFU_Requirements Requirements + * This module requires either the batchisp utility from Atmel's FLIP utility, or the open + * source dfu-programmer utility (http://dfu-programmer.sourceforge.net/) to be + * available in your system's PATH variable. On *nix systems the dfu-programmer utility + * can be installed via the project's source code or through the package manager. + * + * \section SSec_BuildModule_DFU_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
dfuProgram the device FLASH memory with the application's executable data using dfu-programmer.
dfu-eeProgram the device EEPROM memory with the application's EEPROM data using dfu-programmer.
flipProgram the device FLASH memory with the application's executable data using batchisp.
flip-eeProgram the device EEPROM memory with the application's EEPROM data using batchisp.
+ * + * \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_DFU_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module + * + * The DOXYGEN code documentation utility LUFA build system module, providing targets to generate + * project HTML and other format documentation from a set of source files that include special + * Doxygen comments. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_doxygen.mk + * \endcode + * + * \section SSec_BuildModule_DOXYGEN_Requirements Requirements + * This module requires the doxygen utility from the Doxygen website + * (http://www.doxygen.org/) to be available in your system's PATH variable. On *nix + * systems the doxygen utility can be installed via the project's source code or through + * the package manager. + * + * \section SSec_BuildModule_DOXYGEN_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
doxygenGenerate project documentation.
doxygen_createCreate a new Doxygen configuration file using the latest template.
doxygen_upgradeUpgrade an existing Doxygen configuration file to the latest template
+ * + * \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
+ * + * \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
DOXYGEN_CONFName and path of the base Doxygen configuration file for the project.
DOXYGEN_FAIL_ON_WARNINGSet to Y to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, N to continue without failing.
DOXYGEN_OVERRIDE_PARAMSExtra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. QUIET=YES).
+ * + * \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_HID The HID build module + * + * The HID programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor's FLASH memory with a project's compiled binary output file. This module + * requires a HID class bootloader to be running in the target, using a protocol compatible + * with the PJRC "HalfKay" protocol (http://www.pjrc.com/teensy/halfkay_protocol.html). + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_hid.mk + * \endcode + * + * \section SSec_BuildModule_HID_Requirements Requirements + * This module requires either the hid_bootloader_cli utility from the included LUFA HID + * class bootloader API subdirectory, or the teensy_loader_cli utility from PJRC + * (http://www.pjrc.com/teensy/loader_cli.html) to be available in your system's PATH + * variable. + * + * \section SSec_BuildModule_HID_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
hidProgram the device FLASH memory with the application's executable data using hid_bootloader_cli.
hid-eeProgram the device EEPROM memory with the application's EEPROM data using hid_bootloader_cli and + * a temporary AVR application programmed into the target's FLASH. + * \note This will erase the currently loaded application in the target.
teensyProgram the device FLASH memory with the application's executable data using teensy_loader_cli.
teensy-eeProgram the device EEPROM memory with the application's EEPROM data using teensy_loader_cli and + * a temporary AVR application programmed into the target's FLASH. + * \note This will erase the currently loaded application in the target.
+ * + * \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_HID_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_SOURCES The SOURCES build module + * + * The SOURCES LUFA build system module, providing variables listing the various LUFA source files + * required to be build by a project for a given LUFA module. This module gives a way to reference + * LUFA source files symbolically, so that changes to the library structure do not break the library + * makefile. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_sources.mk + * \endcode + * + * \section SSec_BuildModule_SOURCES_Requirements Requirements + * None. + * + * \section SSec_BuildModule_SOURCES_Targets Targets + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
+ * + * \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
LUFA_SRC_USBList of LUFA USB driver source files.
LUFA_SRC_USBCLASSList of LUFA USB Class driver source files.
LUFA_SRC_TEMPERATUREList of LUFA temperature sensor driver source files.
LUFA_SRC_SERIALList of LUFA Serial U(S)ART driver source files.
LUFA_SRC_TWIList of LUFA TWI driver source files.
LUFA_SRC_PLATFORMList of LUFA architecture specific platform management source files.
+ * + * \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildTroubleshooting Troubleshooting Information + * + * LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these + * features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different + * errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ProblemResolution
Error "relocation truncated to fit: R_AVR_13_PCREL against symbol {X}" shown when compiling.Try compiling with the setting LINKER_RELAXATIONS=N in your LUFA Build System 2.0 makefile, or remove the line -Wl,--relax + * from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.
Error "error: ld terminated with signal 11 [Segmentation fault]" shown when compiling.Try compiling with the setting DEBUG_LEVEL=2 in your LUFA Build System 2.0 makefile, or make sure you are using binutils version 2.22 or later.
Error "EMERGENCY ABORT: INFINITE RECURSION DETECTED" shown when compiling.Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with + * GNU make or other variants of Make causing an infinitely recursive build.
Error "Unsupported architecture "{X}"" shown when compiling.Ensure your makefile's ARCH setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.
Error "Makefile {X} value not set" shown when compiling.The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA + * build system modules. Define the value in your project makefile and try again.
Error "Makefile {X} option cannot be blank" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration + * option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.
Error "Makefile {X} option must be Y or N" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No"). + * This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.
Error "Unknown input source file formats: {X}" shown when compiling.The nominated source files, specified in your project's makefile in the SRC configuration option, has an extension that the LUFA build system does not + * recognise. The file extensions are case sensitive, and must be one of the supported formats (*.c, *.cpp or *.S).
Error "Cannot build with OBJDIR parameter set - one or more object file name is not unique" shown when compiling.When a project is built with a non-empty OBJDIR object directory name set, all input source files must have unique names, excluding extension and path. + * This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.
Error "Source file does not exist: {X}" shown when compiling.The nominated input source file, specified in the user project's SRC parameter, could not be found. Ensure the source file exists and the absolute or + * relative path given in the user project makefile is correct and try again.
Error "Doxygen configuration file {X} does not exist" shown when upgrading a Doxygen configuration file.The nominated Doxygen configuration file, specified in the user project's DOXYGEN_CONF parameter, could not be found. Ensure the configuration file exists + * and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration + * file.
Error "avr-gcc: error: unrecognized option '{X}'" shown when compiling.An unrecognised option was supplied to the compiler, usually in the C_FLAGS, CPP_FLAGS, ASM_FLAGS or CC_FLAGS configuration + * options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or + * upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.
Error "makefile:{X}: {Y}.mk: No such file or directory" shown when make is invoked.The path to the nominated makefile module was incorrect. This usually indicates that the makefile LUFA_PATH option is not set to a valid relative or + * absolute path to the LUFA library core.
Error "fatal error: LUFAConfig.h: No such file or directory" shown when compiling.The USE_LUFA_CONFIG_HEADER compile time option was set in the user project makefile, but the user supplied LUFAConfig.h header could not be + * found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile CC_FLAGS + * parameter.
Error "ld.exe: section .apitable_trampolines loaded at {X} overlaps section .text" shown when compiling a bootloader.The bootloader is compiling too large for the given FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB parameters set in the bootloader makefile. This + * usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the + * compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.
Error "unknown MCU '{X}' specified" shown when compiling.The specified microcontroller device model name set in the user application's makefile as the MCU parameter is incorrect, or unsupported by the + * version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.
Error "undefined reference to `{X}'" shown when compiling.This is usually caused by a missing source file in the user application's SRC configuration parameter. If the indicated symbol is one from the LUFA + * library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).
+ * + * For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp. + */ diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt index 486e9a427..a34fd58df 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt @@ -1 +1 @@ -Copy the Microsoft HV1 Docbook transform contents into this directory (i.e. with the XSLT files in the current folder). The HV1 transform proposal can be found at http://sourceforge.net/tracker/?func=detail&aid=3610290&group_id=21935&atid=373750 . +Copy the Microsoft HV1 Docbook transform contents into this directory (i.e. with the XSLT files in the current folder). The HV1 transform proposal can be found at http://sourceforge.net/tracker/?func=detail&aid=3610290&group_id=21935&atid=373750 . diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt index c017acfd7..dd69b7e0b 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt @@ -1 +1 @@ -Copy the Docbook XSLT docbook-xsl-1.78.1 release contents into this directory (i.e. with the root Docbook files in the current folder). The Docbook releases can be found at http://sourceforge.net/projects/docbook/files/docbook-xsl/ . +Copy the Docbook XSLT docbook-xsl-1.78.1 release contents into this directory (i.e. with the root Docbook files in the current folder). The Docbook releases can be found at http://sourceforge.net/projects/docbook/files/docbook-xsl/ . diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt index ee8a38340..8aa4a9413 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css index 49eb7e970..0b6ccbd8c 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css @@ -1,53 +1,53 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2013. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -.programlisting { - display: block; - margin-left: 15px; - padding: 10px; - background-color: #f4f4f4; - border: 1px solid #aaaaaa; - font-family: "Consolas", "Courier New", sans-serif; - } - - code { - background-color: #f4f4f4; - font-family: "Consolas", "Courier New", sans-serif; - } - -.note, .warning, .tip { - display: block; - margin-left: 15px; - padding-left: 10px; - padding-bottom: 5px; - background-color: #f4f4f4; - border: 1px solid #aaaaaa; -} - -table { - border: 1px solid #aaaaaa; - border-collapse: collapse; - margin-left: 15px; - font-size: 10pt; -} - -table thead { - background-color: #f4f4f4; -} - -table thead th { - padding: 5px; -} - -table tbody td { - padding: 5px; -} - -ul { - padding-left: 20px; -} +/* + LUFA Library + Copyright (C) Dean Camera, 2013. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +.programlisting { + display: block; + margin-left: 15px; + padding: 10px; + background-color: #f4f4f4; + border: 1px solid #aaaaaa; + font-family: "Consolas", "Courier New", sans-serif; + } + + code { + background-color: #f4f4f4; + font-family: "Consolas", "Courier New", sans-serif; + } + +.note, .warning, .tip { + display: block; + margin-left: 15px; + padding-left: 10px; + padding-bottom: 5px; + background-color: #f4f4f4; + border: 1px solid #aaaaaa; +} + +table { + border: 1px solid #aaaaaa; + border-collapse: collapse; + margin-left: 15px; + font-size: 10pt; +} + +table thead { + background-color: #f4f4f4; +} + +table thead th { + padding: 5px; +} + +table tbody td { + padding: 5px; +} + +ul { + padding-left: 20px; +} diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml index 05ef8b6ba..112d16994 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml index 794fd689e..bd969518a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml @@ -1,18 +1,18 @@ - - - FourWalledCubicle - LUFA - Dean Camera - - True - - - - 0 - - - content.xml.cache - - - - + + + FourWalledCubicle + LUFA + Dean Camera + + True + + + + 0 + + + content.xml.cache + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest index ea6edeb25..847501744 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest @@ -1,33 +1,33 @@ - - - - - LUFA Library - Dean Camera - 0 - http://www.lufa-lib.org - LUFA, the Lightweight USB Framework for AVRs. - - License.txt - LUFA_thumb.png - LUFA.png - - - AtmelStudio - AtmelStudio - - - - 1033 - - false - - - - - - LUFA.pkgdef - helpcontentsetup.msha - asf-manifest.xml - - + + + + + LUFA Library + Dean Camera + 0 + http://www.lufa-lib.org + LUFA, the Lightweight USB Framework for AVRs. + + License.txt + LUFA_thumb.png + LUFA.png + + + AtmelStudio + AtmelStudio + + + + 1033 + + false + + + + + + LUFA.pkgdef + helpcontentsetup.msha + asf-manifest.xml + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py index c51cff400..eb4b71efd 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py @@ -1,38 +1,38 @@ -""" - LUFA Library - Copyright (C) Dean Camera, 2013. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -""" - -import sys -sys.path.append("ProjectGenerator") - - -def show_message(message): - print("[Project Generator] %s" % message) - sys.stdout.flush() - - -def main(lufa_root_path): - try: - from asf_avrstudio5_interface import PythonFacade - except ImportError: - print("Fatal Error: The ASF project generator is missing.") - return 1 - - p = PythonFacade(lufa_root_path) - - show_message("Checking database sanity...") - p.check_extension_database_sanity(lufa_root_path) - - show_message("Building cache files...") - p.generate_extension_cache_files(lufa_root_path) - - show_message("Cache files created.") - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1])) +""" + LUFA Library + Copyright (C) Dean Camera, 2013. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +""" + +import sys +sys.path.append("ProjectGenerator") + + +def show_message(message): + print("[Project Generator] %s" % message) + sys.stdout.flush() + + +def main(lufa_root_path): + try: + from asf_avrstudio5_interface import PythonFacade + except ImportError: + print("Fatal Error: The ASF project generator is missing.") + return 1 + + p = PythonFacade(lufa_root_path) + + show_message("Checking database sanity...") + p.check_extension_database_sanity(lufa_root_path) + + show_message("Building cache files...") + p.generate_extension_cache_files(lufa_root_path) + + show_message("Cache files created.") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1])) diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml index 28afdda58..86cfc0409 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml @@ -1,96 +1,96 @@ - - - - - - - - - Lightweight USB Framework for AVRs (LUFA), a USB software stack/framework. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Lightweight USB Framework for AVRs (LUFA), a USB software stack/framework. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml index 9e17b188b..c2ef7af4c 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml index 3677d2003..e150aa645 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml @@ -1,114 +1,114 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml index 4b099920b..ab7e03e4e 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml @@ -1,853 +1,853 @@ - - - - - - - - - Board hardware (LEDs, Buttons, etc.) drivers for the preconfigured LUFA boards. Note that only the boards - compatible with the currently selected device will be shown. - - To disable all hardware drivers silently, use NONE. To supply customer drivers, use USER (see manual). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Board hardware (LEDs, Buttons, etc.) drivers for the preconfigured LUFA boards. Note that only the boards + compatible with the currently selected device will be shown. + + To disable all hardware drivers silently, use NONE. To supply customer drivers, use USER (see manual). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml index 8680ca2df..4311ae87b 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml index 3a982e565..76ea516db 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml @@ -1,198 +1,198 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml index 7ff4b3949..263c411df 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml index cd18bf10e..67ab760d3 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml index 58f8917ef..58a0b388f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml @@ -1,85 +1,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml index 166b9257a..4688f05f9 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml index 7e0540cda..2e7185f24 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml index 9e9f4f6a1..c79a0f5b5 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml index 02c7463ee..4ee51f6ee 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml index a488c4b83..98017b08a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml index 1674a77b0..e613fe520 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml index 031c8a2be..a76b6d0d3 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/lufa/descriptor.c index 539a58d66..6f2407f58 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/lufa/descriptor.c @@ -231,9 +231,15 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(1,1,0), +#if VIRTSER_ENABLE + .Class = USB_CSCP_IADDeviceClass, + .SubClass = USB_CSCP_IADDeviceSubclass, + .Protocol = USB_CSCP_IADDeviceProtocol, +#else .Class = USB_CSCP_NoDeviceClass, .SubClass = USB_CSCP_NoDeviceSubclass, .Protocol = USB_CSCP_NoDeviceProtocol, +#endif .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -643,8 +649,112 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x03} - } + }, #endif + +#ifdef VIRTSER_ENABLE + .CDC_Interface_Association = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation}, + + .FirstInterfaceIndex = CCI_INTERFACE, + .TotalInterfaces = 2, + + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, + + .IADStrIndex = NO_DESCRIPTOR, + }, + + .CDC_CCI_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = CCI_INTERFACE, + .AlternateSetting = 0, + + .TotalEndpoints = 1, + + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .CDC_Functional_Header = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .Subtype = 0x00, + + .CDCSpecification = VERSION_BCD(1,1,0), + }, + + .CDC_Functional_ACM = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = 0x02, + + .Capabilities = 0x02, + }, + + .CDC_Functional_Union = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = 0x06, + + .MasterInterfaceNumber = CCI_INTERFACE, + .SlaveInterfaceNumber = CDI_INTERFACE, + }, + + .CDC_NotificationEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = CDC_NOTIFICATION_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_NOTIFICATION_EPSIZE, + .PollingIntervalMS = 0xFF + }, + + .CDC_DCI_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = CDI_INTERFACE, + .AlternateSetting = 0, + + .TotalEndpoints = 2, + + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .CDC_DataOutEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = CDC_OUT_EPADDR, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_EPSIZE, + .PollingIntervalMS = 0x05 + }, + + .CDC_DataInEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = CDC_IN_EPADDR, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_EPSIZE, + .PollingIntervalMS = 0x05 + }, +#endif + }; diff --git a/tmk_core/protocol/lufa/descriptor.h b/tmk_core/protocol/lufa/descriptor.h index 4fd81a0e8..316650a7b 100644 --- a/tmk_core/protocol/lufa/descriptor.h +++ b/tmk_core/protocol/lufa/descriptor.h @@ -104,6 +104,21 @@ typedef struct USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; #endif +#ifdef VIRTSER_ENABLE + USB_Descriptor_Interface_Association_t CDC_Interface_Association; + + // CDC Control Interface + USB_Descriptor_Interface_t CDC_CCI_Interface; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; + USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; + + // CDC Data Interface + USB_Descriptor_Interface_t CDC_DCI_Interface; + USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; + USB_Descriptor_Endpoint_t CDC_DataInEndpoint; +#endif } USB_Descriptor_Configuration_t; @@ -141,8 +156,15 @@ typedef struct # define AS_INTERFACE NKRO_INTERFACE #endif +#ifdef VIRTSER_ENABLE +# define CCI_INTERFACE (AS_INTERFACE + 1) +# define CDI_INTERFACE (AS_INTERFACE + 2) +#else +# define CDI_INTERFACE AS_INTERFACE +#endif + /* nubmer of interfaces */ -#define TOTAL_INTERFACES AS_INTERFACE + 1 +#define TOTAL_INTERFACES (CDI_INTERFACE + 1) // Endopoint number and size @@ -180,11 +202,24 @@ typedef struct # define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 2) # define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM) # define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM) +#else +# define MIDI_STREAM_OUT_EPNUM NKRO_IN_EPNUM +#endif + +#ifdef VIRTSER_ENABLE +# define CDC_NOTIFICATION_EPNUM (MIDI_STREAM_OUT_EPNUM + 1) +# define CDC_IN_EPNUM (MIDI_STREAM_OUT_EPNUM + 2) +# define CDC_OUT_EPNUM (MIDI_STREAM_OUT_EPNUM + 3) +# define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM) +# define CDC_IN_EPADDR (ENDPOINT_DIR_IN | CDC_IN_EPNUM) +# define CDC_OUT_EPADDR (ENDPOINT_DIR_OUT | CDC_OUT_EPNUM) +#else +# define CDC_OUT_EPNUM MIDI_STREAM_OUT_EPNUM #endif -#if defined(__AVR_ATmega32U2__) && MIDI_STREAM_OUT_EPADDR > 4 -# error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI)" +#if defined(__AVR_ATmega32U2__) && CDC_OUT_EPNUM > 4 +# error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL)" #endif #define KEYBOARD_EPSIZE 8 @@ -193,6 +228,8 @@ typedef struct #define CONSOLE_EPSIZE 32 #define NKRO_EPSIZE 16 #define MIDI_STREAM_EPSIZE 64 +#define CDC_NOTIFICATION_EPSIZE 8 +#define CDC_EPSIZE 16 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 9ca55dbc9..9b201374a 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -60,6 +60,10 @@ #include "bluetooth.h" #endif +#ifdef VIRTSER_ENABLE + #include "virtser.h" +#endif + uint8_t keyboard_idle = 0; /* 0: Boot Protocol, 1: Report Protocol(default) */ uint8_t keyboard_protocol = 1; @@ -127,6 +131,34 @@ USB_ClassInfo_MIDI_Device_t USB_MIDI_Interface = #define SYS_COMMON_3 0x30 #endif +#ifdef VIRTSER_ENABLE +USB_ClassInfo_CDC_Device_t cdc_device = +{ + .Config = + { + .ControlInterfaceNumber = CCI_INTERFACE, + .DataINEndpoint = + { + .Address = CDC_IN_EPADDR, + .Size = CDC_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = CDC_OUT_EPADDR, + .Size = CDC_EPSIZE, + .Banks = 1, + }, + .NotificationEndpoint = + { + .Address = CDC_NOTIFICATION_EPADDR, + .Size = CDC_NOTIFICATION_EPSIZE, + .Banks = 1, + }, + }, +}; +#endif + /******************************************************************************* * Console @@ -311,6 +343,12 @@ void EVENT_USB_Device_ConfigurationChanged(void) ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); #endif + +#ifdef VIRTSER_ENABLE + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_OUT_EPADDR, EP_TYPE_BULK, CDC_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_IN_EPADDR, EP_TYPE_BULK, CDC_EPSIZE, ENDPOINT_BANK_SINGLE); +#endif } /* @@ -432,10 +470,15 @@ void EVENT_USB_Device_ControlRequest(void) break; } + +#ifdef VIRTSER_ENABLE + CDC_Device_ProcessControlRequest(&cdc_device); +#endif } /******************************************************************************* * Host driver +p ******************************************************************************/ static uint8_t keyboard_leds(void) { @@ -827,6 +870,61 @@ void MIDI_Task(void) #endif +/******************************************************************************* + * VIRTUAL SERIAL + ******************************************************************************/ + +#ifdef VIRTSER_ENABLE +void virtser_init(void) +{ + cdc_device.State.ControlLineStates.DeviceToHost = CDC_CONTROL_LINE_IN_DSR ; + CDC_Device_SendControlLineStateChange(&cdc_device); +} + +void virtser_recv(uint8_t c) __attribute__ ((weak)); +void virtser_recv(uint8_t c) +{ + // Ignore by default +} + +void virtser_task(void) +{ + uint16_t count = CDC_Device_BytesReceived(&cdc_device); + uint8_t ch; + if (count) + { + ch = CDC_Device_ReceiveByte(&cdc_device); + virtser_recv(ch); + } +} +void virtser_send(const uint8_t byte) +{ + uint8_t timeout = 255; + uint8_t ep = Endpoint_GetCurrentEndpoint(); + + if (cdc_device.State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR) + { + /* IN packet */ + Endpoint_SelectEndpoint(cdc_device.Config.DataINEndpoint.Address); + + if (!Endpoint_IsEnabled() || !Endpoint_IsConfigured()) { + Endpoint_SelectEndpoint(ep); + return; + } + + while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + + Endpoint_Write_8(byte); + CDC_Device_Flush(&cdc_device); + + if (Endpoint_IsINReady()) { + Endpoint_ClearIN(); + } + + Endpoint_SelectEndpoint(ep); + } +} +#endif /******************************************************************************* * main @@ -918,6 +1016,10 @@ int main(void) sleep_led_init(); #endif +#ifdef VIRTSER_ENABLE + virtser_init(); +#endif + print("Keyboard start.\n"); while (1) { #ifndef BLUETOOTH_ENABLE @@ -936,6 +1038,11 @@ int main(void) #endif keyboard_task(); +#ifdef VIRTSER_ENABLE + virtser_task(); + CDC_Device_USBTask(&cdc_device); +#endif + #if !defined(INTERRUPT_CONTROL_ENDPOINT) USB_USBTask(); #endif diff --git a/tmk_core/protocol/midi/Config/LUFAConfig.h b/tmk_core/protocol/midi/Config/LUFAConfig.h index fa9404498..a1d748267 100755 --- a/tmk_core/protocol/midi/Config/LUFAConfig.h +++ b/tmk_core/protocol/midi/Config/LUFAConfig.h @@ -1,93 +1,93 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2012. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * \brief LUFA Library Configuration Header File - * - * This header file is used to configure LUFA's compile time options, - * as an alternative to the compile time constants supplied through - * a makefile. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ - - #if (ARCH == ARCH_AVR8) - - /* Non-USB Related Configuration Tokens: */ -// #define DISABLE_TERMINAL_CODES - - /* USB Class Driver Related Tokens: */ -// #define HID_HOST_BOOT_PROTOCOL_ONLY -// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} -// #define HID_USAGE_STACK_DEPTH {Insert Value Here} -// #define HID_MAX_COLLECTIONS {Insert Value Here} -// #define HID_MAX_REPORTITEMS {Insert Value Here} -// #define HID_MAX_REPORT_IDS {Insert Value Here} -// #define NO_CLASS_DRIVER_AUTOFLUSH - - /* General USB Driver Related Tokens: */ -// #define ORDERED_EP_CONFIG - #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) - #define USB_DEVICE_ONLY -// #define USB_HOST_ONLY -// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} -// #define NO_LIMITED_CONTROLLER_CONNECT -// #define NO_SOF_EVENTS - - /* USB Device Mode Driver Related Tokens: */ -// #define USE_RAM_DESCRIPTORS - #define USE_FLASH_DESCRIPTORS -// #define USE_EEPROM_DESCRIPTORS -// #define NO_INTERNAL_SERIAL - #define FIXED_CONTROL_ENDPOINT_SIZE 8 -// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} - #define FIXED_NUM_CONFIGURATIONS 1 -// #define CONTROL_ONLY_DEVICE -// #define INTERRUPT_CONTROL_ENDPOINT -// #define NO_DEVICE_REMOTE_WAKEUP -// #define NO_DEVICE_SELF_POWER - - /* USB Host Mode Driver Related Tokens: */ -// #define HOST_STATE_AS_GPIOR {Insert Value Here} -// #define USB_HOST_TIMEOUT_MS {Insert Value Here} -// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} -// #define NO_AUTO_VBUS_MANAGEMENT -// #define INVERTED_VBUS_ENABLE_LINE - - #else - - #error Unsupported architecture for this LUFA configuration file. - - #endif -#endif +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Library Configuration Header File + * + * This header file is used to configure LUFA's compile time options, + * as an alternative to the compile time constants supplied through + * a makefile. + * + * For information on what each token does, refer to the LUFA + * manual section "Summary of Compile Tokens". + */ + +#ifndef _LUFA_CONFIG_H_ +#define _LUFA_CONFIG_H_ + + #if (ARCH == ARCH_AVR8) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ +// #define ORDERED_EP_CONFIG + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) + #define USB_DEVICE_ONLY +// #define USB_HOST_ONLY +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE +// #define INTERRUPT_CONTROL_ENDPOINT +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + + /* USB Host Mode Driver Related Tokens: */ +// #define HOST_STATE_AS_GPIOR {Insert Value Here} +// #define USB_HOST_TIMEOUT_MS {Insert Value Here} +// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} +// #define NO_AUTO_VBUS_MANAGEMENT +// #define INVERTED_VBUS_ENABLE_LINE + + #else + + #error Unsupported architecture for this LUFA configuration file. + + #endif +#endif diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index f13351ea1..79fc7119a 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -15,6 +15,29 @@ # Carlos Lamas # +# Enable vpath seraching for source files only +# Without this, output files, could be read from the wrong .build directories +VPATH_SRC := $(VPATH) +vpath %.c $(VPATH_SRC) +vpath %.h $(VPATH_SRC) +vpath %.cpp $(VPATH_SRC) +vpath %.cc $(VPATH_SRC) +vpath %.hpp $(VPATH_SRC) +vpath %.S $(VPATH_SRC) +VPATH := + +# Convert all SRC to OBJ +define OBJ_FROM_SRC +$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$($1_SRC))))) +endef +$(foreach OUTPUT,$(OUTPUTS),$(eval $(OUTPUT)_OBJ +=$(call OBJ_FROM_SRC,$(OUTPUT)))) + +# Define a list of all objects +OBJ := $(foreach OUTPUT,$(OUTPUTS),$($(OUTPUT)_OBJ)) + +MASTER_OUTPUT := $(firstword $(OUTPUTS)) + + # Output format. (can be srec, ihex, binary) FORMAT = ihex @@ -24,55 +47,8 @@ FORMAT = ihex # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) OPT = s -COLOR ?= true - -ifeq ($(COLOR),true) - NO_COLOR=\033[0m - OK_COLOR=\033[32;01m - ERROR_COLOR=\033[31;01m - WARN_COLOR=\033[33;01m - BLUE=\033[0;34m - BOLD=\033[1m -endif - -ifdef quick - QUICK = $(quick) -endif - -QUICK ?= false AUTOGEN ?= false -ifneq ($(shell awk --version 2>/dev/null),) - AWK=awk -else - AWK=cat && test -endif - -OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n -ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n -WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n - -ifndef $(SILENT) - SILENT = false -endif - -TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }' -TAB_LOG_PLAIN = printf "$$LOG\n" -AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' -AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }' -PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && false -PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) -PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && false && break -PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) -PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) -BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; - -# List any extra directories to look for include files here. -# Each directory must be seperated by a space. -# Use forward slashes for directory separators. -# For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS += $(subst :, ,$(VPATH)) - # Compiler flag to set the C Standard level. # c89 = "ANSI" C @@ -83,17 +59,18 @@ CSTANDARD = -std=gnu99 # Place -D or -U options here for C sources -CDEFS += $(OPT_DEFS) +#CDEFS += # Place -D or -U options here for ASM sources -ADEFS += $(OPT_DEFS) +#ADEFS += # Place -D or -U options here for C++ sources #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS -CPPDEFS += $(OPT_DEFS) +#CPPDEFS += + @@ -121,11 +98,7 @@ CFLAGS += -Wstrict-prototypes #CFLAGS += -Wunreachable-code #CFLAGS += -Wsign-compare CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) -CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) CFLAGS += $(CSTANDARD) -ifdef CONFIG_H - CFLAGS += -include $(CONFIG_H) -endif #---------------- Compiler Options C++ ---------------- @@ -148,12 +121,7 @@ CPPFLAGS += -Wundef #CPPFLAGS += -Wunreachable-code #CPPFLAGS += -Wsign-compare CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) -CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) #CPPFLAGS += $(CSTANDARD) -ifdef CONFIG_H - CPPFLAGS += -include $(CONFIG_H) -endif - #---------------- Assembler Options ---------------- # -Wa,...: tell GCC to pass this to the assembler. @@ -164,11 +132,8 @@ endif # files -- see avr-libc docs [FIXME: not yet described there] # -listing-cont-lines: Sets the maximum number of continuation lines of hex # dump that will be displayed for a given single line of source input. -ASFLAGS += $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 -ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -ifdef CONFIG_H - ASFLAGS += -include $(CONFIG_H) -endif +ASFLAGS += $(ADEFS) +ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 #---------------- Library Options ---------------- # Minimalistic printf version @@ -196,6 +161,7 @@ SCANF_LIB = MATH_LIB = -lm +CREATE_MAP ?= yes #---------------- Linker Options ---------------- @@ -206,7 +172,10 @@ MATH_LIB = -lm # Comennt out "--relax" option to avoid a error such: # (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12' # -LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref + +ifeq ($(CREATE_MAP),yes) + LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref +endif #LDFLAGS += -Wl,--relax LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) @@ -223,63 +192,20 @@ COPY = cp WINSHELL = cmd SECHO = $(SILENT) || echo -# Define Messages -# English -MSG_ERRORS_NONE = Errors: none -MSG_BEGIN = -------- begin -------- -MSG_END = -------- end -------- -MSG_SIZE_BEFORE = Size before: -MSG_SIZE_AFTER = Size after: -MSG_COFF = Converting to AVR COFF: -MSG_EXTENDED_COFF = Converting to AVR Extended COFF: -MSG_FLASH = Creating load file for Flash: -MSG_EEPROM = Creating load file for EEPROM: -MSG_BIN = Creating binary load file for Flash: -MSG_EXTENDED_LISTING = Creating Extended Listing: -MSG_SYMBOL_TABLE = Creating Symbol Table: -MSG_LINKING = Linking: -MSG_COMPILING = Compiling: -MSG_COMPILING_CPP = Compiling: -MSG_ASSEMBLING = Assembling: -MSG_CLEANING = Cleaning project: -MSG_CREATING_LIBRARY = Creating library: -MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ - Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\ - git submodule sync --recursive\n\ - git submodule update --init --recursive$(NO_COLOR)\n\n\ - You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\ - or if you have modified the ChibiOS libraries yourself. \n\n - - -# Define all object files. -OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC)))) - -# Define all listing files. -LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC)))) - # Compiler flags to generate dependency files. #GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d -GENDEPFLAGS = -MMD -MP -MF $(BUILD_DIR)/.dep/$(subst /,_,$(subst $(BUILD_DIR)/,,$@)).d +GENDEPFLAGS = -MMD -MP -MF $(patsubst %.o,%.td,$@) # Combine all necessary flags and optional flags. # Add target processor to flags. # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar -ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) -ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) +ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(EXTRAFLAGS) +ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(EXTRAFLAGS) ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) -# Default target. -all: build sizeafter - -# Quick make that doesn't clean -quick: build sizeafter - -# Change the build target to build a HEX file or a library. -build: elf hex -#build: elf hex eep lss sym -#build: lib +MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) elf: $(BUILD_DIR)/$(TARGET).elf @@ -290,15 +216,6 @@ sym: $(BUILD_DIR)/$(TARGET).sym LIBNAME=lib$(TARGET).a lib: $(LIBNAME) -check_submodule: - git submodule status --recursive | \ - while IFS= read -r x; do \ - case "$$x" in \ - \ *) ;; \ - *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \ - esac \ - done - # Display size of file. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf @@ -352,150 +269,112 @@ gccversion : $(eval CMD=$(BIN) $< $@ || exit 0) @$(BUILD_CMD) -# Create library from object files. -.SECONDARY : $(BUILD_DIR)/$(TARGET).a -.PRECIOUS : $(OBJ) -%.a: $(OBJ) - @$(SILENT) || printf "$(MSG_CREATING_LIBRARY) $@" | $(AWK_CMD) - $(eval CMD=$(AR) $@ $(OBJ) ) - @$(BUILD_CMD) - -BEGIN = gccversion check_submodule sizebefore +BEGIN = gccversion sizebefore # Link: create ELF output file from object files. .SECONDARY : $(BUILD_DIR)/$(TARGET).elf .PRECIOUS : $(OBJ) -%.elf: $(OBJ) | $(BEGIN) +# Note the obj.txt depeendency is there to force linking if a source file is deleted +%.elf: $(OBJ) $(MASTER_OUTPUT)/cflags.txt $(MASTER_OUTPUT)/ldflags.txt $(MASTER_OUTPUT)/obj.txt | $(BEGIN) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)) + $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) @$(BUILD_CMD) + + +define GEN_OBJRULE +$1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) +ifdef $1_CONFIG +$1_CONFIG_FLAGS += -include $$($1_CONFIG) +endif +$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) +$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) +$1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) # Compile: create object files from C source files. -$(OBJDIR)/%.o : %.c | $(BEGIN) - @mkdir -p $(@D) - @$(SILENT) || printf "$(MSG_COMPILING) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -c $(ALL_CFLAGS) $< -o $@) - @$(BUILD_CMD) +$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) + @mkdir -p $$(@D) + @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) + $$(eval CMD := $$(CC) -c $$($1_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + @$$(BUILD_CMD) # Compile: create object files from C++ source files. -$(OBJDIR)/%.o : %.cpp | $(BEGIN) - @mkdir -p $(@D) - @$(SILENT) || printf "$(MSG_COMPILING_CPP) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -c $(ALL_CPPFLAGS) $< -o $@) - @$(BUILD_CMD) +$1/%.o : %.cpp $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN) + @mkdir -p $$(@D) + @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) + $$(eval CMD=$$(CC) -c $$($1_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + @$$(BUILD_CMD) -# Compile: create assembler files from C source files. -%.s : %.c | $(BEGIN) - @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -S $(ALL_CFLAGS) $< -o $@) - @$(BUILD_CMD) - -# Compile: create assembler files from C++ source files. -%.s : %.cpp | $(BEGIN) - @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -S $(ALL_CPPFLAGS) $< -o $@) - @$(BUILD_CMD) +$1/%.o : %.cc $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN) + @mkdir -p $$(@D) + @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) + $$(eval CMD=$$(CC) -c $$($1_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + @$$(BUILD_CMD) # Assemble: create object files from assembler source files. -$(OBJDIR)/%.o : %.S | $(BEGIN) - @mkdir -p $(@D) - @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -c $(ALL_ASFLAGS) $< -o $@) - @$(BUILD_CMD) +$1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) + @mkdir -p $$(@D) + @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) + $$(eval CMD=$$(CC) -c $$($1_ASFLAGS) $$< -o $$@) + @$$(BUILD_CMD) + +$1/force: + +$1/cflags.txt: $1/force + echo '$$($1_CFLAGS)' | cmp -s - $$@ || echo '$$($1_CFLAGS)' > $$@ + +$1/cppflags.txt: $1/force + echo '$$($1_CPPFLAGS)' | cmp -s - $$@ || echo '$$($1_CPPFLAGS)' > $$@ + +$1/asflags.txt: $1/force + echo '$$($1_ASFLAGS)' | cmp -s - $$@ || echo '$$($1_ASFLAGS)' > $$@ + +$1/compiler.txt: $1/force + $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@ +endef + +$(MASTER_OUTPUT)/obj.txt: $(MASTER_OUTPUT)/force + echo '$(OBJ)' | cmp -s - $$@ || echo '$(OBJ)' > $$@ + +$(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force + echo '$(LDFLAGS)' | cmp -s - $$@ || echo '$(LDFLAGS)' > $$@ + + +# We have to use static rules for the .d files for some reason +DEPS = $(patsubst %.o,%.d,$(OBJ)) +# Keep the .d files +.PRECIOUS: $(DEPS) +# Empty rule to force recompilation if the .d file is missing +$(DEPS): + + +$(foreach OUTPUT,$(OUTPUTS),$(eval $(call GEN_OBJRULE,$(OUTPUT)))) # Create preprocessed source for use in sending a bug report. %.i : %.c | $(BEGIN) $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ # Target: clean project. -clean: +clean: + $(foreach OUTPUT,$(OUTPUTS), $(REMOVE) -r $(OUTPUT) 2>/dev/null) + $(REMOVE) $(BUILD_DIR)/$(TARGET).* show_path: @echo VPATH=$(VPATH) @echo SRC=$(SRC) - -SUBDIRS := $(filter-out %/util/ %/doc/ %/keymaps/ %/old_keymap_files/,$(dir $(wildcard $(TOP_DIR)/keyboards/**/*/Makefile))) -SUBDIRS := $(SUBDIRS) $(dir $(wildcard $(TOP_DIR)/keyboards/*/.)) -SUBDIRS := $(sort $(SUBDIRS)) -# $(error $(SUBDIRS)) -all-keyboards-defaults-%: - @for x in $(SUBDIRS) ; do \ - printf "Compiling with default: $$x" | $(AWK_CMD); \ - LOG=$$($(MAKE) -C $$x $(subst all-keyboards-defaults-,,$@) VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ - done - -all-keyboards-defaults: all-keyboards-defaults-all - -KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboards/%/=/keyboards/%) -all-keyboards-all: $(addsuffix -all,$(KEYBOARDS)) -all-keyboards-quick: $(addsuffix -quick,$(KEYBOARDS)) -all-keyboards-clean: $(addsuffix -clean,$(KEYBOARDS)) -all-keyboards: all-keyboards-all - -define make_keyboard -$(eval KEYBOARD=$(patsubst /keyboards/%,%,$1)) -$(eval SUBPROJECT=$(lastword $(subst /, ,$(KEYBOARD)))) -$(eval KEYBOARD=$(firstword $(subst /, ,$(KEYBOARD)))) -$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboards/$(KEYBOARD)/keymaps/*/.)))) -$(eval KEYMAPS+=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/*/.)))) -@for x in $(KEYMAPS) ; do \ - printf "Compiling $(BOLD)$(KEYBOARD)/$(SUBPROJECT)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-118s", $$0; }'; \ - LOG=$$($(MAKE) -C $(TOP_DIR)$1 $2 keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ -done -endef - -define make_keyboard_helper -# Just remove the -quick, -all and so on from the first argument and pass it forward -$(call make_keyboard,$(subst -$2,,$1),$2) -endef - -/keyboards/%-quick: - $(call make_keyboard_helper,$@,quick) -/keyboards/%-all: - $(call make_keyboard_helper,$@,all) -/keyboards/%-clean: - $(call make_keyboard_helper,$@,clean) -/keyboards/%: - $(call make_keyboard_helper,$@,all) - -all-keymaps-%: - $(eval MAKECONFIG=$(call get_target,all-keymaps,$@)) - $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboards/$(KEYBOARD)/keymaps/*/.)))) - @for x in $(KEYMAPS) ; do \ - printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-118s", $$0; }'; \ - LOG=$$($(MAKE) $(subst all-keymaps-,,$@) keyboard=$(KEYBOARD) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ - done - -all-keymaps: all-keymaps-all - -GOAL=$(MAKECMDGOALS) -ifeq ($(MAKECMDGOALS),) -GOAL = all -endif -CLEANING_GOALS=clean clean_list all -ifneq ($(findstring $(GOAL),$(CLEANING_GOALS)),) -$(shell $(REMOVE) -r $(BUILD_DIR) 2>/dev/null) -$(shell $(REMOVE) -r $(TOP_DIR)/$(BUILD_DIR)) -$(shell $(REMOVE) -r $(KEYBOARD_PATH)/$(BUILD_DIR)) -$(shell if $$SUBPROJECT; then $(REMOVE) -r $(SUBPROJECT_PATH)/$(BUILD_DIR); fi) -$(shell $(REMOVE) -r $(KEYMAP_PATH)/$(BUILD_DIR)) -endif + @echo OBJ=$(OBJ) # Create build directory -$(shell mkdir $(BUILD_DIR) 2>/dev/null) +$(shell mkdir -p $(BUILD_DIR) 2>/dev/null) # Create object files directory -$(shell mkdir $(OBJDIR) 2>/dev/null) - +$(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) # Include the dependency files. --include $(shell mkdir $(BUILD_DIR)/.dep 2>/dev/null) $(wildcard $(BUILD_DIR)/.dep/*) +-include $(patsubst %.o,%.d,$(OBJ)) # Listing of phony targets. -.PHONY : all quick finish sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff check_submodule \ +.PHONY : all finish sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff \ clean clean_list debug gdb-config show_path \ -program teensy dfu flip dfu-ee flip-ee dfu-start \ -all-keyboards-defaults all-keyboards all-keymaps \ -all-keyboards-defaults-% all-keyboards-% all-keymaps-% +program teensy dfu flip dfu-ee flip-ee dfu-start \ No newline at end of file diff --git a/tmk_core/tool/chibios/ch-bootloader-jump.patch b/tmk_core/tool/chibios/ch-bootloader-jump.patch index d88657621..c6eb2405c 100644 --- a/tmk_core/tool/chibios/ch-bootloader-jump.patch +++ b/tmk_core/tool/chibios/ch-bootloader-jump.patch @@ -3,114 +3,114 @@ index 51a79bb..42d07bd 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s +++ b/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s @@ -105,6 +105,13 @@ - #define CRT0_CALL_DESTRUCTORS TRUE - #endif - -+/** -+ * @brief Magic number for jumping to bootloader. -+ */ -+#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) -+#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF -+#endif -+ - /*===========================================================================*/ - /* Code section. */ - /*===========================================================================*/ + #define CRT0_CALL_DESTRUCTORS TRUE + #endif + ++/** ++ * @brief Magic number for jumping to bootloader. ++ */ ++#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) ++#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF ++#endif ++ + /*===========================================================================*/ + /* Code section. */ + /*===========================================================================*/ @@ -124,6 +131,17 @@ - .thumb_func - .global Reset_Handler - Reset_Handler: -+ -+#ifdef STM32_BOOTLOADER_ADDRESS -+ /* jump to bootloader code */ -+ ldr r0, =__ram0_end__-4 -+ ldr r1, =MAGIC_BOOTLOADER_NUMBER -+ ldr r2, [r0, #0] -+ str r0, [r0, #0] /* erase stored magic */ -+ cmp r2, r1 -+ beq Bootloader_Jump -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - /* Interrupts are globally masked initially.*/ - cpsid i - + .thumb_func + .global Reset_Handler + Reset_Handler: ++ ++#ifdef STM32_BOOTLOADER_ADDRESS ++ /* jump to bootloader code */ ++ ldr r0, =__ram0_end__-4 ++ ldr r1, =MAGIC_BOOTLOADER_NUMBER ++ ldr r2, [r0, #0] ++ str r0, [r0, #0] /* erase stored magic */ ++ cmp r2, r1 ++ beq Bootloader_Jump ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + /* Interrupts are globally masked initially.*/ + cpsid i + @@ -242,6 +260,21 @@ endfiniloop: - ldr r1, =__default_exit - bx r1 - -+#ifdef STM32_BOOTLOADER_ADDRESS -+/* -+ * Jump-to-bootloader function. -+ */ -+ -+ .align 2 -+ .thumb_func -+Bootloader_Jump: -+ ldr r0, =STM32_BOOTLOADER_ADDRESS -+ ldr r1, [r0, #0] -+ mov sp, r1 -+ ldr r0, [r0, #4] -+ bx r0 -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - #endif - - /** @} */ + ldr r1, =__default_exit + bx r1 + ++#ifdef STM32_BOOTLOADER_ADDRESS ++/* ++ * Jump-to-bootloader function. ++ */ ++ ++ .align 2 ++ .thumb_func ++Bootloader_Jump: ++ ldr r0, =STM32_BOOTLOADER_ADDRESS ++ ldr r1, [r0, #0] ++ mov sp, r1 ++ ldr r0, [r0, #4] ++ bx r0 ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + #endif + + /** @} */ diff --git a/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s b/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s index 4812a29..dca9f88 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s +++ b/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s @@ -140,6 +140,13 @@ - #define CRT0_CPACR_INIT 0x00F00000 - #endif - -+/** -+ * @brief Magic number for jumping to bootloader. -+ */ -+#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) -+#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF -+#endif -+ - /*===========================================================================*/ - /* Code section. */ - /*===========================================================================*/ + #define CRT0_CPACR_INIT 0x00F00000 + #endif + ++/** ++ * @brief Magic number for jumping to bootloader. ++ */ ++#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) ++#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF ++#endif ++ + /*===========================================================================*/ + /* Code section. */ + /*===========================================================================*/ @@ -164,6 +171,17 @@ - .thumb_func - .global Reset_Handler - Reset_Handler: -+ -+#ifdef STM32_BOOTLOADER_ADDRESS -+ /* jump to bootloader code */ -+ ldr r0, =__ram0_end__-4 -+ ldr r1, =MAGIC_BOOTLOADER_NUMBER -+ ldr r2, [r0, #0] -+ str r0, [r0, #0] /* erase stored magic */ -+ cmp r2, r1 -+ beq Bootloader_Jump -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - /* Interrupts are globally masked initially.*/ - cpsid i - + .thumb_func + .global Reset_Handler + Reset_Handler: ++ ++#ifdef STM32_BOOTLOADER_ADDRESS ++ /* jump to bootloader code */ ++ ldr r0, =__ram0_end__-4 ++ ldr r1, =MAGIC_BOOTLOADER_NUMBER ++ ldr r2, [r0, #0] ++ str r0, [r0, #0] /* erase stored magic */ ++ cmp r2, r1 ++ beq Bootloader_Jump ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + /* Interrupts are globally masked initially.*/ + cpsid i + @@ -305,6 +323,21 @@ endfiniloop: - /* Branching to the defined exit handler.*/ - b __default_exit - -+#ifdef STM32_BOOTLOADER_ADDRESS -+/* -+ * Jump-to-bootloader function. -+ */ -+ -+ .align 2 -+ .thumb_func -+Bootloader_Jump: -+ ldr r0, =STM32_BOOTLOADER_ADDRESS -+ ldr r1, [r0, #0] -+ mov sp, r1 -+ ldr r0, [r0, #4] -+ bx r0 -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - #endif /* !defined(__DOXYGEN__) */ - - /** @} */ + /* Branching to the defined exit handler.*/ + b __default_exit + ++#ifdef STM32_BOOTLOADER_ADDRESS ++/* ++ * Jump-to-bootloader function. ++ */ ++ ++ .align 2 ++ .thumb_func ++Bootloader_Jump: ++ ldr r0, =STM32_BOOTLOADER_ADDRESS ++ ldr r1, [r0, #0] ++ mov sp, r1 ++ ldr r0, [r0, #4] ++ bx r0 ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + #endif /* !defined(__DOXYGEN__) */ + + /** @} */ diff --git a/util/ergodox_ez.html b/util/ergodox_ez.html new file mode 100644 index 000000000..8e9286607 --- /dev/null +++ b/util/ergodox_ez.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/util/install_dependencies.sh b/util/install_dependencies.sh index 24564a2ac..49ac86e07 100644 --- a/util/install_dependencies.sh +++ b/util/install_dependencies.sh @@ -20,7 +20,8 @@ if [[ -n "$(type -P pacman )" ]]; then arm-none-eabi-gcc \ arm-none-eabi-binutils \ arm-none-eabi-newlib \ - git + git \ + diffutils elif [[ -n "$(type -P apt-get)" ]]; then # Debian and derivatives @@ -47,7 +48,8 @@ elif [[ -n "$(type -P apt-get)" ]]; then gcc-arm-none-eabi \ binutils-arm-none-eabi \ libnewlib-arm-none-eabi \ - git + git \ + diffutils elif [[ -n "$(type -P yum)" ]]; then # Fedora, CentOS or RHEL and derivatives @@ -69,7 +71,8 @@ elif [[ -n "$(type -P yum)" ]]; then gcc-arm-none-eabi \ binutils-arm-none-eabi \ libnewlib-arm-none-eabi \ - git + git \ + diffutils # The listed eabi pacackes do unfortunately not exist for CentOS, # But at least in Fedora they do, so try to install them anyway # TODO: Build them from sources, if the installation fails @@ -85,7 +88,8 @@ elif [[ -n "$(type -P zypper)" ]]; then patch \ wget \ dfu-programmer \ - git + git \ + diffutils # TODO: The avr and eabi tools are not available as default packages, so we need # another way to install them diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index 01317f4be..f432976d0 100644 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -7,6 +7,8 @@ rev=$(git rev-parse --short HEAD) git config --global user.name "Travis CI" git config --global user.email "jack.humb+travis.ci@gmail.com" +make ergodox-ez AUTOGEN=true + find . -name ".build" | xargs rm -rf cd .. git clone https://$GH_TOKEN@github.com/jackhumbert/qmk.fm.git @@ -15,9 +17,11 @@ git submodule update --init --recursive rm -rf keyboard rm -rf keyboards cp -r ../qmk_firmware/keyboards . +mkdir keyboards/ergodox_ez/ +cp ../qmk_firmware/util/ergodox_ez.html keyboards/ergodox_ez/index.html cp ../qmk_firmware/readme.md qmk_readme.md ./generate.sh git add -A git commit -m "generated from qmk_firmware/$TRAVIS_BRANCH@${rev}" -git push \ No newline at end of file +git push