aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile3
-rw-r--r--Makefile57
-rw-r--r--build_keyboard.mk15
-rw-r--r--common.mk1
-rw-r--r--keyboards/amj60/config.h2
-rw-r--r--keyboards/atreus62/Makefile3
-rw-r--r--keyboards/atreus62/atreus62.c1
-rw-r--r--keyboards/atreus62/atreus62.h26
-rw-r--r--keyboards/atreus62/config.h83
-rw-r--r--keyboards/atreus62/keymaps/default/keymap.c71
-rw-r--r--keyboards/atreus62/pro_micro.h362
-rw-r--r--keyboards/atreus62/readme.md10
-rw-r--r--keyboards/atreus62/rules.mk66
-rw-r--r--keyboards/clueboard/rev1/config.h2
-rw-r--r--keyboards/clueboard/rev2/config.h2
-rw-r--r--keyboards/cluecard/config.h2
-rw-r--r--keyboards/cluecard/keymaps/rgb_effects/config.h2
-rw-r--r--keyboards/cluepad/config.h2
-rw-r--r--keyboards/ergodox/ez/Makefile7
-rw-r--r--keyboards/ergodox/ez/config.h13
-rw-r--r--keyboards/ergodox/ez/ez.c10
-rw-r--r--keyboards/ergodox/ez/matrix.c2
-rw-r--r--keyboards/ergodox/ez/rules.mk2
-rw-r--r--keyboards/ergodox/infinity/infinity.c6
-rw-r--r--keyboards/ergodox/infinity/led.c25
-rw-r--r--keyboards/ergodox/infinity/rules.mk2
-rw-r--r--keyboards/ergodox/keymaps/bepo/Makefile9
-rw-r--r--keyboards/ergodox/keymaps/bepo/bepo.pngbin79747 -> 80249 bytes
-rw-r--r--keyboards/ergodox/keymaps/bepo/keymap.c335
-rw-r--r--keyboards/ergodox/keymaps/bepo/readme.md6
-rwxr-xr-xkeyboards/ergodox/keymaps/dvorak_emacs/keymap.c165
-rw-r--r--keyboards/ergodox/keymaps/dvorak_emacs/readme.md70
-rw-r--r--keyboards/ergodox/keymaps/dvorak_plover/README.md14
-rw-r--r--keyboards/ergodox/keymaps/dvorak_plover/keymap.c230
-rw-r--r--keyboards/ergodox/keymaps/erez_experimental/Makefile2
-rw-r--r--keyboards/ergodox/keymaps/erez_experimental/config.h1
-rw-r--r--keyboards/ergodox/keymaps/erez_experimental/keymap.c42
-rw-r--r--keyboards/ergodox/keymaps/galson/Makefile2
-rw-r--r--keyboards/ergodox/keymaps/galson/keymap.c183
-rw-r--r--keyboards/ergodox/keymaps/galson/readme.md11
-rw-r--r--keyboards/ergodox/keymaps/jack/Makefile6
-rw-r--r--keyboards/ergodox/keymaps/jack/config.h17
-rw-r--r--keyboards/ergodox/keymaps/jack/keymap.c22
-rw-r--r--keyboards/ergodox/keymaps/kristian/keymap.c79
-rw-r--r--keyboards/ergodox/keymaps/robot_test_layout/keymap.c151
-rw-r--r--keyboards/ergodox/keymaps/robot_test_layout/readme.md5
-rw-r--r--keyboards/ergodox/keymaps/sethbc/Makefile11
-rw-r--r--keyboards/ergodox/keymaps/sethbc/keymap.c2
-rw-r--r--keyboards/ergodox/keymaps/sethbc/readme.md3
-rw-r--r--keyboards/ergodox/keymaps/videck/Makefile19
-rw-r--r--keyboards/ergodox/keymaps/videck/config.h13
-rw-r--r--keyboards/ergodox/keymaps/videck/keymap.c179
-rw-r--r--keyboards/ergodox/keymaps/videck/readme.md24
-rw-r--r--keyboards/ergodox/keymaps/videck/videck.json443
-rw-r--r--keyboards/ergodox/keymaps/videck/videck.pngbin0 -> 106851 bytes
-rw-r--r--keyboards/ergodox/rules.mk1
-rw-r--r--keyboards/gh60/gh60.h43
-rw-r--r--keyboards/gh60/keymaps/default/keymap.c36
-rw-r--r--keyboards/gh60/keymaps/robotmaxtron/config.h2
-rw-r--r--keyboards/gh60/keymaps/robotmaxtron/keymap.c58
-rw-r--r--keyboards/gh60/keymaps/sethbc/Makefile3
-rw-r--r--keyboards/gh60/keymaps/sethbc/keymap.c76
-rw-r--r--keyboards/handwired/minorca/keymaps/rgb/config.h2
-rw-r--r--keyboards/handwired/promethium/Makefile3
-rw-r--r--keyboards/handwired/promethium/config.h162
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/Makefile28
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/config.h17
-rwxr-xr-xkeyboards/handwired/promethium/keymaps/priyadi/flash.sh3
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/keymap.c725
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/readme.md0
-rw-r--r--keyboards/handwired/promethium/keymaps/readme.md22
-rw-r--r--keyboards/handwired/promethium/promethium.c6
-rw-r--r--keyboards/handwired/promethium/promethium.h101
-rw-r--r--keyboards/handwired/promethium/readme.md13
-rw-r--r--keyboards/handwired/promethium/rgbsps.c24
-rw-r--r--keyboards/handwired/promethium/rgbsps.h4
-rw-r--r--keyboards/handwired/promethium/rules.mk74
-rw-r--r--keyboards/hhkb/keymaps/sh_jp/Makefile1
-rw-r--r--keyboards/hhkb/keymaps/sh_jp/README.md86
-rw-r--r--keyboards/hhkb/keymaps/sh_jp/keymap.c60
-rw-r--r--keyboards/infinity60/chconf.h2
-rw-r--r--keyboards/infinity60/matrix.c7
-rw-r--r--keyboards/jd40/config.h2
-rw-r--r--keyboards/kc60/keymaps/dbroqua/keymap.c2
-rw-r--r--keyboards/kc60/keymaps/ws2812/config.h2
-rw-r--r--keyboards/lets_split/config.h46
-rw-r--r--keyboards/lets_split/keymaps/default/keymap.c46
-rw-r--r--keyboards/lets_split/keymaps/i2c/config.h2
-rw-r--r--keyboards/lets_split/keymaps/serial/config.h2
-rw-r--r--keyboards/lets_split/lets_split.c33
-rw-r--r--keyboards/lets_split/lets_split.h26
-rw-r--r--keyboards/lets_split/rev1/Makefile3
-rw-r--r--keyboards/lets_split/rev1/config.h94
-rw-r--r--keyboards/lets_split/rev1/rev1.c32
-rw-r--r--keyboards/lets_split/rev1/rev1.h28
-rw-r--r--keyboards/lets_split/rev1/rules.mk5
-rw-r--r--keyboards/lets_split/rev2/Makefile3
-rw-r--r--keyboards/lets_split/rev2/config.h102
-rw-r--r--keyboards/lets_split/rev2/rev2.c32
-rw-r--r--keyboards/lets_split/rev2/rev2.h28
-rw-r--r--keyboards/lets_split/rev2/rules.mk5
-rw-r--r--keyboards/lets_split/rules.mk7
-rw-r--r--keyboards/maxipad/Makefile3
-rw-r--r--keyboards/maxipad/config.h169
-rw-r--r--keyboards/maxipad/keymaps/default/Makefile21
-rw-r--r--keyboards/maxipad/keymaps/default/config.h8
-rw-r--r--keyboards/maxipad/keymaps/default/keymap.c54
-rw-r--r--keyboards/maxipad/keymaps/default/readme.md1
-rw-r--r--keyboards/maxipad/maxipad.c28
-rw-r--r--keyboards/maxipad/maxipad.h25
-rw-r--r--keyboards/maxipad/readme.md30
-rw-r--r--keyboards/maxipad/rules.mk67
-rw-r--r--keyboards/phantom/config.h2
-rw-r--r--keyboards/planck/keymaps/cbbrowne/Makefile7
-rw-r--r--keyboards/planck/keymaps/cbbrowne/config.h3
-rw-r--r--keyboards/planck/keymaps/cbbrowne/keymap.c10
-rw-r--r--keyboards/planck/keymaps/default/Makefile8
-rw-r--r--keyboards/planck/keymaps/default/keymap.c4
-rw-r--r--keyboards/planck/keymaps/experimental/config.h2
-rw-r--r--keyboards/planck/keymaps/thermal_printer/Makefile26
-rw-r--r--keyboards/planck/keymaps/thermal_printer/config.h23
-rw-r--r--keyboards/planck/keymaps/thermal_printer/keymap.c314
-rw-r--r--keyboards/planck/keymaps/thermal_printer/readme.md2
-rw-r--r--keyboards/planck/keymaps/yang/config.h2
-rw-r--r--keyboards/planck/rules.mk1
-rw-r--r--keyboards/preonic/config.h2
-rw-r--r--keyboards/preonic/keymaps/default/Makefile22
-rw-r--r--keyboards/preonic/keymaps/kinesis/config.h2
-rw-r--r--keyboards/preonic/rules.mk3
-rw-r--r--keyboards/satan/config.h2
-rw-r--r--keyboards/satan/keymaps/dbroqua_hhkb/keymap.c110
-rw-r--r--keyboards/satan/keymaps/dbroqua_hhkb/readme.md9
-rw-r--r--keyboards/satan/keymaps/sethbc/keymap.c14
-rw-r--r--keyboards/tada68/config.h2
-rw-r--r--keyboards/vision_division/config.h4
-rw-r--r--keyboards/vision_division/keymaps/default/Makefile4
-rw-r--r--keyboards/vision_division/keymaps/default/keymap.c222
-rw-r--r--quantum/api.c178
-rw-r--r--quantum/api.h59
-rw-r--r--quantum/api/api_sysex.c29
-rw-r--r--quantum/api/api_sysex.h10
-rw-r--r--quantum/config_common.h147
-rw-r--r--quantum/keymap.h4
-rw-r--r--quantum/keymap_extras/keymap_jp.h62
-rw-r--r--quantum/keymap_extras/keymap_nordic.h2
-rwxr-xr-xquantum/light_ws2812.c151
-rwxr-xr-xquantum/light_ws2812.h21
-rw-r--r--quantum/matrix.c326
-rw-r--r--quantum/pincontrol.h37
-rw-r--r--quantum/process_keycode/process_printer.c254
-rw-r--r--quantum/process_keycode/process_printer.h8
-rw-r--r--quantum/process_keycode/process_printer_bb.c260
-rw-r--r--quantum/process_keycode/process_unicode.h1
-rw-r--r--quantum/quantum.c59
-rw-r--r--quantum/quantum.h11
-rw-r--r--quantum/rgblight.c145
-rw-r--r--quantum/rgblight.h15
-rw-r--r--readme.md188
-rw-r--r--tmk_core/common.mk6
-rw-r--r--tmk_core/common/avr/suspend.c11
-rw-r--r--tmk_core/common/avr/timer.c36
-rw-r--r--tmk_core/common/backlight.c4
-rw-r--r--tmk_core/common/command.c6
-rw-r--r--tmk_core/common/host_driver.h9
-rw-r--r--tmk_core/protocol/lufa.mk4
-rw-r--r--tmk_core/protocol/lufa/adafruit_ble.cpp805
-rw-r--r--tmk_core/protocol/lufa/adafruit_ble.h60
-rw-r--r--tmk_core/protocol/lufa/lufa.c63
-rw-r--r--tmk_core/protocol/lufa/lufa.h13
-rw-r--r--tmk_core/protocol/lufa/ringbuffer.hpp66
-rw-r--r--tmk_core/protocol/midi.mk1
-rw-r--r--tmk_core/protocol/ps2_mouse.c5
-rw-r--r--tmk_core/ring_buffer.h26
173 files changed, 8249 insertions, 919 deletions
diff --git a/Dockerfile b/Dockerfile
index 744ded857..c42bbeb32 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,5 +25,4 @@ ENV subproject=ez
25ENV keymap=default 25ENV keymap=default
26 26
27VOLUME /qmk 27VOLUME /qmk
28WORKDIR /qmk 28WORKDIR /qmk \ No newline at end of file
29CMD make clean ; make keyboard=${keyboard} subproject=${subproject} keymap=${keymap}
diff --git a/Makefile b/Makefile
index 66c0ff30f..aa33c40f1 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ ERROR_FILE := $(BUILD_DIR)/error_occured
38 38
39MAKEFILE_INCLUDED=yes 39MAKEFILE_INCLUDED=yes
40 40
41# Helper function to process the newt element of a space separated path 41# Helper function to process the newt element of a space separated path
42# It works a bit like the traditional functional head tail 42# It works a bit like the traditional functional head tail
43# so the CURRENT_PATH_ELEMENT will beome the new head 43# so the CURRENT_PATH_ELEMENT will beome the new head
44# and the PATH_ELEMENTS are the rest that are still unprocessed 44# and the PATH_ELEMENTS are the rest that are still unprocessed
@@ -47,16 +47,16 @@ define NEXT_PATH_ELEMENT
47 $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS))) 47 $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
48endef 48endef
49 49
50# We change the / to spaces so that we more easily can work with the elements 50# We change the / to spaces so that we more easily can work with the elements
51# separately 51# separately
52PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR)) 52PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
53# Initialize the path elements list for further processing 53# Initialize the path elements list for further processing
54$(eval $(call NEXT_PATH_ELEMENT)) 54$(eval $(call NEXT_PATH_ELEMENT))
55 55
56# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct 56# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct
57# variables depending on which directory you stand in. 57# variables depending on which directory you stand in.
58# It's really a very simple if else chain, if you squint enough, 58# It's really a very simple if else chain, if you squint enough,
59# but the makefile syntax makes it very verbose. 59# but the makefile syntax makes it very verbose.
60# If we are in a subfolder of keyboards 60# If we are in a subfolder of keyboards
61ifeq ($(CURRENT_PATH_ELEMENT),keyboards) 61ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
62 $(eval $(call NEXT_PATH_ELEMENT)) 62 $(eval $(call NEXT_PATH_ELEMENT))
@@ -111,7 +111,7 @@ endif
111.DEFAULT_GOAL := all 111.DEFAULT_GOAL := all
112ifneq ($(KEYMAP),) 112ifneq ($(KEYMAP),)
113 ifeq ($(SUBPROJECT),) 113 ifeq ($(SUBPROJECT),)
114 # Inside a keymap folder, just build the keymap, with the 114 # Inside a keymap folder, just build the keymap, with the
115 # default subproject 115 # default subproject
116 .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP) 116 .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP)
117 else 117 else
@@ -163,7 +163,7 @@ define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3
163 ifneq ($1,) 163 ifneq ($1,)
164 ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true) 164 ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true)
165 MATCHED_ITEM := $$(firstword $1) 165 MATCHED_ITEM := $$(firstword $1)
166 else 166 else
167 $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1))) 167 $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1)))
168 endif 168 endif
169 endif 169 endif
@@ -171,10 +171,10 @@ endef
171 171
172# A recursive helper function for finding the longest match 172# A recursive helper function for finding the longest match
173# $1 The list to be checed 173# $1 The list to be checed
174# It works by always removing the currently matched item from the list 174# It works by always removing the currently matched item from the list
175# and call itself recursively, until a match is found 175# and call itself recursively, until a match is found
176define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2 176define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
177 # Stop the recursion when the list is empty 177 # Stop the recursion when the list is empty
178 ifneq ($1,) 178 ifneq ($1,)
179 RULE_BEFORE := $$(RULE) 179 RULE_BEFORE := $$(RULE)
180 $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1)) 180 $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1))
@@ -270,7 +270,7 @@ define PARSE_KEYBOARD
270 $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT))) 270 $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT)))
271 # If there's no matching subproject, we assume it's the default 271 # If there's no matching subproject, we assume it's the default
272 # This will allow you to leave the subproject part of the target out 272 # This will allow you to leave the subproject part of the target out
273 else 273 else
274 $$(eval $$(call PARSE_SUBPROJECT,)) 274 $$(eval $$(call PARSE_SUBPROJECT,))
275 endif 275 endif
276endef 276endef
@@ -285,7 +285,7 @@ endef
285# When entering this, the keyboard and subproject are known, so now we need 285# When entering this, the keyboard and subproject are known, so now we need
286# to determine which keymaps are going to get compiled 286# to determine which keymaps are going to get compiled
287define PARSE_SUBPROJECT 287define PARSE_SUBPROJECT
288 # If we want to compile the default subproject, then we need to 288 # If we want to compile the default subproject, then we need to
289 # include the correct makefile to determine the actual name of it 289 # include the correct makefile to determine the actual name of it
290 CURRENT_SP := $1 290 CURRENT_SP := $1
291 ifeq ($$(CURRENT_SP),) 291 ifeq ($$(CURRENT_SP),)
@@ -304,7 +304,7 @@ define PARSE_SUBPROJECT
304 endif 304 endif
305 endif 305 endif
306 # The special allsp is handled later 306 # The special allsp is handled later
307 ifneq ($$(CURRENT_SP),allsp) 307 ifneq ($$(CURRENT_SP),allsp)
308 # get a list of all keymaps 308 # get a list of all keymaps
309 KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) 309 KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
310 ifneq ($$(CURRENT_SP),) 310 ifneq ($$(CURRENT_SP),)
@@ -343,7 +343,7 @@ define PARSE_SUBPROJECT
343 endif 343 endif
344endef 344endef
345 345
346# If we want to parse all subprojects, but the keyboard doesn't have any, 346# If we want to parse all subprojects, but the keyboard doesn't have any,
347# then use defaultsp instead 347# then use defaultsp instead
348define PARSE_ALL_SUBPROJECTS 348define PARSE_ALL_SUBPROJECTS
349 ifeq ($$(SUBPROJECTS),) 349 ifeq ($$(SUBPROJECTS),)
@@ -448,7 +448,7 @@ endef
448 448
449 449
450# Set the silent mode depending on if we are trying to compile multiple keyboards or not 450# Set the silent mode depending on if we are trying to compile multiple keyboards or not
451# By default it's on in that case, but it can be overriden by specifying silent=false 451# By default it's on in that case, but it can be overriden by specifying silent=false
452# from the command line 452# from the command line
453define SET_SILENT_MODE 453define SET_SILENT_MODE
454 ifdef SUB_IS_SILENT 454 ifdef SUB_IS_SILENT
@@ -481,11 +481,12 @@ endef
481# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps 481# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
482SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile))) 482SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile)))
483.PHONY: $(SUBPROJECTS) 483.PHONY: $(SUBPROJECTS)
484$(SUBPROJECTS): %: %-allkm 484$(SUBPROJECTS): %: %-allkm
485 485
486# Let's match everything, we handle all the rule parsing ourselves 486# Let's match everything, we handle all the rule parsing ourselves
487.PHONY: % 487.PHONY: %
488%: 488ifndef SKIP_GIT
489%:
489 # Check if we have the CMP tool installed 490 # Check if we have the CMP tool installed
490 cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; 491 cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
491 # Check if the submodules are dirty, and display a warning if they are 492 # Check if the submodules are dirty, and display a warning if they are
@@ -505,8 +506,24 @@ $(SUBPROJECTS): %: %-allkm
505 # But we return the error code at the end, to trigger travis failures 506 # But we return the error code at the end, to trigger travis failures
506 $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) 507 $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND))
507 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi; 508 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
508 $(foreach TEST,$(TESTS),$(RUN_TEST)) 509 $(foreach TEST,$(TESTS),$(RUN_TEST))
510 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
511else
512%:
513 # Check if we have the CMP tool installed
514 cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
515 rm -f $(ERROR_FILE) > /dev/null 2>&1
516 $(eval $(call PARSE_RULE,$@))
517 $(eval $(call SET_SILENT_MODE))
518 # Run all the commands in the same shell, notice the + at the first line
519 # it has to be there to allow parallel execution of the submake
520 # This always tries to compile everything, even if error occurs in the middle
521 # But we return the error code at the end, to trigger travis failures
522 $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND))
523 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
524 $(foreach TEST,$(TESTS),$(RUN_TEST))
509 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi; 525 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
526endif
510 527
511# All should compile everything 528# All should compile everything
512.PHONY: all 529.PHONY: all
@@ -526,7 +543,11 @@ test: test-all
526test-clean: test-all-clean 543test-clean: test-all-clean
527 544
528# Generate the version.h file 545# Generate the version.h file
529GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") 546ifndef SKIP_GIT
547 GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
548else
549 GIT_VERSION := NA
550endif
530BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") 551BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
531$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) 552$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
532$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) 553$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 61aebf393..ce505de12 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -131,6 +131,14 @@ ifndef CUSTOM_MATRIX
131 SRC += $(QUANTUM_DIR)/matrix.c 131 SRC += $(QUANTUM_DIR)/matrix.c
132endif 132endif
133 133
134ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
135 OPT_DEFS += -DAPI_SYSEX_ENABLE
136 SRC += $(QUANTUM_DIR)/api/api_sysex.c
137 OPT_DEFS += -DAPI_ENABLE
138 SRC += $(QUANTUM_DIR)/api.c
139 MIDI_ENABLE=yes
140endif
141
134ifeq ($(strip $(MIDI_ENABLE)), yes) 142ifeq ($(strip $(MIDI_ENABLE)), yes)
135 OPT_DEFS += -DMIDI_ENABLE 143 OPT_DEFS += -DMIDI_ENABLE
136 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c 144 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
@@ -174,6 +182,12 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
174 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c 182 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
175endif 183endif
176 184
185ifeq ($(strip $(PRINTING_ENABLE)), yes)
186 OPT_DEFS += -DPRINTING_ENABLE
187 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
188 SRC += $(TMK_DIR)/protocol/serial_uart.c
189endif
190
177ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) 191ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
178 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) 192 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
179 OPT_DEFS += $(SERIAL_DEFS) 193 OPT_DEFS += $(SERIAL_DEFS)
@@ -199,6 +213,7 @@ endif
199VPATH += $(KEYBOARD_PATH) 213VPATH += $(KEYBOARD_PATH)
200VPATH += $(COMMON_VPATH) 214VPATH += $(COMMON_VPATH)
201 215
216include $(TMK_PATH)/protocol.mk
202 217
203include $(TMK_PATH)/common.mk 218include $(TMK_PATH)/common.mk
204SRC += $(TMK_COMMON_SRC) 219SRC += $(TMK_COMMON_SRC)
diff --git a/common.mk b/common.mk
index 18751cd5a..c4b9394a2 100644
--- a/common.mk
+++ b/common.mk
@@ -23,4 +23,5 @@ COMMON_VPATH += $(QUANTUM_PATH)
23COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras 23COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
24COMMON_VPATH += $(QUANTUM_PATH)/audio 24COMMON_VPATH += $(QUANTUM_PATH)/audio
25COMMON_VPATH += $(QUANTUM_PATH)/process_keycode 25COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
26COMMON_VPATH += $(QUANTUM_PATH)/api
26COMMON_VPATH += $(SERIAL_PATH) \ No newline at end of file 27COMMON_VPATH += $(SERIAL_PATH) \ No newline at end of file
diff --git a/keyboards/amj60/config.h b/keyboards/amj60/config.h
index d98e0e9f2..7c06f9a6c 100644
--- a/keyboards/amj60/config.h
+++ b/keyboards/amj60/config.h
@@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
67 */ 67 */
68 68
69#define RGB_DI_PIN E2 69#define RGB_DI_PIN E2
70#define RGBLIGHT_TIMER 70#define RGBLIGHT_ANIMATIONS
71#define RGBLED_NUM 8 // Number of LEDs 71#define RGBLED_NUM 8 // Number of LEDs
72#define RGBLIGHT_HUE_STEP 10 72#define RGBLIGHT_HUE_STEP 10
73#define RGBLIGHT_SAT_STEP 17 73#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/atreus62/Makefile b/keyboards/atreus62/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/atreus62/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/atreus62/atreus62.c b/keyboards/atreus62/atreus62.c
new file mode 100644
index 000000000..ba5bce989
--- /dev/null
+++ b/keyboards/atreus62/atreus62.c
@@ -0,0 +1 @@
#include "atreus62.h" \ No newline at end of file
diff --git a/keyboards/atreus62/atreus62.h b/keyboards/atreus62/atreus62.h
new file mode 100644
index 000000000..eacf5b451
--- /dev/null
+++ b/keyboards/atreus62/atreus62.h
@@ -0,0 +1,26 @@
1#ifndef ATREUS62_H
2#define ATREUS62_H
3
4#include "quantum.h"
5
6void promicro_bootloader_jmp(bool program);
7
8// This a shortcut to help you visually see your layout.
9// The first section contains all of the arguements
10// The second converts the arguments into a two-dimensional array
11#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
13 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
14 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
15 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \
16 k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
17) \
18{ \
19 { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \
20 { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \
21 { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \
22 { k30, k31, k32, k33, k34, k35, k46, k36, k37, k38, k39, k3a, k3b }, \
23 { k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b, k4c, k4d } \
24}
25
26#endif \ No newline at end of file
diff --git a/keyboards/atreus62/config.h b/keyboards/atreus62/config.h
new file mode 100644
index 000000000..90a4aa05a
--- /dev/null
+++ b/keyboards/atreus62/config.h
@@ -0,0 +1,83 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24
25#define VENDOR_ID 0xFEED
26#define PRODUCT_ID 0x6062
27#define DEVICE_VER 0x0001
28#define MANUFACTURER Profet
29#define PRODUCT Atreus62
30#define DESCRIPTION q.m.k. keyboard firmware for Atreus62
31
32/* key matrix size */
33// Rows are doubled-up
34#define MATRIX_ROWS 5
35#define MATRIX_COLS 13
36
37// wiring of each half
38#define MATRIX_ROW_PINS { D2, D3, D1, D0, D4 }
39#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, C6 }
40
41#define CATERINA_BOOTLOADER
42
43/* COL2ROW or ROW2COL */
44#define DIODE_DIRECTION ROW2COL
45
46/* define if matrix has ghost */
47//#define MATRIX_HAS_GHOST
48
49/* number of backlight levels */
50// #define BACKLIGHT_LEVELS 3
51
52/* Set 0 if debouncing isn't needed */
53#define DEBOUNCING_DELAY 5
54
55/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
56#define LOCKING_SUPPORT_ENABLE
57/* Locking resynchronize hack */
58#define LOCKING_RESYNC_ENABLE
59
60/* key combination for command */
61#define IS_COMMAND() ( \
62 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
63)
64
65/*
66 * Feature disable options
67 * These options are also useful to firmware size reduction.
68 */
69
70/* disable debug print */
71// #define NO_DEBUG
72
73/* disable print */
74// #define NO_PRINT
75
76/* disable action features */
77//#define NO_ACTION_LAYER
78//#define NO_ACTION_TAPPING
79//#define NO_ACTION_ONESHOT
80//#define NO_ACTION_MACRO
81//#define NO_ACTION_FUNCTION
82
83#endif
diff --git a/keyboards/atreus62/keymaps/default/keymap.c b/keyboards/atreus62/keymaps/default/keymap.c
new file mode 100644
index 000000000..52802c77b
--- /dev/null
+++ b/keyboards/atreus62/keymaps/default/keymap.c
@@ -0,0 +1,71 @@
1// this is the style you want to emulate.
2// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
3
4#include "atreus62.h"
5
6// Each layer gets a name for readability, which is then used in the keymap matrix below.
7// The underscores don't mean anything - you can have a layer called STUFF or any other name.
8// Layer names don't all need to be of the same length, obviously, and you can also skip them
9// entirely and just use numbers.
10#define _DEFAULT 0
11#define _NAV 1
12#define _RESET 2
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15[_DEFAULT] = { /* qwerty */
16 { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS },
17 { KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC },
18 { KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
19 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LBRC },
20 { KC_LCTL, KC_LGUI, KC_LALT, KC_GRV, MO(_NAV),KC_BSPC, KC_ENT, KC_SPC, KC_EQL, KC_MINS, KC_QUOT, KC_ENT, KC_RGUI }
21},
22
23[_NAV] = {
24 { TO(_DEFAULT), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 },
25 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS },
26 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS },
27 { TO(_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 },
28 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS }
29},
30
31[_RESET] = {
32 { TO(_DEFAULT), KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
33 { 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 },
34 { 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 },
35 { 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 },
36 { KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , RESET }
37}
38
39
40/*
41[_TRNS] = {
42 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
43 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
44 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
45 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
46 { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS }
47},
48*/
49};
50
51
52
53const uint16_t PROGMEM fn_actions[] = {
54
55};
56
57const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
58{
59 // MACRODOWN only works in this function
60 switch (id) {
61 case 0:
62 if (record->event.pressed) {
63 register_code(KC_RSFT);
64 }
65 else {
66 unregister_code(KC_RSFT);
67 }
68 break;
69 }
70 return MACRO_NONE;
71};
diff --git a/keyboards/atreus62/pro_micro.h b/keyboards/atreus62/pro_micro.h
new file mode 100644
index 000000000..f9e7ed75d
--- /dev/null
+++ b/keyboards/atreus62/pro_micro.h
@@ -0,0 +1,362 @@
1/*
2 pins_arduino.h - Pin definition functions for Arduino
3 Part of Arduino - http://www.arduino.cc/
4
5 Copyright (c) 2007 David A. Mellis
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General
18 Public License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
21
22 $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23*/
24
25#ifndef Pins_Arduino_h
26#define Pins_Arduino_h
27
28#include <avr/pgmspace.h>
29
30// Workaround for wrong definitions in "iom32u4.h".
31// This should be fixed in the AVR toolchain.
32#undef UHCON
33#undef UHINT
34#undef UHIEN
35#undef UHADDR
36#undef UHFNUM
37#undef UHFNUML
38#undef UHFNUMH
39#undef UHFLEN
40#undef UPINRQX
41#undef UPINTX
42#undef UPNUM
43#undef UPRST
44#undef UPCONX
45#undef UPCFG0X
46#undef UPCFG1X
47#undef UPSTAX
48#undef UPCFG2X
49#undef UPIENX
50#undef UPDATX
51#undef TCCR2A
52#undef WGM20
53#undef WGM21
54#undef COM2B0
55#undef COM2B1
56#undef COM2A0
57#undef COM2A1
58#undef TCCR2B
59#undef CS20
60#undef CS21
61#undef CS22
62#undef WGM22
63#undef FOC2B
64#undef FOC2A
65#undef TCNT2
66#undef TCNT2_0
67#undef TCNT2_1
68#undef TCNT2_2
69#undef TCNT2_3
70#undef TCNT2_4
71#undef TCNT2_5
72#undef TCNT2_6
73#undef TCNT2_7
74#undef OCR2A
75#undef OCR2_0
76#undef OCR2_1
77#undef OCR2_2
78#undef OCR2_3
79#undef OCR2_4
80#undef OCR2_5
81#undef OCR2_6
82#undef OCR2_7
83#undef OCR2B
84#undef OCR2_0
85#undef OCR2_1
86#undef OCR2_2
87#undef OCR2_3
88#undef OCR2_4
89#undef OCR2_5
90#undef OCR2_6
91#undef OCR2_7
92
93#define NUM_DIGITAL_PINS 30
94#define NUM_ANALOG_INPUTS 12
95
96#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
97#define TXLED0 PORTD |= (1<<5)
98#define TXLED1 PORTD &= ~(1<<5)
99#define RXLED0 PORTB |= (1<<0)
100#define RXLED1 PORTB &= ~(1<<0)
101
102static const uint8_t SDA = 2;
103static const uint8_t SCL = 3;
104#define LED_BUILTIN 13
105
106// Map SPI port to 'new' pins D14..D17
107static const uint8_t SS = 17;
108static const uint8_t MOSI = 16;
109static const uint8_t MISO = 14;
110static const uint8_t SCK = 15;
111
112// Mapping of analog pins as digital I/O
113// A6-A11 share with digital pins
114static const uint8_t ADC0 = 18;
115static const uint8_t ADC1 = 19;
116static const uint8_t ADC2 = 20;
117static const uint8_t ADC3 = 21;
118static const uint8_t ADC4 = 22;
119static const uint8_t ADC5 = 23;
120static const uint8_t ADC6 = 24; // D4
121static const uint8_t ADC7 = 25; // D6
122static const uint8_t ADC8 = 26; // D8
123static const uint8_t ADC9 = 27; // D9
124static const uint8_t ADC10 = 28; // D10
125static const uint8_t ADC11 = 29; // D12
126
127#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
128#define digitalPinToPCICRbit(p) 0
129#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
130#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
131
132// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
133extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
134#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
135
136#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
137
138#ifdef ARDUINO_MAIN
139
140// On the Arduino board, digital pins are also used
141// for the analog output (software PWM). Analog input
142// pins are a separate set.
143
144// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
145//
146// D0 PD2 RXD1/INT2
147// D1 PD3 TXD1/INT3
148// D2 PD1 SDA SDA/INT1
149// D3# PD0 PWM8/SCL OC0B/SCL/INT0
150// D4 A6 PD4 ADC8
151// D5# PC6 ??? OC3A/#OC4A
152// D6# A7 PD7 FastPWM #OC4D/ADC10
153// D7 PE6 INT6/AIN0
154//
155// D8 A8 PB4 ADC11/PCINT4
156// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
157// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
158// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
159// D12 A11 PD6 T1/#OC4D/ADC9
160// D13# PC7 PWM10 CLK0/OC4A
161//
162// A0 D18 PF7 ADC7
163// A1 D19 PF6 ADC6
164// A2 D20 PF5 ADC5
165// A3 D21 PF4 ADC4
166// A4 D22 PF1 ADC1
167// A5 D23 PF0 ADC0
168//
169// New pins D14..D17 to map SPI port to digital pins
170//
171// MISO D14 PB3 MISO,PCINT3
172// SCK D15 PB1 SCK,PCINT1
173// MOSI D16 PB2 MOSI,PCINT2
174// SS D17 PB0 RXLED,SS/PCINT0
175//
176// Connected LEDs on board for TX and RX
177// TXLED D24 PD5 XCK1
178// RXLED D17 PB0
179// HWB PE2 HWB
180
181// these arrays map port names (e.g. port B) to the
182// appropriate addresses for various functions (e.g. reading
183// and writing)
184const uint16_t PROGMEM port_to_mode_PGM[] = {
185 NOT_A_PORT,
186 NOT_A_PORT,
187 (uint16_t) &DDRB,
188 (uint16_t) &DDRC,
189 (uint16_t) &DDRD,
190 (uint16_t) &DDRE,
191 (uint16_t) &DDRF,
192};
193
194const uint16_t PROGMEM port_to_output_PGM[] = {
195 NOT_A_PORT,
196 NOT_A_PORT,
197 (uint16_t) &PORTB,
198 (uint16_t) &PORTC,
199 (uint16_t) &PORTD,
200 (uint16_t) &PORTE,
201 (uint16_t) &PORTF,
202};
203
204const uint16_t PROGMEM port_to_input_PGM[] = {
205 NOT_A_PORT,
206 NOT_A_PORT,
207 (uint16_t) &PINB,
208 (uint16_t) &PINC,
209 (uint16_t) &PIND,
210 (uint16_t) &PINE,
211 (uint16_t) &PINF,
212};
213
214const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
215 PD, // D0 - PD2
216 PD, // D1 - PD3
217 PD, // D2 - PD1
218 PD, // D3 - PD0
219 PD, // D4 - PD4
220 PC, // D5 - PC6
221 PD, // D6 - PD7
222 PE, // D7 - PE6
223
224 PB, // D8 - PB4
225 PB, // D9 - PB5
226 PB, // D10 - PB6
227 PB, // D11 - PB7
228 PD, // D12 - PD6
229 PC, // D13 - PC7
230
231 PB, // D14 - MISO - PB3
232 PB, // D15 - SCK - PB1
233 PB, // D16 - MOSI - PB2
234 PB, // D17 - SS - PB0
235
236 PF, // D18 - A0 - PF7
237 PF, // D19 - A1 - PF6
238 PF, // D20 - A2 - PF5
239 PF, // D21 - A3 - PF4
240 PF, // D22 - A4 - PF1
241 PF, // D23 - A5 - PF0
242
243 PD, // D24 - PD5
244 PD, // D25 / D6 - A7 - PD7
245 PB, // D26 / D8 - A8 - PB4
246 PB, // D27 / D9 - A9 - PB5
247 PB, // D28 / D10 - A10 - PB6
248 PD, // D29 / D12 - A11 - PD6
249};
250
251const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
252 _BV(2), // D0 - PD2
253 _BV(3), // D1 - PD3
254 _BV(1), // D2 - PD1
255 _BV(0), // D3 - PD0
256 _BV(4), // D4 - PD4
257 _BV(6), // D5 - PC6
258 _BV(7), // D6 - PD7
259 _BV(6), // D7 - PE6
260
261 _BV(4), // D8 - PB4
262 _BV(5), // D9 - PB5
263 _BV(6), // D10 - PB6
264 _BV(7), // D11 - PB7
265 _BV(6), // D12 - PD6
266 _BV(7), // D13 - PC7
267
268 _BV(3), // D14 - MISO - PB3
269 _BV(1), // D15 - SCK - PB1
270 _BV(2), // D16 - MOSI - PB2
271 _BV(0), // D17 - SS - PB0
272
273 _BV(7), // D18 - A0 - PF7
274 _BV(6), // D19 - A1 - PF6
275 _BV(5), // D20 - A2 - PF5
276 _BV(4), // D21 - A3 - PF4
277 _BV(1), // D22 - A4 - PF1
278 _BV(0), // D23 - A5 - PF0
279
280 _BV(5), // D24 - PD5
281 _BV(7), // D25 / D6 - A7 - PD7
282 _BV(4), // D26 / D8 - A8 - PB4
283 _BV(5), // D27 / D9 - A9 - PB5
284 _BV(6), // D28 / D10 - A10 - PB6
285 _BV(6), // D29 / D12 - A11 - PD6
286};
287
288const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
289 NOT_ON_TIMER,
290 NOT_ON_TIMER,
291 NOT_ON_TIMER,
292 TIMER0B, /* 3 */
293 NOT_ON_TIMER,
294 TIMER3A, /* 5 */
295 TIMER4D, /* 6 */
296 NOT_ON_TIMER,
297
298 NOT_ON_TIMER,
299 TIMER1A, /* 9 */
300 TIMER1B, /* 10 */
301 TIMER0A, /* 11 */
302
303 NOT_ON_TIMER,
304 TIMER4A, /* 13 */
305
306 NOT_ON_TIMER,
307 NOT_ON_TIMER,
308 NOT_ON_TIMER,
309 NOT_ON_TIMER,
310 NOT_ON_TIMER,
311 NOT_ON_TIMER,
312
313 NOT_ON_TIMER,
314 NOT_ON_TIMER,
315 NOT_ON_TIMER,
316 NOT_ON_TIMER,
317 NOT_ON_TIMER,
318 NOT_ON_TIMER,
319 NOT_ON_TIMER,
320 NOT_ON_TIMER,
321 NOT_ON_TIMER,
322 NOT_ON_TIMER,
323};
324
325const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
326 7, // A0 PF7 ADC7
327 6, // A1 PF6 ADC6
328 5, // A2 PF5 ADC5
329 4, // A3 PF4 ADC4
330 1, // A4 PF1 ADC1
331 0, // A5 PF0 ADC0
332 8, // A6 D4 PD4 ADC8
333 10, // A7 D6 PD7 ADC10
334 11, // A8 D8 PB4 ADC11
335 12, // A9 D9 PB5 ADC12
336 13, // A10 D10 PB6 ADC13
337 9 // A11 D12 PD6 ADC9
338};
339
340#endif /* ARDUINO_MAIN */
341
342// These serial port names are intended to allow libraries and architecture-neutral
343// sketches to automatically default to the correct port name for a particular type
344// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
345// the first hardware serial port whose RX/TX pins are not dedicated to another use.
346//
347// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
348//
349// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
350//
351// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
352//
353// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
354//
355// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
356// pins are NOT connected to anything by default.
357#define SERIAL_PORT_MONITOR Serial
358#define SERIAL_PORT_USBVIRTUAL Serial
359#define SERIAL_PORT_HARDWARE Serial1
360#define SERIAL_PORT_HARDWARE_OPEN Serial1
361
362#endif /* Pins_Arduino_h */
diff --git a/keyboards/atreus62/readme.md b/keyboards/atreus62/readme.md
new file mode 100644
index 000000000..0245b4f9f
--- /dev/null
+++ b/keyboards/atreus62/readme.md
@@ -0,0 +1,10 @@
1atreus62 keyboard firmware
2======================
3
4This firmware is for the atreus62 keyboard.
5
6This version utilizes a Pro Micro for its controller and has a 62 key layout.
7
8https://github.com/profet23/atreus62
9
10TODO: More information \ No newline at end of file
diff --git a/keyboards/atreus62/rules.mk b/keyboards/atreus62/rules.mk
new file mode 100644
index 000000000..f5d0be23a
--- /dev/null
+++ b/keyboards/atreus62/rules.mk
@@ -0,0 +1,66 @@
1
2# MCU name
3#MCU = at90usb1287
4MCU = atmega32u4
5
6# Processor frequency.
7# This will define a symbol, F_CPU, in all source code files equal to the
8# processor frequency in Hz. You can then use this symbol in your source code to
9# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
10# automatically to create a 32-bit value in your source code.
11#
12# This will be an integer division of F_USB below, as it is sourced by
13# F_USB after it has run through any CPU prescalers. Note that this value
14# does not *change* the processor frequency - it should merely be updated to
15# reflect the processor speed set externally so that the code can use accurate
16# software delays.
17F_CPU = 16000000
18
19#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = AVR8
24
25# Input clock frequency.
26# This will define a symbol, F_USB, in all source code files equal to the
27# input clock frequency (before any prescaling is performed) in Hz. This value may
28# differ from F_CPU if prescaling is used on the latter, and is required as the
29# raw input clock is fed directly to the PLL sections of the AVR for high speed
30# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31# at the end, this will be done automatically to create a 32-bit value in your
32# source code.
33#
34# If no clock division is performed on the input clock inside the AVR (via the
35# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 1024
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=4096
49
50# Build Options
51# change to "no" to disable the options, or define them in the Makefile in
52# the appropriate keymap folder that will get included automatically
53#
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= yes # Console for debug(+400)
58COMMAND_ENABLE ?= yes # Commands for debug and configuration
59NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60#BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
61#MIDI_ENABLE ?= no # MIDI controls
62UNICODE_ENABLE ?= yes # Unicode
63#BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
64
65# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
66SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
diff --git a/keyboards/clueboard/rev1/config.h b/keyboards/clueboard/rev1/config.h
index 8c9497232..f40876ffb 100644
--- a/keyboards/clueboard/rev1/config.h
+++ b/keyboards/clueboard/rev1/config.h
@@ -26,7 +26,7 @@
26/* Underlight configuration 26/* Underlight configuration
27 */ 27 */
28#define RGB_DI_PIN B2 28#define RGB_DI_PIN B2
29#define RGBLIGHT_TIMER 29#define RGBLIGHT_ANIMATIONS
30#define RGBLED_NUM 14 // Number of LEDs 30#define RGBLED_NUM 14 // Number of LEDs
31#define RGBLIGHT_HUE_STEP 10 31#define RGBLIGHT_HUE_STEP 10
32#define RGBLIGHT_SAT_STEP 17 32#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h
index 15ca4ece8..8435fd02b 100644
--- a/keyboards/clueboard/rev2/config.h
+++ b/keyboards/clueboard/rev2/config.h
@@ -30,7 +30,7 @@
30/* Underlight configuration 30/* Underlight configuration
31 */ 31 */
32#define RGB_DI_PIN D7 32#define RGB_DI_PIN D7
33#define RGBLIGHT_TIMER 33#define RGBLIGHT_ANIMATIONS
34#define RGBLED_NUM 14 // Number of LEDs 34#define RGBLED_NUM 14 // Number of LEDs
35#define RGBLIGHT_HUE_STEP 10 35#define RGBLIGHT_HUE_STEP 10
36#define RGBLIGHT_SAT_STEP 17 36#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/cluecard/config.h b/keyboards/cluecard/config.h
index 765347b13..6520eb557 100644
--- a/keyboards/cluecard/config.h
+++ b/keyboards/cluecard/config.h
@@ -140,7 +140,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
140/* Underlight configuration 140/* Underlight configuration
141 */ 141 */
142#define RGB_DI_PIN E6 142#define RGB_DI_PIN E6
143//#define RGBLIGHT_TIMER 143//#define RGBLIGHT_ANIMATIONS
144#define RGBLED_NUM 4 // Number of LEDs 144#define RGBLED_NUM 4 // Number of LEDs
145#define RGBLIGHT_HUE_STEP 10 145#define RGBLIGHT_HUE_STEP 10
146#define RGBLIGHT_SAT_STEP 17 146#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/cluecard/keymaps/rgb_effects/config.h b/keyboards/cluecard/keymaps/rgb_effects/config.h
index e88847df4..c6c9342c8 100644
--- a/keyboards/cluecard/keymaps/rgb_effects/config.h
+++ b/keyboards/cluecard/keymaps/rgb_effects/config.h
@@ -4,7 +4,7 @@
4#include "../../config.h" 4#include "../../config.h"
5 5
6// place overrides here 6// place overrides here
7#define RGBLIGHT_TIMER 7#define RGBLIGHT_ANIMATIONS
8#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 8#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3
9#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 9#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
10#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 10#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2
diff --git a/keyboards/cluepad/config.h b/keyboards/cluepad/config.h
index bae05fade..bd64dfd27 100644
--- a/keyboards/cluepad/config.h
+++ b/keyboards/cluepad/config.h
@@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
70/* Underlight configuration 70/* Underlight configuration
71 */ 71 */
72#define RGB_DI_PIN F6 72#define RGB_DI_PIN F6
73#define RGBLIGHT_TIMER 73#define RGBLIGHT_ANIMATIONS
74#define RGBLED_NUM 4 // Number of LEDs 74#define RGBLED_NUM 4 // Number of LEDs
75#define RGBLIGHT_HUE_STEP 10 75#define RGBLIGHT_HUE_STEP 10
76#define RGBLIGHT_SAT_STEP 17 76#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/ergodox/ez/Makefile b/keyboards/ergodox/ez/Makefile
index 191c6bb66..9b6121e2c 100644
--- a/keyboards/ergodox/ez/Makefile
+++ b/keyboards/ergodox/ez/Makefile
@@ -1,3 +1,8 @@
1SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
2COMMAND_ENABLE = no # Commands for debug and configuration
3RGBLIGHT_ENABLE ?= yes
4MIDI_ENABLE ?= yes
5
1ifndef MAKEFILE_INCLUDED 6ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile 7 include ../../../Makefile
3endif \ No newline at end of file 8endif
diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h
index 084a044ee..c2750a321 100644
--- a/keyboards/ergodox/ez/config.h
+++ b/keyboards/ergodox/ez/config.h
@@ -21,6 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22#include "../config.h" 22#include "../config.h"
23 23
24#include "config_common.h"
25
24/* USB Device descriptor parameter */ 26/* USB Device descriptor parameter */
25#define VENDOR_ID 0xFEED 27#define VENDOR_ID 0xFEED
26#define PRODUCT_ID 0x1307 28#define PRODUCT_ID 0x1307
@@ -39,6 +41,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
39#define LED_BRIGHTNESS_LO 15 41#define LED_BRIGHTNESS_LO 15
40#define LED_BRIGHTNESS_HI 255 42#define LED_BRIGHTNESS_HI 255
41 43
44/* ws2812 RGB LED */
45#define RGB_DI_PIN D7
46#define RGBLIGHT_ANIMATIONS
47#define RGBLED_NUM 15 // Number of LEDs
48#define RGBLIGHT_HUE_STEP 12
49#define RGBLIGHT_SAT_STEP 255
50#define RGBLIGHT_VAL_STEP 12
51
52#define RGB_MIDI
53#define RGBW_BB_TWI
54
42 55
43/* Set 0 if debouncing isn't needed */ 56/* Set 0 if debouncing isn't needed */
44#define DEBOUNCE 5 57#define DEBOUNCE 5
diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c
index ddb8ff0cf..039e4c6bb 100644
--- a/keyboards/ergodox/ez/ez.c
+++ b/keyboards/ergodox/ez/ez.c
@@ -16,10 +16,10 @@ void matrix_init_kb(void) {
16 // unused pins - C7, D4, D5, D7, E6 16 // unused pins - C7, D4, D5, D7, E6
17 // set as input with internal pull-ip enabled 17 // set as input with internal pull-ip enabled
18 DDRC &= ~(1<<7); 18 DDRC &= ~(1<<7);
19 DDRD &= ~(1<<7 | 1<<5 | 1<<4); 19 DDRD &= ~(1<<5 | 1<<4);
20 DDRE &= ~(1<<6); 20 DDRE &= ~(1<<6);
21 PORTC |= (1<<7); 21 PORTC |= (1<<7);
22 PORTD |= (1<<7 | 1<<5 | 1<<4); 22 PORTD |= (1<<5 | 1<<4);
23 PORTE |= (1<<6); 23 PORTE |= (1<<6);
24 24
25 ergodox_blink_all_leds(); 25 ergodox_blink_all_leds();
@@ -51,6 +51,10 @@ uint8_t init_mcp23018(void) {
51 mcp23018_status = 0x20; 51 mcp23018_status = 0x20;
52 52
53 // I2C subsystem 53 // I2C subsystem
54
55 uint8_t sreg_prev;
56 sreg_prev=SREG;
57 cli();
54 if (i2c_initialized == 0) { 58 if (i2c_initialized == 0) {
55 i2c_init(); // on pins D(1,0) 59 i2c_init(); // on pins D(1,0)
56 i2c_initialized++; 60 i2c_initialized++;
@@ -79,6 +83,8 @@ uint8_t init_mcp23018(void) {
79out: 83out:
80 i2c_stop(); 84 i2c_stop();
81 85
86 SREG=sreg_prev;
87
82 return mcp23018_status; 88 return mcp23018_status;
83} 89}
84 90
diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c
index a19bab90b..43f515259 100644
--- a/keyboards/ergodox/ez/matrix.c
+++ b/keyboards/ergodox/ez/matrix.c
@@ -121,7 +121,7 @@ void matrix_init(void)
121 matrix_scan_count = 0; 121 matrix_scan_count = 0;
122#endif 122#endif
123 123
124 matrix_init_kb(); 124 matrix_init_quantum();
125 125
126} 126}
127 127
diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk
index a9715beb8..893cfa7a8 100644
--- a/keyboards/ergodox/ez/rules.mk
+++ b/keyboards/ergodox/ez/rules.mk
@@ -72,6 +72,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
72# 72#
73 73
74SLEEP_LED_ENABLE = no 74SLEEP_LED_ENABLE = no
75API_SYSEX_ENABLE ?= yes
76RGBLIGHT_ENABLE ?= yes
75 77
76ifndef QUANTUM_DIR 78ifndef QUANTUM_DIR
77 include ../../../Makefile 79 include ../../../Makefile
diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c
index c5793385f..02db67eaf 100644
--- a/keyboards/ergodox/infinity/infinity.c
+++ b/keyboards/ergodox/infinity/infinity.c
@@ -38,7 +38,6 @@ void init_serial_link_hal(void) {
38// Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced 38// Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced
39// Which will reduce the brightness range 39// Which will reduce the brightness range
40#define PRESCALAR_DEFINE 0 40#define PRESCALAR_DEFINE 0
41#ifdef VISUALIZER_ENABLE
42void lcd_backlight_hal_init(void) { 41void lcd_backlight_hal_init(void) {
43 // Setup Backlight 42 // Setup Backlight
44 SIM->SCGC6 |= SIM_SCGC6_FTM0; 43 SIM->SCGC6 |= SIM_SCGC6_FTM0;
@@ -76,7 +75,6 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
76 CHANNEL_GREEN.CnV = g; 75 CHANNEL_GREEN.CnV = g;
77 CHANNEL_BLUE.CnV = b; 76 CHANNEL_BLUE.CnV = b;
78} 77}
79#endif
80 78
81__attribute__ ((weak)) 79__attribute__ ((weak))
82void matrix_init_user(void) { 80void matrix_init_user(void) {
@@ -92,6 +90,10 @@ void matrix_init_kb(void) {
92 // runs once when the firmware starts up 90 // runs once when the firmware starts up
93 91
94 matrix_init_user(); 92 matrix_init_user();
93 // The backlight always has to be initialized, otherwise it will stay lit
94#ifndef VISUALIZER_ENABLE
95 lcd_backlight_hal_init();
96#endif
95} 97}
96 98
97void matrix_scan_kb(void) { 99void matrix_scan_kb(void) {
diff --git a/keyboards/ergodox/infinity/led.c b/keyboards/ergodox/infinity/led.c
index 77195bb35..8175c1c5c 100644
--- a/keyboards/ergodox/infinity/led.c
+++ b/keyboards/ergodox/infinity/led.c
@@ -21,29 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22 22
23void led_set(uint8_t usb_led) { 23void led_set(uint8_t usb_led) {
24// The LCD backlight functionality conflicts with this simple 24 //TODO: Add led emulation if there's no customized visualization
25// red backlight
26#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE)
27 // PTC1: LCD Backlight Red(0:on/1:off)
28 GPIOC->PDDR |= (1<<1);
29 PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
30 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
31 GPIOC->PCOR |= (1<<1);
32 } else {
33 GPIOC->PSOR |= (1<<1);
34 }
35#elif !defined(LCD_BACKLIGHT_ENABLE)
36 (void)usb_led; 25 (void)usb_led;
37 GPIOC->PDDR |= (1<<1);
38 PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
39 GPIOC->PSOR |= (1<<1);
40 GPIOC->PDDR |= (1<<2);
41 PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
42 GPIOC->PSOR |= (1<<2);
43 GPIOC->PDDR |= (1<<3);
44 PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
45 GPIOC->PSOR |= (1<<3);
46#else
47 (void)usb_led;
48#endif
49} 26}
diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk
index ccb735a48..473a6dfec 100644
--- a/keyboards/ergodox/infinity/rules.mk
+++ b/keyboards/ergodox/infinity/rules.mk
@@ -63,6 +63,8 @@ VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile
63LCD_ENABLE ?= yes 63LCD_ENABLE ?= yes
64LED_ENABLE ?= yes 64LED_ENABLE ?= yes
65LCD_BACKLIGHT_ENABLE ?= yes 65LCD_BACKLIGHT_ENABLE ?= yes
66MIDI_ENABLE = no
67RGBLIGHT_ENABLE = no
66 68
67ifndef QUANTUM_DIR 69ifndef QUANTUM_DIR
68 include ../../../Makefile 70 include ../../../Makefile
diff --git a/keyboards/ergodox/keymaps/bepo/Makefile b/keyboards/ergodox/keymaps/bepo/Makefile
new file mode 100644
index 000000000..b673c5ce5
--- /dev/null
+++ b/keyboards/ergodox/keymaps/bepo/Makefile
@@ -0,0 +1,9 @@
1# Having a file like this allows you to override Makefile definitions
2# for your own particular keymap
3
4SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
5COMMAND_ENABLE = no # Commands for debug and configuration
6
7ifndef QUANTUM_DIR
8 include ../../../../Makefile
9endif
diff --git a/keyboards/ergodox/keymaps/bepo/bepo.png b/keyboards/ergodox/keymaps/bepo/bepo.png
index 3df7aa609..54992f5ae 100644
--- a/keyboards/ergodox/keymaps/bepo/bepo.png
+++ b/keyboards/ergodox/keymaps/bepo/bepo.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c
index 2d88fc10e..05250ee6a 100644
--- a/keyboards/ergodox/keymaps/bepo/keymap.c
+++ b/keyboards/ergodox/keymaps/bepo/keymap.c
@@ -1,21 +1,23 @@
1#include "ergodox.h" 1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "keymap_bepo.h" 2#include "keymap_bepo.h"
3#include "keymap_french.h"
5 4
6#define BASE 0 // default layer 5// keymaps
7#define QWER 1 // qwerty compat layer 6#define BEPO 0 // default layer, for bepo compatible systems
8#define SQWER 2 // shifted qwerty compat layer 7#define QW_B 1 // bepo to qwerty base compat layer, for qwerty systems
9#define AQWER 3 // alted qwerty compat layer 8#define QW_A 2 // bepo with altgr key to qwerty compat layer
10#define FNAV 4 // function / navigation keys 9#define QW_S 3 // bepo with shift key to qwerty compat layer
11#define NUM 5 // numeric keypad keys 10#define AZ_B 4 // bepo to azerty base compat layer, for azerty systems
12#define MSE 6 // mouse keys 11#define AZ_A 5 // bepo with altgr key to azerty compat layer
12#define AZ_S 6 // bepo with shift key to azerty compat layer
13#define FNAV 7 // function / navigation / mouse layer
14#define NUMK 8 // numeric keypad layer
13 15
14#define KP_00 0 16// macros
15#define CA_Fx 1 17#define KP_00 0 // keypad "double 0"
16 18
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18/* Keymap 0: Base layer 20/* Keymap 0: default layer
19 * 21 *
20 * ,--------------------------------------------------. ,--------------------------------------------------. 22 * ,--------------------------------------------------. ,--------------------------------------------------.
21 * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | 23 * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = |
@@ -26,22 +28,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| 28 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
27 * | E_CIRC |A_GRAV| Y | X | . | K | | | | ' | Q | G | H | F | C_CEDIL| 29 * | E_CIRC |A_GRAV| Y | X | . | K | | | | ' | Q | G | H | F | C_CEDIL|
28 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' 30 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
29 * |QWERTY| |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| 31 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
30 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' 32 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
31 * | | | L_Num| | CA_Fx| | | 33 * | | |L_NumK| |L_NumK| | |
32 * | Space|LShift|------| |------|RShift|Enter | 34 * | Space|LShift|------| |------|RShift|Enter |
33 * | | |L_FNav| |L_FNav| | | 35 * | | |L_FNav| |L_FNav| | |
34 * `--------------------' `--------------------' 36 * `--------------------' `--------------------'
35 */ 37 */
36[BASE] = KEYMAP( 38[BEPO] = KEYMAP(
37// Left hand 39// Left hand
38BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, 40BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL,
39BP_PERCENT, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC, 41BP_PERCENT, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC,
40BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA, 42BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA,
41BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB, 43BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB,
42TG(QWER), KC_NO, KC_LGUI, KC_LCTL, KC_LALT, 44KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT,
43 KC_ESC, MO(MSE), 45 DF(BEPO), DF(QW_B),
44 MO(NUM), 46 MO(NUMK),
45 KC_SPC, KC_LSHIFT, MO(FNAV), 47 KC_SPC, KC_LSHIFT, MO(FNAV),
46// Right hand 48// Right hand
47 KC_SLCK, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL, 49 KC_SLCK, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL,
@@ -49,10 +51,10 @@ TG(QWER), KC_NO, KC_LGUI, KC_LCTL, KC_LALT,
49 BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, 51 BP_C, BP_T, BP_S, BP_R, BP_N, BP_M,
50 KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, 52 KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED,
51 BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, 53 BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE,
52KC_NO, KC_INS, 54DF(AZ_B), DF(BEPO),
53M(CA_Fx), 55MO(NUMK),
54MO(FNAV), KC_RSHIFT, KC_ENTER), 56MO(FNAV), KC_RSHIFT, KC_ENTER),
55/* Keymap 1: QWERTY system compatibility layer 57/* Keymap 1: bepo to qwerty base compat layer
56 * 58 *
57 * ,--------------------------------------------------. ,--------------------------------------------------. 59 * ,--------------------------------------------------. ,--------------------------------------------------.
58 * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | 60 * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = |
@@ -63,33 +65,70 @@ MO(FNAV), KC_RSHIFT, KC_ENTER),
63 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| 65 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
64 * | e | a | y | x | . | k | | | | ' | q | g | h | f | c | 66 * | e | a | y | x | . | k | | | | ' | q | g | h | f | c |
65 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' 67 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
66 * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| 68 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
67 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' 69 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
68 * | | | L_Num| | | | | 70 * | | |L_NumK| |L_NumK| | |
69 * | Space|LShift|------| |------|RShift|Enter | 71 * | Space|LShift|------| |------|RShift|Enter |
70 * | | |L_FNav| |L_FNav| | | 72 * | | |L_FNav| |L_FNav| | |
71 * `--------------------' `--------------------' 73 * `--------------------' `--------------------'
72 */ 74 */
73[QWER] = KEYMAP( 75[QW_B] = KEYMAP(
74// Left hand 76// Left hand
75KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL, 77KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL,
76KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC, 78KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC,
77KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA, 79KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA,
78KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB, 80KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB,
79KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, 81KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT,
80 KC_ESC, MO(MSE), 82 KC_TRNS, KC_TRNS,
81 MO(NUM), 83 KC_TRNS,
82 KC_SPC, MO(SQWER), MO(FNAV), 84 KC_SPC, MO(QW_S), KC_TRNS,
83// Right hand 85// Right hand
84 KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, 86 KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL,
85 KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, 87 KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z,
86 KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, 88 KC_C, KC_T, KC_S, KC_R, KC_N, KC_M,
87 KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, 89 KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C,
88 MO(AQWER), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, 90 MO(QW_A), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE,
89KC_NO, KC_INS, 91KC_TRNS, KC_TRNS,
92KC_TRNS,
93KC_TRNS, MO(QW_S), KC_ENTER),
94/* Keymap 2: bepo with altgr key to qwerty compat layer
95 *
96 * ,--------------------------------------------------. ,--------------------------------------------------.
97 * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = |
98 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
99 * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z |
100 * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------|
101 * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m |
102 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
103 * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c |
104 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
105 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
106 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
107 * | | |L_NumK| |L_NumK| | |
108 * | _ |LShift|------| |------|RShift|Enter |
109 * | | |L_FNav| |L_FNav| | |
110 * `--------------------' `--------------------'
111 */
112[QW_A] = KEYMAP(
113// Left hand
114KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL,
115KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC,
116KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA,
117KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB,
118KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT,
119 KC_TRNS, KC_TRNS,
120 KC_TRNS,
121 KC_UNDS, MO(QW_S), KC_TRNS,
122// Right hand
123 KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL,
124 KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z,
125 KC_C, KC_T, KC_S, KC_R, KC_N, KC_M,
126 KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C,
127 KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE,
128KC_TRNS, KC_TRNS,
90KC_TRNS, 129KC_TRNS,
91MO(FNAV), MO(SQWER), KC_ENTER), 130KC_TRNS, MO(QW_S), KC_ENTER),
92/* Keymap 2: QWERTY shifted system compatibility layer 131/* Keymap 3: bepo with shift key to qwerty compat layer
93 * 132 *
94 * ,--------------------------------------------------. ,--------------------------------------------------. 133 * ,--------------------------------------------------. ,--------------------------------------------------.
95 * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | 134 * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = |
@@ -100,20 +139,20 @@ MO(FNAV), MO(SQWER), KC_ENTER),
100 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| 139 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
101 * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | 140 * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C |
102 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' 141 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
103 * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| 142 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
104 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' 143 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
105 * | | | L_Num| | | | | 144 * | | |L_NumK| |L_NumK| | |
106 * | Space|LShift|------| |------|RShift|Enter | 145 * | Space|LShift|------| |------|RShift|Enter |
107 * | | |L_FNav| |L_FNav| | | 146 * | | |L_FNav| |L_FNav| | |
108 * `--------------------' `--------------------' 147 * `--------------------' `--------------------'
109 */ 148 */
110[SQWER] = KEYMAP( 149[QW_S] = KEYMAP(
111// Left hand 150// Left hand
112KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, 151KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS,
113KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, 152KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS,
114S(KC_W), S(KC_A), S(KC_U), S(KC_I), S(KC_E), KC_SCOLON, 153S(KC_W), S(KC_A), S(KC_U), S(KC_I), S(KC_E), KC_SCOLON,
115S(KC_E), S(KC_A), S(KC_Y), S(KC_X), KC_COLON, S(KC_K), S(KC_TAB), 154S(KC_E), S(KC_A), S(KC_Y), S(KC_X), KC_COLON, S(KC_K), S(KC_TAB),
116KC_TRNS, KC_TRNS, S(KC_LGUI), S(KC_LCTL), S(KC_LALT), 155S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT),
117 KC_TRNS, KC_TRNS, 156 KC_TRNS, KC_TRNS,
118 KC_TRNS, 157 KC_TRNS,
119 KC_TRNS, KC_TRNS, KC_TRNS, 158 KC_TRNS, KC_TRNS, KC_TRNS,
@@ -126,51 +165,125 @@ KC_TRNS, KC_TRNS, S(KC_LGUI), S(KC_LCTL), S(KC_LALT),
126KC_TRNS, KC_TRNS, 165KC_TRNS, KC_TRNS,
127KC_TRNS, 166KC_TRNS,
128KC_TRNS, KC_TRNS, KC_TRNS), 167KC_TRNS, KC_TRNS, KC_TRNS),
129/* Keymap 3: QWERTY alted system compatibility layer 168/* Keymap 4: bepo to azerty base compat layer
169 *
170 * ,--------------------------------------------------. ,--------------------------------------------------.
171 * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = |
172 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
173 * | % | b |e_acut| p | o |e_grav|Backsp| |CapsLo| ^ | v | d | l | j | z |
174 * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------|
175 * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m |
176 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
177 * | e |a_grav| y | x | . | k | | | | ' | q | g | h | f | c_cedil|
178 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
179 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
180 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
181 * | | |L_NumK| |L_NumK| | |
182 * | Space|LShift|------| |------|RShift|Enter |
183 * | | |L_FNav| |L_FNav| | |
184 * `--------------------' `--------------------'
185 */
186[AZ_B] = KEYMAP(
187// Left hand
188FR_DLR, FR_QUOT, FR_LESS, FR_GRTR, FR_LPRN, FR_RPRN, KC_DEL,
189FR_PERC, KC_B, FR_EACU, KC_P, KC_O, FR_EGRV, KC_BSPC,
190FR_W, FR_A, KC_U, KC_I, KC_E, FR_COMM,
191KC_E, FR_AGRV, KC_Y, KC_X, FR_DOT, KC_K, KC_TAB,
192KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT,
193 KC_TRNS, KC_TRNS,
194 KC_TRNS,
195 KC_SPC, MO(AZ_S), KC_TRNS,
196// Right hand
197 KC_SLCK, FR_AT, FR_PLUS, FR_MINS, FR_SLSH, FR_ASTR, FR_EQL,
198 KC_CAPSLOCK, KC_LBRC, KC_V, KC_D, KC_L, KC_J, FR_Z,
199 KC_C, KC_T, KC_S, KC_R, KC_N, FR_M,
200 KC_NUMLOCK, FR_APOS, FR_Q, KC_G, KC_H, KC_F, FR_CCED,
201 MO(AZ_A), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE,
202KC_TRNS, KC_TRNS,
203KC_TRNS,
204KC_TRNS, MO(AZ_S), KC_ENTER),
205/* Keymap 5: bepo with altgr key to azerty compat layer
130 * 206 *
131 * ,--------------------------------------------------. ,--------------------------------------------------. 207 * ,--------------------------------------------------. ,--------------------------------------------------.
132 * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | 208 * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = |
133 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 209 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
134 * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | 210 * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z |
135 * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| 211 * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------|
136 * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | 212 * | w | a |u_grav| trem | € | , |------| |------| c | t | s | r | n | m |
137 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| 213 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
138 * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | 214 * | / | \ | { | } | . | ~ | | | | ' | q | g | h | f | c |
139 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' 215 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
140 * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| 216 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
141 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' 217 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
142 * | | | L_Num| | | | | 218 * | | |L_NumK| |L_NumK| | |
143 * | _ |LShift|------| |------|RShift|Enter | 219 * | _ |LShift|------| |------|RShift|Enter |
144 * | | |L_FNav| |L_FNav| | | 220 * | | |L_FNav| |L_FNav| | |
145 * `--------------------' `--------------------' 221 * `--------------------' `--------------------'
146 */ 222 */
147[AQWER] = KEYMAP( 223[AZ_A] = KEYMAP(
148// Left hand 224// Left hand
149KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, 225FR_DLR, FR_QUOT, FR_LESS, FR_GRTR, FR_LBRC, FR_RBRC, KC_DEL,
150KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, 226FR_PERC, FR_PIPE, FR_EACU, FR_AMP, KC_O, FR_EGRV, KC_BSPC,
151KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, 227FR_W, FR_A, FR_UGRV, S(KC_LBRC), FR_EURO, FR_COMM,
152KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, 228FR_SLSH, FR_BSLS, FR_LCBR, FR_RCBR, FR_DOT, FR_TILD, KC_TAB,
153KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, 229KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT,
154 KC_ESC, MO(MSE), 230 KC_TRNS, KC_TRNS,
155 MO(NUM), 231 KC_TRNS,
156 KC_UNDS, MO(SQWER), MO(FNAV), 232 FR_UNDS, MO(AZ_S), KC_TRNS,
157// Right hand 233// Right hand
158 KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, 234 KC_SLCK, FR_AT, FR_PLUS, FR_MINS, FR_SLSH, FR_ASTR, FR_EQL,
159 KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, 235 KC_CAPSLOCK, KC_LBRC, KC_V, KC_D, KC_L, KC_J, FR_Z,
160 KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, 236 KC_C, KC_T, KC_S, KC_R, KC_N, FR_M,
161 KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, 237 KC_NUMLOCK, FR_APOS, FR_Q, KC_G, KC_H, KC_F, FR_CCED,
162 KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, 238 KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE,
163KC_NO, KC_INS, 239KC_TRNS, KC_TRNS,
164KC_TRNS, 240KC_TRNS,
165MO(FNAV), MO(SQWER), KC_ENTER), 241KC_TRNS, MO(AZ_S), KC_ENTER),
166/* Keymap 4: function / navigation layer 242/* Keymap 6: bepo with shift key to azerty compat layer
243 *
244 * ,--------------------------------------------------. ,--------------------------------------------------.
245 * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | ° |
246 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
247 * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z |
248 * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------|
249 * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M |
250 * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------|
251 * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C |
252 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
253 * |Escape|Insert|LSuper| LCtrl| LAlt| | BEPO |QWERTY| |AZERTY| BEPO | | AltGr| RCtrl|RSuper|PrntSc| Pause|
254 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
255 * | | |L_NumK| |L_NumK| | |
256 * | Space|LShift|------| |------|RShift|Enter |
257 * | | |L_FNav| |L_FNav| | |
258 * `--------------------' `--------------------'
259 */
260[AZ_S] = KEYMAP(
261// Left hand
262FR_HASH, FR_1, FR_2, FR_3, FR_4, FR_5, KC_TRNS,
263FR_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS,
264S(FR_W), S(FR_A), S(KC_U), S(KC_I), S(KC_E), FR_SCLN,
265S(KC_E), S(FR_A), S(KC_Y), S(KC_X), FR_COLN, S(KC_K), S(KC_TAB),
266S(KC_ESC), S(KC_INS), S(KC_LGUI), S(KC_LCTL), S(KC_LALT),
267 KC_TRNS, KC_TRNS,
268 KC_TRNS,
269 KC_TRNS, KC_TRNS, KC_TRNS,
270// Right hand
271 KC_TRNS, FR_6, FR_7, FR_8, FR_9, FR_0, FR_OVRR,
272 KC_TRNS, FR_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(FR_Z),
273 S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(FR_M),
274 KC_TRNS, FR_QUES, S(FR_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C),
275 S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS,
276KC_TRNS, KC_TRNS,
277KC_TRNS,
278KC_TRNS, KC_TRNS, KC_TRNS),
279/* Keymap 7: function / navigation / mouse layer
167 * 280 *
168 * ,--------------------------------------------------. ,--------------------------------------------------. 281 * ,--------------------------------------------------. ,--------------------------------------------------.
169 * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | 282 * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | |
170 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 283 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
171 * | | | | | | |VolDwn| | | PgUp | Home | Up | End | F11 | | 284 * | | Next |LClick| Up |RClick| WhUp |VolDwn| | | PgUp | Home | Up | End | F11 | |
172 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 285 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
173 * | | | | | | |------| |------| PgDn | Left | Down | Right| F12 | | 286 * | | Prev | Left | Down | Right|WhDown|------| |------| PgDn | Left | Down | Right| F12 | |
174 * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| 287 * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------|
175 * | | Undo | Cut | Copy | Paste| | | | | | | | | | | 288 * | | Undo | Cut | Copy | Paste| | | | | | | | | | |
176 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' 289 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
@@ -184,12 +297,12 @@ MO(FNAV), MO(SQWER), KC_ENTER),
184[FNAV] = KEYMAP( 297[FNAV] = KEYMAP(
185// Left hand 298// Left hand
186KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MUTE, 299KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MUTE,
187KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, 300KC_NO, KC_MS_BTN5, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_VOLU,
188KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 301KC_NO, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN,
189KC_NO, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, 302KC_NO, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD,
190KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, 303KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS,
191 KC_NO, KC_NO, 304 KC_TRNS, KC_TRNS,
192 KC_NO, 305 KC_TRNS,
193 KC_NO, KC_TRNS, KC_TRNS, 306 KC_NO, KC_TRNS, KC_TRNS,
194// Right hand 307// Right hand
195 KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, 308 KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO,
@@ -197,91 +310,52 @@ KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS,
197 KC_PGDOWN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F12, KC_NO, 310 KC_PGDOWN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F12, KC_NO,
198 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 311 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
199 KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, 312 KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO,
200KC_NO, KC_NO, 313KC_TRNS, KC_TRNS,
201KC_TRNS, 314KC_TRNS,
202KC_TRNS, KC_TRNS, KC_NO), 315KC_TRNS, KC_TRNS, KC_NO),
203/* Keymap 5: numeric layer, sends keypad codes 316/* Keymap 8: numeric keypad layer, sends keypad codes
204 * 317 *
205 * ,--------------------------------------------------. ,--------------------------------------------------. 318 * ,--------------------------------------------------. ,--------------------------------------------------.
206 * | | | | | | | | | | | + | - | / | * | | 319 * | | | | | | | | | | | NumLo| / | * | - | |
207 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 320 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
208 * | | | | | | | | | | | 7 | 8 | 9 | | | 321 * | | | | | | | | | | | 7 | 8 | 9 | + | |
209 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 322 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
210 * | | | | | | |------| |------| | 4 | 5 | 6 | | | 323 * | | | | | | |------| |------| | 4 | 5 | 6 | + | |
211 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 324 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
212 * | | | | | | | | | | | 1 | 2 | 3 | | | 325 * | | | | | | | | | | | 1 | 2 | 3 | Enter| |
213 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' 326 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
214 * | | | | | | | | | | | | | 0 | 00 | . | | | 327 * | | | | | | | | | | | | | 0 | 00 | . | Enter| |
215 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
216 * | | | | | | | |
217 * | | |------| |------| | Enter|
218 * | | | | | | | |
219 * `--------------------' `--------------------'
220 */
221[NUM] = KEYMAP(
222// Left hand
223KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
224KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
225KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
226KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
227KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS,
228 KC_NO, KC_NO,
229 KC_TRNS,
230 KC_NO, KC_TRNS, KC_NO,
231// Right hand
232 KC_NO, KC_NO, KC_KP_PLUS, KC_KP_MINUS, KC_KP_SLASH, KC_KP_ASTERISK, KC_NO,
233 KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_NO, KC_NO,
234 KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_NO, KC_NO,
235 KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_NO, KC_NO,
236 KC_KP_0, M(KP_00), KC_KP_COMMA, KC_NO, KC_NO,
237KC_NO, KC_NO,
238KC_NO,
239KC_NO, KC_TRNS, KC_KP_ENTER),
240/* Keymap 6: mouse layer
241 *
242 * ,--------------------------------------------------. ,--------------------------------------------------.
243 * | | | | | | | | | | | | | | | |
244 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
245 * | | | | | | | | | | |LClick| Up |RClick| WhUp | |
246 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
247 * | | | | | | |------| |------| | Left | Down | Right|WhDown| |
248 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
249 * | | | | | | | | | | | | | | | |
250 * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------'
251 * | | | | | | | | | | | | | | | | | |
252 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' 328 * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------'
253 * | | | | | | | | 329 * | | | | | | | |
254 * | | |------| |------| | | 330 * | | |------| |------| | |
255 * | | | | | | | | 331 * | | | | | | | |
256 * `--------------------' `--------------------' 332 * `--------------------' `--------------------'
257 */ 333 */
258[MSE] = KEYMAP( 334[NUMK] = KEYMAP(
259// Left hand 335// Left hand
260KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 336KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
261KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 337KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
262KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 338KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
263KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 339KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
264KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, 340KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS,
265 KC_NO, KC_TRNS, 341 KC_TRNS, KC_TRNS,
266 KC_NO, 342 KC_TRNS,
267 KC_NO, KC_TRNS, KC_NO, 343 KC_NO, KC_TRNS, KC_TRNS,
268// Right hand 344// Right hand
269 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 345 KC_NO, KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO,
270 KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_NO, 346 KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_NO,
271 KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, KC_NO, 347 KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_NO,
272 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 348 KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_NO,
273 KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, 349 KC_KP_0, M(KP_00), KC_KP_COMMA, KC_KP_ENTER, KC_NO,
274KC_NO, KC_NO, 350KC_TRNS, KC_TRNS,
275KC_NO, 351KC_TRNS,
276KC_NO, KC_TRNS, KC_NO) 352KC_TRNS, KC_TRNS, KC_NO)
277};
278
279const uint16_t PROGMEM fn_actions[] = {
280}; 353};
281 354
282const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 355const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
283{ 356{
284 switch(id) { 357 switch(id) {
358 // keypad "double 0"
285 case KP_00: 359 case KP_00:
286 if (record->event.pressed) { 360 if (record->event.pressed) {
287 return MACRO( T(KP_0), D(KP_0), END ); 361 return MACRO( T(KP_0), D(KP_0), END );
@@ -289,23 +363,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
289 return MACRO( U(KP_0), END ); 363 return MACRO( U(KP_0), END );
290 } 364 }
291 break; 365 break;
292 case CA_Fx:
293 if (record->event.pressed) {
294 layer_on(FNAV);
295 return MACRO( D(LALT), D(LCTL), END );
296 } else {
297 layer_off(FNAV);
298 return MACRO( U(LCTL), U(LALT), END );
299 }
300 break;
301 } 366 }
302 return MACRO_NONE; 367 return MACRO_NONE;
303}; 368};
304
305// Runs just one time when the keyboard initializes.
306void matrix_init_user(void) {
307};
308
309// Runs constantly in the background, in a loop.
310void matrix_scan_user(void) {
311};
diff --git a/keyboards/ergodox/keymaps/bepo/readme.md b/keyboards/ergodox/keymaps/bepo/readme.md
index 4a18cd80f..2959ac829 100644
--- a/keyboards/ergodox/keymaps/bepo/readme.md
+++ b/keyboards/ergodox/keymaps/bepo/readme.md
@@ -23,12 +23,12 @@ La touche "Tab" est placée comme sur la TypeMatrix 2020.
23 23
24Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO". 24Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO".
25 25
26Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). 26Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite et d'effectuer des actions souris avec uniquement la main gauche. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long).
27 27
28Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". 28Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0".
29 29
30L'appui sur une touche permet de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle. 30Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle et pour des accès BIOS ou console en QWERTY.
31 31
32TODO : couche de compatibilité pour utiliser la disposition BÉPO sur un système configuré pour un clavier AZERTY. 32Touche permettant de basculer en mode BEPO sur un système configuré pour un clavier AZERTY. Cette compatibilité n'est pas parfaite (pas de gestion des caractères non présents sur le clavier AZERTY, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle et pour faire du bureau à distance vers un système Windows sans BEPO.
33 33
34> Olivier Smedts <olivier@gid0.org> 34> Olivier Smedts <olivier@gid0.org>
diff --git a/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c b/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c
new file mode 100755
index 000000000..d33c6e527
--- /dev/null
+++ b/keyboards/ergodox/keymaps/dvorak_emacs/keymap.c
@@ -0,0 +1,165 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4
5/******************************************************************************************
6 * DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/)
7 * Layer 1: auxiliary keys
8 * Layer 2: full qwerty layout
9 *****************************************************************************************/
10
11// LAYERS
12#define BASE 0 // dvorak layout (default)
13#define AUX 1 // auxiliary keys
14
15// MACROS
16/* #define OBRACE 0 // key { or shift */
17/* #define CBRACE 1 // key } or shift */
18/* #define OBRACK 2 // key [ or left alt */
19/* #define CBRACK 3 // key ] or left alt */
20/* #define CAPS 4 // caps lock */
21
22// LEDS
23#define USB_LED_NUM_LOCK 0
24#define USB_LED_CAPS_LOCK 1
25#define USB_LED_SCROLL_LOCK 2
26#define USB_LED_COMPOSE 3
27#define USB_LED_KANA 4
28
29// TIMERS
30#define KEY_TAP_FAST 85
31#define KEY_TAP_SLOW 95
32
33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34/* Keymap 0: Base layer
35 * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively
36 *
37 * ,--------------------------------------------------. ,--------------------------------------------------.
38 * | | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = / + |
39 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
40 * | ~ |" / ' |, / < |. / > | P | Y | [ | | ] | F | G | C | H | L | / / ? |
41 * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------|
42 * | Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - / _ |
43 * |--------+------+------+------+------+------| LGUI | | LGUI |------+------+------+------+------+--------|
44 * | {/LSft |; / : | Q | J | K | X | | | | B | M | W | V | Z | }/RSft |
45 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
46 * | | | | | ~L1 | | ~L1 | | | \ / || |
47 * `----------------------------------' `----------------------------------'
48 * ,-------------. ,-------------.
49 * | HOME | END | | LEFT | RIGHT|
50 * ,------|------|------| |------+--------+------.
51 * | BSPC | DEL | PGUP | | UP | SPACE |RETURN|
52 * | / | / |------| |------| / | / |
53 * | LCTL | LALT |PGDWN | | DOWN | LALT | LCTL |
54 * `--------------------' `----------------------'
55 *
56 */
57[BASE] = KEYMAP(
58 // left hand
59 KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
60 KC_TILD, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, KC_LBRACKET,
61 KC_TAB, KC_A, KC_O, KC_E, SFT_T(KC_U), LT(AUX, KC_I),
62 SFT_T(KC_LBRC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI,
63 KC_NO, KC_NO, KC_NO, KC_NO, MO(AUX),
64 KC_HOME, KC_END,
65 KC_PGUP,
66 CTL_T(KC_BSPC), ALT_T(KC_DEL), KC_PGDN,
67 // right hand
68 KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
69 KC_RBRACKET, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH,
70 LT(AUX, KC_D), SFT_T(KC_H), KC_T, KC_N, KC_S, KC_MINUS,
71 KC_LGUI, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_RBRC),
72 MO(AUX), KC_NO, KC_NO, KC_BSLASH, KC_NO,
73 KC_LEFT, KC_RIGHT,
74 KC_UP,
75 KC_DOWN, ALT_T(KC_ENT), CTL_T(KC_SPC)
76 ),
77/* Keymap 1: Aux layer
78 *
79 * ,--------------------------------------------------. ,--------------------------------------------------.
80 * | VolUp | | | | | | SLEEP | PWR | | | | | | |
81 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
82 * | VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | |
83 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
84 * | | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | |
85 * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------|
86 * | TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS |
87 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
88 * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | |
89 * `----------------------------------' `----------------------------------'
90 * ,-------------. ,-------------.
91 * | TRANS| TRANS| | TRANS| TRANS|
92 * ,------|------|------| |------+------+------.
93 * | | | TRANS| | TRANS| | |
94 * |TRANS |TRANS |------| |------| TRANS| TRANS|
95 * | | | TRANS| | TRANS| | |
96 * `--------------------' `--------------------'
97 */
98[AUX] = KEYMAP(
99 // left hand
100 KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP,
101 KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, KC_NO, KC_NO,
102 KC_NO , KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS,
103 KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
104 LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), KC_TRNS,
105 KC_TRNS , KC_TRNS,
106 KC_TRNS,
107 KC_TRNS, KC_TRNS, KC_TRNS,
108 // right hand
109 KC_PWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
110 KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_NO,
111 KC_TRNS, KC_4, KC_5, KC_6, KC_PPLS, KC_NO,
112 KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_TRNS,
113 KC_TRNS,KC_DOT, KC_0, KC_PEQL, KC_NO,
114 KC_TRNS , KC_TRNS,
115 KC_TRNS,
116 KC_TRNS, KC_TRNS, KC_TRNS
117),
118};
119
120const uint16_t PROGMEM fn_actions[] = {
121 [1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux)
122};
123
124
125const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
126{
127 // MACRODOWN only works in this function
128 switch(id) {
129 case 0:
130 if (record->event.pressed) {
131 register_code(KC_RSFT);
132 } else {
133 unregister_code(KC_RSFT);
134 }
135 break;
136 }
137 return MACRO_NONE;
138};
139
140// Runs just one time when the keyboard initializes.
141void matrix_init_user(void) {
142
143};
144
145// Runs constantly in the background, in a loop.
146void matrix_scan_user(void) {
147
148 uint8_t layer = biton32(layer_state);
149
150 ergodox_board_led_off();
151 ergodox_right_led_1_off();
152 ergodox_right_led_2_off();
153 ergodox_right_led_3_off();
154 switch (layer) {
155 case 1:
156 ergodox_right_led_1_on();
157 break;
158 case 2:
159 ergodox_right_led_2_on();
160 break;
161 default:
162 // none
163 break;
164 }
165}
diff --git a/keyboards/ergodox/keymaps/dvorak_emacs/readme.md b/keyboards/ergodox/keymaps/dvorak_emacs/readme.md
new file mode 100644
index 000000000..a3fc34afe
--- /dev/null
+++ b/keyboards/ergodox/keymaps/dvorak_emacs/readme.md
@@ -0,0 +1,70 @@
1# Ergodox Dvorak Layout with emacs binding in mind
2 * Control & Alt key on the thumbs (activated if pressed with another key).
3 * In the same way, "U" and "R" are the shift modifier if pressed with another key.
4 * "I" and "D" set the layer 1 for the auxiliary keys if pressed with another key.
5 * Software layout set to english.
6
7## Keymap Layers
8 - L0: dvorak with some customizations (see layout below)
9 - L1: auxiliary keys (includes function keys, numpad...)
10
11
12### Keymap 0: Base layer
13Keys with double values (like U/LSft) correspond to the 'tapped' key and the 'held' key, respectively
14
15<pre><code>
16
17,--------------------------------------------------. ,--------------------------------------------------.
18| | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = |
19|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
20| ~ | ' | , | . | P | Y | [ | | ] | F | G | C | H | L | / |
21|--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------|
22| Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - |
23|--------+------+------+------+------+------| LGUI | | LGUI |------+------+------+------+------+--------|
24| {/LSft | ; | Q | J | K | X | | | | B | M | W | V | Z | }/RSft |
25`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
26 | | | | | ~L1 | | ~L1 | | | \ | |
27 `----------------------------------' `----------------------------------'
28 ,-------------. ,-------------.
29 | HOME | END | | LEFT | RIGHT|
30 ,------|------|------| |------+--------+------.
31 | BSPC | DEL | PGUP | | UP | SPACE |RETURN|
32 | / | / |------| |------| / | / |
33 | LCTL | LALT |PGDWN | | DOWN | LALT | LCTL |
34 `--------------------' `----------------------'
35
36</pre></code>
37
38### Keymap 1: Aux layer
39
40<pre><code>
41
42,--------------------------------------------------. ,--------------------------------------------------.
43| VolUp | | | | | | SLEEP | PWR | | | | | | |
44|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
45| VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | |
46|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
47| | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | |
48|--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------|
49| TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS |
50`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
51 |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | |
52 `----------------------------------' `----------------------------------'
53 ,-------------. ,-------------.
54 | TRANS| TRANS| | TRANS| TRANS|
55 ,------|------|------| |------+------+------.
56 | | | TRANS| | TRANS| | |
57 |TRANS |TRANS |------| |------| TRANS| TRANS|
58 | | | TRANS| | TRANS| | |
59 `--------------------' `--------------------'
60
61</pre></code>
62
63
64
65## Generation of .hex file
66> In the "qmk_firmware/keyboards/ergodox" directory.
67
68> Execute "make dvorak_emacs". Then the hex file "ergodox_ez_dvorak_emacs.hex" is in the root directory : "qmk_firmware".
69
70> Flash with `teensy_loader` binary
diff --git a/keyboards/ergodox/keymaps/dvorak_plover/README.md b/keyboards/ergodox/keymaps/dvorak_plover/README.md
new file mode 100644
index 000000000..c8287b019
--- /dev/null
+++ b/keyboards/ergodox/keymaps/dvorak_plover/README.md
@@ -0,0 +1,14 @@
1Dvorak support, plover support, gaming support
2
3I'm used to the Kinesis, so originally I was just going to patch up
4the thumb keys to be more familiar. But the ergodox is really well
5suited to NKRO support in Plover, so I added a layer for that, and
6then I remembered that dvorak can be really annoying for video
7games (try to reach WASD), so I added a layer for that.
8
9The result is probably a bit idiosyncratic, but it works for me.
10
11(I also don't have any press/hold distinction keys, because that
12confuses my fuzzy little brain.)
13
14Contributed by seebs (seebs@seebs.net)
diff --git a/keyboards/ergodox/keymaps/dvorak_plover/keymap.c b/keyboards/ergodox/keymaps/dvorak_plover/keymap.c
new file mode 100644
index 000000000..d0505609d
--- /dev/null
+++ b/keyboards/ergodox/keymaps/dvorak_plover/keymap.c
@@ -0,0 +1,230 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4
5#define BASE 0 // default layer
6#define SYMB 1 // symbols
7#define PLVR 2 // media keys
8#define QWRT 3 // qwerty layer for gaming
9
10const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11/* Keymap 0: Basic layer
12 *
13 * ,--------------------------------------------------. ,--------------------------------------------------.
14 * | = | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | \ |
15 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
16 * | Tab | ' | , | . | P | Y | L1 | | L2 | F | G | C | R | L | / |
17 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
18 * | LGui | A | O | E | U | I |------| |------| D | H | T | N | S | - |
19 * |--------+------+------+------+------+------| Esc | | L3 |------+------+------+------+------+--------|
20 * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift |
21 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
22 * |Lalt | Grv | | Left | Right| | Up | Down | [ | ] | RAlt |
23 * `----------------------------------' `----------------------------------'
24 * ,-------------. ,---------------.
25 * | LCtrl| Alt | | LGui | RCtrl |
26 * ,------|------|------| |------+--------+------.
27 * | | | Home | | PgUp | | |
28 * |Backsp|Delete|------| |------| Enter |Space |
29 * | ace| | End | | PgDn | | |
30 * `--------------------' `----------------------'
31 */
32// If it accepts an argument (i.e, is a function), it doesn't need KC_.
33// Otherwise, it needs KC_*
34[BASE] = KEYMAP( // layer 0 : default
35 // left hand
36 KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
37 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, MO(SYMB),
38 KC_LGUI, KC_A, KC_O, KC_E, KC_U, KC_I,
39 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ESC,
40 KC_LALT, KC_GRV, KC_ESC, KC_LEFT,KC_RGHT,
41 KC_LCTL, KC_LALT,
42 KC_HOME,
43 KC_BSPC,KC_DEL,KC_END,
44 // right hand
45 KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
46 TG(PLVR), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
47 KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
48 TG(QWRT),KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
49 KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_RALT,
50 KC_LGUI, KC_RCTL,
51 KC_PGUP,
52 KC_PGDN,KC_ENT, KC_SPC
53 ),
54/* Keymap 1: Symbol Layer
55 *
56 * ,--------------------------------------------------. ,--------------------------------------------------.
57 * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
58 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
59 * | | ! | @ | { | } | | | | | | Up | KP7 | KP8 | KP9 | KP* | F12 |
60 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
61 * | | # | $ | ( | ) | ` |------| |------| Down | KP4 | KP5 | KP6 | KP+ | |
62 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
63 * | | % | ^ | [ | ] | ~ | | | | & | KP1 | KP2 | KP3 | KP/ | |
64 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
65 * | | | | | | | | KP. | KP0 | KP= | |
66 * `----------------------------------' `----------------------------------'
67 * ,-------------. ,-------------.
68 * | | | | | |
69 * ,------|------|------| |------+------+------.
70 * | | | | | | | |
71 * | | |------| |------| | |
72 * | | | | | | | |
73 * `--------------------' `--------------------'
74 */
75// SYMBOLS
76[SYMB] = KEYMAP(
77 // left hand
78 KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
79 KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
80 KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
81 KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
82 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
83 KC_TRNS,KC_TRNS,
84 KC_TRNS,
85 KC_TRNS,KC_TRNS,KC_TRNS,
86 // right hand
87 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
88 KC_TRNS, KC_UP, KC_P7, KC_P8, KC_P9, KC_PAST, KC_F12,
89 KC_DOWN, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS,
90 KC_TRNS, KC_AMPR, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_TRNS,
91 KC_TRNS,KC_PDOT, KC_P0, KC_PEQL, KC_TRNS,
92 KC_TRNS, KC_TRNS,
93 KC_TRNS,
94 KC_TRNS, KC_TRNS, KC_TRNS
95),
96/* Keymap 2: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd
97 *
98 * ,--------------------------------------------------. ,--------------------------------------------------.
99 * | | | | | | | | | | | | | | | |
100 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
101 * | | 1 | 2 | 3 | 4 | 5 | | | L2 | 6 | 7 | 8 | 9 | 0 | |
102 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
103 * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ |
104 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
105 * | | a | s | d | f | g | | | | h | j | k | l | ; | ' |
106 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
107 * | | | | | | | | | | | |
108 * `----------------------------------' `----------------------------------'
109 * ,-------------. ,-------------.
110 * | | | | | |
111 * ,------|------|------| |------+------+------.
112 * | | | | | | | |
113 * | c | v |------| |------| n | m |
114 * | | | | | | | |
115 * `--------------------' `--------------------'
116 */
117
118[PLVR] = KEYMAP( // layout: layer 2: Steno for Plover
119 // left hand
120 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
121 KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS,
122 KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T,
123 KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO,
124 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
125 KC_FN4, KC_NO,
126 KC_NO,
127 KC_C, KC_V, KC_NO,
128 // right hand
129 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS,
130 TG(2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
131 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
132 KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
133 KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO,
134 KC_TRNS, KC_TRNS,
135 KC_TRNS,
136 KC_NO, KC_N, KC_M
137),
138/* Keymap 3: qwerty-ish
139 *
140 * ,--------------------------------------------------. ,--------------------------------------------------.
141 * | = | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | - |
142 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
143 * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ |
144 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
145 * | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | LGui |
146 * |--------+------+------+------+------+------| Spc | | L3 |------+------+------+------+------+--------|
147 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
148 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
149 * | Lalt | Grv | '" | Left | Right| | Up | Down | [ | ] | RAlt |
150 * `----------------------------------' `----------------------------------'
151 * ,-------------. ,---------------.
152 * | LCtrl| LAlt | | LGui | RCtrl |
153 * ,------|------|------| |------+--------+------.
154 * | | | Home | | PgUp | | |
155 * |Backsp|Delete|------| |------| Enter |Space |
156 * | ace| | End | | PgDn | | |
157 * `--------------------' `----------------------'
158 */
159[QWRT] = KEYMAP( // layer 3: qwerty for gaming
160 // left hand
161 KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
162 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
163 KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G,
164 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPACE,
165 KC_LALT, KC_GRV, KC_QUOT, KC_LEFT,KC_RGHT,
166 KC_LCTL, KC_LALT,
167 KC_HOME,
168 KC_BSPC,KC_DEL,KC_END,
169 // right hand
170 KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
171 KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
172 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
173 TG(QWRT), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,
174 KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_RALT,
175 KC_LGUI, KC_RCTL,
176 KC_PGUP,
177 KC_PGDN,KC_ENT, KC_SPC
178 ),
179};
180
181const uint16_t PROGMEM fn_actions[] = {
182 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
183};
184
185const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
186{
187 // MACRODOWN only works in this function
188 switch(id) {
189 case 0:
190 if (record->event.pressed) {
191 register_code(KC_RSFT);
192 } else {
193 unregister_code(KC_RSFT);
194 }
195 break;
196 }
197 return MACRO_NONE;
198};
199
200// Runs just one time when the keyboard initializes.
201void matrix_init_user(void) {
202
203};
204
205// Runs constantly in the background, in a loop.
206void matrix_scan_user(void) {
207
208 uint8_t layer = biton32(layer_state);
209
210 ergodox_board_led_off();
211 ergodox_right_led_1_off();
212 ergodox_right_led_2_off();
213 ergodox_right_led_3_off();
214 switch (layer) {
215 // TODO: Make this relevant to the ErgoDox EZ.
216 case 1:
217 ergodox_right_led_1_on();
218 break;
219 case 2:
220 ergodox_right_led_2_on();
221 break;
222 case 3:
223 ergodox_right_led_3_on();
224 break;
225 default:
226 // none
227 break;
228 }
229
230};
diff --git a/keyboards/ergodox/keymaps/erez_experimental/Makefile b/keyboards/ergodox/keymaps/erez_experimental/Makefile
index b673c5ce5..51a0c74c5 100644
--- a/keyboards/ergodox/keymaps/erez_experimental/Makefile
+++ b/keyboards/ergodox/keymaps/erez_experimental/Makefile
@@ -3,6 +3,8 @@
3 3
4SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 4SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
5COMMAND_ENABLE = no # Commands for debug and configuration 5COMMAND_ENABLE = no # Commands for debug and configuration
6RGBLIGHT_ENABLE ?= yes
7MIDI_ENABLE ?= yes
6 8
7ifndef QUANTUM_DIR 9ifndef QUANTUM_DIR
8 include ../../../../Makefile 10 include ../../../../Makefile
diff --git a/keyboards/ergodox/keymaps/erez_experimental/config.h b/keyboards/ergodox/keymaps/erez_experimental/config.h
index e5d7fe188..4da18c65a 100644
--- a/keyboards/ergodox/keymaps/erez_experimental/config.h
+++ b/keyboards/ergodox/keymaps/erez_experimental/config.h
@@ -8,5 +8,6 @@
8 8
9#undef LEADER_TIMEOUT 9#undef LEADER_TIMEOUT
10#define LEADER_TIMEOUT 300 10#define LEADER_TIMEOUT 300
11
11 12
12#endif 13#endif
diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c
index 4804959d6..2963c40e3 100644
--- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c
+++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c
@@ -7,6 +7,12 @@
7#define SYMB 1 // symbols 7#define SYMB 1 // symbols
8#define MDIA 2 // media keys 8#define MDIA 2 // media keys
9 9
10enum custom_keycodes {
11 PLACEHOLDER = SAFE_RANGE, // can always be here
12 RGB_FF00BB // always start with RGB_
13};
14
15
10const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11/* Keymap 0: Basic layer 17/* Keymap 0: Basic layer
12 * 18 *
@@ -65,33 +71,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 * | | | |NxtTab|PrvTab| | | | | | | 71 * | | | |NxtTab|PrvTab| | | | | | |
66 * `----------------------------------' `----------------------------------' 72 * `----------------------------------' `----------------------------------'
67 * ,-------------. ,-------------. 73 * ,-------------. ,-------------.
68 * | | | | | | 74 * | | | |TOG |
69 * ,------|------|------| |------+------+------. 75 * ,------|------|------| |------+------+------.
70 * | | | | | | | | 76 * |VAI |VAD |HUI | |SAI |TOG |MOD |
71 * | | |------| |------| | | 77 * | | |------| |------| | |
72 * | | | | | | | | 78 * | | |HUD | |SAD | | |
73 * `--------------------' `--------------------' 79 * `--------------------' `--------------------'
74 */ 80 */
75// SYMBOLS 81// SYMBOLS
76[SYMB] = KEYMAP( 82[SYMB] = KEYMAP(
77 // left hand 83 // left hand
78 KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, 84 RGB_FF00BB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
79 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 85 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
80 KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, 86 KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5,
81 KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, 87 KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
82 KC_TRNS, KC_TRNS,KC_TRNS,LCTL(KC_PGUP), LCTL(KC_PGDN), 88 KC_TRNS, KC_TRNS,KC_TRNS,LCTL(KC_PGUP), LCTL(KC_PGDN),
83 KC_TRNS,KC_TRNS, 89 KC_TRNS,KC_TRNS,
84 KC_TRNS, 90 RGB_HUI,
85 KC_TRNS,KC_TRNS,KC_TRNS, 91 RGB_VAI,RGB_VAD,RGB_HUD,
86 // right hand 92 // right hand
87 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, 93 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
88 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, 94 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12,
89 KC_AMPR, KC_UNDS, KC_MINS, CM_SCLN, KC_PLUS, KC_TRNS, 95 KC_AMPR, KC_UNDS, KC_MINS, CM_SCLN, KC_PLUS, KC_TRNS,
90 KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS, 96 KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS,
91 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 97 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
92 KC_TRNS, KC_TRNS, 98 RGB_TOG, KC_TRNS,
93 KC_TRNS, 99 RGB_SAI,
94 KC_TRNS, KC_TRNS, KC_TRNS 100 RGB_SAD, KC_TRNS, RGB_MOD
95), 101),
96/* Keymap 2: Media and mouse keys 102/* Keymap 2: Media and mouse keys
97 * 103 *
@@ -152,6 +158,24 @@ void matrix_init_user(void) {
152 158
153}; 159};
154 160
161
162bool process_record_user(uint16_t keycode, keyrecord_t *record) {
163 switch (keycode) {
164 // dynamically generate these.
165 case RGB_FF00BB:
166 if (record->event.pressed) {
167 #ifdef RGBLIGHT_ENABLE
168 rgblight_enable();
169 rgblight_mode(1);
170 rgblight_setrgb(0xff,0x00,0xbb);
171 #endif
172 }
173 return false;
174 break;
175 }
176 return true;
177}
178
155LEADER_EXTERNS(); 179LEADER_EXTERNS();
156 180
157// Runs constantly in the background, in a loop. 181// Runs constantly in the background, in a loop.
diff --git a/keyboards/ergodox/keymaps/galson/Makefile b/keyboards/ergodox/keymaps/galson/Makefile
new file mode 100644
index 000000000..f008f5079
--- /dev/null
+++ b/keyboards/ergodox/keymaps/galson/Makefile
@@ -0,0 +1,2 @@
1COMMAND_ENABLE = no # Commands for debug and configuration
2
diff --git a/keyboards/ergodox/keymaps/galson/keymap.c b/keyboards/ergodox/keymaps/galson/keymap.c
new file mode 100644
index 000000000..0d3e7560d
--- /dev/null
+++ b/keyboards/ergodox/keymaps/galson/keymap.c
@@ -0,0 +1,183 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5
6#define BASE 0 // default layer
7#define SYMB 1 // symbols
8#define MDIA 2 // media keys
9
10const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11/* Keymap 0: Basic layer
12 *
13 * ,--------------------------------------------------. ,--------------------------------------------------.
14 * | + | 1 | 2 | 3 | 4 | 5 | rclk | | lclk | 6 | 7 | 8 | 9 | 0 | - |
15 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
16 * | = | Q | W | E | R |cmd/T |shift | |shift |cmd/Y | U | I | O | P | \ |
17 * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------|
18 * | " | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' |
19 * |--------+------+------+------+------+------| ctrl | | ctrl |------+------+------+------+------+--------|
20 * | { | Z | X | C | V | B | [ | | ] | N | M | , | . | / | } |
21 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
22 * | _ | ` | $ | Left | Right| | Up | Down | : | * | ! |
23 * `----------------------------------' `----------------------------------'
24 * ,-------------. ,-------------.
25 * | < | | | | & | > |
26 * ,------|------|------| |------+--------+------.
27 * | | | # | | @ | | |
28 * | Space|Backsp|------| |------| Tab |Enter |
29 * | |ace | % | | ESC | | |
30 * `--------------------' `----------------------'
31 */
32// If it accepts an argument (i.e, is a function), it doesn't need KC_.
33// Otherwise, it needs KC_*
34[BASE] = KEYMAP( // layer 0 : default
35 // left hand
36 KC_PLUS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_BTN2,
37 KC_EQL, KC_Q, KC_W, KC_E, KC_R, GUI_T(KC_T), KC_LSPO,
38 KC_DQUO, KC_A, KC_S, KC_D, KC_F, KC_G,
39 KC_LCBR, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_LBRC),
40 KC_UNDS, KC_GRV, KC_DLR, KC_LEFT,KC_RGHT,
41 KC_LABK, KC_PIPE,
42 KC_HASH,
43 KC_SPC, KC_BSPC,KC_PERC,
44 // right hand
45 KC_BTN1, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
46 KC_RSPC, GUI_T(KC_Y), KC_U, KC_I, KC_O, KC_P, KC_BSLS,
47 KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_QUOT,
48 CTL_T(KC_RBRC), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RCBR,
49 KC_UP, KC_DOWN,KC_COLN,KC_ASTR, KC_EXLM,
50 KC_AMPR, KC_RABK,
51 KC_AT,
52 KC_ESC, KC_TAB, KC_ENT
53 ),
54/* Keymap 1: Symbol Layer
55 *
56 * ,--------------------------------------------------.
57 * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
58 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
59 * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
60 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
61 * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
62 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
63 * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
64 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
65 * | | | | | | | | . | 0 | = | |
66 * `----------------------------------' `----------------------------------'
67 * ,-------------. ,-------------.
68 * | | | | | |
69 * ,------|------|------| |------+------+------.
70 * | | | | | | | |
71 * | | |------| |------| | |
72 * | | | | | | | |
73 * `--------------------' `--------------------'
74 */
75// SYMBOLS
76[SYMB] = KEYMAP(
77 // left hand
78 M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
79 KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
80 KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
81 KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
82 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
83 KC_TRNS,KC_TRNS,
84 KC_TRNS,
85 KC_TRNS,KC_TRNS,KC_TRNS,
86 // right hand
87 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
88 KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
89 KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
90 KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
91 KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
92 KC_TRNS, KC_TRNS,
93 KC_TRNS,
94 KC_TRNS, KC_TRNS, KC_TRNS
95),
96/* Keymap 2: Media and mouse keys
97 *
98 * ,--------------------------------------------------. ,--------------------------------------------------.
99 * | | | | | | | | | | | | | | | |
100 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
101 * | | | | MsUp | | | | | | | | | | | |
102 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
103 * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
104 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
105 * | | | | | | | | | | | | Prev | Next | | |
106 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
107 * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
108 * `----------------------------------' `----------------------------------'
109 * ,-------------. ,-------------.
110 * | | | | | |
111 * ,------|------|------| |------+------+------.
112 * | | | | | | |Brwser|
113 * | | |------| |------| |Back |
114 * | | | | | | | |
115 * `--------------------' `--------------------'
116 */
117// MEDIA AND MOUSE
118[MDIA] = KEYMAP(
119 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
120 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
121 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
122 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
123 KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
124 KC_TRNS, KC_TRNS,
125 KC_TRNS,
126 KC_TRNS, KC_TRNS, KC_TRNS,
127 // right hand
128 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
129 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
130 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
131 KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
132 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
133 KC_TRNS, KC_TRNS,
134 KC_TRNS,
135 KC_TRNS, KC_TRNS, KC_WBAK
136),
137};
138
139const uint16_t PROGMEM fn_actions[] = {
140 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
141};
142
143const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
144{
145 // MACRODOWN only works in this function
146 switch(id) {
147 case 0:
148 if (record->event.pressed) {
149 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
150 }
151 break;
152 }
153 return MACRO_NONE;
154};
155
156// Runs just one time when the keyboard initializes.
157void matrix_init_user(void) {
158
159};
160
161// Runs constantly in the background, in a loop.
162void matrix_scan_user(void) {
163
164 uint8_t layer = biton32(layer_state);
165
166 ergodox_board_led_off();
167 ergodox_right_led_1_off();
168 ergodox_right_led_2_off();
169 ergodox_right_led_3_off();
170 switch (layer) {
171 // TODO: Make this relevant to the ErgoDox EZ.
172 case 1:
173 ergodox_right_led_1_on();
174 break;
175 case 2:
176 ergodox_right_led_2_on();
177 break;
178 default:
179 // none
180 break;
181 }
182
183};
diff --git a/keyboards/ergodox/keymaps/galson/readme.md b/keyboards/ergodox/keymaps/galson/readme.md
new file mode 100644
index 000000000..ebc916725
--- /dev/null
+++ b/keyboards/ergodox/keymaps/galson/readme.md
@@ -0,0 +1,11 @@
1# Galson keymap
2
3
4Sep 26, 2016.
5
6This is an ergonomic layout for programming for those with typing-related injuries. Key features:
7
8- As many symbol keys as possible are accessible without shifting. These should be accessed by moving the entire hand and pressing with a strong finger.
9- Arrow keys and left and right mouse clicks for mouse-free navigation when combined with head mouse or eyetracker.
10- Modifier keys are dual role and relocated to positions convenient for the index finger.
11- Positions are more convenient when the keyboard is vertically mounted (as it should be!) \ No newline at end of file
diff --git a/keyboards/ergodox/keymaps/jack/Makefile b/keyboards/ergodox/keymaps/jack/Makefile
new file mode 100644
index 000000000..3ca69bb92
--- /dev/null
+++ b/keyboards/ergodox/keymaps/jack/Makefile
@@ -0,0 +1,6 @@
1RGBLIGHT_ENABLE ?= yes
2MIDI_ENABLE ?= yes
3
4ifndef QUANTUM_DIR
5 include ../../../../Makefile
6endif
diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h
new file mode 100644
index 000000000..5c1165226
--- /dev/null
+++ b/keyboards/ergodox/keymaps/jack/config.h
@@ -0,0 +1,17 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/* ws2812 RGB LED */
7#define RGB_DI_PIN D7
8#define RGBLIGHT_ANIMATIONS
9#define RGBLED_NUM 15 // Number of LEDs
10#define RGBLIGHT_HUE_STEP 12
11#define RGBLIGHT_SAT_STEP 255
12#define RGBLIGHT_VAL_STEP 12
13
14#define RGB_MIDI
15#define RGBW_BB_TWI
16
17#endif \ No newline at end of file
diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c
index dda253fa4..9cb80c59d 100644
--- a/keyboards/ergodox/keymaps/jack/keymap.c
+++ b/keyboards/ergodox/keymaps/jack/keymap.c
@@ -19,14 +19,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 KC_HOME, 19 KC_HOME,
20 KC_SPC,KC_SPC,KC_END, 20 KC_SPC,KC_SPC,KC_END,
21 // right hand 21 // right hand
22 KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, 22 KC_NO, M(1), KC_7, KC_8, KC_9, KC_0, KC_NO,
23 KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 23 KC_NO, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_P, KC_BSPC,
24 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 24 RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_SCLN, KC_QUOT,
25 KC_NO, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_ENT, 25 KC_NO, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_ENT,
26 MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, 26 MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,
27 KC_NO, KC_NO, 27 RGB_TOG, RGB_HUI,
28 KC_PGUP, 28 RGB_MOD,
29 KC_PGDN, KC_SPC,KC_SPC 29 M(2), KC_SPC,KC_SPC
30 ), 30 ),
31[SYMB] = KEYMAP( 31[SYMB] = KEYMAP(
32 // left hand 32 // left hand
@@ -84,6 +84,16 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
84 unregister_code(KC_RSFT); 84 unregister_code(KC_RSFT);
85 } 85 }
86 break; 86 break;
87 case 1:
88 if (record->event.pressed) { // For resetting EEPROM
89 eeconfig_init();
90 }
91 break;
92 case 2:
93 if (record->event.pressed) { // For resetting EEPROM
94 api_send_unicode(0x0CA0);
95 }
96 break;
87 } 97 }
88 return MACRO_NONE; 98 return MACRO_NONE;
89}; 99};
diff --git a/keyboards/ergodox/keymaps/kristian/keymap.c b/keyboards/ergodox/keymaps/kristian/keymap.c
new file mode 100644
index 000000000..e7e424325
--- /dev/null
+++ b/keyboards/ergodox/keymaps/kristian/keymap.c
@@ -0,0 +1,79 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5#include "keymap_fr_ch.h"
6#include "keymap_french.h"
7#include "keymap_german.h"
8#include "keymap_german_ch.h"
9#include "keymap_nordic.h"
10#include "keymap_norwegian.h"
11#include "keymap_spanish.h"
12
13const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
14
15
16[0] = KEYMAP(NO_LESS,KC_1,KC_2,KC_3,KC_4,KC_5,KC_BSPACE,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,SFT_T(NO_APOS),CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,SFT_T(KC_EQUAL),MO(1),CTL_T(KC_GRAVE),KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_CAPSLOCK,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_6,KC_7,KC_8,KC_9,KC_0,NO_PLUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,NO_AM,KC_H,KC_J,KC_K,KC_L,LT(2,NO_OSLH),NO_AE,SFT_T(KC_RBRC),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),SFT_T(NO_APOS),KC_DOWN,KC_UP,NO_LPRN,NO_RPRN,MO(1),NO_QUOT,CTL_T(KC_ESCAPE),NO_APOS,KC_LALT,KC_LGUI,KC_ENTER),
17
18[1] = KEYMAP(M(0),KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_TRANSPARENT,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_7,KC_8,KC_9,KC_TRANSPARENT,KC_TRANSPARENT,KC_F12,KC_4,KC_5,KC_6,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_0,KC_1,KC_2,KC_3,NO_LBRC,NO_RBRC,KC_LSHIFT,KC_COMMA,KC_DOT,LSFT(NO_LBRC),LSFT(NO_RBRC),KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LALT,KC_LGUI,KC_ENTER),
19
20[2] = KEYMAP(KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LALT,KC_LGUI,KC_MS_BTN1,KC_MS_BTN2,KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_SPACE,KC_LGUI,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PREV_TRACK,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT,KC_TRANSPARENT,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_ESCAPE,KC_MS_WH_UP,KC_MS_WH_DOWN,KC_MS_ACCEL0,KC_MS_ACCEL1),
21
22};
23
24const uint16_t PROGMEM fn_actions[] = {
25 [1] = ACTION_LAYER_TAP_TOGGLE(1)
26};
27
28const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
29{
30 switch(id) {
31 case 0:
32 if (record->event.pressed) {
33 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
34 }
35 break;
36 }
37 return MACRO_NONE;
38};
39
40void matrix_scan_user(void) {
41
42 uint8_t layer = biton32(layer_state);
43
44 ergodox_board_led_off();
45 ergodox_right_led_1_off();
46 ergodox_right_led_2_off();
47 ergodox_right_led_3_off();
48 switch (layer) {
49 case 1:
50 ergodox_right_led_1_on();
51 break;
52 case 2:
53 ergodox_right_led_2_on();
54 break;
55 case 3:
56 ergodox_right_led_3_on();
57 break;
58 case 4:
59 ergodox_right_led_1_on();
60 ergodox_right_led_2_on();
61 break;
62 case 5:
63 ergodox_right_led_1_on();
64 ergodox_right_led_3_on();
65 break;
66 case 6:
67 ergodox_right_led_2_on();
68 ergodox_right_led_3_on();
69 break;
70 case 7:
71 ergodox_right_led_1_on();
72 ergodox_right_led_2_on();
73 ergodox_right_led_3_on();
74 break;
75 default:
76 break;
77 }
78
79};
diff --git a/keyboards/ergodox/keymaps/robot_test_layout/keymap.c b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c
new file mode 100644
index 000000000..480be177f
--- /dev/null
+++ b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c
@@ -0,0 +1,151 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5
6enum custom_keycodes {
7 PLACEHOLDER = SAFE_RANGE, // can always be here
8 RGB_FF0000,
9 RGB_00FF00,
10 RGB_0000FF,
11 RGB_FFFFFF,
12 RGB_TOGGLE,
13 LED1,
14 LED2,
15 LED3
16};
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19
20[0] = KEYMAP(
21 RGB_TOGGLE, RGB_FF0000, RGB_00FF00, RGB_0000FF, RGB_FFFFFF, KC_5, KC_LPRN,
22 KC_GRAVE, KC_A, KC_B, KC_C, KC_D, KC_E, KC_EXLM,
23 KC_HASH, KC_J, KC_K, KC_L, KC_M, KC_N,
24 KC_AMPR, KC_T, KC_U, KC_V, KC_W, KC_X, KC_DLR,
25 KC_PIPE, KC_R, KC_PLUS, KC_LCBR, KC_RCBR,
26
27 KC_F, KC_G,
28 KC_H,
29 KC_P, KC_O, KC_I,
30
31
32
33 // RIGHT HAND
34 KC_RPRN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
35 KC_AT, KC_F, KC_G, KC_H, KC_I, KC_COLN, KC_BSLS,
36 KC_O, KC_P, KC_Q, KC_R, KC_S, KC_QUOT,
37 LSFT(KC_COMM), KC_Y, KC_Z, KC_COMM, KC_DOT, KC_SLSH, KC_ASTR,
38 KC_A, KC_B, KC_C, KC_D, KC_PIPE,
39
40 LED1, KC_E,
41 LED2,
42 LED3, KC_J, KC_K
43 )
44};
45
46
47
48const uint16_t PROGMEM fn_actions[] = {
49 [1] = ACTION_LAYER_TAP_TOGGLE(1)
50};
51
52const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
53{
54 switch(id) {
55 case 0:
56 if (record->event.pressed) {
57 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
58 }
59 break;
60 }
61 return MACRO_NONE;
62};
63
64bool status_led1_on = false, status_led2_on = false, status_led3_on = false;
65bool process_record_user(uint16_t keycode, keyrecord_t *record) {
66 switch (keycode) {
67 // dynamically generate these.
68 case RGB_FF0000:
69 if (record->event.pressed) {
70 #ifdef RGBLIGHT_ENABLE
71 EZ_RGB(0xff0000);
72 register_code(KC_1); unregister_code(KC_1);
73 #endif
74 }
75 return false;
76 break;
77 case RGB_00FF00:
78 if (record->event.pressed) {
79 #ifdef RGBLIGHT_ENABLE
80 EZ_RGB(0x00ff00);
81 register_code(KC_2); unregister_code(KC_2);
82 #endif
83 }
84 return false;
85 break;
86 case RGB_0000FF:
87 if (record->event.pressed) {
88 #ifdef RGBLIGHT_ENABLE
89 EZ_RGB(0x0000ff);
90 register_code(KC_3); unregister_code(KC_3);
91 #endif
92 }
93 return false;
94 break;
95 case RGB_FFFFFF:
96 if (record->event.pressed) {
97 #ifdef RGBLIGHT_ENABLE
98 EZ_RGB(0xffffff);
99 register_code(KC_4); unregister_code(KC_4);
100 #endif
101 }
102 return false;
103 break;
104 case RGB_TOGGLE:
105 if (record->event.pressed) {
106 #ifdef RGBLIGHT_ENABLE
107 rgblight_toggle();
108 register_code(KC_EQL); unregister_code(KC_EQL);
109 #endif
110 }
111 return false;
112 break;
113 case LED1:
114 if (record->event.pressed) {
115 if(status_led1_on) {
116 ergodox_right_led_1_off();
117 status_led1_on = false;
118 } else {
119 ergodox_right_led_1_on();
120 status_led1_on = true;
121 }
122 }
123 return false;
124 break;
125 case LED2:
126 if (record->event.pressed) {
127 if(status_led2_on) {
128 ergodox_right_led_2_off();
129 status_led2_on = false;
130 } else {
131 ergodox_right_led_2_on();
132 status_led2_on = true;
133 }
134 }
135 return false;
136 break;
137 case LED3:
138 if (record->event.pressed) {
139 if(status_led3_on) {
140 ergodox_right_led_3_off();
141 status_led3_on = false;
142 } else {
143 ergodox_right_led_3_on();
144 status_led3_on = true;
145 }
146 }
147 return false;
148 break;
149 }
150 return true;
151}
diff --git a/keyboards/ergodox/keymaps/robot_test_layout/readme.md b/keyboards/ergodox/keymaps/robot_test_layout/readme.md
new file mode 100644
index 000000000..45dc2aa76
--- /dev/null
+++ b/keyboards/ergodox/keymaps/robot_test_layout/readme.md
@@ -0,0 +1,5 @@
1# Robot test layout
2
3Use this layout if you like to pretend you're [Norman](https://www.youtube.com/watch?v=-sbxFBay-tg), the ErgoDox EZ manufacturing robot.
4
5It's really meant just for internal use, but we're posting it on GitHub anyway, because hurray to open source. :)
diff --git a/keyboards/ergodox/keymaps/sethbc/Makefile b/keyboards/ergodox/keymaps/sethbc/Makefile
index 8c4ff8784..457a3d01d 100644
--- a/keyboards/ergodox/keymaps/sethbc/Makefile
+++ b/keyboards/ergodox/keymaps/sethbc/Makefile
@@ -1,14 +1,3 @@
1BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = no # Commands for debug and configuration
6CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDox EZ
7SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
8NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
9MIDI_ENABLE = no # MIDI controls
10UNICODE_ENABLE = yes # Unicode
11
12ifndef QUANTUM_DIR 1ifndef QUANTUM_DIR
13 include ../../../../Makefile 2 include ../../../../Makefile
14endif 3endif
diff --git a/keyboards/ergodox/keymaps/sethbc/keymap.c b/keyboards/ergodox/keymaps/sethbc/keymap.c
index 6846c4d52..8816ad63b 100644
--- a/keyboards/ergodox/keymaps/sethbc/keymap.c
+++ b/keyboards/ergodox/keymaps/sethbc/keymap.c
@@ -15,7 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15 KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, 15 KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT,
16 KC_LCTL, KC_LALT, 16 KC_LCTL, KC_LALT,
17 KC_HOME, 17 KC_HOME,
18 KC_SPC, KC_BSPC, KC_END, 18 KC_BSPC, KC_DEL, KC_END,
19 // right hand 19 // right hand
20 MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, 20 MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
21 KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, 21 KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC,
diff --git a/keyboards/ergodox/keymaps/sethbc/readme.md b/keyboards/ergodox/keymaps/sethbc/readme.md
index 510b2f99c..57b5d0ec7 100644
--- a/keyboards/ergodox/keymaps/sethbc/readme.md
+++ b/keyboards/ergodox/keymaps/sethbc/readme.md
@@ -1,3 +1,4 @@
1# sethbc's Ergodox EZ keymap 1# sethbc's Ergodox EZ keymap
2 2
3Largely based on the Ergodox Infinity default keymap 3Largely based on the Ergodox Infinity default keymap, but layer locking has been
4removed in favor of momentary layer activation
diff --git a/keyboards/ergodox/keymaps/videck/Makefile b/keyboards/ergodox/keymaps/videck/Makefile
new file mode 100644
index 000000000..5c7d21f2c
--- /dev/null
+++ b/keyboards/ergodox/keymaps/videck/Makefile
@@ -0,0 +1,19 @@
1AUDIO_ENABLE:=no
2BACKLIGHT_ENABLE:=no
3BLUETOOTH_ENABLE:=no
4BOOTMAGIC_ENABLE:=no
5COMMAND_ENABLE:=no
6CONSOLE_ENABLE:=no
7EXTRAKEY_ENABLE:=yes
8MIDI_ENABLE:=no
9MOUSEKEY_ENABLE:=yes
10NKRO_ENABLE:=no
11RGBLIGHT_ENABLE:=no
12SLEEP_LED_ENABLE:=no
13TAP_DANCE_ENABLE:=yes
14UNICODEMAP_ENABLE:=no
15UNICODE_ENABLE:=no
16
17ifndef QUANTUM_DIR
18 include ../../../../Makefile
19endif
diff --git a/keyboards/ergodox/keymaps/videck/config.h b/keyboards/ergodox/keymaps/videck/config.h
new file mode 100644
index 000000000..d89aabe77
--- /dev/null
+++ b/keyboards/ergodox/keymaps/videck/config.h
@@ -0,0 +1,13 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#ifndef NO_DEBUG
7 #define NO_DEBUG
8#endif
9#ifndef NO_PRINT
10 #define NO_PRINT
11#endif
12
13#endif
diff --git a/keyboards/ergodox/keymaps/videck/keymap.c b/keyboards/ergodox/keymaps/videck/keymap.c
new file mode 100644
index 000000000..7bd6274e9
--- /dev/null
+++ b/keyboards/ergodox/keymaps/videck/keymap.c
@@ -0,0 +1,179 @@
1#include <stdbool.h>
2
3#include "ergodox.h"
4#include "action_layer.h"
5
6enum {
7 BASE = 0, // Default layer
8 ARROWS = 1, // Arrows and Fx keys layer
9 MOUSE = 2, // Mouse movement and buttons layer
10 PARENS = 3, // Parenthesis easy access layer
11
12 TD_L = 0, // Tap dance index for left shift
13 TD_R = 1 // Tap dance index for right shift
14};
15
16// See the videck.png image for a visualization of the layout.
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18 [BASE] = KEYMAP(
19 // left hand
20 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME,
21 KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END,
22 MO(PARENS), KC_A, KC_S, KC_D, KC_F, KC_G,
23 TD(TD_L), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC,
24 KC_LCTL, KC_LALT, KC_VOLD, KC_VOLU, KC_MUTE,
25 KC_ESC, KC_LGUI,
26 TG(MOUSE),
27 KC_SPC, KC_TAB, TG(ARROWS),
28 // right hand
29 KC_PGUP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
30 KC_PGDN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
31 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
32 KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(TD_R),
33 KC_LBRC, KC_RBRC, KC_EQL, KC_RALT, KC_RCTL,
34 KC_APP, KC_ESC,
35 KC_INS,
36 KC_SLCK, KC_ENT, KC_SPC
37 ),
38 [ARROWS] = KEYMAP(
39 // left hand
40 KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS,
46 KC_NO,
47 KC_TRNS, KC_TRNS, KC_TRNS,
48 // right hand
49 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
50 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12,
51 KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS,
52 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
53 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
54 KC_TRNS, KC_TRNS,
55 KC_TRNS,
56 KC_TRNS, KC_TRNS, KC_TRNS
57 ),
58 [MOUSE] = KEYMAP(
59 // left hand
60 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
61 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
62 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
63 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
64 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
65 KC_BTN3, KC_TRNS,
66 KC_TRNS,
67 KC_BTN1, KC_BTN2, KC_NO,
68 // right hand
69 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
70 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
71 KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS,
72 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
73 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
74 KC_TRNS, KC_TRNS,
75 KC_TRNS,
76 KC_TRNS, KC_TRNS, KC_TRNS
77 ),
78 [PARENS] = KEYMAP(
79 // left hand
80 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
81 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
82 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
83 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
84 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
85 KC_TRNS, KC_TRNS,
86 KC_NO,
87 KC_TRNS, KC_TRNS, KC_NO,
88 // right hand
89 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
90 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS,
91 KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_TRNS,
92 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS,
93 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
94 KC_TRNS, KC_TRNS,
95 KC_TRNS,
96 KC_TRNS, KC_TRNS, KC_TRNS
97 )
98};
99
100typedef void (*videck_tap_dance_trigger_t) (const uint16_t kc);
101
102typedef struct
103{
104 uint16_t kc1;
105 uint16_t kc2;
106 videck_tap_dance_trigger_t trigger;
107} videck_tap_dance_tuple_t;
108
109static void videck_tap_dance_finished (qk_tap_dance_state_t *state, void *user_data) {
110 videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data;
111
112 if (state->count == 1) {
113 register_code16 (tuple->kc1);
114 } else if (state->count == 2) {
115 register_code16 (tuple->kc2);
116 }
117}
118
119static void videck_tap_dance_reset (qk_tap_dance_state_t *state, void *user_data) {
120 videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data;
121
122 if (state->count == 1) {
123 unregister_code16 (tuple->kc1);
124 } else if (state->count == 2) {
125 unregister_code16 (tuple->kc2);
126 tuple->trigger(tuple->kc2);
127 }
128}
129
130static bool caps_lock_is_on;
131
132// Toggles caps lock status.
133static void videck_caps_trigger (const uint16_t kc) {
134 caps_lock_is_on ^= true;
135}
136
137#define ACTION_TAP_DANCE_DOUBLE_TRIGGER(kc1, kc2, double_trigger) { \
138 .fn = { NULL, videck_tap_dance_finished, videck_tap_dance_reset }, \
139 .user_data = (void *)&((videck_tap_dance_tuple_t) { kc1, kc2, double_trigger }), \
140 }
141
142qk_tap_dance_action_t tap_dance_actions[] = {
143 [TD_L] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_LSFT, KC_CAPS, videck_caps_trigger),
144 [TD_R] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_RSFT, KC_CAPS, videck_caps_trigger)
145};
146
147// Runs just one time when the keyboard initializes.
148void matrix_init_user(void) {
149 ergodox_led_all_set(LED_BRIGHTNESS_LO);
150 caps_lock_is_on = false;
151};
152
153static void indicate_using_led(const uint8_t led, const bool enabled) {
154 if (enabled) {
155 ergodox_right_led_on(led);
156 } else {
157 ergodox_right_led_off(led);
158 }
159}
160
161static inline void indicate_caps_lock_state(const bool enabled) {
162 indicate_using_led(1, enabled);
163}
164
165static inline void indicate_arrows_layer_state(const bool enabled) {
166 indicate_using_led(2, enabled);
167}
168
169static inline void indicate_mouse_layer_state(const bool enabled) {
170 indicate_using_led(3, enabled);
171}
172
173// Runs constantly in the background, in a loop.
174void matrix_scan_user(void) {
175 // Check if we have shift locked.
176 indicate_caps_lock_state(caps_lock_is_on);
177 indicate_arrows_layer_state(IS_LAYER_ON(ARROWS));
178 indicate_mouse_layer_state(IS_LAYER_ON(MOUSE));
179};
diff --git a/keyboards/ergodox/keymaps/videck/readme.md b/keyboards/ergodox/keymaps/videck/readme.md
new file mode 100644
index 000000000..759e81bac
--- /dev/null
+++ b/keyboards/ergodox/keymaps/videck/readme.md
@@ -0,0 +1,24 @@
1ViDeck keymap for ErgoDox
2=========================
3
4This is a QWERTY layout based on the US layout, where Vi functionality has been
5especially considered.
6
7# Features
8* Mouse movements using the Vi movement keys.
9* Vi movement keys doubling as arrow keys.
10* Shift lock using double tap.
11* A coder's modifier key for easy input of parenthesis.
12* Acess to the escape key using either thumb.
13* Reasonably accessible Scroll Lock key (useful if you, like me, want to switch
14 to a non-US layout once in a while in X).
15
16# Missing keys
17* Caps Lock (shift lock is used instead).
18* Pause/Break.
19* Print Screen.
20
21# LEDs
22* Shift lock is indicated using first LED.
23* Arrow keys layer is indicated using second LED.
24* Mouse keys layer is indicated using third LED.
diff --git a/keyboards/ergodox/keymaps/videck/videck.json b/keyboards/ergodox/keymaps/videck/videck.json
new file mode 100644
index 000000000..7068cf548
--- /dev/null
+++ b/keyboards/ergodox/keymaps/videck/videck.json
@@ -0,0 +1,443 @@
1[
2 {
3 "backcolor": "#333333",
4 "background": {
5 "name": "PBT Black",
6 "style": "background-image: url('/bg/plastic/pbt-black.png');"
7 },
8 "switchMount": "cherry",
9 "switchBrand": "gateron",
10 "switchType": "KS-3-Red"
11 },
12 [
13 {
14 "x": 3.5,
15 "c": "#323232",
16 "t": "#ffffff\n\n\n#ac97d8"
17 },
18 "#\n3\n\nF3",
19 {
20 "x": 10.5
21 },
22 "*\n8\n\nF8"
23 ],
24 [
25 {
26 "y": -0.875,
27 "x": 2.5
28 },
29 "@\n2\n\nF2",
30 {
31 "x": 1
32 },
33 "$\n4\n\nF4",
34 {
35 "x": 8.5
36 },
37 "&\n7\n\nF7",
38 {
39 "x": 1,
40 "t": "#ffffff\n\n\n#ac97d8\n\n\n\n#555454"
41 },
42 "(\n9\n\nF9"
43 ],
44 [
45 {
46 "y": -0.875,
47 "x": 5.5,
48 "t": "#ffffff\n\n\n#ac97d8"
49 },
50 "%\n5\n\nF5",
51 {
52 "t": "#ffffff"
53 },
54 "home",
55 {
56 "x": 4.5
57 },
58 "pgup",
59 {
60 "t": "#ffffff\n\n\n#ac97d8"
61 },
62 "^\n6\n\nF6"
63 ],
64 [
65 {
66 "y": -0.875,
67 "t": "#ffffff",
68 "w": 1.5
69 },
70 "~\n`",
71 {
72 "t": "#ffffff\n\n\n#ac97d8"
73 },
74 "!\n1\n\nF1",
75 {
76 "x": 14.5
77 },
78 ")\n0\n\nF10",
79 {
80 "w": 1.5
81 },
82 "_\n-\n\nF11"
83 ],
84 [
85 {
86 "y": -0.375,
87 "x": 3.5,
88 "t": "#ffffff"
89 },
90 "E",
91 {
92 "x": 10.5
93 },
94 "I"
95 ],
96 [
97 {
98 "y": -0.875,
99 "x": 2.5
100 },
101 "W",
102 {
103 "x": 1
104 },
105 "R",
106 {
107 "x": 8.5
108 },
109 "U",
110 {
111 "x": 1,
112 "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615"
113 },
114 "O\n\n\n\n\n\n\n\n\n{"
115 ],
116 [
117 {
118 "y": -0.875,
119 "x": 5.5,
120 "t": "#ffffff"
121 },
122 "T",
123 {
124 "h": 1.5
125 },
126 "end",
127 {
128 "x": 4.5,
129 "h": 1.5
130 },
131 "pgdn",
132 "Y"
133 ],
134 [
135 {
136 "y": -0.875,
137 "w": 1.5
138 },
139 "+\n=",
140 "Q",
141 {
142 "x": 14.5,
143 "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615"
144 },
145 "P\n\n\n\n\n\n\n\n\n}",
146 {
147 "t": "#ffffff\n\n\n#ac97d8",
148 "w": 1.5
149 },
150 "|\n\\\n\nF12"
151 ],
152 [
153 {
154 "y": -0.375,
155 "x": 3.5,
156 "t": "#ffffff"
157 },
158 "D",
159 {
160 "x": 10.5,
161 "t": "#ffffff\n\n#5eb1e7\n#ac97d8"
162 },
163 "K\n\n<i class='fa fa-caret-up'></i>\n<i class='kb kb-Arrows-Up'></i>"
164 ],
165 [
166 {
167 "y": -0.875,
168 "x": 2.5,
169 "t": "#ffffff"
170 },
171 "S",
172 {
173 "x": 1,
174 "n": true
175 },
176 "F",
177 {
178 "x": 8.5,
179 "t": "#ffffff\n\n#5eb1e7\n#ac97d8",
180 "n": true
181 },
182 "J\n\n<i class='fa fa-caret-down'></i>\n<i class='kb kb-Arrows-Down'></i>",
183 {
184 "x": 1,
185 "t": "#ffffff\n\n#5eb1e7\n#ac97d8\n\n\n\n\n\n#f8d615"
186 },
187 "L\n\n<i class='fa fa-caret-right'></i>\n<i class='kb kb-Arrows-Right'></i>\n\n\n\n\n\n("
188 ],
189 [
190 {
191 "y": -0.875,
192 "x": 5.5,
193 "t": "#ffffff"
194 },
195 "G",
196 {
197 "x": 6.5,
198 "t": "#ffffff\n\n#5eb1e7\n#ac97d8"
199 },
200 "H\n\n<i class='fa fa-caret-left'></i>\n<i class='kb kb-Arrows-Left'></i>"
201 ],
202 [
203 {
204 "y": -0.875,
205 "t": "#f8d615",
206 "a": 6,
207 "w": 1.5
208 },
209 "( ) [ ] { }",
210 {
211 "t": "#ffffff",
212 "a": 4
213 },
214 "A",
215 {
216 "x": 14.5,
217 "t": "#ffffff\n\n\n\n\n\n\n#60605b\n\n#f8d615"
218 },
219 ":\n;\n\n\n\n\n\n&Ouml;\n\n)",
220 {
221 "t": "#ffffff\n\n\n\n\n\n\n#60605b",
222 "w": 1.5
223 },
224 "\"\n'\n\n\n\n\n\n&Auml;"
225 ],
226 [
227 {
228 "y": -0.625,
229 "x": 6.5,
230 "t": "#ffffff",
231 "h": 1.5
232 },
233 "<i class='kb kb-Unicode-BackSpace-DeleteLeft-Big'></i>",
234 {
235 "x": 4.5,
236 "h": 1.5
237 },
238 "<i class='kb kb-Unicode-DeleteRight-Big'></i>"
239 ],
240 [
241 {
242 "y": -0.75,
243 "x": 3.5
244 },
245 "C",
246 {
247 "x": 10.5
248 },
249 "<\n,"
250 ],
251 [
252 {
253 "y": -0.875,
254 "x": 2.5
255 },
256 "X",
257 {
258 "x": 1
259 },
260 "V",
261 {
262 "x": 8.5
263 },
264 "M",
265 {
266 "x": 1,
267 "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615"
268 },
269 ">\n.\n\n\n\n\n\n\n\n["
270 ],
271 [
272 {
273 "y": -0.875,
274 "x": 5.5,
275 "t": "#ffffff"
276 },
277 "B",
278 {
279 "x": 6.5
280 },
281 "N"
282 ],
283 [
284 {
285 "y": -0.875,
286 "t": "#ffffff\n\n#f67f00",
287 "a": 6,
288 "fa": [
289 5
290 ],
291 "w": 1.5
292 },
293 "&uArr;\n\n2-tap<br/>locks",
294 {
295 "t": "#ffffff",
296 "a": 4,
297 "f": 3
298 },
299 "Z",
300 {
301 "x": 14.5,
302 "t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615",
303 "f": 3
304 },
305 "?\n/\n\n\n\n\n\n\n\n]",
306 {
307 "t": "#ffffff\n\n#f67f00",
308 "a": 6,
309 "f": 3,
310 "w": 1.5
311 },
312 "&uArr;\n\n2-tap<br/>locks"
313 ],
314 [
315 {
316 "y": -0.375,
317 "x": 3.5,
318 "t": "#ffffff",
319 "a": 4
320 },
321 "\n<i class='kb kb-Multimedia-Volume-Up-2'></i>",
322 {
323 "x": 10.5,
324 "f": 3
325 },
326 "}\n]"
327 ],
328 [
329 {
330 "y": -0.875,
331 "x": 2.5
332 },
333 "\n<i class='kb kb-Multimedia-Volume-Down-1'></i>",
334 {
335 "x": 1
336 },
337 "\n<i class='kb kb-Multimedia-Mute-1'></i>",
338 {
339 "x": 8.5,
340 "t": "#ffffff\n\n\n\n\n\n\n#60605b",
341 "f": 3
342 },
343 "{\n[\n\n\n\n\n\n&Aring;",
344 {
345 "x": 1,
346 "t": "#ffffff",
347 "f": 3
348 },
349 "+\n="
350 ],
351 [
352 {
353 "y": -0.75,
354 "x": 0.5,
355 "f": 3
356 },
357 "ctrl",
358 {
359 "f": 3
360 },
361 "alt",
362 {
363 "x": 14.5,
364 "f": 3
365 },
366 "altgr",
367 {
368 "f": 3
369 },
370 "ctrl"
371 ],
372 [
373 {
374 "r": 30,
375 "rx": 6.5,
376 "ry": 4.25,
377 "y": -1,
378 "x": 1,
379 "t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7",
380 "f": 3
381 },
382 "esc\n\n\n\n\n\n\n\n\n\n<i class='fa fa-mouse-pointer'></i>M",
383 {
384 "t": "#ffffff",
385 "f": 7
386 },
387 "<i class='kb kb-logo-linux-tux'></i>"
388 ],
389 [
390 {
391 "t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7",
392 "f": 3,
393 "h": 2
394 },
395 "space\n\n\n\n\n\n\n\n\n\n<i class='fa fa-mouse-pointer'></i>L",
396 {
397 "h": 2
398 },
399 "<i class='kb kb-Tab-1'></i>\n\n\n\n\n\n\n\n\n\n<i class='fa fa-mouse-pointer'></i>R",
400 {
401 "t": "#5eb1e7"
402 },
403 "<i class='fa fa-mouse-pointer'></i>"
404 ],
405 [
406 {
407 "x": 2,
408 "t": "#ac97d8"
409 },
410 "<i class='fa fa-arrows'></i>"
411 ],
412 [
413 {
414 "r": -30,
415 "rx": 13,
416 "y": -1,
417 "x": -3,
418 "t": "#ffffff"
419 },
420 "<i class='kb kb-Hamburger-Menu'></i>",
421 "esc"
422 ],
423 [
424 {
425 "x": -3
426 },
427 "ins",
428 {
429 "h": 2
430 },
431 "<i class='kb kb-Return-2'></i>",
432 {
433 "h": 2
434 },
435 "space"
436 ],
437 [
438 {
439 "x": -3
440 },
441 "scroll<br/>lock"
442 ]
443] \ No newline at end of file
diff --git a/keyboards/ergodox/keymaps/videck/videck.png b/keyboards/ergodox/keymaps/videck/videck.png
new file mode 100644
index 000000000..c99323f53
--- /dev/null
+++ b/keyboards/ergodox/keymaps/videck/videck.png
Binary files differ
diff --git a/keyboards/ergodox/rules.mk b/keyboards/ergodox/rules.mk
index add64ec76..2e501e81b 100644
--- a/keyboards/ergodox/rules.mk
+++ b/keyboards/ergodox/rules.mk
@@ -24,6 +24,5 @@ COMMAND_ENABLE ?= yes # Commands for debug and configuration
24CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ 24CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ
25SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend 25SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
26NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 26NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
27MIDI_ENABLE ?= no # MIDI controls
28UNICODE_ENABLE ?= yes # Unicode 27UNICODE_ENABLE ?= yes # Unicode
29ONEHAND_ENABLE ?= yes # Allow swapping hands of keyboard 28ONEHAND_ENABLE ?= yes # Allow swapping hands of keyboard
diff --git a/keyboards/gh60/gh60.h b/keyboards/gh60/gh60.h
index 82624b614..66bc2790d 100644
--- a/keyboards/gh60/gh60.h
+++ b/keyboards/gh60/gh60.h
@@ -4,7 +4,7 @@
4#include "quantum.h" 4#include "quantum.h"
5#include "led.h" 5#include "led.h"
6 6
7/* GH60 LEDs 7/* GH60 LEDs
8 * GPIO pads 8 * GPIO pads
9 * 0 F7 WASD LEDs 9 * 0 F7 WASD LEDs
10 * 1 F6 ESC LED 10 * 1 F6 ESC LED
@@ -35,40 +35,41 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
35 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ 35 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
36 K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ 36 K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \
37) { \ 37) { \
38 { 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 }, \ 38 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
39 { 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 }, \ 39 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
40 { 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 }, \ 40 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
41 { 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 }, \ 41 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
42 { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ 42 { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \
43} 43}
44 44
45/* ANSI valiant. No extra keys for ISO */ 45/* ANSI variant. No extra keys for ISO */
46#define KEYMAP_ANSI( \ 46#define KEYMAP_ANSI( \
47 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ 47 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
48 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 48 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
49 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ 49 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
50 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ 50 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
51 K40, K41, K42, K45, K4A, K4B, K4C, K4D \ 51 K40, K41, K42, K45, K4A, K4B, K4C, K4D \
52) KEYMAP( \ 52) { \
53 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ 53 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
54 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 54 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
55 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ 55 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \
56 K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO, K3D, \ 56 { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D }, \
57 K40, K41, K42, K45, NO, K4A, K4B, K4C, K4D \ 57 { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \
58) 58}
59 59
60/* HHKB Variant */
60#define KEYMAP_HHKB( \ 61#define KEYMAP_HHKB( \
61 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ 62 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\
62 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 63 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
63 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ 64 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
64 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ 65 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \
65 K40, K41, K42, K45, K4A, K4B, K4C, K4D \ 66 K40, K41, K42, K45, K4A, K4B, K4C, K4D \
66) KEYMAP( \ 67) { \
67 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ 68 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
68 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 69 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
69 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ 70 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \
70 K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ 71 { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
71 K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ 72 { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \
72) 73}
73 74
74#endif 75#endif
diff --git a/keyboards/gh60/keymaps/default/keymap.c b/keyboards/gh60/keymaps/default/keymap.c
index 3622be41b..92f545984 100644
--- a/keyboards/gh60/keymaps/default/keymap.c
+++ b/keyboards/gh60/keymaps/default/keymap.c
@@ -4,25 +4,25 @@
4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 4const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5 /* 0: qwerty */ 5 /* 0: qwerty */
6 KEYMAP( 6 KEYMAP(
7 ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, \ 7 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,\
8 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ 8 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,\
9 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, \ 9 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,\
10 LSFT,FN1, Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, RSFT, \ 10 KC_LSFT,F(1),KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,F(0),KC_RSFT,\
11 LCTL,LGUI,LALT, SPC, BSLS,RALT,RGUI,APP, RCTL), 11 KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_BSLS,KC_RALT,KC_RGUI,KC_APP,KC_RCTL),
12 /* 1: fn */ 12 /* 1: fn */
13 KEYMAP( 13 KEYMAP(
14 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ 14 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_TRNS,\
15 TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 15 KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,\
16 TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 16 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,\
17 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 17 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,\
18 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), 18 KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
19 /* 2: arrows */ 19 /* 2: arrows */
20 KEYMAP( 20 KEYMAP(
21 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 21 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,\
22 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 22 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,\
23 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 23 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,\
24 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,UP, \ 24 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,\
25 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,LEFT,DOWN,RGHT), 25 KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT),
26}; 26};
27 27
28const uint16_t PROGMEM fn_actions[] = { 28const uint16_t PROGMEM fn_actions[] = {
@@ -49,7 +49,7 @@ void matrix_scan_user(void) {
49 49
50//Layer LED indicators 50//Layer LED indicators
51 uint32_t layer = layer_state; 51 uint32_t layer = layer_state;
52 52
53 if (layer & (1<<1)) { 53 if (layer & (1<<1)) {
54 gh60_wasd_leds_on(); 54 gh60_wasd_leds_on();
55 gh60_fn_led_on(); 55 gh60_fn_led_on();
@@ -57,7 +57,7 @@ void matrix_scan_user(void) {
57 gh60_wasd_leds_off(); 57 gh60_wasd_leds_off();
58 gh60_fn_led_off(); 58 gh60_fn_led_off();
59 } 59 }
60 60
61 if (layer & (1<<2)) { 61 if (layer & (1<<2)) {
62 gh60_poker_leds_on(); 62 gh60_poker_leds_on();
63 gh60_esc_led_on(); 63 gh60_esc_led_on();
@@ -65,5 +65,5 @@ void matrix_scan_user(void) {
65 gh60_poker_leds_off(); 65 gh60_poker_leds_off();
66 gh60_esc_led_off(); 66 gh60_esc_led_off();
67 } 67 }
68 68
69}; 69};
diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h
index 6a29e6b8c..bcd753461 100644
--- a/keyboards/gh60/keymaps/robotmaxtron/config.h
+++ b/keyboards/gh60/keymaps/robotmaxtron/config.h
@@ -182,7 +182,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
182#define ws2812_pin PF4 182#define ws2812_pin PF4
183*/ 183*/
184#define RGB_DI_PIN F4 184#define RGB_DI_PIN F4
185#define RGBLIGHT_TIMER 185#define RGBLIGHT_ANIMATIONS
186#define RGBLED_NUM 8 // Number of LEDs 186#define RGBLED_NUM 8 // Number of LEDs
187#define RGBLIGHT_HUE_STEP 8 187#define RGBLIGHT_HUE_STEP 8
188#define RGBLIGHT_SAT_STEP 8 188#define RGBLIGHT_SAT_STEP 8
diff --git a/keyboards/gh60/keymaps/robotmaxtron/keymap.c b/keyboards/gh60/keymaps/robotmaxtron/keymap.c
index 263eec4e5..9acac7cec 100644
--- a/keyboards/gh60/keymaps/robotmaxtron/keymap.c
+++ b/keyboards/gh60/keymaps/robotmaxtron/keymap.c
@@ -8,9 +8,9 @@
8 8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 /* 10 /*
11 * Base layer, pretty standard ANSI layout. 11 * Base layer, pretty standard ANSI layout.
12 * ,-----------------------------------------------------------. 12 * ,-----------------------------------------------------------.
13 * |FN12| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | 13 * |F(12)| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
14 * |-----------------------------------------------------------| 14 * |-----------------------------------------------------------|
15 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| 15 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
16 * |-----------------------------------------------------------| 16 * |-----------------------------------------------------------|
@@ -22,13 +22,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 * `-----------------------------------------------------------' 22 * `-----------------------------------------------------------'
23 */ 23 */
24 [_BL] = KEYMAP( 24 [_BL] = KEYMAP(
25 FN12,1,2,3,4,5,6,7,8,9,0,MINS,EQL,BSPC, \ 25 F(12),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, \
26 TAB,Q,W,E,R,T,Y,U,I,O,P,LBRC,RBRC,BSLS, \ 26 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, \
27 FN2,A,S,D,F,G,H,J,K,L,SCLN,QUOT,NO,ENT, \ 27 F(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, \
28 LSFT,NO,Z,X,C,V,B,N,M,COMM,DOT,SLSH,NO,RSFT, \ 28 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, \
29 LCTL,LGUI,LALT, SPC, NO,RALT,FN0,APP, RCTL), 29 KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_NO,KC_RALT,F(0),KC_APP,KC_RCTL),
30 30
31 /* 31 /*
32 * Locking arrow keys to WASD for when you need dedicated arrow keys 32 * Locking arrow keys to WASD for when you need dedicated arrow keys
33 * ,-----------------------------------------------------------. 33 * ,-----------------------------------------------------------.
34 * | | | | | | | | | | | | | | | 34 * | | | | | | | | | | | | | | |
@@ -43,14 +43,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
43 * `-----------------------------------------------------------' 43 * `-----------------------------------------------------------'
44 */ 44 */
45 [_AL] = KEYMAP( 45 [_AL] = KEYMAP(
46 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 46 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
47 TRNS,TRNS,UP,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 47 KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
48 TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 48 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, \
49 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 49 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
50 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), 50 KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
51 51
52 52
53 /* 53 /*
54 * Primary function layer, mostly the same as the traditional Pok3r layout. 54 * Primary function layer, mostly the same as the traditional Pok3r layout.
55 * ,-------------------------------------------------------------. 55 * ,-------------------------------------------------------------.
56 * |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL | 56 * |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL |
@@ -65,15 +65,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 * `-------------------------------------------------------------' 65 * `-------------------------------------------------------------'
66 */ 66 */
67 [_FL] = KEYMAP( 67 [_FL] = KEYMAP(
68 GRAVE,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12, DELETE, \ 68 KC_GRAVE,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_DELETE, \
69 TRNS,FN1,TRNS,TRNS,TRNS,TRNS,CALC,PGUP,UP,PGDN,PSCR,SLCK,PAUS,TRNS, \ 69 KC_TRNS,F(1),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_CALC,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_SLCK,KC_PAUS,KC_TRNS, \
70 TRNS,MUTE,_VOLDOWN,_VOLUP,TRNS,TRNS,HOME,LEFT,DOWN,RGHT,INS,TRNS,TRNS,TRNS, \ 70 KC_TRNS,KC_MUTE,KC__VOLDOWN,KC__VOLUP,KC_TRNS,KC_TRNS,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_INS,KC_TRNS,KC_TRNS,KC_TRNS, \
71 TRNS,TRNS,FN3,TRNS,TRNS,TRNS,TRNS,END,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 71 KC_TRNS,KC_TRNS,F(3),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_END,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
72 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), 72 KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
73 73
74 /* 74 /*
75 * Locking layer for controlling the underglow. 75 * Locking layer for controlling the underglow.
76 * 76 *
77 * ,-----------------------------------------------------------. 77 * ,-----------------------------------------------------------.
78 * | | | | | | | | | | | | | | | 78 * | | | | | | | | | | | | | | |
79 * |-----------------------------------------------------------| 79 * |-----------------------------------------------------------|
@@ -87,11 +87,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 * `-----------------------------------------------------------' 87 * `-----------------------------------------------------------'
88 */ 88 */
89 [_UL] = KEYMAP( 89 [_UL] = KEYMAP(
90 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 90 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
91 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 91 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
92 TRNS,FN4,FN5,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ 92 KC_TRNS,F(4),F(5),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
93 TRNS,TRNS,TRNS,FN6,FN7,FN8,FN9,FN10,FN11,TRNS,TRNS,TRNS,TRNS,TRNS, \ 93 KC_TRNS,KC_TRNS,KC_TRNS,F(6),F(7),F(8),F(9),F(10),F(11),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
94 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), 94 KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
95}; 95};
96 96
97enum function_id { 97enum function_id {
@@ -124,7 +124,7 @@ const uint16_t PROGMEM fn_actions[] = {
124 124
125const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 125const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
126{ 126{
127 // MACRODOWN only works in this function 127 // MACRODOWN only works in this function
128 switch(id) { 128 switch(id) {
129 case 0: 129 case 0:
130 if (record->event.pressed) { 130 if (record->event.pressed) {
diff --git a/keyboards/gh60/keymaps/sethbc/Makefile b/keyboards/gh60/keymaps/sethbc/Makefile
new file mode 100644
index 000000000..457a3d01d
--- /dev/null
+++ b/keyboards/gh60/keymaps/sethbc/Makefile
@@ -0,0 +1,3 @@
1ifndef QUANTUM_DIR
2 include ../../../../Makefile
3endif
diff --git a/keyboards/gh60/keymaps/sethbc/keymap.c b/keyboards/gh60/keymaps/sethbc/keymap.c
new file mode 100644
index 000000000..599e664e2
--- /dev/null
+++ b/keyboards/gh60/keymaps/sethbc/keymap.c
@@ -0,0 +1,76 @@
1#include "gh60.h"
2#include "action_layer.h"
3
4#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
5
6
7const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
8 /* 0: qwerty */
9 KEYMAP_HHKB(
10 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_BSLS,KC_GRV,\
11 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,\
12 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,\
13 KC_LSFT,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT,F(1),\
14 KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RGUI,KC_RALT,KC_APP,KC_RCTL),
15 /* 1: fn */
16 KEYMAP_HHKB(
17 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_TRNS,KC_TRNS,\
18 KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,\
19 KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RIGHT,KC_PENT,\
20 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,\
21 KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
22};
23
24enum function_id {
25 SHIFT_ESC,
26};
27
28const uint16_t PROGMEM fn_actions[] = {
29 [0] = ACTION_FUNCTION(SHIFT_ESC),
30 [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
31};
32
33const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
34{
35 // MACRODOWN only works in this function
36 switch(id) {
37 case 0:
38 if (record->event.pressed) {
39 register_code(KC_RSFT);
40 } else {
41 unregister_code(KC_RSFT);
42 }
43 break;
44 }
45 return MACRO_NONE;
46};
47
48void matrix_scan_user(void) {
49
50}
51
52void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
53 static uint8_t shift_esc_shift_mask;
54 switch (id) {
55 case SHIFT_ESC:
56 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
57 if (record->event.pressed) {
58 if (shift_esc_shift_mask) {
59 add_key(KC_GRV);
60 send_keyboard_report();
61 } else {
62 add_key(KC_ESC);
63 send_keyboard_report();
64 }
65 } else {
66 if (shift_esc_shift_mask) {
67 del_key(KC_GRV);
68 send_keyboard_report();
69 } else {
70 del_key(KC_ESC);
71 send_keyboard_report();
72 }
73 }
74 break;
75 }
76}
diff --git a/keyboards/handwired/minorca/keymaps/rgb/config.h b/keyboards/handwired/minorca/keymaps/rgb/config.h
index deaac2e26..43b3c5911 100644
--- a/keyboards/handwired/minorca/keymaps/rgb/config.h
+++ b/keyboards/handwired/minorca/keymaps/rgb/config.h
@@ -11,7 +11,7 @@
11 11
12/* ws2812 RGB LED */ 12/* ws2812 RGB LED */
13#define RGB_DI_PIN D5 13#define RGB_DI_PIN D5
14#define RGBLIGHT_TIMER 14#define RGBLIGHT_ANIMATIONS
15#define RGBLED_NUM 13 // Number of LEDs 15#define RGBLED_NUM 13 // Number of LEDs
16#define RGBLIGHT_HUE_STEP 10 16#define RGBLIGHT_HUE_STEP 10
17#define RGBLIGHT_SAT_STEP 17 17#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/handwired/promethium/Makefile b/keyboards/handwired/promethium/Makefile
new file mode 100644
index 000000000..191c6bb66
--- /dev/null
+++ b/keyboards/handwired/promethium/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h
new file mode 100644
index 000000000..473af67d3
--- /dev/null
+++ b/keyboards/handwired/promethium/config.h
@@ -0,0 +1,162 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6660
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Priyadi
28#define PRODUCT Promethium Keyboard
29#define DESCRIPTION Promethium Keyboard
30
31/* key matrix size */
32#define MATRIX_ROWS 8
33#define MATRIX_COLS 6
34
35/* default pin-out */
36#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 }
37#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 }
38#define UNUSED_PINS
39
40/* COL2ROW or ROW2COL */
41#define DIODE_DIRECTION COL2ROW
42
43/* define if matrix has ghost */
44//#define MATRIX_HAS_GHOST
45
46/* number of backlight levels */
47#define BACKLIGHT_LEVELS 3
48
49/* Set 0 if debouncing isn't needed */
50#define DEBOUNCING_DELAY 5
51
52/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
53#define LOCKING_SUPPORT_ENABLE
54/* Locking resynchronize hack */
55#define LOCKING_RESYNC_ENABLE
56
57/* key combination for command */
58#define IS_COMMAND() ( \
59 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) \
60)
61
62/*
63 * Feature disable options
64 * These options are also useful to firmware size reduction.
65 */
66
67/* disable debug print */
68//#define NO_DEBUG
69
70/* disable print */
71//#define NO_PRINT
72
73/* disable action features */
74//#define NO_ACTION_LAYER
75//#define NO_ACTION_TAPPING
76//#define NO_ACTION_ONESHOT
77//#define NO_ACTION_MACRO
78//#define NO_ACTION_FUNCTION
79
80/* PS/2 mouse */
81#ifdef PS2_USE_BUSYWAIT
82# define PS2_CLOCK_PORT PORTD
83# define PS2_CLOCK_PIN PIND
84# define PS2_CLOCK_DDR DDRD
85# define PS2_CLOCK_BIT 1
86# define PS2_DATA_PORT PORTD
87# define PS2_DATA_PIN PIND
88# define PS2_DATA_DDR DDRD
89# define PS2_DATA_BIT 2
90#endif
91
92/* PS/2 mouse interrupt version */
93#ifdef PS2_USE_INT
94/* uses INT1 for clock line(ATMega32U4) */
95#define PS2_CLOCK_PORT PORTD
96#define PS2_CLOCK_PIN PIND
97#define PS2_CLOCK_DDR DDRD
98#define PS2_CLOCK_BIT 3
99#define PS2_DATA_PORT PORTD
100#define PS2_DATA_PIN PIND
101#define PS2_DATA_DDR DDRD
102#define PS2_DATA_BIT 2
103
104#define PS2_INT_INIT() do { \
105 EICRA |= ((1<<ISC31) | \
106 (0<<ISC30)); \
107} while (0)
108#define PS2_INT_ON() do { \
109 EIMSK |= (1<<INT3); \
110} while (0)
111#define PS2_INT_OFF() do { \
112 EIMSK &= ~(1<<INT3); \
113} while (0)
114#define PS2_INT_VECT INT3_vect
115#endif
116
117/* PS/2 mouse USART version */
118#ifdef PS2_USE_USART
119/* XCK for clock line and RXD for data line */
120#define PS2_CLOCK_PORT PORTD
121#define PS2_CLOCK_PIN PIND
122#define PS2_CLOCK_DDR DDRD
123#define PS2_CLOCK_BIT 5
124#define PS2_DATA_PORT PORTD
125#define PS2_DATA_PIN PIND
126#define PS2_DATA_DDR DDRD
127#define PS2_DATA_BIT 2
128
129/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
130/* set DDR of CLOCK as input to be slave */
131#define PS2_USART_INIT() do { \
132 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
133 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
134 UCSR1C = ((1 << UMSEL10) | \
135 (3 << UPM10) | \
136 (0 << USBS1) | \
137 (3 << UCSZ10) | \
138 (0 << UCPOL1)); \
139 UCSR1A = 0; \
140 UBRR1H = 0; \
141 UBRR1L = 0; \
142} while (0)
143#define PS2_USART_RX_INT_ON() do { \
144 UCSR1B = ((1 << RXCIE1) | \
145 (1 << RXEN1)); \
146} while (0)
147#define PS2_USART_RX_POLL_ON() do { \
148 UCSR1B = (1 << RXEN1); \
149} while (0)
150#define PS2_USART_OFF() do { \
151 UCSR1C = 0; \
152 UCSR1B &= ~((1 << RXEN1) | \
153 (1 << TXEN1)); \
154} while (0)
155#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
156#define PS2_USART_RX_DATA UDR1
157#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
158#define PS2_USART_RX_VECT USART1_RX_vect
159#endif
160
161
162#endif
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/Makefile b/keyboards/handwired/promethium/keymaps/priyadi/Makefile
new file mode 100644
index 000000000..2f6f27a73
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/Makefile
@@ -0,0 +1,28 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19PS2_MOUSE_ENABLE = yes
20PS2_USE_INT = yes
21
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24
25ifndef QUANTUM_DIR
26 include ../../../../../Makefile
27endif
28
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h
new file mode 100644
index 000000000..8b78c0dc4
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h
@@ -0,0 +1,17 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/* bootmagic salt key */
7#define BOOTMAGIC_KEY_SALT KC_ESC
8
9/* skip bootmagic and eeconfig */
10#define BOOTMAGIC_KEY_SKIP KC_SPACE
11
12#define PREVENT_STUCK_MODIFIERS
13
14#define RGB_DI_PIN B5
15#define RGBSPS_NUM 57
16
17#endif
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/flash.sh b/keyboards/handwired/promethium/keymaps/priyadi/flash.sh
new file mode 100755
index 000000000..fb81a54ee
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/flash.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:../../../../../.build/handwired_promethium_priyadi.hex
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
new file mode 100644
index 000000000..b2da2f97b
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
@@ -0,0 +1,725 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "promethium.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8 #include "musical_notes.h"
9#endif
10#include "eeconfig.h"
11#include "process_unicode.h"
12#include "quantum.h"
13#include "rgbsps.h"
14#define COUNT(x) (sizeof (x) / sizeof (*(x)))
15
16// #define RGBLED_NUM 5
17// struct cRGB led[RGBLED_NUM];
18
19
20extern keymap_config_t keymap_config;
21
22enum layers {
23 _QWERTY,
24 _COLEMAK,
25 _WORKMAN,
26 _PUNC,
27 _NUM,
28 _FUNC,
29 _EMOJI,
30 _GUI,
31};
32
33enum planck_keycodes {
34 // layouts
35 QWERTY = SAFE_RANGE,
36 COLEMAK,
37 WORKMAN,
38
39 // layer switchers
40 PUNC,
41 NUM,
42 FUNC,
43 EMOJI,
44 GUI,
45
46 // os switchers
47 LINUX,
48 WIN,
49 OSX,
50};
51
52// Fillers to make layering clearer
53
54#define _______ KC_TRNS
55#define XXXXXXX KC_NO
56
57// unicode map
58
59enum unicode_name {
60 GRIN, // grinning face 😊
61 TJOY, // tears of joy 😂
62 SMILE, // grining face with smiling eyes 😁
63 HEART, // heart ❤
64 EYERT, // smiling face with heart shaped eyes 😍
65 CRY, // crying face 😭
66 SMEYE, // smiling face with smiling eyes 😊
67 UNAMU, // unamused 😒
68 KISS, // kiss 😘
69 HART2, // two hearts 💕
70 WEARY, // weary 😩
71 OKHND, // ok hand sign 👌
72 PENSV, // pensive 😔
73 SMIRK, // smirk 😏
74 RECYC, // recycle ♻
75 WINK, // wink 😉
76 THMUP, // thumb up 👍
77 THMDN, // thumb down 👎
78 PRAY, // pray 🙏
79 PHEW, // relieved 😌
80 MUSIC, // musical notes
81 FLUSH, // flushed 😳
82 CELEB, // celebration 🙌
83 CRY2, // crying face 😢
84 COOL, // smile with sunglasses 😎
85 NOEVS, // see no evil
86 NOEVH, // hear no evil
87 NOEVK, // speak no evil
88 POO, // pile of poo
89 EYES, // eyes
90 VIC, // victory hand
91 BHART, // broken heart
92 SLEEP, // sleeping face
93 SMIL2, // smiling face with open mouth & sweat
94 HUNRD, // 100
95 CONFU, // confused
96 TONGU, // face with tongue & winking eye
97 DISAP, // disappointed
98 YUMMY, // face savoring delicious food
99 CLAP, // hand clapping
100 FEAR, // face screaming in fear
101 HORNS, // smiling face with horns
102 HALO, // smiling face with halo
103 BYE, // waving hand
104 SUN, // sun
105 MOON, // moon
106 SKULL, // skull
107};
108
109const uint32_t PROGMEM unicode_map[] = {
110 [GRIN] = 0x1F600,
111 [TJOY] = 0x1F602,
112 [SMILE] = 0x1F601,
113 [HEART] = 0x2764,
114 [EYERT] = 0x1f60d,
115 [CRY] = 0x1f62d,
116 [SMEYE] = 0x1F60A,
117 [UNAMU] = 0x1F612,
118 [KISS] = 0x1F618,
119 [HART2] = 0x1F495,
120 [WEARY] = 0x1F629,
121 [OKHND] = 0x1F44C,
122 [PENSV] = 0x1F614,
123 [SMIRK] = 0x1F60F,
124 [RECYC] = 0x267B,
125 [WINK] = 0x1F609,
126 [THMUP] = 0x1F44D,
127 [THMDN] = 0x1F44E,
128 [PRAY] = 0x1F64F,
129 [PHEW] = 0x1F60C,
130 [MUSIC] = 0x1F3B6,
131 [FLUSH] = 0x1F633,
132 [CELEB] = 0x1F64C,
133 [CRY2] = 0x1F622,
134 [COOL] = 0x1F60E,
135 [NOEVS] = 0x1F648,
136 [NOEVH] = 0x1F649,
137 [NOEVK] = 0x1F64A,
138 [POO] = 0x1F4A9,
139 [EYES] = 0x1F440,
140 [VIC] = 0x270C,
141 [BHART] = 0x1F494,
142 [SLEEP] = 0x1F634,
143 [SMIL2] = 0x1F605,
144 [HUNRD] = 0x1F4AF,
145 [CONFU] = 0x1F615,
146 [TONGU] = 0x1F61C,
147 [DISAP] = 0x1F61E,
148 [YUMMY] = 0x1F60B,
149 [CLAP] = 0x1F44F,
150 [FEAR] = 0x1F631,
151 [HORNS] = 0x1F608,
152 [HALO] = 0x1F607,
153 [BYE] = 0x1F44B,
154 [SUN] = 0x2600,
155 [MOON] = 0x1F314,
156 [SKULL] = 0x1F480,
157};
158
159
160// hybrid shift - =
161// #undef KC_LSFT
162// #define KC_LSFT MT(MOD_LSFT, KC_MINS)
163// #undef KC_RSFT
164// #define KC_RSFT MT(MOD_LSFT, KC_EQL)
165
166
167// hybrid right-gui & scroll lock (mapped to Compose in OS)
168#undef KC_RCTL
169#define KC_RCTL MT(MOD_LCTL, KC_SLCK)
170
171// RGBSPS
172
173const uint8_t PROGMEM LED_ALNUM[] = {
174 LED_Z,
175 LED_A,
176 LED_Q,
177 LED_W,
178 LED_S,
179 LED_X,
180 LED_C,
181 LED_D,
182 LED_E,
183 LED_R,
184 LED_F,
185 LED_V,
186 LED_B,
187 LED_G,
188 LED_T,
189 LED_N,
190 LED_HH,
191 LED_Y,
192 LED_U,
193 LED_J,
194 LED_M,
195 LED_COMM,
196 LED_K,
197 LED_I,
198 LED_O,
199 LED_L,
200 LED_DOT,
201 LED_SLSH,
202 LED_SCLN,
203 LED_P,
204 LED_LSPC,
205 LED_RSPC
206};
207
208const uint8_t PROGMEM LED_MODS[] = {
209 LED_TAB,
210 LED_ESC,
211 LED_LSFT,
212 LED_LCTL,
213 LED_LGUI,
214 LED_LALT,
215 LED_RALT,
216 LED_RGUI,
217 LED_BKSP,
218 LED_ENT,
219 LED_RSFT,
220 LED_RCTL
221};
222
223const uint8_t PROGMEM LED_FN[] = {
224 LED_PUNC,
225 LED_NUM,
226 LED_FUNC,
227 LED_EMOJI
228};
229
230const uint8_t PROGMEM LED_INDICATORS[] = {
231 LED_IND_EMOJI,
232 LED_IND_NUM,
233 LED_IND_FUNC,
234 LED_IND_BATTERY,
235 LED_IND_USB,
236 LED_IND_BLUETOOTH,
237};
238
239const uint8_t PROGMEM LED_TRACKPOINT[] = {
240 LED_TRACKPOINT1,
241 LED_TRACKPOINT2,
242 LED_TRACKPOINT3,
243};
244
245void led_reset(void) {
246 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
247 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 15, 6, 0);
248 }
249
250 for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
251 rgbsps_set(pgm_read_byte(&LED_MODS[i]), 15, 0, 0);
252 }
253
254 for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
255 rgbsps_set(pgm_read_byte(&LED_FN[i]), 15, 15, 15);
256 }
257}
258
259void led_layer_normal(void) {
260 rgbsps_set(LED_IND_FUNC, 0, 0, 0);
261 rgbsps_set(LED_IND_NUM, 0, 0, 0);
262 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
263
264 led_reset();
265
266 rgbsps_send();
267}
268
269void led_layer_func(void) {
270 rgbsps_set(LED_IND_FUNC, 0, 15, 0);
271 rgbsps_set(LED_IND_NUM, 0, 0, 0);
272 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
273
274 led_reset();
275
276 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
277 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0);
278 }
279
280 rgbsps_set(LED_I, 15, 0, 15);
281 rgbsps_set(LED_J, 15, 0, 15);
282 rgbsps_set(LED_K, 15, 0, 15);
283 rgbsps_set(LED_L, 15, 0, 15);
284
285 rgbsps_set(LED_U, 15, 0, 10);
286 rgbsps_set(LED_O, 15, 0, 10);
287 rgbsps_set(LED_COMM, 15, 0, 10);
288 rgbsps_set(LED_DOT, 15, 0, 10);
289 rgbsps_set(LED_SCLN, 15, 0, 10);
290 rgbsps_set(LED_P, 15, 0, 10);
291
292 rgbsps_set(LED_Q, 10, 0, 15);
293 rgbsps_set(LED_W, 10, 0, 15);
294 rgbsps_set(LED_E, 10, 0, 15);
295 rgbsps_set(LED_R, 10, 0, 15);
296 rgbsps_set(LED_A, 10, 0, 15);
297 rgbsps_set(LED_S, 10, 0, 15);
298 rgbsps_set(LED_D, 10, 0, 15);
299 rgbsps_set(LED_F, 10, 0, 15);
300 rgbsps_set(LED_Z, 10, 0, 15);
301 rgbsps_set(LED_X, 10, 0, 15);
302 rgbsps_set(LED_C, 10, 0, 15);
303 rgbsps_set(LED_V, 10, 0, 15);
304
305 rgbsps_send();
306}
307
308void led_layer_punc(void) {
309 rgbsps_set(LED_IND_FUNC, 0, 15, 0);
310 rgbsps_set(LED_IND_NUM, 0, 0, 15);
311 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
312
313 led_reset();
314
315 rgbsps_send();
316}
317
318void led_layer_num(void) {
319 rgbsps_set(LED_IND_FUNC, 0, 0, 0);
320 rgbsps_set(LED_IND_NUM, 0, 0, 15);
321 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
322
323 led_reset();
324
325 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
326 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0);
327 }
328
329 rgbsps_set(LED_U, 0, 5, 15);
330 rgbsps_set(LED_I, 0, 5, 15);
331 rgbsps_set(LED_O, 0, 5, 15);
332 rgbsps_set(LED_J, 0, 5, 15);
333 rgbsps_set(LED_K, 0, 5, 15);
334 rgbsps_set(LED_L, 0, 5, 15);
335 rgbsps_set(LED_M, 0, 5, 15);
336 rgbsps_set(LED_COMM, 0, 5, 15);
337 rgbsps_set(LED_DOT, 0, 5, 15);
338 rgbsps_set(LED_FUNC, 0, 5, 15);
339
340 rgbsps_set(LED_EMOJI, 0, 10, 15);
341 rgbsps_set(LED_RALT, 0, 10, 15);
342
343 rgbsps_set(LED_Q, 0, 10, 15);
344 rgbsps_set(LED_W, 0, 10, 15);
345 rgbsps_set(LED_E, 0, 10, 15);
346 rgbsps_set(LED_R, 0, 10, 15);
347 rgbsps_set(LED_T, 0, 10, 15);
348 rgbsps_set(LED_Y, 0, 10, 15);
349 rgbsps_set(LED_P, 0, 10, 15);
350
351 rgbsps_set(LED_A, 0, 15, 15);
352 rgbsps_set(LED_S, 0, 15, 15);
353 rgbsps_set(LED_D, 0, 15, 15);
354 rgbsps_set(LED_F, 0, 15, 15);
355 rgbsps_set(LED_Z, 0, 15, 15);
356 rgbsps_set(LED_X, 0, 15, 15);
357 rgbsps_set(LED_C, 0, 15, 15);
358 rgbsps_set(LED_V, 0, 15, 15);
359
360 rgbsps_send();
361}
362
363void led_layer_emoji(void) {
364 rgbsps_setall(15, 15, 0);
365
366 rgbsps_set(LED_IND_FUNC, 0, 0, 0);
367 rgbsps_set(LED_IND_NUM, 0, 0, 0);
368 rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
369
370 rgbsps_set(LED_PUNC, 15, 15, 15);
371 rgbsps_set(LED_EMOJI, 15, 15, 15);
372
373 rgbsps_send();
374}
375
376void led_layer_gui(void) {
377 rgbsps_set(LED_IND_FUNC, 15, 10, 15);
378 rgbsps_set(LED_IND_NUM, 15, 10, 15);
379 rgbsps_set(LED_IND_EMOJI, 15, 10, 15);
380 rgbsps_send();
381}
382
383void led_init(void) {
384 // turn off all
385 rgbsps_turnoff();
386
387 // set trackpoint color
388 rgbsps_set(LED_TRACKPOINT1, 15, 0, 0);
389 rgbsps_set(LED_TRACKPOINT2, 0, 0, 15);
390 rgbsps_set(LED_TRACKPOINT3, 15, 0, 0);
391
392 // // hardcode indicator for now
393 rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15);
394 rgbsps_set(LED_IND_USB, 15, 15, 15);
395 rgbsps_set(LED_IND_BATTERY, 0, 15, 0);
396
397 led_layer_normal();
398}
399
400
401// keymaps
402
403const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
404
405/* Qwerty
406 * ,-----------------------------------------------------------------------------------.
407 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
408 * |------+------+------+------+------+-------------+------+------+------+------+------|
409 * | Esc | A | S | D | F | G | H | J | K | L | ; |Enter |
410 * |------+------+------+------+------+------|------+------+------+------+------+------|
411 * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
412 * |------+------+------+------+------+------+------+------+------+------+------+------|
413 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
414 * `-----------------------------------------------------------------------------------'
415 */
416[_QWERTY] = KEYMAP(
417 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
418 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT ,
419 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
420 KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL
421),
422
423/* Colemak
424 * ,-----------------------------------------------------------------------------------.
425 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
426 * |------+------+------+------+------+-------------+------+------+------+------+------|
427 * | Esc | A | R | S | T | D | H | N | E | I | O |Enter |
428 * |------+------+------+------+------+------|------+------+------+------+------+------|
429 * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift |
430 * |------+------+------+------+------+------+------+------+------+------+------+------|
431 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
432 * `-----------------------------------------------------------------------------------'
433 */
434[_COLEMAK] = KEYMAP(
435 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
436 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT ,
437 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
438 KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL
439),
440
441/* Workman
442 * ,-----------------------------------------------------------------------------------.
443 * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp |
444 * |------+------+------+------+------+-------------+------+------+------+------+------|
445 * | Esc | A | S | H | T | G | Y | N | E | O | I |Enter |
446 * |------+------+------+------+------+------|------+------+------+------+------+------|
447 * | Shift| Z | X | M | C | V | K | K | , | . | / |Shift |
448 * |------+------+------+------+------+------+------+------+------+------+------+------|
449 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
450 * `-----------------------------------------------------------------------------------'
451 */
452[_WORKMAN] = KEYMAP(
453 KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC,
454 KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT ,
455 KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
456 KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL
457),
458
459/* Punc
460 * ,-----------------------------------------------------------------------------------.
461 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` |
462 * |------+------+------+------+------+-------------+------+------+------+------+------|
463 * | | | \ | - | = | < | > | ( | ) | ' | | |
464 * |------+------+------+------+------+------|------+------+------+------+------+------|
465 * | | | | | _ | + | { | } | [ | ] | " | | |
466 * |------+------+------+------+------+------+------+------+------+------+------+------|
467 * | | | | | | | | | | | |
468 * `-----------------------------------------------------------------------------------'
469 */
470[_PUNC] = KEYMAP(
471 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV ,
472 XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_QUOT, XXXXXXX, XXXXXXX,
473 XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_DQUO, XXXXXXX, XXXXXXX,
474 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
475),
476
477/* Num
478 * ,-----------------------------------------------------------------------------------.
479 * | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
480 * |------+------+------+------+------+-------------+------+------+------+------+------|
481 * | Esc | @ | A | B | C | ( | ) | 4 | 5 | 6 | : |Enter |
482 * |------+------+------+------+------+------|------+------+------+------+------+------|
483 * | & | # | D | E | F | [ | ] | 1 | 2 | 3 | / | * |
484 * |------+------+------+------+------+------+------+------+------+------+------+------|
485 * | | | | x | | | 0 | , | . | + | - |
486 * `-----------------------------------------------------------------------------------'
487 */
488[_NUM] = KEYMAP(
489 KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
490 KC_ESC, KC_AT, S(KC_A), S(KC_B), S(KC_C), KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_COLN, KC_ENT,
491 KC_AMPR, KC_HASH, S(KC_D), S(KC_E), S(KC_F), KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, KC_ASTR,
492 _______, _______, _______, KC_X, _______, KC_SPC, KC_SPC, KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_MINS
493),
494
495/* Func
496 * ,-----------------------------------------------------------------------------------.
497 * | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Del |
498 * |------+------+------+------+------+-------------+------+------+------+------+------|
499 * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | Ins |
500 * |------+------+------+------+------+------|------+------+------+------+------+------|
501 * | | F9 | F10 | F11 | F12 | | | | Home | End | | |
502 * |------+------+------+------+------+------+------+------+------+------+------+------|
503 * | | | | | | | | | | | |
504 * `-----------------------------------------------------------------------------------'
505 */
506[_FUNC] = KEYMAP(
507 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
508 XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS,
509 _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
510 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
511),
512
513/* Emoji
514 * ,-----------------------------------------------------------------------------------.
515 * | | | | | | | | | | | | |
516 * |------+------+------+------+------+-------------+------+------+------+------+------|
517 * | | | | | | | | | | | | |
518 * |------+------+------+------+------+------+------+------+------+------+------+------|
519 * | | | | | | | | | | | | |
520 * |------+------+------+------+------+------+------+------+------+------+------+------|
521 * | | | | | | | | | | | | |
522 * `-----------------------------------------------------------------------------------'
523 */
524[_EMOJI] = KEYMAP(
525 X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
526 X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
527 X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
528 X(POO), X(EYES),X(HUNRD), _______,X(SKULL),X(HORNS), X(HALO), X(FEAR), _______,X(YUMMY),X(DISAP),X(NOEVK)
529),
530
531/* GUI
532 * ,-----------------------------------------------------------------------------------.
533 * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
534 * |------+------+------+------+------+-------------+------+------+------+------+------|
535 * |Linux | | Vol- | Mute | Vol+ | | | D- | | D+ | |Qwerty|
536 * |------+------+------+------+------+------+------+------+------+------+------+------|
537 * | Win | | Prev | Play | Next | | | | | | |Colmak|
538 * |------+------+------+------+------+------+------+------+------+------+------+------|
539 * | OSX | | | | | BL- | BL+ | | | | |Workmn|
540 * `-----------------------------------------------------------------------------------'
541 */
542[_GUI] = KEYMAP(
543 _______, LGUI(KC_1),LGUI(KC_2),LGUI(KC_3),LGUI(KC_4),LGUI(KC_5),LGUI(KC_6),LGUI(KC_7),LGUI(KC_8),LGUI(KC_9),LGUI(KC_0), _______,
544 LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,_______, QWERTY,
545 WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, COLEMAK,
546 OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, RGB_VAI, RGB_VAD, WORKMAN
547),
548
549};
550
551#ifdef AUDIO_ENABLE
552float tone_startup[][2] = SONG(STARTUP_SOUND);
553float tone_qwerty[][2] = SONG(QWERTY_SOUND);
554float tone_colemak[][2] = SONG(COLEMAK_SOUND);
555float tone_workman[][2] = SONG(DVORAK_SOUND);
556float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
557float tone_linux[][2] = SONG(CAPS_LOCK_ON_SOUND);
558float tone_windows[][2] = SONG(SCROLL_LOCK_ON_SOUND);
559float tone_osx[][2] = SONG(NUM_LOCK_ON_SOUND);
560float tone_click[][2] = SONG(MUSICAL_NOTE(_F3, 2));
561#endif
562
563void persistant_default_layer_set(uint16_t default_layer) {
564 eeconfig_update_default_layer(default_layer);
565 default_layer_set(default_layer);
566}
567
568bool process_record_user(uint16_t keycode, keyrecord_t *record) {
569 #ifdef AUDIO_ENABLE
570 // faux clicky
571 if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0);
572 #endif
573
574 switch (keycode) {
575 case QWERTY:
576 if (record->event.pressed) {
577 #ifdef AUDIO_ENABLE
578 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
579 #endif
580 persistant_default_layer_set(1UL<<_QWERTY);
581 }
582 return false;
583 break;
584 case COLEMAK:
585 if (record->event.pressed) {
586 #ifdef AUDIO_ENABLE
587 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
588 #endif
589 persistant_default_layer_set(1UL<<_COLEMAK);
590 }
591 return false;
592 break;
593 case WORKMAN:
594 if (record->event.pressed) {
595 #ifdef AUDIO_ENABLE
596 PLAY_NOTE_ARRAY(tone_workman, false, 0);
597 #endif
598 persistant_default_layer_set(1UL<<_WORKMAN);
599 }
600 return false;
601 break;
602
603
604
605 case PUNC:
606 if (record->event.pressed) {
607 layer_on(_PUNC);
608 update_tri_layer(_PUNC, _EMOJI, _GUI);
609 if (IS_LAYER_ON(_GUI)) {
610 led_layer_gui();
611 } else {
612 led_layer_punc();;
613 }
614 } else {
615 layer_off(_PUNC);
616 update_tri_layer(_PUNC, _EMOJI, _GUI);
617 if (IS_LAYER_ON(_EMOJI)) {
618 led_layer_emoji();
619 } else {
620 led_layer_normal();;
621 }
622 }
623 return false;
624 break;
625 case EMOJI:
626 if (record->event.pressed) {
627 layer_on(_EMOJI);
628 update_tri_layer(_PUNC, _EMOJI, _GUI);
629 if (IS_LAYER_ON(_GUI)) {
630 led_layer_gui();
631 } else {
632 led_layer_emoji();;
633 }
634 } else {
635 layer_off(_EMOJI);
636 update_tri_layer(_PUNC, _EMOJI, _GUI);
637 if (IS_LAYER_ON(_PUNC)) {
638 led_layer_punc();
639 } else {
640 led_layer_normal();;
641 }
642 }
643 return false;
644 break;
645 case NUM:
646 if (record->event.pressed) {
647 layer_on(_NUM);
648 led_layer_num();
649 } else {
650 layer_off(_NUM);
651 led_layer_normal();
652 }
653 return false;
654 break;
655 case FUNC:
656 if (record->event.pressed) {
657 layer_on(_FUNC);
658 led_layer_func();
659 } else {
660 layer_off(_FUNC);
661 led_layer_normal();
662 }
663 return false;
664 break;
665
666
667 case LINUX:
668 set_unicode_input_mode(UC_LNX);
669 #ifdef AUDIO_ENABLE
670 PLAY_NOTE_ARRAY(tone_linux, false, 0);
671 #endif
672 return false;
673 break;
674 case WIN:
675 set_unicode_input_mode(UC_WINC);
676 #ifdef AUDIO_ENABLE
677 PLAY_NOTE_ARRAY(tone_windows, false, 0);
678 #endif
679 return false;
680 break;
681 case OSX:
682 set_unicode_input_mode(UC_OSX);
683 #ifdef AUDIO_ENABLE
684 PLAY_NOTE_ARRAY(tone_osx, false, 0);
685 #endif
686 return false;
687 break;
688 }
689 return true;
690}
691
692void matrix_init_user(void) {
693 #ifdef AUDIO_ENABLE
694 startup_user();
695 #endif
696 set_unicode_input_mode(UC_LNX);
697 led_init();
698}
699
700// void init_rgblight(void) {
701// for (uint8_t i = 0; i < RGBLED_NUM; i++) {
702// led[i].r = 255;
703// led[i].g = 85;
704// led[i].b = 0;
705// }
706// ws2812_setleds(led, RGBLED_NUM);
707// }
708
709
710#ifdef AUDIO_ENABLE
711
712void startup_user()
713{
714 _delay_ms(20); // gets rid of tick
715 PLAY_NOTE_ARRAY(tone_startup, false, 0);
716}
717
718void shutdown_user()
719{
720 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
721 _delay_ms(150);
722 stop_all_notes();
723}
724
725#endif \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/readme.md b/keyboards/handwired/promethium/keymaps/priyadi/readme.md
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/readme.md
diff --git a/keyboards/handwired/promethium/keymaps/readme.md b/keyboards/handwired/promethium/keymaps/readme.md
new file mode 100644
index 000000000..527691389
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/readme.md
@@ -0,0 +1,22 @@
1# How to add your own keymap
2
3Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`:
4
5 _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author]
6
7\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
8
9and contain the following files:
10
11* `keymap.c`
12* `readme.md` *recommended*
13* `config.h` *optional*, found automatically when compiling
14* `Makefile` *optional*, found automatically when compling
15
16When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format:
17
18 * **folder_name** description
19
20# List of Promethium keymaps
21
22
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c
new file mode 100644
index 000000000..a0035cce1
--- /dev/null
+++ b/keyboards/handwired/promethium/promethium.c
@@ -0,0 +1,6 @@
1#include "promethium.h"
2
3void matrix_init_kb(void) {
4
5 matrix_init_user();
6} \ No newline at end of file
diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h
new file mode 100644
index 000000000..8f2a8c3be
--- /dev/null
+++ b/keyboards/handwired/promethium/promethium.h
@@ -0,0 +1,101 @@
1#ifndef PROMETHIUM_H
2#define PROMETHIUM_H
3
4#include "quantum.h"
5
6#define PS2_INIT_DELAY 2000
7
8#define KEYMAP( \
9 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
10 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
11 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
12 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
13) \
14{ \
15 {k11, k12, k13, k14, k15, k16}, \
16 {k21, k22, k23, k24, k25, k26}, \
17 {k31, k32, k33, k34, k35, k36}, \
18 {k41, k42, k43, k44, k45, k46}, \
19 {k17, k18, k19, k1a, k1b, k1c}, \
20 {k27, k28, k29, k2a, k2b, k2c}, \
21 {k37, k38, k39, k3a, k3b, k3c}, \
22 {k47, k48, k49, k4a, k4b, k4c} \
23}
24
25enum led_sequence {
26 LED_IND_EMOJI,
27 LED_IND_NUM,
28 LED_IND_FUNC,
29
30 LED_IND_BATTERY,
31 LED_IND_USB,
32 LED_IND_BLUETOOTH,
33
34 LED_TAB,
35 LED_ESC,
36 LED_LSFT,
37 LED_LCTL,
38
39 LED_LGUI,
40 LED_Z,
41 LED_A,
42 LED_Q,
43
44 LED_W,
45 LED_S,
46 LED_X,
47 LED_LALT,
48
49 LED_PUNC,
50 LED_C,
51 LED_D,
52 LED_E,
53
54 LED_R,
55 LED_F,
56 LED_V,
57 LED_NUM,
58
59 LED_LSPC,
60 LED_B,
61 LED_G,
62 LED_T,
63
64 LED_TRACKPOINT1,
65 LED_TRACKPOINT2,
66 LED_TRACKPOINT3,
67
68 LED_RSPC,
69 LED_N,
70 LED_HH,
71 LED_Y,
72
73 LED_U,
74 LED_J,
75 LED_M,
76 LED_FUNC,
77
78 LED_EMOJI,
79 LED_COMM,
80 LED_K,
81 LED_I,
82
83 LED_O,
84 LED_L,
85 LED_DOT,
86 LED_RALT,
87
88 LED_RGUI,
89 LED_SLSH,
90 LED_SCLN,
91 LED_P,
92
93 LED_BKSP,
94 LED_ENT,
95 LED_RSFT,
96 LED_RCTL
97};
98
99#endif
100
101
diff --git a/keyboards/handwired/promethium/readme.md b/keyboards/handwired/promethium/readme.md
new file mode 100644
index 000000000..e63d2f1ad
--- /dev/null
+++ b/keyboards/handwired/promethium/readme.md
@@ -0,0 +1,13 @@
1Promethium Keyboard Firmware
2============================
3A handwired Planck based keyboard using the Adafruit Feather 32u4 Bluefruit LE controller.
4
5Features:
6
7* Single piece split form factor
8* Columnar stagger
9* Trackpoint
10* Bluetooth LE *TBD*
11* Battery
12* Per switch RGB LED
13* Proximity sensor for energy conservation *TBD* \ No newline at end of file
diff --git a/keyboards/handwired/promethium/rgbsps.c b/keyboards/handwired/promethium/rgbsps.c
new file mode 100644
index 000000000..ea922ec3f
--- /dev/null
+++ b/keyboards/handwired/promethium/rgbsps.c
@@ -0,0 +1,24 @@
1#include "light_ws2812.h"
2#include "rgbsps.h"
3
4struct cRGB led[RGBSPS_NUM];
5
6void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b) {
7 led[index].r = r;
8 led[index].g = g;
9 led[index].b = b;
10}
11
12void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b) {
13 for (uint16_t i = 0; i < RGBSPS_NUM; i++) {
14 rgbsps_set(i, r, g, b);
15 }
16}
17
18void rgbsps_turnoff(void) {
19 rgbsps_setall(0, 0, 0);
20}
21
22void rgbsps_send(void) {
23 ws2812_setleds(led, RGBSPS_NUM);
24} \ No newline at end of file
diff --git a/keyboards/handwired/promethium/rgbsps.h b/keyboards/handwired/promethium/rgbsps.h
new file mode 100644
index 000000000..6da197f75
--- /dev/null
+++ b/keyboards/handwired/promethium/rgbsps.h
@@ -0,0 +1,4 @@
1void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
2void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b);
3void rgbsps_turnoff(void);
4void rgbsps_send(void); \ No newline at end of file
diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk
new file mode 100644
index 000000000..0842780cc
--- /dev/null
+++ b/keyboards/handwired/promethium/rules.mk
@@ -0,0 +1,74 @@
1
2# MCU name
3#MCU = at90usb1287
4MCU = atmega32u4
5
6# Processor frequency.
7# This will define a symbol, F_CPU, in all source code files equal to the
8# processor frequency in Hz. You can then use this symbol in your source code to
9# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
10# automatically to create a 32-bit value in your source code.
11#
12# This will be an integer division of F_USB below, as it is sourced by
13# F_USB after it has run through any CPU prescalers. Note that this value
14# does not *change* the processor frequency - it should merely be updated to
15# reflect the processor speed set externally so that the code can use accurate
16# software delays.
17F_CPU = 8000000
18
19#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = AVR8
24
25# Input clock frequency.
26# This will define a symbol, F_USB, in all source code files equal to the
27# input clock frequency (before any prescaling is performed) in Hz. This value may
28# differ from F_CPU if prescaling is used on the latter, and is required as the
29# raw input clock is fed directly to the PLL sections of the AVR for high speed
30# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31# at the end, this will be done automatically to create a 32-bit value in your
32# source code.
33#
34# If no clock division is performed on the input clock inside the AVR (via the
35# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 1024
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=4096
49
50# Build Options
51# change to "no" to disable the options, or define them in the Makefile in
52# the appropriate keymap folder that will get included automatically
53#
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= no # Console for debug(+400)
58COMMAND_ENABLE ?= no # Commands for debug and configuration
59NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
61MIDI_ENABLE ?= no # MIDI controls
62AUDIO_ENABLE ?= no # Audio output on port C6
63UNICODE_ENABLE ?= no # Unicode
64UNICODEMAP_ENABLE = yes
65BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
66RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
67PS2_MOUSE_ENABLE ?= yes
68PS2_USE_INT ?= yes
69
70# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
71SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
72
73SRC += $(QUANTUM_DIR)/light_ws2812.c
74SRC += rgbsps.c \ No newline at end of file
diff --git a/keyboards/hhkb/keymaps/sh_jp/Makefile b/keyboards/hhkb/keymaps/sh_jp/Makefile
new file mode 100644
index 000000000..a7f700f01
--- /dev/null
+++ b/keyboards/hhkb/keymaps/sh_jp/Makefile
@@ -0,0 +1 @@
OPT_DEFS += -DHHKB_JP
diff --git a/keyboards/hhkb/keymaps/sh_jp/README.md b/keyboards/hhkb/keymaps/sh_jp/README.md
new file mode 100644
index 000000000..4f82f2f4e
--- /dev/null
+++ b/keyboards/hhkb/keymaps/sh_jp/README.md
@@ -0,0 +1,86 @@
1###Keymaps with both Dvorak layout and QWER layout for HHKB JP.
2
31. The default layout is Dvorak.
42. Use `Tog` to toggle between Dvorak and QWER
53. Holding `NewCmd`, the original `LftCmd`, will activate the `NewCmd` layer which means `NewCmd+key` is the same as `Cmd+key` in normal QWER layout.<sup>[1](#cmdTab)</sup>
6 - For example, no matter you are in Dvorak layout or QWER layout, you can use `Cmd+s` to save a currently editing file.
74. `Symb` makes type symbols easier
8 - for example: `Symb+a` is `!`.
95. `Spc+key` equals to `Shft+key` while using `Spc` alone will yield a space as usual.
106. There's an extra `Tab` in the last line.
11
12```
13Layer DVOR:
14,-----------------------------------------------------------.
15|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| |Bsp|
16|-----------------------------------------------------------|
17|Tab | '| ,| .| P| Y| F| G| C| R| L| /| =| |
18|------------------------------------------------------` Ent|
19|Ctrl | A| O| E| U| I| D| H| T| N| S| -| \| |
20|-----------------------------------------------------------|
21|Shft | ;| Q| J| K| X| B| M| W| V| Z| | Up| |
22|-----------------------------------------------------------|
23|FN| `| Alt|NewCmd|Symb| Spc |Symb|Tab|RCmd|Tog|Lft|Dwn|Rgh|
24`-----------------------------------------------------------'
25```
26
27```
28Layer QWER:
29,-----------------------------------------------------------.
30|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| -| =| |Bsp|
31|-----------------------------------------------------------|
32|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| |
33|------------------------------------------------------` Ent|
34|Ctrl | A| S| D| F| G| H| J| K| L| ;| '| \| |
35|-----------------------------------------------------------|
36|Shft | Z| X| C| V| B| N| M| ,| .| /| | Up| |
37|-----------------------------------------------------------|
38|FN| `| Alt|NewCmd|Symb| Spc |Symb|Tab|Cmd|Tog|Lft|Dwn|Rgh|
39`-----------------------------------------------------------'
40```
41
42```
43Layer Symb:
44,-----------------------------------------------------------.
45| | | | | | | | | | | | | | | |
46|-----------------------------------------------------------|
47| | | | [| ]| | | {| }| | | | | |
48|------------------------------------------------------` |
49| | !| @| #| $| %| ^| &| *| (| )| '| \| |
50|-----------------------------------------------------------|
51| | | | | | | | | | | | | | |
52|-----------------------------------------------------------|
53| | | | | | | | | | | | | |
54`-----------------------------------------------------------'
55```
56
57```
58Layer FUNC: HHKB mode (HHKB Fn)
59,-----------------------------------------------------------.
60|Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
61|-----------------------------------------------------------|
62|Caps | | | | | | | |Psc|Slk|Pus|Up | | |
63|------------------------------------------------------` |
64| |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| | |
65|-----------------------------------------------------------|
66| | | | | | | +| -|End|PgD|Dow| | | |
67|-----------------------------------------------------------|
68| || | | | | | | | | || | | |
69`-----------------------------------------------------------'
70```
71
72```
73Empty Layer:
74,-----------------------------------------------------------.
75| | | | | | | | | | | | | | | |
76|-----------------------------------------------------------|
77| | | | | | | | | | | | | | |
78|------------------------------------------------------` |
79| | | | | | | | | | | | | | |
80|-----------------------------------------------------------|
81| | | | | | | | | | | | | | |
82|-----------------------------------------------------------|
83| | | | | | | | | | | | | |
84`-----------------------------------------------------------'
85```
86<a name="cmdTab">1</a>: `NewCmd + Tab` does not work, you can use `RCmd+Tab` to switch among applications.
diff --git a/keyboards/hhkb/keymaps/sh_jp/keymap.c b/keyboards/hhkb/keymaps/sh_jp/keymap.c
new file mode 100644
index 000000000..d4cb3b041
--- /dev/null
+++ b/keyboards/hhkb/keymaps/sh_jp/keymap.c
@@ -0,0 +1,60 @@
1#include "hhkb.h"
2
3#define _______ KC_TRNS
4
5enum {
6 DVOR,
7 QWER,
8 NEW_CMD,
9 SYMB,
10 FUNC
11};
12
13const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
14 [DVOR] = KEYMAP_JP(
15 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_JYEN, KC_BSPC,
16 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,
17 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_BSLS, KC_ENT,
18 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RO, KC_UP, KC_RSFT,
19 MO(FUNC), KC_ZKHK, KC_LALT, MO(NEW_CMD), MO(SYMB), MT(MOD_LSFT, KC_SPC), MO(SYMB), KC_TAB, KC_RGUI, TG(QWER), KC_LEFT, KC_DOWN, KC_RGHT
20 ),
21 [QWER] = KEYMAP_JP(
22 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_JYEN, KC_BSPC,
23 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,
24 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_BSLS, KC_ENT,
25 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_UP, KC_RSFT,
26 MO(FUNC), KC_ZKHK, KC_LALT, MO(NEW_CMD), MO(SYMB), MT(MOD_LSFT, KC_SPC), MO(SYMB), KC_TAB, KC_RGUI, _______, KC_LEFT, KC_DOWN, KC_RGHT
27 ),
28
29 [NEW_CMD] = KEYMAP_JP(
30 _______, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), _______, _______, _______, LGUI(KC_BSPC),
31 _______, LGUI(KC_Q), LGUI(KC_W), LGUI(KC_E), LGUI(KC_R), LGUI(KC_T), LGUI(KC_Y), LGUI(KC_U), LGUI(KC_I), LGUI(KC_O), LGUI(KC_P), LGUI(KC_LBRC), LGUI(KC_RBRC),
32 _______, LGUI(KC_A), LGUI(KC_S), LGUI(KC_D), LGUI(KC_F), LGUI(KC_G), LGUI(KC_H), LGUI(KC_J), LGUI(KC_K), LGUI(KC_L), _______, _______, _______, _______,
33 LGUI(KC_LSFT), LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), LGUI(KC_B), LGUI(KC_N), LGUI(KC_M), LGUI(KC_COMM), LGUI(KC_DOT), LGUI(KC_SLSH), _______, _______, _______,
34 _______, _______, _______, _______, _______, LGUI(KC_SPC), _______, _______, _______, _______, LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_RGHT)
35 ),
36
37 [SYMB] = KEYMAP_JP(
38 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
39 _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, LSFT(KC_LBRC), LSFT(KC_RBRC), _______, _______,_______, _______,
40 _______, LSFT(KC_1),LSFT(KC_2),LSFT(KC_3),LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), _______, _______, _______,
41 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
42 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
43 ),
44
45 [FUNC] = KEYMAP_JP(
46 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,
47 KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______,
48 _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, KC_PENT,
49 _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______,
50 _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______
51 )
52};
53
54const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t opt) {
55 return MACRO_NONE;
56}
57
58const uint16_t PROGMEM fn_actions[] = {
59
60};
diff --git a/keyboards/infinity60/chconf.h b/keyboards/infinity60/chconf.h
index 43c845739..d9114ec85 100644
--- a/keyboards/infinity60/chconf.h
+++ b/keyboards/infinity60/chconf.h
@@ -48,7 +48,7 @@
48 * @details Frequency of the system timer that drives the system ticks. This 48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit. 49 * setting also defines the system tick time unit.
50 */ 50 */
51#define CH_CFG_ST_FREQUENCY 1000 51#define CH_CFG_ST_FREQUENCY 100000
52 52
53/** 53/**
54 * @brief Time delta constant for the tick-less mode. 54 * @brief Time delta constant for the tick-less mode.
diff --git a/keyboards/infinity60/matrix.c b/keyboards/infinity60/matrix.c
index 62c165aa5..d2f185288 100644
--- a/keyboards/infinity60/matrix.c
+++ b/keyboards/infinity60/matrix.c
@@ -96,7 +96,12 @@ uint8_t matrix_scan(void)
96 } 96 }
97 #endif 97 #endif
98 98
99 wait_us(1); // need wait to settle pin state 99 // need wait to settle pin state
100 // if you wait too short, or have a too high update rate
101 // the keyboard might freeze, or there might not be enough
102 // processing power to update the LCD screen properly.
103 // 20us, or two ticks at 100000Hz seems to be OK
104 wait_us(20);
100 105
101 // read col data 106 // read col data
102 data = (palReadPort(GPIOD)>>1); 107 data = (palReadPort(GPIOD)>>1);
diff --git a/keyboards/jd40/config.h b/keyboards/jd40/config.h
index e2594f4b3..047be5707 100644
--- a/keyboards/jd40/config.h
+++ b/keyboards/jd40/config.h
@@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
70) 70)
71 71
72#define RGB_DI_PIN D3 72#define RGB_DI_PIN D3
73#define RGBLIGHT_TIMER 73#define RGBLIGHT_ANIMATIONS
74#define RGBLED_NUM 12 // Number of LEDs 74#define RGBLED_NUM 12 // Number of LEDs
75#define RGBLIGHT_HUE_STEP 8 75#define RGBLIGHT_HUE_STEP 8
76#define RGBLIGHT_SAT_STEP 8 76#define RGBLIGHT_SAT_STEP 8
diff --git a/keyboards/kc60/keymaps/dbroqua/keymap.c b/keyboards/kc60/keymaps/dbroqua/keymap.c
index 1b645ea93..8b5efd0ce 100644
--- a/keyboards/kc60/keymaps/dbroqua/keymap.c
+++ b/keyboards/kc60/keymaps/dbroqua/keymap.c
@@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
61 * |-----------------------------------------------------------------------------------------+ 61 * |-----------------------------------------------------------------------------------------+
62 * | | | | | | | | Psc | | | | | | 62 * | | | | | | | | Psc | | | | | |
63 * |-----------------------------------------------------------------------------------------+ 63 * |-----------------------------------------------------------------------------------------+
64 * | | Led | Led-| Led+| | Mute| Vol+| Vol-| | | | Play | | 64 * | | Led | Led+| Led-| | Mute| Vol+| Vol-| | | | Play | |
65 * |-----------------------------------------------------------------------------------------+ 65 * |-----------------------------------------------------------------------------------------+
66 * | | | | | | Prev | Stop | Next | 66 * | | | | | | Prev | Stop | Next |
67 * `-----------------------------------------------------------------------------------------' 67 * `-----------------------------------------------------------------------------------------'
diff --git a/keyboards/kc60/keymaps/ws2812/config.h b/keyboards/kc60/keymaps/ws2812/config.h
index 2f39ea8e5..43abf6228 100644
--- a/keyboards/kc60/keymaps/ws2812/config.h
+++ b/keyboards/kc60/keymaps/ws2812/config.h
@@ -2,7 +2,7 @@
2 2
3/* WS2812B RGB Underglow LED */ 3/* WS2812B RGB Underglow LED */
4#define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg 4#define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg
5#define RGBLIGHT_TIMER 5#define RGBLIGHT_ANIMATIONS
6#define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case. 6#define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case.
7#define RGBLIGHT_HUE_STEP 8 7#define RGBLIGHT_HUE_STEP 8
8#define RGBLIGHT_SAT_STEP 8 8#define RGBLIGHT_SAT_STEP 8
diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h
index f4d900acc..4db45ab0b 100644
--- a/keyboards/lets_split/config.h
+++ b/keyboards/lets_split/config.h
@@ -28,29 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28#define PRODUCT Lets Split 28#define PRODUCT Lets Split
29#define DESCRIPTION A split keyboard for the cheap makers 29#define DESCRIPTION A split keyboard for the cheap makers
30 30
31/* key matrix size */
32// Rows are doubled-up
33#define MATRIX_ROWS 8
34#define MATRIX_COLS 6
35
36// wiring of each half
37#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
38#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
39
40#define CATERINA_BOOTLOADER
41
42// #define USE_I2C
43
44// Use serial if not using I2C
45#ifndef USE_I2C
46# define USE_SERIAL
47#endif
48
49// #define EE_HANDS
50
51#define I2C_MASTER_LEFT
52// #define I2C_MASTER_RIGHT
53
54/* COL2ROW or ROW2COL */ 31/* COL2ROW or ROW2COL */
55#define DIODE_DIRECTION COL2ROW 32#define DIODE_DIRECTION COL2ROW
56 33
@@ -73,24 +50,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
73 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ 50 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
74) 51)
75 52
76/* ws2812 RGB LED */
77#define RGB_DI_PIN D4
78#define RGBLIGHT_TIMER
79#define RGBLED_NUM 8 // Number of LEDs
80#define RGBLIGHT_HUE_STEP 10
81#define RGBLIGHT_SAT_STEP 17
82#define RGBLIGHT_VAL_STEP 17
83
84/*
85 * Feature disable options
86 * These options are also useful to firmware size reduction.
87 */
88
89/* disable debug print */ 53/* disable debug print */
90// #define NO_DEBUG 54//#define NO_DEBUG
91 55
92/* disable print */ 56/* disable print */
93// #define NO_PRINT 57//#define NO_PRINT
94 58
95/* disable action features */ 59/* disable action features */
96//#define NO_ACTION_LAYER 60//#define NO_ACTION_LAYER
@@ -99,4 +63,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
99//#define NO_ACTION_MACRO 63//#define NO_ACTION_MACRO
100//#define NO_ACTION_FUNCTION 64//#define NO_ACTION_FUNCTION
101 65
66#ifdef SUBPROJECT_rev1
67 #include "rev1/config.h"
68#endif
69#ifdef SUBPROJECT_rev2
70 #include "rev2/config.h"
71#endif
102#endif 72#endif
diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c
index 0d2d94b67..6f1f71f5f 100644
--- a/keyboards/lets_split/keymaps/default/keymap.c
+++ b/keyboards/lets_split/keymaps/default/keymap.c
@@ -42,10 +42,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42 * `-----------------------------------------------------------------------------------' 42 * `-----------------------------------------------------------------------------------'
43 */ 43 */
44[_QWERTY] = KEYMAP( \ 44[_QWERTY] = KEYMAP( \
45 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ 45 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
46 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ 46 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
47 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ 47 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
48 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ 48 KC_LCTL, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, MT(MOD_LSFT, KC_SPC), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
49), 49),
50 50
51/* Colemak 51/* Colemak
@@ -83,41 +83,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
83 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ 83 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
84 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ 84 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
85), 85),
86 86[3] = KEYMAP( \
87/* Lower 87 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \
88 * ,-----------------------------------------------------------------------------------.
89 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
90 * |------+------+------+------+------+-------------+------+------+------+------+------|
91 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
92 * |------+------+------+------+------+------|------+------+------+------+------+------|
93 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
94 * |------+------+------+------+------+------+------+------+------+------+------+------|
95 * | | | | | | | | Next | Vol- | Vol+ | Play |
96 * `-----------------------------------------------------------------------------------'
97 */
98[_LOWER] = KEYMAP( \
99 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
100 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ 88 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
101 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ 89 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
102 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ 90 _______, _______, _______, _______, _______, KC_BSPC, MT(MOD_LSFT, KC_BSPC), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
103), 91),
104 92[4] = KEYMAP( \
105/* Raise 93 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
106 * ,-----------------------------------------------------------------------------------.
107 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
108 * |------+------+------+------+------+-------------+------+------+------+------+------|
109 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
110 * |------+------+------+------+------+------|------+------+------+------+------+------|
111 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
112 * |------+------+------+------+------+------+------+------+------+------+------+------|
113 * | | | | | | | | Next | Vol- | Vol+ | Play |
114 * `-----------------------------------------------------------------------------------'
115 */
116[_RAISE] = KEYMAP( \
117 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
118 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ 94 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
119 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ 95 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
120 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ 96 _______, _______, _______, _______, _______, KC_ENT, MT(MOD_LSFT, KC_ENT), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
121), 97),
122 98
123/* Adjust (Lower + Raise) 99/* Adjust (Lower + Raise)
@@ -134,11 +110,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
134[_ADJUST] = KEYMAP( \ 110[_ADJUST] = KEYMAP( \
135 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ 111 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
136 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ 112 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
137 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 113 _______, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, _______, _______, _______, \
138 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ 114 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
139) 115)
140
141
142}; 116};
143 117
144#ifdef AUDIO_ENABLE 118#ifdef AUDIO_ENABLE
diff --git a/keyboards/lets_split/keymaps/i2c/config.h b/keyboards/lets_split/keymaps/i2c/config.h
index 2671fabf6..72e5ae66b 100644
--- a/keyboards/lets_split/keymaps/i2c/config.h
+++ b/keyboards/lets_split/keymaps/i2c/config.h
@@ -75,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
75 75
76/* ws2812 RGB LED */ 76/* ws2812 RGB LED */
77#define RGB_DI_PIN D4 77#define RGB_DI_PIN D4
78#define RGBLIGHT_TIMER 78#define RGBLIGHT_ANIMATIONS
79#define RGBLED_NUM 8 // Number of LEDs 79#define RGBLED_NUM 8 // Number of LEDs
80#define RGBLIGHT_HUE_STEP 10 80#define RGBLIGHT_HUE_STEP 10
81#define RGBLIGHT_SAT_STEP 17 81#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/lets_split/keymaps/serial/config.h b/keyboards/lets_split/keymaps/serial/config.h
index f4d900acc..b0ad522fc 100644
--- a/keyboards/lets_split/keymaps/serial/config.h
+++ b/keyboards/lets_split/keymaps/serial/config.h
@@ -75,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
75 75
76/* ws2812 RGB LED */ 76/* ws2812 RGB LED */
77#define RGB_DI_PIN D4 77#define RGB_DI_PIN D4
78#define RGBLIGHT_TIMER 78#define RGBLIGHT_ANIMATIONS
79#define RGBLED_NUM 8 // Number of LEDs 79#define RGBLED_NUM 8 // Number of LEDs
80#define RGBLIGHT_HUE_STEP 10 80#define RGBLIGHT_HUE_STEP 10
81#define RGBLIGHT_SAT_STEP 17 81#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/lets_split/lets_split.c b/keyboards/lets_split/lets_split.c
index c505d3a6e..117b727a8 100644
--- a/keyboards/lets_split/lets_split.c
+++ b/keyboards/lets_split/lets_split.c
@@ -1,32 +1 @@
1#include "lets_split.h" #include "lets_split.h" \ No newline at end of file
2
3#ifdef AUDIO_ENABLE
4 float tone_startup[][2] = SONG(STARTUP_SOUND);
5 float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
6#endif
7
8void matrix_init_kb(void) {
9
10 #ifdef AUDIO_ENABLE
11 _delay_ms(20); // gets rid of tick
12 PLAY_NOTE_ARRAY(tone_startup, false, 0);
13 #endif
14
15 // // green led on
16 // DDRD |= (1<<5);
17 // PORTD &= ~(1<<5);
18
19 // // orange led on
20 // DDRB |= (1<<0);
21 // PORTB &= ~(1<<0);
22
23 matrix_init_user();
24};
25
26void shutdown_user(void) {
27 #ifdef AUDIO_ENABLE
28 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
29 _delay_ms(150);
30 stop_all_notes();
31 #endif
32}
diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h
index fe7ae0767..2cdfb061f 100644
--- a/keyboards/lets_split/lets_split.h
+++ b/keyboards/lets_split/lets_split.h
@@ -1,25 +1,13 @@
1#ifndef LETS_SPLIT_H 1#ifndef LETS_SPLIT_H
2#define LETS_SPLIT_H 2#define LETS_SPLIT_H
3 3
4#include "quantum.h" 4#ifdef SUBPROJECT_rev1
5 5 #include "rev1.h"
6void promicro_bootloader_jmp(bool program); 6#endif
7#ifdef SUBPROJECT_rev2
8 #include "rev2.h"
9#endif
7 10
8#define KEYMAP( \ 11#include "quantum.h"
9 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
10 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
11 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
12 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
13 ) \
14 { \
15 { k00, k01, k02, k03, k04, k05 }, \
16 { k10, k11, k12, k13, k14, k15 }, \
17 { k20, k21, k22, k23, k24, k25 }, \
18 { k30, k31, k32, k33, k34, k35 }, \
19 { k40, k41, k42, k43, k44, k45 }, \
20 { k50, k51, k52, k53, k54, k55 }, \
21 { k60, k61, k62, k63, k64, k65 }, \
22 { k70, k71, k72, k73, k74, k75 } \
23 }
24 12
25#endif \ No newline at end of file 13#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev1/Makefile b/keyboards/lets_split/rev1/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/lets_split/rev1/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h
new file mode 100644
index 000000000..825e5ec24
--- /dev/null
+++ b/keyboards/lets_split/rev1/config.h
@@ -0,0 +1,94 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x3060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Wootpatoot
28#define PRODUCT Lets Split
29#define PRODUCT Lets Split v1
30#define DESCRIPTION A split keyboard for the cheap makers
31
32/* key matrix size */
33// Rows are doubled-up
34#define MATRIX_ROWS 8
35#define MATRIX_COLS 6
36
37// wiring of each half
38#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
39#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
40
41#define CATERINA_BOOTLOADER
42
43// #define USE_I2C
44// Use serial if not using I2C
45#ifndef USE_I2C
46# define USE_SERIAL
47#endif
48
49// #define EE_HANDS
50
51#define I2C_MASTER_LEFT
52// #define I2C_MASTER_RIGHT
53
54/* COL2ROW or ROW2COL */
55#define DIODE_DIRECTION COL2ROW
56
57/* define if matrix has ghost */
58//#define MATRIX_HAS_GHOST
59
60/* number of backlight levels */
61// #define BACKLIGHT_LEVELS 3
62
63/* Set 0 if debouncing isn't needed */
64#define DEBOUNCING_DELAY 5
65
66/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
67#define LOCKING_SUPPORT_ENABLE
68/* Locking resynchronize hack */
69#define LOCKING_RESYNC_ENABLE
70
71/* key combination for command */
72#define IS_COMMAND() ( \
73 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
74)
75
76/*
77 * Feature disable options
78 * These options are also useful to firmware size reduction.
79 */
80
81/* disable debug print */
82// #define NO_DEBUG
83
84/* disable print */
85// #define NO_PRINT
86
87/* disable action features */
88//#define NO_ACTION_LAYER
89//#define NO_ACTION_TAPPING
90//#define NO_ACTION_ONESHOT
91//#define NO_ACTION_MACRO
92//#define NO_ACTION_FUNCTION
93
94#endif
diff --git a/keyboards/lets_split/rev1/rev1.c b/keyboards/lets_split/rev1/rev1.c
new file mode 100644
index 000000000..c505d3a6e
--- /dev/null
+++ b/keyboards/lets_split/rev1/rev1.c
@@ -0,0 +1,32 @@
1#include "lets_split.h"
2
3#ifdef AUDIO_ENABLE
4 float tone_startup[][2] = SONG(STARTUP_SOUND);
5 float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
6#endif
7
8void matrix_init_kb(void) {
9
10 #ifdef AUDIO_ENABLE
11 _delay_ms(20); // gets rid of tick
12 PLAY_NOTE_ARRAY(tone_startup, false, 0);
13 #endif
14
15 // // green led on
16 // DDRD |= (1<<5);
17 // PORTD &= ~(1<<5);
18
19 // // orange led on
20 // DDRB |= (1<<0);
21 // PORTB &= ~(1<<0);
22
23 matrix_init_user();
24};
25
26void shutdown_user(void) {
27 #ifdef AUDIO_ENABLE
28 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
29 _delay_ms(150);
30 stop_all_notes();
31 #endif
32}
diff --git a/keyboards/lets_split/rev1/rev1.h b/keyboards/lets_split/rev1/rev1.h
new file mode 100644
index 000000000..4667c9fb0
--- /dev/null
+++ b/keyboards/lets_split/rev1/rev1.h
@@ -0,0 +1,28 @@
1#ifndef REV1_H
2#define REV1_H
3
4#include "../lets_split.h"
5
6//void promicro_bootloader_jmp(bool program);
7#include "quantum.h"
8
9//void promicro_bootloader_jmp(bool program);
10
11#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
13 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
14 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
15 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
16 ) \
17 { \
18 { k00, k01, k02, k03, k04, k05 }, \
19 { k10, k11, k12, k13, k14, k15 }, \
20 { k20, k21, k22, k23, k24, k25 }, \
21 { k30, k31, k32, k33, k34, k35 }, \
22 { k40, k41, k42, k43, k44, k45 }, \
23 { k50, k51, k52, k53, k54, k55 }, \
24 { k60, k61, k62, k63, k64, k65 }, \
25 { k70, k71, k72, k73, k74, k75 } \
26 }
27
28#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev1/rules.mk b/keyboards/lets_split/rev1/rules.mk
new file mode 100644
index 000000000..a0825b4ef
--- /dev/null
+++ b/keyboards/lets_split/rev1/rules.mk
@@ -0,0 +1,5 @@
1BACKLIGHT_ENABLE = no
2
3ifndef QUANTUM_DIR
4 include ../../../Makefile
5endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2/Makefile b/keyboards/lets_split/rev2/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/lets_split/rev2/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h
new file mode 100644
index 000000000..e9689d773
--- /dev/null
+++ b/keyboards/lets_split/rev2/config.h
@@ -0,0 +1,102 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x3060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Wootpatoot
28#define PRODUCT Lets Split v2
29#define DESCRIPTION A split keyboard for the cheap makers
30
31/* key matrix size */
32// Rows are doubled-up
33#define MATRIX_ROWS 8
34#define MATRIX_COLS 6
35
36// wiring of each half
37#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
38#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
39
40#define CATERINA_BOOTLOADER
41
42// #define USE_I2C
43
44// Use serial if not using I2C
45#ifndef USE_I2C
46# define USE_SERIAL
47#endif
48
49// #define EE_HANDS
50
51#define I2C_MASTER_LEFT
52// #define I2C_MASTER_RIGHT
53
54/* COL2ROW or ROW2COL */
55#define DIODE_DIRECTION COL2ROW
56
57/* define if matrix has ghost */
58//#define MATRIX_HAS_GHOST
59
60/* number of backlight levels */
61// #define BACKLIGHT_LEVELS 3
62
63/* Set 0 if debouncing isn't needed */
64#define DEBOUNCING_DELAY 5
65
66/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
67#define LOCKING_SUPPORT_ENABLE
68/* Locking resynchronize hack */
69#define LOCKING_RESYNC_ENABLE
70
71/* key combination for command */
72#define IS_COMMAND() ( \
73 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
74)
75
76/* ws2812 RGB LED */
77#define RGB_DI_PIN D3
78#define RGBLIGHT_TIMER
79#define RGBLED_NUM 12 // Number of LEDs
80#define ws2812_PORTREG PORTD
81#define ws2812_DDRREG DDRD
82
83/*
84 * Feature disable options
85 * These options are also useful to firmware size reduction.
86 */
87
88/* disable debug print */
89// #define NO_DEBUG
90
91/* disable print */
92// #define NO_PRINT
93
94/* disable action features */
95//#define NO_ACTION_LAYER
96//#define NO_ACTION_TAPPING
97//#define NO_ACTION_ONESHOT
98//#define NO_ACTION_MACRO
99//#define NO_ACTION_FUNCTION
100
101
102#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2/rev2.c b/keyboards/lets_split/rev2/rev2.c
new file mode 100644
index 000000000..c505d3a6e
--- /dev/null
+++ b/keyboards/lets_split/rev2/rev2.c
@@ -0,0 +1,32 @@
1#include "lets_split.h"
2
3#ifdef AUDIO_ENABLE
4 float tone_startup[][2] = SONG(STARTUP_SOUND);
5 float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
6#endif
7
8void matrix_init_kb(void) {
9
10 #ifdef AUDIO_ENABLE
11 _delay_ms(20); // gets rid of tick
12 PLAY_NOTE_ARRAY(tone_startup, false, 0);
13 #endif
14
15 // // green led on
16 // DDRD |= (1<<5);
17 // PORTD &= ~(1<<5);
18
19 // // orange led on
20 // DDRB |= (1<<0);
21 // PORTB &= ~(1<<0);
22
23 matrix_init_user();
24};
25
26void shutdown_user(void) {
27 #ifdef AUDIO_ENABLE
28 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
29 _delay_ms(150);
30 stop_all_notes();
31 #endif
32}
diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h
new file mode 100644
index 000000000..990976de2
--- /dev/null
+++ b/keyboards/lets_split/rev2/rev2.h
@@ -0,0 +1,28 @@
1#ifndef REV2_H
2#define REV2_H
3
4#include "../lets_split.h"
5
6//void promicro_bootloader_jmp(bool program);
7#include "quantum.h"
8
9//void promicro_bootloader_jmp(bool program);
10
11#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \
13 k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \
14 k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \
15 k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \
16 ) \
17 { \
18 { k00, k01, k02, k03, k04, k05 }, \
19 { k10, k11, k12, k13, k14, k15 }, \
20 { k20, k21, k22, k23, k24, k25 }, \
21 { k30, k31, k32, k33, k34, k35 }, \
22 { k40, k41, k42, k43, k44, k45 }, \
23 { k50, k51, k52, k53, k54, k55 }, \
24 { k60, k61, k62, k63, k64, k65 }, \
25 { k70, k71, k72, k73, k74, k75 } \
26 }
27
28#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2/rules.mk b/keyboards/lets_split/rev2/rules.mk
new file mode 100644
index 000000000..80a942d06
--- /dev/null
+++ b/keyboards/lets_split/rev2/rules.mk
@@ -0,0 +1,5 @@
1BACKLIGHT_ENABLE = no
2
3ifndef QUANTUM_DIR
4 include ../../../Makefile
5endif
diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk
index 6fde8a444..1aee5313c 100644
--- a/keyboards/lets_split/rules.mk
+++ b/keyboards/lets_split/rules.mk
@@ -63,11 +63,12 @@ COMMAND_ENABLE ?= yes # Commands for debug and configuration
63NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 63NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
64BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality 64BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
65MIDI_ENABLE ?= no # MIDI controls 65MIDI_ENABLE ?= no # MIDI controls
66AUDIO_ENABLE ?= yes # Audio output on port C6 66AUDIO_ENABLE ?= no # Audio output on port C6
67UNICODE_ENABLE ?= no # Unicode 67UNICODE_ENABLE ?= no # Unicode
68BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID 68BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
69RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 69RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
70 70SUBPROJECT_rev1 ?= yes
71USE_I2C ?= yes
71# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 72# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
72SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 73SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
73 74
diff --git a/keyboards/maxipad/Makefile b/keyboards/maxipad/Makefile
new file mode 100644
index 000000000..57b2ef62e
--- /dev/null
+++ b/keyboards/maxipad/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif
diff --git a/keyboards/maxipad/config.h b/keyboards/maxipad/config.h
new file mode 100644
index 000000000..fc5ab7761
--- /dev/null
+++ b/keyboards/maxipad/config.h
@@ -0,0 +1,169 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Wootpatoot
28#define PRODUCT maxipad
29#define DESCRIPTION A custom keyboard
30
31
32/* key matrix size */
33#define MATRIX_ROWS 5
34#define MATRIX_COLS 6
35
36/*
37 * Keyboard Matrix Assignments
38 *
39 * Change this to how you wired your keyboard
40 * COLS: AVR pins used for columns, left to right
41 * ROWS: AVR pins used for rows, top to bottom
42 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
43 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
44 *
45*/
46//Pro micro pinout
47 #define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 }
48 #define MATRIX_COL_PINS { F4, C6, D7, F5, B4, B5 }
49 #define UNUSED_PINS
50//Teensy 2 pinout
51 //#define MATRIX_ROW_PINS { B6, F7, B2, B3, B1 }
52 //#define MATRIX_COL_PINS { F6, C6, D7, F5, B4, B5 }
53 //#define UNUSED_PINS
54
55
56/* COL2ROW or ROW2COL */
57#define DIODE_DIRECTION COL2ROW
58
59// #define BACKLIGHT_PIN B7
60// #define BACKLIGHT_BREATHING
61// #define BACKLIGHT_LEVELS 3
62
63
64/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
65#define DEBOUNCING_DELAY 5
66
67/* define if matrix has ghost (lacks anti-ghosting diodes) */
68//#define MATRIX_HAS_GHOST
69
70/* number of backlight levels */
71
72/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
73#define LOCKING_SUPPORT_ENABLE
74/* Locking resynchronize hack */
75#define LOCKING_RESYNC_ENABLE
76
77/*
78 * Force NKRO
79 *
80 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
81 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
82 * makefile for this to work.)
83 *
84 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
85 * until the next keyboard reset.
86 *
87 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
88 * fully operational during normal computer usage.
89 *
90 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
91 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
92 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
93 * power-up.
94 *
95 */
96//#define FORCE_NKRO
97
98/*
99 * Magic Key Options
100 *
101 * Magic keys are hotkey commands that allow control over firmware functions of
102 * the keyboard. They are best used in combination with the HID Listen program,
103 * found here: https://www.pjrc.com/teensy/hid_listen.html
104 *
105 * The options below allow the magic key functionality to be changed. This is
106 * useful if your keyboard/keypad is missing keys and you want magic key support.
107 *
108 */
109
110/* key combination for magic key command */
111#define IS_COMMAND() ( \
112 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
113)
114
115/* control how magic key switches layers */
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
117//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
118//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
119
120/* override magic key keymap */
121//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
122//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
123//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
124//#define MAGIC_KEY_HELP1 H
125//#define MAGIC_KEY_HELP2 SLASH
126//#define MAGIC_KEY_DEBUG D
127//#define MAGIC_KEY_DEBUG_MATRIX X
128//#define MAGIC_KEY_DEBUG_KBD K
129//#define MAGIC_KEY_DEBUG_MOUSE M
130//#define MAGIC_KEY_VERSION V
131//#define MAGIC_KEY_STATUS S
132//#define MAGIC_KEY_CONSOLE C
133//#define MAGIC_KEY_LAYER0_ALT1 ESC
134//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
135//#define MAGIC_KEY_LAYER0 0
136//#define MAGIC_KEY_LAYER1 1
137//#define MAGIC_KEY_LAYER2 2
138//#define MAGIC_KEY_LAYER3 3
139//#define MAGIC_KEY_LAYER4 4
140//#define MAGIC_KEY_LAYER5 5
141//#define MAGIC_KEY_LAYER6 6
142//#define MAGIC_KEY_LAYER7 7
143//#define MAGIC_KEY_LAYER8 8
144//#define MAGIC_KEY_LAYER9 9
145//#define MAGIC_KEY_BOOTLOADER PAUSE
146//#define MAGIC_KEY_LOCK CAPS
147//#define MAGIC_KEY_EEPROM E
148//#define MAGIC_KEY_NKRO N
149//#define MAGIC_KEY_SLEEP_LED Z
150
151/*
152 * Feature disable options
153 * These options are also useful to firmware size reduction.
154 */
155
156/* disable debug print */
157//#define NO_DEBUG
158
159/* disable print */
160//#define NO_PRINT
161
162/* disable action features */
163//#define NO_ACTION_LAYER
164//#define NO_ACTION_TAPPING
165//#define NO_ACTION_ONESHOT
166//#define NO_ACTION_MACRO
167//#define NO_ACTION_FUNCTION
168
169#endif
diff --git a/keyboards/maxipad/keymaps/default/Makefile b/keyboards/maxipad/keymaps/default/Makefile
new file mode 100644
index 000000000..f4671a9d1
--- /dev/null
+++ b/keyboards/maxipad/keymaps/default/Makefile
@@ -0,0 +1,21 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
6MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
8CONSOLE_ENABLE = no # Console for debug(+400)
9COMMAND_ENABLE = yes # Commands for debug and configuration
10NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = no # Audio output on port C6
14UNICODE_ENABLE = no # Unicode
15BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
16RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
17SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
18
19ifndef QUANTUM_DIR
20 include ../../../../Makefile
21endif \ No newline at end of file
diff --git a/keyboards/maxipad/keymaps/default/config.h b/keyboards/maxipad/keymaps/default/config.h
new file mode 100644
index 000000000..df06a2620
--- /dev/null
+++ b/keyboards/maxipad/keymaps/default/config.h
@@ -0,0 +1,8 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6// place overrides here
7
8#endif \ No newline at end of file
diff --git a/keyboards/maxipad/keymaps/default/keymap.c b/keyboards/maxipad/keymaps/default/keymap.c
new file mode 100644
index 000000000..43ace3241
--- /dev/null
+++ b/keyboards/maxipad/keymaps/default/keymap.c
@@ -0,0 +1,54 @@
1#include "maxipad.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4[0] = KEYMAP( /* Base */
5 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, \
6 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, \
7 MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, \
8 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, \
9 KC_LCTL, KC_LALT, MO(1), KC_ENT,KC_GRV,KC_SPC \
10),
11[1] = KEYMAP(
12 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, \
13 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, \
14 KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, \
15 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
16 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
17),
18};
19
20const uint16_t PROGMEM fn_actions[] = {
21
22};
23
24const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
25{
26 // MACRODOWN only works in this function
27 switch(id) {
28 case 0:
29 if (record->event.pressed) {
30 register_code(KC_RSFT);
31 } else {
32 unregister_code(KC_RSFT);
33 }
34 break;
35 }
36 return MACRO_NONE;
37};
38
39
40void matrix_init_user(void) {
41
42}
43
44void matrix_scan_user(void) {
45
46}
47
48bool process_record_user(uint16_t keycode, keyrecord_t *record) {
49 return true;
50}
51
52void led_set_user(uint8_t usb_led) {
53
54} \ No newline at end of file
diff --git a/keyboards/maxipad/keymaps/default/readme.md b/keyboards/maxipad/keymaps/default/readme.md
new file mode 100644
index 000000000..a6c0d4a3f
--- /dev/null
+++ b/keyboards/maxipad/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for maxipad \ No newline at end of file
diff --git a/keyboards/maxipad/maxipad.c b/keyboards/maxipad/maxipad.c
new file mode 100644
index 000000000..879ae86a7
--- /dev/null
+++ b/keyboards/maxipad/maxipad.c
@@ -0,0 +1,28 @@
1#include "maxipad.h"
2
3void matrix_init_kb(void) {
4 // put your keyboard start-up code here
5 // runs once when the firmware starts up
6
7 matrix_init_user();
8}
9
10void matrix_scan_kb(void) {
11 // put your looping keyboard code here
12 // runs every cycle (a lot)
13
14 matrix_scan_user();
15}
16
17bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
18 // put your per-action keyboard code here
19 // runs for every action, just before processing by the firmware
20
21 return process_record_user(keycode, record);
22}
23
24void led_set_kb(uint8_t usb_led) {
25 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
26
27 led_set_user(usb_led);
28}
diff --git a/keyboards/maxipad/maxipad.h b/keyboards/maxipad/maxipad.h
new file mode 100644
index 000000000..eee1309dd
--- /dev/null
+++ b/keyboards/maxipad/maxipad.h
@@ -0,0 +1,25 @@
1#ifndef MAXIPAD_H
2#define MAXIPAD_H
3
4#include "quantum.h"
5
6// This a shortcut to help you visually see your layout.
7// The following is an example using the Planck MIT layout
8// The first section contains all of the arguements
9// The second converts the arguments into a two-dimensional array
10#define KEYMAP( \
11 k00, k01, k02, k03, k04, k05, \
12 k10, k11, k12, k13, k14, k15, \
13 k20, k21, k22, k23, k24, k25, \
14 k30, k31, k32, k33, k34, k35, \
15 k40, k41, k42, k43, k44, k45 \
16) \
17{ \
18 { k00, k01, k02, k03, k04, k05 }, \
19 { k10, k11, k12, k13, k14, k15 }, \
20 { k20, k21, k22, k23, k24, k25 }, \
21 { k30, k31, k32, k33, k34, k35 }, \
22 { k40, k41, k42, k43, k44, k45} \
23}
24
25#endif
diff --git a/keyboards/maxipad/readme.md b/keyboards/maxipad/readme.md
new file mode 100644
index 000000000..de2265d11
--- /dev/null
+++ b/keyboards/maxipad/readme.md
@@ -0,0 +1,30 @@
1## Quantum MK Firmware
2
3For the full Quantum feature list, see [the parent readme](/).
4
5
6## Building
7
8Change the config.h pinout to match your mcu!!
9
10Download or clone the whole firmware and navigate to the keyboards/maxipad 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.
11
12Depending on which keymap you would like to use, you will have to compile slightly differently.
13
14### Default
15
16To build with the default keymap, simply run `make`.
17
18
19### Other Keymaps
20
21Several 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.
22
23To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
24
25```
26$ make [default|jack|<name>]
27```
28
29Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
30
diff --git a/keyboards/maxipad/rules.mk b/keyboards/maxipad/rules.mk
new file mode 100644
index 000000000..56b2042ef
--- /dev/null
+++ b/keyboards/maxipad/rules.mk
@@ -0,0 +1,67 @@
1# MCU name
2#MCU = at90usb1287
3MCU = atmega32u4
4
5# Processor frequency.
6# This will define a symbol, F_CPU, in all source code files equal to the
7# processor frequency in Hz. You can then use this symbol in your source code to
8# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
9# automatically to create a 32-bit value in your source code.
10#
11# This will be an integer division of F_USB below, as it is sourced by
12# F_USB after it has run through any CPU prescalers. Note that this value
13# does not *change* the processor frequency - it should merely be updated to
14# reflect the processor speed set externally so that the code can use accurate
15# software delays.
16F_CPU = 16000000
17
18
19#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = AVR8
24
25# Input clock frequency.
26# This will define a symbol, F_USB, in all source code files equal to the
27# input clock frequency (before any prescaling is performed) in Hz. This value may
28# differ from F_CPU if prescaling is used on the latter, and is required as the
29# raw input clock is fed directly to the PLL sections of the AVR for high speed
30# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31# at the end, this will be done automatically to create a 32-bit value in your
32# source code.
33#
34# If no clock division is performed on the input clock inside the AVR (via the
35# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 1024
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=512
49
50
51# Build Options
52# change yes to no to disable
53#
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= yes # Console for debug(+400)
58COMMAND_ENABLE ?= yes # Commands for debug and configuration
59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
62NKRO_ENABLE ?= no # USB Nkey Rollover
63BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
64MIDI_ENABLE ?= no # MIDI controls
65UNICODE_ENABLE ?= no # Unicode
66BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
67AUDIO_ENABLE ?= no # Audio output on port C6 \ No newline at end of file
diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h
index 983a1d73f..71a33498b 100644
--- a/keyboards/phantom/config.h
+++ b/keyboards/phantom/config.h
@@ -63,7 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
63/* Underlight configuration 63/* Underlight configuration
64 */ 64 */
65#define RGB_DI_PIN E2 65#define RGB_DI_PIN E2
66#define RGBLIGHT_TIMER 66#define RGBLIGHT_ANIMATIONS
67#define RGBLED_NUM 20 // Number of LEDs 67#define RGBLED_NUM 20 // Number of LEDs
68#define RGBLIGHT_HUE_STEP 10 68#define RGBLIGHT_HUE_STEP 10
69#define RGBLIGHT_SAT_STEP 17 69#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/planck/keymaps/cbbrowne/Makefile b/keyboards/planck/keymaps/cbbrowne/Makefile
index 581e08cd0..b1c70ace7 100644
--- a/keyboards/planck/keymaps/cbbrowne/Makefile
+++ b/keyboards/planck/keymaps/cbbrowne/Makefile
@@ -5,8 +5,8 @@
5# the appropriate keymap folder that will get included automatically 5# the appropriate keymap folder that will get included automatically
6# 6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 8MOUSEKEY_ENABLE = no # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 9EXTRAKEY_ENABLE = no # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400) 10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration 11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
@@ -16,10 +16,11 @@ AUDIO_ENABLE = yes # Audio output on port C6
16UNICODE_ENABLE = no # Unicode 16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19API_SYSEX_ENABLE = yes # Enable SYSEX API (+5390)
19 20
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 21# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 22SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22 23
23ifndef QUANTUM_DIR 24ifndef QUANTUM_DIR
24 include ../../../../Makefile 25 include ../../../../Makefile
25endif \ No newline at end of file 26endif
diff --git a/keyboards/planck/keymaps/cbbrowne/config.h b/keyboards/planck/keymaps/cbbrowne/config.h
index 1e04ba61d..bd15fd5a2 100644
--- a/keyboards/planck/keymaps/cbbrowne/config.h
+++ b/keyboards/planck/keymaps/cbbrowne/config.h
@@ -1,6 +1,9 @@
1#ifndef CONFIG_USER_H 1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H 2#define CONFIG_USER_H
3 3
4#define NO_DEBUG
5#define NO_PRINT
6
4#include "../../config.h" 7#include "../../config.h"
5 8
6#define LEADER_TIMEOUT 300 9#define LEADER_TIMEOUT 300
diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c
index 7f1601af7..2be4dab4b 100644
--- a/keyboards/planck/keymaps/cbbrowne/keymap.c
+++ b/keyboards/planck/keymaps/cbbrowne/keymap.c
@@ -62,6 +62,7 @@
62 - How about Alt-F1 thru Alt-F8? 62 - How about Alt-F1 thru Alt-F8?
63 - What's the keystroke to get from X to console these days? 63 - What's the keystroke to get from X to console these days?
64 - A layer for doing console switching would not be a bad idea 64 - A layer for doing console switching would not be a bad idea
65 - I haven't got page-up/page-down, let's have that...
65*/ 66*/
66 67
67enum layers { 68enum layers {
@@ -94,6 +95,7 @@ enum macro_id {
94#define SHIFTQUOTE MT(MOD_RSFT, KC_QUOT) 95#define SHIFTQUOTE MT(MOD_RSFT, KC_QUOT)
95#define ALTRIGHT MT(MOD_LALT, KC_RGHT) 96#define ALTRIGHT MT(MOD_LALT, KC_RGHT)
96#define MVERSION M(M_VERSION) 97#define MVERSION M(M_VERSION)
98#define ALTSLASH LALT(KC_SLSH)
97 99
98 100
99/* Note that Planck has dimensions 4 rows x 12 columns */ 101/* Note that Planck has dimensions 4 rows x 12 columns */
@@ -109,14 +111,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
109[_RAISE] = { /* RAISE */ 111[_RAISE] = { /* RAISE */
110 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 112 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
111 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, 113 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
112 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, RESET, _______}, 114 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, ALTSLASH,_______},
113 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 115 {_______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_PGUP}
114}, 116},
115[_LOWER] = { /* LOWER */ 117[_LOWER] = { /* LOWER */
116 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, 118 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
117 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, 119 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
118 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, RESET, _______}, 120 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, ALTSLASH, _______},
119 {_______, KEYPAD, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 121 {_______, KEYPAD, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_PGUP}
120 }, 122 },
121[_KEYPAD] = { /* Key Pad */ 123[_KEYPAD] = { /* Key Pad */
122 {KC_ESC, USERNAME, MVERSION, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC}, 124 {KC_ESC, USERNAME, MVERSION, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC},
diff --git a/keyboards/planck/keymaps/default/Makefile b/keyboards/planck/keymaps/default/Makefile
index 0f4953888..267a087ea 100644
--- a/keyboards/planck/keymaps/default/Makefile
+++ b/keyboards/planck/keymaps/default/Makefile
@@ -5,17 +5,17 @@
5# the appropriate keymap folder that will get included automatically 5# the appropriate keymap folder that will get included automatically
6# 6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 8MOUSEKEY_ENABLE = no # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400) 10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration 11COMMAND_ENABLE = no # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality 13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls 14MIDI_ENABLE = yes # MIDI controls
15AUDIO_ENABLE = yes # Audio output on port C6 15AUDIO_ENABLE = yes # Audio output on port C6
16UNICODE_ENABLE = no # Unicode 16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight
19 19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c
index 5f71ae7d1..ddbe4d7b2 100644
--- a/keyboards/planck/keymaps/default/keymap.c
+++ b/keyboards/planck/keymaps/default/keymap.c
@@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
107[_LOWER] = { 107[_LOWER] = {
108 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, 108 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
109 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, 109 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
110 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, 110 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______},
111 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 111 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
112}, 112},
113 113
@@ -125,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
125[_RAISE] = { 125[_RAISE] = {
126 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 126 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
127 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, 127 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
128 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, 128 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______},
129 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 129 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
130}, 130},
131 131
diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h
index 52acd1905..cc093bee4 100644
--- a/keyboards/planck/keymaps/experimental/config.h
+++ b/keyboards/planck/keymaps/experimental/config.h
@@ -9,7 +9,7 @@
9 9
10/* ws2812 RGB LED */ 10/* ws2812 RGB LED */
11#define RGB_DI_PIN B1 11#define RGB_DI_PIN B1
12#define RGBLIGHT_TIMER 12#define RGBLIGHT_ANIMATIONS
13#define RGBLED_NUM 8 // Number of LEDs 13#define RGBLED_NUM 8 // Number of LEDs
14#define RGBLIGHT_HUE_STEP 10 14#define RGBLIGHT_HUE_STEP 10
15#define RGBLIGHT_SAT_STEP 17 15#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/planck/keymaps/thermal_printer/Makefile b/keyboards/planck/keymaps/thermal_printer/Makefile
new file mode 100644
index 000000000..3d1d11877
--- /dev/null
+++ b/keyboards/planck/keymaps/thermal_printer/Makefile
@@ -0,0 +1,26 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = yes # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19PRINTING_ENABLE = yes
20
21# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
22SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
23
24ifndef QUANTUM_DIR
25 include ../../../../Makefile
26endif
diff --git a/keyboards/planck/keymaps/thermal_printer/config.h b/keyboards/planck/keymaps/thermal_printer/config.h
new file mode 100644
index 000000000..430b6493c
--- /dev/null
+++ b/keyboards/planck/keymaps/thermal_printer/config.h
@@ -0,0 +1,23 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6# define SERIAL_UART_BAUD 19200
7# define SERIAL_UART_DATA UDR1
8# define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
9# define SERIAL_UART_RXD_VECT USART1_RX_vect
10# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
11# define SERIAL_UART_INIT() do { \
12 /* baud rate */ \
13 UBRR1L = SERIAL_UART_UBRR; \
14 /* baud rate */ \
15 UBRR1H = SERIAL_UART_UBRR >> 8; \
16 /* enable TX */ \
17 UCSR1B = _BV(TXEN1); \
18 /* 8-bit data */ \
19 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
20 sei(); \
21 } while(0)
22
23 #endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/thermal_printer/keymap.c b/keyboards/planck/keymaps/thermal_printer/keymap.c
new file mode 100644
index 000000000..e88059731
--- /dev/null
+++ b/keyboards/planck/keymaps/thermal_printer/keymap.c
@@ -0,0 +1,314 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "planck.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8#endif
9#include "eeconfig.h"
10
11extern keymap_config_t keymap_config;
12
13// Each layer gets a name for readability, which is then used in the keymap matrix below.
14// The underscores don't mean anything - you can have a layer called STUFF or any other name.
15// Layer names don't all need to be of the same length, obviously, and you can also skip them
16// entirely and just use numbers.
17#define _QWERTY 0
18#define _COLEMAK 1
19#define _DVORAK 2
20#define _LOWER 3
21#define _RAISE 4
22#define _PLOVER 5
23#define _ADJUST 16
24
25enum planck_keycodes {
26 QWERTY = SAFE_RANGE,
27 COLEMAK,
28 DVORAK,
29 PLOVER,
30 LOWER,
31 RAISE,
32 BACKLIT,
33 EXT_PLV
34};
35
36// Fillers to make layering more clear
37#define _______ KC_TRNS
38#define XXXXXXX KC_NO
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41
42/* Qwerty
43 * ,-----------------------------------------------------------------------------------.
44 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
45 * |------+------+------+------+------+-------------+------+------+------+------+------|
46 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
47 * |------+------+------+------+------+------|------+------+------+------+------+------|
48 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
49 * |------+------+------+------+------+------+------+------+------+------+------+------|
50 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
51 * `-----------------------------------------------------------------------------------'
52 */
53[_QWERTY] = {
54 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
55 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
56 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
57 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
58},
59
60/* Colemak
61 * ,-----------------------------------------------------------------------------------.
62 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
63 * |------+------+------+------+------+-------------+------+------+------+------+------|
64 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
65 * |------+------+------+------+------+------|------+------+------+------+------+------|
66 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
67 * |------+------+------+------+------+------+------+------+------+------+------+------|
68 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
69 * `-----------------------------------------------------------------------------------'
70 */
71[_COLEMAK] = {
72 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
73 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
74 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
75 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
76},
77
78/* Dvorak
79 * ,-----------------------------------------------------------------------------------.
80 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
81 * |------+------+------+------+------+-------------+------+------+------+------+------|
82 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
83 * |------+------+------+------+------+------|------+------+------+------+------+------|
84 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
85 * |------+------+------+------+------+------+------+------+------+------+------+------|
86 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
87 * `-----------------------------------------------------------------------------------'
88 */
89[_DVORAK] = {
90 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
91 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
92 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
93 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
94},
95
96/* Lower
97 * ,-----------------------------------------------------------------------------------.
98 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
99 * |------+------+------+------+------+-------------+------+------+------+------+------|
100 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
101 * |------+------+------+------+------+------|------+------+------+------+------+------|
102 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
103 * |------+------+------+------+------+------+------+------+------+------+------+------|
104 * | | | | | | | | Next | Vol- | Vol+ | Play |
105 * `-----------------------------------------------------------------------------------'
106 */
107[_LOWER] = {
108 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
109 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
110 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
111 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
112},
113
114/* Raise
115 * ,-----------------------------------------------------------------------------------.
116 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
117 * |------+------+------+------+------+-------------+------+------+------+------+------|
118 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
119 * |------+------+------+------+------+------|------+------+------+------+------+------|
120 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
121 * |------+------+------+------+------+------+------+------+------+------+------+------|
122 * | | | | | | | | Next | Vol- | Vol+ | Play |
123 * `-----------------------------------------------------------------------------------'
124 */
125[_RAISE] = {
126 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
127 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
128 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______},
129 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
130},
131
132/* Plover layer (http://opensteno.org)
133 * ,-----------------------------------------------------------------------------------.
134 * | # | # | # | # | # | # | # | # | # | # | # | # |
135 * |------+------+------+------+------+-------------+------+------+------+------+------|
136 * | | S | T | P | H | * | * | F | P | L | T | D |
137 * |------+------+------+------+------+------|------+------+------+------+------+------|
138 * |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
139 * |------+------+------+------+------+------+------+------+------+------+------+------|
140 * | Exit | | | A | O | | E | U | | | |
141 * `-----------------------------------------------------------------------------------'
142 */
143
144[_PLOVER] = {
145 {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
146 {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
147 {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
148 {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
149},
150
151/* Adjust (Lower + Raise)
152 * ,-----------------------------------------------------------------------------------.
153 * | | Reset| | Print|no prnt | | | | | | | Del |
154 * |------+------+------+------+------+-------------+------+------+------+------+------|
155 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
156 * |------+------+------+------+------+------|------+------+------+------+------+------|
157 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
158 * |------+------+------+------+------+------+------+------+------+------+------+------|
159 * | | | | | | | | | | | |
160 * `-----------------------------------------------------------------------------------'
161 */
162[_ADJUST] = {
163 {_______, RESET, _______, PRINT_ON, PRINT_OFF, _______, _______, _______, _______, _______, _______, KC_DEL},
164 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
165 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
166 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
167}
168
169
170};
171
172#ifdef AUDIO_ENABLE
173
174float tone_startup[][2] = SONG(STARTUP_SOUND);
175float tone_qwerty[][2] = SONG(QWERTY_SOUND);
176float tone_dvorak[][2] = SONG(DVORAK_SOUND);
177float tone_colemak[][2] = SONG(COLEMAK_SOUND);
178float tone_plover[][2] = SONG(PLOVER_SOUND);
179float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
180float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
181
182float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
183#endif
184
185
186void persistant_default_layer_set(uint16_t default_layer) {
187 eeconfig_update_default_layer(default_layer);
188 default_layer_set(default_layer);
189}
190
191bool process_record_user(uint16_t keycode, keyrecord_t *record) {
192 switch (keycode) {
193 case QWERTY:
194 if (record->event.pressed) {
195 #ifdef AUDIO_ENABLE
196 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
197 #endif
198 persistant_default_layer_set(1UL<<_QWERTY);
199 }
200 return false;
201 break;
202 case COLEMAK:
203 if (record->event.pressed) {
204 #ifdef AUDIO_ENABLE
205 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
206 #endif
207 persistant_default_layer_set(1UL<<_COLEMAK);
208 }
209 return false;
210 break;
211 case DVORAK:
212 if (record->event.pressed) {
213 #ifdef AUDIO_ENABLE
214 PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
215 #endif
216 persistant_default_layer_set(1UL<<_DVORAK);
217 }
218 return false;
219 break;
220 case LOWER:
221 if (record->event.pressed) {
222 layer_on(_LOWER);
223 update_tri_layer(_LOWER, _RAISE, _ADJUST);
224 } else {
225 layer_off(_LOWER);
226 update_tri_layer(_LOWER, _RAISE, _ADJUST);
227 }
228 return false;
229 break;
230 case RAISE:
231 if (record->event.pressed) {
232 layer_on(_RAISE);
233 update_tri_layer(_LOWER, _RAISE, _ADJUST);
234 } else {
235 layer_off(_RAISE);
236 update_tri_layer(_LOWER, _RAISE, _ADJUST);
237 }
238 return false;
239 break;
240 case BACKLIT:
241 if (record->event.pressed) {
242 register_code(KC_RSFT);
243 #ifdef BACKLIGHT_ENABLE
244 backlight_step();
245 #endif
246 } else {
247 unregister_code(KC_RSFT);
248 }
249 return false;
250 break;
251 case PLOVER:
252 if (record->event.pressed) {
253 #ifdef AUDIO_ENABLE
254 stop_all_notes();
255 PLAY_NOTE_ARRAY(tone_plover, false, 0);
256 #endif
257 layer_off(_RAISE);
258 layer_off(_LOWER);
259 layer_off(_ADJUST);
260 layer_on(_PLOVER);
261 if (!eeconfig_is_enabled()) {
262 eeconfig_init();
263 }
264 keymap_config.raw = eeconfig_read_keymap();
265 keymap_config.nkro = 1;
266 eeconfig_update_keymap(keymap_config.raw);
267 }
268 return false;
269 break;
270 case EXT_PLV:
271 if (record->event.pressed) {
272 #ifdef AUDIO_ENABLE
273 PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
274 #endif
275 layer_off(_PLOVER);
276 }
277 return false;
278 break;
279 }
280 return true;
281}
282
283void matrix_init_user(void) {
284 #ifdef AUDIO_ENABLE
285 startup_user();
286 #endif
287}
288
289#ifdef AUDIO_ENABLE
290
291void startup_user()
292{
293 _delay_ms(20); // gets rid of tick
294 PLAY_NOTE_ARRAY(tone_startup, false, 0);
295}
296
297void shutdown_user()
298{
299 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
300 _delay_ms(150);
301 stop_all_notes();
302}
303
304void music_on_user(void)
305{
306 music_scale_user();
307}
308
309void music_scale_user(void)
310{
311 PLAY_NOTE_ARRAY(music_scale, false, 0);
312}
313
314#endif
diff --git a/keyboards/planck/keymaps/thermal_printer/readme.md b/keyboards/planck/keymaps/thermal_printer/readme.md
new file mode 100644
index 000000000..de9680b49
--- /dev/null
+++ b/keyboards/planck/keymaps/thermal_printer/readme.md
@@ -0,0 +1,2 @@
1# The Default Planck Layout
2
diff --git a/keyboards/planck/keymaps/yang/config.h b/keyboards/planck/keymaps/yang/config.h
index feb5a1190..4ed19d76f 100644
--- a/keyboards/planck/keymaps/yang/config.h
+++ b/keyboards/planck/keymaps/yang/config.h
@@ -5,7 +5,7 @@
5 5
6/* ws2812 RGB LED */ 6/* ws2812 RGB LED */
7#define RGB_DI_PIN D1 7#define RGB_DI_PIN D1
8#define RGBLIGHT_TIMER 8#define RGBLIGHT_ANIMATIONS
9#define RGBLED_NUM 28 // Number of LEDs 9#define RGBLED_NUM 28 // Number of LEDs
10#define RGBLIGHT_HUE_STEP 10 10#define RGBLIGHT_HUE_STEP 10
11#define RGBLIGHT_SAT_STEP 17 11#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk
index 25db53a31..ccee97271 100644
--- a/keyboards/planck/rules.mk
+++ b/keyboards/planck/rules.mk
@@ -62,6 +62,7 @@ AUDIO_ENABLE ?= no # Audio output on port C6
62UNICODE_ENABLE ?= no # Unicode 62UNICODE_ENABLE ?= no # Unicode
63BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID 63BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
64RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 64RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
65API_SYSEX_ENABLE = yes
65 66
66# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 67# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
67SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file 68SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file
diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h
index 3fb978c2f..f88acf211 100644
--- a/keyboards/preonic/config.h
+++ b/keyboards/preonic/config.h
@@ -63,7 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
63 63
64/* ws2812 RGB LED */ 64/* ws2812 RGB LED */
65#define RGB_DI_PIN D1 65#define RGB_DI_PIN D1
66#define RGBLIGHT_TIMER 66#define RGBLIGHT_ANIMATIONS
67#define RGBLED_NUM 28 // Number of LEDs 67#define RGBLED_NUM 28 // Number of LEDs
68#define RGBLIGHT_HUE_STEP 10 68#define RGBLIGHT_HUE_STEP 10
69#define RGBLIGHT_SAT_STEP 17 69#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/preonic/keymaps/default/Makefile b/keyboards/preonic/keymaps/default/Makefile
index 581e08cd0..3d4659ceb 100644
--- a/keyboards/preonic/keymaps/default/Makefile
+++ b/keyboards/preonic/keymaps/default/Makefile
@@ -1,25 +1,3 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = yes # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23ifndef QUANTUM_DIR 1ifndef QUANTUM_DIR
24 include ../../../../Makefile 2 include ../../../../Makefile
25endif \ No newline at end of file 3endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/kinesis/config.h b/keyboards/preonic/keymaps/kinesis/config.h
index 086baa84f..e6099ceb8 100644
--- a/keyboards/preonic/keymaps/kinesis/config.h
+++ b/keyboards/preonic/keymaps/kinesis/config.h
@@ -63,7 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
63 63
64/* ws2812 RGB LED */ 64/* ws2812 RGB LED */
65#define RGB_DI_PIN D1 65#define RGB_DI_PIN D1
66#define RGBLIGHT_TIMER 66#define RGBLIGHT_ANIMATIONS
67#define RGBLED_NUM 28 // Number of LEDs 67#define RGBLED_NUM 28 // Number of LEDs
68#define RGBLIGHT_HUE_STEP 10 68#define RGBLIGHT_HUE_STEP 10
69#define RGBLIGHT_SAT_STEP 17 69#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk
index d0f3a3a1c..c4ce2aacc 100644
--- a/keyboards/preonic/rules.mk
+++ b/keyboards/preonic/rules.mk
@@ -53,7 +53,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
53# the appropriate keymap folder that will get included automatically 53# the appropriate keymap folder that will get included automatically
54# 54#
55BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) 55BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
56MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) 56MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
57EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) 57EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
58CONSOLE_ENABLE ?= no # Console for debug(+400) 58CONSOLE_ENABLE ?= no # Console for debug(+400)
59COMMAND_ENABLE ?= yes # Commands for debug and configuration 59COMMAND_ENABLE ?= yes # Commands for debug and configuration
@@ -64,6 +64,7 @@ AUDIO_ENABLE ?= no # Audio output on port C6
64UNICODE_ENABLE ?= no # Unicode 64UNICODE_ENABLE ?= no # Unicode
65BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID 65BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
66RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 66RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
67API_SYSEX_ENABLE ?= yes
67 68
68# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 69# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
69SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file 70SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend \ No newline at end of file
diff --git a/keyboards/satan/config.h b/keyboards/satan/config.h
index 7e9f91cc8..eb357b39e 100644
--- a/keyboards/satan/config.h
+++ b/keyboards/satan/config.h
@@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
67 */ 67 */
68 68
69#define RGB_DI_PIN E2 69#define RGB_DI_PIN E2
70#define RGBLIGHT_TIMER 70#define RGBLIGHT_ANIMATIONS
71#define RGBLED_NUM 8 // Number of LEDs 71#define RGBLED_NUM 8 // Number of LEDs
72#define RGBLIGHT_HUE_STEP 10 72#define RGBLIGHT_HUE_STEP 10
73#define RGBLIGHT_SAT_STEP 17 73#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/satan/keymaps/dbroqua_hhkb/keymap.c b/keyboards/satan/keymaps/dbroqua_hhkb/keymap.c
new file mode 100644
index 000000000..98a298e76
--- /dev/null
+++ b/keyboards/satan/keymaps/dbroqua_hhkb/keymap.c
@@ -0,0 +1,110 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "satan.h"
5
6#define _DEFAULT 0
7#define _ALTDISP 1
8#define _FN 2
9
10enum planck_keycodes {
11 DEFAULT = SAFE_RANGE,
12 ALTDISP
13};
14
15// Fillers to make layering more clear
16#define ______ KC_TRNS
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19/* Qwerty alt/gui/space/gui/alt
20 * ,-----------------------------------------------------------------------------------------.
21 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
22 * |-----------------------------------------------------------------------------------------+
23 * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
24 * |-----------------------------------------------------------------------------------------+
25 * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
26 * |-----------------------------------------------------------------------------------------+
27 * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
28 * |-----------------------------------------------------------------------------------------+
29 * | LAlt| LGUI | Space | RGUI | RAlt |
30 * `-----------------------------------------------------------------'
31 */
32 [_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */
33 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, \
34 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, \
35 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, \
36 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(_FN), \
37 ______, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, ______, ______ \
38 ),
39
40/* Qwerty gui/alt/space/alt/gui
41 * ,-----------------------------------------------------------------------------------------.
42 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
43 * |-----------------------------------------------------------------------------------------+
44 * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
45 * |-----------------------------------------------------------------------------------------+
46 * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
47 * |-----------------------------------------------------------------------------------------+
48 * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
49 * |-----------------------------------------------------------------------------------------+
50 * |LGUI | LAlt | Space | RAlt |RGUI |
51 * `-----------------------------------------------------------------'
52 */
53 [_ALTDISP] = KEYMAP_HHKB( /* Basic QWERTY */
54 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, \
55 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, \
56 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, \
57 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(_FN), \
58 ______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \
59 ),
60
61/* FN Layer
62 * ,-----------------------------------------------------------------------------------------.
63 * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
64 * |-----------------------------------------------------------------------------------------+
65 * | CAPS | BL- | BL+ | BL | | | | | Psc | Slck| Paus| Up | | |
66 * |-----------------------------------------------------------------------------------------+
67 * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
68 * |-----------------------------------------------------------------------------------------+
69 * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
70 * |-----------------------------------------------------------------------------------------+
71 * | | | | Stop | |
72 * `-----------------------------------------------------------------'
73 */
74 [_FN] = KEYMAP_HHKB( /* Layer 1 */
75 ______, 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, \
76 KC_CAPS, BL_DEC, BL_INC, BL_TOGG, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
77 ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \
78 ______, KC_MPRV, KC_MPLY, KC_MNXT,______,______,KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______,______, \
79 ______, DEFAULT, ALTDISP, ______, KC_MSTP, ______, ______, ______ \
80 )
81};
82
83const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
84{
85 // MACRODOWN only works in this function
86 return MACRO_NONE;
87};
88
89void persistant_default_layer_set(uint16_t default_layer) {
90 eeconfig_update_default_layer(default_layer);
91 default_layer_set(default_layer);
92}
93
94bool process_record_user(uint16_t keycode, keyrecord_t *record) {
95 switch (keycode) {
96 case DEFAULT:
97 if (record->event.pressed) {
98 persistant_default_layer_set(1UL<<_DEFAULT);
99 }
100 return false;
101 break;
102 case ALTDISP:
103 if (record->event.pressed) {
104 persistant_default_layer_set(1UL<<_ALTDISP);
105 }
106 return false;
107 break;
108 }
109 return true;
110} \ No newline at end of file
diff --git a/keyboards/satan/keymaps/dbroqua_hhkb/readme.md b/keyboards/satan/keymaps/dbroqua_hhkb/readme.md
new file mode 100644
index 000000000..39e71beed
--- /dev/null
+++ b/keyboards/satan/keymaps/dbroqua_hhkb/readme.md
@@ -0,0 +1,9 @@
1# Dbroqua HHKB like Layout
2
3Like the HHKB but with a Satan GH60 PCB :D.
4
5# Programming Instructions:
6Enter into programming mode and run the following command.
7```
8$ sudo KEYMAP=dbroqua_hhkb make dfu
9``` \ No newline at end of file
diff --git a/keyboards/satan/keymaps/sethbc/keymap.c b/keyboards/satan/keymaps/sethbc/keymap.c
index 82c779081..93610258b 100644
--- a/keyboards/satan/keymaps/sethbc/keymap.c
+++ b/keyboards/satan/keymaps/sethbc/keymap.c
@@ -32,21 +32,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32 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, \ 32 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, \
33 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, \ 33 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, \
34 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(_FL), \ 34 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(_FL), \
35 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL), 35 KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_MENU, KC_RCTL),
36 36
37[_FL] = KEYMAP_HHKB( 37[_FL] = KEYMAP_HHKB(
38 #ifdef RGBLIGHT_ENABLE 38 #ifdef RGBLIGHT_ENABLE
39 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, _______, RESET, \ 39 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, _______, RESET, \
40 KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, \
41 _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
42 _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
43 _______, _______, _______, _______, _______, _______, _______, _______),
44 #else
45 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, _______, RESET, \
46 KC_CAPS, _______, RGB_TOG,RGB_MOD,RGB_HUI, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, \ 40 KC_CAPS, _______, RGB_TOG,RGB_MOD,RGB_HUI, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, \
47 _______, KC_VOLD, RGB_HUD,RGB_SAI,RGB_SAD, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ 41 _______, KC_VOLD, RGB_HUD,RGB_SAI,RGB_SAD, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
48 _______, RGB_VAI,RGB_VAD,_______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ 42 _______, RGB_VAI,RGB_VAD,_______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
49 _______, _______, _______, _______, _______, _______, _______, _______), 43 _______, _______, _______, _______, _______, _______, _______, _______),
44 #else
45 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, _______, RESET, \
46 KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, \
47 _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
48 _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
49 _______, _______, _______, _______, _______, _______, _______, _______),
50 #endif 50 #endif
51}; 51};
52 52
diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h
index 5d8757936..19cf9c9b3 100644
--- a/keyboards/tada68/config.h
+++ b/keyboards/tada68/config.h
@@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
67 */ 67 */
68 68
69/*#define RGB_DI_PIN E2 69/*#define RGB_DI_PIN E2
70#define RGBLIGHT_TIMER 70#define RGBLIGHT_ANIMATIONS
71#define RGBLED_NUM 2 // Number of LEDs 71#define RGBLED_NUM 2 // Number of LEDs
72#define RGBLIGHT_HUE_STEP 10 72#define RGBLIGHT_HUE_STEP 10
73#define RGBLIGHT_SAT_STEP 17 73#define RGBLIGHT_SAT_STEP 17
diff --git a/keyboards/vision_division/config.h b/keyboards/vision_division/config.h
index 1f8466a54..5798d91ad 100644
--- a/keyboards/vision_division/config.h
+++ b/keyboards/vision_division/config.h
@@ -31,7 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
31#define BACKLIGHT_LEVELS 3 31#define BACKLIGHT_LEVELS 3
32 32
33/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 33/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
34#define DEBOUNCING_DELAY 5 34#define DEBOUNCING_DELAY 0
35
36#define MATRIX_MASKED
35 37
36/* define if matrix has ghost (lacks anti-ghosting diodes) */ 38/* define if matrix has ghost (lacks anti-ghosting diodes) */
37//#define MATRIX_HAS_GHOST 39//#define MATRIX_HAS_GHOST
diff --git a/keyboards/vision_division/keymaps/default/Makefile b/keyboards/vision_division/keymaps/default/Makefile
index 5a930e85e..28060947a 100644
--- a/keyboards/vision_division/keymaps/default/Makefile
+++ b/keyboards/vision_division/keymaps/default/Makefile
@@ -2,7 +2,7 @@
2# change to "no" to disable the options, or define them in the Makefile in 2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically 3# the appropriate keymap folder that will get included automatically
4# 4#
5BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
6MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 6MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
7EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
8CONSOLE_ENABLE = yes # Console for debug(+400) 8CONSOLE_ENABLE = yes # Console for debug(+400)
@@ -18,4 +18,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
18 18
19ifndef QUANTUM_DIR 19ifndef QUANTUM_DIR
20 include ../../../../Makefile 20 include ../../../../Makefile
21endif \ No newline at end of file 21endif
diff --git a/keyboards/vision_division/keymaps/default/keymap.c b/keyboards/vision_division/keymaps/default/keymap.c
index 64118abdc..3282761c0 100644
--- a/keyboards/vision_division/keymaps/default/keymap.c
+++ b/keyboards/vision_division/keymaps/default/keymap.c
@@ -121,6 +121,7 @@ enum keyboard_macros {
121 121
122#define M_CP_CT M(MACRO_COPY_CUT) 122#define M_CP_CT M(MACRO_COPY_CUT)
123 123
124#define M_COPY KC_FN1
124 125
125#define SC_UNDO LCTL(KC_Z) 126#define SC_UNDO LCTL(KC_Z)
126#define SC_REDO LCTL(KC_Y) 127#define SC_REDO LCTL(KC_Y)
@@ -141,35 +142,46 @@ enum keyboard_macros {
141#define ________________ _______, _______ 142#define ________________ _______, _______
142#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX 143#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX
143 144
145const matrix_row_t matrix_mask[MATRIX_ROWS] =
146{
147// 1098765432109876543210987654321
148 0b0000000001111111101111011111111,
149 0b0000000001111111111111111111111,
150 0b0000000001111111111111111111111,
151 0b0000000001111111111111111111111,
152 0b0000000001010111111111111111111,
153 0b0000000001111101111111101011111,
154};
155
144const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = 156const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] =
145{ 157{
146/* LAYER = LAYER_QWERTY 158/* LAYER = LAYER_QWERTY
147 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 159 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
148 | FN | PRINT | SCR LK | PAUSE | | F1 | F2 | F3 | F4 | XXXXXX | F5 | F6 | F7 | F8 | XXXXXX | F9 | F10 | F11 | F12 | | VOL DN | MUTE | VOL UP | BACKLT | 160 | VOL DN | MUTE | VOL UP | BACKLT | | F1 | F2 | F3 | F4 | XXXXXX | F5 | F6 | F7 | F8 | XXXXXX | F9 | F10 | F11 | F12 | | PRINT | SCR LK | PAUSE | FN |
149 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 161 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
150 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 162 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
151 | M1 | INS | HOME | PG UP | | ESC | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | BACKSP | | NUM LK | KP / | KP * | KP - | 163 | NUM LK | KP / | KP * | KP - | | ESC | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | BACKSP | | INS | HOME | PG UP | M1 |
152 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| 164 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------|
153 | M2 | DEL | END | PG DN | | TAB | TAB | Q | W | E | R | T | Y | U | I | O | P | - | \ | | KP 7 | KP 8 | KP 9 | KP + | 165 | KP 7 | KP 8 | KP 9 | KP + | | TAB | TAB | Q | W | E | R | T | Y | U | I | O | P | - | \ | | DEL | END | PG DN | M2 |
154 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| 166 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------|
155 | M3 | UL | UP | UR | | CAP LK | BACKSP | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | o | KP 4 | KP 5 | KP 6 | KP + | 167 | KP 4 | KP 5 | KP 6 | KP + | | CAP LK | BACKSP | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | o | CP/CT | UNDO | PASTE | M3 |
156 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| 168 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------|
157 | M4 | LEFT | CP/CT | RIGHT | | LSHIFT | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | RSHIFT | | KP 1 | KP 2 | KP 3 | KP Ent | 169 | KP 1 | KP 2 | KP 3 | KP Ent | | LSHIFT | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | RSHIFT | | XXXXXX | UP | XXXXXX | M4 |
158 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| 170 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------|
159 | M5 | DL | DOWN | DR | | LCTRL | XXXXXX | XXXXXX | LWIN | LALT | LOWER | SPACE . SPACE | UPPER | OSHIFT | RALT | APP | XXXXXX | RCTRL | | KP 0 | KP , | KP . | KP Ent | 171 | KP 0 | KP , | KP . | KP Ent | | LCTRL | XXXXXX | LWIN | XXXXXX | LALT | UPPER | SPACE . SPACE | LOWER | OSHIFT | RALT | APP | XXXXXX | RCTRL | | LEFT | DOWN | RIGHT | M5 |
160 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 172 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
161*/ 173*/
162KEYMAP(LAYER_QWERTY, \ 174KEYMAP(LAYER_QWERTY, \
163 M_HELP , KC_PSCR, KC_SLCK, KC_PAUS, 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_VOLD, KC_MUTE, KC_VOLU, M_BACKL, \ 175 KC_VOLD, KC_MUTE, KC_VOLU, M_BACKL, 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, M_HELP , \
164 M_M1 , KC_INS , KC_HOME, KC_PGUP, 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_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ 176 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, M_M1 , \
165 M_M2 , KC_DEL , KC_END , KC_PGDN, 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_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, \ 177 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, M_M2 , \
166 M_M3 , M_UL , KC_UP , M_UR , 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 , KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, \ 178 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 , M_CP_CT, SC_UNDO, SC_PSTE, M_M3 , \
167 M_M4 , KC_LEFT, M_CP_CT, KC_RGHT, 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, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, \ 179 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, M_M4 , \
168 M_M5 , M_DL , KC_DOWN, M_DR , KC_LCTL, XXXXXXX, XXXXXXX, KC_LGUI, KC_LALT, M_LOWER, KC_SPC , KC_SPC , M_UPPER, OS_SHFT, KC_RALT, KC_APP , XXXXXXX, KC_RCTL, KC_KP_0, KC_PCMM, KC_PDOT, KC_PENT \ 180 KC_KP_0, KC_PCMM, KC_PDOT, KC_PENT, KC_LCTL, XXXXXXX, KC_LGUI, XXXXXXX, KC_LALT, M_UPPER, KC_SPC , KC_SPC , M_LOWER, OS_SHFT, KC_RALT, KC_APP , XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, M_M5 \
169), 181),
170/* LAYER = LAYER_LOWER 182/* LAYER = LAYER_LOWER
171 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 183 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
172 | ______ | ______ | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | MUTE A | ______ | ______ | 184 | ______ | MUTE A | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | ______ | ______ | ______ |
173 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 185 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
174 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 186 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
175 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 187 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ |
@@ -180,20 +192,20 @@ KEYMAP(LAYER_QWERTY, \
180 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| 192 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------|
181 | ______ | ______ | ______ | ______ | | ______ | ______ | | | & | ! | ~ | ; | : | = | < | > | ? | ______ | ______ | | ______ | ______ | ______ | ______ | 193 | ______ | ______ | ______ | ______ | | ______ | ______ | | | & | ! | ~ | ; | : | = | < | > | ? | ______ | ______ | | ______ | ______ | ______ | ______ |
182 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| 194 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------|
183 | ______ | ______ | ______ | ______ | | ______ | XXXXXX | XXXXXX | ______ | ______ | ______ | ______ . ______ | LOWER | ______ | ______ | ______ | XXXXXX | ______ | | ______ | ______ | ______ | ______ | 195 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ . ______ | LOWER | ______ | ______ | ______ | XXXXXX | ______ | | ______ | ______ | ______ | ______ |
184 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 196 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
185*/ 197*/
186KEYMAP(LAYER_LOWER, \ 198KEYMAP(LAYER_LOWER, \
187 _______, _______, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, M_MUTEA, _______, _______, \ 199 _______, M_MUTEA, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, _______, _______, _______, \
188 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 200 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
189 _______, _______, _______, _______, _______, _______, KC_DLR , KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT , _______, _______, _______, _______, _______, _______, \ 201 _______, _______, _______, _______, _______, _______, KC_DLR , KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT , _______, _______, _______, _______, _______, _______, \
190 _______, _______, _______, _______, _______, _______, KC_CIRC, KC_ASTR, KC_PLUS, KC_MINS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT , KC_GRV , _______, _______, _______, _______, _______, _______, \ 202 _______, _______, _______, _______, _______, _______, KC_CIRC, KC_ASTR, KC_PLUS, KC_MINS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT , KC_GRV , _______, _______, _______, _______, _______, _______, \
191 _______, _______, _______, _______, _______, _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL , KC_LT , KC_GT , KC_QUES, _______, _______, _______, _______, _______, _______, \ 203 _______, _______, _______, _______, _______, _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL , KC_LT , KC_GT , KC_QUES, _______, _______, _______, _______, _______, _______, \
192 _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, M_LOWER, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______ \ 204 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_LOWER, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______ \
193), 205),
194/* LAYER = LAYER_UPPER 206/* LAYER = LAYER_UPPER
195 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 207 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
196 | ______ | ______ | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | MUTE A | ______ | ______ | 208 | ______ | MUTE A | ______ | ______ | | F13 | F14 | F15 | F16 | XXXXXX | F17 | F18 | F19 | F20 | XXXXXX | F21 | F22 | F23 | F24 | | ______ | ______ | ______ | ______ |
197 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 209 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
198 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 210 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
199 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 211 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ |
@@ -204,44 +216,44 @@ KEYMAP(LAYER_LOWER, \
204 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| 216 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------|
205 | ______ | ______ | ______ | ______ | | ______ | ______ | F9 | F10 | F11 | F12 | SCR LK | KP 0 | KP 1 | KP 2 | KP 3 | KP Ent | ______ | ______ | | ______ | ______ | ______ | ______ | 217 | ______ | ______ | ______ | ______ | | ______ | ______ | F9 | F10 | F11 | F12 | SCR LK | KP 0 | KP 1 | KP 2 | KP 3 | KP Ent | ______ | ______ | | ______ | ______ | ______ | ______ |
206 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| 218 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------|
207 | ______ | ______ | ______ | ______ | | ______ | XXXXXX | XXXXXX | ______ | ______ | UPPER | KP 0 . KP 0 | ______ | RALT | KP . | KP Ent | XXXXXX | ______ | | ______ | ______ | ______ | ______ | 219 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | UPPER | KP 0 . KP 0 | ______ | RALT | KP . | KP Ent | XXXXXX | ______ | | ______ | ______ | ______ | ______ |
208 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 220 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
209*/ 221*/
210KEYMAP(LAYER_UPPER, \ 222KEYMAP(LAYER_UPPER, \
211 _______, _______, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, M_MUTEA, _______, _______, \ 223 _______, M_MUTEA, _______, _______, KC_F13 , KC_F14 , KC_F15 , KC_F16 , XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , XXXXXXX, KC_F21 , KC_F22 , KC_F23 , KC_F24 , _______, _______, _______, _______, \
212 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 224 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
213 _______, _______, _______, _______, _______, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_NLCK, KC_PSLS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, _______, _______, _______, \ 225 _______, _______, _______, _______, _______, _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_NLCK, KC_PSLS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, _______, _______, _______, \
214 _______, _______, _______, _______, _______, _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_CAPS, KC_PAST, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, _______, _______, _______, _______, _______, \ 226 _______, _______, _______, _______, _______, _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_CAPS, KC_PAST, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, _______, _______, _______, _______, _______, \
215 _______, _______, _______, _______, _______, _______, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_SLCK, KC_KP_0, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, _______, _______, _______, _______, _______, \ 227 _______, _______, _______, _______, _______, _______, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_SLCK, KC_KP_0, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, _______, _______, _______, _______, _______, \
216 _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, M_UPPER, KC_KP_0, KC_KP_0, _______, KC_RALT, KC_PDOT, KC_PENT, XXXXXXX, _______, _______, _______, _______, _______ \ 228 _______, _______, _______, _______, _______, _______, _______, _______, _______, M_UPPER, KC_KP_0, KC_KP_0, _______, KC_RALT, KC_PDOT, KC_PENT, XXXXXXX, _______, _______, _______, _______, _______ \
217), 229),
218/* LAYER = LAYER_MOUSE 230/* LAYER = LAYER_MOUSE
219 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 231 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
220 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 232 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ |
221 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 233 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
222 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 234 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
223 | MS BT1 | MS AC0 | MS WHU | MS AC2 | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 235 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | MS AC0 | MS WHU | MS AC2 | MS BT1 |
224 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| 236 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------|
225 | MS BT2 | MS WHL | MS WHD | MS WHU | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 237 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | MS WHL | MS WHD | MS WHU | MS BT2 |
226 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| 238 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------|
227 | MS BT3 | MS UL | MS U | MS UR | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | o | ______ | ______ | ______ | ______ | 239 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | o | MS BT1 | MS BT2 | MS BT3 | MS BT3 |
228 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------| 240 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| o |--------|--------|--------+--------|
229 | MS BT4 | MS L | MS BT1 | MS R | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 241 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | XXXXXX | MS U | XXXXXX | MS BT4 |
230 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------| 242 |--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |--------|--------|--------+--------|
231 | MS BT5 | MS DL | MS D | MS DR | | ______ | ______ | ______ | ______ | ______ | ______ | ______ . ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | 243 | ______ | ______ | ______ | ______ | | ______ | ______ | ______ | ______ | ______ | ______ | ______ . ______ | ______ | ______ | ______ | ______ | ______ | ______ | | MS L | MS D | MS R | MS BT5 |
232 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 244 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
233*/ 245*/
234KEYMAP(LAYER_MOUSE, \ 246KEYMAP(LAYER_MOUSE, \
235 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 247 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
236 KC_BTN1, KC_ACL0, KC_WH_U, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 248 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ACL0, KC_WH_U, KC_ACL2, KC_BTN1, \
237 KC_BTN2, KC_WH_L, KC_WH_D, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 249 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_BTN2, \
238 KC_BTN3, M_MS_UL, KC_MS_U, M_MS_UR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 250 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_BTN3, \
239 KC_BTN4, KC_MS_L, KC_BTN1, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 251 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_MS_U, XXXXXXX, KC_BTN4, \
240 KC_BTN5, M_MS_DL, KC_MS_D, M_MS_DR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ 252 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5 \
241), 253),
242/* LAYER = LAYER_ADJUST 254/* LAYER = LAYER_ADJUST
243 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 255 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
244 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | HELP 1 | HELP 2 | HELP 3 | HELP 4 | XXXXXX | HELP 5 | HELP 6 | HELP 7 | HELP 8 | XXXXXX | HELP 9 | HELP 0 | XXXXXX | XXXXXX | | VOICE- | AUDIO | VOICE+ | MUSIC | 256 | VOICE- | AUDIO | VOICE+ | MUSIC | | HELP 1 | HELP 2 | HELP 3 | HELP 4 | XXXXXX | HELP 5 | HELP 6 | HELP 7 | HELP 8 | XXXXXX | HELP 9 | HELP 0 | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX |
245 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 257 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
246 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------. 258 .-----------------------------------. .-----------------------------------------------------------------------------------------------------------------------------. .-----------------------------------.
247 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | 259 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | XXXXXX | XXXXXX | XXXXXX | XXXXXX |
@@ -256,14 +268,13 @@ KEYMAP(LAYER_MOUSE, \
256 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------' 268 '-----------------------------------' '-----------------------------------------------------------------------------------------------------------------------------' '-----------------------------------'
257*/ 269*/
258KEYMAP(LAYER_ADJUST, \ 270KEYMAP(LAYER_ADJUST, \
259 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_HELP1, M_HELP2, M_HELP3, M_HELP4, XXXXXXX, M_HELP5, M_HELP6, M_HELP7, M_HELP8, XXXXXXX, M_HELP9, M_HELP0, XXXXXXX, XXXXXXX, MUV_DE , AU_TOG , MUV_IN , MU_TOG , \ 271 MUV_DE , AU_TOG , MUV_IN , MU_TOG , M_HELP1, M_HELP2, M_HELP3, M_HELP4, XXXXXXX, M_HELP5, M_HELP6, M_HELP7, M_HELP8, XXXXXXX, M_HELP9, M_HELP0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
260 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 272 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
261 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 273 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
262 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 274 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
263 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , XXXXXXX, M_MOUSE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 275 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , XXXXXXX, M_MOUSE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
264 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_UPPER, XXXXXXX, XXXXXXX, M_LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ 276 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_UPPER, XXXXXXX, XXXXXXX, M_LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
265), 277),
266
267}; 278};
268 279
269#ifdef AUDIO_ENABLE 280#ifdef AUDIO_ENABLE
@@ -296,6 +307,7 @@ void persistant_default_layer_set(uint16_t default_layer)
296 307
297const uint16_t PROGMEM fn_actions[] = { 308const uint16_t PROGMEM fn_actions[] = {
298 [0] = ACTION_MODS_ONESHOT(MOD_LSFT), 309 [0] = ACTION_MODS_ONESHOT(MOD_LSFT),
310 [1] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
299}; 311};
300 312
301const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 313const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
@@ -305,68 +317,84 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
305 switch(id) 317 switch(id)
306 { 318 {
307 319
308 case MACRO_HELP_1: 320 case MACRO_COPY_CUT:
309 if (record->event.pressed) 321 if (record->event.pressed) {
310 { 322 register_code(KC_LCTL);
311 uprint("H1"); 323 if (record->tap.count == 1) {
312 } 324 register_code(KC_C);
313 break; 325 unregister_code(KC_C);
314 326 }
315 case MACRO_HELP_2: 327 else if (record->tap.count == 2) {
316 if (record->event.pressed) 328 register_code(KC_X);
317 { 329 unregister_code(KC_X);
318 uprint("H2"); 330 }
319 } 331 unregister_code(KC_LCTL);
320 break; 332 }
321 333 break;
322 case MACRO_HELP_3: 334
323 if (record->event.pressed) 335
324 { 336 // case MACRO_HELP_1:
325 uprint("H3"); 337 // if (record->event.pressed)
326 } 338 // {
327 break; 339 // uprint("H1");
328 340 // }
329 case MACRO_HELP_4: 341 // break;
330 if (record->event.pressed) 342
331 { 343 // case MACRO_HELP_2:
332 uprint("H4"); 344 // if (record->event.pressed)
333 } 345 // {
334 break; 346 // uprint("H2");
335 347 // }
336 case MACRO_HELP_5: 348 // break;
337 if (record->event.pressed) 349
338 { 350 // case MACRO_HELP_3:
339 uprint("H5"); 351 // if (record->event.pressed)
340 } 352 // {
341 break; 353 // uprint("H3");
342 354 // }
343 case MACRO_HELP_6: 355 // break;
344 if (record->event.pressed) 356
345 { 357 // case MACRO_HELP_4:
346 uprint("H6"); 358 // if (record->event.pressed)
347 } 359 // {
348 break; 360 // uprint("H4");
349 361 // }
350 case MACRO_HELP_7: 362 // break;
351 if (record->event.pressed) 363
352 { 364 // case MACRO_HELP_5:
353 uprint("H7"); 365 // if (record->event.pressed)
354 } 366 // {
355 break; 367 // uprint("H5");
356 368 // }
357 case MACRO_HELP_8: 369 // break;
358 if (record->event.pressed) 370
359 { 371 // case MACRO_HELP_6:
360 uprint("H8"); 372 // if (record->event.pressed)
361 } 373 // {
362 break; 374 // uprint("H6");
363 375 // }
364 case MACRO_HELP_9: 376 // break;
365 if (record->event.pressed) 377
366 { 378 // case MACRO_HELP_7:
367 uprint("H9"); 379 // if (record->event.pressed)
368 } 380 // {
369 break; 381 // uprint("H7");
382 // }
383 // break;
384
385 // case MACRO_HELP_8:
386 // if (record->event.pressed)
387 // {
388 // uprint("H8");
389 // }
390 // break;
391
392 // case MACRO_HELP_9:
393 // if (record->event.pressed)
394 // {
395 // uprint("H9");
396 // }
397 // break;
370 398
371 case MACRO_BREATH_TOGGLE: 399 case MACRO_BREATH_TOGGLE:
372 if (record->event.pressed) 400 if (record->event.pressed)
@@ -566,12 +594,12 @@ void led_set_user(uint8_t usb_led)
566void startup_user() 594void startup_user()
567{ 595{
568 _delay_ms(10); // gets rid of tick 596 _delay_ms(10); // gets rid of tick
569 PLAY_NOTE_ARRAY(tone_my_startup, false, STACCATO); 597 // PLAY_NOTE_ARRAY(tone_my_startup, false, STACCATO);
570} 598}
571 599
572void shutdown_user() 600void shutdown_user()
573{ 601{
574 PLAY_NOTE_ARRAY(tone_my_goodbye, false, STACCATO); 602 // PLAY_NOTE_ARRAY(tone_my_goodbye, false, STACCATO);
575 _delay_ms(2000); 603 _delay_ms(2000);
576 stop_all_notes(); 604 stop_all_notes();
577} 605}
diff --git a/quantum/api.c b/quantum/api.c
new file mode 100644
index 000000000..4ca3b9676
--- /dev/null
+++ b/quantum/api.c
@@ -0,0 +1,178 @@
1#include "api.h"
2#include "quantum.h"
3
4void dword_to_bytes(uint32_t dword, uint8_t * bytes) {
5 bytes[0] = (dword >> 24) & 0xFF;
6 bytes[1] = (dword >> 16) & 0xFF;
7 bytes[2] = (dword >> 8) & 0xFF;
8 bytes[3] = (dword >> 0) & 0xFF;
9}
10
11uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index) {
12 return ((uint32_t)bytes[index + 0] << 24) | ((uint32_t)bytes[index + 1] << 16) | ((uint32_t)bytes[index + 2] << 8) | (uint32_t)bytes[index + 3];
13}
14
15__attribute__ ((weak))
16bool process_api_quantum(uint8_t length, uint8_t * data) {
17 return process_api_keyboard(length, data);
18}
19
20__attribute__ ((weak))
21bool process_api_keyboard(uint8_t length, uint8_t * data) {
22 return process_api_user(length, data);
23}
24
25__attribute__ ((weak))
26bool process_api_user(uint8_t length, uint8_t * data) {
27 return true;
28}
29
30void process_api(uint16_t length, uint8_t * data) {
31 // SEND_STRING("\nRX: ");
32 // for (uint8_t i = 0; i < length; i++) {
33 // send_byte(data[i]);
34 // SEND_STRING(" ");
35 // }
36 if (!process_api_quantum(length, data))
37 return;
38
39 switch (data[0]) {
40 case MT_SET_DATA:
41 switch (data[1]) {
42 case DT_DEFAULT_LAYER: {
43 eeconfig_update_default_layer(data[2]);
44 default_layer_set((uint32_t)(data[2]));
45 break;
46 }
47 case DT_KEYMAP_OPTIONS: {
48 eeconfig_update_keymap(data[2]);
49 break;
50 }
51 case DT_RGBLIGHT: {
52 #ifdef RGBLIGHT_ENABLE
53 uint32_t rgblight = bytes_to_dword(data, 2);
54 rgblight_update_dword(rgblight);
55 #endif
56 break;
57 }
58 }
59 case MT_GET_DATA:
60 switch (data[1]) {
61 case DT_HANDSHAKE: {
62 MT_GET_DATA_ACK(DT_HANDSHAKE, NULL, 0);
63 break;
64 }
65 case DT_DEBUG: {
66 uint8_t debug_bytes[1] = { eeprom_read_byte(EECONFIG_DEBUG) };
67 MT_GET_DATA_ACK(DT_DEBUG, debug_bytes, 1);
68 break;
69 }
70 case DT_DEFAULT_LAYER: {
71 uint8_t default_bytes[1] = { eeprom_read_byte(EECONFIG_DEFAULT_LAYER) };
72 MT_GET_DATA_ACK(DT_DEFAULT_LAYER, default_bytes, 1);
73 break;
74 }
75 case DT_CURRENT_LAYER: {
76 uint8_t layer_state_bytes[4];
77 dword_to_bytes(layer_state, layer_state_bytes);
78 MT_GET_DATA_ACK(DT_CURRENT_LAYER, layer_state_bytes, 4);
79 break;
80 }
81 case DT_AUDIO: {
82 #ifdef AUDIO_ENABLE
83 uint8_t audio_bytes[1] = { eeprom_read_byte(EECONFIG_AUDIO) };
84 MT_GET_DATA_ACK(DT_AUDIO, audio_bytes, 1);
85 #else
86 MT_GET_DATA_ACK(DT_AUDIO, NULL, 0);
87 #endif
88 break;
89 }
90 case DT_BACKLIGHT: {
91 #ifdef BACKLIGHT_ENABLE
92 uint8_t backlight_bytes[1] = { eeprom_read_byte(EECONFIG_BACKLIGHT) };
93 MT_GET_DATA_ACK(DT_BACKLIGHT, backlight_bytes, 1);
94 #else
95 MT_GET_DATA_ACK(DT_BACKLIGHT, NULL, 0);
96 #endif
97 break;
98 }
99 case DT_RGBLIGHT: {
100 #ifdef RGBLIGHT_ENABLE
101 uint8_t rgblight_bytes[4];
102 dword_to_bytes(eeconfig_read_rgblight(), rgblight_bytes);
103 MT_GET_DATA_ACK(DT_RGBLIGHT, rgblight_bytes, 4);
104 #else
105 MT_GET_DATA_ACK(DT_RGBLIGHT, NULL, 0);
106 #endif
107 break;
108 }
109 case DT_KEYMAP_OPTIONS: {
110 uint8_t keymap_bytes[1] = { eeconfig_read_keymap() };
111 MT_GET_DATA_ACK(DT_KEYMAP_OPTIONS, keymap_bytes, 1);
112 break;
113 }
114 case DT_KEYMAP_SIZE: {
115 uint8_t keymap_size[2] = {MATRIX_ROWS, MATRIX_COLS};
116 MT_GET_DATA_ACK(DT_KEYMAP_SIZE, keymap_size, 2);
117 break;
118 }
119 case DT_KEYMAP: {
120 uint8_t keymap_data[MATRIX_ROWS * MATRIX_COLS * 4 + 3];
121 keymap_data[0] = data[2];
122 keymap_data[1] = MATRIX_ROWS;
123 keymap_data[2] = MATRIX_COLS;
124 for (int i = 0; i < MATRIX_ROWS; i++) {
125 for (int j = 0; j < MATRIX_COLS; j++) {
126 keymap_data[3 + (i*MATRIX_COLS*2) + (j*2)] = pgm_read_word(&keymaps[data[2]][i][j]) >> 8;
127 keymap_data[3 + (i*MATRIX_COLS*2) + (j*2) + 1] = pgm_read_word(&keymaps[data[2]][i][j]) & 0xFF;
128 }
129 }
130 MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, MATRIX_ROWS * MATRIX_COLS * 4 + 3);
131 // uint8_t keymap_data[5];
132 // keymap_data[0] = data[2];
133 // keymap_data[1] = data[3];
134 // keymap_data[2] = data[4];
135 // keymap_data[3] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) >> 8;
136 // keymap_data[4] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) & 0xFF;
137
138 // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, 5);
139 break;
140 }
141 default:
142 break;
143 }
144 break;
145 case MT_SET_DATA_ACK:
146 case MT_GET_DATA_ACK:
147 break;
148 case MT_SEND_DATA:
149 break;
150 case MT_SEND_DATA_ACK:
151 break;
152 case MT_EXE_ACTION:
153 break;
154 case MT_EXE_ACTION_ACK:
155 break;
156 case MT_TYPE_ERROR:
157 break;
158 default: ; // command not recognised
159 SEND_BYTES(MT_TYPE_ERROR, DT_NONE, data, length);
160 break;
161
162 // #ifdef RGBLIGHT_ENABLE
163 // case 0x27: ; // RGB LED functions
164 // switch (*data++) {
165 // case 0x00: ; // Update HSV
166 // rgblight_sethsv((data[0] << 8 | data[1]) % 360, data[2], data[3]);
167 // break;
168 // case 0x01: ; // Update RGB
169 // break;
170 // case 0x02: ; // Update mode
171 // rgblight_mode(data[0]);
172 // break;
173 // }
174 // break;
175 // #endif
176 }
177
178} \ No newline at end of file
diff --git a/quantum/api.h b/quantum/api.h
new file mode 100644
index 000000000..00dcdb895
--- /dev/null
+++ b/quantum/api.h
@@ -0,0 +1,59 @@
1#ifndef _API_H_
2#define _API_H_
3
4#include "lufa.h"
5
6enum MESSAGE_TYPE {
7 MT_GET_DATA = 0x10, // Get data from keyboard
8 MT_GET_DATA_ACK = 0x11, // returned data to process (ACK)
9 MT_SET_DATA = 0x20, // Set data on keyboard
10 MT_SET_DATA_ACK = 0x21, // returned data to confirm (ACK)
11 MT_SEND_DATA = 0x30, // Sending data/action from keyboard
12 MT_SEND_DATA_ACK = 0x31, // returned data/action confirmation (ACK)
13 MT_EXE_ACTION = 0x40, // executing actions on keyboard
14 MT_EXE_ACTION_ACK =0x41, // return confirmation/value (ACK)
15 MT_TYPE_ERROR = 0x80 // type not recofgnised (ACK)
16};
17
18enum DATA_TYPE {
19 DT_NONE = 0x00,
20 DT_HANDSHAKE,
21 DT_DEFAULT_LAYER,
22 DT_CURRENT_LAYER,
23 DT_KEYMAP_OPTIONS,
24 DT_BACKLIGHT,
25 DT_RGBLIGHT,
26 DT_UNICODE,
27 DT_DEBUG,
28 DT_AUDIO,
29 DT_QUANTUM_ACTION,
30 DT_KEYBOARD_ACTION,
31 DT_USER_ACTION,
32 DT_KEYMAP_SIZE,
33 DT_KEYMAP
34};
35
36void dword_to_bytes(uint32_t dword, uint8_t * bytes);
37uint32_t bytes_to_dword(uint8_t * bytes, uint8_t index);
38
39#define MT_GET_DATA(data_type, data, length) SEND_BYTES(MT_GET_DATA, data_type, data, length)
40#define MT_GET_DATA_ACK(data_type, data, length) SEND_BYTES(MT_GET_DATA_ACK, data_type, data, length)
41#define MT_SET_DATA(data_type, data, length) SEND_BYTES(MT_SET_DATA, data_type, data, length)
42#define MT_SET_DATA_ACK(data_type, data, length) SEND_BYTES(MT_SET_DATA_ACK, data_type, data, length)
43#define MT_SEND_DATA(data_type, data, length) SEND_BYTES(MT_SEND_DATA, data_type, data, length)
44#define MT_SEND_DATA_ACK(data_type, data, length) SEND_BYTES(MT_SEND_DATA_ACK, data_type, data, length)
45#define MT_EXE_ACTION(data_type, data, length) SEND_BYTES(MT_EXE_ACTION, data_type, data, length)
46#define MT_EXE_ACTION_ACK(data_type, data, length) SEND_BYTES(MT_EXE_ACTION_ACK, data_type, data, length)
47
48void process_api(uint16_t length, uint8_t * data);
49
50__attribute__ ((weak))
51bool process_api_quantum(uint8_t length, uint8_t * data);
52
53__attribute__ ((weak))
54bool process_api_keyboard(uint8_t length, uint8_t * data);
55
56__attribute__ ((weak))
57bool process_api_user(uint8_t length, uint8_t * data);
58
59#endif \ No newline at end of file
diff --git a/quantum/api/api_sysex.c b/quantum/api/api_sysex.c
new file mode 100644
index 000000000..a4a554e76
--- /dev/null
+++ b/quantum/api/api_sysex.c
@@ -0,0 +1,29 @@
1#include "api_sysex.h"
2
3void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint16_t length) {
4 // SEND_STRING("\nTX: ");
5 // for (uint8_t i = 0; i < length; i++) {
6 // send_byte(bytes[i]);
7 // SEND_STRING(" ");
8 // }
9 uint8_t * precode = malloc(sizeof(uint8_t) * (length + 2));
10 precode[0] = message_type;
11 precode[1] = data_type;
12 memcpy(precode + 2, bytes, length);
13 uint8_t * encoded = malloc(sizeof(uint8_t) * (sysex_encoded_length(length + 2)));
14 uint16_t encoded_length = sysex_encode(encoded, precode, length + 2);
15 uint8_t * array = malloc(sizeof(uint8_t) * (encoded_length + 5));
16 array[0] = 0xF0;
17 array[1] = 0x00;
18 array[2] = 0x00;
19 array[3] = 0x00;
20 array[encoded_length + 4] = 0xF7;
21 memcpy(array + 4, encoded, encoded_length);
22 midi_send_array(&midi_device, encoded_length + 5, array);
23
24 // SEND_STRING("\nTD: ");
25 // for (uint8_t i = 0; i < encoded_length + 5; i++) {
26 // send_byte(array[i]);
27 // SEND_STRING(" ");
28 // }
29} \ No newline at end of file
diff --git a/quantum/api/api_sysex.h b/quantum/api/api_sysex.h
new file mode 100644
index 000000000..b947b60e5
--- /dev/null
+++ b/quantum/api/api_sysex.h
@@ -0,0 +1,10 @@
1#ifndef _API_SYSEX_H_
2#define _API_SYSEX_H_
3
4#include "api.h"
5
6void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes, uint16_t length);
7
8#define SEND_BYTES(mt, dt, b, l) send_bytes_sysex(mt, dt, b, l)
9
10#endif \ No newline at end of file
diff --git a/quantum/config_common.h b/quantum/config_common.h
index 8ed5f4a10..17c11faeb 100644
--- a/quantum/config_common.h
+++ b/quantum/config_common.h
@@ -5,55 +5,56 @@
5#define COL2ROW 0 5#define COL2ROW 0
6#define ROW2COL 1 6#define ROW2COL 1
7/* I/O pins */ 7/* I/O pins */
8#define B0 0x30 8#ifndef F0
9#define B1 0x31 9 #define B0 0x30
10#define B2 0x32 10 #define B1 0x31
11#define B3 0x33 11 #define B2 0x32
12#define B4 0x34 12 #define B3 0x33
13#define B5 0x35 13 #define B4 0x34
14#define B6 0x36 14 #define B5 0x35
15#define B7 0x37 15 #define B6 0x36
16#define C0 0x60 16 #define B7 0x37
17#define C1 0x61 17 #define C0 0x60
18#define C2 0x62 18 #define C1 0x61
19#define C3 0x63 19 #define C2 0x62
20#define C4 0x64 20 #define C3 0x63
21#define C5 0x65 21 #define C4 0x64
22#define C6 0x66 22 #define C5 0x65
23#define C7 0x67 23 #define C6 0x66
24#define D0 0x90 24 #define C7 0x67
25#define D1 0x91 25 #define D0 0x90
26#define D2 0x92 26 #define D1 0x91
27#define D3 0x93 27 #define D2 0x92
28#define D4 0x94 28 #define D3 0x93
29#define D5 0x95 29 #define D4 0x94
30#define D6 0x96 30 #define D5 0x95
31#define D7 0x97 31 #define D6 0x96
32#define E0 0xC0 32 #define D7 0x97
33#define E1 0xC1 33 #define E0 0xC0
34#define E2 0xC2 34 #define E1 0xC1
35#define E3 0xC3 35 #define E2 0xC2
36#define E4 0xC4 36 #define E3 0xC3
37#define E5 0xC5 37 #define E4 0xC4
38#define E6 0xC6 38 #define E5 0xC5
39#define E7 0xC7 39 #define E6 0xC6
40#define F0 0xF0 40 #define E7 0xC7
41#define F1 0xF1 41 #define F0 0xF0
42#define F2 0xF2 42 #define F1 0xF1
43#define F3 0xF3 43 #define F2 0xF2
44#define F4 0xF4 44 #define F3 0xF3
45#define F5 0xF5 45 #define F4 0xF4
46#define F6 0xF6 46 #define F5 0xF5
47#define F7 0xF7 47 #define F6 0xF6
48#define A0 0x00 48 #define F7 0xF7
49#define A1 0x01 49 #define A0 0x00
50#define A2 0x02 50 #define A1 0x01
51#define A3 0x03 51 #define A2 0x02
52#define A4 0x04 52 #define A3 0x03
53#define A5 0x05 53 #define A4 0x04
54#define A6 0x06 54 #define A5 0x05
55#define A7 0x07 55 #define A6 0x06
56 56 #define A7 0x07
57#endif
57 58
58/* USART configuration */ 59/* USART configuration */
59#ifdef BLUETOOTH_ENABLE 60#ifdef BLUETOOTH_ENABLE
@@ -76,53 +77,7 @@
76 } while(0) 77 } while(0)
77# else 78# else
78# error "USART configuration is needed." 79# error "USART configuration is needed."
79#endif 80# endif
80
81// I'm fairly sure these aren't needed, but oh well - Jack
82
83/*
84 * PS/2 Interrupt configuration
85 */
86#ifdef PS2_USE_INT
87/* uses INT1 for clock line(ATMega32U4) */
88#define PS2_CLOCK_PORT PORTD
89#define PS2_CLOCK_PIN PIND
90#define PS2_CLOCK_DDR DDRD
91#define PS2_CLOCK_BIT 1
92
93#define PS2_DATA_PORT PORTD
94#define PS2_DATA_PIN PIND
95#define PS2_DATA_DDR DDRD
96#define PS2_DATA_BIT 0
97
98#define PS2_INT_INIT() do { \
99 EICRA |= ((1<<ISC11) | \
100 (0<<ISC10)); \
101} while (0)
102#define PS2_INT_ON() do { \
103 EIMSK |= (1<<INT1); \
104} while (0)
105#define PS2_INT_OFF() do { \
106 EIMSK &= ~(1<<INT1); \
107} while (0)
108#define PS2_INT_VECT INT1_vect
109#endif
110
111/*
112 * PS/2 Busywait configuration
113 */
114#ifdef PS2_USE_BUSYWAIT
115#define PS2_CLOCK_PORT PORTD
116#define PS2_CLOCK_PIN PIND
117#define PS2_CLOCK_DDR DDRD
118#define PS2_CLOCK_BIT 1
119
120#define PS2_DATA_PORT PORTD
121#define PS2_DATA_PIN PIND
122#define PS2_DATA_DDR DDRD
123#define PS2_DATA_BIT 0
124#endif
125
126#endif 81#endif
127 82
128#endif 83#endif
diff --git a/quantum/keymap.h b/quantum/keymap.h
index a01bbfbd1..ae56d16c7 100644
--- a/quantum/keymap.h
+++ b/quantum/keymap.h
@@ -178,6 +178,10 @@ enum quantum_keycodes {
178 // Right shift, close paren 178 // Right shift, close paren
179 KC_RSPC, 179 KC_RSPC,
180 180
181 // Printing
182 PRINT_ON,
183 PRINT_OFF,
184
181 // always leave at the end 185 // always leave at the end
182 SAFE_RANGE 186 SAFE_RANGE
183}; 187};
diff --git a/quantum/keymap_extras/keymap_jp.h b/quantum/keymap_extras/keymap_jp.h
new file mode 100644
index 000000000..e81b5952e
--- /dev/null
+++ b/quantum/keymap_extras/keymap_jp.h
@@ -0,0 +1,62 @@
1/* JP106-layout (Japanese Standard)
2 *
3 * For more information, see
4 * http://www2d.biglobe.ne.jp/~msyk/keyboard/layout/usbkeycode.html
5 * note: This website is written in Japanese.
6 */
7
8
9#ifndef KEYMAP_JP_H
10#define KEYMAP_JP_H
11
12
13#include "keymap.h"
14
15
16#define JP_ZHTG KC_GRV // hankaku/zenkaku|kanzi
17#define JP_YEN KC_INT3 // yen, |
18#define JP_CIRC KC_EQL // ^, ~
19#define JP_AT KC_LBRC // @, `
20#define JP_LBRC KC_RBRC // [, {
21#define JP_COLN KC_QUOT // :, *
22#define JP_RBRC KC_NUHS // ], }
23#define JP_BSLS KC_INT1 // \, _
24#define JP_MHEN KC_INT5 // muhenkan
25#define JP_HENK KC_INT4 // henkan
26#define JP_KANA KC_INT2 // katakana/hiragana|ro-mazi
27
28
29//Aliases for shifted symbols
30#define JP_DQT LSFT(KC_2) // "
31#define JP_AMPR LSFT(KC_6) // &
32#define JP_QUOT LSFT(KC_7) // '
33#define JP_LPRN LSFT(KC_8) // (
34#define JP_RPRN LSFT(KC_9) // )
35#define JP_EQL LSFT(KC_MINS) // =
36#define JP_TILD LSFT(JP_CIRC) // ~
37#define JP_PIPE LSFT(JP_YEN) // |
38#define JP_GRV LSFT(JP_AT) // `
39#define JP_LCBR LSFT(JP_LBRC) // {
40#define JP_PLUS LSFT(KC_SCLN) // +
41#define JP_ASTR LSFT(JP_COLN) // *
42#define JP_RCBR LSFT(JP_RBRC) // }
43#define JP_UNDS LSFT(JP_BSLS) // _
44
45
46// These symbols are correspond to US101-layout.
47#define JP_MINS KC_MINS // -
48#define JP_SCLN KC_SCLN // ;
49#define JP_COMM KC_COMM // ,
50#define JP_DOT KC_DOT // .
51#define JP_SLSH KC_SLSH // /
52// shifted
53#define JP_EXLM KC_EXLM // !
54#define JP_HASH KC_HASH // #
55#define JP_DLR KC_DLR // $
56#define JP_PERC KC_PERC // %
57#define JP_LT KC_LT // <
58#define JP_GT KC_GT // >
59#define JP_QUES KC_QUES // ?
60
61
62#endif
diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h
index da5c82975..9b0ef35ca 100644
--- a/quantum/keymap_extras/keymap_nordic.h
+++ b/quantum/keymap_extras/keymap_nordic.h
@@ -13,7 +13,7 @@
13#define NO_ACUT KC_EQL 13#define NO_ACUT KC_EQL
14 14
15#define NO_AM KC_LBRC 15#define NO_AM KC_LBRC
16#define NO_QUOT KC_RBRC 16#define NO_QUOT KC_RBRC // this is the "umlaut" char on Nordic keyboards, Apple layout
17#define NO_AE KC_SCLN 17#define NO_AE KC_SCLN
18#define NO_OSLH KC_QUOT 18#define NO_OSLH KC_QUOT
19#define NO_APOS KC_NUHS 19#define NO_APOS KC_NUHS
diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c
index 401845e85..a883b1388 100755
--- a/quantum/light_ws2812.c
+++ b/quantum/light_ws2812.c
@@ -16,14 +16,128 @@
16#include <util/delay.h> 16#include <util/delay.h>
17#include "debug.h" 17#include "debug.h"
18 18
19#ifdef RGBW_BB_TWI
20
21// Port for the I2C
22#define I2C_DDR DDRD
23#define I2C_PIN PIND
24#define I2C_PORT PORTD
25
26// Pins to be used in the bit banging
27#define I2C_CLK 0
28#define I2C_DAT 1
29
30#define I2C_DATA_HI()\
31I2C_DDR &= ~ (1 << I2C_DAT);\
32I2C_PORT |= (1 << I2C_DAT);
33#define I2C_DATA_LO()\
34I2C_DDR |= (1 << I2C_DAT);\
35I2C_PORT &= ~ (1 << I2C_DAT);
36
37#define I2C_CLOCK_HI()\
38I2C_DDR &= ~ (1 << I2C_CLK);\
39I2C_PORT |= (1 << I2C_CLK);
40#define I2C_CLOCK_LO()\
41I2C_DDR |= (1 << I2C_CLK);\
42I2C_PORT &= ~ (1 << I2C_CLK);
43
44#define I2C_DELAY 1
45
46void I2C_WriteBit(unsigned char c)
47{
48 if (c > 0)
49 {
50 I2C_DATA_HI();
51 }
52 else
53 {
54 I2C_DATA_LO();
55 }
56
57 I2C_CLOCK_HI();
58 _delay_us(I2C_DELAY);
59
60 I2C_CLOCK_LO();
61 _delay_us(I2C_DELAY);
62
63 if (c > 0)
64 {
65 I2C_DATA_LO();
66 }
67
68 _delay_us(I2C_DELAY);
69}
70
71// Inits bitbanging port, must be called before using the functions below
72//
73void I2C_Init()
74{
75 I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));
76
77 I2C_CLOCK_HI();
78 I2C_DATA_HI();
79
80 _delay_us(I2C_DELAY);
81}
82
83// Send a START Condition
84//
85void I2C_Start()
86{
87 // set both to high at the same time
88 I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));
89 _delay_us(I2C_DELAY);
90
91 I2C_DATA_LO();
92 _delay_us(I2C_DELAY);
93
94 I2C_CLOCK_LO();
95 _delay_us(I2C_DELAY);
96}
97
98// Send a STOP Condition
99//
100void I2C_Stop()
101{
102 I2C_CLOCK_HI();
103 _delay_us(I2C_DELAY);
104
105 I2C_DATA_HI();
106 _delay_us(I2C_DELAY);
107}
108
109// write a byte to the I2C slave device
110//
111unsigned char I2C_Write(unsigned char c)
112{
113 for (char i = 0; i < 8; i++)
114 {
115 I2C_WriteBit(c & 128);
116
117 c <<= 1;
118 }
119
120
121 I2C_WriteBit(0);
122 _delay_us(I2C_DELAY);
123 _delay_us(I2C_DELAY);
124
125 // _delay_us(I2C_DELAY);
126 //return I2C_ReadBit();
127 return 0;
128}
129
130
131#endif
132
19// Setleds for standard RGB 133// Setleds for standard RGB
20void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) 134void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds)
21{ 135{
22 // ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); 136 // ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin));
23 ws2812_setleds_pin(ledarray,leds, _BV(RGB_DI_PIN & 0xF)); 137 ws2812_setleds_pin(ledarray,leds, _BV(RGB_DI_PIN & 0xF));
24} 138}
25 139
26void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask) 140void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask)
27{ 141{
28 // ws2812_DDRREG |= pinmask; // Enable DDR 142 // ws2812_DDRREG |= pinmask; // Enable DDR
29 // new universal format (DDR) 143 // new universal format (DDR)
@@ -34,14 +148,41 @@ void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pin
34} 148}
35 149
36// Setleds for SK6812RGBW 150// Setleds for SK6812RGBW
37void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) 151void inline ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t leds)
38{ 152{
153
154 #ifdef RGBW_BB_TWI
155 uint8_t sreg_prev, twcr_prev;
156 sreg_prev=SREG;
157 twcr_prev=TWCR;
158 cli();
159 TWCR &= ~(1<<TWEN);
160 I2C_Init();
161 I2C_Start();
162 I2C_Write(0x84);
163 uint16_t datlen = leds<<2;
164 uint8_t curbyte;
165 uint8_t * data = (uint8_t*)ledarray;
166 while (datlen--) {
167 curbyte=*data++;
168 I2C_Write(curbyte);
169 }
170 I2C_Stop();
171 SREG=sreg_prev;
172 TWCR=twcr_prev;
173 #endif
174
175
39 // ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR 176 // ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR
40 // new universal format (DDR) 177 // new universal format (DDR)
41 _SFR_IO8((RGB_DI_PIN >> 4) + 1) |= _BV(RGB_DI_PIN & 0xF); 178 _SFR_IO8((RGB_DI_PIN >> 4) + 1) |= _BV(RGB_DI_PIN & 0xF);
42 179
43 ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(RGB_DI_PIN & 0xF)); 180 ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(RGB_DI_PIN & 0xF));
44 _delay_us(80); 181
182
183 #ifndef RGBW_BB_TWI
184 _delay_us(80);
185 #endif
45} 186}
46 187
47void ws2812_sendarray(uint8_t *data,uint16_t datlen) 188void ws2812_sendarray(uint8_t *data,uint16_t datlen)
@@ -123,7 +264,7 @@ void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi)
123 cli(); 264 cli();
124 265
125 while (datlen--) { 266 while (datlen--) {
126 curbyte=*data++; 267 curbyte=(*data++);
127 268
128 asm volatile( 269 asm volatile(
129 " ldi %0,8 \n\t" 270 " ldi %0,8 \n\t"
diff --git a/quantum/light_ws2812.h b/quantum/light_ws2812.h
index 54eef22d9..9498e550e 100755
--- a/quantum/light_ws2812.h
+++ b/quantum/light_ws2812.h
@@ -16,6 +16,21 @@
16#include <avr/io.h> 16#include <avr/io.h>
17#include <avr/interrupt.h> 17#include <avr/interrupt.h>
18//#include "ws2812_config.h" 18//#include "ws2812_config.h"
19//#include "i2cmaster.h"
20
21#define LIGHT_I2C 1
22#define LIGHT_I2C_ADDR 0x84
23#define LIGHT_I2C_ADDR_WRITE ( (LIGHT_I2C_ADDR<<1) | I2C_WRITE )
24#define LIGHT_I2C_ADDR_READ ( (LIGHT_I2C_ADDR<<1) | I2C_READ )
25
26#define RGBW 1
27
28#ifdef RGBW
29 #define LED_TYPE struct cRGBW
30#else
31 #define LED_TYPE struct cRGB
32#endif
33
19 34
20/* 35/*
21 * Structure of the LED array 36 * Structure of the LED array
@@ -42,9 +57,9 @@ struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;};
42 * - Wait 50�s to reset the LEDs 57 * - Wait 50�s to reset the LEDs
43 */ 58 */
44 59
45void ws2812_setleds (struct cRGB *ledarray, uint16_t number_of_leds); 60void ws2812_setleds (LED_TYPE *ledarray, uint16_t number_of_leds);
46void ws2812_setleds_pin (struct cRGB *ledarray, uint16_t number_of_leds,uint8_t pinmask); 61void ws2812_setleds_pin (LED_TYPE *ledarray, uint16_t number_of_leds,uint8_t pinmask);
47void ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t number_of_leds); 62void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
48 63
49/* 64/*
50 * Old interface / Internal functions 65 * Old interface / Internal functions
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 3174e0739..07eb87bc3 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -25,37 +25,65 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
25#include "debug.h" 25#include "debug.h"
26#include "util.h" 26#include "util.h"
27#include "matrix.h" 27#include "matrix.h"
28#include "timer.h"
29
28 30
29/* Set 0 if debouncing isn't needed */ 31/* Set 0 if debouncing isn't needed */
30 32
31#ifndef DEBOUNCING_DELAY 33#ifndef DEBOUNCING_DELAY
32# define DEBOUNCING_DELAY 5 34# define DEBOUNCING_DELAY 5
33#endif 35#endif
34static uint8_t debouncing = DEBOUNCING_DELAY; 36
37#if (DEBOUNCING_DELAY > 0)
38 static uint16_t debouncing_time;
39 static bool debouncing = false;
40#endif
41
42#if (MATRIX_COLS <= 8)
43# define print_matrix_header() print("\nr/c 01234567\n")
44# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
45# define matrix_bitpop(i) bitpop(matrix[i])
46# define ROW_SHIFTER ((uint8_t)1)
47#elif (MATRIX_COLS <= 16)
48# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
49# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
50# define matrix_bitpop(i) bitpop16(matrix[i])
51# define ROW_SHIFTER ((uint16_t)1)
52#elif (MATRIX_COLS <= 32)
53# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
54# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
55# define matrix_bitpop(i) bitpop32(matrix[i])
56# define ROW_SHIFTER ((uint32_t)1)
57#endif
58
59#ifdef MATRIX_MASKED
60 extern const matrix_row_t matrix_mask[];
61#endif
35 62
36static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; 63static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
37static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; 64static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
38 65
39/* matrix state(1:on, 0:off) */ 66/* matrix state(1:on, 0:off) */
40static matrix_row_t matrix[MATRIX_ROWS]; 67static matrix_row_t matrix[MATRIX_ROWS];
68
69static matrix_row_t matrix_raw[MATRIX_ROWS];
41static matrix_row_t matrix_debouncing[MATRIX_ROWS]; 70static matrix_row_t matrix_debouncing[MATRIX_ROWS];
42 71
43#if DIODE_DIRECTION == ROW2COL
44 static matrix_row_t matrix_reversed[MATRIX_COLS];
45 static matrix_row_t matrix_reversed_debouncing[MATRIX_COLS];
46#endif
47 72
48#if MATRIX_COLS > 16 73#if (DIODE_DIRECTION == COL2ROW)
49 #define SHIFTER 1UL 74 static void init_cols(void);
50#else 75 static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
51 #define SHIFTER 1 76 static void unselect_rows(void);
77 static void select_row(uint8_t row);
78 static void unselect_row(uint8_t row);
79#else // ROW2COL
80 static void init_rows(void);
81 static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
82 static void unselect_cols(void);
83 static void unselect_col(uint8_t col);
84 static void select_col(uint8_t col);
52#endif 85#endif
53 86
54static matrix_row_t read_cols(void);
55static void init_cols(void);
56static void unselect_rows(void);
57static void select_row(uint8_t row);
58
59__attribute__ ((weak)) 87__attribute__ ((weak))
60void matrix_init_quantum(void) { 88void matrix_init_quantum(void) {
61 matrix_init_kb(); 89 matrix_init_kb();
@@ -95,7 +123,7 @@ uint8_t matrix_cols(void) {
95} 123}
96 124
97// void matrix_power_up(void) { 125// void matrix_power_up(void) {
98// #if DIODE_DIRECTION == COL2ROW 126// #if (DIODE_DIRECTION == COL2ROW)
99// for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { 127// for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
100// /* DDRxn */ 128// /* DDRxn */
101// _SFR_IO8((row_pins[r] >> 4) + 1) |= _BV(row_pins[r] & 0xF); 129// _SFR_IO8((row_pins[r] >> 4) + 1) |= _BV(row_pins[r] & 0xF);
@@ -119,19 +147,26 @@ uint8_t matrix_cols(void) {
119// } 147// }
120 148
121void matrix_init(void) { 149void matrix_init(void) {
150
122 // To use PORTF disable JTAG with writing JTD bit twice within four cycles. 151 // To use PORTF disable JTAG with writing JTD bit twice within four cycles.
123 #ifdef __AVR_ATmega32U4__ 152 #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
124 MCUCR |= _BV(JTD); 153 MCUCR |= _BV(JTD);
125 MCUCR |= _BV(JTD); 154 MCUCR |= _BV(JTD);
126 #endif 155 #endif
127 156
128 // initialize row and col 157 // initialize row and col
158#if (DIODE_DIRECTION == COL2ROW)
129 unselect_rows(); 159 unselect_rows();
130 init_cols(); 160 init_cols();
161#else // ROW2COL
162 unselect_cols();
163 init_rows();
164#endif
131 165
132 // initialize matrix state: all keys off 166 // initialize matrix state: all keys off
133 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 167 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
134 matrix[i] = 0; 168 matrix[i] = 0;
169 matrix_raw[i] = 0;
135 matrix_debouncing[i] = 0; 170 matrix_debouncing[i] = 0;
136 } 171 }
137 172
@@ -141,71 +176,60 @@ void matrix_init(void) {
141uint8_t matrix_scan(void) 176uint8_t matrix_scan(void)
142{ 177{
143 178
144#if DIODE_DIRECTION == COL2ROW 179#if (DIODE_DIRECTION == COL2ROW)
145 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
146 select_row(i);
147 wait_us(30); // without this wait read unstable value.
148 matrix_row_t cols = read_cols();
149 if (matrix_debouncing[i] != cols) {
150 matrix_debouncing[i] = cols;
151 if (debouncing) {
152 debug("bounce!: "); debug_hex(debouncing); debug("\n");
153 }
154 debouncing = DEBOUNCING_DELAY;
155 }
156 unselect_rows();
157 }
158 180
159 if (debouncing) { 181 // Set row, read cols
160 if (--debouncing) { 182 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
161 wait_ms(1); 183# if (DEBOUNCING_DELAY > 0)
162 } else { 184 bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
163 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 185
164 matrix[i] = matrix_debouncing[i]; 186 if (matrix_changed) {
187 debouncing = true;
188 debouncing_time = timer_read();
165 } 189 }
166 } 190
191# else
192 read_cols_on_row(matrix, current_row);
193# endif
194
167 } 195 }
168#else 196
169 for (uint8_t i = 0; i < MATRIX_COLS; i++) { 197#else // ROW2COL
170 select_row(i); 198
171 wait_us(30); // without this wait read unstable value. 199 // Set col, read rows
172 matrix_row_t rows = read_cols(); 200 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
173 if (matrix_reversed_debouncing[i] != rows) { 201# if (DEBOUNCING_DELAY > 0)
174 matrix_reversed_debouncing[i] = rows; 202 bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
175 if (debouncing) { 203 if (matrix_changed) {
176 debug("bounce!: "); debug_hex(debouncing); debug("\n"); 204 debouncing = true;
205 debouncing_time = timer_read();
177 } 206 }
178 debouncing = DEBOUNCING_DELAY; 207# else
179 } 208 read_rows_on_col(matrix, current_col);
180 unselect_rows(); 209# endif
210
181 } 211 }
182 212
183 if (debouncing) { 213#endif
184 if (--debouncing) { 214
185 wait_ms(1); 215# if (DEBOUNCING_DELAY > 0)
186 } else { 216 if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
187 for (uint8_t i = 0; i < MATRIX_COLS; i++) { 217 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
188 matrix_reversed[i] = matrix_reversed_debouncing[i]; 218 matrix[i] = matrix_debouncing[i];
189 } 219 }
220 debouncing = false;
190 } 221 }
191 } 222# endif
192 for (uint8_t y = 0; y < MATRIX_ROWS; y++) {
193 matrix_row_t row = 0;
194 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
195 row |= ((matrix_reversed[x] & (1<<y)) >> y) << x;
196 }
197 matrix[y] = row;
198 }
199#endif
200 223
201 matrix_scan_quantum(); 224 matrix_scan_quantum();
202
203 return 1; 225 return 1;
204} 226}
205 227
206bool matrix_is_modified(void) 228bool matrix_is_modified(void)
207{ 229{
230#if (DEBOUNCING_DELAY > 0)
208 if (debouncing) return false; 231 if (debouncing) return false;
232#endif
209 return true; 233 return true;
210} 234}
211 235
@@ -218,15 +242,22 @@ bool matrix_is_on(uint8_t row, uint8_t col)
218inline 242inline
219matrix_row_t matrix_get_row(uint8_t row) 243matrix_row_t matrix_get_row(uint8_t row)
220{ 244{
245 // Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
246 // switch blocker installed and the switch is always pressed.
247#ifdef MATRIX_MASKED
248 return matrix[row] & matrix_mask[row];
249#else
221 return matrix[row]; 250 return matrix[row];
251#endif
222} 252}
223 253
224void matrix_print(void) 254void matrix_print(void)
225{ 255{
226 print("\nr/c 0123456789ABCDEF\n"); 256 print_matrix_header();
257
227 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 258 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
228 phex(row); print(": "); 259 phex(row); print(": ");
229 pbin_reverse16(matrix_get_row(row)); 260 print_matrix_row(row);
230 print("\n"); 261 print("\n");
231 } 262 }
232} 263}
@@ -235,63 +266,148 @@ uint8_t matrix_key_count(void)
235{ 266{
236 uint8_t count = 0; 267 uint8_t count = 0;
237 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 268 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
238 count += bitpop16(matrix[i]); 269 count += matrix_bitpop(i);
239 } 270 }
240 return count; 271 return count;
241} 272}
242 273
274
275
276#if (DIODE_DIRECTION == COL2ROW)
277
243static void init_cols(void) 278static void init_cols(void)
244{ 279{
245#if DIODE_DIRECTION == COL2ROW 280 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
246 for(int x = 0; x < MATRIX_COLS; x++) { 281 uint8_t pin = col_pins[x];
247 int pin = col_pins[x]; 282 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
248#else 283 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
249 for(int x = 0; x < MATRIX_ROWS; x++) {
250 int pin = row_pins[x];
251#endif
252 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF);
253 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
254 } 284 }
255} 285}
256 286
257static matrix_row_t read_cols(void) 287static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
258{ 288{
259 matrix_row_t result = 0; 289 // Store last value of row prior to reading
290 matrix_row_t last_row_value = current_matrix[current_row];
260 291
261#if DIODE_DIRECTION == COL2ROW 292 // Clear data in matrix row
262 for(int x = 0; x < MATRIX_COLS; x++) { 293 current_matrix[current_row] = 0;
263 int pin = col_pins[x]; 294
264#else 295 // Select row and wait for row selecton to stabilize
265 for(int x = 0; x < MATRIX_ROWS; x++) { 296 select_row(current_row);
266 int pin = row_pins[x]; 297 wait_us(30);
267#endif 298
268 result |= (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)) ? 0 : (SHIFTER << x); 299 // For each col...
300 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
301
302 // Select the col pin to read (active low)
303 uint8_t pin = col_pins[col_index];
304 uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
305
306 // Populate the matrix row with the state of the col pin
307 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
269 } 308 }
270 return result; 309
310 // Unselect row
311 unselect_row(current_row);
312
313 return (last_row_value != current_matrix[current_row]);
314}
315
316static void select_row(uint8_t row)
317{
318 uint8_t pin = row_pins[row];
319 _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
320 _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
321}
322
323static void unselect_row(uint8_t row)
324{
325 uint8_t pin = row_pins[row];
326 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
327 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
271} 328}
272 329
273static void unselect_rows(void) 330static void unselect_rows(void)
274{ 331{
275#if DIODE_DIRECTION == COL2ROW 332 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
276 for(int x = 0; x < MATRIX_ROWS; x++) { 333 uint8_t pin = row_pins[x];
277 int pin = row_pins[x]; 334 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
278#else 335 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
279 for(int x = 0; x < MATRIX_COLS; x++) {
280 int pin = col_pins[x];
281#endif
282 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF);
283 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
284 } 336 }
285} 337}
286 338
287static void select_row(uint8_t row) 339#else // ROW2COL
340
341static void init_rows(void)
288{ 342{
343 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
344 uint8_t pin = row_pins[x];
345 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
346 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
347 }
348}
289 349
290#if DIODE_DIRECTION == COL2ROW 350static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
291 int pin = row_pins[row]; 351{
292#else 352 bool matrix_changed = false;
293 int pin = col_pins[row]; 353
294#endif 354 // Select col and wait for col selecton to stabilize
295 _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); 355 select_col(current_col);
296 _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); 356 wait_us(30);
357
358 // For each row...
359 for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
360 {
361
362 // Store last value of row prior to reading
363 matrix_row_t last_row_value = current_matrix[row_index];
364
365 // Check row pin state
366 if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
367 {
368 // Pin LO, set col bit
369 current_matrix[row_index] |= (ROW_SHIFTER << current_col);
370 }
371 else
372 {
373 // Pin HI, clear col bit
374 current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
375 }
376
377 // Determine if the matrix changed state
378 if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
379 {
380 matrix_changed = true;
381 }
382 }
383
384 // Unselect col
385 unselect_col(current_col);
386
387 return matrix_changed;
297} 388}
389
390static void select_col(uint8_t col)
391{
392 uint8_t pin = col_pins[col];
393 _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
394 _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
395}
396
397static void unselect_col(uint8_t col)
398{
399 uint8_t pin = col_pins[col];
400 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
401 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
402}
403
404static void unselect_cols(void)
405{
406 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
407 uint8_t pin = col_pins[x];
408 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
409 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
410 }
411}
412
413#endif
diff --git a/quantum/pincontrol.h b/quantum/pincontrol.h
new file mode 100644
index 000000000..36ce29ef2
--- /dev/null
+++ b/quantum/pincontrol.h
@@ -0,0 +1,37 @@
1#pragma once
2// Some helpers for controlling gpio pins
3#include <avr/io.h>
4
5enum {
6 PinDirectionInput = 0,
7 PinDirectionOutput = 1,
8 PinLevelHigh = 1,
9 PinLevelLow = 0,
10};
11
12// ex: pinMode(B0, PinDirectionOutput);
13static inline void pinMode(uint8_t pin, int mode) {
14 uint8_t bv = _BV(pin & 0xf);
15 if (mode == PinDirectionOutput) {
16 _SFR_IO8((pin >> 4) + 1) |= bv;
17 } else {
18 _SFR_IO8((pin >> 4) + 1) &= ~bv;
19 _SFR_IO8((pin >> 4) + 2) &= ~bv;
20 }
21}
22
23// ex: digitalWrite(B0, PinLevelHigh);
24static inline void digitalWrite(uint8_t pin, int mode) {
25 uint8_t bv = _BV(pin & 0xf);
26 if (mode == PinLevelHigh) {
27 _SFR_IO8((pin >> 4) + 2) |= bv;
28 } else {
29 _SFR_IO8((pin >> 4) + 2) &= ~bv;
30 }
31}
32
33// Return true if the pin is HIGH
34// digitalRead(B0)
35static inline bool digitalRead(uint8_t pin) {
36 return _SFR_IO8(pin >> 4) & _BV(pin & 0xf);
37}
diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c
new file mode 100644
index 000000000..2e11dd366
--- /dev/null
+++ b/quantum/process_keycode/process_printer.c
@@ -0,0 +1,254 @@
1#include "process_printer.h"
2#include "action_util.h"
3
4bool printing_enabled = false;
5uint8_t character_shift = 0;
6
7void enabled_printing() {
8 printing_enabled = true;
9 serial_init();
10}
11
12void disable_printing() {
13 printing_enabled = false;
14}
15
16uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29};
17
18// uint8_t keycode_to_ascii[0xFF][2];
19
20// keycode_to_ascii[KC_MINS] = {0x2D, 0x5F};
21
22void print_char(char c) {
23 USB_Disable();
24 serial_send(c);
25 USB_Init();
26}
27
28void print_box_string(uint8_t text[]) {
29 uint8_t len = strlen(text);
30 uint8_t out[len * 3 + 8];
31 out[0] = 0xDA;
32 for (uint8_t i = 0; i < len; i++) {
33 out[i+1] = 0xC4;
34 }
35 out[len + 1] = 0xBF;
36 out[len + 2] = '\n';
37
38 out[len + 3] = 0xB3;
39 for (uint8_t i = 0; i < len; i++) {
40 out[len + 4 + i] = text[i];
41 }
42 out[len * 2 + 4] = 0xB3;
43 out[len * 2 + 5] = '\n';
44
45
46 out[len * 2 + 6] = 0xC0;
47 for (uint8_t i = 0; i < len; i++) {
48 out[len * 2 + 7 + i] = 0xC4;
49 }
50 out[len * 3 + 7] = 0xD9;
51 out[len * 3 + 8] = '\n';
52
53 print_string(out);
54}
55
56void print_string(char c[]) {
57 for(uint8_t i = 0; i < strlen(c); i++)
58 print_char(c[i]);
59}
60
61bool process_printer(uint16_t keycode, keyrecord_t *record) {
62 if (keycode == PRINT_ON) {
63 enabled_printing();
64 return false;
65 }
66 if (keycode == PRINT_OFF) {
67 disable_printing();
68 return false;
69 }
70
71 if (printing_enabled) {
72 switch(keycode) {
73 case KC_EXLM ... KC_RPRN:
74 case KC_UNDS:
75 case KC_PLUS:
76 case KC_LCBR:
77 case KC_RCBR:
78 case KC_PIPE:
79 case KC_TILD:
80 keycode &= 0xFF;
81 case KC_LSFT:
82 case KC_RSFT:
83 if (record->event.pressed) {
84 character_shift++;
85 } else {
86 character_shift--;
87 }
88 return false;
89 break;
90 }
91
92 switch(keycode) {
93 case KC_F1:
94 if (record->event.pressed) {
95 print_box_string("This is a line of text!");
96 }
97 return false;
98 case KC_ESC:
99 if (record->event.pressed) {
100 print_char(0x1B);
101 }
102 return false;
103 break;
104 case KC_SPC:
105 if (record->event.pressed) {
106 print_char(0x20);
107 }
108 return false;
109 break;
110 case KC_A ... KC_Z:
111 if (record->event.pressed) {
112 if (character_shift) {
113 print_char(0x41 + (keycode - KC_A));
114 } else {
115 print_char(0x61 + (keycode - KC_A));
116 }
117 }
118 return false;
119 break;
120 case KC_1 ... KC_0:
121 if (record->event.pressed) {
122 if (character_shift) {
123 print_char(shifted_numbers[keycode - KC_1]);
124 } else {
125 print_char(0x30 + ((keycode - KC_1 + 1) % 10));
126 }
127 }
128 return false;
129 break;
130 case KC_ENT:
131 if (record->event.pressed) {
132 if (character_shift) {
133 print_char(0x0C);
134 } else {
135 print_char(0x0A);
136 }
137 }
138 return false;
139 break;
140 case KC_BSPC:
141 if (record->event.pressed) {
142 if (character_shift) {
143 print_char(0x18);
144 } else {
145 print_char(0x1A);
146 }
147 }
148 return false;
149 break;
150 case KC_DOT:
151 if (record->event.pressed) {
152 if (character_shift) {
153 print_char(0x3E);
154 } else {
155 print_char(0x2E);
156 }
157 }
158 return false;
159 break;
160 case KC_COMM:
161 if (record->event.pressed) {
162 if (character_shift) {
163 print_char(0x3C);
164 } else {
165 print_char(0x2C);
166 }
167 }
168 return false;
169 break;
170 case KC_SLSH:
171 if (record->event.pressed) {
172 if (character_shift) {
173 print_char(0x3F);
174 } else {
175 print_char(0x2F);
176 }
177 }
178 return false;
179 break;
180 case KC_QUOT:
181 if (record->event.pressed) {
182 if (character_shift) {
183 print_char(0x22);
184 } else {
185 print_char(0x27);
186 }
187 }
188 return false;
189 break;
190 case KC_GRV:
191 if (record->event.pressed) {
192 if (character_shift) {
193 print_char(0x7E);
194 } else {
195 print_char(0x60);
196 }
197 }
198 return false;
199 break;
200 case KC_MINS:
201 if (record->event.pressed) {
202 if (character_shift) {
203 print_char(0x5F);
204 } else {
205 print_char(0x2D);
206 }
207 }
208 return false;
209 break;
210 case KC_EQL:
211 if (record->event.pressed) {
212 if (character_shift) {
213 print_char(0x2B);
214 } else {
215 print_char(0x3D);
216 }
217 }
218 return false;
219 break;
220 case KC_LBRC:
221 if (record->event.pressed) {
222 if (character_shift) {
223 print_char(0x7B);
224 } else {
225 print_char(0x5B);
226 }
227 }
228 return false;
229 break;
230 case KC_RBRC:
231 if (record->event.pressed) {
232 if (character_shift) {
233 print_char(0x7D);
234 } else {
235 print_char(0x5D);
236 }
237 }
238 return false;
239 break;
240 case KC_BSLS:
241 if (record->event.pressed) {
242 if (character_shift) {
243 print_char(0x7C);
244 } else {
245 print_char(0x5C);
246 }
247 }
248 return false;
249 break;
250 }
251 }
252 return true;
253
254} \ No newline at end of file
diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h
new file mode 100644
index 000000000..fdd36d75a
--- /dev/null
+++ b/quantum/process_keycode/process_printer.h
@@ -0,0 +1,8 @@
1#ifndef PROCESS_PRINTER_H
2#define PROCESS_PRINTER_H
3
4#include "quantum.h"
5
6#include "protocol/serial.h"
7
8#endif \ No newline at end of file
diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c
new file mode 100644
index 000000000..1924d0377
--- /dev/null
+++ b/quantum/process_keycode/process_printer_bb.c
@@ -0,0 +1,260 @@
1#include "process_printer.h"
2#include "action_util.h"
3
4bool printing_enabled = false;
5uint8_t character_shift = 0;
6
7#define SERIAL_PIN_DDR DDRD
8#define SERIAL_PIN_PORT PORTD
9#define SERIAL_PIN_MASK _BV(PD3)
10#define SERIAL_DELAY 52
11
12inline static
13void serial_delay(void) {
14 _delay_us(SERIAL_DELAY);
15}
16
17inline static
18void serial_high(void) {
19 SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
20}
21
22inline static
23void serial_low(void) {
24 SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
25}
26
27inline static
28void serial_output(void) {
29 SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
30}
31
32
33void enabled_printing() {
34 printing_enabled = true;
35 serial_output();
36 serial_high();
37}
38
39void disable_printing() {
40 printing_enabled = false;
41}
42
43uint8_t shifted_numbers[10] = {0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29};
44
45// uint8_t keycode_to_ascii[0xFF][2];
46
47// keycode_to_ascii[KC_MINS] = {0x2D, 0x5F};
48
49void print_char(char c) {
50 uint8_t b = 8;
51 serial_output();
52 while( b-- ) {
53 if(c & (1 << b)) {
54 serial_high();
55 } else {
56 serial_low();
57 }
58 serial_delay();
59 }
60}
61
62void print_string(char c[]) {
63 for(uint8_t i = 0; i < strlen(c); i++)
64 print_char(c[i]);
65}
66
67bool process_printer(uint16_t keycode, keyrecord_t *record) {
68 if (keycode == PRINT_ON) {
69 enabled_printing();
70 return false;
71 }
72 if (keycode == PRINT_OFF) {
73 disable_printing();
74 return false;
75 }
76
77 if (printing_enabled) {
78 switch(keycode) {
79 case KC_EXLM ... KC_RPRN:
80 case KC_UNDS:
81 case KC_PLUS:
82 case KC_LCBR:
83 case KC_RCBR:
84 case KC_PIPE:
85 case KC_TILD:
86 keycode &= 0xFF;
87 case KC_LSFT:
88 case KC_RSFT:
89 if (record->event.pressed) {
90 character_shift++;
91 } else {
92 character_shift--;
93 }
94 return false;
95 break;
96 }
97
98 switch(keycode) {
99 case KC_F1:
100 if (record->event.pressed) {
101 print_string("This is a line of text!\n\n\n");
102 }
103 return false;
104 case KC_ESC:
105 if (record->event.pressed) {
106 print_char(0x1B);
107 }
108 return false;
109 break;
110 case KC_SPC:
111 if (record->event.pressed) {
112 print_char(0x20);
113 }
114 return false;
115 break;
116 case KC_A ... KC_Z:
117 if (record->event.pressed) {
118 if (character_shift) {
119 print_char(0x41 + (keycode - KC_A));
120 } else {
121 print_char(0x61 + (keycode - KC_A));
122 }
123 }
124 return false;
125 break;
126 case KC_1 ... KC_0:
127 if (record->event.pressed) {
128 if (character_shift) {
129 print_char(shifted_numbers[keycode - KC_1]);
130 } else {
131 print_char(0x30 + ((keycode - KC_1 + 1) % 10));
132 }
133 }
134 return false;
135 break;
136 case KC_ENT:
137 if (record->event.pressed) {
138 if (character_shift) {
139 print_char(0x0C);
140 } else {
141 print_char(0x0A);
142 }
143 }
144 return false;
145 break;
146 case KC_BSPC:
147 if (record->event.pressed) {
148 if (character_shift) {
149 print_char(0x18);
150 } else {
151 print_char(0x1A);
152 }
153 }
154 return false;
155 break;
156 case KC_DOT:
157 if (record->event.pressed) {
158 if (character_shift) {
159 print_char(0x3E);
160 } else {
161 print_char(0x2E);
162 }
163 }
164 return false;
165 break;
166 case KC_COMM:
167 if (record->event.pressed) {
168 if (character_shift) {
169 print_char(0x3C);
170 } else {
171 print_char(0x2C);
172 }
173 }
174 return false;
175 break;
176 case KC_SLSH:
177 if (record->event.pressed) {
178 if (character_shift) {
179 print_char(0x3F);
180 } else {
181 print_char(0x2F);
182 }
183 }
184 return false;
185 break;
186 case KC_QUOT:
187 if (record->event.pressed) {
188 if (character_shift) {
189 print_char(0x22);
190 } else {
191 print_char(0x27);
192 }
193 }
194 return false;
195 break;
196 case KC_GRV:
197 if (record->event.pressed) {
198 if (character_shift) {
199 print_char(0x7E);
200 } else {
201 print_char(0x60);
202 }
203 }
204 return false;
205 break;
206 case KC_MINS:
207 if (record->event.pressed) {
208 if (character_shift) {
209 print_char(0x5F);
210 } else {
211 print_char(0x2D);
212 }
213 }
214 return false;
215 break;
216 case KC_EQL:
217 if (record->event.pressed) {
218 if (character_shift) {
219 print_char(0x2B);
220 } else {
221 print_char(0x3D);
222 }
223 }
224 return false;
225 break;
226 case KC_LBRC:
227 if (record->event.pressed) {
228 if (character_shift) {
229 print_char(0x7B);
230 } else {
231 print_char(0x5B);
232 }
233 }
234 return false;
235 break;
236 case KC_RBRC:
237 if (record->event.pressed) {
238 if (character_shift) {
239 print_char(0x7D);
240 } else {
241 print_char(0x5D);
242 }
243 }
244 return false;
245 break;
246 case KC_BSLS:
247 if (record->event.pressed) {
248 if (character_shift) {
249 print_char(0x7C);
250 } else {
251 print_char(0x5C);
252 }
253 }
254 return false;
255 break;
256 }
257 }
258 return true;
259
260} \ No newline at end of file
diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h
index 065eeb5f6..f17cfa6cf 100644
--- a/quantum/process_keycode/process_unicode.h
+++ b/quantum/process_keycode/process_unicode.h
@@ -22,6 +22,7 @@ void register_hex(uint16_t hex);
22bool process_unicode(uint16_t keycode, keyrecord_t *record); 22bool process_unicode(uint16_t keycode, keyrecord_t *record);
23 23
24#ifdef UNICODEMAP_ENABLE 24#ifdef UNICODEMAP_ENABLE
25void unicode_map_input_error(void);
25bool process_unicode_map(uint16_t keycode, keyrecord_t *record); 26bool process_unicode_map(uint16_t keycode, keyrecord_t *record);
26#endif 27#endif
27 28
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 098312e6e..f653564a6 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -1,5 +1,9 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3#ifndef TAPPING_TERM
4#define TAPPING_TERM 200
5#endif
6
3static void do_code16 (uint16_t code, void (*f) (uint8_t)) { 7static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
4 switch (code) { 8 switch (code) {
5 case QK_MODS ... QK_MODS_MAX: 9 case QK_MODS ... QK_MODS_MAX:
@@ -75,6 +79,7 @@ void reset_keyboard(void) {
75#endif 79#endif
76 80
77static bool shift_interrupted[2] = {0, 0}; 81static bool shift_interrupted[2] = {0, 0};
82static uint16_t scs_timer = 0;
78 83
79bool process_record_quantum(keyrecord_t *record) { 84bool process_record_quantum(keyrecord_t *record) {
80 85
@@ -129,6 +134,9 @@ bool process_record_quantum(keyrecord_t *record) {
129 #ifdef UCIS_ENABLE 134 #ifdef UCIS_ENABLE
130 process_ucis(keycode, record) && 135 process_ucis(keycode, record) &&
131 #endif 136 #endif
137 #ifdef PRINTING_ENABLE
138 process_printer(keycode, record) &&
139 #endif
132 #ifdef UNICODEMAP_ENABLE 140 #ifdef UNICODEMAP_ENABLE
133 process_unicode_map(keycode, record) && 141 process_unicode_map(keycode, record) &&
134 #endif 142 #endif
@@ -283,6 +291,7 @@ bool process_record_quantum(keyrecord_t *record) {
283 case KC_LSPO: { 291 case KC_LSPO: {
284 if (record->event.pressed) { 292 if (record->event.pressed) {
285 shift_interrupted[0] = false; 293 shift_interrupted[0] = false;
294 scs_timer = timer_read ();
286 register_mods(MOD_BIT(KC_LSFT)); 295 register_mods(MOD_BIT(KC_LSFT));
287 } 296 }
288 else { 297 else {
@@ -292,7 +301,7 @@ bool process_record_quantum(keyrecord_t *record) {
292 shift_interrupted[1] = true; 301 shift_interrupted[1] = true;
293 } 302 }
294 #endif 303 #endif
295 if (!shift_interrupted[0]) { 304 if (!shift_interrupted[0] && timer_elapsed(scs_timer) < TAPPING_TERM) {
296 register_code(LSPO_KEY); 305 register_code(LSPO_KEY);
297 unregister_code(LSPO_KEY); 306 unregister_code(LSPO_KEY);
298 } 307 }
@@ -305,6 +314,7 @@ bool process_record_quantum(keyrecord_t *record) {
305 case KC_RSPC: { 314 case KC_RSPC: {
306 if (record->event.pressed) { 315 if (record->event.pressed) {
307 shift_interrupted[1] = false; 316 shift_interrupted[1] = false;
317 scs_timer = timer_read ();
308 register_mods(MOD_BIT(KC_RSFT)); 318 register_mods(MOD_BIT(KC_RSFT));
309 } 319 }
310 else { 320 else {
@@ -314,7 +324,7 @@ bool process_record_quantum(keyrecord_t *record) {
314 shift_interrupted[1] = true; 324 shift_interrupted[1] = true;
315 } 325 }
316 #endif 326 #endif
317 if (!shift_interrupted[1]) { 327 if (!shift_interrupted[1] && timer_elapsed(scs_timer) < TAPPING_TERM) {
318 register_code(RSPC_KEY); 328 register_code(RSPC_KEY);
319 unregister_code(RSPC_KEY); 329 unregister_code(RSPC_KEY);
320 } 330 }
@@ -799,6 +809,51 @@ void backlight_set(uint8_t level)
799#endif // backlight 809#endif // backlight
800 810
801 811
812// Functions for spitting out values
813//
814
815void send_dword(uint32_t number) { // this might not actually work
816 uint16_t word = (number >> 16);
817 send_word(word);
818 send_word(number & 0xFFFFUL);
819}
820
821void send_word(uint16_t number) {
822 uint8_t byte = number >> 8;
823 send_byte(byte);
824 send_byte(number & 0xFF);
825}
826
827void send_byte(uint8_t number) {
828 uint8_t nibble = number >> 4;
829 send_nibble(nibble);
830 send_nibble(number & 0xF);
831}
832
833void send_nibble(uint8_t number) {
834 switch (number) {
835 case 0:
836 register_code(KC_0);
837 unregister_code(KC_0);
838 break;
839 case 1 ... 9:
840 register_code(KC_1 + (number - 1));
841 unregister_code(KC_1 + (number - 1));
842 break;
843 case 0xA ... 0xF:
844 register_code(KC_A + (number - 0xA));
845 unregister_code(KC_A + (number - 0xA));
846 break;
847 }
848}
849
850void api_send_unicode(uint32_t unicode) {
851#ifdef API_ENABLE
852 uint8_t chunk[4];
853 dword_to_bytes(unicode, chunk);
854 MT_SEND_DATA(DT_UNICODE, chunk, 5);
855#endif
856}
802 857
803__attribute__ ((weak)) 858__attribute__ ((weak))
804void led_set_user(uint8_t usb_led) { 859void led_set_user(uint8_t usb_led) {
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 0c6046649..e6adf974a 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -59,6 +59,10 @@ extern uint32_t default_layer_state;
59 59
60#include "process_tap_dance.h" 60#include "process_tap_dance.h"
61 61
62#ifdef PRINTING_ENABLE
63 #include "process_printer.h"
64#endif
65
62#define SEND_STRING(str) send_string(PSTR(str)) 66#define SEND_STRING(str) send_string(PSTR(str))
63void send_string(const char *str); 67void send_string(const char *str);
64 68
@@ -106,8 +110,15 @@ void breathing_speed_dec(uint8_t value);
106#endif 110#endif
107 111
108#endif 112#endif
113void send_dword(uint32_t number);
114void send_word(uint16_t number);
115void send_byte(uint8_t number);
116void send_nibble(uint8_t number);
117
109 118
110void led_set_user(uint8_t usb_led); 119void led_set_user(uint8_t usb_led);
111void led_set_kb(uint8_t usb_led); 120void led_set_kb(uint8_t usb_led);
112 121
122void api_send_unicode(uint32_t unicode);
123
113#endif 124#endif
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index d550c5866..625971e0f 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -69,11 +69,12 @@ const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20};
69 69
70rgblight_config_t rgblight_config; 70rgblight_config_t rgblight_config;
71rgblight_config_t inmem_config; 71rgblight_config_t inmem_config;
72struct cRGB led[RGBLED_NUM];
73uint8_t rgblight_inited = 0;
74 72
73LED_TYPE led[RGBLED_NUM];
74uint8_t rgblight_inited = 0;
75bool rgblight_timer_enabled = false;
75 76
76void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { 77void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
77 uint8_t r = 0, g = 0, b = 0, base, color; 78 uint8_t r = 0, g = 0, b = 0, base, color;
78 79
79 if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. 80 if (sat == 0) { // Acromatic color (gray). Hue doesn't mind.
@@ -124,7 +125,7 @@ void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) {
124 setrgb(r, g, b, led1); 125 setrgb(r, g, b, led1);
125} 126}
126 127
127void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1) { 128void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) {
128 (*led1).r = r; 129 (*led1).r = r;
129 (*led1).g = g; 130 (*led1).g = g;
130 (*led1).b = b; 131 (*led1).b = b;
@@ -141,9 +142,9 @@ void eeconfig_update_rgblight_default(void) {
141 dprintf("eeconfig_update_rgblight_default\n"); 142 dprintf("eeconfig_update_rgblight_default\n");
142 rgblight_config.enable = 1; 143 rgblight_config.enable = 1;
143 rgblight_config.mode = 1; 144 rgblight_config.mode = 1;
144 rgblight_config.hue = 200; 145 rgblight_config.hue = 0;
145 rgblight_config.sat = 204; 146 rgblight_config.sat = 255;
146 rgblight_config.val = 204; 147 rgblight_config.val = 255;
147 eeconfig_update_rgblight(rgblight_config.raw); 148 eeconfig_update_rgblight(rgblight_config.raw);
148} 149}
149void eeconfig_debug_rgblight(void) { 150void eeconfig_debug_rgblight(void) {
@@ -173,7 +174,7 @@ void rgblight_init(void) {
173 } 174 }
174 eeconfig_debug_rgblight(); // display current eeprom values 175 eeconfig_debug_rgblight(); // display current eeprom values
175 176
176 #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) 177 #ifdef RGBLIGHT_ANIMATIONS
177 rgblight_timer_init(); // setup the timer 178 rgblight_timer_init(); // setup the timer
178 #endif 179 #endif
179 180
@@ -182,6 +183,19 @@ void rgblight_init(void) {
182 } 183 }
183} 184}
184 185
186void rgblight_update_dword(uint32_t dword) {
187 rgblight_config.raw = dword;
188 eeconfig_update_rgblight(rgblight_config.raw);
189 if (rgblight_config.enable)
190 rgblight_mode(rgblight_config.mode);
191 else {
192 #ifdef RGBLIGHT_ANIMATIONS
193 rgblight_timer_disable();
194 #endif
195 rgblight_set();
196 }
197}
198
185void rgblight_increase(void) { 199void rgblight_increase(void) {
186 uint8_t mode = 0; 200 uint8_t mode = 0;
187 if (rgblight_config.mode < RGBLIGHT_MODES) { 201 if (rgblight_config.mode < RGBLIGHT_MODES) {
@@ -220,7 +234,7 @@ void rgblight_mode(uint8_t mode) {
220 eeconfig_update_rgblight(rgblight_config.raw); 234 eeconfig_update_rgblight(rgblight_config.raw);
221 xprintf("rgblight mode: %u\n", rgblight_config.mode); 235 xprintf("rgblight mode: %u\n", rgblight_config.mode);
222 if (rgblight_config.mode == 1) { 236 if (rgblight_config.mode == 1) {
223 #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) 237 #ifdef RGBLIGHT_ANIMATIONS
224 rgblight_timer_disable(); 238 rgblight_timer_disable();
225 #endif 239 #endif
226 } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { 240 } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) {
@@ -230,7 +244,7 @@ void rgblight_mode(uint8_t mode) {
230 // MODE 15-20, snake 244 // MODE 15-20, snake
231 // MODE 21-23, knight 245 // MODE 21-23, knight
232 246
233 #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) 247 #ifdef RGBLIGHT_ANIMATIONS
234 rgblight_timer_enable(); 248 rgblight_timer_enable();
235 #endif 249 #endif
236 } 250 }
@@ -244,7 +258,7 @@ void rgblight_toggle(void) {
244 if (rgblight_config.enable) { 258 if (rgblight_config.enable) {
245 rgblight_mode(rgblight_config.mode); 259 rgblight_mode(rgblight_config.mode);
246 } else { 260 } else {
247 #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) 261 #ifdef RGBLIGHT_ANIMATIONS
248 rgblight_timer_disable(); 262 rgblight_timer_disable();
249 #endif 263 #endif
250 _delay_ms(50); 264 _delay_ms(50);
@@ -252,6 +266,13 @@ void rgblight_toggle(void) {
252 } 266 }
253} 267}
254 268
269void rgblight_enable(void) {
270 rgblight_config.enable = 1;
271 eeconfig_update_rgblight(rgblight_config.raw);
272 xprintf("rgblight enable: rgblight_config.enable = %u\n", rgblight_config.enable);
273 rgblight_mode(rgblight_config.mode);
274}
275
255 276
256void rgblight_increase_hue(void) { 277void rgblight_increase_hue(void) {
257 uint16_t hue; 278 uint16_t hue;
@@ -307,7 +328,7 @@ void rgblight_decrease_val(void) {
307void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { 328void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) {
308 inmem_config.raw = rgblight_config.raw; 329 inmem_config.raw = rgblight_config.raw;
309 if (rgblight_config.enable) { 330 if (rgblight_config.enable) {
310 struct cRGB tmp_led; 331 LED_TYPE tmp_led;
311 sethsv(hue, sat, val, &tmp_led); 332 sethsv(hue, sat, val, &tmp_led);
312 inmem_config.hue = hue; 333 inmem_config.hue = hue;
313 inmem_config.sat = sat; 334 inmem_config.sat = sat;
@@ -351,66 +372,84 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) {
351 372
352void rgblight_set(void) { 373void rgblight_set(void) {
353 if (rgblight_config.enable) { 374 if (rgblight_config.enable) {
354 ws2812_setleds(led, RGBLED_NUM); 375 #ifdef RGBW
376 ws2812_setleds_rgbw(led, RGBLED_NUM);
377 #else
378 ws2812_setleds(led, RGBLED_NUM);
379 #endif
355 } else { 380 } else {
356 for (uint8_t i = 0; i < RGBLED_NUM; i++) { 381 for (uint8_t i = 0; i < RGBLED_NUM; i++) {
357 led[i].r = 0; 382 led[i].r = 0;
358 led[i].g = 0; 383 led[i].g = 0;
359 led[i].b = 0; 384 led[i].b = 0;
360 } 385 }
361 ws2812_setleds(led, RGBLED_NUM); 386 #ifdef RGBW
387 ws2812_setleds_rgbw(led, RGBLED_NUM);
388 #else
389 ws2812_setleds(led, RGBLED_NUM);
390 #endif
362 } 391 }
363} 392}
364 393
365#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) 394#ifdef RGBLIGHT_ANIMATIONS
366 395
367// Animation timer -- AVR Timer3 396// Animation timer -- AVR Timer3
368void rgblight_timer_init(void) { 397void rgblight_timer_init(void) {
369 static uint8_t rgblight_timer_is_init = 0; 398 // static uint8_t rgblight_timer_is_init = 0;
370 if (rgblight_timer_is_init) { 399 // if (rgblight_timer_is_init) {
371 return; 400 // return;
372 } 401 // }
373 rgblight_timer_is_init = 1; 402 // rgblight_timer_is_init = 1;
374 /* Timer 3 setup */ 403 // /* Timer 3 setup */
375 TCCR3B = _BV(WGM32) //CTC mode OCR3A as TOP 404 // TCCR3B = _BV(WGM32) // CTC mode OCR3A as TOP
376 | _BV(CS30); //Clock selelct: clk/1 405 // | _BV(CS30); // Clock selelct: clk/1
377 /* Set TOP value */ 406 // /* Set TOP value */
378 uint8_t sreg = SREG; 407 // uint8_t sreg = SREG;
379 cli(); 408 // cli();
380 OCR3AH = (RGBLED_TIMER_TOP >> 8) & 0xff; 409 // OCR3AH = (RGBLED_TIMER_TOP >> 8) & 0xff;
381 OCR3AL = RGBLED_TIMER_TOP & 0xff; 410 // OCR3AL = RGBLED_TIMER_TOP & 0xff;
382 SREG = sreg; 411 // SREG = sreg;
412
413 rgblight_timer_enabled = true;
383} 414}
384void rgblight_timer_enable(void) { 415void rgblight_timer_enable(void) {
385 TIMSK3 |= _BV(OCIE3A); 416 rgblight_timer_enabled = true;
386 dprintf("TIMER3 enabled.\n"); 417 dprintf("TIMER3 enabled.\n");
387} 418}
388void rgblight_timer_disable(void) { 419void rgblight_timer_disable(void) {
389 TIMSK3 &= ~_BV(OCIE3A); 420 rgblight_timer_enabled = false;
390 dprintf("TIMER3 disabled.\n"); 421 dprintf("TIMER3 disabled.\n");
391} 422}
392void rgblight_timer_toggle(void) { 423void rgblight_timer_toggle(void) {
393 TIMSK3 ^= _BV(OCIE3A); 424 rgblight_timer_enabled ^= rgblight_timer_enabled;
394 dprintf("TIMER3 toggled.\n"); 425 dprintf("TIMER3 toggled.\n");
395} 426}
396 427
397ISR(TIMER3_COMPA_vect) { 428void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b) {
398 // mode = 1, static light, do nothing here 429 rgblight_enable();
399 if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { 430 rgblight_mode(1);
400 // mode = 2 to 5, breathing mode 431 rgblight_setrgb(r, g, b);
401 rgblight_effect_breathing(rgblight_config.mode - 2); 432}
402 } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) { 433
403 // mode = 6 to 8, rainbow mood mod 434void rgblight_task(void) {
404 rgblight_effect_rainbow_mood(rgblight_config.mode - 6); 435 if (rgblight_timer_enabled) {
405 } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) { 436 // mode = 1, static light, do nothing here
406 // mode = 9 to 14, rainbow swirl mode 437 if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) {
407 rgblight_effect_rainbow_swirl(rgblight_config.mode - 9); 438 // mode = 2 to 5, breathing mode
408 } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) { 439 rgblight_effect_breathing(rgblight_config.mode - 2);
409 // mode = 15 to 20, snake mode 440 } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) {
410 rgblight_effect_snake(rgblight_config.mode - 15); 441 // mode = 6 to 8, rainbow mood mod
411 } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { 442 rgblight_effect_rainbow_mood(rgblight_config.mode - 6);
412 // mode = 21 to 23, knight mode 443 } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) {
413 rgblight_effect_knight(rgblight_config.mode - 21); 444 // mode = 9 to 14, rainbow swirl mode
445 rgblight_effect_rainbow_swirl(rgblight_config.mode - 9);
446 } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) {
447 // mode = 15 to 20, snake mode
448 rgblight_effect_snake(rgblight_config.mode - 15);
449 } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) {
450 // mode = 21 to 23, knight mode
451 rgblight_effect_knight(rgblight_config.mode - 21);
452 }
414 } 453 }
415} 454}
416 455
@@ -449,7 +488,7 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) {
449 last_timer = timer_read(); 488 last_timer = timer_read();
450 for (i = 0; i < RGBLED_NUM; i++) { 489 for (i = 0; i < RGBLED_NUM; i++) {
451 hue = (360 / RGBLED_NUM * i + current_hue) % 360; 490 hue = (360 / RGBLED_NUM * i + current_hue) % 360;
452 sethsv(hue, rgblight_config.sat, rgblight_config.val, &led[i]); 491 sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]);
453 } 492 }
454 rgblight_set(); 493 rgblight_set();
455 494
@@ -486,7 +525,7 @@ void rgblight_effect_snake(uint8_t interval) {
486 k = k + RGBLED_NUM; 525 k = k + RGBLED_NUM;
487 } 526 }
488 if (i == k) { 527 if (i == k) {
489 sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val*(RGBLIGHT_EFFECT_SNAKE_LENGTH-j)/RGBLIGHT_EFFECT_SNAKE_LENGTH), &led[i]); 528 sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val*(RGBLIGHT_EFFECT_SNAKE_LENGTH-j)/RGBLIGHT_EFFECT_SNAKE_LENGTH), (LED_TYPE *)&led[i]);
490 } 529 }
491 } 530 }
492 } 531 }
@@ -506,7 +545,7 @@ void rgblight_effect_knight(uint8_t interval) {
506 static uint16_t last_timer = 0; 545 static uint16_t last_timer = 0;
507 uint8_t i, j, cur; 546 uint8_t i, j, cur;
508 int8_t k; 547 int8_t k;
509 struct cRGB preled[RGBLED_NUM]; 548 LED_TYPE preled[RGBLED_NUM];
510 static int8_t increment = -1; 549 static int8_t increment = -1;
511 if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { 550 if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) {
512 return; 551 return;
@@ -525,7 +564,7 @@ void rgblight_effect_knight(uint8_t interval) {
525 k = RGBLED_NUM - 1; 564 k = RGBLED_NUM - 1;
526 } 565 }
527 if (i == k) { 566 if (i == k) {
528 sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); 567 sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&preled[i]);
529 } 568 }
530 } 569 }
531 } 570 }
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index 17f04ffcf..aa1d026e0 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -1,8 +1,7 @@
1#ifndef RGBLIGHT_H 1#ifndef RGBLIGHT_H
2#define RGBLIGHT_H 2#define RGBLIGHT_H
3 3
4 4#ifdef RGBLIGHT_ANIMATIONS
5#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER)
6 #define RGBLIGHT_MODES 23 5 #define RGBLIGHT_MODES 23
7#else 6#else
8 #define RGBLIGHT_MODES 1 7 #define RGBLIGHT_MODES 1
@@ -34,6 +33,7 @@
34#endif 33#endif
35 34
36#define RGBLED_TIMER_TOP F_CPU/(256*64) 35#define RGBLED_TIMER_TOP F_CPU/(256*64)
36// #define RGBLED_TIMER_TOP 0xFF10
37 37
38#include <stdint.h> 38#include <stdint.h>
39#include <stdbool.h> 39#include <stdbool.h>
@@ -61,9 +61,11 @@ void rgblight_init(void);
61void rgblight_increase(void); 61void rgblight_increase(void);
62void rgblight_decrease(void); 62void rgblight_decrease(void);
63void rgblight_toggle(void); 63void rgblight_toggle(void);
64void rgblight_enable(void);
64void rgblight_step(void); 65void rgblight_step(void);
65void rgblight_mode(uint8_t mode); 66void rgblight_mode(uint8_t mode);
66void rgblight_set(void); 67void rgblight_set(void);
68void rgblight_update_dword(uint32_t dword);
67void rgblight_increase_hue(void); 69void rgblight_increase_hue(void);
68void rgblight_decrease_hue(void); 70void rgblight_decrease_hue(void);
69void rgblight_increase_sat(void); 71void rgblight_increase_sat(void);
@@ -78,10 +80,15 @@ void eeconfig_update_rgblight(uint32_t val);
78void eeconfig_update_rgblight_default(void); 80void eeconfig_update_rgblight_default(void);
79void eeconfig_debug_rgblight(void); 81void eeconfig_debug_rgblight(void);
80 82
81void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1); 83void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
82void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1); 84void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1);
83void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); 85void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
84 86
87#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF)
88void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b);
89
90void rgblight_task(void);
91
85void rgblight_timer_init(void); 92void rgblight_timer_init(void);
86void rgblight_timer_enable(void); 93void rgblight_timer_enable(void);
87void rgblight_timer_disable(void); 94void rgblight_timer_disable(void);
diff --git a/readme.md b/readme.md
index 4eed2c776..be1510832 100644
--- a/readme.md
+++ b/readme.md
@@ -241,6 +241,7 @@ You can also add extra options at the end of the make command line, after the ta
241* `make COLOR=false` - turns off color output 241* `make COLOR=false` - turns off color output
242* `make SILENT=true` - turns off output besides errors/warnings 242* `make SILENT=true` - turns off output besides errors/warnings
243* `make VERBOSE=true` - outputs all of the gcc stuff (not interesting, unless you need to debug) 243* `make VERBOSE=true` - outputs all of the gcc stuff (not interesting, unless you need to debug)
244* `make EXTRAFLAGS=-E` - Preprocess the code without doing any compiling (useful if you are trying to debug #define commands)
244 245
245The 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. 246The 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.
246 247
@@ -347,6 +348,10 @@ This allows you output audio on the C6 pin (needs abstracting). See the [audio s
347 348
348Use this to debug changes to variable values, see the [tracing variables](#tracing-variables) section for more information. 349Use this to debug changes to variable values, see the [tracing variables](#tracing-variables) section for more information.
349 350
351`API_SYSEX_ENABLE`
352
353This enables using the Quantum SYSEX API to send strings (somewhere?)
354
350### Customizing Makefile options on a per-keymap basis 355### Customizing Makefile options on a per-keymap basis
351 356
352If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard. 357If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard.
@@ -910,7 +915,33 @@ In `quantum/keymap_extras/`, you'll see various language files - these work the
910 915
911## Unicode support 916## Unicode support
912 917
913You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout, see [this article](http://www.poynton.com/notes/misc/mac-unicode-hex-input.html) to learn more) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile. 918There are three Unicode keymap definition method available in QMK:
919
920### UNICODE_ENABLE
921
922Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
923keymap file, where *n* is a 4 digit hexadecimal.
924
925### UNICODEMAP_ENABLE
926
927Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
928table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file.
929The keycode function is `X(n)` where *n* is the array index of the mapping
930table.
931
932### UCIS_ENABLE
933
934TBD
935
936Unicode input in QMK works by inputing a sequence of characters to the OS,
937sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted.
938
939This is the current list of Unicode input method in QMK:
940
941* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
942* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
943* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
944* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
914 945
915## Backlight Breathing 946## Backlight Breathing
916 947
@@ -1135,12 +1166,12 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring
1135 1166
1136 RGBLIGHT_ENABLE = yes 1167 RGBLIGHT_ENABLE = yes
1137 1168
1138In order to use the underglow timer functions, you need to have `#define RGBLIGHT_TIMER` in your `config.h`, and have audio disabled (`AUDIO_ENABLE = no` in your Makefile). 1169In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`.
1139 1170
1140Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: 1171Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default:
1141 1172
1142 #define RGB_DI_PIN F4 // The pin your RGB strip is wired to 1173 #define RGB_DI_PIN F4 // The pin your RGB strip is wired to
1143 #define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) 1174 #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio)
1144 #define RGBLED_NUM 14 // Number of LEDs 1175 #define RGBLED_NUM 14 // Number of LEDs
1145 #define RGBLIGHT_HUE_STEP 10 1176 #define RGBLIGHT_HUE_STEP 10
1146 #define RGBLIGHT_SAT_STEP 17 1177 #define RGBLIGHT_SAT_STEP 17
@@ -1156,20 +1187,165 @@ The firmware supports 5 different light effects, and the color (hue, saturation,
1156 1187
1157Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. 1188Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
1158 1189
1190## PS/2 Mouse Support
1191
1192Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device.
1193
1194Then, decide whether to use USART (best), interrupts (better) or busywait (not recommended), and enable the relevant option.
1195
1196### Busywait version
1197
1198Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible.
1199
1200In rules.mk:
1201
1202```
1203PS2_MOUSE_ENABLE = yes
1204PS2_USE_BUSYWAIT = yes
1205```
1206
1207In your keyboard config.h:
1208
1209```
1210#ifdef PS2_USE_BUSYWAIT
1211# define PS2_CLOCK_PORT PORTD
1212# define PS2_CLOCK_PIN PIND
1213# define PS2_CLOCK_DDR DDRD
1214# define PS2_CLOCK_BIT 1
1215# define PS2_DATA_PORT PORTD
1216# define PS2_DATA_PIN PIND
1217# define PS2_DATA_DDR DDRD
1218# define PS2_DATA_BIT 2
1219#endif
1220```
1221
1222### Interrupt version
1223
1224The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data.
1225
1226In rules.mk:
1227
1228```
1229PS2_MOUSE_ENABLE = yes
1230PS2_USE_INT = yes
1231```
1232
1233In your keyboard config.h:
1234
1235```
1236#ifdef PS2_USE_INT
1237#define PS2_CLOCK_PORT PORTD
1238#define PS2_CLOCK_PIN PIND
1239#define PS2_CLOCK_DDR DDRD
1240#define PS2_CLOCK_BIT 2
1241#define PS2_DATA_PORT PORTD
1242#define PS2_DATA_PIN PIND
1243#define PS2_DATA_DDR DDRD
1244#define PS2_DATA_BIT 5
1245
1246#define PS2_INT_INIT() do { \
1247 EICRA |= ((1<<ISC21) | \
1248 (0<<ISC20)); \
1249} while (0)
1250#define PS2_INT_ON() do { \
1251 EIMSK |= (1<<INT2); \
1252} while (0)
1253#define PS2_INT_OFF() do { \
1254 EIMSK &= ~(1<<INT2); \
1255} while (0)
1256#define PS2_INT_VECT INT2_vect
1257#endif
1258```
1259
1260### USART version
1261
1262To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version.
1263
1264In rules.mk:
1265
1266```
1267PS2_MOUSE_ENABLE = yes
1268PS2_USE_USART = yes
1269```
1270
1271In your keyboard config.h:
1272
1273```
1274#ifdef PS2_USE_USART
1275#define PS2_CLOCK_PORT PORTD
1276#define PS2_CLOCK_PIN PIND
1277#define PS2_CLOCK_DDR DDRD
1278#define PS2_CLOCK_BIT 5
1279#define PS2_DATA_PORT PORTD
1280#define PS2_DATA_PIN PIND
1281#define PS2_DATA_DDR DDRD
1282#define PS2_DATA_BIT 2
1283
1284/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
1285/* set DDR of CLOCK as input to be slave */
1286#define PS2_USART_INIT() do { \
1287 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
1288 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
1289 UCSR1C = ((1 << UMSEL10) | \
1290 (3 << UPM10) | \
1291 (0 << USBS1) | \
1292 (3 << UCSZ10) | \
1293 (0 << UCPOL1)); \
1294 UCSR1A = 0; \
1295 UBRR1H = 0; \
1296 UBRR1L = 0; \
1297} while (0)
1298#define PS2_USART_RX_INT_ON() do { \
1299 UCSR1B = ((1 << RXCIE1) | \
1300 (1 << RXEN1)); \
1301} while (0)
1302#define PS2_USART_RX_POLL_ON() do { \
1303 UCSR1B = (1 << RXEN1); \
1304} while (0)
1305#define PS2_USART_OFF() do { \
1306 UCSR1C = 0; \
1307 UCSR1B &= ~((1 << RXEN1) | \
1308 (1 << TXEN1)); \
1309} while (0)
1310#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
1311#define PS2_USART_RX_DATA UDR1
1312#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
1313#define PS2_USART_RX_VECT USART1_RX_vect
1314#endif
1315#endif
1316#endif
1317```
1318
1159## Safety Considerations 1319## Safety Considerations
1160 1320
1161You probably don't want to "brick" your keyboard, making it impossible 1321You probably don't want to "brick" your keyboard, making it impossible
1162to rewrite firmware onto it. Here are some of the parameters to show 1322to rewrite firmware onto it. Here are some of the parameters to show
1163what things are (and likely aren't) too risky. 1323what things are (and likely aren't) too risky.
1164 1324
1165- If a keyboard map does not include RESET, then, to get into DFU 1325- If your keyboard map does not include RESET, then, to get into DFU
1166 mode, you will need to press the reset button on the PCB, which 1326 mode, you will need to press the reset button on the PCB, which
1167 requires unscrewing some bits. 1327 requires unscrewing the bottom.
1168- Messing with tmk_core / common files might make the keyboard 1328- Messing with tmk_core / common files might make the keyboard
1169 inoperable 1329 inoperable
1170- Too large a .hex file is trouble; `make dfu` will erase the block, 1330- Too large a .hex file is trouble; `make dfu` will erase the block,
1171 test the size (oops, wrong order!), which errors out, failing to 1331 test the size (oops, wrong order!), which errors out, failing to
1172 flash the keyboard 1332 flash the keyboard, leaving it in DFU mode.
1333 - To this end, note that the maximum .hex file size on Planck is
1334 7000h (28672 decimal)
1335```Linking: .build/planck_rev4_cbbrowne.elf [OK]
1336Creating load file for Flash: .build/planck_rev4_cbbrowne.hex [OK]
1337
1338Size after:
1339 text data bss dec hex filename
1340 0 22396 0 22396 577c planck_rev4_cbbrowne.hex
1341```
1342 - The above file is of size 22396/577ch, which is less than
1343 28672/7000h
1344 - As long as you have a suitable alternative .hex file around, you
1345 can retry, loading that one
1346 - Some of the options you might specify in your keyboard's Makefile
1347 consume extra memory; watch out for BOOTMAGIC_ENABLE,
1348 MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE
1173- DFU tools do /not/ allow you to write into the bootloader (unless 1349- DFU tools do /not/ allow you to write into the bootloader (unless
1174 you throw in extra fruitsalad of options), so there is little risk 1350 you throw in extra fruitsalad of options), so there is little risk
1175 there. 1351 there.
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index f826a7b54..c32a12bb6 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -81,6 +81,10 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
81 TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE 81 TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
82endif 82endif
83 83
84ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes)
85 TMK_COMMON_DEFS += -DADAFRUIT_BLE_ENABLE
86endif
87
84ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) 88ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
85 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE 89 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
86endif 90endif
@@ -110,4 +114,4 @@ endif
110VPATH += $(TMK_PATH)/$(COMMON_DIR) 114VPATH += $(TMK_PATH)/$(COMMON_DIR)
111ifeq ($(PLATFORM),CHIBIOS) 115ifeq ($(PLATFORM),CHIBIOS)
112VPATH += $(TMK_PATH)/$(COMMON_DIR)/chibios 116VPATH += $(TMK_PATH)/$(COMMON_DIR)/chibios
113endif \ No newline at end of file 117endif
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 8a7272bbc..0c81e8361 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -47,6 +47,7 @@ void suspend_idle(uint8_t time)
47 sleep_disable(); 47 sleep_disable();
48} 48}
49 49
50#ifndef NO_SUSPEND_POWER_DOWN
50/* Power down MCU with watchdog timer 51/* Power down MCU with watchdog timer
51 * wdto: watchdog timer timeout defined in <avr/wdt.h> 52 * wdto: watchdog timer timeout defined in <avr/wdt.h>
52 * WDTO_15MS 53 * WDTO_15MS
@@ -61,6 +62,7 @@ void suspend_idle(uint8_t time)
61 * WDTO_8S 62 * WDTO_8S
62 */ 63 */
63static uint8_t wdt_timeout = 0; 64static uint8_t wdt_timeout = 0;
65
64static void power_down(uint8_t wdto) 66static void power_down(uint8_t wdto)
65{ 67{
66#ifdef PROTOCOL_LUFA 68#ifdef PROTOCOL_LUFA
@@ -98,19 +100,19 @@ static void power_down(uint8_t wdto)
98 // Disable watchdog after sleep 100 // Disable watchdog after sleep
99 wdt_disable(); 101 wdt_disable();
100} 102}
103#endif
101 104
102void suspend_power_down(void) 105void suspend_power_down(void)
103{ 106{
107#ifndef NO_SUSPEND_POWER_DOWN
104 power_down(WDTO_15MS); 108 power_down(WDTO_15MS);
109#endif
105} 110}
106 111
107__attribute__ ((weak)) void matrix_power_up(void) {} 112__attribute__ ((weak)) void matrix_power_up(void) {}
108__attribute__ ((weak)) void matrix_power_down(void) {} 113__attribute__ ((weak)) void matrix_power_down(void) {}
109bool suspend_wakeup_condition(void) 114bool suspend_wakeup_condition(void)
110{ 115{
111#ifdef BACKLIGHT_ENABLE
112 backlight_set(0);
113#endif
114 matrix_power_up(); 116 matrix_power_up();
115 matrix_scan(); 117 matrix_scan();
116 matrix_power_down(); 118 matrix_power_down();
@@ -126,10 +128,9 @@ void suspend_wakeup_init(void)
126 // clear keyboard state 128 // clear keyboard state
127 clear_keyboard(); 129 clear_keyboard();
128#ifdef BACKLIGHT_ENABLE 130#ifdef BACKLIGHT_ENABLE
129 backlight_set(0);
130 backlight_init(); 131 backlight_init();
131#endif 132#endif
132led_set(host_keyboard_leds()); 133 led_set(host_keyboard_leds());
133} 134}
134 135
135#ifndef NO_SUSPEND_POWER_DOWN 136#ifndef NO_SUSPEND_POWER_DOWN
diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c
index 292b41c3a..84af44488 100644
--- a/tmk_core/common/avr/timer.c
+++ b/tmk_core/common/avr/timer.c
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18#include <avr/io.h> 18#include <avr/io.h>
19#include <avr/interrupt.h> 19#include <avr/interrupt.h>
20#include <util/atomic.h>
20#include <stdint.h> 21#include <stdint.h>
21#include "timer_avr.h" 22#include "timer_avr.h"
22#include "timer.h" 23#include "timer.h"
@@ -24,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24 25
25// counter resolution 1ms 26// counter resolution 1ms
26// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }} 27// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }}
27volatile uint32_t timer_count = 0; 28volatile uint32_t timer_count;
28 29
29void timer_init(void) 30void timer_init(void)
30{ 31{
@@ -52,10 +53,9 @@ void timer_init(void)
52inline 53inline
53void timer_clear(void) 54void timer_clear(void)
54{ 55{
55 uint8_t sreg = SREG; 56 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
56 cli();
57 timer_count = 0; 57 timer_count = 0;
58 SREG = sreg; 58 }
59} 59}
60 60
61inline 61inline
@@ -63,10 +63,9 @@ uint16_t timer_read(void)
63{ 63{
64 uint32_t t; 64 uint32_t t;
65 65
66 uint8_t sreg = SREG; 66 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
67 cli(); 67 t = timer_count;
68 t = timer_count; 68 }
69 SREG = sreg;
70 69
71 return (t & 0xFFFF); 70 return (t & 0xFFFF);
72} 71}
@@ -76,10 +75,9 @@ uint32_t timer_read32(void)
76{ 75{
77 uint32_t t; 76 uint32_t t;
78 77
79 uint8_t sreg = SREG; 78 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
80 cli(); 79 t = timer_count;
81 t = timer_count; 80 }
82 SREG = sreg;
83 81
84 return t; 82 return t;
85} 83}
@@ -89,10 +87,9 @@ uint16_t timer_elapsed(uint16_t last)
89{ 87{
90 uint32_t t; 88 uint32_t t;
91 89
92 uint8_t sreg = SREG; 90 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
93 cli(); 91 t = timer_count;
94 t = timer_count; 92 }
95 SREG = sreg;
96 93
97 return TIMER_DIFF_16((t & 0xFFFF), last); 94 return TIMER_DIFF_16((t & 0xFFFF), last);
98} 95}
@@ -102,10 +99,9 @@ uint32_t timer_elapsed32(uint32_t last)
102{ 99{
103 uint32_t t; 100 uint32_t t;
104 101
105 uint8_t sreg = SREG; 102 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
106 cli(); 103 t = timer_count;
107 t = timer_count; 104 }
108 SREG = sreg;
109 105
110 return TIMER_DIFF_32(t, last); 106 return TIMER_DIFF_32(t, last);
111} 107}
diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c
index c9e8fd3fd..0e0ad2d15 100644
--- a/tmk_core/common/backlight.c
+++ b/tmk_core/common/backlight.c
@@ -36,9 +36,9 @@ void backlight_increase(void)
36 if(backlight_config.level < BACKLIGHT_LEVELS) 36 if(backlight_config.level < BACKLIGHT_LEVELS)
37 { 37 {
38 backlight_config.level++; 38 backlight_config.level++;
39 backlight_config.enable = 1;
40 eeconfig_update_backlight(backlight_config.raw);
41 } 39 }
40 backlight_config.enable = 1;
41 eeconfig_update_backlight(backlight_config.raw);
42 dprintf("backlight increase: %u\n", backlight_config.level); 42 dprintf("backlight increase: %u\n", backlight_config.level);
43 backlight_set(backlight_config.level); 43 backlight_set(backlight_config.level);
44} 44}
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c
index f3e1bf623..5f29bc0b4 100644
--- a/tmk_core/common/command.c
+++ b/tmk_core/common/command.c
@@ -379,11 +379,11 @@ static bool command_common(uint8_t code)
379 debug_enable = !debug_enable; 379 debug_enable = !debug_enable;
380 if (debug_enable) { 380 if (debug_enable) {
381 print("\ndebug: on\n"); 381 print("\ndebug: on\n");
382 debug_matrix = true;
383 debug_keyboard = true;
384 debug_mouse = true;
385 } else { 382 } else {
386 print("\ndebug: off\n"); 383 print("\ndebug: off\n");
384 debug_matrix = false;
385 debug_keyboard = false;
386 debug_mouse = false;
387 } 387 }
388 break; 388 break;
389 389
diff --git a/tmk_core/common/host_driver.h b/tmk_core/common/host_driver.h
index edb9e5dd9..588d1c0be 100644
--- a/tmk_core/common/host_driver.h
+++ b/tmk_core/common/host_driver.h
@@ -20,7 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21#include <stdint.h> 21#include <stdint.h>
22#include "report.h" 22#include "report.h"
23 23#ifdef MIDI_ENABLE
24 #include "midi.h"
25#endif
24 26
25typedef struct { 27typedef struct {
26 uint8_t (*keyboard_leds)(void); 28 uint8_t (*keyboard_leds)(void);
@@ -28,6 +30,11 @@ typedef struct {
28 void (*send_mouse)(report_mouse_t *); 30 void (*send_mouse)(report_mouse_t *);
29 void (*send_system)(uint16_t); 31 void (*send_system)(uint16_t);
30 void (*send_consumer)(uint16_t); 32 void (*send_consumer)(uint16_t);
33#ifdef MIDI_ENABLE
34 void (*usb_send_func)(MidiDevice *, uint16_t, uint8_t, uint8_t, uint8_t);
35 void (*usb_get_midi)(MidiDevice *);
36 void (*midi_usb_init)(MidiDevice *);
37#endif
31} host_driver_t; 38} host_driver_t;
32 39
33#endif 40#endif
diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk
index 5b1e3d19d..151d26cbc 100644
--- a/tmk_core/protocol/lufa.mk
+++ b/tmk_core/protocol/lufa.mk
@@ -21,6 +21,10 @@ ifeq ($(strip $(MIDI_ENABLE)), yes)
21 include $(TMK_PATH)/protocol/midi.mk 21 include $(TMK_PATH)/protocol/midi.mk
22endif 22endif
23 23
24ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes)
25 LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
26endif
27
24ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) 28ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
25 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ 29 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
26 $(TMK_DIR)/protocol/serial_uart.c 30 $(TMK_DIR)/protocol/serial_uart.c
diff --git a/tmk_core/protocol/lufa/adafruit_ble.cpp b/tmk_core/protocol/lufa/adafruit_ble.cpp
new file mode 100644
index 000000000..37194e77a
--- /dev/null
+++ b/tmk_core/protocol/lufa/adafruit_ble.cpp
@@ -0,0 +1,805 @@
1#include "adafruit_ble.h"
2#include <stdio.h>
3#include <stdlib.h>
4#include <alloca.h>
5#include <util/delay.h>
6#include <util/atomic.h>
7#include "debug.h"
8#include "pincontrol.h"
9#include "timer.h"
10#include "action_util.h"
11#include "ringbuffer.hpp"
12#include <string.h>
13
14// These are the pin assignments for the 32u4 boards.
15// You may define them to something else in your config.h
16// if yours is wired up differently.
17#ifndef AdafruitBleResetPin
18#define AdafruitBleResetPin D4
19#endif
20
21#ifndef AdafruitBleCSPin
22#define AdafruitBleCSPin B4
23#endif
24
25#ifndef AdafruitBleIRQPin
26#define AdafruitBleIRQPin E6
27#endif
28
29
30#define SAMPLE_BATTERY
31#define ConnectionUpdateInterval 1000 /* milliseconds */
32
33static struct {
34 bool is_connected;
35 bool initialized;
36 bool configured;
37
38#define ProbedEvents 1
39#define UsingEvents 2
40 bool event_flags;
41
42#ifdef SAMPLE_BATTERY
43 uint16_t last_battery_update;
44 uint32_t vbat;
45#endif
46 uint16_t last_connection_update;
47} state;
48
49// Commands are encoded using SDEP and sent via SPI
50// https://github.com/adafruit/Adafruit_BluefruitLE_nRF51/blob/master/SDEP.md
51
52#define SdepMaxPayload 16
53struct sdep_msg {
54 uint8_t type;
55 uint8_t cmd_low;
56 uint8_t cmd_high;
57 struct __attribute__((packed)) {
58 uint8_t len:7;
59 uint8_t more:1;
60 };
61 uint8_t payload[SdepMaxPayload];
62} __attribute__((packed));
63
64// The recv latency is relatively high, so when we're hammering keys quickly,
65// we want to avoid waiting for the responses in the matrix loop. We maintain
66// a short queue for that. Since there is quite a lot of space overhead for
67// the AT command representation wrapped up in SDEP, we queue the minimal
68// information here.
69
70enum queue_type {
71 QTKeyReport, // 1-byte modifier + 6-byte key report
72 QTConsumer, // 16-bit key code
73#ifdef MOUSE_ENABLE
74 QTMouseMove, // 4-byte mouse report
75#endif
76};
77
78struct queue_item {
79 enum queue_type queue_type;
80 uint16_t added;
81 union __attribute__((packed)) {
82 struct __attribute__((packed)) {
83 uint8_t modifier;
84 uint8_t keys[6];
85 } key;
86
87 uint16_t consumer;
88 struct __attribute__((packed)) {
89 uint8_t x, y, scroll, pan;
90 } mousemove;
91 };
92};
93
94// Items that we wish to send
95static RingBuffer<queue_item, 40> send_buf;
96// Pending response; while pending, we can't send any more requests.
97// This records the time at which we sent the command for which we
98// are expecting a response.
99static RingBuffer<uint16_t, 2> resp_buf;
100
101static bool process_queue_item(struct queue_item *item, uint16_t timeout);
102
103enum sdep_type {
104 SdepCommand = 0x10,
105 SdepResponse = 0x20,
106 SdepAlert = 0x40,
107 SdepError = 0x80,
108 SdepSlaveNotReady = 0xfe, // Try again later
109 SdepSlaveOverflow = 0xff, // You read more data than is available
110};
111
112enum ble_cmd {
113 BleInitialize = 0xbeef,
114 BleAtWrapper = 0x0a00,
115 BleUartTx = 0x0a01,
116 BleUartRx = 0x0a02,
117};
118
119enum ble_system_event_bits {
120 BleSystemConnected = 0,
121 BleSystemDisconnected = 1,
122 BleSystemUartRx = 8,
123 BleSystemMidiRx = 10,
124};
125
126// The SDEP.md file says 2MHz but the web page and the sample driver
127// both use 4MHz
128#define SpiBusSpeed 4000000
129
130#define SdepTimeout 150 /* milliseconds */
131#define SdepShortTimeout 10 /* milliseconds */
132#define SdepBackOff 25 /* microseconds */
133#define BatteryUpdateInterval 10000 /* milliseconds */
134
135static bool at_command(const char *cmd, char *resp, uint16_t resplen,
136 bool verbose, uint16_t timeout = SdepTimeout);
137static bool at_command_P(const char *cmd, char *resp, uint16_t resplen,
138 bool verbose = false);
139
140struct SPI_Settings {
141 uint8_t spcr, spsr;
142};
143
144static struct SPI_Settings spi;
145
146// Initialize 4Mhz MSBFIRST MODE0
147void SPI_init(struct SPI_Settings *spi) {
148 spi->spcr = _BV(SPE) | _BV(MSTR);
149 spi->spsr = _BV(SPI2X);
150
151 static_assert(SpiBusSpeed == F_CPU / 2, "hard coded at 4Mhz");
152
153 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
154 // Ensure that SS is OUTPUT High
155 digitalWrite(B0, PinLevelHigh);
156 pinMode(B0, PinDirectionOutput);
157
158 SPCR |= _BV(MSTR);
159 SPCR |= _BV(SPE);
160 pinMode(B1 /* SCK */, PinDirectionOutput);
161 pinMode(B2 /* MOSI */, PinDirectionOutput);
162 }
163}
164
165static inline void SPI_begin(struct SPI_Settings*spi) {
166 SPCR = spi->spcr;
167 SPSR = spi->spsr;
168}
169
170static inline uint8_t SPI_TransferByte(uint8_t data) {
171 SPDR = data;
172 asm volatile("nop");
173 while (!(SPSR & _BV(SPIF))) {
174 ; // wait
175 }
176 return SPDR;
177}
178
179static inline void spi_send_bytes(const uint8_t *buf, uint8_t len) {
180 if (len == 0) return;
181 const uint8_t *end = buf + len;
182 while (buf < end) {
183 SPDR = *buf;
184 while (!(SPSR & _BV(SPIF))) {
185 ; // wait
186 }
187 ++buf;
188 }
189}
190
191static inline uint16_t spi_read_byte(void) {
192 return SPI_TransferByte(0x00 /* dummy */);
193}
194
195static inline void spi_recv_bytes(uint8_t *buf, uint8_t len) {
196 const uint8_t *end = buf + len;
197 if (len == 0) return;
198 while (buf < end) {
199 SPDR = 0; // write a dummy to initiate read
200 while (!(SPSR & _BV(SPIF))) {
201 ; // wait
202 }
203 *buf = SPDR;
204 ++buf;
205 }
206}
207
208#if 0
209static void dump_pkt(const struct sdep_msg *msg) {
210 print("pkt: type=");
211 print_hex8(msg->type);
212 print(" cmd=");
213 print_hex8(msg->cmd_high);
214 print_hex8(msg->cmd_low);
215 print(" len=");
216 print_hex8(msg->len);
217 print(" more=");
218 print_hex8(msg->more);
219 print("\n");
220}
221#endif
222
223// Send a single SDEP packet
224static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) {
225 SPI_begin(&spi);
226
227 digitalWrite(AdafruitBleCSPin, PinLevelLow);
228 uint16_t timerStart = timer_read();
229 bool success = false;
230 bool ready = false;
231
232 do {
233 ready = SPI_TransferByte(msg->type) != SdepSlaveNotReady;
234 if (ready) {
235 break;
236 }
237
238 // Release it and let it initialize
239 digitalWrite(AdafruitBleCSPin, PinLevelHigh);
240 _delay_us(SdepBackOff);
241 digitalWrite(AdafruitBleCSPin, PinLevelLow);
242 } while (timer_elapsed(timerStart) < timeout);
243
244 if (ready) {
245 // Slave is ready; send the rest of the packet
246 spi_send_bytes(&msg->cmd_low,
247 sizeof(*msg) - (1 + sizeof(msg->payload)) + msg->len);
248 success = true;
249 }
250
251 digitalWrite(AdafruitBleCSPin, PinLevelHigh);
252
253 return success;
254}
255
256static inline void sdep_build_pkt(struct sdep_msg *msg, uint16_t command,
257 const uint8_t *payload, uint8_t len,
258 bool moredata) {
259 msg->type = SdepCommand;
260 msg->cmd_low = command & 0xff;
261 msg->cmd_high = command >> 8;
262 msg->len = len;
263 msg->more = (moredata && len == SdepMaxPayload) ? 1 : 0;
264
265 static_assert(sizeof(*msg) == 20, "msg is correctly packed");
266
267 memcpy(msg->payload, payload, len);
268}
269
270// Read a single SDEP packet
271static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) {
272 bool success = false;
273 uint16_t timerStart = timer_read();
274 bool ready = false;
275
276 do {
277 ready = digitalRead(AdafruitBleIRQPin);
278 if (ready) {
279 break;
280 }
281 _delay_us(1);
282 } while (timer_elapsed(timerStart) < timeout);
283
284 if (ready) {
285 SPI_begin(&spi);
286
287 digitalWrite(AdafruitBleCSPin, PinLevelLow);
288
289 do {
290 // Read the command type, waiting for the data to be ready
291 msg->type = spi_read_byte();
292 if (msg->type == SdepSlaveNotReady || msg->type == SdepSlaveOverflow) {
293 // Release it and let it initialize
294 digitalWrite(AdafruitBleCSPin, PinLevelHigh);
295 _delay_us(SdepBackOff);
296 digitalWrite(AdafruitBleCSPin, PinLevelLow);
297 continue;
298 }
299
300 // Read the rest of the header
301 spi_recv_bytes(&msg->cmd_low, sizeof(*msg) - (1 + sizeof(msg->payload)));
302
303 // and get the payload if there is any
304 if (msg->len <= SdepMaxPayload) {
305 spi_recv_bytes(msg->payload, msg->len);
306 }
307 success = true;
308 break;
309 } while (timer_elapsed(timerStart) < timeout);
310
311 digitalWrite(AdafruitBleCSPin, PinLevelHigh);
312 }
313 return success;
314}
315
316static void resp_buf_read_one(bool greedy) {
317 uint16_t last_send;
318 if (!resp_buf.peek(last_send)) {
319 return;
320 }
321
322 if (digitalRead(AdafruitBleIRQPin)) {
323 struct sdep_msg msg;
324
325again:
326 if (sdep_recv_pkt(&msg, SdepTimeout)) {
327 if (!msg.more) {
328 // We got it; consume this entry
329 resp_buf.get(last_send);
330 dprintf("recv latency %dms\n", TIMER_DIFF_16(timer_read(), last_send));
331 }
332
333 if (greedy && resp_buf.peek(last_send) && digitalRead(AdafruitBleIRQPin)) {
334 goto again;
335 }
336 }
337
338 } else if (timer_elapsed(last_send) > SdepTimeout * 2) {
339 dprintf("waiting_for_result: timeout, resp_buf size %d\n",
340 (int)resp_buf.size());
341
342 // Timed out: consume this entry
343 resp_buf.get(last_send);
344 }
345}
346
347static void send_buf_send_one(uint16_t timeout = SdepTimeout) {
348 struct queue_item item;
349
350 // Don't send anything more until we get an ACK
351 if (!resp_buf.empty()) {
352 return;
353 }
354
355 if (!send_buf.peek(item)) {
356 return;
357 }
358 if (process_queue_item(&item, timeout)) {
359 // commit that peek
360 send_buf.get(item);
361 dprintf("send_buf_send_one: have %d remaining\n", (int)send_buf.size());
362 } else {
363 dprint("failed to send, will retry\n");
364 _delay_ms(SdepTimeout);
365 resp_buf_read_one(true);
366 }
367}
368
369static void resp_buf_wait(const char *cmd) {
370 bool didPrint = false;
371 while (!resp_buf.empty()) {
372 if (!didPrint) {
373 dprintf("wait on buf for %s\n", cmd);
374 didPrint = true;
375 }
376 resp_buf_read_one(true);
377 }
378}
379
380static bool ble_init(void) {
381 state.initialized = false;
382 state.configured = false;
383 state.is_connected = false;
384
385 pinMode(AdafruitBleIRQPin, PinDirectionInput);
386 pinMode(AdafruitBleCSPin, PinDirectionOutput);
387 digitalWrite(AdafruitBleCSPin, PinLevelHigh);
388
389 SPI_init(&spi);
390
391 // Perform a hardware reset
392 pinMode(AdafruitBleResetPin, PinDirectionOutput);
393 digitalWrite(AdafruitBleResetPin, PinLevelHigh);
394 digitalWrite(AdafruitBleResetPin, PinLevelLow);
395 _delay_ms(10);
396 digitalWrite(AdafruitBleResetPin, PinLevelHigh);
397
398 _delay_ms(1000); // Give it a second to initialize
399
400 state.initialized = true;
401 return state.initialized;
402}
403
404static inline uint8_t min(uint8_t a, uint8_t b) {
405 return a < b ? a : b;
406}
407
408static bool read_response(char *resp, uint16_t resplen, bool verbose) {
409 char *dest = resp;
410 char *end = dest + resplen;
411
412 while (true) {
413 struct sdep_msg msg;
414
415 if (!sdep_recv_pkt(&msg, 2 * SdepTimeout)) {
416 dprint("sdep_recv_pkt failed\n");
417 return false;
418 }
419
420 if (msg.type != SdepResponse) {
421 *resp = 0;
422 return false;
423 }
424
425 uint8_t len = min(msg.len, end - dest);
426 if (len > 0) {
427 memcpy(dest, msg.payload, len);
428 dest += len;
429 }
430
431 if (!msg.more) {
432 // No more data is expected!
433 break;
434 }
435 }
436
437 // Ensure the response is NUL terminated
438 *dest = 0;
439
440 // "Parse" the result text; we want to snip off the trailing OK or ERROR line
441 // Rewind past the possible trailing CRLF so that we can strip it
442 --dest;
443 while (dest > resp && (dest[0] == '\n' || dest[0] == '\r')) {
444 *dest = 0;
445 --dest;
446 }
447
448 // Look back for start of preceeding line
449 char *last_line = strrchr(resp, '\n');
450 if (last_line) {
451 ++last_line;
452 } else {
453 last_line = resp;
454 }
455
456 bool success = false;
457 static const char kOK[] PROGMEM = "OK";
458
459 success = !strcmp_P(last_line, kOK );
460
461 if (verbose || !success) {
462 dprintf("result: %s\n", resp);
463 }
464 return success;
465}
466
467static bool at_command(const char *cmd, char *resp, uint16_t resplen,
468 bool verbose, uint16_t timeout) {
469 const char *end = cmd + strlen(cmd);
470 struct sdep_msg msg;
471
472 if (verbose) {
473 dprintf("ble send: %s\n", cmd);
474 }
475
476 if (resp) {
477 // They want to decode the response, so we need to flush and wait
478 // for all pending I/O to finish before we start this one, so
479 // that we don't confuse the results
480 resp_buf_wait(cmd);
481 *resp = 0;
482 }
483
484 // Fragment the command into a series of SDEP packets
485 while (end - cmd > SdepMaxPayload) {
486 sdep_build_pkt(&msg, BleAtWrapper, (uint8_t *)cmd, SdepMaxPayload, true);
487 if (!sdep_send_pkt(&msg, timeout)) {
488 return false;
489 }
490 cmd += SdepMaxPayload;
491 }
492
493 sdep_build_pkt(&msg, BleAtWrapper, (uint8_t *)cmd, end - cmd, false);
494 if (!sdep_send_pkt(&msg, timeout)) {
495 return false;
496 }
497
498 if (resp == NULL) {
499 auto now = timer_read();
500 while (!resp_buf.enqueue(now)) {
501 resp_buf_read_one(false);
502 }
503 auto later = timer_read();
504 if (TIMER_DIFF_16(later, now) > 0) {
505 dprintf("waited %dms for resp_buf\n", TIMER_DIFF_16(later, now));
506 }
507 return true;
508 }
509
510 return read_response(resp, resplen, verbose);
511}
512
513bool at_command_P(const char *cmd, char *resp, uint16_t resplen, bool verbose) {
514 auto cmdbuf = (char *)alloca(strlen_P(cmd) + 1);
515 strcpy_P(cmdbuf, cmd);
516 return at_command(cmdbuf, resp, resplen, verbose);
517}
518
519bool adafruit_ble_is_connected(void) {
520 return state.is_connected;
521}
522
523bool adafruit_ble_enable_keyboard(void) {
524 char resbuf[128];
525
526 if (!state.initialized && !ble_init()) {
527 return false;
528 }
529
530 state.configured = false;
531
532 // Disable command echo
533 static const char kEcho[] PROGMEM = "ATE=0";
534 // Make the advertised name match the keyboard
535 static const char kGapDevName[] PROGMEM =
536 "AT+GAPDEVNAME=" STR(PRODUCT) " " STR(DESCRIPTION);
537 // Turn on keyboard support
538 static const char kHidEnOn[] PROGMEM = "AT+BLEHIDEN=1";
539
540 // Adjust intervals to improve latency. This causes the "central"
541 // system (computer/tablet) to poll us every 10-30 ms. We can't
542 // set a smaller value than 10ms, and 30ms seems to be the natural
543 // processing time on my macbook. Keeping it constrained to that
544 // feels reasonable to type to.
545 static const char kGapIntervals[] PROGMEM = "AT+GAPINTERVALS=10,30,,";
546
547 // Reset the device so that it picks up the above changes
548 static const char kATZ[] PROGMEM = "ATZ";
549
550 // Turn down the power level a bit
551 static const char kPower[] PROGMEM = "AT+BLEPOWERLEVEL=-12";
552 static PGM_P const configure_commands[] PROGMEM = {
553 kEcho,
554 kGapIntervals,
555 kGapDevName,
556 kHidEnOn,
557 kPower,
558 kATZ,
559 };
560
561 uint8_t i;
562 for (i = 0; i < sizeof(configure_commands) / sizeof(configure_commands[0]);
563 ++i) {
564 PGM_P cmd;
565 memcpy_P(&cmd, configure_commands + i, sizeof(cmd));
566
567 if (!at_command_P(cmd, resbuf, sizeof(resbuf))) {
568 dprintf("failed BLE command: %S: %s\n", cmd, resbuf);
569 goto fail;
570 }
571 }
572
573 state.configured = true;
574
575 // Check connection status in a little while; allow the ATZ time
576 // to kick in.
577 state.last_connection_update = timer_read();
578fail:
579 return state.configured;
580}
581
582static void set_connected(bool connected) {
583 if (connected != state.is_connected) {
584 if (connected) {
585 print("****** BLE CONNECT!!!!\n");
586 } else {
587 print("****** BLE DISCONNECT!!!!\n");
588 }
589 state.is_connected = connected;
590
591 // TODO: if modifiers are down on the USB interface and
592 // we cut over to BLE or vice versa, they will remain stuck.
593 // This feels like a good point to do something like clearing
594 // the keyboard and/or generating a fake all keys up message.
595 // However, I've noticed that it takes a couple of seconds
596 // for macOS to to start recognizing key presses after BLE
597 // is in the connected state, so I worry that doing that
598 // here may not be good enough.
599 }
600}
601
602void adafruit_ble_task(void) {
603 char resbuf[48];
604
605 if (!state.configured && !adafruit_ble_enable_keyboard()) {
606 return;
607 }
608 resp_buf_read_one(true);
609 send_buf_send_one(SdepShortTimeout);
610
611 if (resp_buf.empty() && (state.event_flags & UsingEvents) &&
612 digitalRead(AdafruitBleIRQPin)) {
613 // Must be an event update
614 if (at_command_P(PSTR("AT+EVENTSTATUS"), resbuf, sizeof(resbuf))) {
615 uint32_t mask = strtoul(resbuf, NULL, 16);
616
617 if (mask & BleSystemConnected) {
618 set_connected(true);
619 } else if (mask & BleSystemDisconnected) {
620 set_connected(false);
621 }
622 }
623 }
624
625 if (timer_elapsed(state.last_connection_update) > ConnectionUpdateInterval) {
626 bool shouldPoll = true;
627 if (!(state.event_flags & ProbedEvents)) {
628 // Request notifications about connection status changes.
629 // This only works in SPIFRIEND firmware > 0.6.7, which is why
630 // we check for this conditionally here.
631 // Note that at the time of writing, HID reports only work correctly
632 // with Apple products on firmware version 0.6.7!
633 // https://forums.adafruit.com/viewtopic.php?f=8&t=104052
634 if (at_command_P(PSTR("AT+EVENTENABLE=0x1"), resbuf, sizeof(resbuf))) {
635 at_command_P(PSTR("AT+EVENTENABLE=0x2"), resbuf, sizeof(resbuf));
636 state.event_flags |= UsingEvents;
637 }
638 state.event_flags |= ProbedEvents;
639
640 // leave shouldPoll == true so that we check at least once
641 // before relying solely on events
642 } else {
643 shouldPoll = false;
644 }
645
646 static const char kGetConn[] PROGMEM = "AT+GAPGETCONN";
647 state.last_connection_update = timer_read();
648
649 if (at_command_P(kGetConn, resbuf, sizeof(resbuf))) {
650 set_connected(atoi(resbuf));
651 }
652 }
653
654#ifdef SAMPLE_BATTERY
655 // I don't know if this really does anything useful yet; the reported
656 // voltage level always seems to be around 3200mV. We may want to just rip
657 // this code out.
658 if (timer_elapsed(state.last_battery_update) > BatteryUpdateInterval &&
659 resp_buf.empty()) {
660 state.last_battery_update = timer_read();
661
662 if (at_command_P(PSTR("AT+HWVBAT"), resbuf, sizeof(resbuf))) {
663 state.vbat = atoi(resbuf);
664 }
665 }
666#endif
667}
668
669static bool process_queue_item(struct queue_item *item, uint16_t timeout) {
670 char cmdbuf[48];
671 char fmtbuf[64];
672
673 // Arrange to re-check connection after keys have settled
674 state.last_connection_update = timer_read();
675
676#if 1
677 if (TIMER_DIFF_16(state.last_connection_update, item->added) > 0) {
678 dprintf("send latency %dms\n",
679 TIMER_DIFF_16(state.last_connection_update, item->added));
680 }
681#endif
682
683 switch (item->queue_type) {
684 case QTKeyReport:
685 strcpy_P(fmtbuf,
686 PSTR("AT+BLEKEYBOARDCODE=%02x-00-%02x-%02x-%02x-%02x-%02x-%02x"));
687 snprintf(cmdbuf, sizeof(cmdbuf), fmtbuf, item->key.modifier,
688 item->key.keys[0], item->key.keys[1], item->key.keys[2],
689 item->key.keys[3], item->key.keys[4], item->key.keys[5]);
690 return at_command(cmdbuf, NULL, 0, true, timeout);
691
692 case QTConsumer:
693 strcpy_P(fmtbuf, PSTR("AT+BLEHIDCONTROLKEY=0x%04x"));
694 snprintf(cmdbuf, sizeof(cmdbuf), fmtbuf, item->consumer);
695 return at_command(cmdbuf, NULL, 0, true, timeout);
696
697#ifdef MOUSE_ENABLE
698 case QTMouseMove:
699 strcpy_P(fmtbuf, PSTR("AT+BLEHIDMOUSEMOVE=%d,%d,%d,%d"));
700 snprintf(cmdbuf, sizeof(cmdbuf), fmtbuf, item->mousemove.x,
701 item->mousemove.y, item->mousemove.scroll, item->mousemove.pan);
702 return at_command(cmdbuf, NULL, 0, true, timeout);
703#endif
704 default:
705 return true;
706 }
707}
708
709bool adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys,
710 uint8_t nkeys) {
711 struct queue_item item;
712 bool didWait = false;
713
714 item.queue_type = QTKeyReport;
715 item.key.modifier = hid_modifier_mask;
716 item.added = timer_read();
717
718 while (nkeys >= 0) {
719 item.key.keys[0] = keys[0];
720 item.key.keys[1] = nkeys >= 1 ? keys[1] : 0;
721 item.key.keys[2] = nkeys >= 2 ? keys[2] : 0;
722 item.key.keys[3] = nkeys >= 3 ? keys[3] : 0;
723 item.key.keys[4] = nkeys >= 4 ? keys[4] : 0;
724 item.key.keys[5] = nkeys >= 5 ? keys[5] : 0;
725
726 if (!send_buf.enqueue(item)) {
727 if (!didWait) {
728 dprint("wait for buf space\n");
729 didWait = true;
730 }
731 send_buf_send_one();
732 continue;
733 }
734
735 if (nkeys <= 6) {
736 return true;
737 }
738
739 nkeys -= 6;
740 keys += 6;
741 }
742
743 return true;
744}
745
746bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration) {
747 struct queue_item item;
748
749 item.queue_type = QTConsumer;
750 item.consumer = keycode;
751
752 while (!send_buf.enqueue(item)) {
753 send_buf_send_one();
754 }
755 return true;
756}
757
758#ifdef MOUSE_ENABLE
759bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll,
760 int8_t pan) {
761 struct queue_item item;
762
763 item.queue_type = QTMouseMove;
764 item.mousemove.x = x;
765 item.mousemove.y = y;
766 item.mousemove.scroll = scroll;
767 item.mousemove.pan = pan;
768
769 while (!send_buf.enqueue(item)) {
770 send_buf_send_one();
771 }
772 return true;
773}
774#endif
775
776uint32_t adafruit_ble_read_battery_voltage(void) {
777 return state.vbat;
778}
779
780bool adafruit_ble_set_mode_leds(bool on) {
781 if (!state.configured) {
782 return false;
783 }
784
785 // The "mode" led is the red blinky one
786 at_command_P(on ? PSTR("AT+HWMODELED=1") : PSTR("AT+HWMODELED=0"), NULL, 0);
787
788 // Pin 19 is the blue "connected" LED; turn that off too.
789 // When turning LEDs back on, don't turn that LED on if we're
790 // not connected, as that would be confusing.
791 at_command_P(on && state.is_connected ? PSTR("AT+HWGPIO=19,1")
792 : PSTR("AT+HWGPIO=19,0"),
793 NULL, 0);
794 return true;
795}
796
797// https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/ble-generic#at-plus-blepowerlevel
798bool adafruit_ble_set_power_level(int8_t level) {
799 char cmd[46];
800 if (!state.configured) {
801 return false;
802 }
803 snprintf(cmd, sizeof(cmd), "AT+BLEPOWERLEVEL=%d", level);
804 return at_command(cmd, NULL, 0, false);
805}
diff --git a/tmk_core/protocol/lufa/adafruit_ble.h b/tmk_core/protocol/lufa/adafruit_ble.h
new file mode 100644
index 000000000..351fd55ae
--- /dev/null
+++ b/tmk_core/protocol/lufa/adafruit_ble.h
@@ -0,0 +1,60 @@
1/* Bluetooth Low Energy Protocol for QMK.
2 * Author: Wez Furlong, 2016
3 * Supports the Adafruit BLE board built around the nRF51822 chip.
4 */
5#pragma once
6#ifdef ADAFRUIT_BLE_ENABLE
7#include <stdbool.h>
8#include <stdint.h>
9#include <string.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/* Instruct the module to enable HID keyboard support and reset */
16extern bool adafruit_ble_enable_keyboard(void);
17
18/* Query to see if the BLE module is connected */
19extern bool adafruit_ble_query_is_connected(void);
20
21/* Returns true if we believe that the BLE module is connected.
22 * This uses our cached understanding that is maintained by
23 * calling ble_task() periodically. */
24extern bool adafruit_ble_is_connected(void);
25
26/* Call this periodically to process BLE-originated things */
27extern void adafruit_ble_task(void);
28
29/* Generates keypress events for a set of keys.
30 * The hid modifier mask specifies the state of the modifier keys for
31 * this set of keys.
32 * Also sends a key release indicator, so that the keys do not remain
33 * held down. */
34extern bool adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys,
35 uint8_t nkeys);
36
37/* Send a consumer keycode, holding it down for the specified duration
38 * (milliseconds) */
39extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration);
40
41#ifdef MOUSE_ENABLE
42/* Send a mouse/wheel movement report.
43 * The parameters are signed and indicate positive of negative direction
44 * change. */
45extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll,
46 int8_t pan);
47#endif
48
49/* Compute battery voltage by reading an analog pin.
50 * Returns the integer number of millivolts */
51extern uint32_t adafruit_ble_read_battery_voltage(void);
52
53extern bool adafruit_ble_set_mode_leds(bool on);
54extern bool adafruit_ble_set_power_level(int8_t level);
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif // ADAFRUIT_BLE_ENABLE
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 01c0e45b0..39d4824b6 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -51,6 +51,7 @@
51 51
52#include "descriptor.h" 52#include "descriptor.h"
53#include "lufa.h" 53#include "lufa.h"
54#include "quantum.h"
54 55
55#ifdef NKRO_ENABLE 56#ifdef NKRO_ENABLE
56 #include "keycode_config.h" 57 #include "keycode_config.h"
@@ -71,6 +72,14 @@
71 #include "virtser.h" 72 #include "virtser.h"
72#endif 73#endif
73 74
75#if (defined(RGB_MIDI) | defined(RGBLIGHT_ANIMATIONS)) & defined(RGBLIGHT_ENABLE)
76 #include "rgblight.h"
77#endif
78
79#ifdef MIDI_ENABLE
80 #include "sysex_tools.h"
81#endif
82
74uint8_t keyboard_idle = 0; 83uint8_t keyboard_idle = 0;
75/* 0: Boot Protocol, 1: Report Protocol(default) */ 84/* 0: Boot Protocol, 1: Report Protocol(default) */
76uint8_t keyboard_protocol = 1; 85uint8_t keyboard_protocol = 1;
@@ -79,9 +88,9 @@ static uint8_t keyboard_led_stats = 0;
79static report_keyboard_t keyboard_report_sent; 88static report_keyboard_t keyboard_report_sent;
80 89
81#ifdef MIDI_ENABLE 90#ifdef MIDI_ENABLE
82void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2); 91static void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2);
83void usb_get_midi(MidiDevice * device); 92static void usb_get_midi(MidiDevice * device);
84void midi_usb_init(MidiDevice * device); 93static void midi_usb_init(MidiDevice * device);
85#endif 94#endif
86 95
87/* Host driver */ 96/* Host driver */
@@ -709,7 +718,7 @@ int8_t sendchar(uint8_t c)
709 ******************************************************************************/ 718 ******************************************************************************/
710 719
711#ifdef MIDI_ENABLE 720#ifdef MIDI_ENABLE
712void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2) { 721static void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2) {
713 MIDI_EventPacket_t event; 722 MIDI_EventPacket_t event;
714 event.Data1 = byte0; 723 event.Data1 = byte0;
715 event.Data2 = byte1; 724 event.Data2 = byte1;
@@ -769,7 +778,7 @@ void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byt
769 USB_USBTask(); 778 USB_USBTask();
770} 779}
771 780
772void usb_get_midi(MidiDevice * device) { 781static void usb_get_midi(MidiDevice * device) {
773 MIDI_EventPacket_t event; 782 MIDI_EventPacket_t event;
774 while (MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, &event)) { 783 while (MIDI_Device_ReceiveEventPacket(&USB_MIDI_Interface, &event)) {
775 784
@@ -799,12 +808,12 @@ void usb_get_midi(MidiDevice * device) {
799 USB_USBTask(); 808 USB_USBTask();
800} 809}
801 810
802void midi_usb_init(MidiDevice * device){ 811static void midi_usb_init(MidiDevice * device){
803 midi_device_init(device); 812 midi_device_init(device);
804 midi_device_set_send_func(device, usb_send_func); 813 midi_device_set_send_func(device, usb_send_func);
805 midi_device_set_pre_input_process_func(device, usb_get_midi); 814 midi_device_set_pre_input_process_func(device, usb_get_midi);
806 815
807 SetupHardware(); 816 // SetupHardware();
808 sei(); 817 sei();
809} 818}
810 819
@@ -1039,11 +1048,16 @@ int main(void)
1039 } 1048 }
1040 #endif 1049 #endif
1041 1050
1051 keyboard_task();
1052
1042#ifdef MIDI_ENABLE 1053#ifdef MIDI_ENABLE
1043 midi_device_process(&midi_device); 1054 midi_device_process(&midi_device);
1044 // MIDI_Task(); 1055 // MIDI_Task();
1045#endif 1056#endif
1046 keyboard_task(); 1057
1058#if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE)
1059 rgblight_task();
1060#endif
1047 1061
1048#ifdef VIRTSER_ENABLE 1062#ifdef VIRTSER_ENABLE
1049 virtser_task(); 1063 virtser_task();
@@ -1077,15 +1091,38 @@ void fallthrough_callback(MidiDevice * device,
1077#endif 1091#endif
1078} 1092}
1079 1093
1094
1080void cc_callback(MidiDevice * device, 1095void cc_callback(MidiDevice * device,
1081 uint8_t chan, uint8_t num, uint8_t val) { 1096 uint8_t chan, uint8_t num, uint8_t val) {
1082 //sending it back on the next channel 1097 //sending it back on the next channel
1083 midi_send_cc(device, (chan + 1) % 16, num, val); 1098 // midi_send_cc(device, (chan + 1) % 16, num, val);
1084} 1099}
1085 1100
1086void sysex_callback(MidiDevice * device, 1101uint8_t midi_buffer[MIDI_SYSEX_BUFFER] = {0};
1087 uint16_t start, uint8_t length, uint8_t * data) { 1102
1088 for (int i = 0; i < length; i++) 1103void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) {
1089 midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); 1104 #ifdef API_SYSEX_ENABLE
1105 // SEND_STRING("\n");
1106 // send_word(start);
1107 // SEND_STRING(": ");
1108 for (uint8_t place = 0; place < length; place++) {
1109 // send_byte(*data);
1110 midi_buffer[start + place] = *data;
1111 if (*data == 0xF7) {
1112 // SEND_STRING("\nRD: ");
1113 // for (uint8_t i = 0; i < start + place + 1; i++){
1114 // send_byte(midi_buffer[i]);
1115 // SEND_STRING(" ");
1116 // }
1117 uint8_t * decoded = malloc(sizeof(uint8_t) * (sysex_decoded_length(start + place - 4)));
1118 uint16_t decode_length = sysex_decode(decoded, midi_buffer + 4, start + place - 4);
1119 process_api(decode_length, decoded);
1120 }
1121 // SEND_STRING(" ");
1122 data++;
1123 }
1124 #endif
1090} 1125}
1126
1127
1091#endif 1128#endif
diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h
index aad08d640..b11854101 100644
--- a/tmk_core/protocol/lufa/lufa.h
+++ b/tmk_core/protocol/lufa/lufa.h
@@ -68,8 +68,17 @@ typedef struct {
68} __attribute__ ((packed)) report_extra_t; 68} __attribute__ ((packed)) report_extra_t;
69 69
70#ifdef MIDI_ENABLE 70#ifdef MIDI_ENABLE
71void MIDI_Task(void); 71 void MIDI_Task(void);
72MidiDevice midi_device; 72 MidiDevice midi_device;
73 #define MIDI_SYSEX_BUFFER 32
74#endif
75
76#ifdef API_ENABLE
77 #include "api.h"
78#endif
79
80#ifdef API_SYSEX_ENABLE
81 #include "api_sysex.h"
73#endif 82#endif
74 83
75// #if LUFA_VERSION_INTEGER < 0x120730 84// #if LUFA_VERSION_INTEGER < 0x120730
diff --git a/tmk_core/protocol/lufa/ringbuffer.hpp b/tmk_core/protocol/lufa/ringbuffer.hpp
new file mode 100644
index 000000000..70a3c4881
--- /dev/null
+++ b/tmk_core/protocol/lufa/ringbuffer.hpp
@@ -0,0 +1,66 @@
1#pragma once
2// A simple ringbuffer holding Size elements of type T
3template <typename T, uint8_t Size>
4class RingBuffer {
5 protected:
6 T buf_[Size];
7 uint8_t head_{0}, tail_{0};
8 public:
9 inline uint8_t nextPosition(uint8_t position) {
10 return (position + 1) % Size;
11 }
12
13 inline uint8_t prevPosition(uint8_t position) {
14 if (position == 0) {
15 return Size - 1;
16 }
17 return position - 1;
18 }
19
20 inline bool enqueue(const T &item) {
21 static_assert(Size > 1, "RingBuffer size must be > 1");
22 uint8_t next = nextPosition(head_);
23 if (next == tail_) {
24 // Full
25 return false;
26 }
27
28 buf_[head_] = item;
29 head_ = next;
30 return true;
31 }
32
33 inline bool get(T &dest, bool commit = true) {
34 auto tail = tail_;
35 if (tail == head_) {
36 // No more data
37 return false;
38 }
39
40 dest = buf_[tail];
41 tail = nextPosition(tail);
42
43 if (commit) {
44 tail_ = tail;
45 }
46 return true;
47 }
48
49 inline bool empty() const { return head_ == tail_; }
50
51 inline uint8_t size() const {
52 int diff = head_ - tail_;
53 if (diff >= 0) {
54 return diff;
55 }
56 return Size + diff;
57 }
58
59 inline T& front() {
60 return buf_[tail_];
61 }
62
63 inline bool peek(T &item) {
64 return get(item, false);
65 }
66};
diff --git a/tmk_core/protocol/midi.mk b/tmk_core/protocol/midi.mk
index c85ae42ff..4855b23d3 100644
--- a/tmk_core/protocol/midi.mk
+++ b/tmk_core/protocol/midi.mk
@@ -4,6 +4,7 @@ SRC += midi.c \
4 midi_device.c \ 4 midi_device.c \
5 bytequeue/bytequeue.c \ 5 bytequeue/bytequeue.c \
6 bytequeue/interrupt_setting.c \ 6 bytequeue/interrupt_setting.c \
7 sysex_tools.c \
7 $(LUFA_SRC_USBCLASS) 8 $(LUFA_SRC_USBCLASS)
8 9
9VPATH += $(TMK_PATH)/$(MIDI_DIR) \ No newline at end of file 10VPATH += $(TMK_PATH)/$(MIDI_DIR) \ No newline at end of file
diff --git a/tmk_core/protocol/ps2_mouse.c b/tmk_core/protocol/ps2_mouse.c
index c3e8b3c1c..82f6966e8 100644
--- a/tmk_core/protocol/ps2_mouse.c
+++ b/tmk_core/protocol/ps2_mouse.c
@@ -26,6 +26,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
26#include "print.h" 26#include "print.h"
27#include "debug.h" 27#include "debug.h"
28 28
29#ifndef PS2_INIT_DELAY
30#define PS2_INIT_DELAY 1000
31#endif
29 32
30static report_mouse_t mouse_report = {}; 33static report_mouse_t mouse_report = {};
31 34
@@ -39,7 +42,7 @@ uint8_t ps2_mouse_init(void) {
39 42
40 ps2_host_init(); 43 ps2_host_init();
41 44
42 _delay_ms(1000); // wait for powering up 45 _delay_ms(PS2_INIT_DELAY); // wait for powering up
43 46
44 // send Reset 47 // send Reset
45 rcv = ps2_host_send(0xFF); 48 rcv = ps2_host_send(0xFF);
diff --git a/tmk_core/ring_buffer.h b/tmk_core/ring_buffer.h
index 7bdebbcf3..005d1be61 100644
--- a/tmk_core/ring_buffer.h
+++ b/tmk_core/ring_buffer.h
@@ -4,13 +4,13 @@
4 * Ring buffer to store scan codes from keyboard 4 * Ring buffer to store scan codes from keyboard
5 *------------------------------------------------------------------*/ 5 *------------------------------------------------------------------*/
6#define RBUF_SIZE 32 6#define RBUF_SIZE 32
7#include <util/atomic.h>
7static uint8_t rbuf[RBUF_SIZE]; 8static uint8_t rbuf[RBUF_SIZE];
8static uint8_t rbuf_head = 0; 9static uint8_t rbuf_head = 0;
9static uint8_t rbuf_tail = 0; 10static uint8_t rbuf_tail = 0;
10static inline void rbuf_enqueue(uint8_t data) 11static inline void rbuf_enqueue(uint8_t data)
11{ 12{
12 uint8_t sreg = SREG; 13 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
13 cli();
14 uint8_t next = (rbuf_head + 1) % RBUF_SIZE; 14 uint8_t next = (rbuf_head + 1) % RBUF_SIZE;
15 if (next != rbuf_tail) { 15 if (next != rbuf_tail) {
16 rbuf[rbuf_head] = data; 16 rbuf[rbuf_head] = data;
@@ -18,36 +18,34 @@ static inline void rbuf_enqueue(uint8_t data)
18 } else { 18 } else {
19 print("rbuf: full\n"); 19 print("rbuf: full\n");
20 } 20 }
21 SREG = sreg; 21 }
22} 22}
23static inline uint8_t rbuf_dequeue(void) 23static inline uint8_t rbuf_dequeue(void)
24{ 24{
25 uint8_t val = 0; 25 uint8_t val = 0;
26 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
26 27
27 uint8_t sreg = SREG;
28 cli();
29 if (rbuf_head != rbuf_tail) { 28 if (rbuf_head != rbuf_tail) {
30 val = rbuf[rbuf_tail]; 29 val = rbuf[rbuf_tail];
31 rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; 30 rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE;
32 } 31 }
33 SREG = sreg; 32 }
34 33
35 return val; 34 return val;
36} 35}
37static inline bool rbuf_has_data(void) 36static inline bool rbuf_has_data(void)
38{ 37{
39 uint8_t sreg = SREG; 38 bool has_data;
40 cli(); 39 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
41 bool has_data = (rbuf_head != rbuf_tail); 40 has_data = (rbuf_head != rbuf_tail);
42 SREG = sreg; 41 }
43 return has_data; 42 return has_data;
44} 43}
45static inline void rbuf_clear(void) 44static inline void rbuf_clear(void)
46{ 45{
47 uint8_t sreg = SREG; 46 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
48 cli();
49 rbuf_head = rbuf_tail = 0; 47 rbuf_head = rbuf_tail = 0;
50 SREG = sreg; 48 }
51} 49}
52 50
53#endif /* RING_BUFFER_H */ 51#endif /* RING_BUFFER_H */