aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_keyboard.mk182
-rw-r--r--doc/BUILD_GUIDE.md2
-rw-r--r--keyboards/atomic/keymaps/twolayer.c72
-rw-r--r--keyboards/atreus/keymaps/default/keymap.c4
-rw-r--r--keyboards/atreus/keymaps/xyverz/keymap.c223
-rw-r--r--keyboards/atreus/keymaps/xyverz/readme.md107
-rw-r--r--keyboards/atreus62/keymaps/xyverz/keymap.c175
-rw-r--r--keyboards/clueboard/keymaps/xyverz/Makefile49
-rw-r--r--keyboards/clueboard/keymaps/xyverz/keymap.c111
-rw-r--r--keyboards/ergodox/config.h2
-rw-r--r--keyboards/ergodox/ez/config.h3
-rw-r--r--keyboards/ergodox/ez/rules.mk4
-rw-r--r--keyboards/ergodox/infinity/Makefile2
-rw-r--r--keyboards/ergodox/infinity/animations.c107
-rw-r--r--keyboards/ergodox/infinity/animations.h30
-rw-r--r--keyboards/ergodox/infinity/config.h4
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c37
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h80
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c411
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h11
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h2
-rw-r--r--keyboards/ergodox/infinity/gfxconf.h2
-rw-r--r--keyboards/ergodox/infinity/infinity.c51
-rw-r--r--keyboards/ergodox/infinity/infinity.h71
-rw-r--r--keyboards/ergodox/infinity/rules.mk13
-rw-r--r--keyboards/ergodox/infinity/simple_visualizer.h123
-rw-r--r--keyboards/ergodox/infinity/visualizer.c329
-rw-r--r--keyboards/ergodox/keymaps/default/visualizer.c42
-rw-r--r--keyboards/ergodox/keymaps/familiar/README.md69
-rw-r--r--keyboards/ergodox/keymaps/familiar/familiar.pngbin0 -> 149846 bytes
-rw-r--r--keyboards/ergodox/keymaps/familiar/keymap.c267
-rw-r--r--keyboards/ergodox/keymaps/xyverz/keymap.c14
-rw-r--r--keyboards/ergodox/keymaps/xyverz/readme.md8
-rw-r--r--keyboards/gh60/keymaps/xyverz/keymap.c149
-rw-r--r--keyboards/handwired/kbod/Makefile3
-rw-r--r--keyboards/handwired/kbod/config.h167
-rw-r--r--keyboards/handwired/kbod/kbod.c28
-rw-r--r--keyboards/handwired/kbod/kbod.h21
-rw-r--r--keyboards/handwired/kbod/keymaps/default/Makefile21
-rw-r--r--keyboards/handwired/kbod/keymaps/default/config.h8
-rw-r--r--keyboards/handwired/kbod/keymaps/default/keymap.c104
-rw-r--r--keyboards/handwired/kbod/keymaps/default/readme.md5
-rw-r--r--keyboards/handwired/kbod/readme.md21
-rw-r--r--keyboards/handwired/kbod/rules.mk68
-rw-r--r--keyboards/kinesis/keymaps/xyverz/Makefile21
-rw-r--r--keyboards/kinesis/keymaps/xyverz/config.h8
-rw-r--r--keyboards/kinesis/keymaps/xyverz/keymap.c302
-rw-r--r--keyboards/kinesis/keymaps/xyverz/readme.md128
-rw-r--r--keyboards/lets_split/keymaps/OLED_sample/config.h17
-rw-r--r--keyboards/lets_split/keymaps/OLED_sample/keymap.c3
-rw-r--r--keyboards/lets_split/keymaps/hexwire/config.h49
-rw-r--r--keyboards/lets_split/keymaps/hexwire/keymap.c12
-rw-r--r--keyboards/lets_split/keymaps/xyverz/config.h37
-rw-r--r--keyboards/lets_split/keymaps/xyverz/keymap.c191
-rw-r--r--keyboards/lets_split/lets_split.h14
-rw-r--r--keyboards/lets_split/readme.md11
-rw-r--r--keyboards/lets_split/rev1/rev1.h24
-rw-r--r--keyboards/lets_split/rev2/rev2.c1
-rw-r--r--keyboards/lets_split/rev2/rev2.h73
-rw-r--r--keyboards/lets_split/rules.mk14
-rw-r--r--keyboards/lets_split/split_util.c2
-rw-r--r--keyboards/lets_split/ssd1306.c6
-rw-r--r--keyboards/lets_split/ssd1306.h17
-rw-r--r--keyboards/miuni32/Makefile3
-rw-r--r--keyboards/miuni32/config.h170
-rw-r--r--keyboards/miuni32/keymaps/default/Makefile21
-rw-r--r--keyboards/miuni32/keymaps/default/config.h8
-rw-r--r--keyboards/miuni32/keymaps/default/keymap.c49
-rw-r--r--keyboards/miuni32/keymaps/default/readme.md1
-rw-r--r--keyboards/miuni32/miuni32.c28
-rw-r--r--keyboards/miuni32/miuni32.h15
-rw-r--r--keyboards/miuni32/readme.md28
-rw-r--r--keyboards/miuni32/rules.mk67
-rw-r--r--keyboards/planck/keymaps/khord/config.h1
-rw-r--r--keyboards/planck/keymaps/khord/keymap.c42
-rw-r--r--keyboards/planck/keymaps/xyverz/Makefile6
-rw-r--r--keyboards/planck/keymaps/xyverz/keymap.c24
-rw-r--r--keyboards/preonic/keymaps/xyverz/Makefile (renamed from keyboards/planck/keymaps/xyverz/makefile.mk)12
-rw-r--r--keyboards/preonic/keymaps/xyverz/config.h21
-rw-r--r--keyboards/preonic/keymaps/xyverz/keymap.c244
-rw-r--r--keyboards/preonic/keymaps/xyverz/makefile.mk1
-rw-r--r--keyboards/tv44/keymaps/tong92/Makefile21
-rw-r--r--keyboards/tv44/keymaps/tong92/config.h12
-rw-r--r--keyboards/tv44/keymaps/tong92/keymap.c138
-rw-r--r--keyboards/tv44/keymaps/tong92/readme.md52
-rw-r--r--keyboards/tv44/keymaps/xyverz/keymap.c26
-rw-r--r--keyboards/xd60/keymaps/default/keymap.c4
-rw-r--r--quantum/led_tables.c71
-rw-r--r--quantum/led_tables.h30
-rw-r--r--quantum/quantum.c10
-rw-r--r--quantum/rgblight.c58
-rw-r--r--quantum/serial_link/system/serial_link.c2
-rw-r--r--quantum/visualizer/example_integration/callbacks.c36
-rw-r--r--quantum/visualizer/example_integration/gfxconf.h325
-rw-r--r--quantum/visualizer/example_integration/lcd_backlight_hal.c91
-rw-r--r--quantum/visualizer/example_integration/visualizer_user.c121
-rw-r--r--quantum/visualizer/lcd_backlight.c8
-rw-r--r--quantum/visualizer/lcd_backlight.h4
-rw-r--r--quantum/visualizer/lcd_backlight_keyframes.c77
-rw-r--r--quantum/visualizer/lcd_backlight_keyframes.h30
-rw-r--r--quantum/visualizer/lcd_keyframes.c188
-rw-r--r--quantum/visualizer/lcd_keyframes.h39
-rw-r--r--quantum/visualizer/led_keyframes.c (renamed from quantum/visualizer/led_test.c)57
-rw-r--r--quantum/visualizer/led_keyframes.h (renamed from quantum/visualizer/led_test.h)20
-rw-r--r--quantum/visualizer/resources/lcd_logo.c61
-rw-r--r--quantum/visualizer/resources/lcd_logo.pngbin0 -> 490 bytes
-rw-r--r--quantum/visualizer/resources/resources.h27
-rw-r--r--quantum/visualizer/visualizer.c226
-rw-r--r--quantum/visualizer/visualizer.h41
-rw-r--r--quantum/visualizer/visualizer.mk21
-rw-r--r--quantum/visualizer/visualizer_keyframes.c23
-rw-r--r--quantum/visualizer/visualizer_keyframes.h26
-rw-r--r--readme.md2
-rw-r--r--tmk_core/common/action_util.c6
114 files changed, 5047 insertions, 1679 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 82464d583..9da8277db 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -7,11 +7,11 @@ endif
7include common.mk 7include common.mk
8 8
9ifneq ($(SUBPROJECT),) 9ifneq ($(SUBPROJECT),)
10 TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP) 10 TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
11 KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT) 11 KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT)
12else 12else
13 TARGET ?= $(KEYBOARD)_$(KEYMAP) 13 TARGET ?= $(KEYBOARD)_$(KEYMAP)
14 KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD) 14 KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
15endif 15endif
16 16
17# Force expansion 17# Force expansion
@@ -20,15 +20,15 @@ TARGET := $(TARGET)
20 20
21MASTER ?= left 21MASTER ?= left
22ifdef master 22ifdef master
23 MASTER = $(master) 23 MASTER = $(master)
24endif 24endif
25 25
26ifeq ($(MASTER),right) 26ifeq ($(MASTER),right)
27 OPT_DEFS += -DMASTER_IS_ON_RIGHT 27 OPT_DEFS += -DMASTER_IS_ON_RIGHT
28else 28else
29 ifneq ($(MASTER),left) 29 ifneq ($(MASTER),left)
30$(error MASTER does not have a valid value(left/right)) 30$(error MASTER does not have a valid value(left/right))
31 endif 31 endif
32endif 32endif
33 33
34 34
@@ -56,31 +56,31 @@ endif
56 56
57# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA 57# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
58ifdef MCU_FAMILY 58ifdef MCU_FAMILY
59 PLATFORM=CHIBIOS 59 PLATFORM=CHIBIOS
60else 60else
61 PLATFORM=AVR 61 PLATFORM=AVR
62endif 62endif
63 63
64ifeq ($(PLATFORM),CHIBIOS) 64ifeq ($(PLATFORM),CHIBIOS)
65 include $(TMK_PATH)/protocol/chibios.mk 65 include $(TMK_PATH)/protocol/chibios.mk
66 include $(TMK_PATH)/chibios.mk 66 include $(TMK_PATH)/chibios.mk
67 OPT_OS = chibios 67 OPT_OS = chibios
68 ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","") 68 ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","")
69 OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h 69 OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h
70 else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","") 70 else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
71 OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h 71 OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h
72 else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","") 72 else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","")
73 OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h 73 OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h
74 else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","") 74 else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
75 OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h 75 OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h
76 endif 76 endif
77endif 77endif
78 78
79CONFIG_H = $(KEYBOARD_PATH)/config.h 79CONFIG_H = $(KEYBOARD_PATH)/config.h
80ifneq ($(SUBPROJECT),) 80ifneq ($(SUBPROJECT),)
81 ifneq ("$(wildcard $(SUBPROJECT_C))","") 81 ifneq ("$(wildcard $(SUBPROJECT_C))","")
82 CONFIG_H = $(SUBPROJECT_PATH)/config.h 82 CONFIG_H = $(SUBPROJECT_PATH)/config.h
83 endif 83 endif
84endif 84endif
85 85
86# Save the defines and includes here, so we don't include any keymap specific ones 86# Save the defines and includes here, so we don't include any keymap specific ones
@@ -112,30 +112,30 @@ KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
112 112
113 113
114ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") 114ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
115 CONFIG_H = $(KEYMAP_PATH)/config.h 115 CONFIG_H = $(KEYMAP_PATH)/config.h
116endif 116endif
117 117
118# # project specific files 118# # project specific files
119SRC += $(KEYBOARD_C) \ 119SRC += $(KEYBOARD_C) \
120 $(KEYMAP_C) \ 120 $(KEYMAP_C) \
121 $(QUANTUM_DIR)/quantum.c \ 121 $(QUANTUM_DIR)/quantum.c \
122 $(QUANTUM_DIR)/keymap_common.c \ 122 $(QUANTUM_DIR)/keymap_common.c \
123 $(QUANTUM_DIR)/keycode_config.c \ 123 $(QUANTUM_DIR)/keycode_config.c \
124 $(QUANTUM_DIR)/process_keycode/process_leader.c 124 $(QUANTUM_DIR)/process_keycode/process_leader.c
125 125
126ifneq ($(SUBPROJECT),) 126ifneq ($(SUBPROJECT),)
127 SRC += $(SUBPROJECT_C) 127 SRC += $(SUBPROJECT_C)
128endif 128endif
129 129
130ifndef CUSTOM_MATRIX 130ifndef CUSTOM_MATRIX
131 SRC += $(QUANTUM_DIR)/matrix.c 131 SRC += $(QUANTUM_DIR)/matrix.c
132endif 132endif
133 133
134ifeq ($(strip $(API_SYSEX_ENABLE)), yes) 134ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
135 OPT_DEFS += -DAPI_SYSEX_ENABLE 135 OPT_DEFS += -DAPI_SYSEX_ENABLE
136 SRC += $(QUANTUM_DIR)/api/api_sysex.c 136 SRC += $(QUANTUM_DIR)/api/api_sysex.c
137 OPT_DEFS += -DAPI_ENABLE 137 OPT_DEFS += -DAPI_ENABLE
138 SRC += $(QUANTUM_DIR)/api.c 138 SRC += $(QUANTUM_DIR)/api.c
139 MIDI_ENABLE=yes 139 MIDI_ENABLE=yes
140endif 140endif
141 141
@@ -144,25 +144,25 @@ MUSIC_ENABLE := 0
144ifeq ($(strip $(AUDIO_ENABLE)), yes) 144ifeq ($(strip $(AUDIO_ENABLE)), yes)
145 OPT_DEFS += -DAUDIO_ENABLE 145 OPT_DEFS += -DAUDIO_ENABLE
146 MUSIC_ENABLE := 1 146 MUSIC_ENABLE := 1
147 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c 147 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
148 SRC += $(QUANTUM_DIR)/audio/audio.c 148 SRC += $(QUANTUM_DIR)/audio/audio.c
149 SRC += $(QUANTUM_DIR)/audio/voices.c 149 SRC += $(QUANTUM_DIR)/audio/voices.c
150 SRC += $(QUANTUM_DIR)/audio/luts.c 150 SRC += $(QUANTUM_DIR)/audio/luts.c
151endif 151endif
152 152
153ifeq ($(strip $(MIDI_ENABLE)), yes) 153ifeq ($(strip $(MIDI_ENABLE)), yes)
154 OPT_DEFS += -DMIDI_ENABLE 154 OPT_DEFS += -DMIDI_ENABLE
155 MUSIC_ENABLE := 1 155 MUSIC_ENABLE := 1
156 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c 156 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
157endif 157endif
158 158
159ifeq ($(MUSIC_ENABLE), 1) 159ifeq ($(MUSIC_ENABLE), 1)
160 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c 160 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
161endif 161endif
162 162
163ifeq ($(strip $(COMBO_ENABLE)), yes) 163ifeq ($(strip $(COMBO_ENABLE)), yes)
164 OPT_DEFS += -DCOMBO_ENABLE 164 OPT_DEFS += -DCOMBO_ENABLE
165 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c 165 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
166endif 166endif
167 167
168ifeq ($(strip $(VIRTSER_ENABLE)), yes) 168ifeq ($(strip $(VIRTSER_ENABLE)), yes)
@@ -171,56 +171,80 @@ endif
171 171
172ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes) 172ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
173 OPT_DEFS += -DFAUXCLICKY_ENABLE 173 OPT_DEFS += -DFAUXCLICKY_ENABLE
174 SRC += $(QUANTUM_DIR)/fauxclicky.c 174 SRC += $(QUANTUM_DIR)/fauxclicky.c
175endif 175endif
176 176
177ifeq ($(strip $(UCIS_ENABLE)), yes) 177ifeq ($(strip $(UCIS_ENABLE)), yes)
178 OPT_DEFS += -DUCIS_ENABLE 178 OPT_DEFS += -DUCIS_ENABLE
179 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c 179 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
180 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c 180 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
181endif 181endif
182 182
183ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) 183ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
184 OPT_DEFS += -DUNICODEMAP_ENABLE 184 OPT_DEFS += -DUNICODEMAP_ENABLE
185 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c 185 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
186 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c 186 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
187endif 187endif
188 188
189ifeq ($(strip $(UNICODE_ENABLE)), yes) 189ifeq ($(strip $(UNICODE_ENABLE)), yes)
190 OPT_DEFS += -DUNICODE_ENABLE 190 OPT_DEFS += -DUNICODE_ENABLE
191 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c 191 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
192 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c 192 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
193endif 193endif
194 194
195ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) 195ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
196 OPT_DEFS += -DRGBLIGHT_ENABLE 196 OPT_DEFS += -DRGBLIGHT_ENABLE
197 SRC += $(QUANTUM_DIR)/light_ws2812.c 197 SRC += $(QUANTUM_DIR)/light_ws2812.c
198 SRC += $(QUANTUM_DIR)/rgblight.c 198 SRC += $(QUANTUM_DIR)/rgblight.c
199 CIE1931_CURVE = yes
200 LED_BREATHING_TABLE = yes
199endif 201endif
200 202
201ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 203ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
202 OPT_DEFS += -DTAP_DANCE_ENABLE 204 OPT_DEFS += -DTAP_DANCE_ENABLE
203 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c 205 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
204endif 206endif
205 207
206ifeq ($(strip $(PRINTING_ENABLE)), yes) 208ifeq ($(strip $(PRINTING_ENABLE)), yes)
207 OPT_DEFS += -DPRINTING_ENABLE 209 OPT_DEFS += -DPRINTING_ENABLE
208 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c 210 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
209 SRC += $(TMK_DIR)/protocol/serial_uart.c 211 SRC += $(TMK_DIR)/protocol/serial_uart.c
210endif 212endif
211 213
212ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) 214ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
213 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) 215 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
214 OPT_DEFS += $(SERIAL_DEFS) 216 OPT_DEFS += $(SERIAL_DEFS)
215 VAPTH += $(SERIAL_PATH) 217 VAPTH += $(SERIAL_PATH)
216endif 218endif
217 219
218ifneq ($(strip $(VARIABLE_TRACE)),) 220ifneq ($(strip $(VARIABLE_TRACE)),)
219 SRC += $(QUANTUM_DIR)/variable_trace.c 221 SRC += $(QUANTUM_DIR)/variable_trace.c
220 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE)) 222 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
221ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),) 223ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
222 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE)) 224 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
225endif
226endif
227
228ifeq ($(strip $(LCD_ENABLE)), yes)
229 CIE1931_CURVE = yes
223endif 230endif
231
232ifeq ($(strip $(LED_ENABLE)), yes)
233 CIE1931_CURVE = yes
234endif
235
236ifeq ($(strip $(CIE1931_CURVE)), yes)
237 OPT_DEFS += -DUSE_CIE1931_CURVE
238 LED_TABLES = yes
239endif
240
241ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
242 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
243 LED_TABLES = yes
244endif
245
246ifeq ($(strip $(LED_TABLES)), yes)
247 SRC += $(QUANTUM_DIR)/led_tables.c
224endif 248endif
225 249
226# Optimize size but this may cause error "relocation truncated to fit" 250# Optimize size but this may cause error "relocation truncated to fit"
@@ -229,7 +253,7 @@ endif
229# Search Path 253# Search Path
230VPATH += $(KEYMAP_PATH) 254VPATH += $(KEYMAP_PATH)
231ifneq ($(SUBPROJECT),) 255ifneq ($(SUBPROJECT),)
232 VPATH += $(SUBPROJECT_PATH) 256 VPATH += $(SUBPROJECT_PATH)
233endif 257endif
234VPATH += $(KEYBOARD_PATH) 258VPATH += $(KEYBOARD_PATH)
235VPATH += $(COMMON_VPATH) 259VPATH += $(COMMON_VPATH)
@@ -243,27 +267,27 @@ EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
243 267
244ifeq ($(PLATFORM),AVR) 268ifeq ($(PLATFORM),AVR)
245ifeq ($(strip $(PROTOCOL)), VUSB) 269ifeq ($(strip $(PROTOCOL)), VUSB)
246 include $(TMK_PATH)/protocol/vusb.mk 270 include $(TMK_PATH)/protocol/vusb.mk
247else 271else
248 include $(TMK_PATH)/protocol/lufa.mk 272 include $(TMK_PATH)/protocol/lufa.mk
249endif 273endif
250 include $(TMK_PATH)/avr.mk 274 include $(TMK_PATH)/avr.mk
251endif 275endif
252 276
253ifeq ($(strip $(VISUALIZER_ENABLE)), yes) 277ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
254 VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer 278 VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
255 VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer 279 VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
256 include $(VISUALIZER_PATH)/visualizer.mk 280 include $(VISUALIZER_PATH)/visualizer.mk
257endif 281endif
258 282
259OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) 283OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
260$(KEYMAP_OUTPUT)_SRC := $(SRC) 284$(KEYMAP_OUTPUT)_SRC := $(SRC)
261$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" 285$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
262$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) 286$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
263$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) 287$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
264$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) 288$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
265$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) 289$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
266$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) 290$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
267$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) 291$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
268 292
269# Default target. 293# Default target.
diff --git a/doc/BUILD_GUIDE.md b/doc/BUILD_GUIDE.md
index 175019183..78cf00b91 100644
--- a/doc/BUILD_GUIDE.md
+++ b/doc/BUILD_GUIDE.md
@@ -96,7 +96,7 @@ The keyboard `config.h` is included only if the keymap one doesn't exist. The fo
96``` 96```
97#undef MY_SETTING 97#undef MY_SETTING
98#define MY_SETTING 4 98#define MY_SETTING 4
99```c 99```
100 100
101For a value of `4` for this imaginary setting. So we `undef` it first, then `define` it. 101For a value of `4` for this imaginary setting. So we `undef` it first, then `define` it.
102 102
diff --git a/keyboards/atomic/keymaps/twolayer.c b/keyboards/atomic/keymaps/twolayer.c
new file mode 100644
index 000000000..8ea045d80
--- /dev/null
+++ b/keyboards/atomic/keymaps/twolayer.c
@@ -0,0 +1,72 @@
1#include "atomic.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4
5/* QWERTY - MIT ENHANCED / GRID COMPATIBLE
6 * .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
7 * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
8 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
9 * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
10 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
11 * | LCTRL1 | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP |
12 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
13 * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
14 * |--------+--------+--------+--------+--------+- 6.25u ---------+--------+--------+--------+--------+-----------------+--------+--------|
15 * | BRITE | LALT | FN | XXXXXX . SPACE | RCTRL | RALT | FN | LEFT | DOWN | RIGHT |
16 * '--------------------------------------------------------------------------------------------------------------------------------------'
17 */
18
19 [0] = { /* QWERTY */
20 { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
21 { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
22 { KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP },
23 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
24 { M(0), KC_ALT, MO(1), KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RCTL, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT },
25 },
26
27
28/* FUNCTION
29 * .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
30 * | GRV | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . |
31 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
32 * | SCR LK | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | PAUSE | PR SCR |
33 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
34 * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | XXXXXX . | WHEEL+ |
35 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
36 * | NUM LK | | | | | | | | INSERT | END1 | HOME | XXXXXX . | MOUS U | WHEEL- |
37 * |--------+--------+--------+--------+--------+- 6.25 ------------+--------+--------+------+--------+-----------------+--------+--------|
38 * | | | FN | XXXXXX . MS BT1 | | | FN | MOUS L | MOUS D | MOUS R |
39 * '--------------------------------------------------------------------------------------------------------------------------------------'
40 */
41
42 [1] = { /* FUNCTION LAYER*/
43 { 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, ___T___, ___T___ },
44 { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
45 { KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U },
46 { KC_NLCK, _______, _______, _______, _______, _______, _______, _______, KC_INSERT, KC_END, KC_HOME, ___T___, ___T___, KC_MS_U, KC_WH_D },
47 { _______, _______, MO(1), _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, MO(1), KC_MS_L, KC_MS_D, KC_MS_R },
48 },
49};
50
51const uint16_t PROGMEM fn_actions[] = {
52 [1] = ACTION_LAYER_MOMENTARY(1),
53 [2] = ACTION_LAYER_MOMENTARY(1),
54};
55
56const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
57{
58 // MACRODOWN only works in this function
59 switch(id) {
60 case 0:
61 if (record->event.pressed) {
62 register_code(KC_RSFT);
63 #ifdef BACKLIGHT_ENABLE
64 backlight_step();
65 #endif
66 } else {
67 unregister_code(KC_RSFT);
68 }
69 break;
70 }
71 return MACRO_NONE;
72};
diff --git a/keyboards/atreus/keymaps/default/keymap.c b/keyboards/atreus/keymaps/default/keymap.c
index ce92e89c9..15ebad14d 100644
--- a/keyboards/atreus/keymaps/default/keymap.c
+++ b/keyboards/atreus/keymaps/default/keymap.c
@@ -39,8 +39,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39[_LW] = { /* [> LOWER <] */ 39[_LW] = { /* [> LOWER <] */
40 {KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10}, 40 {KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10},
41 {KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11}, 41 {KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11},
42 {KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, RESET, KC_LCTL, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12}, 42 {KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_LCTL, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12},
43 {KC_TRNS, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LALT, KC_SPC, DF(_QW), KC_PSCR, KC_SLCK, KC_PAUS} 43 {KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS}
44}}; 44}};
45 45
46const uint16_t PROGMEM fn_actions[] = { 46const uint16_t PROGMEM fn_actions[] = {
diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c
index b418cc9b5..ed943eb66 100644
--- a/keyboards/atreus/keymaps/xyverz/keymap.c
+++ b/keyboards/atreus/keymaps/xyverz/keymap.c
@@ -12,49 +12,156 @@ extern keymap_config_t keymap_config;
12// The underscores don't mean anything - you can have a layer called STUFF or any other name. 12// The underscores don't mean anything - you can have a layer called STUFF or any other name.
13// Layer names don't all need to be of the same length, obviously, and you can also skip them 13// Layer names don't all need to be of the same length, obviously, and you can also skip them
14// entirely and just use numbers. 14// entirely and just use numbers.
15#define _DV 0 15#define _DVORAK 0
16#define _QW 1 16#define _QWERTY 1
17#define _CM 2 17#define _COLEMAK 2
18#define _L1 3 18#define _DVORMAC 3
19#define _L2 4 19#define _LOWER 4
20#define _RAISE 5
21#define _ADJUST 16
20 22
21// Macro name shortcuts 23enum planck_keycodes {
22#define DVORAK M(_DV) 24 DVORAK = SAFE_RANGE,
23#define QWERTY M(_QW) 25 QWERTY,
24#define COLEMAK M(_CM) 26 COLEMAK,
27 DVORMAC,
28 LOWER,
29 RAISE,
30 BACKLIT
31};
32
33// Adding macros to make the keymaps below much easier to read.
34#define SFTSCLN SFT_T(KC_SCLN)
35#define SFTSLSH SFT_T(KC_SLSH)
36#define SFTZED SFT_T(KC_Z)
37#define ALTENT ALT_T(KC_ENT)
38#define ESCTRL CTL_T(KC_ESC)
39#define TABALT ALT_T(KC_TAB)
25 40
41// Fillers to make layering more clear
42#define _______ KC_TRNS
43#define XXXXXXX KC_NO
26 44
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 45const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28 [_DV] = { /* Dvorak */ 46/* Dvorak Layer
29 {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L }, 47 ,----------------------------------. ,----------------------------------.
30 {KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S }, 48 | ' | , | . | P | Y | | F | G | C | R | L |
31 {SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) }, 49 |------+------+------+------+------| |------+------+------+------+------|
32 {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL} 50 | A | O | E | U | I | | D | H | T | N | S |
51 |------+------+------+------+------|------.,------|------+------+------+------+------|
52 |SFT/ ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |SFT/ Z|
53 |------+------+------+------+------| ||Enter |------+------+------+------+------|
54 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
55 `----------------------------------' `----------------------------------' */
56 [_DVORAK] = {
57 {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L },
58 {KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S },
59 {SFTSCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCTL, KC_B, KC_M, KC_W, KC_V, SFTZED },
60 {ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS}
61 },
62
63/* QWERTY Layer
64 ,----------------------------------. ,----------------------------------.
65 | Q | W | E | R | T | | Y | U | I | O | P |
66 |------+------+------+------+------| |------+------+------+------+------|
67 | A | S | D | F | G | | H | J | K | L | ; |
68 |------+------+------+------+------|------.,------|------+------+------+------+------|
69 |SFT/ Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |SFT/ /|
70 |------+------+------+------+------| ||Enter |------+------+------+------+------|
71 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
72 `----------------------------------' `----------------------------------' */
73 [_QWERTY] = {
74 {KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P },
75 {KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
76 {SFTZED, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_N, KC_M, KC_COMM, KC_DOT, SFTSLSH},
77 {ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS}
78 },
79
80/* Colemak Layer
81 ,----------------------------------. ,----------------------------------.
82 | Q | W | F | P | G | | J | L | U | Y | L |
83 |------+------+------+------+------| |------+------+------+------+------|
84 | A | R | S | T | D | | H | N | E | I | S |
85 |------+------+------+------+------|------.,------|------+------+------+------+------|
86 |SFT/ Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |SFT/ /|
87 |------+------+------+------+------| ||Enter |------+------+------+------+------|
88 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
89 `----------------------------------' `----------------------------------'*/
90 [_COLEMAK] = {
91 {KC_Q, KC_W, KC_F, KC_P, KC_G, XXXXXXX, KC_J, KC_L, KC_U, KC_Y, KC_SCLN},
92 {KC_A, KC_R, KC_S, KC_T, KC_D, XXXXXXX, KC_H, KC_N, KC_E, KC_I, KC_O },
93 {SFTZED, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_K, KC_M, KC_COMM, KC_DOT, SFTSLSH},
94 {ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS}
33 }, 95 },
34 [_QW] = { /* Qwerty */ 96
35 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, 97/* Dvorak Layer with Command key on left thumb instead of Control
36 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, 98 ,----------------------------------. ,----------------------------------.
37 {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, 99 | ' | , | . | P | Y | | F | G | C | R | L |
38 {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} 100 |------+------+------+------+------| |------+------+------+------+------|
101 | A | O | E | U | I | | D | H | T | N | S |
102 |------+------+------+------+------|------.,------|------+------+------+------+------|
103 |SFT/ ;| Q | J | K | X | CMD ||Alt / | B | M | W | V |SFT/ Z|
104 |------+------+------+------+------| ||Enter |------+------+------+------+------|
105 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
106 `----------------------------------' `----------------------------------' */
107 [_DVORMAC] = {
108 {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L },
109 {KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S },
110 {SFTSCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI, KC_B, KC_M, KC_W, KC_V, SFTZED },
111 {ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS}
39 }, 112 },
40 [_CM] = { /* Colemak */ 113
41 {KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, 114/* LOWER Layer
42 {KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O }, 115 ,----------------------------------. ,----------------------------------.
43 {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, 116 | ! | @ | # | $ | % | | ^ | & | * | ( | ) |
44 {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} 117 |------+------+------+------+------| |------+------+------+------+------|
118 | CAPS | | UP | | Home | | PgDn | | + | { | } |
119 |------+------+------+------+------|------.,------|------+------+------+------+------|
120 | | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | |
121 |------+------+------+------+------| || |------+------+------+------+------|
122 | ~ | | | | Del |------'`------| Ins | | | | |
123 `----------------------------------' `----------------------------------'*/
124 [_LOWER] = {
125 {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
126 {KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_PLUS, KC_LCBR, KC_RCBR},
127 {_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, _______},
128 {KC_TILD, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______}
45 }, 129 },
46 [_L1] = { /* LAYER 1 */ 130
47 {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, 131/* RAISE Layer
48 {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL }, 132 ,----------------------------------. ,----------------------------------.
49 {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, 133 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
50 {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } 134 |------+------+------+------+------| |------+------+------+------+------|
135 | CAPS | | UP | | Home | | PgDn | | = | [ | ] |
136 |------+------+------+------+------|------.,------|------+------+------+------+------|
137 | | Left | Down | Right| End | || | PgUp | Prev | Play | Next | |
138 |------+------+------+------+------| || |------+------+------+------+------|
139 | ` | | | | Del |------'`------| Ins | | | | |
140 `----------------------------------' `----------------------------------'*/
141 [_RAISE] = {
142 {KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0 },
143 {KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_EQL, KC_LBRC, KC_RBRC},
144 {_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, _______},
145 {KC_GRV, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______}
51 }, 146 },
52 [_L2] = { /* LAYER 2 */ 147
53 {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, 148/* ADJUST Layer
54 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS}, 149 ,----------------------------------. ,----------------------------------.
55 {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, 150 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
56 {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} 151 |------+------+------+------+------| |------+------+------+------+------|
152 | F11 | | | | | | | PrSc | ScLk | Paus | F12 |
153 |------+------+------+------+------|------.,------|------+------+------+------+------|
154 | |QWERTY|COLEMK|DVORAK|DVORMC| || | | | | | |
155 |------+------+------+------+------| || |------+------+------+------+------|
156 | | | | | |------'`------| | | | | RESET|
157 `----------------------------------' `----------------------------------'*/
158 [_ADJUST] = {
159 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 },
160 {KC_F11, _______, _______, _______, _______, XXXXXXX, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_F12 },
161 {_______, QWERTY, COLEMAK, DVORAK, DVORMAC, _______, _______, _______, _______, _______, _______},
162 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }
57 } 163 }
164
58}; 165};
59 166
60const uint16_t PROGMEM fn_actions[] = { 167const uint16_t PROGMEM fn_actions[] = {
@@ -66,24 +173,52 @@ void persistant_default_layer_set(uint16_t default_layer) {
66 default_layer_set(default_layer); 173 default_layer_set(default_layer);
67} 174}
68 175
69const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 176bool process_record_user(uint16_t keycode, keyrecord_t *record) {
70{ 177 switch (keycode) {
71 switch(id) { 178 case QWERTY:
72 case _DV: 179 if (record->event.pressed) {
180 persistant_default_layer_set(1UL<<_QWERTY);
181 }
182 return false;
183 break;
184 case COLEMAK:
185 if (record->event.pressed) {
186 persistant_default_layer_set(1UL<<_COLEMAK);
187 }
188 return false;
189 break;
190 case DVORAK:
191 if (record->event.pressed) {
192 persistant_default_layer_set(1UL<<_DVORAK);
193 }
194 return false;
195 break;
196 case DVORMAC:
73 if (record->event.pressed) { 197 if (record->event.pressed) {
74 persistant_default_layer_set(1UL<<_DV); 198 persistant_default_layer_set(1UL<<_DVORMAC);
75 } 199 }
200 return false;
76 break; 201 break;
77 case _QW: 202 case LOWER:
78 if (record->event.pressed) { 203 if (record->event.pressed) {
79 persistant_default_layer_set(1UL<<_QW); 204 layer_on(_LOWER);
205 update_tri_layer(_LOWER, _RAISE, _ADJUST);
206 } else {
207 layer_off(_LOWER);
208 update_tri_layer(_LOWER, _RAISE, _ADJUST);
80 } 209 }
210 return false;
81 break; 211 break;
82 case _CM: 212 case RAISE:
83 if (record->event.pressed) { 213 if (record->event.pressed) {
84 persistant_default_layer_set(1UL<<_CM); 214 layer_on(_RAISE);
215 update_tri_layer(_LOWER, _RAISE, _ADJUST);
216 } else {
217 layer_off(_RAISE);
218 update_tri_layer(_LOWER, _RAISE, _ADJUST);
85 } 219 }
220 return false;
86 break; 221 break;
87 } 222 }
88 return MACRO_NONE; 223 return true;
89}; 224};
diff --git a/keyboards/atreus/keymaps/xyverz/readme.md b/keyboards/atreus/keymaps/xyverz/readme.md
new file mode 100644
index 000000000..ec7d836c1
--- /dev/null
+++ b/keyboards/atreus/keymaps/xyverz/readme.md
@@ -0,0 +1,107 @@
1# Xyverz's Atreus Keymap
2
3## About this keymap:
4
5This is the second iteration of my Atreus keymap. The first one was as close to the planck as I could get at the
6time, but still very much like the original Atreus keymap. I've managed to get things working better now and have
7implemented (more like copied) the RAISE/LOWER/ADJUST layers. This is a work in progress, but I think I'm closer
8to a final go with this.
9
10I'm using MOD_TAP quite a bit in this keymap. On all layers, R4 pinky keys use mod-tap and are SHIFT when held
11and their normal keys when tapped. In addition, ESC and TAB are also set as Ctrl and ALT respectively when held,
12and Enter/ALT on the right thumb key for all layers.
13
14I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts.
15
16Recently added: Documentation, Formatting, and another Dvorak layer that has Command on the left thumb, instead of
17Control.
18
19## Still to do:
20
21 * Enjoy this revision; figure out new things later.
22
23### Layer 0: Dvorak layer
24
25 ,----------------------------------. ,----------------------------------.
26 | ' | , | . | P | Y | | F | G | C | R | L |
27 |------+------+------+------+------| |------+------+------+------+------|
28 | A | O | E | U | I | | D | H | T | N | S |
29 |------+------+------+------+------|------.,------|------+------+------+------+------|
30 |Shft ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |Shft Z|
31 |------+------+------+------+------| ||Enter |------+------+------+------+------|
32 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
33 `----------------------------------' `----------------------------------'
34
35### Layer 1: QWERTY layer
36
37 ,----------------------------------. ,----------------------------------.
38 | Q | W | E | R | T | | Y | U | I | O | P |
39 |------+------+------+------+------| |------+------+------+------+------|
40 | A | S | D | F | G | | H | J | K | L | ; |
41 |------+------+------+------+------|------.,------|------+------+------+------+------|
42 |Shft Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |Shft /|
43 |------+------+------+------+------| ||Enter |------+------+------+------+------|
44 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
45 `----------------------------------' `----------------------------------'
46
47### Keymap 2: Colemak layer
48
49 ,----------------------------------. ,----------------------------------.
50 | Q | W | F | P | G | | J | L | U | Y | L |
51 |------+------+------+------+------| |------+------+------+------+------|
52 | A | R | S | T | D | | H | N | E | I | S |
53 |------+------+------+------+------|------.,------|------+------+------+------+------|
54 |Shft Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |Shft /|
55 |------+------+------+------+------| ||Enter |------+------+------+------+------|
56 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
57 `----------------------------------' `----------------------------------'
58
59### Keymap 3: Dvorak for Mac layout
60
61 ,----------------------------------. ,----------------------------------.
62 | ' | , | . | P | Y | | F | G | C | R | L |
63 |------+------+------+------+------| |------+------+------+------+------|
64 | A | O | E | U | I | | D | H | T | N | S |
65 |------+------+------+------+------|------.,------|------+------+------+------+------|
66 |SFT/ ;| Q | J | K | X | CMD ||Alt / | B | M | W | V |SFT/ Z|
67 |------+------+------+------+------| ||Enter |------+------+------+------+------|
68 | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
69 `----------------------------------' `----------------------------------'
70
71### Keymap 4: LOWER layer
72
73 ,----------------------------------. ,----------------------------------.
74 | ! | @ | # | $ | % | | ^ | & | * | ( | ) |
75 |------+------+------+------+------| |------+------+------+------+------|
76 | CAPS | | UP | | Home | | PgDn | | + | { | } |
77 |------+------+------+------+------|------.,------|------+------+------+------+------|
78 | | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | |
79 |------+------+------+------+------| || |------+------+------+------+------|
80 | ~ | | | | Del |------'`------| Ins | | | | |
81 `----------------------------------' `----------------------------------'
82
83
84### Keymap 5: RAISE layer
85
86 ,----------------------------------. ,----------------------------------.
87 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
88 |------+------+------+------+------| |------+------+------+------+------|
89 | CAPS | | UP | | Home | | PgDn | | = | [ | ] |
90 |------+------+------+------+------|------.,------|------+------+------+------+------|
91 | | Left | Down | Right| End | || | PgUp | Prev | Play | Next | |
92 |------+------+------+------+------| || |------+------+------+------+------|
93 | ` | | | | Del |------'`------| Ins | | | | |
94 `----------------------------------' `----------------------------------'
95
96### Keymap 6: ADJUST layer
97
98 ,----------------------------------. ,----------------------------------.
99 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
100 |------+------+------+------+------| |------+------+------+------+------|
101 | F11 | | | | | | | PScr | SLck | Paus | F12 |
102 |------+------+------+------+------|------.,------|------+------+------+------+------|
103 | |QWERTY|COLEMK|DVORAK|DVORMC| || | | | | | |
104 |------+------+------+------+------| || |------+------+------+------+------|
105 | | | | | |------'`------| | | | | RESET|
106 `----------------------------------' `----------------------------------'
107
diff --git a/keyboards/atreus62/keymaps/xyverz/keymap.c b/keyboards/atreus62/keymaps/xyverz/keymap.c
new file mode 100644
index 000000000..7b7c69f57
--- /dev/null
+++ b/keyboards/atreus62/keymaps/xyverz/keymap.c
@@ -0,0 +1,175 @@
1/* This is the Atreus62 keyboard layout by Xyverz aka u/Zrevyx on r/mk
2 I've blatantly stolen what works for me from the Planck and Preonic
3 layouts and modified this file to fit me. Initial credet goes to
4 u/profet23 for the doing all the work and adding this keyboard to
5 QMK in the first place.
6
7 I've got Dvorak, Qwerty, and Colemak layouts at this time, with the
8 possibility of adding more in the future.
9
10 The bottom row is fairly Kinesis-ish since the Contour and Advantage
11 keyboards have been my daily drivers for the last 17 years. I hope
12 You can get some enjoyment out of this layout should you chose it!
13
14CHANGELOG:
15
16 0.1 - Initial commit. Based off of Profet's default keymap.
17 0.2 - Converted to a more Planck/Preonic keymap style file with
18 persistent layers enabled. Renamed layers to reflect OLKB maps.
19 Added a TODO list.
20
21TODO:
22
23 * Make the layout more efficient, even if it means changing the RAISE
24 and LOWER functionality.
25 * Add legends in comments for each layer. Maybe.
26 * Add a gaming layer.
27
28*/
29
30// this is the style you want to emulate.
31// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
32#include "atreus62.h"
33#include "action_layer.h"
34#include "eeconfig.h"
35
36// Each layer gets a name for readability, which is then used in the keymap matrix below.
37// The underscores don't mean anything - you can have a layer called STUFF or any other name.
38// Layer names don't all need to be of the same length, obviously, and you can also skip them
39// entirely and just use numbers.
40#define _DVORAK 0
41#define _QWERTY 1
42#define _COLEMAK 2
43#define _WOW 3
44#define _LOWER 4
45#define _RAISE 5
46#define _ADJUST 16
47
48enum atreus52_keycodes {
49 DVORAK = SAFE_RANGE,
50 QWERTY,
51 COLEMAK,
52 WOW,
53 LOWER,
54 RAISE
55};
56
57// Fillers to make layering more clear
58#define _______ KC_TRNS
59#define XXXXXXX KC_NO
60
61const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
62 [_DVORAK] = { /* dvorak */
63 { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS },
64 { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, _______, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH },
65 { KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, _______, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS },
66 { KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT },
67 { KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL }
68 },
69
70 [_QWERTY] = { /* qwerty */
71 { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS },
72 { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL },
73 { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
74 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
75 { KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL }
76 },
77
78 [_COLEMAK] = { /* colemak */
79 { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS },
80 { KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL },
81 { KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT },
82 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
83 { KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL}
84 },
85
86 [_WOW] = { /* Dvorak with minor modifications for playing World of Warcraft */
87 { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS },
88 { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, _______, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH },
89 { KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, _______, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS },
90 { KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LALT, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT },
91 { KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, CTL_T(KC_ENT), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
92 },
93
94 [_LOWER] = {
95 { KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 },
96 { KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE },
97 { _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______ },
98 { _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______ },
99 { _______, _______, KC_HOME, KC_END, _______, KC_DEL, _______, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ }
100 },
101 [_RAISE] = {
102 { KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 },
103 { KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS },
104 { _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______ },
105 { _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______ },
106 { _______, _______, KC_HOME, KC_END, _______, KC_DEL, _______, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ }
107 },
108 [_ADJUST] = {
109 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
110 { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
111 { _______, _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, WOW },
112 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
113 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
114 },
115
116};
117
118const uint16_t PROGMEM fn_actions[] = {
119
120};
121
122void persistant_default_layer_set(uint16_t default_layer) {
123 eeconfig_update_default_layer(default_layer);
124 default_layer_set(default_layer);
125}
126
127bool process_record_user(uint16_t keycode, keyrecord_t *record) {
128 switch (keycode) {
129 case QWERTY:
130 if (record->event.pressed) {
131 persistant_default_layer_set(1UL<<_QWERTY);
132 }
133 return false;
134 break;
135 case COLEMAK:
136 if (record->event.pressed) {
137 persistant_default_layer_set(1UL<<_COLEMAK);
138 }
139 return false;
140 break;
141 case DVORAK:
142 if (record->event.pressed) {
143 persistant_default_layer_set(1UL<<_DVORAK);
144 }
145 return false;
146 break;
147 case WOW:
148 if (record->event.pressed) {
149 persistant_default_layer_set(1UL<<_WOW);
150 }
151 return false;
152 break;
153 case LOWER:
154 if (record->event.pressed) {
155 layer_on(_LOWER);
156 update_tri_layer(_LOWER, _RAISE, _ADJUST);
157 } else {
158 layer_off(_LOWER);
159 update_tri_layer(_LOWER, _RAISE, _ADJUST);
160 }
161 return false;
162 break;
163 case RAISE:
164 if (record->event.pressed) {
165 layer_on(_RAISE);
166 update_tri_layer(_LOWER, _RAISE, _ADJUST);
167 } else {
168 layer_off(_RAISE);
169 update_tri_layer(_LOWER, _RAISE, _ADJUST);
170 }
171 return false;
172 break;
173 }
174 return true;
175};
diff --git a/keyboards/clueboard/keymaps/xyverz/Makefile b/keyboards/clueboard/keymaps/xyverz/Makefile
new file mode 100644
index 000000000..950dadf84
--- /dev/null
+++ b/keyboards/clueboard/keymaps/xyverz/Makefile
@@ -0,0 +1,49 @@
1#----------------------------------------------------------------------------
2# On command line:
3#
4# make all = Make software.
5#
6# make clean = Clean out built project files.
7#
8# make coff = Convert ELF to AVR COFF.
9#
10# make extcoff = Convert ELF to AVR Extended COFF.
11#
12# make program = Download the hex file to the device.
13# Please customize your programmer settings(PROGRAM_CMD)
14#
15# make teensy = Download the hex file to the device, using teensy_loader_cli.
16# (must have teensy_loader_cli installed).
17#
18# make dfu = Download the hex file to the device, using dfu-programmer (must
19# have dfu-programmer installed).
20#
21# make flip = Download the hex file to the device, using Atmel FLIP (must
22# have Atmel FLIP installed).
23#
24# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
25# (must have dfu-programmer installed).
26#
27# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
28# (must have Atmel FLIP installed).
29#
30# make debug = Start either simulavr or avarice as specified for debugging,
31# with avr-gdb or avr-insight as the front end for debugging.
32#
33# make filename.s = Just compile filename.c into the assembler code only.
34#
35# make filename.i = Create a preprocessed source file for use in submitting
36# bug reports to the GCC project.
37#
38# To rebuild project do "make clean" then "make all".
39#----------------------------------------------------------------------------
40
41# Build Options
42# change to "no" to disable the options, or define them in the makefile.mk in
43# the appropriate keymap folder that will get included automatically
44#
45RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
46
47ifndef QUANTUM_DIR
48 include ../../../../Makefile
49endif \ No newline at end of file
diff --git a/keyboards/clueboard/keymaps/xyverz/keymap.c b/keyboards/clueboard/keymaps/xyverz/keymap.c
new file mode 100644
index 000000000..453911973
--- /dev/null
+++ b/keyboards/clueboard/keymaps/xyverz/keymap.c
@@ -0,0 +1,111 @@
1// Xyverz' keymap.
2// It's based on the default keymap, but Dvorak!
3
4#include "clueboard.h"
5
6// Used for SHIFT_ESC
7#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
8
9// Each layer gets a name for readability, which is then used in the keymap matrix below.
10// The underscores don't mean anything - you can have a layer called STUFF or any other name.
11// Layer names don't all need to be of the same length, obviously, and you can also skip them
12// entirely and just use numbers.
13#define _BL 0
14#define _FL 1
15#define _RS 2
16
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18 /* Keymap _BL: (Base Layer) Default Layer
19 * ,--------------------------------------------------------------------------. ,----.
20 * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| BS| |PGUP|
21 * |--------------------------------------------------------------------------| |----|
22 * | Tab| '| ,| .| P| Y| F| G| C| R| L| /| =| \| |PGDN|
23 * |--------------------------------------------------------------------------| `----'
24 * |_FL/Caps| A| O| E| U| I| H| D| H| T| N| S| - | Ent|
25 * |-----------------------------------------------------------------------------.
26 * |Shift| BS| ;| Q| J| K| X| B| M| W| V| Z| BS|Shift| UP|
27 * |------------------------------------------------------------------------|----|----.
28 * | Ctrl| Gui| Alt| MHen| Space| Space| Hen| Alt| Ctrl| _FL|LEFT|DOWN|RGHT|
29 * `----------------------------------------------------------------------------------'
30 */
31[_BL] = KEYMAP(
32 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_GRV, KC_BSPC, KC_PGUP, \
33 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGDN, \
34 LT(_FL, KC_CAPS), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_NUHS, KC_ENT, \
35 KC_LSFT, KC_RO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SLSH, KC_RSFT, KC_UP, \
36 KC_LCTL, KC_LALT, KC_LGUI, KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
37
38 /* Keymap _FL: Function Layer
39 * ,--------------------------------------------------------------------------. ,----.
40 * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
41 * |--------------------------------------------------------------------------| |----|
42 * | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
43 * |--------------------------------------------------------------------------| `----'
44 * | | | _RS| | | | | | | | | | | |
45 * |-----------------------------------------------------------------------------.
46 * | | | | | | | | | | | | | | |PGUP|
47 * |------------------------------------------------------------------------|----|----.
48 * | | | | | | | | | | _FL|HOME|PGDN| END|
49 * `----------------------------------------------------------------------------------'
50 */
51[_FL] = KEYMAP(
52 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_DEL, BL_STEP, \
53 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
54 KC_TRNS, KC_TRNS, MO(_RS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
55 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \
56 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_HOME, KC_PGDN, KC_END),
57
58 /* Keymap _RS: Reset layer
59 * ,--------------------------------------------------------------------------. ,----.
60 * | | | | | | | | | | | | | | | RGB| |VAL+|
61 * |--------------------------------------------------------------------------| |----|
62 * | | | | |RESET| | | | | | | | | | |VAL-|
63 * |--------------------------------------------------------------------------| `----'
64 * | | | _RS| | | | | | | | | | | |
65 * |-----------------------------------------------------------------------------.
66 * | | | | | | | | | | | | | | |SAT+|
67 * |------------------------------------------------------------------------|----|----.
68 * | | | | | | | | | | _FL|HUE-|SAT-|HUE+|
69 * `----------------------------------------------------------------------------------'
70 */
71[_RS] = KEYMAP(
72 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \
73 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \
74 KC_TRNS, KC_TRNS, MO(_RS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
75 MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \
76 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI),
77};
78
79enum function_id {
80 SHIFT_ESC,
81};
82
83const uint16_t PROGMEM fn_actions[] = {
84 [0] = ACTION_FUNCTION(SHIFT_ESC),
85};
86
87void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
88 static uint8_t shift_esc_shift_mask;
89 switch (id) {
90 case SHIFT_ESC:
91 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
92 if (record->event.pressed) {
93 if (shift_esc_shift_mask) {
94 add_key(KC_GRV);
95 send_keyboard_report();
96 } else {
97 add_key(KC_ESC);
98 send_keyboard_report();
99 }
100 } else {
101 if (shift_esc_shift_mask) {
102 del_key(KC_GRV);
103 send_keyboard_report();
104 } else {
105 del_key(KC_ESC);
106 send_keyboard_report();
107 }
108 }
109 break;
110 }
111}
diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h
index 361859832..994a8c643 100644
--- a/keyboards/ergodox/config.h
+++ b/keyboards/ergodox/config.h
@@ -34,4 +34,4 @@
34#endif 34#endif
35 35
36 36
37#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ \ No newline at end of file 37#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h
index e4f95c302..a3347de45 100644
--- a/keyboards/ergodox/ez/config.h
+++ b/keyboards/ergodox/ez/config.h
@@ -49,6 +49,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
49#define RGBLIGHT_SAT_STEP 255 49#define RGBLIGHT_SAT_STEP 255
50#define RGBLIGHT_VAL_STEP 12 50#define RGBLIGHT_VAL_STEP 12
51 51
52/* fix space cadet rollover issue */
53#define DISABLE_SPACE_CADET_ROLLOVER
54
52// #define RGB_MIDI 55// #define RGB_MIDI
53#define RGBW_BB_TWI 56#define RGBW_BB_TWI
54 57
diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk
index 64b2db815..6cd1c0c4f 100644
--- a/keyboards/ergodox/ez/rules.mk
+++ b/keyboards/ergodox/ez/rules.mk
@@ -74,7 +74,3 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
74SLEEP_LED_ENABLE = no 74SLEEP_LED_ENABLE = no
75API_SYSEX_ENABLE ?= no 75API_SYSEX_ENABLE ?= no
76RGBLIGHT_ENABLE ?= yes 76RGBLIGHT_ENABLE ?= yes
77
78ifndef QUANTUM_DIR
79 include ../../../Makefile
80endif
diff --git a/keyboards/ergodox/infinity/Makefile b/keyboards/ergodox/infinity/Makefile
index 191c6bb66..bd09e5885 100644
--- a/keyboards/ergodox/infinity/Makefile
+++ b/keyboards/ergodox/infinity/Makefile
@@ -1,3 +1,3 @@
1ifndef MAKEFILE_INCLUDED 1ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile 2 include ../../../Makefile
3endif \ No newline at end of file 3endif
diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c
new file mode 100644
index 000000000..4c9f6d9c8
--- /dev/null
+++ b/keyboards/ergodox/infinity/animations.c
@@ -0,0 +1,107 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#if defined(VISUALIZER_ENABLE)
18
19#include "animations.h"
20#include "visualizer.h"
21#ifdef LCD_ENABLE
22#include "lcd_keyframes.h"
23#endif
24#ifdef LCD_BACKLIGHT_ENABLE
25#include "lcd_backlight_keyframes.h"
26#endif
27
28#ifdef LED_ENABLE
29#include "led_keyframes.h"
30#endif
31
32#include "visualizer_keyframes.h"
33
34
35#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
36
37// Don't worry, if the startup animation is long, you can use the keyboard like normal
38// during that time
39keyframe_animation_t default_startup_animation = {
40 .num_frames = 4,
41 .loop = false,
42 .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0},
43 .frame_functions = {
44 lcd_keyframe_enable,
45 backlight_keyframe_enable,
46 lcd_keyframe_draw_logo,
47 backlight_keyframe_animate_color,
48 },
49};
50
51keyframe_animation_t default_suspend_animation = {
52 .num_frames = 4,
53 .loop = false,
54 .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0},
55 .frame_functions = {
56 lcd_keyframe_display_layer_text,
57 backlight_keyframe_animate_color,
58 lcd_keyframe_disable,
59 backlight_keyframe_disable,
60 },
61};
62#endif
63
64#if defined(LED_ENABLE)
65#define CROSSFADE_TIME 1000
66#define GRADIENT_TIME 3000
67
68keyframe_animation_t led_test_animation = {
69 .num_frames = 14,
70 .loop = true,
71 .frame_lengths = {
72 gfxMillisecondsToTicks(1000), // fade in
73 gfxMillisecondsToTicks(1000), // no op (leds on)
74 gfxMillisecondsToTicks(1000), // fade out
75 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
76 gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
77 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
78 gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
79 0, // mirror leds
80 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
81 gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
82 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
83 gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
84 0, // normal leds
85 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
86
87 },
88 .frame_functions = {
89 led_keyframe_fade_in_all,
90 keyframe_no_operation,
91 led_keyframe_fade_out_all,
92 led_keyframe_crossfade,
93 led_keyframe_left_to_right_gradient,
94 led_keyframe_crossfade,
95 led_keyframe_top_to_bottom_gradient,
96 led_keyframe_mirror_orientation,
97 led_keyframe_crossfade,
98 led_keyframe_left_to_right_gradient,
99 led_keyframe_crossfade,
100 led_keyframe_top_to_bottom_gradient,
101 led_keyframe_normal_orientation,
102 led_keyframe_crossfade,
103 },
104};
105#endif
106
107#endif
diff --git a/keyboards/ergodox/infinity/animations.h b/keyboards/ergodox/infinity/animations.h
new file mode 100644
index 000000000..6d8b9830d
--- /dev/null
+++ b/keyboards/ergodox/infinity/animations.h
@@ -0,0 +1,30 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
18#define KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
19
20#include "visualizer.h"
21
22// You can use these default animations, but of course you can also write your own custom ones instead
23extern keyframe_animation_t default_startup_animation;
24extern keyframe_animation_t default_suspend_animation;
25
26// An animation for testing and demonstrating the led support, should probably not be used for real world
27// cases
28extern keyframe_animation_t led_test_animation;
29
30#endif /* KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ */
diff --git a/keyboards/ergodox/infinity/config.h b/keyboards/ergodox/infinity/config.h
index 9e264083b..95f713819 100644
--- a/keyboards/ergodox/infinity/config.h
+++ b/keyboards/ergodox/infinity/config.h
@@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
40/* number of backlight levels */ 40/* number of backlight levels */
41#define BACKLIGHT_LEVELS 3 41#define BACKLIGHT_LEVELS 3
42 42
43#define LED_BRIGHTNESS_LO 15 43#define LED_BRIGHTNESS_LO 100
44#define LED_BRIGHTNESS_HI 255 44#define LED_BRIGHTNESS_HI 255
45 45
46/* define if matrix has ghost */ 46/* define if matrix has ghost */
@@ -54,6 +54,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
54// The visualizer needs gfx thread priorities 54// The visualizer needs gfx thread priorities
55#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2) 55#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2)
56 56
57#define VISUALIZER_USER_DATA_SIZE 16
58
57/* 59/*
58 * Feature disable options 60 * Feature disable options
59 * These options are also useful to firmware size reduction. 61 * These options are also useful to firmware size reduction.
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c
index 1d21f0c49..ea09c4bb0 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c
+++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c
@@ -25,6 +25,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
25 25
26#include "board_IS31FL3731C.h" 26#include "board_IS31FL3731C.h"
27 27
28
29// Can't include led_tables from here
30extern const uint8_t CIE1931_CURVE[];
31
28/*===========================================================================*/ 32/*===========================================================================*/
29/* Driver local definitions. */ 33/* Driver local definitions. */
30/*===========================================================================*/ 34/*===========================================================================*/
@@ -100,37 +104,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
100 104
101#define IS31 105#define IS31
102 106
103//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm
104const unsigned char cie[256] = {
105 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
106 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
107 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
108 3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
109 5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
110 7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
111 10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
112 13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
113 17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
114 22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
115 28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
116 34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
117 41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
118 49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
119 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
120 68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
121 80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
122 92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
123 106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
124 121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
125 138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
126 155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
127 175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
128 196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
129 218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
130 242, 245, 247, 250, 252, 255,
131};
132
133
134/*===========================================================================*/ 107/*===========================================================================*/
135/* Driver local functions. */ 108/* Driver local functions. */
136/*===========================================================================*/ 109/*===========================================================================*/
@@ -231,7 +204,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
231 uint8_t* src = PRIV(g)->frame_buffer; 204 uint8_t* src = PRIV(g)->frame_buffer;
232 for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) { 205 for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) {
233 for (int x=0;x<GDISP_SCREEN_WIDTH;x++) { 206 for (int x=0;x<GDISP_SCREEN_WIDTH;x++) {
234 PRIV(g)->write_buffer[get_led_address(g, x, y)]=cie[*src]; 207 PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[*src];
235 ++src; 208 ++src;
236 } 209 }
237 } 210 }
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h
index 290571ce5..e8c17e6e3 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h
+++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h
@@ -8,8 +8,6 @@
8#ifndef _GDISP_LLD_BOARD_H 8#ifndef _GDISP_LLD_BOARD_H
9#define _GDISP_LLD_BOARD_H 9#define _GDISP_LLD_BOARD_H
10 10
11#include "print.h"
12
13#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 11#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6
14#define ST7565_ADC ST7565_ADC_NORMAL 12#define ST7565_ADC ST7565_ADC_NORMAL
15#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC 13#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC
@@ -39,35 +37,49 @@
39// MSB First 37// MSB First
40// CLK Low by default 38// CLK Low by default
41static const SPIConfig spi1config = { 39static const SPIConfig spi1config = {
42 NULL, 40 // Operation complete callback or @p NULL.
43 /* HW dependent part.*/ 41 .end_cb = NULL,
44 ST7565_GPIOPORT, 42 //The chip select line port - when not using pcs.
45 ST7565_SS_PIN, 43 .ssport = ST7565_GPIOPORT,
46 SPIx_CTARn_FMSZ(7) 44 // brief The chip select line pad number - when not using pcs.
47 | SPIx_CTARn_ASC(7) 45 .sspad=ST7565_SS_PIN,
48 | SPIx_CTARn_DT(7) 46 // SPI initialization data.
49 | SPIx_CTARn_CSSCK(7) 47 .tar0 =
50 | SPIx_CTARn_PBR(0) 48 SPIx_CTARn_FMSZ(7) // Frame size = 8 bytes
51 | SPIx_CTARn_BR(7) 49 | SPIx_CTARn_ASC(1) // After SCK Delay Scaler (min 50 ns) = 55.56ns
52 //SPI_CR1_BR_0 50 | SPIx_CTARn_DT(0) // Delay After Transfer Scaler (no minimum)= 27.78ns
51 | SPIx_CTARn_CSSCK(0) // PCS to SCK Delay Scaler (min 20 ns) = 27.78ns
52 | SPIx_CTARn_PBR(0) // Baud Rate Prescaler = 2
53 | SPIx_CTARn_BR(0) // Baud rate (min 50ns) = 55.56ns
53}; 54};
54 55
55static bool_t st7565_is_data_mode = 1; 56static GFXINLINE void acquire_bus(GDisplay *g) {
57 (void) g;
58 // Only the LCD is using the SPI bus, so no need to acquire
59 // spiAcquireBus(&SPID1);
60 spiSelect(&SPID1);
61}
62
63static GFXINLINE void release_bus(GDisplay *g) {
64 (void) g;
65 // Only the LCD is using the SPI bus, so no need to release
66 //spiReleaseBus(&SPID1);
67 spiUnselect(&SPID1);
68}
56 69
57static GFXINLINE void init_board(GDisplay *g) { 70static GFXINLINE void init_board(GDisplay *g) {
58 (void) g; 71 (void) g;
59 palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); 72 palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL);
60 palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); 73 palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
61 st7565_is_data_mode = 1;
62 palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); 74 palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL);
63 palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); 75 palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN);
64 palSetPadModeRaw(MOSI, ST7565_SPI_MODE); 76 palSetPadModeRaw(MOSI, ST7565_SPI_MODE);
65 palSetPadModeRaw(SLCK, ST7565_SPI_MODE); 77 palSetPadModeRaw(SLCK, ST7565_SPI_MODE);
66 palSetPadModeRaw(SS, ST7565_SPI_MODE); 78 palSetPadModeRaw(SS, PAL_MODE_OUTPUT_PUSHPULL);
67 79
68 spiInit(); 80 spiInit();
69 spiStart(&SPID1, &spi1config); 81 spiStart(&SPID1, &spi1config);
70 spiSelect(&SPID1); 82 release_bus(g);
71} 83}
72 84
73static GFXINLINE void post_init_board(GDisplay *g) { 85static GFXINLINE void post_init_board(GDisplay *g) {
@@ -84,43 +96,17 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
84 } 96 }
85} 97}
86 98
87static GFXINLINE void acquire_bus(GDisplay *g) { 99static GFXINLINE void enter_data_mode(GDisplay *g) {
88 (void) g; 100 palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
89 // Only the LCD is using the SPI bus, so no need to acquire
90 // spiAcquireBus(&SPID1);
91} 101}
92 102
93static GFXINLINE void release_bus(GDisplay *g) { 103static GFXINLINE void enter_cmd_mode(GDisplay *g) {
94 (void) g; 104 palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN);
95 // Only the LCD is using the SPI bus, so no need to release
96 //spiReleaseBus(&SPID1);
97} 105}
98 106
99static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) {
100 (void) g;
101 if (st7565_is_data_mode) {
102 // The sleeps need to be at lest 10 vs 25 ns respectively
103 // So let's sleep two ticks, one tick might not be enough
104 // if we are at the end of the tick
105 chThdSleep(2);
106 palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN);
107 chThdSleep(2);
108 st7565_is_data_mode = 0;
109 }
110 spiSend(&SPID1, 1, &cmd);
111}
112 107
113static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { 108static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
114 (void) g; 109 (void) g;
115 if (!st7565_is_data_mode) {
116 // The sleeps need to be at lest 10 vs 25 ns respectively
117 // So let's sleep two ticks, one tick might not be enough
118 // if we are at the end of the tick
119 chThdSleep(2);
120 palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
121 chThdSleep(2);
122 st7565_is_data_mode = 1;
123 }
124 spiSend(&SPID1, length, data); 110 spiSend(&SPID1, length, data);
125} 111}
126 112
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
index c33aea81a..b04ad0293 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
+++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
@@ -20,16 +20,16 @@
20/*===========================================================================*/ 20/*===========================================================================*/
21 21
22#ifndef GDISP_SCREEN_HEIGHT 22#ifndef GDISP_SCREEN_HEIGHT
23 #define GDISP_SCREEN_HEIGHT 32 23#define GDISP_SCREEN_HEIGHT 32
24#endif 24#endif
25#ifndef GDISP_SCREEN_WIDTH 25#ifndef GDISP_SCREEN_WIDTH
26 #define GDISP_SCREEN_WIDTH 128 26#define GDISP_SCREEN_WIDTH 128
27#endif 27#endif
28#ifndef GDISP_INITIAL_CONTRAST 28#ifndef GDISP_INITIAL_CONTRAST
29 #define GDISP_INITIAL_CONTRAST 0 29#define GDISP_INITIAL_CONTRAST 35
30#endif 30#endif
31#ifndef GDISP_INITIAL_BACKLIGHT 31#ifndef GDISP_INITIAL_BACKLIGHT
32 #define GDISP_INITIAL_BACKLIGHT 100 32#define GDISP_INITIAL_BACKLIGHT 100
33#endif 33#endif
34 34
35#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) 35#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0)
@@ -40,16 +40,16 @@
40/* Driver config defaults for backward compatibility. */ 40/* Driver config defaults for backward compatibility. */
41/*===========================================================================*/ 41/*===========================================================================*/
42#ifndef ST7565_LCD_BIAS 42#ifndef ST7565_LCD_BIAS
43 #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 43#define ST7565_LCD_BIAS ST7565_LCD_BIAS_7
44#endif 44#endif
45#ifndef ST7565_ADC 45#ifndef ST7565_ADC
46 #define ST7565_ADC ST7565_ADC_NORMAL 46#define ST7565_ADC ST7565_ADC_NORMAL
47#endif 47#endif
48#ifndef ST7565_COM_SCAN 48#ifndef ST7565_COM_SCAN
49 #define ST7565_COM_SCAN ST7565_COM_SCAN_INC 49#define ST7565_COM_SCAN ST7565_COM_SCAN_INC
50#endif 50#endif
51#ifndef ST7565_PAGE_ORDER 51#ifndef ST7565_PAGE_ORDER
52 #define ST7565_PAGE_ORDER 0,1,2,3 52#define ST7565_PAGE_ORDER 0,1,2,3
53#endif 53#endif
54 54
55/*===========================================================================*/ 55/*===========================================================================*/
@@ -58,12 +58,24 @@
58 58
59typedef struct{ 59typedef struct{
60 bool_t buffer2; 60 bool_t buffer2;
61 uint8_t data_pos;
62 uint8_t data[16];
61 uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; 63 uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8];
62}PrivData; 64}PrivData;
63 65
64// Some common routines and macros 66// Some common routines and macros
65#define PRIV(g) ((PrivData*)g->priv) 67#define PRIV(g) ((PrivData*)g->priv)
66#define RAM(g) (PRIV(g)->ram) 68#define RAM(g) (PRIV(g)->ram)
69
70static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) {
71 PRIV(g)->data[PRIV(g)->data_pos++] = cmd;
72}
73
74static GFXINLINE void flush_cmd(GDisplay* g) {
75 write_data(g, PRIV(g)->data, PRIV(g)->data_pos);
76 PRIV(g)->data_pos = 0;
77}
78
67#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } 79#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); }
68#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } 80#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); }
69 81
@@ -86,207 +98,232 @@ typedef struct{
86 */ 98 */
87 99
88LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { 100LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
89 // The private area is the display surface. 101 // The private area is the display surface.
90 g->priv = gfxAlloc(sizeof(PrivData)); 102 g->priv = gfxAlloc(sizeof(PrivData));
91 PRIV(g)->buffer2 = false; 103 PRIV(g)->buffer2 = false;
92 104 PRIV(g)->data_pos = 0;
93 // Initialise the board interface 105
94 init_board(g); 106 // Initialise the board interface
95 107 init_board(g);
96 // Hardware reset 108
97 setpin_reset(g, TRUE); 109 // Hardware reset
98 gfxSleepMilliseconds(20); 110 setpin_reset(g, TRUE);
99 setpin_reset(g, FALSE); 111 gfxSleepMilliseconds(20);
100 gfxSleepMilliseconds(20); 112 setpin_reset(g, FALSE);
101 113 gfxSleepMilliseconds(20);
102 acquire_bus(g); 114 acquire_bus(g);
103 write_cmd(g, ST7565_DISPLAY_OFF); 115 enter_cmd_mode(g);
104 write_cmd(g, ST7565_LCD_BIAS); 116
117 write_cmd(g, ST7565_RESET);
118 write_cmd(g, ST7565_LCD_BIAS);
105 write_cmd(g, ST7565_ADC); 119 write_cmd(g, ST7565_ADC);
106 write_cmd(g, ST7565_COM_SCAN); 120 write_cmd(g, ST7565_COM_SCAN);
107
108 write_cmd(g, ST7565_START_LINE | 0);
109
110 write_cmd(g, ST7565_RESISTOR_RATIO | 0x6);
111
112 // turn on voltage converter (VC=1, VR=0, VF=0)
113 write_cmd(g, ST7565_POWER_CONTROL | 0x04);
114 delay_ms(50);
115 121
116 // turn on voltage regulator (VC=1, VR=1, VF=0) 122 write_cmd(g, ST7565_RESISTOR_RATIO | 0x1);
117 write_cmd(g, ST7565_POWER_CONTROL | 0x06); 123 write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST);
118 delay_ms(50);
119 124
120 // turn on voltage follower (VC=1, VR=1, VF=1) 125 // turn on internal power supply (VC=1, VR=1, VF=1)
121 write_cmd(g, ST7565_POWER_CONTROL | 0x07); 126 write_cmd(g, ST7565_POWER_CONTROL | 0x07);
122 delay_ms(50);
123 127
124 write_cmd(g, 0xE2); 128 write_cmd(g, ST7565_INVERT_DISPLAY);
125 write_cmd(g, ST7565_COM_SCAN); 129 write_cmd(g, ST7565_ALLON_NORMAL);
126 write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101);
127 //write_cmd2(g, ST7565_CONTRAST, 0);
128 write_cmd(g, ST7565_DISPLAY_ON);
129 write_cmd(g, ST7565_ALLON_NORMAL);
130 write_cmd(g, ST7565_INVERT_DISPLAY);
131 130
132 write_cmd(g, ST7565_RMW); 131 write_cmd(g, ST7565_START_LINE | 0);
132 write_cmd(g, ST7565_RMW);
133 flush_cmd(g);
133 134
134 // Finish Init 135 // Finish Init
135 post_init_board(g); 136 post_init_board(g);
136 137
137 // Release the bus 138 // Release the bus
138 release_bus(g); 139 release_bus(g);
139 140
140 /* Initialise the GDISP structure */ 141 /* Initialise the GDISP structure */
141 g->g.Width = GDISP_SCREEN_WIDTH; 142 g->g.Width = GDISP_SCREEN_WIDTH;
142 g->g.Height = GDISP_SCREEN_HEIGHT; 143 g->g.Height = GDISP_SCREEN_HEIGHT;
143 g->g.Orientation = GDISP_ROTATE_0; 144 g->g.Orientation = GDISP_ROTATE_0;
144 g->g.Powermode = powerOn; 145 g->g.Powermode = powerOff;
145 g->g.Backlight = GDISP_INITIAL_BACKLIGHT; 146 g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
146 g->g.Contrast = GDISP_INITIAL_CONTRAST; 147 g->g.Contrast = GDISP_INITIAL_CONTRAST;
147 return TRUE; 148 return TRUE;
148} 149}
149 150
150#if GDISP_HARDWARE_FLUSH 151#if GDISP_HARDWARE_FLUSH
151 LLDSPEC void gdisp_lld_flush(GDisplay *g) { 152LLDSPEC void gdisp_lld_flush(GDisplay *g) {
152 unsigned p; 153 unsigned p;
153 154
154 // Don't flush if we don't need it. 155 // Don't flush if we don't need it.
155 if (!(g->flags & GDISP_FLG_NEEDFLUSH)) 156 if (!(g->flags & GDISP_FLG_NEEDFLUSH))
156 return; 157 return;
157 158
158 acquire_bus(g); 159 acquire_bus(g);
159 unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); 160 enter_cmd_mode(g);
160 for (p = 0; p < 4; p++) { 161 unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0);
161 write_cmd(g, ST7565_PAGE | (p + dstOffset)); 162 for (p = 0; p < 4; p++) {
162 write_cmd(g, ST7565_COLUMN_MSB | 0); 163 write_cmd(g, ST7565_PAGE | (p + dstOffset));
163 write_cmd(g, ST7565_COLUMN_LSB | 0); 164 write_cmd(g, ST7565_COLUMN_MSB | 0);
164 write_cmd(g, ST7565_RMW); 165 write_cmd(g, ST7565_COLUMN_LSB | 0);
165 write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); 166 write_cmd(g, ST7565_RMW);
166 } 167 flush_cmd(g);
167 unsigned line = (PRIV(g)->buffer2 ? 32 : 0); 168 enter_data_mode(g);
168 write_cmd(g, ST7565_START_LINE | line); 169 write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH);
169 PRIV(g)->buffer2 = !PRIV(g)->buffer2; 170 enter_cmd_mode(g);
170 release_bus(g); 171 }
171 172 unsigned line = (PRIV(g)->buffer2 ? 32 : 0);
172 g->flags &= ~GDISP_FLG_NEEDFLUSH; 173 write_cmd(g, ST7565_START_LINE | line);
173 } 174 flush_cmd(g);
175 PRIV(g)->buffer2 = !PRIV(g)->buffer2;
176 release_bus(g);
177
178 g->flags &= ~GDISP_FLG_NEEDFLUSH;
179}
174#endif 180#endif
175 181
176#if GDISP_HARDWARE_DRAWPIXEL 182#if GDISP_HARDWARE_DRAWPIXEL
177 LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { 183LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
178 coord_t x, y; 184 coord_t x, y;
179 185
180 switch(g->g.Orientation) { 186 switch(g->g.Orientation) {
181 default: 187 default:
182 case GDISP_ROTATE_0: 188 case GDISP_ROTATE_0:
183 x = g->p.x; 189 x = g->p.x;
184 y = g->p.y; 190 y = g->p.y;
185 break; 191 break;
186 case GDISP_ROTATE_90: 192 case GDISP_ROTATE_90:
187 x = g->p.y; 193 x = g->p.y;
188 y = GDISP_SCREEN_HEIGHT-1 - g->p.x; 194 y = GDISP_SCREEN_HEIGHT-1 - g->p.x;
189 break; 195 break;
190 case GDISP_ROTATE_180: 196 case GDISP_ROTATE_180:
191 x = GDISP_SCREEN_WIDTH-1 - g->p.x; 197 x = GDISP_SCREEN_WIDTH-1 - g->p.x;
192 y = GDISP_SCREEN_HEIGHT-1 - g->p.y; 198 y = GDISP_SCREEN_HEIGHT-1 - g->p.y;
193 break; 199 break;
194 case GDISP_ROTATE_270: 200 case GDISP_ROTATE_270:
195 x = GDISP_SCREEN_HEIGHT-1 - g->p.y; 201 x = GDISP_SCREEN_HEIGHT-1 - g->p.y;
196 y = g->p.x; 202 y = g->p.x;
197 break; 203 break;
198 } 204 }
199 if (gdispColor2Native(g->p.color) != Black) 205 if (gdispColor2Native(g->p.color) != Black)
200 RAM(g)[xyaddr(x, y)] |= xybit(y); 206 RAM(g)[xyaddr(x, y)] |= xybit(y);
201 else 207 else
202 RAM(g)[xyaddr(x, y)] &= ~xybit(y); 208 RAM(g)[xyaddr(x, y)] &= ~xybit(y);
203 g->flags |= GDISP_FLG_NEEDFLUSH; 209 g->flags |= GDISP_FLG_NEEDFLUSH;
204 } 210}
205#endif 211#endif
206 212
207#if GDISP_HARDWARE_PIXELREAD 213#if GDISP_HARDWARE_PIXELREAD
208 LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { 214LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
209 coord_t x, y; 215 coord_t x, y;
210 216
211 switch(g->g.Orientation) { 217 switch(g->g.Orientation) {
212 default: 218 default:
213 case GDISP_ROTATE_0: 219 case GDISP_ROTATE_0:
214 x = g->p.x; 220 x = g->p.x;
215 y = g->p.y; 221 y = g->p.y;
216 break; 222 break;
217 case GDISP_ROTATE_90: 223 case GDISP_ROTATE_90:
218 x = g->p.y; 224 x = g->p.y;
219 y = GDISP_SCREEN_HEIGHT-1 - g->p.x; 225 y = GDISP_SCREEN_HEIGHT-1 - g->p.x;
220 break; 226 break;
221 case GDISP_ROTATE_180: 227 case GDISP_ROTATE_180:
222 x = GDISP_SCREEN_WIDTH-1 - g->p.x; 228 x = GDISP_SCREEN_WIDTH-1 - g->p.x;
223 y = GDISP_SCREEN_HEIGHT-1 - g->p.y; 229 y = GDISP_SCREEN_HEIGHT-1 - g->p.y;
224 break; 230 break;
225 case GDISP_ROTATE_270: 231 case GDISP_ROTATE_270:
226 x = GDISP_SCREEN_HEIGHT-1 - g->p.y; 232 x = GDISP_SCREEN_HEIGHT-1 - g->p.y;
227 y = g->p.x; 233 y = g->p.x;
228 break; 234 break;
229 } 235 }
230 return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; 236 return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black;
231 } 237}
232#endif 238#endif
233 239
240LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
241 uint8_t* buffer = (uint8_t*)g->p.ptr;
242 int linelength = g->p.cx;
243 for (int i = 0; i < g->p.cy; i++) {
244 unsigned dstx = g->p.x;
245 unsigned dsty = g->p.y + i;
246 unsigned srcx = g->p.x1;
247 unsigned srcy = g->p.y1 + i;
248 unsigned srcbit = srcy * g->p.x2 + srcx;
249 for(int j=0; j < linelength; j++) {
250 uint8_t src = buffer[srcbit / 8];
251 uint8_t bit = 7-(srcbit % 8);
252 uint8_t bitset = (src >> bit) & 1;
253 uint8_t* dst = &(RAM(g)[xyaddr(dstx, dsty)]);
254 if (bitset) {
255 *dst |= xybit(dsty);
256 }
257 else {
258 *dst &= ~xybit(dsty);
259 }
260 dstx++;
261 srcbit++;
262 }
263 }
264 g->flags |= GDISP_FLG_NEEDFLUSH;
265}
266
234#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL 267#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL
235 LLDSPEC void gdisp_lld_control(GDisplay *g) { 268LLDSPEC void gdisp_lld_control(GDisplay *g) {
236 switch(g->p.x) { 269 switch(g->p.x) {
237 case GDISP_CONTROL_POWER: 270 case GDISP_CONTROL_POWER:
238 if (g->g.Powermode == (powermode_t)g->p.ptr) 271 if (g->g.Powermode == (powermode_t)g->p.ptr)
239 return; 272 return;
240 switch((powermode_t)g->p.ptr) { 273 switch((powermode_t)g->p.ptr) {
241 case powerOff: 274 case powerOff:
242 case powerSleep: 275 case powerSleep:
243 case powerDeepSleep: 276 case powerDeepSleep:
244 acquire_bus(g); 277 acquire_bus(g);
245 write_cmd(g, ST7565_DISPLAY_OFF); 278 enter_cmd_mode(g);
246 release_bus(g); 279 write_cmd(g, ST7565_DISPLAY_OFF);
247 break; 280 flush_cmd(g);
248 case powerOn: 281 release_bus(g);
249 acquire_bus(g); 282 break;
250 write_cmd(g, ST7565_DISPLAY_ON); 283 case powerOn:
251 release_bus(g); 284 acquire_bus(g);
252 break; 285 enter_cmd_mode(g);
253 default: 286 write_cmd(g, ST7565_DISPLAY_ON);
254 return; 287 flush_cmd(g);
255 } 288 release_bus(g);
256 g->g.Powermode = (powermode_t)g->p.ptr; 289 break;
257 return; 290 default:
258 291 return;
259 case GDISP_CONTROL_ORIENTATION: 292 }
260 if (g->g.Orientation == (orientation_t)g->p.ptr) 293 g->g.Powermode = (powermode_t)g->p.ptr;
261 return; 294 return;
262 switch((orientation_t)g->p.ptr) { 295
263 /* Rotation is handled by the drawing routines */ 296 case GDISP_CONTROL_ORIENTATION:
264 case GDISP_ROTATE_0: 297 if (g->g.Orientation == (orientation_t)g->p.ptr)
265 case GDISP_ROTATE_180: 298 return;
266 g->g.Height = GDISP_SCREEN_HEIGHT; 299 switch((orientation_t)g->p.ptr) {
267 g->g.Width = GDISP_SCREEN_WIDTH; 300 /* Rotation is handled by the drawing routines */
268 break; 301 case GDISP_ROTATE_0:
269 case GDISP_ROTATE_90: 302 case GDISP_ROTATE_180:
270 case GDISP_ROTATE_270: 303 g->g.Height = GDISP_SCREEN_HEIGHT;
271 g->g.Height = GDISP_SCREEN_WIDTH; 304 g->g.Width = GDISP_SCREEN_WIDTH;
272 g->g.Width = GDISP_SCREEN_HEIGHT; 305 break;
273 break; 306 case GDISP_ROTATE_90:
274 default: 307 case GDISP_ROTATE_270:
275 return; 308 g->g.Height = GDISP_SCREEN_WIDTH;
276 } 309 g->g.Width = GDISP_SCREEN_HEIGHT;
277 g->g.Orientation = (orientation_t)g->p.ptr; 310 break;
278 return; 311 default:
279 312 return;
280 case GDISP_CONTROL_CONTRAST: 313 }
281 if ((unsigned)g->p.ptr > 100) 314 g->g.Orientation = (orientation_t)g->p.ptr;
282 g->p.ptr = (void *)100; 315 return;
283 acquire_bus(g); 316
284 write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); 317 case GDISP_CONTROL_CONTRAST:
285 release_bus(g); 318 g->g.Contrast = (unsigned)g->p.ptr & 63;
286 g->g.Contrast = (unsigned)g->p.ptr; 319 acquire_bus(g);
287 return; 320 enter_cmd_mode(g);
288 } 321 write_cmd2(g, ST7565_CONTRAST, g->g.Contrast);
289 } 322 flush_cmd(g);
323 release_bus(g);
324 return;
325 }
326}
290#endif // GDISP_NEED_CONTROL 327#endif // GDISP_NEED_CONTROL
291 328
292#endif // GFX_USE_GDISP 329#endif // GFX_USE_GDISP
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h
index 48587b9e1..2b66a877c 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h
+++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h
@@ -14,12 +14,13 @@
14/* Driver hardware support. */ 14/* Driver hardware support. */
15/*===========================================================================*/ 15/*===========================================================================*/
16 16
17#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing 17#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing
18#define GDISP_HARDWARE_DRAWPIXEL TRUE 18#define GDISP_HARDWARE_DRAWPIXEL TRUE
19#define GDISP_HARDWARE_PIXELREAD TRUE 19#define GDISP_HARDWARE_PIXELREAD TRUE
20#define GDISP_HARDWARE_CONTROL TRUE 20#define GDISP_HARDWARE_CONTROL TRUE
21#define GDISP_HARDWARE_BITFILLS TRUE
21 22
22#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO 23#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO
23 24
24#endif /* GFX_USE_GDISP */ 25#endif /* GFX_USE_GDISP */
25 26
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h
index 48636b33d..24924ff05 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h
+++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h
@@ -34,4 +34,6 @@
34#define ST7565_RESISTOR_RATIO 0x20 34#define ST7565_RESISTOR_RATIO 0x20
35#define ST7565_POWER_CONTROL 0x28 35#define ST7565_POWER_CONTROL 0x28
36 36
37#define ST7565_RESET 0xE2
38
37#endif /* _ST7565_H */ 39#endif /* _ST7565_H */
diff --git a/keyboards/ergodox/infinity/gfxconf.h b/keyboards/ergodox/infinity/gfxconf.h
index 8caa577b7..45b9f5858 100644
--- a/keyboards/ergodox/infinity/gfxconf.h
+++ b/keyboards/ergodox/infinity/gfxconf.h
@@ -143,7 +143,7 @@
143 #define GDISP_HARDWARE_DRAWPIXEL TRUE 143 #define GDISP_HARDWARE_DRAWPIXEL TRUE
144 #define GDISP_HARDWARE_CLEARS FALSE 144 #define GDISP_HARDWARE_CLEARS FALSE
145 #define GDISP_HARDWARE_FILLS FALSE 145 #define GDISP_HARDWARE_FILLS FALSE
146 #define GDISP_HARDWARE_BITFILLS FALSE 146 //#define GDISP_HARDWARE_BITFILLS FALSE
147 #define GDISP_HARDWARE_SCROLL FALSE 147 #define GDISP_HARDWARE_SCROLL FALSE
148 #define GDISP_HARDWARE_PIXELREAD TRUE 148 #define GDISP_HARDWARE_PIXELREAD TRUE
149 #define GDISP_HARDWARE_CONTROL TRUE 149 #define GDISP_HARDWARE_CONTROL TRUE
diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c
index 02db67eaf..62259ed3f 100644
--- a/keyboards/ergodox/infinity/infinity.c
+++ b/keyboards/ergodox/infinity/infinity.c
@@ -70,10 +70,33 @@ void lcd_backlight_hal_init(void) {
70 RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; 70 RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
71} 71}
72 72
73static uint16_t cie_lightness(uint16_t v) {
74 // The CIE 1931 formula for lightness
75 // Y = luminance (output) 0-1
76 // L = lightness input 0 - 100
77
78 // Y = (L* / 902.3) if L* <= 8
79 // Y = ((L* + 16) / 116)^3 if L* > 8
80
81 float l = 100.0f * (v / 65535.0f);
82 float y = 0.0f;
83 if (l <= 8.0f) {
84 y = l / 902.3;
85 }
86 else {
87 y = ((l + 16.0f) / 116.0f);
88 y = y * y * y;
89 if (y > 1.0f) {
90 y = 1.0f;
91 }
92 }
93 return y * 65535.0f;
94}
95
73void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { 96void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
74 CHANNEL_RED.CnV = r; 97 CHANNEL_RED.CnV = cie_lightness(r);
75 CHANNEL_GREEN.CnV = g; 98 CHANNEL_GREEN.CnV = cie_lightness(g);
76 CHANNEL_BLUE.CnV = b; 99 CHANNEL_BLUE.CnV = cie_lightness(b);
77} 100}
78 101
79__attribute__ ((weak)) 102__attribute__ ((weak))
@@ -103,34 +126,48 @@ void matrix_scan_kb(void) {
103 matrix_scan_user(); 126 matrix_scan_user();
104} 127}
105 128
129__attribute__ ((weak))
106void ergodox_board_led_on(void){ 130void ergodox_board_led_on(void){
107} 131}
108 132
133__attribute__ ((weak))
109void ergodox_right_led_1_on(void){ 134void ergodox_right_led_1_on(void){
110} 135}
111 136
137__attribute__ ((weak))
112void ergodox_right_led_2_on(void){ 138void ergodox_right_led_2_on(void){
113} 139}
114 140
141__attribute__ ((weak))
115void ergodox_right_led_3_on(void){ 142void ergodox_right_led_3_on(void){
116} 143}
117 144
118void ergodox_right_led_on(uint8_t led){ 145__attribute__ ((weak))
119}
120
121void ergodox_board_led_off(void){ 146void ergodox_board_led_off(void){
122} 147}
123 148
149__attribute__ ((weak))
124void ergodox_right_led_1_off(void){ 150void ergodox_right_led_1_off(void){
125} 151}
126 152
153__attribute__ ((weak))
127void ergodox_right_led_2_off(void){ 154void ergodox_right_led_2_off(void){
128} 155}
129 156
157__attribute__ ((weak))
130void ergodox_right_led_3_off(void){ 158void ergodox_right_led_3_off(void){
131} 159}
132 160
133void ergodox_right_led_off(uint8_t led){ 161__attribute__ ((weak))
162void ergodox_right_led_1_set(uint8_t n) {
163}
164
165__attribute__ ((weak))
166void ergodox_right_led_2_set(uint8_t n) {
167}
168
169__attribute__ ((weak))
170void ergodox_right_led_3_set(uint8_t n) {
134} 171}
135 172
136#ifdef ONEHAND_ENABLE 173#ifdef ONEHAND_ENABLE
diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h
index fec9e565c..73a0f4bf7 100644
--- a/keyboards/ergodox/infinity/infinity.h
+++ b/keyboards/ergodox/infinity/infinity.h
@@ -7,13 +7,38 @@ void ergodox_board_led_on(void);
7void ergodox_right_led_1_on(void); 7void ergodox_right_led_1_on(void);
8void ergodox_right_led_2_on(void); 8void ergodox_right_led_2_on(void);
9void ergodox_right_led_3_on(void); 9void ergodox_right_led_3_on(void);
10void ergodox_right_led_on(uint8_t led); 10
11inline void ergodox_right_led_on(uint8_t led) {
12 switch (led) {
13 case 0:
14 ergodox_right_led_1_on();
15 break;
16 case 1:
17 ergodox_right_led_2_on();
18 break;
19 case 2:
20 ergodox_right_led_3_on();
21 break;
22 }
23}
11 24
12void ergodox_board_led_off(void); 25void ergodox_board_led_off(void);
13void ergodox_right_led_1_off(void); 26void ergodox_right_led_1_off(void);
14void ergodox_right_led_2_off(void); 27void ergodox_right_led_2_off(void);
15void ergodox_right_led_3_off(void); 28void ergodox_right_led_3_off(void);
16void ergodox_right_led_off(uint8_t led); 29inline void ergodox_right_led_off(uint8_t led) {
30 switch (led) {
31 case 0:
32 ergodox_right_led_1_off();
33 break;
34 case 1:
35 ergodox_right_led_2_off();
36 break;
37 case 2:
38 ergodox_right_led_3_off();
39 break;
40 }
41}
17 42
18inline void ergodox_led_all_on(void) 43inline void ergodox_led_all_on(void)
19{ 44{
@@ -31,36 +56,22 @@ inline void ergodox_led_all_off(void)
31 ergodox_right_led_3_off(); 56 ergodox_right_led_3_off();
32} 57}
33 58
34inline void ergodox_right_led_1_set(uint8_t n){ 59void ergodox_right_led_1_set(uint8_t n);
35 if (n) { 60void ergodox_right_led_2_set(uint8_t n);
36 ergodox_right_led_1_on(); 61void ergodox_right_led_3_set(uint8_t n);
37 } else {
38 ergodox_right_led_1_off();
39 }
40}
41
42inline void ergodox_right_led_2_set(uint8_t n){
43 if (n) {
44 ergodox_right_led_2_on();
45 } else {
46 ergodox_right_led_2_off();
47 }
48}
49
50inline void ergodox_right_led_3_set(uint8_t n){
51 if (n) {
52 ergodox_right_led_3_on();
53 } else {
54 ergodox_right_led_3_off();
55 }
56}
57 62
58inline void ergodox_right_led_set(uint8_t led, uint8_t n){ 63inline void ergodox_right_led_set(uint8_t led, uint8_t n){
59 if (n) { 64 switch (led) {
60 ergodox_right_led_on(led); 65 case 0:
61 } else { 66 ergodox_right_led_1_set(n);
62 ergodox_right_led_off(led); 67 break;
63 } 68 case 1:
69 ergodox_right_led_2_set(n);
70 break;
71 case 2:
72 ergodox_right_led_3_set(n);
73 break;
74 }
64} 75}
65 76
66inline void ergodox_led_all_set(uint8_t n) { 77inline void ergodox_led_all_set(uint8_t n) {
diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk
index 473a6dfec..9e6170d89 100644
--- a/keyboards/ergodox/infinity/rules.mk
+++ b/keyboards/ergodox/infinity/rules.mk
@@ -1,6 +1,7 @@
1# project specific files 1# project specific files
2SRC = matrix.c \ 2SRC = matrix.c \
3 led.c 3 led.c \
4 animations.c
4 5
5## chip/board settings 6## chip/board settings
6# - the next two should match the directories in 7# - the next two should match the directories in
@@ -59,21 +60,17 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
59# 60#
60CUSTOM_MATRIX ?= yes # Custom matrix file 61CUSTOM_MATRIX ?= yes # Custom matrix file
61SERIAL_LINK_ENABLE = yes 62SERIAL_LINK_ENABLE = yes
62VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile 63VISUALIZER_ENABLE ?= yes
63LCD_ENABLE ?= yes 64LCD_ENABLE ?= yes
64LED_ENABLE ?= yes 65LED_ENABLE ?= no
65LCD_BACKLIGHT_ENABLE ?= yes 66LCD_BACKLIGHT_ENABLE ?= yes
66MIDI_ENABLE = no 67MIDI_ENABLE = no
67RGBLIGHT_ENABLE = no 68RGBLIGHT_ENABLE = no
68 69
69ifndef QUANTUM_DIR
70 include ../../../Makefile
71endif
72
73ifdef LCD_ENABLE 70ifdef LCD_ENABLE
74include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk 71include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
75endif 72endif
76 73
77ifdef LED_ENABLE 74ifdef LED_ENABLE
78include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk 75include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
79endif 76endif \ No newline at end of file
diff --git a/keyboards/ergodox/infinity/simple_visualizer.h b/keyboards/ergodox/infinity/simple_visualizer.h
new file mode 100644
index 000000000..ded8a3222
--- /dev/null
+++ b/keyboards/ergodox/infinity/simple_visualizer.h
@@ -0,0 +1,123 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_
18#define KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_
19
20// Currently we are assuming that both the backlight and LCD are enabled
21// But it's entirely possible to write a custom visualizer that use only
22// one of them
23#ifndef LCD_BACKLIGHT_ENABLE
24#error This visualizer needs that LCD backlight is enabled
25#endif
26
27#ifndef LCD_ENABLE
28#error This visualizer needs that LCD is enabled
29#endif
30
31#include "visualizer.h"
32#include "visualizer_keyframes.h"
33#include "lcd_keyframes.h"
34#include "lcd_backlight_keyframes.h"
35#include "system/serial_link.h"
36#include "led.h"
37#include "animations.h"
38
39static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
40static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
41
42static bool initial_update = true;
43
44// Feel free to modify the animations below, or even add new ones if needed
45
46static keyframe_animation_t lcd_layer_display = {
47 .num_frames = 1,
48 .loop = false,
49 .frame_lengths = {gfxMillisecondsToTicks(0)},
50 .frame_functions = {lcd_keyframe_display_layer_and_led_states}
51};
52
53// The color animation animates the LCD color when you change layers
54static keyframe_animation_t color_animation = {
55 .num_frames = 2,
56 .loop = false,
57 // Note that there's a 200 ms no-operation frame,
58 // this prevents the color from changing when activating the layer
59 // momentarily
60 .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)},
61 .frame_functions = {keyframe_no_operation, backlight_keyframe_animate_color},
62};
63
64void initialize_user_visualizer(visualizer_state_t* state) {
65 // The brightness will be dynamically adjustable in the future
66 // But for now, change it here.
67 lcd_backlight_brightness(130);
68 state->current_lcd_color = initial_color;
69 state->target_lcd_color = logo_background_color;
70 initial_update = true;
71 start_keyframe_animation(&default_startup_animation);
72}
73
74
75// This function should be implemented by the keymap visualizer
76// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
77// that the simple_visualizer assumes that you are updating
78// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
79// stopped. This can be done by either double buffering it or by using constant strings
80static void get_visualizer_layer_and_color(visualizer_state_t* state);
81
82void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
83 // Add more tests, change the colors and layer texts here
84 // Usually you want to check the high bits (higher layers first)
85 // because that's the order layers are processed for keypresses
86 // You can for check for example:
87 // state->status.layer
88 // state->status.default_layer
89 // state->status.leds (see led.h for available statuses)
90
91 uint32_t prev_color = state->target_lcd_color;
92 const char* prev_layer_text = state->layer_text;
93
94 get_visualizer_layer_and_color(state);
95
96 if (initial_update || prev_color != state->target_lcd_color) {
97 start_keyframe_animation(&color_animation);
98 }
99
100 if (initial_update || prev_layer_text != state->layer_text) {
101 start_keyframe_animation(&lcd_layer_display);
102 }
103 // You can also stop existing animations, and start your custom ones here
104 // remember that you should normally have only one animation for the LCD
105 // and one for the background. But you can also combine them if you want.
106}
107
108void user_visualizer_suspend(visualizer_state_t* state) {
109 state->layer_text = "Suspending...";
110 uint8_t hue = LCD_HUE(state->current_lcd_color);
111 uint8_t sat = LCD_SAT(state->current_lcd_color);
112 state->target_lcd_color = LCD_COLOR(hue, sat, 0);
113 start_keyframe_animation(&default_suspend_animation);
114}
115
116void user_visualizer_resume(visualizer_state_t* state) {
117 state->current_lcd_color = initial_color;
118 state->target_lcd_color = logo_background_color;
119 initial_update = true;
120 start_keyframe_animation(&default_startup_animation);
121}
122
123#endif /* KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_ */
diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c
new file mode 100644
index 000000000..a4b09a34d
--- /dev/null
+++ b/keyboards/ergodox/infinity/visualizer.c
@@ -0,0 +1,329 @@
1/*
2Copyright 2016 Fred Sundvik <fsundvik@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// Currently we are assuming that both the backlight and LCD are enabled
19// But it's entirely possible to write a custom visualizer that use only
20// one of them
21#ifndef LCD_BACKLIGHT_ENABLE
22#error This visualizer needs that LCD backlight is enabled
23#endif
24
25#ifndef LCD_ENABLE
26#error This visualizer needs that LCD is enabled
27#endif
28
29#include "visualizer.h"
30#include "visualizer_keyframes.h"
31#include "lcd_keyframes.h"
32#include "lcd_backlight_keyframes.h"
33#include "system/serial_link.h"
34#include "animations.h"
35
36static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
37static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
38
39static const uint32_t led_emulation_colors[4] = {
40 LCD_COLOR(0, 0, 0),
41 LCD_COLOR(255, 255, 255),
42 LCD_COLOR(84, 255, 255),
43 LCD_COLOR(168, 255, 255),
44};
45
46static uint32_t next_led_target_color = 0;
47
48typedef enum {
49 LCD_STATE_INITIAL,
50 LCD_STATE_LAYER_BITMAP,
51 LCD_STATE_BITMAP_AND_LEDS,
52} lcd_state_t;
53
54static lcd_state_t lcd_state = LCD_STATE_INITIAL;
55
56typedef struct {
57 uint8_t led_on;
58 uint8_t led1;
59 uint8_t led2;
60 uint8_t led3;
61} visualizer_user_data_t;
62
63// Don't access from visualization function, use the visualizer state instead
64static visualizer_user_data_t user_data_keyboard = {
65 .led_on = 0,
66 .led1 = LED_BRIGHTNESS_HI,
67 .led2 = LED_BRIGHTNESS_HI,
68 .led3 = LED_BRIGHTNESS_HI,
69};
70
71_Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
72 "Please increase the VISUALIZER_USER_DATA_SIZE");
73
74// Feel free to modify the animations below, or even add new ones if needed
75
76
77// The color animation animates the LCD color when you change layers
78static keyframe_animation_t one_led_color = {
79 .num_frames = 1,
80 .loop = false,
81 .frame_lengths = {gfxMillisecondsToTicks(0)},
82 .frame_functions = {backlight_keyframe_set_color},
83};
84
85bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t* state) {
86 uint32_t temp = next_led_target_color;
87 next_led_target_color = state->target_lcd_color;
88 state->target_lcd_color = temp;
89 return false;
90}
91
92// The color animation animates the LCD color when you change layers
93static keyframe_animation_t two_led_colors = {
94 .num_frames = 2,
95 .loop = true,
96 .frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)},
97 .frame_functions = {backlight_keyframe_set_color, swap_led_target_color},
98};
99
100// The LCD animation alternates between the layer name display and a
101// bitmap that displays all active layers
102static keyframe_animation_t lcd_bitmap_animation = {
103 .num_frames = 1,
104 .loop = false,
105 .frame_lengths = {gfxMillisecondsToTicks(0)},
106 .frame_functions = {lcd_keyframe_display_layer_bitmap},
107};
108
109static keyframe_animation_t lcd_bitmap_leds_animation = {
110 .num_frames = 2,
111 .loop = true,
112 .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)},
113 .frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states},
114};
115
116void initialize_user_visualizer(visualizer_state_t* state) {
117 // The brightness will be dynamically adjustable in the future
118 // But for now, change it here.
119 lcd_backlight_brightness(130);
120 state->current_lcd_color = initial_color;
121 state->target_lcd_color = logo_background_color;
122 lcd_state = LCD_STATE_INITIAL;
123 start_keyframe_animation(&default_startup_animation);
124}
125
126inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) {
127 return user_data->led_on & (1u << num);
128}
129
130static uint8_t get_led_index_master(visualizer_user_data_t* user_data) {
131 for (int i=0; i < 3; i++) {
132 if (is_led_on(user_data, i)) {
133 return i + 1;
134 }
135 }
136 return 0;
137}
138
139static uint8_t get_led_index_slave(visualizer_user_data_t* user_data) {
140 uint8_t master_index = get_led_index_master(user_data);
141 if (master_index!=0) {
142 for (int i=master_index; i < 3; i++) {
143 if (is_led_on(user_data, i)) {
144 return i + 1;
145 }
146 }
147 }
148
149 return 0;
150}
151
152static uint8_t get_secondary_led_index(visualizer_user_data_t* user_data) {
153 if (is_led_on(user_data, 0) &&
154 is_led_on(user_data, 1) &&
155 is_led_on(user_data, 2)) {
156 return 3;
157 }
158 return 0;
159}
160
161static uint8_t get_brightness(visualizer_user_data_t* user_data, uint8_t index) {
162 switch (index) {
163 case 1:
164 return user_data->led1;
165 case 2:
166 return user_data->led2;
167 case 3:
168 return user_data->led3;
169 }
170 return 0;
171}
172
173static void update_emulated_leds(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
174 visualizer_user_data_t* user_data_new = (visualizer_user_data_t*)state->status.user_data;
175 visualizer_user_data_t* user_data_old = (visualizer_user_data_t*)prev_status->user_data;
176
177 uint8_t new_index;
178 uint8_t old_index;
179
180 if (is_serial_link_master()) {
181 new_index = get_led_index_master(user_data_new);
182 old_index = get_led_index_master(user_data_old);
183 }
184 else {
185 new_index = get_led_index_slave(user_data_new);
186 old_index = get_led_index_slave(user_data_old);
187 }
188 uint8_t new_secondary_index = get_secondary_led_index(user_data_new);
189 uint8_t old_secondary_index = get_secondary_led_index(user_data_old);
190
191 uint8_t old_brightness = get_brightness(user_data_old, old_index);
192 uint8_t new_brightness = get_brightness(user_data_new, new_index);
193
194 uint8_t old_secondary_brightness = get_brightness(user_data_old, old_secondary_index);
195 uint8_t new_secondary_brightness = get_brightness(user_data_new, new_secondary_index);
196
197 if (lcd_state == LCD_STATE_INITIAL ||
198 new_index != old_index ||
199 new_secondary_index != old_secondary_index ||
200 new_brightness != old_brightness ||
201 new_secondary_brightness != old_secondary_brightness) {
202
203 if (new_secondary_index != 0) {
204 state->target_lcd_color = change_lcd_color_intensity(
205 led_emulation_colors[new_index], new_brightness);
206 next_led_target_color = change_lcd_color_intensity(
207 led_emulation_colors[new_secondary_index], new_secondary_brightness);
208
209 stop_keyframe_animation(&one_led_color);
210 start_keyframe_animation(&two_led_colors);
211 } else {
212 state->target_lcd_color = change_lcd_color_intensity(
213 led_emulation_colors[new_index], new_brightness);
214 stop_keyframe_animation(&two_led_colors);
215 start_keyframe_animation(&one_led_color);
216 }
217 }
218}
219
220static void update_lcd_text(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
221 if (state->status.leds) {
222 if (lcd_state != LCD_STATE_BITMAP_AND_LEDS ||
223 state->status.leds != prev_status->leds ||
224 state->status.layer != prev_status->layer ||
225 state->status.default_layer != prev_status->default_layer) {
226
227 // NOTE: that it doesn't matter if the animation isn't playing, stop will do nothing in that case
228 stop_keyframe_animation(&lcd_bitmap_animation);
229
230 lcd_state = LCD_STATE_BITMAP_AND_LEDS;
231 // For information:
232 // The logic in this function makes sure that this doesn't happen, but if you call start on an
233 // animation that is already playing it will be restarted.
234 start_keyframe_animation(&lcd_bitmap_leds_animation);
235 }
236 } else {
237 if (lcd_state != LCD_STATE_LAYER_BITMAP ||
238 state->status.layer != prev_status->layer ||
239 state->status.default_layer != prev_status->default_layer) {
240
241 stop_keyframe_animation(&lcd_bitmap_leds_animation);
242
243 lcd_state = LCD_STATE_LAYER_BITMAP;
244 start_keyframe_animation(&lcd_bitmap_animation);
245 }
246 }
247}
248
249void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
250 // Check the status here to start and stop animations
251 // You might have to save some state, like the current animation here so that you can start the right
252 // This function is called every time the status changes
253
254 // NOTE that this is called from the visualizer thread, so don't access anything else outside the status
255 // This is also important because the slave won't have access to the active layer for example outside the
256 // status.
257
258 update_emulated_leds(state, prev_status);
259 update_lcd_text(state, prev_status);
260
261}
262
263void user_visualizer_suspend(visualizer_state_t* state) {
264 state->layer_text = "Suspending...";
265 uint8_t hue = LCD_HUE(state->current_lcd_color);
266 uint8_t sat = LCD_SAT(state->current_lcd_color);
267 state->target_lcd_color = LCD_COLOR(hue, sat, 0);
268 start_keyframe_animation(&default_suspend_animation);
269}
270
271void user_visualizer_resume(visualizer_state_t* state) {
272 state->current_lcd_color = initial_color;
273 state->target_lcd_color = logo_background_color;
274 lcd_state = LCD_STATE_INITIAL;
275 start_keyframe_animation(&default_startup_animation);
276}
277
278void ergodox_board_led_on(void){
279 // No board led support
280}
281
282void ergodox_right_led_1_on(void){
283 user_data_keyboard.led_on |= (1u << 0);
284 visualizer_set_user_data(&user_data_keyboard);
285}
286
287void ergodox_right_led_2_on(void){
288 user_data_keyboard.led_on |= (1u << 1);
289 visualizer_set_user_data(&user_data_keyboard);
290}
291
292void ergodox_right_led_3_on(void){
293 user_data_keyboard.led_on |= (1u << 2);
294 visualizer_set_user_data(&user_data_keyboard);
295}
296
297void ergodox_board_led_off(void){
298 // No board led support
299}
300
301void ergodox_right_led_1_off(void){
302 user_data_keyboard.led_on &= ~(1u << 0);
303 visualizer_set_user_data(&user_data_keyboard);
304}
305
306void ergodox_right_led_2_off(void){
307 user_data_keyboard.led_on &= ~(1u << 1);
308 visualizer_set_user_data(&user_data_keyboard);
309}
310
311void ergodox_right_led_3_off(void){
312 user_data_keyboard.led_on &= ~(1u << 2);
313 visualizer_set_user_data(&user_data_keyboard);
314}
315
316void ergodox_right_led_1_set(uint8_t n) {
317 user_data_keyboard.led1 = n;
318 visualizer_set_user_data(&user_data_keyboard);
319}
320
321void ergodox_right_led_2_set(uint8_t n) {
322 user_data_keyboard.led2 = n;
323 visualizer_set_user_data(&user_data_keyboard);
324}
325
326void ergodox_right_led_3_set(uint8_t n) {
327 user_data_keyboard.led3 = n;
328 visualizer_set_user_data(&user_data_keyboard);
329}
diff --git a/keyboards/ergodox/keymaps/default/visualizer.c b/keyboards/ergodox/keymaps/default/visualizer.c
new file mode 100644
index 000000000..502e53f3d
--- /dev/null
+++ b/keyboards/ergodox/keymaps/default/visualizer.c
@@ -0,0 +1,42 @@
1/*
2Copyright 2017 Fred Sundvik
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#include "simple_visualizer.h"
19
20// This function should be implemented by the keymap visualizer
21// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
22// that the simple_visualizer assumes that you are updating
23// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
24// stopped. This can be done by either double buffering it or by using constant strings
25static void get_visualizer_layer_and_color(visualizer_state_t* state) {
26 uint8_t saturation = 60;
27 if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
28 saturation = 255;
29 }
30 if (state->status.layer & 0x4) {
31 state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF);
32 state->layer_text = "Media & Mouse";
33 }
34 else if (state->status.layer & 0x2) {
35 state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF);
36 state->layer_text = "Symbol";
37 }
38 else {
39 state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF);
40 state->layer_text = "Default";
41 }
42}
diff --git a/keyboards/ergodox/keymaps/familiar/README.md b/keyboards/ergodox/keymaps/familiar/README.md
new file mode 100644
index 000000000..e4336d9b5
--- /dev/null
+++ b/keyboards/ergodox/keymaps/familiar/README.md
@@ -0,0 +1,69 @@
1# ErgoDox Familiar Layout
2Familiar layout for those who regularly switch back and forth from ErgoDox to regular QWERTY.
3
4[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](../../../../license_GPLv3.md../../../../license_GPLv3.md) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)
5
6## Table of Contents
7
8- [Background](#background)
9- [Install](#install)
10- [Usage](#usage)
11 - [Layers](#layers)
12- [Contribute](#contribute)
13 - [Issues](#issues)
14- [License](#license)
15
16## Background
17
18This layout is built to be as familiar as possible for users coming directly from a default (QWERTY US) keyboard, while gaining as much advantage as possible from the ErgoDox and QMK featureset. I use an ErgoDoxEZ at home, but I don't have a regular office (CS grad student) so I regularly use either my laptop or a default-setup lab computer; I context switch daily so this layout is meant to reduce the mental overhead as much as possible.
19
20The default ErgoDoxEZ layout is probably more optimized as a solo daily driver - as are a lot of the others available keymaps. The focus of this layout is to get as much from the 'Dox as possible without overly disrupting long-established muscle memory.
21
22Key features of the familiar layout:
231. QWERTY default layout.
241. International symbols layer, mapped in the US-International layout default positions, through [UCIS](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable).
251. Numpad layer on right hand.
261. Thumb cluster holds spacebar, ALT, and access to secondary layers.
271. Function-layer arrow keys in both the first-person-shooter (actually ESDF instead of WASD) and vim (HJKL) locations.
28
29## Install
30
31If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 235).
32```c
33void matrix_init_user(void) {
34 set_unicode_input_mode(UC_LNX); // Linux
35 //set_unicode_input_mode(UC_OSX); // Mac OSX
36 //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
37 //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
38};
39```
40
41For instructions on building and installing this keymap, [go to the wiki](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ergodox#build-dependencies). Below is the command for me; it may be different for you.
42```sh
43$ make ergodox-ez-familiar-teensy
44```
45
46## Usage
47
48[![Familiar Layout](familiar.png)](http://www.keyboard-layout-editor.com/#/gists/13508a9f99cff381d58b7be6f7dcc644)
49
50### Layers
511. Base Layer: QWERTY, with arrow keys at bottom right.
521. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `INTL` layer using the UCIS key (bottom of left thumb cluster).
531. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed through holding shift while the UCIS layer is active (toggles the `INSF` layer).
541. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NPAD key (bottom of right thumb cluster).
551. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions.
56
57## Contribute
58
59[Contributor Covenant](http://contributor-covenant.org/)
60
61I'm terrible at this; I have no background in human-computer interaction, kinesiology, or keyboard-ology. Please send comments/issues/pull requests/angry tweets/etc. If you think there is a better way to take advantage of the ErgoDox/QMK comination without straying far from 84/101-key QWERTY, I want to know it.
62
63### Issues
641. The top two keys of the right thumb cluster are currently unused. I wanted them for screen brightness, but I haven't found a solution I like.
651. The `'`, `"`, `[`, and `]` keys are terrible to access; I want to put them somewhere else but I haven't figured out where.
661. The `INSF` layer is an ugly workaround. I should write a function for doing different things in the `INTL` layer depending on whether SHIFT is being held. Or something. Ideas?
67
68## License
69QMK is licensed ([mostly](https://github.com/qmk/qmk_firmware/issues/1038)) under the [GPLv2](blob/master/license_GPLv2.md). Accordingly, to whatever extent applicable, this keymap is licensed under the [GPLv3](../../../../license_GPLv3.md).
diff --git a/keyboards/ergodox/keymaps/familiar/familiar.png b/keyboards/ergodox/keymaps/familiar/familiar.png
new file mode 100644
index 000000000..f8b50e75e
--- /dev/null
+++ b/keyboards/ergodox/keymaps/familiar/familiar.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/familiar/keymap.c b/keyboards/ergodox/keymaps/familiar/keymap.c
new file mode 100644
index 000000000..c5f94afda
--- /dev/null
+++ b/keyboards/ergodox/keymaps/familiar/keymap.c
@@ -0,0 +1,267 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5
6// Layers
7#define BASE 0 // default layer
8#define INTL 1 // international symbols
9#define INSF 2 // international symbols shifted
10#define NUMP 3 // numpad
11#define ARRW 4 // function, media, arrow keys
12
13// Fillers to make layering more clear
14#define _______ KC_TRNS
15#define XXXXXXX KC_NO
16
17const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
18// If it accepts an argument (i.e, is a function), it doesn't need KC_.
19// Otherwise, it needs KC_*
20/* layer 0 : default
21 *
22 * ,--------------------------------------------------. ,--------------------------------------------------.
23 * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC |
24 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
25 * | TAB | Q | W | E | R | T | HOME | | PGUP | Y | U | I | O | P | DELETE |
26 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
27 * | ` | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER |
28 * |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------|
29 * | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT |
30 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
31 * | LCTRL | LGUI | MENU | ' | " | | [ | ] | LEFT | DOWN | RIGHT |
32 * `------------------------------------' `------------------------------------'
33 * ,-------------. ,-------------.
34 * | VOL- | VOL+ | | | |
35 * ,------|------|------| |------+------+------.
36 * | SPC/ |SLASH/| MUTE | |NUMLCK|WHACK/| SPC/ |
37 * | ALT | MO(1)|------| |------|MO(1) | ALT |
38 * | | | LAY3 | | LAY2 | | |
39 * `--------------------' `--------------------'
40 */
41[BASE] = KEYMAP(
42 // left hand
43 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
44 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
45 KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G,
46 KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END,
47 KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, S(KC_QUOT),
48 KC_VOLD, KC_VOLU,
49 KC_MUTE,
50 ALT_T(KC_SPC), LT(ARRW,KC_SLSH), TG(INTL),
51 // right hand
52 KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
53 KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
54 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER,
55 KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC,
56 KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT,
57 _______, _______,
58 KC_NLCK,
59 TG(NUMP), LT(ARRW,KC_BSLS), ALT_T(KC_SPC)
60 ),
61
62/* layer 1: International symbols, etc
63 *
64 * ,--------------------------------------------------. ,--------------------------------------------------.
65 * | ´ | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | |
66 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
67 * | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | |
68 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
69 * | | á | ß | ð | | |------| |------| | | | ø | ¶ | |
70 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
71 * |MO(INSF)| æ | | © | | | | | | ñ | µ | ç | | |MO(INSF)|
72 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
73 * | | | | ¬ | ¿ | | « | » | | | |
74 * `------------------------------------' `------------------------------------'
75 * ,-------------. ,-------------.
76 * | | | | | |
77 * ,------|------|------| |------+------+------.
78 * | | | | | | | |
79 * | | |------| |------| | |
80 * | | | | | | | |
81 * `--------------------' `--------------------'
82 */
83[INTL] = KEYMAP(
84 // left hand
85 UC(0x00B4), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC),
86 _______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______,
87 _______, UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______,
88 MO(INSF), UC(0x00E6), _______, UC(0x00A9), _______, _______, _______,
89 _______, _______, _______, UC(0x00AC), UC(0x00BF),
90 _______, _______,
91 _______,
92 _______, _______, _______,
93 // right hand
94 UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), UC(0x00A5), UC(0x00D7), _______,
95 _______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______,
96 _______, _______, _______, UC(0x00F8), UC(0x00B6), _______,
97 _______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(INSF),
98 UC(0x00AB), UC(0x00BB), _______, _______, _______,
99 _______, _______,
100 _______,
101 _______, _______, _______
102 ),
103
104/* layer 2 : international symbols, shifted
105 * This layer is an ugly workaround; it pretends that SHIFT still works normally on keys
106 * which don't produce an "upper case" or "shifted" international symobol.
107 *
108 * ,--------------------------------------------------. ,--------------------------------------------------.
109 * | ¨ | ¹ | | | £ | | | | | | | | — | ÷ | |
110 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
111 * | | Ä | Å | É | | Þ | | | | Ü | Ú | Í | Ó | Ö | |
112 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
113 * | | Á | § | Ð | | |------| |------| | | | Ø | ° | |
114 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
115 * | | Æ | | ¢ | | | | | | Ñ | | Ç | | | |
116 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
117 * | | | | ¦ | | | | | | | |
118 * `------------------------------------' `------------------------------------'
119 * ,-------------. ,-------------.
120 * | | | | | |
121 * ,------|------|------| |------+------+------.
122 * | | | | | | | |
123 * | | |------| |------| | |
124 * | | | | | | | |
125 * `--------------------' `--------------------'
126 */
127[INSF] = KEYMAP(
128 // left hand
129 UC(0x00A8), UC(0x00B9), _______, _______, UC(0x00A3), _______, _______,
130 _______, UC(0x00C4), UC(0x00C5), UC(0x00C9), _______, UC(0x00DE), _______,
131 _______, UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G),
132 _______, UC(0x00C6), S(KC_X), UC(0x00A2), S(KC_V), S(KC_B), _______,
133 _______, _______, _______, UC(0x00A6), _______,
134 _______, _______,
135 _______,
136 _______, _______, _______,
137 // right hand
138 _______, _______, _______, _______, UC(0x2014), UC(0x00F7), _______,
139 _______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______,
140 S(KC_H), S(KC_J), S(KC_K), UC(0x00D8), UC(0x00B0), _______,
141 _______, UC(0x00D1), _______, UC(0x00C7), S(KC_DOT), _______, _______,
142 _______, _______, _______, _______, _______,
143 _______, _______,
144 _______,
145 _______, _______, _______
146 ),
147
148/* layer 3: numberpad
149 *
150 * ,--------------------------------------------------. ,--------------------------------------------------.
151 * | | | | | | | | | | | ( | ) | / | * | |
152 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
153 * | | | | | | | | | | | 7 | 8 | 9 | - | |
154 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
155 * | | | | | | |------| |------| | 4 | 5 | 6 | + | |
156 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
157 * | | | | | | | | | | | 1 | 2 | 3 | = | |
158 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
159 * | | | | | | | 0 | . | , | ENTER| |
160 * `------------------------------------' `------------------------------------'
161 * ,-------------. ,-------------.
162 * | | | | | |
163 * ,------|------|------| |------+------+------.
164 * | | | | | | | |
165 * | | |------| |------| | |
166 * | | | | | | | |
167 * `--------------------' `--------------------'
168 */
169[NUMP] = KEYMAP(
170 // left hand
171 _______, _______, _______, _______, _______, _______, _______,
172 _______, _______, _______, _______, _______, _______, _______,
173 _______, _______, _______, _______, _______, _______,
174 _______, _______, _______, _______, _______, _______, _______,
175 _______, _______, _______, _______, _______,
176 _______, _______,
177 _______,
178 _______, _______, _______,
179 // right hand
180 _______, _______, S(KC_9), S(KC_0), KC_PSLS, KC_PAST, _______,
181 _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______,
182 _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______,
183 _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PEQL, _______,
184 KC_KP_0, KC_KP_DOT, KC_PCMM, KC_PENT, _______,
185 _______, _______,
186 _______,
187 _______, _______, _______
188 ),
189
190/* layer 4 : functions and arrows
191 * This layer is at the top so that the functions still work no matter what layers are active.
192 *
193 * ,--------------------------------------------------. ,--------------------------------------------------.
194 * | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | SYSREQ |
195 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
196 * | | | | UP | | | | | | | | | | | INSERT |
197 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
198 * |CAPSLOCK| | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | |
199 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
200 * | |M_PREV|M_STOP|M_PLPS|M_NEXT| | | | | | | | | PGUP | |
201 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
202 * | | | | | | | | | HOME | PGDN | END |
203 * `------------------------------------' `------------------------------------'
204 * ,-------------. ,-------------.
205 * | | PAUSE| | | |
206 * ,------|------|------| |------+------+------.
207 * | | | | |SCRLK | | |
208 * | | |------| |------| | |
209 * | | | | | | | |
210 * `--------------------' `--------------------'
211 */
212[ARRW] = KEYMAP(
213 // left hand
214 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
215 _______, _______, _______, KC_UP, _______, _______, _______,
216 KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
217 _______, _______, _______, _______, _______, _______, _______,
218 _______, _______, _______, _______, _______,
219 _______, KC_PAUSE,
220 _______,
221 _______, _______, _______,
222 // right hand
223 KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_SYSREQ,
224 _______, _______, _______, _______, _______, _______, KC_INS,
225 KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
226 _______, _______, _______, _______, _______, KC_PGUP, _______,
227 _______, _______, KC_HOME, KC_PGDN, KC_END,
228 _______, _______,
229 KC_SLCK,
230 _______, _______, _______
231 ),
232};
233
234// Runs just one time when the keyboard initializes.
235void matrix_init_user(void) {
236 set_unicode_input_mode(UC_LNX); // Linux
237 //set_unicode_input_mode(UC_OSX); // Mac OSX
238 //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
239 //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
240};
241
242// Runs constantly in the background, in a loop.
243void matrix_scan_user(void) {
244
245 uint8_t layer = biton32(layer_state);
246
247 ergodox_board_led_off();
248 ergodox_right_led_1_off();
249 ergodox_right_led_2_off();
250 ergodox_right_led_3_off();
251 switch (layer) {
252 case INTL:
253 case INSF:
254 ergodox_right_led_1_on();
255 break;
256 case NUMP:
257 ergodox_right_led_2_on();
258 break;
259 case ARRW:
260 ergodox_right_led_3_on();
261 break;
262 default:
263 // none
264 break;
265 }
266
267};
diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c
index 08ee5aeda..ec909ec53 100644
--- a/keyboards/ergodox/keymaps/xyverz/keymap.c
+++ b/keyboards/ergodox/keymaps/xyverz/keymap.c
@@ -40,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
40 40
41/* Layer 0 : Dvorak 41/* Layer 0 : Dvorak
42 * ,--------------------------------------------------. ,--------------------------------------------------. 42 * ,--------------------------------------------------. ,--------------------------------------------------.
43 * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | 43 * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | / |
44 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 44 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
45 * | Tab | ' | , | . | P | Y | | | | F | G | C | R | L | \ | 45 * | Tab | ' | , | . | P | Y | | | | F | G | C | R | L | \ |
46 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 46 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
@@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
48 * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| 48 * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------|
49 * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | 49 * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift |
50 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 50 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
51 * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | 51 * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI |
52 * `----------------------------------' `----------------------------------' 52 * `----------------------------------' `----------------------------------'
53 * ,-------------. ,-------------. 53 * ,-------------. ,-------------.
54 * | LCTL | LALT | | RALT | RCTL | 54 * | LCTL | LALT | | RALT | RCTL |
@@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
61 */ 61 */
62[_DV] = KEYMAP( 62[_DV] = KEYMAP(
63 // left hand 63 // left hand
64 KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, 64 KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
65 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, 65 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX,
66 KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, 66 KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I,
67 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(_MD), 67 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(_MD),
@@ -70,11 +70,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
70 KC_HOME, 70 KC_HOME,
71 KC_BSPC, KC_DEL, KC_END, 71 KC_BSPC, KC_DEL, KC_END,
72 // right hand 72 // right hand
73 KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, 73 KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLSH,
74 XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, 74 XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS,
75 KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, 75 KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
76 MO(_KP), KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, 76 MO(_KP), KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
77 KC_UP, KC_DOWN, KC_SLSH, KC_EQL, KC_RGUI, 77 KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_RGUI,
78 KC_RALT, KC_RCTL, 78 KC_RALT, KC_RCTL,
79 KC_PGUP, 79 KC_PGUP,
80 KC_PGDN, KC_ENT, KC_SPC 80 KC_PGDN, KC_ENT, KC_SPC
@@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
91 * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| 91 * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------|
92 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | 92 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
93 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 93 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
94 * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | 94 * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI |
95 * `----------------------------------' `----------------------------------' 95 * `----------------------------------' `----------------------------------'
96 * ,-------------. ,-------------. 96 * ,-------------. ,-------------.
97 * | LCTL | LALT | | RALT | RCTL | 97 * | LCTL | LALT | | RALT | RCTL |
@@ -133,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
133 * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| 133 * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------|
134 * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | 134 * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift |
135 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 135 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
136 * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | 136 * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI |
137 * `----------------------------------' `----------------------------------' 137 * `----------------------------------' `----------------------------------'
138 * ,-------------. ,-------------. 138 * ,-------------. ,-------------.
139 * | LCTL | LALT | | RALT | RCTL | 139 * | LCTL | LALT | | RALT | RCTL |
diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md
index 6ecdabc9e..134fb50af 100644
--- a/keyboards/ergodox/keymaps/xyverz/readme.md
+++ b/keyboards/ergodox/keymaps/xyverz/readme.md
@@ -2,7 +2,7 @@
2 2
3## About this keymap: 3## About this keymap:
4 4
5The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my ErgoDox. 5The Dvorak layout shown here stems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. ~~Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my ErgoDox.~~ I've decided do give the normal placing of the SLSH, EQL, and xBRC keys a try, after using a different keyboard for a while...
6 6
7The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. 7The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional keys as shown in the diagrams. The Colemak layout is merely an adaptation of that.
8 8
@@ -17,15 +17,15 @@ I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar t
17### Layer 0: Dvorak layer 17### Layer 0: Dvorak layer
18 18
19 ,--------------------------------------------------.,--------------------------------------------------. 19 ,--------------------------------------------------.,--------------------------------------------------.
20 | ] | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | [ | 20 | = | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | / |
21 |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| 21 |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------|
22 | Tab | ' | , | . | Y | Y | || | F | G | C | R | L | \ | 22 | Tab | ' | , | . | P | Y | || | F | G | C | R | L | \ |
23 |--------+------+------+------+------+------| || |------+------+------+------+------+--------| 23 |--------+------+------+------+------+------| || |------+------+------+------+------+--------|
24 | CapsLk | A | O | E | U | I |------||------| D | H | T | N | S | - | 24 | CapsLk | A | O | E | U | I |------||------| D | H | T | N | S | - |
25 |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| 25 |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------|
26 | LShift | Z | X | C | V | X | || | B | M | W | V | Z | RShift | 26 | LShift | Z | X | C | V | X | || | B | M | W | V | Z | RShift |
27 `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' 27 `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------'
28 | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | 28 | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI |
29 `----------------------------------' `----------------------------------' 29 `----------------------------------' `----------------------------------'
30 ,-------------.,-------------. 30 ,-------------.,-------------.
31 | LCtr | LAlt || Ralt | RCtr | 31 | LCtr | LAlt || Ralt | RCtr |
diff --git a/keyboards/gh60/keymaps/xyverz/keymap.c b/keyboards/gh60/keymaps/xyverz/keymap.c
new file mode 100644
index 000000000..e83a7f5a3
--- /dev/null
+++ b/keyboards/gh60/keymaps/xyverz/keymap.c
@@ -0,0 +1,149 @@
1#include "gh60.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4
5
6extern keymap_config_t keymap_config;
7
8
9// Each layer gets a name for readability, which is then used in the keymap matrix below.
10// The underscores don't mean anything - you can have a layer called STUFF or any other name.
11// Layer names don't all need to be of the same length, obviously, and you can also skip them
12// entirely and just use numbers.
13#define _QW 0
14#define _DV 1
15#define _CM 2
16#define _FL 3
17
18// Macro name shortcuts
19#define QWERTY M(_QW)
20#define DVORAK M(_DV)
21#define COLEMAK M(_CM)
22
23// Fillers to make layering more clear
24#define _______ KC_TRNS
25#define XXXXXXX KC_NO
26
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28
29 /*
30 * _QW: Qwerty Layer
31 * ,-----------------------------------------------------------.
32 * |ESC | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp|
33 * |-----------------------------------------------------------|
34 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
35 * |-----------------------------------------------------------|
36 * |Fn | A| S| D| F| G| H| J| K| L| ;| '| Return|
37 * |-----------------------------------------------------------|
38 * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift|
39 * |-----------------------------------------------------------|
40 * |Ctrl|Alt |Gui | Space |Gui |Alt |Ctrl| Fn|
41 * `-----------------------------------------------------------'
42 */
43[_QW] = { /* Layer 0: Qwerty */
44 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC},
45 {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},
46 {MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT },
47 {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT},
48 {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL)}
49 },
50
51 /*
52 * _DV: Dvorak Layer
53 * ,-----------------------------------------------------------.
54 * |ESC | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| Backsp|
55 * |-----------------------------------------------------------|
56 * |Tab | '| ,| .| P| Y| F| G| C| R| L| /| =| \|
57 * |-----------------------------------------------------------|
58 * |Fn | A| O| E| U| I| D| H| T| N| S| -| Return|
59 * |-----------------------------------------------------------|
60 * |Shift | ;| Q| J| K| X| B| M| W| V| Z| Shift|
61 * |-----------------------------------------------------------|
62 * |Ctrl|Alt |Gui | Space |Gui |Alt |Ctrl| Fn|
63 * `-----------------------------------------------------------'
64 */
65[_DV] = { /* Layer 1: Dvorak */
66 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC},
67 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS},
68 {MO(_FL), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT },
69 {KC_LSFT, XXXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, XXXXXXX, KC_RSFT},
70 {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL)}
71 },
72
73 /*
74 * _CM: Colemak Layer
75 * ,-----------------------------------------------------------.
76 * |ESC | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp|
77 * |-----------------------------------------------------------|
78 * |Tab | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \|
79 * |-----------------------------------------------------------|
80 * |Fn | A| R| S| T| D| H| N| E| I| O| '| Return|
81 * |-----------------------------------------------------------|
82 * |Shift | Z| X| C| V| B| K| M| ,| .| /| Shift|
83 * |-----------------------------------------------------------|
84 * |Ctrl|Alt |Gui | Space |Gui |Alt |Ctrl| Fn|
85 * `-----------------------------------------------------------'
86 */
87[_CM] = { /* Layer 2: Colemak */
88 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC},
89 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS},
90 {MO(_FL), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT },
91 {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT},
92 {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL)}
93 },
94
95 /*
96 * _FL: Function Layer
97 * ,-----------------------------------------------------------.
98 * | |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del|
99 * |-----------------------------------------------------------|
100 * | | | | | | | |PgU| Up|PgD|PSc|SLk|Pau| |
101 * |-----------------------------------------------------------|
102 * | | |MPr|MPl|MNx| |Hom| Lt| Dn| Rt| | | |
103 * |-----------------------------------------------------------|
104 * |CAPS | |Mut|VlD|VlU| |End| | | | | |
105 * |-----------------------------------------------------------|
106 * |_QW |_DV |_CM | | | | | |
107 * `-----------------------------------------------------------'
108 */
109[_FL] = { /* Layer 3: Functions */
110 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL },
111 {_______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______},
112 {_______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, XXXXXXX, _______},
113 {KC_CAPS, XXXXXXX, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_END, _______, _______, _______, _______, XXXXXXX, _______},
114 {QWERTY, DVORAK, COLEMAK, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______}
115 },
116
117
118};
119
120const uint16_t PROGMEM fn_actions[] = {
121
122};
123
124void persistant_default_layer_set(uint16_t default_layer) {
125 eeconfig_update_default_layer(default_layer);
126 default_layer_set(default_layer);
127}
128
129const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
130{
131 switch(id) {
132 case _DV:
133 if (record->event.pressed) {
134 persistant_default_layer_set(1UL<<_DV);
135 }
136 break;
137 case _QW:
138 if (record->event.pressed) {
139 persistant_default_layer_set(1UL<<_QW);
140 }
141 break;
142 case _CM:
143 if (record->event.pressed) {
144 persistant_default_layer_set(1UL<<_CM);
145 }
146 break;
147 }
148 return MACRO_NONE;
149};
diff --git a/keyboards/handwired/kbod/Makefile b/keyboards/handwired/kbod/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/handwired/kbod/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/handwired/kbod/config.h b/keyboards/handwired/kbod/config.h
new file mode 100644
index 000000000..f3d0c8bf2
--- /dev/null
+++ b/keyboards/handwired/kbod/config.h
@@ -0,0 +1,167 @@
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 fudanchii
28#define PRODUCT kbod
29#define DESCRIPTION Keyboard of Disapproval
30
31/* key matrix size */
32#define MATRIX_ROWS 8
33#define MATRIX_COLS 8
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5, B6, B7, D6 }
46#define MATRIX_COL_PINS { D0, D1, F0, F1, F4, F5, F6, F7 }
47#define UNUSED_PINS
48
49/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
50#define DIODE_DIRECTION COL2ROW
51
52// #define BACKLIGHT_PIN B7
53// #define BACKLIGHT_BREATHING
54// #define BACKLIGHT_LEVELS 3
55
56
57/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
58#define DEBOUNCING_DELAY 5
59
60/* define if matrix has ghost (lacks anti-ghosting diodes) */
61//#define MATRIX_HAS_GHOST
62
63/* number of backlight levels */
64
65/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
66#define LOCKING_SUPPORT_ENABLE
67/* Locking resynchronize hack */
68#define LOCKING_RESYNC_ENABLE
69
70/*
71 * Force NKRO
72 *
73 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
74 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
75 * makefile for this to work.)
76 *
77 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
78 * until the next keyboard reset.
79 *
80 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
81 * fully operational during normal computer usage.
82 *
83 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
84 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
85 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
86 * power-up.
87 *
88 */
89//#define FORCE_NKRO
90
91/*
92 * Magic Key Options
93 *
94 * Magic keys are hotkey commands that allow control over firmware functions of
95 * the keyboard. They are best used in combination with the HID Listen program,
96 * found here: https://www.pjrc.com/teensy/hid_listen.html
97 *
98 * The options below allow the magic key functionality to be changed. This is
99 * useful if your keyboard/keypad is missing keys and you want magic key support.
100 *
101 */
102
103/* key combination for magic key command */
104#define IS_COMMAND() ( \
105 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
106)
107
108/* control how magic key switches layers */
109//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
112
113/* override magic key keymap */
114//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
115//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
117//#define MAGIC_KEY_HELP1 H
118//#define MAGIC_KEY_HELP2 SLASH
119//#define MAGIC_KEY_DEBUG D
120//#define MAGIC_KEY_DEBUG_MATRIX X
121//#define MAGIC_KEY_DEBUG_KBD K
122//#define MAGIC_KEY_DEBUG_MOUSE M
123//#define MAGIC_KEY_VERSION V
124//#define MAGIC_KEY_STATUS S
125//#define MAGIC_KEY_CONSOLE C
126//#define MAGIC_KEY_LAYER0_ALT1 ESC
127//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
128//#define MAGIC_KEY_LAYER0 0
129//#define MAGIC_KEY_LAYER1 1
130//#define MAGIC_KEY_LAYER2 2
131//#define MAGIC_KEY_LAYER3 3
132//#define MAGIC_KEY_LAYER4 4
133//#define MAGIC_KEY_LAYER5 5
134//#define MAGIC_KEY_LAYER6 6
135//#define MAGIC_KEY_LAYER7 7
136//#define MAGIC_KEY_LAYER8 8
137//#define MAGIC_KEY_LAYER9 9
138//#define MAGIC_KEY_BOOTLOADER PAUSE
139//#define MAGIC_KEY_LOCK CAPS
140//#define MAGIC_KEY_EEPROM E
141//#define MAGIC_KEY_NKRO N
142//#define MAGIC_KEY_SLEEP_LED Z
143
144/*
145 * Feature disable options
146 * These options are also useful to firmware size reduction.
147 */
148
149/* disable debug print */
150//#define NO_DEBUG
151
152/* disable print */
153//#define NO_PRINT
154
155/* disable action features */
156//#define NO_ACTION_LAYER
157//#define NO_ACTION_TAPPING
158//#define NO_ACTION_ONESHOT
159//#define NO_ACTION_MACRO
160//#define NO_ACTION_FUNCTION
161
162#define PREVENT_STUCK_MODIFIERS
163
164#undef TAPPING_TOGGLE
165#define TAPPING_TOGGLE 2
166
167#endif
diff --git a/keyboards/handwired/kbod/kbod.c b/keyboards/handwired/kbod/kbod.c
new file mode 100644
index 000000000..9a12cae0d
--- /dev/null
+++ b/keyboards/handwired/kbod/kbod.c
@@ -0,0 +1,28 @@
1#include "kbod.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/handwired/kbod/kbod.h b/keyboards/handwired/kbod/kbod.h
new file mode 100644
index 000000000..356063624
--- /dev/null
+++ b/keyboards/handwired/kbod/kbod.h
@@ -0,0 +1,21 @@
1#ifndef KBOD_H
2#define KBOD_H
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \
8 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
9 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \
10 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, \
11 k40, k41, k42, k43, k44, k45, k46, k47 \
12) \
13{ \
14 { k00, k01, k02, k03, k04, k05, k06, k07 }, { k08, k09, k0A, k0B, k0C, k0D, KC_NO, KC_NO }, \
15 { k10, k11, k12, k13, k14, k15, k16, k17 }, { k18, k19, k1A, k1B, k1C, k1D, KC_NO, k3B }, \
16 { k20, k21, k22, k23, k24, k25, k26, k27 }, { k28, k29, k2A, k2B, k2C, k38, k39, k3A }, \
17 { k30, k31, k32, k33, k34, k35, k36, k37 }, \
18 { k40, k41, k42, k43, k44, k45, k46, k47 }, \
19}
20
21#endif
diff --git a/keyboards/handwired/kbod/keymaps/default/Makefile b/keyboards/handwired/kbod/keymaps/default/Makefile
new file mode 100644
index 000000000..0d9def930
--- /dev/null
+++ b/keyboards/handwired/kbod/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 = no # 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/handwired/kbod/keymaps/default/config.h b/keyboards/handwired/kbod/keymaps/default/config.h
new file mode 100644
index 000000000..df06a2620
--- /dev/null
+++ b/keyboards/handwired/kbod/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/handwired/kbod/keymaps/default/keymap.c b/keyboards/handwired/kbod/keymaps/default/keymap.c
new file mode 100644
index 000000000..1386b742f
--- /dev/null
+++ b/keyboards/handwired/kbod/keymaps/default/keymap.c
@@ -0,0 +1,104 @@
1#include "kbod.h"
2
3#define _____ KC_TRNS
4
5#define MODS_PRESSED(btn) (get_mods() & (MOD_BIT(KC_L##btn)|MOD_BIT(KC_R##btn)))
6
7#define SET_WHETHER(mask, btn1, btn2) \
8if (record->event.pressed) { \
9 if (mask) { \
10 add_key(btn2); \
11 send_keyboard_report(); \
12 } else { \
13 add_key(btn1); \
14 send_keyboard_report(); \
15 } \
16} else { \
17 if (mask) { \
18 del_key(btn2); \
19 send_keyboard_report(); \
20 } else { \
21 del_key(btn1); \
22 send_keyboard_report(); \
23 } \
24} \
25
26
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28 KEYMAP( /* Base */
29 F(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQUAL, KC_BSPC,
30 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_BSLASH,
31 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_ENTER,
32 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSFT,
33 TT(1), KC_LCTL, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL
34 ),
35 KEYMAP( /* Cursor layer */
36 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_DEL,
37 TT(3), _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_INSERT,
38 TT(2), _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_HOME, _____,
39 _____, _____, _____, _____, _____, _____, _____, _____, KC_PGUP, KC_PGDN, KC_END, KC_UP,
40 _____, _____, _____, _____, _____, KC_LEFT, KC_DOWN, KC_RIGHT
41 ),
42 KEYMAP( /* Keypad layer */
43 TO(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_BSPC,
44 _____, _____, _____, _____, _____, _____, _____, KC_P4, KC_P5, KC_P6, _____, _____, _____, _____,
45 _____, _____, _____, _____, _____, _____, _____, KC_P1, KC_P2, KC_P3, _____, _____, _____,
46 _____, _____, _____, _____, _____, _____, _____, KC_P0, KC_PDOT, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2,
47 _____, _____, _____, _____, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN3
48 ),
49 KEYMAP( /* Multimedia layer */
50 TO(0), _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _____,
51 _____, _____, KC_WAKE, _____, _____, _____, _____, _____, _____, _____, KC_MSTP, KC_MPRV, KC_MNXT, _____,
52 _____, _____, KC_SLEP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,
53 _____, _____, KC_PWR, _____, _____, _____, _____, _____, _____, KC_MS_BTN1, KC_MS_WH_UP, KC_MS_BTN2,
54 _____, _____, _____, KC_MPLY, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_MS_BTN3
55 ),
56};
57
58const uint16_t PROGMEM fn_actions[] = {
59 [0] = ACTION_FUNCTION(0),
60 [1] = ACTION_FUNCTION(1),
61};
62
63
64void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
65 static uint8_t shift_esc_mask;
66 static uint8_t alt_mask;
67 switch (id) {
68 case 0:
69 shift_esc_mask = MODS_PRESSED(SHIFT);
70 SET_WHETHER(shift_esc_mask, KC_ESC, KC_GRAVE);
71 break;
72 case 1:
73 alt_mask = MODS_PRESSED(ALT);
74 SET_WHETHER(alt_mask, KC_4, KC_F4);
75 break;
76 }
77}
78
79const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
80{
81 return MACRO_NONE;
82};
83
84void led_set_user(uint8_t usb_led) {
85 if (usb_led & _BV(USB_LED_CAPS_LOCK)) {
86 PORTB |= _BV(PB0);
87 } else {
88 PORTB &= ~_BV(PB0);
89 }
90}
91
92void matrix_init_user(void) {
93 DDRB |= _BV(PB0);
94 DDRC |= _BV(PC7);
95}
96
97void matrix_scan_user(void) {
98 uint8_t layer = biton32(layer_state);
99 if (layer) {
100 PORTC |= _BV(PC7);
101 } else {
102 PORTC &= ~_BV(PC7);
103 }
104} \ No newline at end of file
diff --git a/keyboards/handwired/kbod/keymaps/default/readme.md b/keyboards/handwired/kbod/keymaps/default/readme.md
new file mode 100644
index 000000000..35c22ec00
--- /dev/null
+++ b/keyboards/handwired/kbod/keymaps/default/readme.md
@@ -0,0 +1,5 @@
1# The default keymap for kbod
2
3This is the default keymap for kbod,
4
5it consists of a base layer with QWERTY layout, a momentary cursor-layer, and mouse-keys and multimedia layers. \ No newline at end of file
diff --git a/keyboards/handwired/kbod/readme.md b/keyboards/handwired/kbod/readme.md
new file mode 100644
index 000000000..67bf711be
--- /dev/null
+++ b/keyboards/handwired/kbod/readme.md
@@ -0,0 +1,21 @@
1KBOD keyboard firmware
2======================
3
4KBOD is a 60% Keyboard kit, hand-wired, with Arduino Micro as its controller. It's utilize 8x8 matrix and has layout similar to GH-60
5
6## Quantum MK Firmware
7
8For the full Quantum feature list, see [the parent readme](/).
9
10## Building
11
12Download or clone the whole firmware and use ```make handwired-kbod-default``` to generate the .hex file. You may flash it with avrdude
13
14## Flashing
15Something along this line:
16
17```
18avrdude -p m32u4 -c avr109 -P <COM PORT> -C <avrdude conf file> -e -u flash:w:handwired_kbod_default.hex
19```
20
21[More info](https://github.com/fudanchii/keyboard_of_disapproval) \ No newline at end of file
diff --git a/keyboards/handwired/kbod/rules.mk b/keyboards/handwired/kbod/rules.mk
new file mode 100644
index 000000000..4fcd147a9
--- /dev/null
+++ b/keyboards/handwired/kbod/rules.mk
@@ -0,0 +1,68 @@
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=4096
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 ?= no # Console for debug(+400)
58COMMAND_ENABLE ?= no # 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
68FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches
diff --git a/keyboards/kinesis/keymaps/xyverz/Makefile b/keyboards/kinesis/keymaps/xyverz/Makefile
new file mode 100644
index 000000000..1da780b84
--- /dev/null
+++ b/keyboards/kinesis/keymaps/xyverz/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 = yes # 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
diff --git a/keyboards/kinesis/keymaps/xyverz/config.h b/keyboards/kinesis/keymaps/xyverz/config.h
new file mode 100644
index 000000000..8893d122e
--- /dev/null
+++ b/keyboards/kinesis/keymaps/xyverz/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
diff --git a/keyboards/kinesis/keymaps/xyverz/keymap.c b/keyboards/kinesis/keymaps/xyverz/keymap.c
new file mode 100644
index 000000000..62f47773c
--- /dev/null
+++ b/keyboards/kinesis/keymaps/xyverz/keymap.c
@@ -0,0 +1,302 @@
1#include "kinesis.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4
5extern keymap_config_t keymap_config;
6
7#define _DV 0 // Dvorak layer
8#define _QW 1 // Qwerty layer
9#define _CM 2 // Colemak layer
10#define _MD 3 // Media Layer
11#define _KP 4 // Keypad Layer
12
13// Macro name shortcuts
14#define DVORAK M(_DV)
15#define QWERTY M(_QW)
16#define COLEMAK M(_CM)
17
18// Fillers to make layering more clear
19#define _______ KC_TRNS
20#define XXXXXXX KC_NO
21
22/*
23
24 Function Keys on All Layers (Keypad toggles):
25 ,-----------------------------------------------------------------.
26 | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 |
27 `-----------------------------------------------------------------'
28 ,-----------------------------------------------------------------.
29 | F9 | F10 | F11 | F12 | PScr | SLck | Paus | Keypad | RESET |
30 `-----------------------------------------------------------------'
31
32 Dvorak layer:
33 ,-------------------------------------------.,-------------------------------------------.
34 | ] | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | [ |
35 |--------+------+------+------+------+------||------+------+------+------+------+--------|
36 | Tab | ' | , | . | P | Y || F | G | C | R | L | \ |
37 |--------+------+------+------+------+------||------+------+------+------+------+--------|
38 | CapsLk | A | O | E | U | I || D | H | T | N | S | - |
39 |--------+------+------+------+------+------||------+------+------+------+------+--------|
40 | LShift | Z | X | C | V | X || B | M | W | V | Z | RShift |
41 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
42 | ` | INS | Left | Rght | | Up | Dn | / | = |
43 `---------------------------' `---------------------------'
44 ,--------------.,--------------.
45 | LCtl | LAlt || RGUI | RCtl |
46 ,------|-------|------||------+-------+-------.
47 | | Del | Home || PgUp | Enter | |
48 | BkSp | / |------||------| / | Space |
49 | | Media | End || PgDn | KeyPd | |
50 `---------------------'`----------------------'
51
52 QWERTY layer:
53 ,-------------------------------------------.,-------------------------------------------.
54 | = | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | - |
55 |--------+------+------+------+------+------||------+------+------+------+------+--------|
56 | Tab | Q | W | E | R | T || Y | U | I | O | P | \ |
57 |--------+------+------+------+------+------||------+------+------+------+------+--------|
58 | CapsLk | A | S | D | F | G || H | J | K | L | ; | ' |
59 |--------+------+------+------+------+------||------+------+------+------+------+--------|
60 | LShift | Z | X | C | V | B || N | M | , | . | / | RShift |
61 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
62 | ` | INS | Left | Rght | | Up | Dn | [ | ] |
63 `---------------------------' `---------------------------'
64 ,--------------.,--------------.
65 | LCtl | LAlt || RGUI | RCtl |
66 ,------|-------|------||------+-------+-------.
67 | | Del | Home || PgUp | Enter | |
68 | BkSp | / |------||------| / | Space |
69 | | Media | End || PgDn | KeyPd | |
70 `---------------------'`----------------------'
71
72 Colemak layer:
73 ,-------------------------------------------.,-------------------------------------------.
74 | = | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | - |
75 |--------+------+------+------+------+------||------+------+------+------+------+--------|
76 | Tab | Q | W | F | P | G || J | L | U | Y | ; | \ |
77 |--------+------+------+------+------+------||------+------+------+------+------+--------|
78 | BkSpc | A | R | S | T | D || H | N | E | I | O | ' |
79 |--------+------+------+------+------+------||------+------+------+------+------+--------|
80 | LShift | Z | X | C | V | B || K | M | , | . | / | RShift |
81 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
82 | ` | INS | Left | Rght | | Up | Dn | [ | ] |
83 `---------------------------' `---------------------------'
84 ,--------------.,--------------.
85 | LCtl | LAlt || RGUI | RCtl |
86 ,------|-------|------||------+-------+-------.
87 | | Del | Home || PgUp | Enter | |
88 | BkSp | / |------||------| / | Space |
89 | | Media | End || PgDn | KeyPd | |
90 `---------------------'`----------------------'
91
92 Media layer:
93 ,-------------------------------------------.,-------------------------------------------.
94 | F11 | F1 | F2 | F3 | F4 | F5 || F6 | F7 | F8 | F9 | F10 | F12 |
95 |--------+------+------+------+------+------||------+------+------+------+------+--------|
96 | | | | | | || | | | | | |
97 |--------+------+------+------+------+------||------+------+------+------+------+--------|
98 | | | | | | || | Mute | Vol- | Vol+ | | |
99 |--------+------+------+------+------+------||------+------+------+------+------+--------|
100 | | | | | | || Stop | Prev | Play | Next | Sel | |
101 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
102 | | | | | | | | | |
103 `---------------------------' `---------------------------'
104 ,-------------.,-------------.
105 | | || | |
106 ,------|------|------||------+------+------.
107 | | | || | | |
108 | | |------||------| | |
109 | | | || | | |
110 `--------------------'`--------------------'
111
112 Keypad layer:
113 ,-------------------------------------------.,-------------------------------------------.
114 | Power | | | | | || | NmLk | KP = | KP / | KP * | |
115 |--------+------+------+------+------+------||------+------+------+------+------+--------|
116 | Sleep | | | | | || | KP 7 | KP 8 | KP 9 | KP - | |
117 |--------+------+------+------+------+------||------+------+------+------+------+--------|
118 | Wake | |QWERTY|Colemk|Dvorak| || | KP 4 | KP 5 | KP 6 | KP + | |
119 |--------+------+------+------+------+------||------+------+------+------+------+--------|
120 | | | | | | || | KP 1 | KP 2 | KP 3 |KP Ent| |
121 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
122 | | | | | | | | KP . |KP Ent| |
123 `---------------------------' `----------------------------------'
124 ,-------------.,-------------.
125 | | || | |
126 ,------|------|------||------+------+------.
127 | | | || | | |
128 | | |------||------| | KP 0 |
129 | | | || | | |
130 `--------------------'`--------------------'
131*/
132
133const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
134
135[_DV] = KEYMAP(
136 // Left Hand
137 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8,
138 KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5,
139 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y,
140 KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I,
141 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X,
142 KC_GRV, KC_INS, KC_LEFT, KC_RGHT,
143 // Left Thumb
144 KC_LCTL, KC_LALT,
145 KC_HOME,
146 KC_BSPC, LT(_MD, KC_DEL), KC_END,
147
148 // Right Hand
149 KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KP), RESET,
150 KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC,
151 KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS,
152 KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
153 KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
154 KC_UP, KC_DOWN, KC_SLSH, KC_EQL,
155 // Right Thumb
156 KC_RGUI, KC_RCTL,
157 KC_PGUP,
158 KC_PGDN, LT(_KP, KC_ENT), KC_SPC
159 ),
160
161[_QW] = KEYMAP(
162 // Left Hand
163 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8,
164 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5,
165 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T,
166 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G,
167 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B,
168 KC_GRV, KC_INS, KC_LEFT, KC_RGHT,
169 // Left Thumb
170 KC_LCTL, KC_LALT,
171 KC_HOME,
172 KC_BSPC, LT(_MD, KC_DEL), KC_END,
173
174 // Right Hand
175 KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KP), RESET,
176 KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
177 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL ,
178 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
179 KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
180 KC_UP, KC_DOWN, KC_LBRC, KC_RBRC,
181 // Right Thumb
182 KC_RGUI, KC_RCTL,
183 KC_PGUP,
184 KC_PGDN, LT(_KP, KC_ENT), KC_SPC
185 ),
186
187[_CM] = KEYMAP(
188 // Left Hand
189 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8,
190 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5,
191 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G,
192 KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D,
193 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B,
194 KC_GRV, KC_INS, KC_LEFT, KC_RGHT,
195 // Left Thumb
196 KC_LCTL, KC_LALT,
197 KC_HOME,
198 KC_BSPC, LT(_MD, KC_DEL), KC_END,
199
200 // Right Hand
201 KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KP), RESET,
202 KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
203 KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL,
204 KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
205 KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
206 KC_UP, KC_DOWN, KC_LBRC, KC_RBRC,
207 // Right Thumb
208 KC_RGUI, KC_RCTL,
209 KC_PGUP,
210 KC_PGDN, LT(_KP, KC_ENT), KC_SPC
211 ),
212
213[_MD] = KEYMAP(
214 // Left Hand
215 _______, _______, _______, _______, _______, _______, _______, _______, _______,
216 KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
217 _______, _______, _______, _______, _______, _______,
218 _______, _______, _______, _______, _______, _______,
219 _______, _______, _______, _______, _______, _______,
220 _______, _______, _______, _______,
221 // Left Thumb
222 _______, _______,
223 _______,
224 _______, _______, _______,
225
226 // Right Hand
227 _______, _______, _______, _______, _______, _______, _______, _______, _______,
228 KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
229 _______, _______, _______, _______, _______, _______,
230 _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
231 KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______,
232 _______, _______, _______, _______,
233 // Right Thumb
234 _______, _______,
235 _______,
236 _______, _______, _______
237 ),
238
239[_KP] = KEYMAP(
240 // Left Hand
241 _______, _______, _______, _______, _______, _______, _______, _______, _______,
242 KC_PWR, _______, _______, _______, _______, _______,
243 KC_SLEP, _______, _______, _______, _______, _______,
244 KC_WAKE, _______, QWERTY, COLEMAK, DVORAK, _______,
245 _______, _______, _______, _______, _______, _______,
246 _______, _______, _______, _______,
247 // Left Thumb
248 _______, _______,
249 _______,
250 _______, _______, _______,
251
252 // Right Hand */
253 _______, _______, _______, _______, _______, _______, _______, _______, _______,
254 _______, KC_NLCK, KC_PEQL, KC_PSLS, KC_PAST, _______,
255 _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______,
256 _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______,
257 _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______,
258 _______, _______, KC_PDOT, KC_PENT,
259 // Right Thumb
260 _______, _______,
261 _______,
262 _______, _______, KC_P0
263 )
264
265};
266
267
268const uint16_t PROGMEM fn_actions[] = {
269
270};
271
272void persistant_default_layer_set(uint16_t default_layer) {
273 eeconfig_update_default_layer(default_layer);
274 default_layer_set(default_layer);
275}
276
277const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
278{
279 switch(id) {
280 case _DV:
281 if (record->event.pressed) {
282 persistant_default_layer_set(1UL<<_DV);
283 }
284 break;
285 case _QW:
286 if (record->event.pressed) {
287 persistant_default_layer_set(1UL<<_QW);
288 }
289 break;
290 case _CM:
291 if (record->event.pressed) {
292 persistant_default_layer_set(1UL<<_CM);
293 }
294 break;
295 }
296 return MACRO_NONE;
297};
298
299// Runs just one time when the keyboard initializes.
300void matrix_init_user(void) {
301
302};
diff --git a/keyboards/kinesis/keymaps/xyverz/readme.md b/keyboards/kinesis/keymaps/xyverz/readme.md
new file mode 100644
index 000000000..a10d7c2ba
--- /dev/null
+++ b/keyboards/kinesis/keymaps/xyverz/readme.md
@@ -0,0 +1,128 @@
1# Xyverz's Kinesis Keymap
2
3## About this keymap:
4
5The Dvorak layout shown here stems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my QMK Kinesis.
6
7The QWERTY layout shown here is based entirely on the Kinesis Advantage layout. The Colemak layout is merely an adaptation of that.
8
9I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts.
10
11## Still to do:
12
13 * Implement the CapsLock, NumLock, and ScrLck LEDs on the off-chance that I decide to actually solder some to the keyboard.
14
15### Function Keys on All Layers (keypad toggles):
16 ,-----------------------------------------------------------------.
17 | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 |
18 `-----------------------------------------------------------------'
19 ,-----------------------------------------------------------------.
20 | F9 | F10 | F11 | F12 | PScr | SLck | Paus | Keypad | Reset |
21 `-----------------------------------------------------------------'
22
23### Layer 0: Dvorak layer
24
25 ,-------------------------------------------.,-------------------------------------------.
26 | ] | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | [ |
27 |--------+------+------+------+------+------||------+------+------+------+------+--------|
28 | Tab | ' | , | . | P | Y || F | G | C | R | L | \ |
29 |--------+------+------+------+------+------||------+------+------+------+------+--------|
30 | CapsLk | A | O | E | U | I || D | H | T | N | S | - |
31 |--------+------+------+------+------+------||------+------+------+------+------+--------|
32 | LShift | Z | X | C | V | X || B | M | W | V | Z | RShift |
33 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
34 | ` | Ins | Left | Rght | | Up | Dn | / | = |
35 `---------------------------' `---------------------------'
36 ,--------------.,--------------.
37 | LCtl | LAlt || RGUI | RCtl |
38 ,------|-------|------||------+-------+-------.
39 | | Del | Home || PgUp | Enter | |
40 | BkSp | / |------||------| / | Space |
41 | | Media | End || PgDn | KeyPd | |
42 `---------------------'`----------------------'
43
44### Layer 1: QWERTY layer
45
46 ,-------------------------------------------.,-------------------------------------------.
47 | = | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | - |
48 |--------+------+------+------+------+------||------+------+------+------+------+--------|
49 | Tab | Q | W | E | R | T || Y | U | I | O | P | \ |
50 |--------+------+------+------+------+------||------+------+------+------+------+--------|
51 | CapsLk | A | S | D | F | G || H | J | K | L | ; | ' |
52 |--------+------+------+------+------+------||------+------+------+------+------+--------|
53 | LShift | Z | X | C | V | B || N | M | , | . | / | RShift |
54 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
55 | ` | Ins | Left | Rght | | Up | Dn | [ | ] |
56 `---------------------------' `---------------------------'
57 ,--------------.,--------------.
58 | LCtl | LAlt || RGUI | RCtl |
59 ,------|-------|------||------+-------+-------.
60 | | Del | Home || PgUp | Enter | |
61 | BkSp | / |------||------| / | Space |
62 | | Media | End || PgDn | KeyPd | |
63 `---------------------'`----------------------'
64
65### Keymap 2: Colemak layer
66
67 ,-------------------------------------------.,-------------------------------------------.
68 | = | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | - |
69 |--------+------+------+------+------+------||------+------+------+------+------+--------|
70 | Tab | Q | W | F | P | G || J | L | U | Y | ; | \ |
71 |--------+------+------+------+------+------||------+------+------+------+------+--------|
72 | BkSpc | A | R | S | T | D || H | N | E | I | O | ' |
73 |--------+------+------+------+------+------||------+------+------+------+------+--------|
74 | LShift | Z | X | C | V | B || K | M | , | . | / | RShift |
75 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
76 | ` | Ins | Left | Rght | | Up | Dn | [ | ] |
77 `---------------------------' `---------------------------'
78 ,--------------.,--------------.
79 | LCtl | LAlt || RGUI | RCtl |
80 ,------|-------|------||------+-------+-------.
81 | | Del | Home || PgUp | Enter | |
82 | BkSp | / |------||------| / | Space |
83 | | Media | End || PgDn | KeyPd | |
84 `---------------------'`----------------------'
85
86### layer 3 : Media layer
87
88 ,-------------------------------------------.,-------------------------------------------.
89 | F11 | F1 | F2 | F3 | F4 | F5 || F6 | F7 | F8 | F9 | F10 | F12 |
90 |--------+------+------+------+------+------||------+------+------+------+------+--------|
91 | | | | | | || | | | | | |
92 |--------+------+------+------+------+------||------+------+------+------+------+--------|
93 | | | | | | || | Mute | Vol- | Vol+ | | |
94 |--------+------+------+------+------+------||------+------+------+------+------+--------|
95 | | | | | | || Stop | Prev | Play | Next | Sel | |
96 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
97 | | | | | | | | | |
98 `---------------------------' `---------------------------'
99 ,-------------.,-------------.
100 | | || | |
101 ,------|------|------||------+------+------.
102 | | | || | | |
103 | | |------||------| | |
104 | | | || | | |
105 `--------------------'`--------------------'
106
107
108
109### Keymap 4: Keypad layer
110
111 ,-------------------------------------------.,-------------------------------------------.
112 | Power | | | | | || | NmLk | KP = | KP / | KP * | |
113 |--------+------+------+------+------+------||------+------+------+------+------+--------|
114 | Sleep | | | | | || | KP 7 | KP 8 | KP 9 | KP - | |
115 |--------+------+------+------+------+------||------+------+------+------+------+--------|
116 | Wake | |QWERTY|Colemk|Dvorak| || | KP 4 | KP 5 | KP 6 | KP + | |
117 |--------+------+------+------+------+------||------+------+------+------+------+--------|
118 | | | | | | || | KP 1 | KP 2 | KP 3 |KP Ent| |
119 `--------+------+------+------+------+------'`------+------+------+------+------+--------'
120 | | | | | | | | KP . |KP Ent| |
121 `---------------------------' `----------------------------------'
122 ,-------------.,-------------.
123 | | || | |
124 ,------|------|------||------+------+------.
125 | | | || | | |
126 | | |------||------| | KP 0 |
127 | | | || | | |
128 `--------------------'`--------------------'
diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h
index 353ea368c..8389ba111 100644
--- a/keyboards/lets_split/keymaps/OLED_sample/config.h
+++ b/keyboards/lets_split/keymaps/OLED_sample/config.h
@@ -27,19 +27,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27#define TAPPING_FORCE_HOLD 27#define TAPPING_FORCE_HOLD
28#define TAPPING_TERM 100 28#define TAPPING_TERM 100
29 29
30#ifdef SUBPROJECT_rev1
31 #include "../../rev1/config.h"
32#endif
33#ifdef SUBPROJECT_rev2
34 #include "../../rev2/config.h"
35#endif
36
30#undef RGBLED_NUM 37#undef RGBLED_NUM
31#define RGBLIGHT_ANIMATIONS 38#define RGBLIGHT_ANIMATIONS
32#define RGBLED_NUM 6 39#define RGBLED_NUM 6
33#define RGBLIGHT_HUE_STEP 10 40#define RGBLIGHT_HUE_STEP 10
34#define RGBLIGHT_SAT_STEP 17 41#define RGBLIGHT_SAT_STEP 17
35#define RGBLIGHT_VAL_STEP 17 42#define RGBLIGHT_VAL_STEP 17
36
37
38
39
40#ifdef SUBPROJECT_rev1
41 #include "../../rev1/config.h"
42#endif
43#ifdef SUBPROJECT_rev2
44 #include "../../rev2/config.h"
45#endif \ No newline at end of file
diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c
index 072b825ab..493ebcd3f 100644
--- a/keyboards/lets_split/keymaps/OLED_sample/keymap.c
+++ b/keyboards/lets_split/keymaps/OLED_sample/keymap.c
@@ -6,6 +6,9 @@
6#ifdef AUDIO_ENABLE 6#ifdef AUDIO_ENABLE
7 #include "audio.h" 7 #include "audio.h"
8#endif 8#endif
9#ifdef SSD1306OLED
10 #include "ssd1306.h"
11#endif
9 12
10extern keymap_config_t keymap_config; 13extern keymap_config_t keymap_config;
11 14
diff --git a/keyboards/lets_split/keymaps/hexwire/config.h b/keyboards/lets_split/keymaps/hexwire/config.h
index 9c8c6d7f4..e315d8c0c 100644
--- a/keyboards/lets_split/keymaps/hexwire/config.h
+++ b/keyboards/lets_split/keymaps/hexwire/config.h
@@ -20,51 +20,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21#define TAPPING_TERM 150 21#define TAPPING_TERM 150
22 22
23#undef RGBLED_NUM
24#define RGBLIGHT_ANIMATIONS
25#define RGBLED_NUM 8
26#define RGBLIGHT_HUE_STEP 8
27#define RGBLIGHT_SAT_STEP 8
28#define RGBLIGHT_VAL_STEP 8
29
30#ifdef SUBPROJECT_rev1 23#ifdef SUBPROJECT_rev1
31 #include "../../rev1/config.h" 24 #include "../../rev1/config.h"
32 #define COMPACT_KEYMAP( \
33 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
34 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
35 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
36 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
37 ) \
38 { \
39 { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \
40 { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \
41 { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \
42 { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \
43 { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \
44 { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \
45 { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \
46 { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \
47 }
48#endif 25#endif
49#ifdef SUBPROJECT_rev2 26#ifdef SUBPROJECT_rev2
50 #include "../../rev2/config.h" 27 #include "../../rev2/config.h"
51 #define COMPACT_KEYMAP( \
52 k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \
53 k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \
54 k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \
55 k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \
56 ) \
57 { \
58 { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \
59 { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \
60 { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \
61 { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \
62 { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \
63 { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \
64 { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \
65 { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \
66 }
67#endif
68#ifdef SUBPROJECT_rev2fliphalf
69 #include "../../rev2fliphalf/config.h"
70#endif 28#endif
29
30#undef RGBLED_NUM
31#define RGBLIGHT_ANIMATIONS
32#define RGBLED_NUM 8
33#define RGBLIGHT_HUE_STEP 8
34#define RGBLIGHT_SAT_STEP 8
35#define RGBLIGHT_VAL_STEP 8
diff --git a/keyboards/lets_split/keymaps/hexwire/keymap.c b/keyboards/lets_split/keymaps/hexwire/keymap.c
index f8370490d..fcf3cde75 100644
--- a/keyboards/lets_split/keymaps/hexwire/keymap.c
+++ b/keyboards/lets_split/keymaps/hexwire/keymap.c
@@ -39,7 +39,7 @@ enum custom_keycodes {
39 39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41 41
42 [_QWERTY] = COMPACT_KEYMAP( 42 [_QWERTY] = KC_KEYMAP(
43 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 43 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
44 TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, 44 TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS,
45 //|----+----+----+----+----+----| |----+----+----+----+----+----| 45 //|----+----+----+----+----+----| |----+----+----+----+----+----|
@@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
51 //`----+----+----+----+----+----' `----+----+----+----+----+----' 51 //`----+----+----+----+----+----' `----+----+----+----+----+----'
52 ), 52 ),
53 53
54 [_COLEMAK] = COMPACT_KEYMAP( 54 [_COLEMAK] = KC_KEYMAP(
55 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 55 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
56 TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, 56 TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS,
57 //|----+----+----+----+----+----| |----+----+----+----+----+----| 57 //|----+----+----+----+----+----| |----+----+----+----+----+----|
@@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
63 //`----+----+----+----+----+----' `----+----+----+----+----+----' 63 //`----+----+----+----+----+----' `----+----+----+----+----+----'
64 ), 64 ),
65 65
66 [_DVORAK] = COMPACT_KEYMAP( 66 [_DVORAK] = KC_KEYMAP(
67 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 67 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
68 TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, 68 TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS,
69 //|----+----+----+----+----+----| |----+----+----+----+----+----| 69 //|----+----+----+----+----+----| |----+----+----+----+----+----|
@@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
75 //`----+----+----+----+----+----' `----+----+----+----+----+----' 75 //`----+----+----+----+----+----' `----+----+----+----+----+----'
76 ), 76 ),
77 77
78 [_LOWER] = COMPACT_KEYMAP( 78 [_LOWER] = KC_KEYMAP(
79 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 79 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
80 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , 80 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , ,
81 //|----+----+----+----+----+----| |----+----+----+----+----+----| 81 //|----+----+----+----+----+----| |----+----+----+----+----+----|
@@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 //`----+----+----+----+----+----' `----+----+----+----+----+----' 87 //`----+----+----+----+----+----' `----+----+----+----+----+----'
88 ), 88 ),
89 89
90 [_RAISE] = COMPACT_KEYMAP( 90 [_RAISE] = KC_KEYMAP(
91 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 91 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
92 ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , 92 ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, ,
93 //|----+----+----+----+----+----| |----+----+----+----+----+----| 93 //|----+----+----+----+----+----| |----+----+----+----+----+----|
@@ -99,7 +99,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
99 //`----+----+----+----+----+----' `----+----+----+----+----+----' 99 //`----+----+----+----+----+----' `----+----+----+----+----+----'
100 ), 100 ),
101 101
102 [_FN3] = COMPACT_KEYMAP( 102 [_FN3] = KC_KEYMAP(
103 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 103 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
104 F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , 104 F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
105 //|----+----+----+----+----+----| |----+----+----+----+----+----| 105 //|----+----+----+----+----+----| |----+----+----+----+----+----|
diff --git a/keyboards/lets_split/keymaps/xyverz/config.h b/keyboards/lets_split/keymaps/xyverz/config.h
new file mode 100644
index 000000000..1b5be030e
--- /dev/null
+++ b/keyboards/lets_split/keymaps/xyverz/config.h
@@ -0,0 +1,37 @@
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
19#define USE_SERIAL
20
21#define MASTER_LEFT
22// #define MASTER_RIGHT
23// #define EE_HANDS
24
25#ifdef SUBPROJECT_rev1
26 #include "../../rev1/config.h"
27#endif
28#ifdef SUBPROJECT_rev2
29 #include "../../rev2/config.h"
30 /* RGB Underglow */
31 #undef RGBLED_NUM
32 #define RGBLIGHT_ANIMATIONS
33 #define RGBLED_NUM 8
34#endif
35#ifdef SUBPROJECT_rev2fliphalf
36 #include "../../rev2fliphalf/config.h"
37#endif
diff --git a/keyboards/lets_split/keymaps/xyverz/keymap.c b/keyboards/lets_split/keymaps/xyverz/keymap.c
new file mode 100644
index 000000000..216e94696
--- /dev/null
+++ b/keyboards/lets_split/keymaps/xyverz/keymap.c
@@ -0,0 +1,191 @@
1#include "lets_split.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4
5extern keymap_config_t keymap_config;
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them
10// entirely and just use numbers.
11#define _QWERTY 0
12#define _COLEMAK 1
13#define _DVORAK 2
14#define _LOWER 3
15#define _RAISE 4
16#define _ADJUST 16
17
18enum planck_keycodes {
19 QWERTY = SAFE_RANGE,
20 COLEMAK,
21 DVORAK,
22 LOWER,
23 RAISE,
24 ADJUST
25};
26
27// Fillers to make layering more clear
28#define _______ KC_TRNS
29#define XXXXXXX KC_NO
30
31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32
33/* Qwerty
34 * ,-----------------------------------------------------------------------------------.
35 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
36 * |------+------+------+------+------+-------------+------+------+------+------+------|
37 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
38 * |------+------+------+------+------+------|------+------+------+------+------+------|
39 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
40 * |------+------+------+------+------+------+------+------+------+------+------+------|
41 * | Brite| Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Left | Down | Up |Right |
42 * `-----------------------------------------------------------------------------------'
43 */
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, \
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, \
47 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\
48 KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \
49),
50
51/* Colemak
52 * ,-----------------------------------------------------------------------------------.
53 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
54 * |------+------+------+------+------+-------------+------+------+------+------+------|
55 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
56 * |------+------+------+------+------+------|------+------+------+------+------+------|
57 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
58 * |------+------+------+------+------+------+------+------+------+------+------+------|
59 * | Brite| Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Left | Down | Up |Right |
60 * `-----------------------------------------------------------------------------------'
61 */
62[_COLEMAK] = KEYMAP ( \
63 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
64 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
65 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
66 KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \
67),
68
69/* Dvorak
70 * ,-----------------------------------------------------------------------------------.
71 * | Tab | " | , | . | P | Y | F | G | C | R | L | / |
72 * |------+------+------+------+------+-------------+------+------+------+------+------|
73 * | Esc | A | O | E | U | I | D | H | T | N | S | - |
74 * |------+------+------+------+------+------|------+------+------+------+------+------|
75 * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift|
76 * |------+------+------+------+------+------+------+------+------+------+------+------|
77 * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
78 * `-----------------------------------------------------------------------------------'
79 */
80[_DVORAK] = KEYMAP ( \
81 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \
82 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \
83 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \
84 KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT \
85),
86
87/* Lower
88 * ,-----------------------------------------------------------------------------------.
89 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
90 * |------+------+------+------+------+-------------+------+------+------+------+------|
91 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
92 * |------+------+------+------+------+------|------+------+------+------+------+------|
93 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | |
94 * |------+------+------+------+------+------+------+------+------+------+------+------|
95 * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter |
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, _______, \
100 KC_CAPS, 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, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, \
102 _______, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ \
103),
104
105/* Raise
106 * ,-----------------------------------------------------------------------------------.
107 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
108 * |------+------+------+------+------+-------------+------+------+------+------+------|
109 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
110 * |------+------+------+------+------+------|------+------+------+------+------+------|
111 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | |
112 * |------+------+------+------+------+------+------+------+------+------+------+------|
113 * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter |
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, _______, \
118 KC_CAPS, 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_MPRV, KC_MPLY, KC_MNXT, _______, _______, \
120 _______, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______ \
121),
122
123/* Adjust (Lower + Raise)
124 * ,-----------------------------------------------------------------------------------.
125 * | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 |
126 * |------+------+------+------+------+-------------+------+------+------+------+------|
127 * | | Reset| |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
128 * |------+------+------+------+------+------|------+------+------+------+------+------|
129 * | |RGB ON| MODE | HUE+ | HUE- | SAT+ | SAT- | VAL+ | VAL- | | | |
130 * |------+------+------+------+------+------+------+------+------+------+------+------|
131 * | | | | | | | | | | | |
132 * `-----------------------------------------------------------------------------------'
133 */
134[_ADJUST] = KEYMAP ( \
135 KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \
136 _______, RESET, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
137 _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, \
138 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
139)
140
141
142};
143
144void persistant_default_layer_set(uint16_t default_layer) {
145 eeconfig_update_default_layer(default_layer);
146 default_layer_set(default_layer);
147}
148
149bool process_record_user(uint16_t keycode, keyrecord_t *record) {
150 switch (keycode) {
151 case QWERTY:
152 if (record->event.pressed) {
153 persistant_default_layer_set(1UL<<_QWERTY);
154 }
155 return false;
156 break;
157 case COLEMAK:
158 if (record->event.pressed) {
159 persistant_default_layer_set(1UL<<_COLEMAK);
160 }
161 return false;
162 break;
163 case DVORAK:
164 if (record->event.pressed) {
165 persistant_default_layer_set(1UL<<_DVORAK);
166 }
167 return false;
168 break;
169 case LOWER:
170 if (record->event.pressed) {
171 layer_on(_LOWER);
172 update_tri_layer(_LOWER, _RAISE, _ADJUST);
173 } else {
174 layer_off(_LOWER);
175 update_tri_layer(_LOWER, _RAISE, _ADJUST);
176 }
177 return false;
178 break;
179 case RAISE:
180 if (record->event.pressed) {
181 layer_on(_RAISE);
182 update_tri_layer(_LOWER, _RAISE, _ADJUST);
183 } else {
184 layer_off(_RAISE);
185 update_tri_layer(_LOWER, _RAISE, _ADJUST);
186 }
187 return false;
188 break;
189 }
190 return true;
191}
diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h
index 0de308c7a..1892bf2cb 100644
--- a/keyboards/lets_split/lets_split.h
+++ b/keyboards/lets_split/lets_split.h
@@ -11,6 +11,20 @@
11 #include "rev2fliphalf.h" 11 #include "rev2fliphalf.h"
12#endif 12#endif
13 13
14// Used to create a keymap using only KC_ prefixed keys
15#define KC_KEYMAP( \
16 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
17 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
18 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
19 L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
20 ) \
21 KEYMAP( \
22 KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \
23 KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \
24 KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \
25 KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \
26 )
27
14#include "quantum.h" 28#include "quantum.h"
15 29
16#endif \ No newline at end of file 30#endif \ No newline at end of file
diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md
index ecce3f415..7e5a54602 100644
--- a/keyboards/lets_split/readme.md
+++ b/keyboards/lets_split/readme.md
@@ -7,6 +7,12 @@ Split keyboard firmware for Arduino Pro Micro or other ATmega32u4
7based boards. 7based boards.
8 8
9 9
10## Build Guide
11
12A build guide for putting together the Let's Split v2 can be found here: [An Overly Verbose Guide to Building a Let's Split Keyboard](https://github.com/nicinabox/lets-split-guide)
13
14There is additional information there about flashing and adding RGB underglow.
15
10## First Time Setup 16## First Time Setup
11 17
12Download or clone the whole firmware and navigate to the keyboards/lets_split directory. Once your dev env is setup, you'll be able to generate the default .hex using: 18Download or clone the whole firmware and navigate to the keyboards/lets_split directory. Once your dev env is setup, you'll be able to generate the default .hex using:
@@ -62,8 +68,7 @@ Apart from diodes and key switches for the keyboard matrix in each half, you
62will need: 68will need:
63 69
64* 2 Arduino Pro Micro's. You can find theses on aliexpress for ≈3.50USD each. 70* 2 Arduino Pro Micro's. You can find theses on aliexpress for ≈3.50USD each.
65* 2 TRS sockets 71* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable
66* 1 TRS cable.
67 72
68Alternatively, you can use any sort of cable and socket that has at least 3 73Alternatively, you can use any sort of cable and socket that has at least 3
69wires. If you want to use I2C to communicate between halves, you will need a 74wires. If you want to use I2C to communicate between halves, you will need a
@@ -77,7 +82,7 @@ A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and t
77Wiring 82Wiring
78------ 83------
79 84
80The 3 wires of the TRS cable need to connect GND, VCC, and digital pin 3 (i.e. 85The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e.
81PD0 on the ATmega32u4) between the two Pro Micros. 86PD0 on the ATmega32u4) between the two Pro Micros.
82 87
83Then wire your key matrix to any of the remaining 17 IO pins of the pro micro 88Then wire your key matrix to any of the remaining 17 IO pins of the pro micro
diff --git a/keyboards/lets_split/rev1/rev1.h b/keyboards/lets_split/rev1/rev1.h
index 4667c9fb0..6bf9f0f03 100644
--- a/keyboards/lets_split/rev1/rev1.h
+++ b/keyboards/lets_split/rev1/rev1.h
@@ -9,20 +9,20 @@
9//void promicro_bootloader_jmp(bool program); 9//void promicro_bootloader_jmp(bool program);
10 10
11#define KEYMAP( \ 11#define KEYMAP( \
12 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ 12 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
13 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ 13 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
14 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ 14 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
15 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ 15 L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
16 ) \ 16 ) \
17 { \ 17 { \
18 { k00, k01, k02, k03, k04, k05 }, \ 18 { L00, L01, L02, L03, L04, L05 }, \
19 { k10, k11, k12, k13, k14, k15 }, \ 19 { L10, L11, L12, L13, L14, L15 }, \
20 { k20, k21, k22, k23, k24, k25 }, \ 20 { L20, L21, L22, L23, L24, L25 }, \
21 { k30, k31, k32, k33, k34, k35 }, \ 21 { L30, L31, L32, L33, L34, L35 }, \
22 { k40, k41, k42, k43, k44, k45 }, \ 22 { R00, R01, R02, R03, R04, R05 }, \
23 { k50, k51, k52, k53, k54, k55 }, \ 23 { R10, R11, R12, R13, R14, R15 }, \
24 { k60, k61, k62, k63, k64, k65 }, \ 24 { R20, R21, R22, R23, R24, R25 }, \
25 { k70, k71, k72, k73, k74, k75 } \ 25 { R30, R31, R32, R33, R34, R35 } \
26 } 26 }
27 27
28#endif \ No newline at end of file 28#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rev2/rev2.c b/keyboards/lets_split/rev2/rev2.c
index 8bfa171d0..20a4c6be1 100644
--- a/keyboards/lets_split/rev2/rev2.c
+++ b/keyboards/lets_split/rev2/rev2.c
@@ -37,4 +37,3 @@ void shutdown_user(void) {
37 stop_all_notes(); 37 stop_all_notes();
38 #endif 38 #endif
39} 39}
40
diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h
index 054731366..0c4e8e7de 100644
--- a/keyboards/lets_split/rev2/rev2.h
+++ b/keyboards/lets_split/rev2/rev2.h
@@ -10,62 +10,51 @@
10#ifdef USE_I2C 10#ifdef USE_I2C
11#include <stddef.h> 11#include <stddef.h>
12#ifdef __AVR__ 12#ifdef __AVR__
13#include <avr/io.h> 13 #include <avr/io.h>
14#include <avr/interrupt.h> 14 #include <avr/interrupt.h>
15#endif
16#ifdef SSD1306OLED
17extern bool iota_gfx_init(void);
18extern void iota_gfx_task(void);
19extern bool iota_gfx_off(void);
20extern bool iota_gfx_on(void);
21extern void iota_gfx_flush(void);
22extern void iota_gfx_write_char(uint8_t c);
23extern void iota_gfx_write(const char *data);
24extern void iota_gfx_write_P(const char *data);
25extern void iota_gfx_clear_screen(void);
26#endif 15#endif
27#endif 16#endif
28 17
29//void promicro_bootloader_jmp(bool program); 18//void promicro_bootloader_jmp(bool program);
30 19
31#ifndef FLIP_HALF 20#ifndef FLIP_HALF
32//Standard Keymap 21// Standard Keymap
22// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left)
33#define KEYMAP( \ 23#define KEYMAP( \
34 k40, k41, k42, k43, k44, k45, k05, k04, k03, k02, k01, k00, \ 24 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
35 k50, k51, k52, k53, k54, k55, k15, k14, k13, k12, k11, k10, \ 25 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
36 k60, k61, k62, k63, k64, k65, k25, k24, k23, k22, k21, k20, \ 26 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
37 k70, k71, k72, k73, k74, k75, k35, k34, k33, k32, k31, k30 \ 27 L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
38 ) \ 28 ) \
39 { \ 29 { \
40 { k45, k44, k43, k42, k41, k40 }, \ 30 { L00, L01, L02, L03, L04, L05 }, \
41 { k55, k54, k53, k52, k51, k50 }, \ 31 { L10, L11, L12, L13, L14, L15 }, \
42 { k65, k64, k63, k62, k61, k60 }, \ 32 { L20, L21, L22, L23, L24, L25 }, \
43 { k75, k74, k73, k72, k71, k70 }, \ 33 { L30, L31, L32, L33, L34, L35 }, \
44 { k00, k01, k02, k03, k04, k05 }, \ 34 { R05, R04, R03, R02, R01, R00 }, \
45 { k10, k11, k12, k13, k14, k15 }, \ 35 { R15, R14, R13, R12, R11, R10 }, \
46 { k20, k21, k22, k23, k24, k25 }, \ 36 { R25, R24, R23, R22, R21, R20 }, \
47 { k30, k31, k32, k33, k34, k35 } \ 37 { R35, R34, R33, R32, R31, R30 } \
48 } 38 }
49
50#else 39#else
51// Keymap with one side flipped 40// Keymap with right side flipped
41// (TRRS jack on both halves are to the right)
52#define KEYMAP( \ 42#define KEYMAP( \
53 k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ 43 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
54 k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ 44 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
55 k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ 45 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
56 k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ 46 L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
57 ) \ 47 ) \
58 { \ 48 { \
59 { k00, k01, k02, k03, k04, k05 }, \ 49 { L00, L01, L02, L03, L04, L05 }, \
60 { k10, k11, k12, k13, k14, k15 }, \ 50 { L10, L11, L12, L13, L14, L15 }, \
61 { k20, k21, k22, k23, k24, k25 }, \ 51 { L20, L21, L22, L23, L24, L25 }, \
62 { k30, k31, k32, k33, k34, k35 }, \ 52 { L30, L31, L32, L33, L34, L35 }, \
63 { k45, k44, k43, k42, k41, k40 }, \ 53 { R00, R01, R02, R03, R04, R05 }, \
64 { k55, k54, k53, k52, k51, k50 }, \ 54 { R10, R11, R12, R13, R14, R15 }, \
65 { k65, k64, k63, k62, k61, k60 }, \ 55 { R20, R21, R22, R23, R24, R25 }, \
66 { k75, k74, k73, k72, k71, k70 } \ 56 { R30, R31, R32, R33, R34, R35 } \
67 } 57 }
68#endif 58#endif
69 59
70 60#endif
71#endif \ No newline at end of file
diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk
index ff159e0f0..79860ea35 100644
--- a/keyboards/lets_split/rules.mk
+++ b/keyboards/lets_split/rules.mk
@@ -1,7 +1,7 @@
1SRC += matrix.c \ 1SRC += matrix.c \
2 i2c.c \ 2 i2c.c \
3 split_util.c \ 3 split_util.c \
4 serial.c\ 4 serial.c \
5 ssd1306.c 5 ssd1306.c
6 6
7# MCU name 7# MCU name
@@ -74,3 +74,15 @@ USE_I2C ?= yes
74SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 74SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
75 75
76CUSTOM_MATRIX = yes 76CUSTOM_MATRIX = yes
77
78avrdude: build
79 ls /dev/tty* > /tmp/1; \
80 echo "Reset your Pro Micro now"; \
81 while [[ -z $$USB ]]; do \
82 sleep 1; \
83 ls /dev/tty* > /tmp/2; \
84 USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
85 done; \
86 avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
87
88.PHONY: avrdude
diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c
index 46586fbc0..39639c3b4 100644
--- a/keyboards/lets_split/split_util.c
+++ b/keyboards/lets_split/split_util.c
@@ -21,7 +21,7 @@ static void setup_handedness(void) {
21 #ifdef EE_HANDS 21 #ifdef EE_HANDS
22 isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); 22 isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
23 #else 23 #else
24 // I2c_MASTER_RIGHT ish deprecate use MASTER_RIGHT instead since this works for both serial and i2c: 24 // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c
25 #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) 25 #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
26 isLeftHand = !has_usb(); 26 isLeftHand = !has_usb();
27 #else 27 #else
diff --git a/keyboards/lets_split/ssd1306.c b/keyboards/lets_split/ssd1306.c
index 3c7816bb3..5c6dff27f 100644
--- a/keyboards/lets_split/ssd1306.c
+++ b/keyboards/lets_split/ssd1306.c
@@ -1,8 +1,9 @@
1#ifdef SSD1306OLED
2
3#include "ssd1306.h"
1#include "config.h" 4#include "config.h"
2#include "i2c.h" 5#include "i2c.h"
3#include <stdbool.h>
4#include <string.h> 6#include <string.h>
5#include <stdio.h>
6#include "print.h" 7#include "print.h"
7#include "lets_split.h" 8#include "lets_split.h"
8#include "common/glcdfont.c" 9#include "common/glcdfont.c"
@@ -466,3 +467,4 @@ void iota_gfx_task(void) {
466 iota_gfx_off(); 467 iota_gfx_off();
467 } 468 }
468} 469}
470#endif
diff --git a/keyboards/lets_split/ssd1306.h b/keyboards/lets_split/ssd1306.h
new file mode 100644
index 000000000..b0c74f987
--- /dev/null
+++ b/keyboards/lets_split/ssd1306.h
@@ -0,0 +1,17 @@
1#ifndef SSD1306_H
2#define SSD1306_H
3
4#include <stdbool.h>
5#include <stdio.h>
6
7bool iota_gfx_init(void);
8void iota_gfx_task(void);
9bool iota_gfx_off(void);
10bool iota_gfx_on(void);
11void iota_gfx_flush(void);
12void iota_gfx_write_char(uint8_t c);
13void iota_gfx_write(const char *data);
14void iota_gfx_write_P(const char *data);
15void iota_gfx_clear_screen(void);
16
17#endif
diff --git a/keyboards/miuni32/Makefile b/keyboards/miuni32/Makefile
new file mode 100644
index 000000000..57b2ef62e
--- /dev/null
+++ b/keyboards/miuni32/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif
diff --git a/keyboards/miuni32/config.h b/keyboards/miuni32/config.h
new file mode 100644
index 000000000..4f9b68551
--- /dev/null
+++ b/keyboards/miuni32/config.h
@@ -0,0 +1,170 @@
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 Bigtuna.io
28#define PRODUCT Miuni32
29#define DESCRIPTION A custom keyboard for writers
30
31/* key matrix size */
32#define MATRIX_ROWS 3
33#define MATRIX_COLS 11
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { F0, F4, D7}
46#define MATRIX_COL_PINS { C6, C7, F7, F6, F1, E6, B7, B3, B2, B1, B0}
47#define UNUSED_PINS
48
49/* COL2ROW or ROW2COL */
50#define DIODE_DIRECTION ROW2COL
51
52// #define BACKLIGHT_PIN B7
53// #define BACKLIGHT_BREATHING
54// #define BACKLIGHT_LEVELS 3
55
56
57/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
58#define DEBOUNCING_DELAY 5
59
60/* define if matrix has ghost (lacks anti-ghosting diodes) */
61//#define MATRIX_HAS_GHOST
62
63/* number of backlight levels */
64
65/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
66#define LOCKING_SUPPORT_ENABLE
67/* Locking resynchronize hack */
68#define LOCKING_RESYNC_ENABLE
69
70/*
71 * Force NKRO
72 *
73 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
74 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
75 * makefile for this to work.)
76 *
77 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
78 * until the next keyboard reset.
79 *
80 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
81 * fully operational during normal computer usage.
82 *
83 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
84 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
85 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
86 * power-up.
87 *
88 */
89//#define FORCE_NKRO
90
91/*
92 * Magic Key Options
93 *
94 * Magic keys are hotkey commands that allow control over firmware functions of
95 * the keyboard. They are best used in combination with the HID Listen program,
96 * found here: https://www.pjrc.com/teensy/hid_listen.html
97 *
98 * The options below allow the magic key functionality to be changed. This is
99 * useful if your keyboard/keypad is missing keys and you want magic key support.
100 *
101 */
102
103/* key combination for magic key command */
104#define IS_COMMAND() ( \
105 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
106)
107
108/* control how magic key switches layers */
109//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
112
113/* override magic key keymap */
114//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
115//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
117//#define MAGIC_KEY_HELP1 H
118//#define MAGIC_KEY_HELP2 SLASH
119//#define MAGIC_KEY_DEBUG D
120//#define MAGIC_KEY_DEBUG_MATRIX X
121//#define MAGIC_KEY_DEBUG_KBD K
122//#define MAGIC_KEY_DEBUG_MOUSE M
123//#define MAGIC_KEY_VERSION V
124//#define MAGIC_KEY_STATUS S
125//#define MAGIC_KEY_CONSOLE C
126//#define MAGIC_KEY_LAYER0_ALT1 ESC
127//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
128//#define MAGIC_KEY_LAYER0 0
129//#define MAGIC_KEY_LAYER1 1
130//#define MAGIC_KEY_LAYER2 2
131//#define MAGIC_KEY_LAYER3 3
132//#define MAGIC_KEY_LAYER4 4
133//#define MAGIC_KEY_LAYER5 5
134//#define MAGIC_KEY_LAYER6 6
135//#define MAGIC_KEY_LAYER7 7
136//#define MAGIC_KEY_LAYER8 8
137//#define MAGIC_KEY_LAYER9 9
138//#define MAGIC_KEY_BOOTLOADER PAUSE
139//#define MAGIC_KEY_LOCK CAPS
140//#define MAGIC_KEY_EEPROM E
141//#define MAGIC_KEY_NKRO N
142//#define MAGIC_KEY_SLEEP_LED Z
143
144/*
145 * Feature disable options
146 * These options are also useful to firmware size reduction.
147 */
148
149/* disable debug print */
150//#define NO_DEBUG
151
152/* disable print */
153//#define NO_PRINT
154
155/* disable action features */
156//#define NO_ACTION_LAYER
157//#define NO_ACTION_TAPPING
158//#define NO_ACTION_ONESHOT
159//#define NO_ACTION_MACRO
160//#define NO_ACTION_FUNCTION
161
162#define RGBLIGHT_TIMER
163#define RGB_DI_PIN D0 // The pin your RGB strip is wired to
164#define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio)
165#define RGBLED_NUM 7 // Number of LEDs
166#define RGBLIGHT_HUE_STEP 10
167#define RGBLIGHT_SAT_STEP 17
168#define RGBLIGHT_VAL_STEP 17
169
170#endif
diff --git a/keyboards/miuni32/keymaps/default/Makefile b/keyboards/miuni32/keymaps/default/Makefile
new file mode 100644
index 000000000..88a3aea74
--- /dev/null
+++ b/keyboards/miuni32/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 = yes # 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
diff --git a/keyboards/miuni32/keymaps/default/config.h b/keyboards/miuni32/keymaps/default/config.h
new file mode 100644
index 000000000..df06a2620
--- /dev/null
+++ b/keyboards/miuni32/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/miuni32/keymaps/default/keymap.c b/keyboards/miuni32/keymaps/default/keymap.c
new file mode 100644
index 000000000..15e2fa45c
--- /dev/null
+++ b/keyboards/miuni32/keymaps/default/keymap.c
@@ -0,0 +1,49 @@
1#include "miuni32.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4[0] ={
5 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
6 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, KC_ENT},
7 {KC_Z, KC_X, KC_C, KC_V, KC_V, KC_SPC, KC_B, KC_N, KC_M , MO(1), KC_RCTL}
8 },
9[1] ={
10 {KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL},
11 {KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_TRNS},
12 {RGB_TOG, RGB_HUI, RGB_HUD, RGB_SAI, KC_TRNS, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, RGB_MOD},
13 }
14};
15const uint16_t PROGMEM fn_actions[] = {
16
17};
18
19const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
20{
21 // MACRODOWN only works in this function
22 switch(id) {
23 case 0:
24 if (record->event.pressed) {
25 register_code(KC_RSFT);
26 } else {
27 unregister_code(KC_RSFT);
28 }
29 break;
30 }
31 return MACRO_NONE;
32};
33
34
35void matrix_init_user(void) {
36
37}
38
39void matrix_scan_user(void) {
40
41}
42
43bool process_record_user(uint16_t keycode, keyrecord_t *record) {
44 return true;
45}
46
47void led_set_user(uint8_t usb_led) {
48
49}
diff --git a/keyboards/miuni32/keymaps/default/readme.md b/keyboards/miuni32/keymaps/default/readme.md
new file mode 100644
index 000000000..4cff8ef5a
--- /dev/null
+++ b/keyboards/miuni32/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for miuni32 \ No newline at end of file
diff --git a/keyboards/miuni32/miuni32.c b/keyboards/miuni32/miuni32.c
new file mode 100644
index 000000000..1c1983a56
--- /dev/null
+++ b/keyboards/miuni32/miuni32.c
@@ -0,0 +1,28 @@
1#include "miuni32.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/miuni32/miuni32.h b/keyboards/miuni32/miuni32.h
new file mode 100644
index 000000000..eecb17f81
--- /dev/null
+++ b/keyboards/miuni32/miuni32.h
@@ -0,0 +1,15 @@
1#ifndef MIUNI32_H
2#define MIUNI32_H
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
8 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
9 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A ) { \
10 { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A }, \
11 { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A }, \
12 { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A } \
13}
14
15#endif
diff --git a/keyboards/miuni32/readme.md b/keyboards/miuni32/readme.md
new file mode 100644
index 000000000..36696ddbc
--- /dev/null
+++ b/keyboards/miuni32/readme.md
@@ -0,0 +1,28 @@
1miuni32 keyboard firmware
2======================
3
4## Quantum MK Firmware
5
6For the full Quantum feature list, see [the parent readme](/).
7
8## Building
9
10Download or clone the whole firmware and navigate to the keyboards/miuni32 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 default`.
17
18### Other Keymaps
19
20Several 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.
21
22To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
23
24```
25$ make [default|jack|<name>]
26```
27
28Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/miuni32/rules.mk b/keyboards/miuni32/rules.mk
new file mode 100644
index 000000000..ef8daf3ca
--- /dev/null
+++ b/keyboards/miuni32/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=4096
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
diff --git a/keyboards/planck/keymaps/khord/config.h b/keyboards/planck/keymaps/khord/config.h
index 008f3a5c2..83dece50e 100644
--- a/keyboards/planck/keymaps/khord/config.h
+++ b/keyboards/planck/keymaps/khord/config.h
@@ -48,6 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
48 48
49/* number of backlight levels */ 49/* number of backlight levels */
50#define BACKLIGHT_LEVELS 3 50#define BACKLIGHT_LEVELS 3
51#define BACKLIGHT_BREATHING
51 52
52/* Set 0 if debouncing isn't needed */ 53/* Set 0 if debouncing isn't needed */
53#define DEBOUNCING_DELAY 5 54#define DEBOUNCING_DELAY 5
diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c
index 8001a0986..e371e5b70 100644
--- a/keyboards/planck/keymaps/khord/keymap.c
+++ b/keyboards/planck/keymaps/khord/keymap.c
@@ -37,6 +37,14 @@ enum planck_keycodes {
37#define _______ KC_TRNS 37#define _______ KC_TRNS
38#define XXXXXXX KC_NO 38#define XXXXXXX KC_NO
39 39
40#define MACRO_BREATH_TOGGLE 21
41#define MACRO_BREATH_SPEED_INC 23
42#define MACRO_BREATH_SPEED_DEC 24
43#define MACRO_BREATH_DEFAULT 25
44#define M_BRTOG M(MACRO_BREATH_TOGGLE)
45#define M_BRINC M(MACRO_BREATH_SPEED_INC)
46#define M_BRDEC M(MACRO_BREATH_SPEED_DEC)
47#define M_BRDFT M(MACRO_BREATH_DEFAULT)
40// Tap Dance Declarations 48// Tap Dance Declarations
41enum { 49enum {
42 ESC_CAP = 0, 50 ESC_CAP = 0,
@@ -173,10 +181,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
173 * `-----------------------------------------------------------------------------------' 181 * `-----------------------------------------------------------------------------------'
174 */ 182 */
175[_ADJUST] = { 183[_ADJUST] = {
176 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, 184 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, M_BRDFT, KC_DEL },
177 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, 185 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, M_BRINC, _______},
178 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, 186 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, M_BRDEC, C_A_INS},
179 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_A_INS, C_A_DEL} 187 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_BRTOG, C_A_DEL}
180} 188}
181 189
182 190
@@ -210,6 +218,32 @@ void persistant_default_layer_set(uint16_t default_layer) {
210 default_layer_set(default_layer); 218 default_layer_set(default_layer);
211} 219}
212 220
221const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
222 switch(id) {
223 case MACRO_BREATH_TOGGLE:
224 if (record->event.pressed) {
225 breathing_toggle();
226 }
227 break;
228 case MACRO_BREATH_SPEED_INC:
229 if (record->event.pressed) {
230 breathing_speed_inc(1);
231 }
232 break;
233 case MACRO_BREATH_SPEED_DEC:
234 if (record->event.pressed) {
235 breathing_speed_dec(1);
236 }
237 break;
238 case MACRO_BREATH_DEFAULT:
239 if (record->event.pressed) {
240 breathing_defaults();
241 }
242 break;
243 }
244 return MACRO_NONE;
245}
246
213bool process_record_user(uint16_t keycode, keyrecord_t *record) { 247bool process_record_user(uint16_t keycode, keyrecord_t *record) {
214 switch (keycode) { 248 switch (keycode) {
215 case QWERTY: 249 case QWERTY:
diff --git a/keyboards/planck/keymaps/xyverz/Makefile b/keyboards/planck/keymaps/xyverz/Makefile
new file mode 100644
index 000000000..55bf853a0
--- /dev/null
+++ b/keyboards/planck/keymaps/xyverz/Makefile
@@ -0,0 +1,6 @@
1BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
2AUDIO_ENABLE = no # Audio output on port C6
3
4ifndef QUANTUM_DIR
5 include ../../../../Makefile
6endif
diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c
index 192933b18..329bb043a 100644
--- a/keyboards/planck/keymaps/xyverz/keymap.c
+++ b/keyboards/planck/keymaps/xyverz/keymap.c
@@ -44,14 +44,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
44 * |------+------+------+------+------+------|------+------+------+------+------+------| 44 * |------+------+------+------+------+------|------+------+------+------+------+------|
45 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | 45 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
46 * |------+------+------+------+------+------+------+------+------+------+------+------| 46 * |------+------+------+------+------+------+------+------+------+------+------+------|
47 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | 47 * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
48 * `-----------------------------------------------------------------------------------' 48 * `-----------------------------------------------------------------------------------'
49 */ 49 */
50[_QWERTY] = { 50[_QWERTY] = {
51 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, 51 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
52 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, 52 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
53 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, 53 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
54 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} 54 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
55}, 55},
56 56
57/* Colemak 57/* Colemak
@@ -62,14 +62,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
62 * |------+------+------+------+------+------|------+------+------+------+------+------| 62 * |------+------+------+------+------+------|------+------+------+------+------+------|
63 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | 63 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
64 * |------+------+------+------+------+------+------+------+------+------+------+------| 64 * |------+------+------+------+------+------+------+------+------+------+------+------|
65 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | 65 * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
66 * `-----------------------------------------------------------------------------------' 66 * `-----------------------------------------------------------------------------------'
67 */ 67 */
68[_COLEMAK] = { 68[_COLEMAK] = {
69 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, 69 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
70 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, 70 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
71 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, 71 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
72 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} 72 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
73}, 73},
74 74
75/* Dvorak 75/* Dvorak
@@ -86,8 +86,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
86[_DVORAK] = { 86[_DVORAK] = {
87 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, 87 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
88 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, 88 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
89 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, 89 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT},
90 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } 90 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
91}, 91},
92 92
93/* Lower 93/* Lower
@@ -128,9 +128,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
128 128
129/* Adjust (Lower + Raise) 129/* Adjust (Lower + Raise)
130 * ,-----------------------------------------------------------------------------------. 130 * ,-----------------------------------------------------------------------------------.
131 * | | Reset| | | | | | | | | | Del | 131 * | F11 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F12 |
132 * |------+------+------+------+------+-------------+------+------+------+------+------| 132 * |------+------+------+------+------+-------------+------+------+------+------+------|
133 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | 133 * | | Reset| |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
134 * |------+------+------+------+------+------|------+------+------+------+------+------| 134 * |------+------+------+------+------+------|------+------+------+------+------+------|
135 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | 135 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
136 * |------+------+------+------+------+------+------+------+------+------+------+------| 136 * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -138,8 +138,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
138 * `-----------------------------------------------------------------------------------' 138 * `-----------------------------------------------------------------------------------'
139 */ 139 */
140[_ADJUST] = { 140[_ADJUST] = {
141 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, 141 {KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 },
142 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, 142 {_______, RESET, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______},
143 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, 143 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
144 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} 144 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
145} 145}
diff --git a/keyboards/planck/keymaps/xyverz/makefile.mk b/keyboards/preonic/keymaps/xyverz/Makefile
index 93a89bb4a..ea5f6c164 100644
--- a/keyboards/planck/keymaps/xyverz/makefile.mk
+++ b/keyboards/preonic/keymaps/xyverz/Makefile
@@ -1,25 +1,23 @@
1
2
3# Build Options 1# Build Options
4# 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
5# the appropriate keymap folder that will get included automatically 3# the appropriate keymap folder that will get included automatically
6# 4#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 6MOUSEKEY_ENABLE = no # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400) 8CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration 9COMMAND_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 10NKRO_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 11BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls 12MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = yes # Audio output on port C6 13AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode 14UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 15BLUETOOTH_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. 16RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19 17
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 18# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 19SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22 20
23ifndef QUANTUM_DIR 21ifndef QUANTUM_DIR
24 include ../../../../Makefile 22 include ../../../../Makefile
25endif 23endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/xyverz/config.h b/keyboards/preonic/keymaps/xyverz/config.h
new file mode 100644
index 000000000..4e12921fe
--- /dev/null
+++ b/keyboards/preonic/keymaps/xyverz/config.h
@@ -0,0 +1,21 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6// Number of backlight levels
7#undef BACKLIGHT_LEVELS
8#define BACKLIGHT_LEVELS 3
9
10/* ws2812 RGB LED */
11#undef RGB_DI_PIN
12#define RGB_DI_PIN B3
13#undef RGBLED_NUM
14#define RGBLIGHT_ANIMATIONS
15#define RGBLED_NUM 11 // Number of LEDs
16#define RGBLIGHT_HUE_STEP 10
17#define RGBLIGHT_SAT_STEP 17
18#define RGBLIGHT_VAL_STEP 17
19
20
21#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/xyverz/keymap.c b/keyboards/preonic/keymaps/xyverz/keymap.c
index adc7392e5..c8457cda1 100644
--- a/keyboards/preonic/keymaps/xyverz/keymap.c
+++ b/keyboards/preonic/keymaps/xyverz/keymap.c
@@ -14,22 +14,16 @@
14#define _DVORAK 2 14#define _DVORAK 2
15#define _LOWER 3 15#define _LOWER 3
16#define _RAISE 4 16#define _RAISE 4
17#define _MUSIC 5
18#define _ADJUST 16 17#define _ADJUST 16
19 18
20// Macro name shortcuts 19enum preonic_keycodes {
21#define QWERTY M(_QWERTY) 20 QWERTY = SAFE_RANGE,
22#define COLEMAK M(_COLEMAK) 21 COLEMAK,
23#define DVORAK M(_DVORAK) 22 DVORAK,
24#define LOWER M(_LOWER) 23 LOWER,
25#define RAISE M(_RAISE) 24 RAISE,
26#define M_BL 5 25 BACKLIT
27#define AUD_OFF M(6) 26};
28#define AUD_ON M(7)
29#define MUS_OFF M(8)
30#define MUS_ON M(9)
31#define VC_IN M(10)
32#define VC_DE M(11)
33 27
34// Fillers to make layering more clear 28// Fillers to make layering more clear
35#define _______ KC_TRNS 29#define _______ KC_TRNS
@@ -47,41 +41,41 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
47 * |------+------+------+------+------+------|------+------+------+------+------+------| 41 * |------+------+------+------+------+------|------+------+------+------+------+------|
48 * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| 42 * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift|
49 * |------+------+------+------+------+------+------+------+------+------+------+------| 43 * |------+------+------+------+------+------+------+------+------+------+------+------|
50 * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | 44 * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
51 * `-----------------------------------------------------------------------------------' 45 * `-----------------------------------------------------------------------------------'
52 */ 46 */
53[_QWERTY] = { 47[_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_BSPC}, 48 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
55 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, 49 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL },
56 {KC_MINS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, 50 {KC_MINS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
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}, 51 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
58 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } 52 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
59}, 53},
60 54
61/* Colemak 55/* Colemak
62 * ,-----------------------------------------------------------------------------------. 56 * ,-----------------------------------------------------------------------------------.
63 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | 57 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
64 * |------+------+------+------+------+------+------+------+------+------+------+------| 58 * |------+------+------+------+------+------+------+------+------+------+------+------|
65 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | 59 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
66 * |------+------+------+------+------+-------------+------+------+------+------+------| 60 * |------+------+------+------+------+-------------+------+------+------+------+------|
67 * | Esc | A | R | S | T | D | H | N | E | I | O | " | 61 * | Bksp | A | R | S | T | D | H | N | E | I | O | " |
68 * |------+------+------+------+------+------|------+------+------+------+------+------| 62 * |------+------+------+------+------+------|------+------+------+------+------+------|
69 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | 63 * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift|
70 * |------+------+------+------+------+------+------+------+------+------+------+------| 64 * |------+------+------+------+------+------+------+------+------+------+------+------|
71 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | 65 * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
72 * `-----------------------------------------------------------------------------------' 66 * `-----------------------------------------------------------------------------------'
73 */ 67 */
74[_COLEMAK] = { 68[_COLEMAK] = {
75 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 69 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
76 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL}, 70 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL },
77 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, 71 {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
78 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, 72 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
79 {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} 73 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
80}, 74},
81 75
82/* Dvorak 76/* Dvorak
83 * ,-----------------------------------------------------------------------------------. 77 * ,-----------------------------------------------------------------------------------.
84 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | 78 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ |
85 * |------+------+------+------+------+------+------+------+------+------+------+------| 79 * |------+------+------+------+------+------+------+------+------+------+------+------|
86 * | Tab | " | , | . | P | Y | F | G | C | R | L | / | 80 * | Tab | " | , | . | P | Y | F | G | C | R | L | / |
87 * |------+------+------+------+------+-------------+------+------+------+------+------| 81 * |------+------+------+------+------+-------------+------+------+------+------+------|
@@ -89,112 +83,98 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
89 * |------+------+------+------+------+------|------+------+------+------+------+------| 83 * |------+------+------+------+------+------|------+------+------+------+------+------|
90 * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| 84 * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift|
91 * |------+------+------+------+------+------+------+------+------+------+------+------| 85 * |------+------+------+------+------+------+------+------+------+------+------+------|
92 * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | 86 * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
93 * `-----------------------------------------------------------------------------------' 87 * `-----------------------------------------------------------------------------------'
94 */ 88 */
95[_DVORAK] = { 89[_DVORAK] = {
96 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 90 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS},
97 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, 91 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
98 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, 92 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
99 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, 93 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT},
100 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } 94 {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, GUI_T(KC_BSPC), KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
101}, 95},
102 96
103/* Lower 97/* Lower
104 * ,-----------------------------------------------------------------------------------. 98 * ,-----------------------------------------------------------------------------------.
105 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | 99 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
106 * |------+------+------+------+------+-------------+------+------+------+------+------| 100 * |------+------+------+------+------+-------------+------+------+------+------+------|
107 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | 101 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
108 * |------+------+------+------+------+-------------+------+------+------+------+------| 102 * |------+------+------+------+------+-------------+------+------+------+------+------|
109 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | 103 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | |
110 * |------+------+------+------+------+------|------+------+------+------+------+------| 104 * |------+------+------+------+------+------|------+------+------+------+------+------|
111 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | 105 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | |
112 * |------+------+------+------+------+------+------+------+------+------+------+------| 106 * |------+------+------+------+------+------+------+------+------+------+------+------|
113 * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | 107 * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter |
114 * `-----------------------------------------------------------------------------------' 108 * `-----------------------------------------------------------------------------------'
115 */ 109 */
116[_LOWER] = { 110[_LOWER] = {
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}, 111 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
118 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, 112 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE},
119 {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, 113 {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______},
120 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, 114 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______},
121 {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} 115 {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______}
122}, 116},
123 117
124/* Raise 118/* Raise
125 * ,-----------------------------------------------------------------------------------. 119 * ,-----------------------------------------------------------------------------------.
126 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | 120 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
127 * |------+------+------+------+------+------+------+------+------+------+------+------| 121 * |------+------+------+------+------+------+------+------+------+------+------+------|
128 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | 122 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | \ |
129 * |------+------+------+------+------+-------------+------+------+------+------+------| 123 * |------+------+------+------+------+-------------+------+------+------+------+------|
130 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | 124 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | |
131 * |------+------+------+------+------+------|------+------+------+------+------+------| 125 * |------+------+------+------+------+------|------+------+------+------+------+------|
132 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | 126 * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | |
133 * |------+------+------+------+------+------+------+------+------+------+------+------| 127 * |------+------+------+------+------+------+------+------+------+------+------+------|
134 * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | 128 * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter |
135 * `-----------------------------------------------------------------------------------' 129 * `-----------------------------------------------------------------------------------'
136 */ 130 */
137[_RAISE] = { 131[_RAISE] = {
138 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 132 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
139 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, 133 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSLS},
140 {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, 134 {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______},
141 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, 135 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______},
142 {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} 136 {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______}
143},
144
145/* Music (reserved for process_action_user)
146 *
147 */
148[_MUSIC] = {
149 {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
150 {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
151 {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
152 {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
153 {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}
154}, 137},
155 138
156/* Adjust (Lower + Raise) 139/* Adjust (Lower + Raise)
157 * ,-----------------------------------------------------------------------------------. 140 * ,-----------------------------------------------------------------------------------.
158 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | 141 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
159 * |------+------+------+------+------+------+------+------+------+------+------+------| 142 * |------+------+------+------+------+------+------+------+------+------+------+------|
160 * | | Reset| | | | | | | | | | Del | 143 * | | Reset| | | | | | | | | | |
161 * |------+------+------+------+------+-------------+------+------+------+------+------| 144 * |------+------+------+------+------+-------------+------+------+------+------+------|
162 * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | 145 * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
163 * |------+------+------+------+------+------|------+------+------+------+------+------| 146 * |------+------+------+------+------+------|------+------+------+------+------+------|
164 * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | 147 * | |RGB ON| MODE | HUE+ | HUE- | SAT+ | SAT- | VAL+ | VAL- | | | |
165 * |------+------+------+------+------+------+------+------+------+------+------+------| 148 * |------+------+------+------+------+------+------+------+------+------+------+------|
166 * | | | | | | | | | | | | 149 * | | | | | | | | | | | |
167 * `-----------------------------------------------------------------------------------' 150 * `-----------------------------------------------------------------------------------'
168 */ 151 */
169[_ADJUST] = { 152[_ADJUST] = {
170 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, 153 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 },
171 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, 154 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
172 {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, 155 {_______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______},
173 {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, 156 {_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______},
174 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} 157 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
175} 158}
176 159
177 160
178}; 161};
179 162
180const uint16_t PROGMEM fn_actions[] = {
181
182};
183
184#ifdef AUDIO_ENABLE 163#ifdef AUDIO_ENABLE
185float start_up[][2] = { 164float tone_startup[][2] = {
186 {440.0*pow(2.0,(14)/12.0), 20}, 165 {NOTE_B5, 20},
187 {440.0*pow(2.0,(26)/12.0), 8}, 166 {NOTE_B6, 8},
188 {440.0*pow(2.0,(18)/12.0), 20}, 167 {NOTE_DS6, 20},
189 {440.0*pow(2.0,(26)/12.0), 8} 168 {NOTE_B6, 8}
190}; 169};
191 170
192float tone_qwerty[][2] = SONG(QWERTY_SOUND); 171float tone_qwerty[][2] = SONG(QWERTY_SOUND);
193float tone_dvorak[][2] = SONG(DVORAK_SOUND); 172float tone_dvorak[][2] = SONG(DVORAK_SOUND);
194float tone_colemak[][2] = SONG(COLEMAK_SOUND); 173float tone_colemak[][2] = SONG(COLEMAK_SOUND);
195 174
196float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); 175float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
197float goodbye[][2] = SONG(GOODBYE_SOUND); 176
177float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
198#endif 178#endif
199 179
200void persistant_default_layer_set(uint16_t default_layer) { 180void persistant_default_layer_set(uint16_t default_layer) {
@@ -202,34 +182,36 @@ void persistant_default_layer_set(uint16_t default_layer) {
202 default_layer_set(default_layer); 182 default_layer_set(default_layer);
203} 183}
204 184
205const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 185bool process_record_user(uint16_t keycode, keyrecord_t *record) {
206{ 186 switch (keycode) {
207 switch(id) { 187 case QWERTY:
208 case _QWERTY:
209 if (record->event.pressed) { 188 if (record->event.pressed) {
210 #ifdef AUDIO_ENABLE 189 #ifdef AUDIO_ENABLE
211 PLAY_NOTE_ARRAY(tone_qwerty, false, 0); 190 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
212 #endif 191 #endif
213 persistant_default_layer_set(1UL<<_QWERTY); 192 persistant_default_layer_set(1UL<<_QWERTY);
214 } 193 }
194 return false;
215 break; 195 break;
216 case _COLEMAK: 196 case COLEMAK:
217 if (record->event.pressed) { 197 if (record->event.pressed) {
218 #ifdef AUDIO_ENABLE 198 #ifdef AUDIO_ENABLE
219 PLAY_NOTE_ARRAY(tone_colemak, false, 0); 199 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
220 #endif 200 #endif
221 persistant_default_layer_set(1UL<<_COLEMAK); 201 persistant_default_layer_set(1UL<<_COLEMAK);
222 } 202 }
203 return false;
223 break; 204 break;
224 case _DVORAK: 205 case DVORAK:
225 if (record->event.pressed) { 206 if (record->event.pressed) {
226 #ifdef AUDIO_ENABLE 207 #ifdef AUDIO_ENABLE
227 PLAY_NOTE_ARRAY(tone_dvorak, false, 0); 208 PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
228 #endif 209 #endif
229 persistant_default_layer_set(1UL<<_DVORAK); 210 persistant_default_layer_set(1UL<<_DVORAK);
230 } 211 }
212 return false;
231 break; 213 break;
232 case _LOWER: 214 case LOWER:
233 if (record->event.pressed) { 215 if (record->event.pressed) {
234 layer_on(_LOWER); 216 layer_on(_LOWER);
235 update_tri_layer(_LOWER, _RAISE, _ADJUST); 217 update_tri_layer(_LOWER, _RAISE, _ADJUST);
@@ -237,8 +219,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
237 layer_off(_LOWER); 219 layer_off(_LOWER);
238 update_tri_layer(_LOWER, _RAISE, _ADJUST); 220 update_tri_layer(_LOWER, _RAISE, _ADJUST);
239 } 221 }
222 return false;
240 break; 223 break;
241 case _RAISE: 224 case RAISE:
242 if (record->event.pressed) { 225 if (record->event.pressed) {
243 layer_on(_RAISE); 226 layer_on(_RAISE);
244 update_tri_layer(_LOWER, _RAISE, _ADJUST); 227 update_tri_layer(_LOWER, _RAISE, _ADJUST);
@@ -246,8 +229,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
246 layer_off(_RAISE); 229 layer_off(_RAISE);
247 update_tri_layer(_LOWER, _RAISE, _ADJUST); 230 update_tri_layer(_LOWER, _RAISE, _ADJUST);
248 } 231 }
232 return false;
249 break; 233 break;
250 case M_BL: 234 case BACKLIT:
251 if (record->event.pressed) { 235 if (record->event.pressed) {
252 register_code(KC_RSFT); 236 register_code(KC_RSFT);
253 #ifdef BACKLIGHT_ENABLE 237 #ifdef BACKLIGHT_ENABLE
@@ -256,87 +240,41 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
256 } else { 240 } else {
257 unregister_code(KC_RSFT); 241 unregister_code(KC_RSFT);
258 } 242 }
259 break; 243 return false;
260 case 6: 244 break;
261 if (record->event.pressed) {
262 #ifdef AUDIO_ENABLE
263 audio_off();
264 #endif
265 }
266 break;
267 case 7:
268 if (record->event.pressed) {
269 #ifdef AUDIO_ENABLE
270 audio_on();
271 PLAY_NOTE_ARRAY(start_up, false, 0);
272 #endif
273 }
274 break;
275 case 8:
276 if (record->event.pressed) {
277 #ifdef AUDIO_ENABLE
278 layer_off(_MUSIC);
279 stop_all_notes();
280 #endif
281 }
282 break;
283 case 9:
284 if (record->event.pressed) {
285 #ifdef AUDIO_ENABLE
286 PLAY_NOTE_ARRAY(music_scale, false, 0);
287 layer_on(_MUSIC);
288 #endif
289 }
290 break;
291 case 10:
292 if (record->event.pressed) {
293 #ifdef AUDIO_ENABLE
294 voice_iterate();
295 PLAY_NOTE_ARRAY(music_scale, false, 0);
296 #endif
297 }
298 break;
299 case 11:
300 if (record->event.pressed) {
301 #ifdef AUDIO_ENABLE
302 voice_deiterate();
303 PLAY_NOTE_ARRAY(music_scale, false, 0);
304 #endif
305 }
306 break;
307 } 245 }
308 return MACRO_NONE; 246 return true;
309}; 247};
310 248
311
312void matrix_init_user(void) { 249void matrix_init_user(void) {
313 #ifdef AUDIO_ENABLE 250 #ifdef AUDIO_ENABLE
314 _delay_ms(20); // gets rid of tick 251 startup_user();
315 PLAY_NOTE_ARRAY(start_up, false, 0); 252 #endif
316 #endif
317} 253}
318 254
319#ifdef AUDIO_ENABLE 255#ifdef AUDIO_ENABLE
320 256
321uint8_t starting_note = 0x0C; 257void startup_user()
322int offset = 7; 258{
323 259 _delay_ms(20); // gets rid of tick
324void process_action_user(keyrecord_t *record) { 260 PLAY_NOTE_ARRAY(tone_startup, false, 0);
261}
325 262
326 if (IS_LAYER_ON(_MUSIC)) { 263void shutdown_user()
327 if (record->event.pressed) { 264{
328 play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); 265 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
329 } else { 266 _delay_ms(150);
330 stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); 267 stop_all_notes();
331 } 268}
332 }
333 269
270void music_on_user(void)
271{
272 music_scale_user();
334} 273}
335 274
336void play_goodbye_tone() 275void music_scale_user(void)
337{ 276{
338 PLAY_NOTE_ARRAY(goodbye, false, 0); 277 PLAY_NOTE_ARRAY(music_scale, false, 0);
339 _delay_ms(150);
340} 278}
341 279
342#endif \ No newline at end of file 280#endif
diff --git a/keyboards/preonic/keymaps/xyverz/makefile.mk b/keyboards/preonic/keymaps/xyverz/makefile.mk
deleted file mode 100644
index 628167ff6..000000000
--- a/keyboards/preonic/keymaps/xyverz/makefile.mk
+++ /dev/null
@@ -1 +0,0 @@
1AUDIO_ENABLE = yes \ No newline at end of file
diff --git a/keyboards/tv44/keymaps/tong92/Makefile b/keyboards/tv44/keymaps/tong92/Makefile
new file mode 100644
index 000000000..e60e3c5c5
--- /dev/null
+++ b/keyboards/tv44/keymaps/tong92/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 = no # Audio control and System control(+450)
8CONSOLE_ENABLE = no # Console for debug(+400)
9COMMAND_ENABLE = no # Commands for debug and configuration
10NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = yes # 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/tv44/keymaps/tong92/config.h b/keyboards/tv44/keymaps/tong92/config.h
new file mode 100644
index 000000000..be959a823
--- /dev/null
+++ b/keyboards/tv44/keymaps/tong92/config.h
@@ -0,0 +1,12 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6// place overrides here
7#ifdef BACKLIGHT_ENABLE
8 #define BACKLIGHT_PIN B2
9 #define BACKLIGHT_LEVELS 7
10#endif
11
12#endif
diff --git a/keyboards/tv44/keymaps/tong92/keymap.c b/keyboards/tv44/keymaps/tong92/keymap.c
new file mode 100644
index 000000000..4a16b3554
--- /dev/null
+++ b/keyboards/tv44/keymaps/tong92/keymap.c
@@ -0,0 +1,138 @@
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//Author: tong92 <tong92power@gmail.com>
4
5#include "tv44.h"
6#include "action_layer.h"
7#include "eeconfig.h"
8#ifdef BACKLIGHT_ENABLE
9 #include "backlight.h"
10#endif
11
12// Fillers to make layering more clear
13#define _______ KC_TRNS
14#define LOWER F(1)
15#define RAISE F(2)
16#define FTN MO(4)
17#define MOUSE M(10)
18#define GO_DEFT M(99)
19#define XXXXXXX KC_NO
20
21const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22
23/* Qwerty
24 * ,--------------------------------------------------------------------------.
25 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
26 * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
27 * | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter|
28 * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
29 * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift|
30 * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
31 * | Ftn1 | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt |
32 * `--------------------------------------------------------------------------'
33 */
34[0] = {
35{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
36{KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT},
37{KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT },
38{FTN ,KC_LGUI,KC_LALT,LOWER,XXXXXXX,XXXXXXX,XXXXXXX,RAISE,KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT}
39},
40/* LOWER
41 * ,--------------------------------------------------------------------------.
42 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
43 * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
44 * | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | \ |
45 * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
46 * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo|
47 * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
48 * | | | | | | END | LEFT| Down|RIGHT|
49 * `--------------------------------------------------------------------------'
50 */
51[1] = {
52{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
53{_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS },
54{_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN },
55{XXXXXXX,_______,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_END, KC_LEFT,KC_DOWN,KC_RIGHT}
56},
57/* RAISE
58 * ,--------------------------------------------------------------------------.
59 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
60 * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
61 * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | |
62 * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
63 * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo|
64 * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
65 * | | | | | | END | LEFT| Down|RIGHT|
66 * `--------------------------------------------------------------------------'
67 */
68[2] ={
69{KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______ },
70{_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE },
71{_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN },
72{XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______,KC_END, KC_LEFT,KC_DOWN,KC_RIGHT}
73},
74/* FTN
75 * ,--------------------------------------------------------------------------.
76 * | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET |
77 * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
78 * | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | |
79 * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
80 * | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl|
81 * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
82 * | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED |
83 * `--------------------------------------------------------------------------'
84 */
85[4] = {
86{KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX ,S(KC_CAPS) ,XXXXXXX,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_DELT},
87{_______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT) ,XXXXXXX ,LALT(KC_CAPS),KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX},
88{_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX ,LCTL(KC_CAPS),KC_SLCK,KC_HOME,XXXXXXX,KC_END,XXXXXXX,KC_RCTL},
89{_______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)),LCTL(LALT(KC_DELT)),XXXXXXX,XXXXXXX,XXXXXXX,LGUI(LCTL(KC_F4)),MOUSE,XXXXXXX,XXXXXXX,M(0)}
90},
91/* MOUSE
92 * ,--------------------------------------------------------------------------.
93 * | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | RESET |
94 * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
95 * | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | |
96 * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
97 * | | | | | | | |M_AC0|M_AC1|M_AC2| | |
98 * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
99 * | | | | GO_DEFAULT | GO_DEFAULT | | | | |
100 * `--------------------------------------------------------------------------'
101 */
102[10] ={
103{XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,RESET},
104{XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX},
105{XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,XXXXXXX},
106{XXXXXXX,XXXXXXX,XXXXXXX,GO_DEFT,XXXXXXX,XXXXXXX,XXXXXXX,GO_DEFT,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX}
107}
108};
109
110const uint16_t PROGMEM fn_actions[] = {
111 [1] = ACTION_LAYER_TAP_KEY(1, KC_SPC),
112 [2] = ACTION_LAYER_TAP_KEY(2, KC_SPC)
113};
114
115const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
116{
117 switch(id) {
118 case 0:
119 if (record->event.pressed) {
120 #ifdef BACKLIGHT_ENABLE
121 backlight_step();
122 #endif
123 }
124 break;
125 case 10:
126 if (record->event.pressed) {
127 layer_on(10);
128 }
129 break;
130 case 99:
131 if (record->event.pressed) {
132 layer_off(10);
133 layer_off(4);
134 }
135 break;
136 }
137 return MACRO_NONE;
138}; \ No newline at end of file
diff --git a/keyboards/tv44/keymaps/tong92/readme.md b/keyboards/tv44/keymaps/tong92/readme.md
new file mode 100644
index 000000000..820857256
--- /dev/null
+++ b/keyboards/tv44/keymaps/tong92/readme.md
@@ -0,0 +1,52 @@
1# The tong92's keymap for tv44
2
3- Arrow Layout (45key)
4- my keymap for Window User
5- Mouse Layer : space -> Default Layer
6
7## Qwerty
8 ,--------------------------------------------------------------------------.
9 | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
10 |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
11 | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter|
12 |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
13 | Shift | Z | X | C | V | B | N | M | , | . | / |Shift|
14 |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
15 | Ftn1 | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt |
16 `--------------------------------------------------------------------------'
17
18
19## RAISE
20 ,--------------------------------------------------------------------------.
21 | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
22 |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
23 | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | |
24 |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
25 | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo|
26 |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
27 | | | | | | END | LEFT| Down|RIGHT|
28 `--------------------------------------------------------------------------'
29
30
31## FTN
32 ,--------------------------------------------------------------------------.
33 | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET |
34 |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
35 | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | |
36 |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
37 | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl|
38 |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
39 | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED |
40 `--------------------------------------------------------------------------'
41
42
43## MOUSE
44 ,--------------------------------------------------------------------------.
45 | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | RESET |
46 |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
47 | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | |
48 |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
49 | | | | | | | |M_AC0|M_AC1|M_AC2| | |
50 |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
51 | | | | GO_DEFAULT | GO_DEFAULT | | | | |
52 `--------------------------------------------------------------------------'
diff --git a/keyboards/tv44/keymaps/xyverz/keymap.c b/keyboards/tv44/keymaps/xyverz/keymap.c
index 8cbcf8d35..00347b019 100644
--- a/keyboards/tv44/keymaps/xyverz/keymap.c
+++ b/keyboards/tv44/keymaps/xyverz/keymap.c
@@ -22,38 +22,38 @@ extern keymap_config_t keymap_config;
22 22
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24 [_DV] = { /* 0: Dvorak */ 24 [_DV] = { /* 0: Dvorak */
25 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC }, 25 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH },
26 {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT }, 26 {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, LT(_L2, KC_MINS)},
27 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT }, 27 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT },
28 {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } 28 {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_BSLS, KC_EQL, XXXXXXX, KC_ENT }
29 }, 29 },
30 30
31 [_QW] = { /* 1: Qwerty */ 31 [_QW] = { /* 1: Qwerty */
32 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, 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_BSPC },
33 {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, 33 {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_L2, KC_QUOT)},
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 }, 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 },
35 {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } 35 {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, KC_ENT }
36 }, 36 },
37 37
38 [_CM] = { /* 2: Colemak */ 38 [_CM] = { /* 2: Colemak */
39 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, 39 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC },
40 {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, 40 {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, LT(_L2, KC_QUOT)},
41 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, 41 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
42 {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } 42 {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, KC_ENT }
43 }, 43 },
44 44
45 [_L1] = {/* 1: FN 1 */ 45 [_L1] = {/* 1: FN 1 */
46 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, 46 {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL },
47 {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, 47 {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ },
48 {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, 48 {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT },
49 {KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, _______, _______ } 49 {KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_EQL, _______, _______ }
50 }, 50 },
51 51
52 [_L2] = { /* 2: FN 2 */ 52 [_L2] = { /* 2: FN 2 */
53 {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ESC }, 53 {KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC },
54 {_______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_VOLU, KC_ENT }, 54 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_HOME, KC_PGUP, KC_VOLU, _______ },
55 {_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, 55 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_END, KC_PGDN, KC_VOLD, _______ },
56 {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ } 56 {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PLUS, _______, _______ }
57 } 57 }
58 58
59}; 59};
diff --git a/keyboards/xd60/keymaps/default/keymap.c b/keyboards/xd60/keymaps/default/keymap.c
index 11be9afca..784088d53 100644
--- a/keyboards/xd60/keymaps/default/keymap.c
+++ b/keyboards/xd60/keymaps/default/keymap.c
@@ -5,8 +5,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
5 5
6 // 0: Base Layer 6 // 0: Base Layer
7 KEYMAP( 7 KEYMAP(
8 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, \ 8 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV, \
9 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 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, \
10 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 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, \
11 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_RSFT, KC_UP, KC_DEL, \ 11 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_RSFT, KC_UP, KC_DEL, \
12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), 12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),
diff --git a/quantum/led_tables.c b/quantum/led_tables.c
new file mode 100644
index 000000000..b99f26209
--- /dev/null
+++ b/quantum/led_tables.c
@@ -0,0 +1,71 @@
1/*
2Copyright 2017 Fred Sundvik
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.
8This program is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12You should have received a copy of the GNU General Public License
13along with this program. If not, see <http://www.gnu.org/licenses/>.
14*/
15
16#include "led_tables.h"
17
18
19#ifdef USE_CIE1931_CURVE
20// Lightness curve using the CIE 1931 lightness formula
21//Generated by the python script provided in http://jared.geek.nz/2013/feb/linear-led-pwm
22const uint8_t CIE1931_CURVE[] PROGMEM = {
23 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
24 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
25 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
26 3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
27 5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
28 7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
29 10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
30 13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
31 17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
32 22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
33 28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
34 34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
35 41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
36 49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
37 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
38 68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
39 80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
40 92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
41 106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
42 121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
43 138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
44 155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
45 175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
46 196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
47 218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
48 242, 245, 247, 250, 252, 255,
49 };
50#endif
51
52#ifdef USE_LED_BREATHING_TABLE
53const uint8_t LED_BREATHING_TABLE[] PROGMEM = {
54 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9,
55 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35,
56 37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76,
57 79, 82, 85, 88, 90, 93, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124,
58 127, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 162, 165, 167, 170, 173,
59 176, 179, 182, 185, 188, 190, 193, 196, 198, 201, 203, 206, 208, 211, 213, 215,
60 218, 220, 222, 224, 226, 228, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244,
61 245, 246, 248, 249, 250, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
62 255, 255, 255, 255, 254, 254, 254, 253, 253, 252, 251, 250, 250, 249, 248, 246,
63 245, 244, 243, 241, 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, 222, 220,
64 218, 215, 213, 211, 208, 206, 203, 201, 198, 196, 193, 190, 188, 185, 182, 179,
65 176, 173, 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, 140, 137, 134, 131,
66 128, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, 93, 90, 88, 85, 82,
67 79, 76, 73, 70, 67, 65, 62, 59, 57, 54, 52, 49, 47, 44, 42, 40,
68 37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, 12, 11,
69 10, 9, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0
70};
71#endif
diff --git a/quantum/led_tables.h b/quantum/led_tables.h
new file mode 100644
index 000000000..af49bf332
--- /dev/null
+++ b/quantum/led_tables.h
@@ -0,0 +1,30 @@
1/*
2Copyright 2017 Fred Sundvik
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.
8This program is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12You should have received a copy of the GNU General Public License
13along with this program. If not, see <http://www.gnu.org/licenses/>.
14*/
15
16#ifndef LED_TABLES_H
17#define LED_TABLES_H
18
19#include "progmem.h"
20#include <stdint.h>
21
22#ifdef USE_CIE1931_CURVE
23extern const uint8_t CIE1931_CURVE[] PROGMEM;
24#endif
25
26#ifdef USE_LED_BREATHING_TABLE
27extern const uint8_t LED_BREATHING_TABLE[] PROGMEM;
28#endif
29
30#endif
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 62d9ef923..4f4cee4e9 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -135,7 +135,7 @@ void reset_keyboard(void) {
135#endif 135#endif
136 136
137static bool shift_interrupted[2] = {0, 0}; 137static bool shift_interrupted[2] = {0, 0};
138static uint16_t scs_timer = 0; 138static uint16_t scs_timer[2] = {0, 0};
139 139
140bool process_record_quantum(keyrecord_t *record) { 140bool process_record_quantum(keyrecord_t *record) {
141 141
@@ -395,7 +395,7 @@ bool process_record_quantum(keyrecord_t *record) {
395 case KC_LSPO: { 395 case KC_LSPO: {
396 if (record->event.pressed) { 396 if (record->event.pressed) {
397 shift_interrupted[0] = false; 397 shift_interrupted[0] = false;
398 scs_timer = timer_read (); 398 scs_timer[0] = timer_read ();
399 register_mods(MOD_BIT(KC_LSFT)); 399 register_mods(MOD_BIT(KC_LSFT));
400 } 400 }
401 else { 401 else {
@@ -405,7 +405,7 @@ bool process_record_quantum(keyrecord_t *record) {
405 shift_interrupted[1] = true; 405 shift_interrupted[1] = true;
406 } 406 }
407 #endif 407 #endif
408 if (!shift_interrupted[0] && timer_elapsed(scs_timer) < TAPPING_TERM) { 408 if (!shift_interrupted[0] && timer_elapsed(scs_timer[0]) < TAPPING_TERM) {
409 register_code(LSPO_KEY); 409 register_code(LSPO_KEY);
410 unregister_code(LSPO_KEY); 410 unregister_code(LSPO_KEY);
411 } 411 }
@@ -418,7 +418,7 @@ bool process_record_quantum(keyrecord_t *record) {
418 case KC_RSPC: { 418 case KC_RSPC: {
419 if (record->event.pressed) { 419 if (record->event.pressed) {
420 shift_interrupted[1] = false; 420 shift_interrupted[1] = false;
421 scs_timer = timer_read (); 421 scs_timer[1] = timer_read ();
422 register_mods(MOD_BIT(KC_RSFT)); 422 register_mods(MOD_BIT(KC_RSFT));
423 } 423 }
424 else { 424 else {
@@ -428,7 +428,7 @@ bool process_record_quantum(keyrecord_t *record) {
428 shift_interrupted[1] = true; 428 shift_interrupted[1] = true;
429 } 429 }
430 #endif 430 #endif
431 if (!shift_interrupted[1] && timer_elapsed(scs_timer) < TAPPING_TERM) { 431 if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) {
432 register_code(RSPC_KEY); 432 register_code(RSPC_KEY);
433 unregister_code(RSPC_KEY); 433 unregister_code(RSPC_KEY);
434 } 434 }
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index eff70aae1..4eec2a776 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -20,56 +20,8 @@
20#include "timer.h" 20#include "timer.h"
21#include "rgblight.h" 21#include "rgblight.h"
22#include "debug.h" 22#include "debug.h"
23#include "led_tables.h"
23 24
24// Lightness curve using the CIE 1931 lightness formula
25//Generated by the python script provided in http://jared.geek.nz/2013/feb/linear-led-pwm
26const uint8_t DIM_CURVE[] PROGMEM = {
27 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
28 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
29 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
30 3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
31 5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
32 7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
33 10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
34 13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
35 17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
36 22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
37 28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
38 34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
39 41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
40 49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
41 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
42 68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
43 80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
44 92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
45 106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
46 121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
47 138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
48 155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
49 175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
50 196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
51 218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
52 242, 245, 247, 250, 252, 255,
53 };
54
55const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = {
56 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9,
57 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35,
58 37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76,
59 79, 82, 85, 88, 90, 93, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124,
60 127, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 162, 165, 167, 170, 173,
61 176, 179, 182, 185, 188, 190, 193, 196, 198, 201, 203, 206, 208, 211, 213, 215,
62 218, 220, 222, 224, 226, 228, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244,
63 245, 246, 248, 249, 250, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
64 255, 255, 255, 255, 254, 254, 254, 253, 253, 252, 251, 250, 250, 249, 248, 246,
65 245, 244, 243, 241, 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, 222, 220,
66 218, 215, 213, 211, 208, 206, 203, 201, 198, 196, 193, 190, 188, 185, 182, 179,
67 176, 173, 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, 140, 137, 134, 131,
68 128, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, 93, 90, 88, 85, 82,
69 79, 76, 73, 70, 67, 65, 62, 59, 57, 54, 52, 49, 47, 44, 42, 40,
70 37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, 12, 11,
71 10, 9, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0
72};
73 25
74__attribute__ ((weak)) 26__attribute__ ((weak))
75const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; 27const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
@@ -135,9 +87,9 @@ void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
135 break; 87 break;
136 } 88 }
137 } 89 }
138 r = pgm_read_byte(&DIM_CURVE[r]); 90 r = pgm_read_byte(&CIE1931_CURVE[r]);
139 g = pgm_read_byte(&DIM_CURVE[g]); 91 g = pgm_read_byte(&CIE1931_CURVE[g]);
140 b = pgm_read_byte(&DIM_CURVE[b]); 92 b = pgm_read_byte(&CIE1931_CURVE[b]);
141 93
142 setrgb(r, g, b, led1); 94 setrgb(r, g, b, led1);
143} 95}
@@ -509,7 +461,7 @@ void rgblight_effect_breathing(uint8_t interval) {
509 } 461 }
510 last_timer = timer_read(); 462 last_timer = timer_read();
511 463
512 rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, pgm_read_byte(&RGBLED_BREATHING_TABLE[pos])); 464 rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, pgm_read_byte(&LED_BREATHING_TABLE[pos]));
513 pos = (pos + 1) % 256; 465 pos = (pos + 1) % 256;
514} 466}
515void rgblight_effect_rainbow_mood(uint8_t interval) { 467void rgblight_effect_rainbow_mood(uint8_t interval) {
diff --git a/quantum/serial_link/system/serial_link.c b/quantum/serial_link/system/serial_link.c
index 75c7e77a7..b3bee62a1 100644
--- a/quantum/serial_link/system/serial_link.c
+++ b/quantum/serial_link/system/serial_link.c
@@ -212,7 +212,7 @@ void serial_link_update(void) {
212 212
213 systime_t current_time = chVTGetSystemTimeX(); 213 systime_t current_time = chVTGetSystemTimeX();
214 systime_t delta = current_time - last_update; 214 systime_t delta = current_time - last_update;
215 if (changed || delta > US2ST(1000)) { 215 if (changed || delta > US2ST(5000)) {
216 last_update = current_time; 216 last_update = current_time;
217 last_matrix = matrix; 217 last_matrix = matrix;
218 matrix_object_t* m = begin_write_keyboard_matrix(); 218 matrix_object_t* m = begin_write_keyboard_matrix();
diff --git a/quantum/visualizer/example_integration/callbacks.c b/quantum/visualizer/example_integration/callbacks.c
deleted file mode 100644
index 2539615d6..000000000
--- a/quantum/visualizer/example_integration/callbacks.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2The MIT License (MIT)
3
4Copyright (c) 2016 Fred Sundvik
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25#include "keyboard.h"
26#include "action_layer.h"
27#include "visualizer.h"
28#include "host.h"
29
30void post_keyboard_init(void) {
31 visualizer_init();
32}
33
34void post_keyboard_task() {
35 visualizer_set_state(default_layer_state, layer_state, host_keyboard_leds());
36}
diff --git a/quantum/visualizer/example_integration/gfxconf.h b/quantum/visualizer/example_integration/gfxconf.h
deleted file mode 100644
index 304c5d187..000000000
--- a/quantum/visualizer/example_integration/gfxconf.h
+++ /dev/null
@@ -1,325 +0,0 @@
1/**
2 * This file has a different license to the rest of the uGFX system.
3 * You can copy, modify and distribute this file as you see fit.
4 * You do not need to publish your source modifications to this file.
5 * The only thing you are not permitted to do is to relicense it
6 * under a different license.
7 */
8
9/**
10 * Copy this file into your project directory and rename it as gfxconf.h
11 * Edit your copy to turn on the uGFX features you want to use.
12 * The values below are the defaults.
13 *
14 * Only remove the comments from lines where you want to change the
15 * default value. This allows definitions to be included from
16 * driver makefiles when required and provides the best future
17 * compatibility for your project.
18 *
19 * Please use spaces instead of tabs in this file.
20 */
21
22#ifndef _GFXCONF_H
23#define _GFXCONF_H
24
25
26///////////////////////////////////////////////////////////////////////////
27// GOS - One of these must be defined, preferably in your Makefile //
28///////////////////////////////////////////////////////////////////////////
29#define GFX_USE_OS_CHIBIOS TRUE
30//#define GFX_USE_OS_FREERTOS FALSE
31// #define GFX_FREERTOS_USE_TRACE FALSE
32//#define GFX_USE_OS_WIN32 FALSE
33//#define GFX_USE_OS_LINUX FALSE
34//#define GFX_USE_OS_OSX FALSE
35//#define GFX_USE_OS_ECOS FALSE
36//#define GFX_USE_OS_RAWRTOS FALSE
37//#define GFX_USE_OS_ARDUINO FALSE
38//#define GFX_USE_OS_KEIL FALSE
39//#define GFX_USE_OS_CMSIS FALSE
40//#define GFX_USE_OS_RAW32 FALSE
41// #define INTERRUPTS_OFF() optional_code
42// #define INTERRUPTS_ON() optional_code
43// These are not defined by default for some reason
44#define GOS_NEED_X_THREADS FALSE
45#define GOS_NEED_X_HEAP FALSE
46
47// Options that (should where relevant) apply to all operating systems
48 #define GFX_NO_INLINE FALSE
49// #define GFX_COMPILER GFX_COMPILER_UNKNOWN
50// #define GFX_CPU GFX_CPU_UNKNOWN
51// #define GFX_OS_HEAP_SIZE 0
52// #define GFX_OS_NO_INIT FALSE
53// #define GFX_OS_INIT_NO_WARNING FALSE
54// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine
55// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
56// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
57
58
59///////////////////////////////////////////////////////////////////////////
60// GDISP //
61///////////////////////////////////////////////////////////////////////////
62#define GFX_USE_GDISP TRUE
63
64//#define GDISP_NEED_AUTOFLUSH FALSE
65//#define GDISP_NEED_TIMERFLUSH FALSE
66//#define GDISP_NEED_VALIDATION TRUE
67//#define GDISP_NEED_CLIP TRUE
68//#define GDISP_NEED_CIRCLE FALSE
69//#define GDISP_NEED_ELLIPSE FALSE
70//#define GDISP_NEED_ARC FALSE
71//#define GDISP_NEED_ARCSECTORS FALSE
72//#define GDISP_NEED_CONVEX_POLYGON FALSE
73//#define GDISP_NEED_SCROLL FALSE
74//#define GDISP_NEED_PIXELREAD FALSE
75//#define GDISP_NEED_CONTROL FALSE
76//#define GDISP_NEED_QUERY FALSE
77//#define GDISP_NEED_MULTITHREAD FALSE
78//#define GDISP_NEED_STREAMING FALSE
79#define GDISP_NEED_TEXT TRUE
80// #define GDISP_NEED_TEXT_WORDWRAP FALSE
81// #define GDISP_NEED_ANTIALIAS FALSE
82// #define GDISP_NEED_UTF8 FALSE
83 #define GDISP_NEED_TEXT_KERNING TRUE
84// #define GDISP_INCLUDE_FONT_UI1 FALSE
85// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font.
86// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE
87// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE
88// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE
89// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE
90// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE
91// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE
92// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE
93 #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE
94// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE
95// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE
96 #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE
97// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE
98// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE
99// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE
100// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE
101// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE
102// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE
103// #define GDISP_INCLUDE_USER_FONTS FALSE
104
105//#define GDISP_NEED_IMAGE FALSE
106// #define GDISP_NEED_IMAGE_NATIVE FALSE
107// #define GDISP_NEED_IMAGE_GIF FALSE
108// #define GDISP_NEED_IMAGE_BMP FALSE
109// #define GDISP_NEED_IMAGE_BMP_1 FALSE
110// #define GDISP_NEED_IMAGE_BMP_4 FALSE
111// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE
112// #define GDISP_NEED_IMAGE_BMP_8 FALSE
113// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE
114// #define GDISP_NEED_IMAGE_BMP_16 FALSE
115// #define GDISP_NEED_IMAGE_BMP_24 FALSE
116// #define GDISP_NEED_IMAGE_BMP_32 FALSE
117// #define GDISP_NEED_IMAGE_JPG FALSE
118// #define GDISP_NEED_IMAGE_PNG FALSE
119// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE
120
121//#define GDISP_NEED_PIXMAP FALSE
122// #define GDISP_NEED_PIXMAP_IMAGE FALSE
123
124//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used.
125//#define GDISP_LINEBUF_SIZE 128
126//#define GDISP_STARTUP_COLOR Black
127#define GDISP_NEED_STARTUP_LOGO FALSE
128
129//#define GDISP_TOTAL_DISPLAYS 1
130
131//#define GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_Win32
132// #ifdef GDISP_DRIVER_LIST
133// // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability
134// #define GDISP_HARDWARE_STREAM_WRITE FALSE
135// #define GDISP_HARDWARE_STREAM_READ FALSE
136// #define GDISP_HARDWARE_STREAM_POS FALSE
137// #define GDISP_HARDWARE_DRAWPIXEL FALSE
138// #define GDISP_HARDWARE_CLEARS FALSE
139// #define GDISP_HARDWARE_FILLS FALSE
140// #define GDISP_HARDWARE_BITFILLS FALSE
141// #define GDISP_HARDWARE_SCROLL FALSE
142// #define GDISP_HARDWARE_PIXELREAD FALSE
143// #define GDISP_HARDWARE_CONTROL FALSE
144// #define GDISP_HARDWARE_QUERY FALSE
145// #define GDISP_HARDWARE_CLIP FALSE
146
147 #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888
148// #endif
149
150// The custom format is not defined for some reason, so define it as error
151// so we don't get compiler warnings
152#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR
153
154#define GDISP_USE_GFXNET FALSE
155// #define GDISP_GFXNET_PORT 13001
156// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE
157// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE
158// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE
159
160
161///////////////////////////////////////////////////////////////////////////
162// GWIN //
163///////////////////////////////////////////////////////////////////////////
164#define GFX_USE_GWIN FALSE
165
166//#define GWIN_NEED_WINDOWMANAGER FALSE
167// #define GWIN_REDRAW_IMMEDIATE FALSE
168// #define GWIN_REDRAW_SINGLEOP FALSE
169// #define GWIN_NEED_FLASHING FALSE
170// #define GWIN_FLASHING_PERIOD 250
171
172//#define GWIN_NEED_CONSOLE FALSE
173// #define GWIN_CONSOLE_USE_HISTORY FALSE
174// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE
175// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE
176// #define GWIN_CONSOLE_ESCSEQ FALSE
177// #define GWIN_CONSOLE_USE_BASESTREAM FALSE
178// #define GWIN_CONSOLE_USE_FLOAT FALSE
179//#define GWIN_NEED_GRAPH FALSE
180//#define GWIN_NEED_GL3D FALSE
181
182//#define GWIN_NEED_WIDGET FALSE
183//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1
184// #define GWIN_NEED_LABEL FALSE
185// #define GWIN_LABEL_ATTRIBUTE FALSE
186// #define GWIN_NEED_BUTTON FALSE
187// #define GWIN_BUTTON_LAZY_RELEASE FALSE
188// #define GWIN_NEED_SLIDER FALSE
189// #define GWIN_SLIDER_NOSNAP FALSE
190// #define GWIN_SLIDER_DEAD_BAND 5
191// #define GWIN_SLIDER_TOGGLE_INC 20
192// #define GWIN_NEED_CHECKBOX FALSE
193// #define GWIN_NEED_IMAGE FALSE
194// #define GWIN_NEED_IMAGE_ANIMATION FALSE
195// #define GWIN_NEED_RADIO FALSE
196// #define GWIN_NEED_LIST FALSE
197// #define GWIN_NEED_LIST_IMAGES FALSE
198// #define GWIN_NEED_PROGRESSBAR FALSE
199// #define GWIN_PROGRESSBAR_AUTO FALSE
200// #define GWIN_NEED_KEYBOARD FALSE
201// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1
202// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE
203// #define GWIN_NEED_TEXTEDIT FALSE
204// #define GWIN_FLAT_STYLING FALSE
205// #define GWIN_WIDGET_TAGS FALSE
206
207//#define GWIN_NEED_CONTAINERS FALSE
208// #define GWIN_NEED_CONTAINER FALSE
209// #define GWIN_NEED_FRAME FALSE
210// #define GWIN_NEED_TABSET FALSE
211// #define GWIN_TABSET_TABHEIGHT 18
212
213
214///////////////////////////////////////////////////////////////////////////
215// GEVENT //
216///////////////////////////////////////////////////////////////////////////
217#define GFX_USE_GEVENT FALSE
218
219//#define GEVENT_ASSERT_NO_RESOURCE FALSE
220//#define GEVENT_MAXIMUM_SIZE 32
221//#define GEVENT_MAX_SOURCE_LISTENERS 32
222
223
224///////////////////////////////////////////////////////////////////////////
225// GTIMER //
226///////////////////////////////////////////////////////////////////////////
227#define GFX_USE_GTIMER FALSE
228
229//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY
230//#define GTIMER_THREAD_WORKAREA_SIZE 2048
231
232
233///////////////////////////////////////////////////////////////////////////
234// GQUEUE //
235///////////////////////////////////////////////////////////////////////////
236#define GFX_USE_GQUEUE FALSE
237
238//#define GQUEUE_NEED_ASYNC FALSE
239//#define GQUEUE_NEED_GSYNC FALSE
240//#define GQUEUE_NEED_FSYNC FALSE
241//#define GQUEUE_NEED_BUFFERS FALSE
242
243///////////////////////////////////////////////////////////////////////////
244// GINPUT //
245///////////////////////////////////////////////////////////////////////////
246#define GFX_USE_GINPUT FALSE
247
248//#define GINPUT_NEED_MOUSE FALSE
249// #define GINPUT_TOUCH_STARTRAW FALSE
250// #define GINPUT_TOUCH_NOTOUCH FALSE
251// #define GINPUT_TOUCH_NOCALIBRATE FALSE
252// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE
253// #define GINPUT_MOUSE_POLL_PERIOD 25
254// #define GINPUT_MOUSE_CLICK_TIME 300
255// #define GINPUT_TOUCH_CXTCLICK_TIME 700
256// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE
257// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE
258// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32
259//#define GINPUT_NEED_KEYBOARD FALSE
260// #define GINPUT_KEYBOARD_POLL_PERIOD 200
261// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32
262// #define GKEYBOARD_LAYOUT_OFF FALSE
263// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE
264//#define GINPUT_NEED_TOGGLE FALSE
265//#define GINPUT_NEED_DIAL FALSE
266
267
268///////////////////////////////////////////////////////////////////////////
269// GFILE //
270///////////////////////////////////////////////////////////////////////////
271#define GFX_USE_GFILE FALSE
272
273//#define GFILE_NEED_PRINTG FALSE
274//#define GFILE_NEED_SCANG FALSE
275//#define GFILE_NEED_STRINGS FALSE
276//#define GFILE_NEED_FILELISTS FALSE
277//#define GFILE_NEED_STDIO FALSE
278//#define GFILE_NEED_NOAUTOMOUNT FALSE
279//#define GFILE_NEED_NOAUTOSYNC FALSE
280
281//#define GFILE_NEED_MEMFS FALSE
282//#define GFILE_NEED_ROMFS FALSE
283//#define GFILE_NEED_RAMFS FALSE
284//#define GFILE_NEED_FATFS FALSE
285//#define GFILE_NEED_NATIVEFS FALSE
286//#define GFILE_NEED_CHBIOSFS FALSE
287
288//#define GFILE_ALLOW_FLOATS FALSE
289//#define GFILE_ALLOW_DEVICESPECIFIC FALSE
290//#define GFILE_MAX_GFILES 3
291
292///////////////////////////////////////////////////////////////////////////
293// GADC //
294///////////////////////////////////////////////////////////////////////////
295#define GFX_USE_GADC FALSE
296
297//#define GADC_MAX_LOWSPEED_DEVICES 4
298
299
300///////////////////////////////////////////////////////////////////////////
301// GAUDIO //
302///////////////////////////////////////////////////////////////////////////
303#define GFX_USE_GAUDIO FALSE
304// There seems to be a bug in the ugfx code, the wrong define is used
305// So define it in order to avoid warnings
306#define GFX_USE_GAUDIN GFX_USE_GAUDIO
307// #define GAUDIO_NEED_PLAY FALSE
308// #define GAUDIO_NEED_RECORD FALSE
309
310
311///////////////////////////////////////////////////////////////////////////
312// GMISC //
313///////////////////////////////////////////////////////////////////////////
314#define GFX_USE_GMISC FALSE
315
316//#define GMISC_NEED_ARRAYOPS FALSE
317//#define GMISC_NEED_FASTTRIG FALSE
318//#define GMISC_NEED_FIXEDTRIG FALSE
319//#define GMISC_NEED_INVSQRT FALSE
320// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
321// #define GMISC_INVSQRT_REAL_SLOW FALSE
322//#define GMISC_NEED_MATRIXFLOAT2D FALSE
323//#define GMISC_NEED_MATRIXFIXED2D FALSE
324
325#endif /* _GFXCONF_H */
diff --git a/quantum/visualizer/example_integration/lcd_backlight_hal.c b/quantum/visualizer/example_integration/lcd_backlight_hal.c
deleted file mode 100644
index 913131b16..000000000
--- a/quantum/visualizer/example_integration/lcd_backlight_hal.c
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2The MIT License (MIT)
3
4Copyright (c) 2016 Fred Sundvik
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25#include "lcd_backlight.h"
26#include "hal.h"
27
28#define RED_PIN 1
29#define GREEN_PIN 2
30#define BLUE_PIN 3
31#define CHANNEL_RED FTM0->CHANNEL[0]
32#define CHANNEL_GREEN FTM0->CHANNEL[1]
33#define CHANNEL_BLUE FTM0->CHANNEL[2]
34
35#define RGB_PORT PORTC
36#define RGB_PORT_GPIO GPIOC
37
38// Base FTM clock selection (72 MHz system clock)
39// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period
40// Higher pre-scalar will use the most power (also look the best)
41// Pre-scalar calculations
42// 0 - 72 MHz -> 549 Hz
43// 1 - 36 MHz -> 275 Hz
44// 2 - 18 MHz -> 137 Hz
45// 3 - 9 MHz -> 69 Hz (Slightly visible flicker)
46// 4 - 4 500 kHz -> 34 Hz (Visible flickering)
47// 5 - 2 250 kHz -> 17 Hz
48// 6 - 1 125 kHz -> 9 Hz
49// 7 - 562 500 Hz -> 4 Hz
50// Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced
51// Which will reduce the brightness range
52#define PRESCALAR_DEFINE 0
53
54void lcd_backlight_hal_init(void) {
55 // Setup Backlight
56 SIM->SCGC6 |= SIM_SCGC6_FTM0;
57 FTM0->CNT = 0; // Reset counter
58
59 // PWM Period
60 // 16-bit maximum
61 FTM0->MOD = 0xFFFF;
62
63 // Set FTM to PWM output - Edge Aligned, Low-true pulses
64#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0)
65 CHANNEL_RED.CnSC = CNSC_MODE;
66 CHANNEL_GREEN.CnSC = CNSC_MODE;
67 CHANNEL_BLUE.CnSC = CNSC_MODE;
68
69 // System clock, /w prescalar setting
70 FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE);
71
72 CHANNEL_RED.CnV = 0;
73 CHANNEL_GREEN.CnV = 0;
74 CHANNEL_BLUE.CnV = 0;
75
76 RGB_PORT_GPIO->PDDR |= (1 << RED_PIN);
77 RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN);
78 RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN);
79
80#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4)
81 RGB_PORT->PCR[RED_PIN] = RGB_MODE;
82 RGB_PORT->PCR[GREEN_PIN] = RGB_MODE;
83 RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
84}
85
86void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
87 CHANNEL_RED.CnV = r;
88 CHANNEL_GREEN.CnV = g;
89 CHANNEL_BLUE.CnV = b;
90}
91
diff --git a/quantum/visualizer/example_integration/visualizer_user.c b/quantum/visualizer/example_integration/visualizer_user.c
deleted file mode 100644
index fc09fe2ea..000000000
--- a/quantum/visualizer/example_integration/visualizer_user.c
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2The MIT License (MIT)
3
4Copyright (c) 2016 Fred Sundvik
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25// Currently we are assuming that both the backlight and LCD are enabled
26// But it's entirely possible to write a custom visualizer that use only
27// one of them
28#ifndef LCD_BACKLIGHT_ENABLE
29#error This visualizer needs that LCD backlight is enabled
30#endif
31
32#ifndef LCD_ENABLE
33#error This visualizer needs that LCD is enabled
34#endif
35
36#include "visualizer.h"
37
38static const char* welcome_text[] = {"TMK", "Infinity Ergodox"};
39
40// Just an example how to write custom keyframe functions, we could have moved
41// all this into the init function
42bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) {
43 (void)animation;
44 // Read the uGFX documentation for information how to use the displays
45 // http://wiki.ugfx.org/index.php/Main_Page
46 gdispClear(White);
47 // You can use static variables for things that can't be found in the animation
48 // or state structs
49 gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black);
50 gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black);
51 // Always remember to flush the display
52 gdispFlush();
53 // you could set the backlight color as well, but we won't do it here, since
54 // it's part of the following animation
55 // lcd_backlight_color(hue, saturation, intensity);
56 // We don't need constant updates, just drawing the screen once is enough
57 return false;
58}
59
60// Feel free to modify the animations below, or even add new ones if needed
61
62// Don't worry, if the startup animation is long, you can use the keyboard like normal
63// during that time
64static keyframe_animation_t startup_animation = {
65 .num_frames = 4,
66 .loop = false,
67 .frame_lengths = {0, MS2ST(1000), MS2ST(5000), 0},
68 .frame_functions = {display_welcome, keyframe_animate_backlight_color, keyframe_no_operation, enable_visualization},
69};
70
71// The color animation animates the LCD color when you change layers
72static keyframe_animation_t color_animation = {
73 .num_frames = 2,
74 .loop = false,
75 // Note that there's a 200 ms no-operation frame,
76 // this prevents the color from changing when activating the layer
77 // momentarily
78 .frame_lengths = {MS2ST(200), MS2ST(500)},
79 .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color},
80};
81
82// The LCD animation alternates between the layer name display and a
83// bitmap that displays all active layers
84static keyframe_animation_t lcd_animation = {
85 .num_frames = 2,
86 .loop = true,
87 .frame_lengths = {MS2ST(2000), MS2ST(2000)},
88 .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap},
89};
90
91void initialize_user_visualizer(visualizer_state_t* state) {
92 // The brightness will be dynamically adjustable in the future
93 // But for now, change it here.
94 lcd_backlight_brightness(0x50);
95 state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF);
96 state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF);
97 start_keyframe_animation(&startup_animation);
98}
99
100void update_user_visualizer_state(visualizer_state_t* state) {
101 // Add more tests, change the colors and layer texts here
102 // Usually you want to check the high bits (higher layers first)
103 // because that's the order layers are processed for keypresses
104 // You can for check for example:
105 // state->status.layer
106 // state->status.default_layer
107 // state->status.leds (see led.h for available statuses)
108 if (state->status.layer & 0x2) {
109 state->target_lcd_color = LCD_COLOR(0xA0, 0xB0, 0xFF);
110 state->layer_text = "Layer 2";
111 }
112 else {
113 state->target_lcd_color = LCD_COLOR(0x50, 0xB0, 0xFF);
114 state->layer_text = "Layer 1";
115 }
116 // You can also stop existing animations, and start your custom ones here
117 // remember that you should normally have only one animation for the LCD
118 // and one for the background. But you can also combine them if you want.
119 start_keyframe_animation(&lcd_animation);
120 start_keyframe_animation(&color_animation);
121}
diff --git a/quantum/visualizer/lcd_backlight.c b/quantum/visualizer/lcd_backlight.c
index 70187d1e0..00de3fab5 100644
--- a/quantum/visualizer/lcd_backlight.c
+++ b/quantum/visualizer/lcd_backlight.c
@@ -25,10 +25,10 @@ SOFTWARE.
25#include "lcd_backlight.h" 25#include "lcd_backlight.h"
26#include <math.h> 26#include <math.h>
27 27
28static uint8_t current_hue = 0x00; 28static uint8_t current_hue = 0;
29static uint8_t current_saturation = 0x00; 29static uint8_t current_saturation = 0;
30static uint8_t current_intensity = 0xFF; 30static uint8_t current_intensity = 0;
31static uint8_t current_brightness = 0x7F; 31static uint8_t current_brightness = 0;
32 32
33void lcd_backlight_init(void) { 33void lcd_backlight_init(void) {
34 lcd_backlight_hal_init(); 34 lcd_backlight_hal_init();
diff --git a/quantum/visualizer/lcd_backlight.h b/quantum/visualizer/lcd_backlight.h
index dd3e37a06..14dde64a1 100644
--- a/quantum/visualizer/lcd_backlight.h
+++ b/quantum/visualizer/lcd_backlight.h
@@ -32,6 +32,10 @@ SOFTWARE.
32#define LCD_SAT(color) ((color >> 8) & 0xFF) 32#define LCD_SAT(color) ((color >> 8) & 0xFF)
33#define LCD_INT(color) (color & 0xFF) 33#define LCD_INT(color) (color & 0xFF)
34 34
35inline uint32_t change_lcd_color_intensity(uint32_t color, uint8_t new_intensity) {
36 return (color & 0xFFFFFF00) | new_intensity;
37}
38
35void lcd_backlight_init(void); 39void lcd_backlight_init(void);
36void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity); 40void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity);
37void lcd_backlight_brightness(uint8_t b); 41void lcd_backlight_brightness(uint8_t b);
diff --git a/quantum/visualizer/lcd_backlight_keyframes.c b/quantum/visualizer/lcd_backlight_keyframes.c
new file mode 100644
index 000000000..8436d4e3d
--- /dev/null
+++ b/quantum/visualizer/lcd_backlight_keyframes.c
@@ -0,0 +1,77 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "lcd_backlight_keyframes.h"
18
19bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state) {
20 int frame_length = animation->frame_lengths[animation->current_frame];
21 int current_pos = frame_length - animation->time_left_in_frame;
22 uint8_t t_h = LCD_HUE(state->target_lcd_color);
23 uint8_t t_s = LCD_SAT(state->target_lcd_color);
24 uint8_t t_i = LCD_INT(state->target_lcd_color);
25 uint8_t p_h = LCD_HUE(state->prev_lcd_color);
26 uint8_t p_s = LCD_SAT(state->prev_lcd_color);
27 uint8_t p_i = LCD_INT(state->prev_lcd_color);
28
29 uint8_t d_h1 = t_h - p_h; //Modulo arithmetic since we want to wrap around
30 int d_h2 = t_h - p_h;
31 // Chose the shortest way around
32 int d_h = abs(d_h2) < d_h1 ? d_h2 : d_h1;
33 int d_s = t_s - p_s;
34 int d_i = t_i - p_i;
35
36 int hue = (d_h * current_pos) / frame_length;
37 int sat = (d_s * current_pos) / frame_length;
38 int intensity = (d_i * current_pos) / frame_length;
39 //dprintf("%X -> %X = %X\n", p_h, t_h, hue);
40 hue += p_h;
41 sat += p_s;
42 intensity += p_i;
43 state->current_lcd_color = LCD_COLOR(hue, sat, intensity);
44 lcd_backlight_color(
45 LCD_HUE(state->current_lcd_color),
46 LCD_SAT(state->current_lcd_color),
47 LCD_INT(state->current_lcd_color));
48
49 return true;
50}
51
52bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state) {
53 (void)animation;
54 state->prev_lcd_color = state->target_lcd_color;
55 state->current_lcd_color = state->target_lcd_color;
56 lcd_backlight_color(
57 LCD_HUE(state->current_lcd_color),
58 LCD_SAT(state->current_lcd_color),
59 LCD_INT(state->current_lcd_color));
60 return false;
61}
62
63bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
64 (void)animation;
65 (void)state;
66 lcd_backlight_hal_color(0, 0, 0);
67 return false;
68}
69
70bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
71 (void)animation;
72 (void)state;
73 lcd_backlight_color(LCD_HUE(state->current_lcd_color),
74 LCD_SAT(state->current_lcd_color),
75 LCD_INT(state->current_lcd_color));
76 return false;
77}
diff --git a/quantum/visualizer/lcd_backlight_keyframes.h b/quantum/visualizer/lcd_backlight_keyframes.h
new file mode 100644
index 000000000..e1c125cf9
--- /dev/null
+++ b/quantum/visualizer/lcd_backlight_keyframes.h
@@ -0,0 +1,30 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
18#define QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
19
20#include "visualizer.h"
21
22// Animates the LCD backlight color between the current color and the target color (of the state)
23bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state);
24// Sets the backlight color to the target color
25bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state);
26
27bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
28bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
29
30#endif /* QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_ */
diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c
new file mode 100644
index 000000000..df11861dd
--- /dev/null
+++ b/quantum/visualizer/lcd_keyframes.c
@@ -0,0 +1,188 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "lcd_keyframes.h"
18#include <string.h>
19#include "action_util.h"
20#include "led.h"
21#include "resources/resources.h"
22
23bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) {
24 (void)animation;
25 gdispClear(White);
26 gdispDrawString(0, 10, state->layer_text, state->font_dejavusansbold12, Black);
27 return false;
28}
29
30static void format_layer_bitmap_string(uint16_t default_layer, uint16_t layer, char* buffer) {
31 for (int i=0; i<16;i++)
32 {
33 uint32_t mask = (1u << i);
34 if (default_layer & mask) {
35 if (layer & mask) {
36 *buffer = 'B';
37 } else {
38 *buffer = 'D';
39 }
40 } else if (layer & mask) {
41 *buffer = '1';
42 } else {
43 *buffer = '0';
44 }
45 ++buffer;
46
47 if (i==3 || i==7 || i==11) {
48 *buffer = ' ';
49 ++buffer;
50 }
51 }
52 *buffer = 0;
53}
54
55bool lcd_keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
56 (void)animation;
57 const char* layer_help = "1=On D=Default B=Both";
58 char layer_buffer[16 + 4]; // 3 spaces and one null terminator
59 gdispClear(White);
60 gdispDrawString(0, 0, layer_help, state->font_fixed5x8, Black);
61 format_layer_bitmap_string(state->status.default_layer, state->status.layer, layer_buffer);
62 gdispDrawString(0, 10, layer_buffer, state->font_fixed5x8, Black);
63 format_layer_bitmap_string(state->status.default_layer >> 16, state->status.layer >> 16, layer_buffer);
64 gdispDrawString(0, 20, layer_buffer, state->font_fixed5x8, Black);
65 return false;
66}
67
68static void format_mods_bitmap_string(uint8_t mods, char* buffer) {
69 *buffer = ' ';
70 ++buffer;
71
72 for (int i = 0; i<8; i++)
73 {
74 uint32_t mask = (1u << i);
75 if (mods & mask) {
76 *buffer = '1';
77 } else {
78 *buffer = '0';
79 }
80 ++buffer;
81
82 if (i==3) {
83 *buffer = ' ';
84 ++buffer;
85 }
86 }
87 *buffer = 0;
88}
89
90bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
91 (void)animation;
92
93 const char* title = "Modifier states";
94 const char* mods_header = " CSAG CSAG ";
95 char status_buffer[12];
96
97 gdispClear(White);
98 gdispDrawString(0, 0, title, state->font_fixed5x8, Black);
99 gdispDrawString(0, 10, mods_header, state->font_fixed5x8, Black);
100 format_mods_bitmap_string(state->status.mods, status_buffer);
101 gdispDrawString(0, 20, status_buffer, state->font_fixed5x8, Black);
102
103 return false;
104}
105
106#define LED_STATE_STRING_SIZE sizeof("NUM CAPS SCRL COMP KANA")
107
108static void get_led_state_string(char* output, visualizer_state_t* state) {
109 uint8_t pos = 0;
110
111 if (state->status.leds & (1u << USB_LED_NUM_LOCK)) {
112 memcpy(output + pos, "NUM ", 4);
113 pos += 4;
114 }
115 if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
116 memcpy(output + pos, "CAPS ", 5);
117 pos += 5;
118 }
119 if (state->status.leds & (1u << USB_LED_SCROLL_LOCK)) {
120 memcpy(output + pos, "SCRL ", 5);
121 pos += 5;
122 }
123 if (state->status.leds & (1u << USB_LED_COMPOSE)) {
124 memcpy(output + pos, "COMP ", 5);
125 pos += 5;
126 }
127 if (state->status.leds & (1u << USB_LED_KANA)) {
128 memcpy(output + pos, "KANA ", 5);
129 pos += 5;
130 }
131 output[pos] = 0;
132}
133
134bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state)
135{
136 (void)animation;
137 char output[LED_STATE_STRING_SIZE];
138 get_led_state_string(output, state);
139 gdispClear(White);
140 gdispDrawString(0, 10, output, state->font_dejavusansbold12, Black);
141 return false;
142}
143
144bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state) {
145 (void)animation;
146 gdispClear(White);
147 uint8_t y = 10;
148 if (state->status.leds) {
149 char output[LED_STATE_STRING_SIZE];
150 get_led_state_string(output, state);
151 gdispDrawString(0, 1, output, state->font_dejavusansbold12, Black);
152 y = 17;
153 }
154 gdispDrawString(0, y, state->layer_text, state->font_dejavusansbold12, Black);
155 return false;
156}
157
158bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
159 (void)state;
160 (void)animation;
161 // Read the uGFX documentation for information how to use the displays
162 // http://wiki.ugfx.org/index.php/Main_Page
163 gdispClear(White);
164
165 // You can use static variables for things that can't be found in the animation
166 // or state structs, here we use the image
167
168 //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
169 // if you have full screen image, then just use 128 and 32 for both source and target dimensions
170 gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
171
172 return false;
173}
174
175
176bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
177 (void)animation;
178 (void)state;
179 gdispSetPowerMode(powerOff);
180 return false;
181}
182
183bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
184 (void)animation;
185 (void)state;
186 gdispSetPowerMode(powerOn);
187 return false;
188}
diff --git a/quantum/visualizer/lcd_keyframes.h b/quantum/visualizer/lcd_keyframes.h
new file mode 100644
index 000000000..2e912b4c7
--- /dev/null
+++ b/quantum/visualizer/lcd_keyframes.h
@@ -0,0 +1,39 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_
18#define QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_
19
20#include "visualizer.h"
21
22// Displays the layer text centered vertically on the screen
23bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
24// Displays a bitmap (0/1) of all the currently active layers
25bool lcd_keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
26// Displays a bitmap (0/1) of all the currently active mods
27bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
28// Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA)
29bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
30// Displays both the layer text and the led states
31bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
32// Displays the QMK logo on the LCD screen
33bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state);
34
35bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
36bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
37
38
39#endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */
diff --git a/quantum/visualizer/led_test.c b/quantum/visualizer/led_keyframes.c
index a9abace8d..2dacd990d 100644
--- a/quantum/visualizer/led_test.c
+++ b/quantum/visualizer/led_keyframes.c
@@ -21,50 +21,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE. 22SOFTWARE.
23*/ 23*/
24#include "led_test.h"
25#include "gfx.h" 24#include "gfx.h"
26#include "math.h" 25#include "math.h"
27 26#include "led_keyframes.h"
28#define CROSSFADE_TIME 1000
29#define GRADIENT_TIME 3000
30
31keyframe_animation_t led_test_animation = {
32 .num_frames = 14,
33 .loop = true,
34 .frame_lengths = {
35 gfxMillisecondsToTicks(1000), // fade in
36 gfxMillisecondsToTicks(1000), // no op (leds on)
37 gfxMillisecondsToTicks(1000), // fade out
38 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
39 gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
40 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
41 gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
42 0, // mirror leds
43 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
44 gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
45 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
46 gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
47 0, // normal leds
48 gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
49
50 },
51 .frame_functions = {
52 keyframe_fade_in_all_leds,
53 keyframe_no_operation,
54 keyframe_fade_out_all_leds,
55 keyframe_led_crossfade,
56 keyframe_led_left_to_right_gradient,
57 keyframe_led_crossfade,
58 keyframe_led_top_to_bottom_gradient,
59 keyframe_mirror_led_orientation,
60 keyframe_led_crossfade,
61 keyframe_led_left_to_right_gradient,
62 keyframe_led_crossfade,
63 keyframe_led_top_to_bottom_gradient,
64 keyframe_normal_led_orientation,
65 keyframe_led_crossfade,
66 },
67};
68 27
69static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) { 28static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) {
70 int frame_length = animation->frame_lengths[animation->current_frame]; 29 int frame_length = animation->frame_lengths[animation->current_frame];
@@ -96,19 +55,19 @@ static uint8_t compute_gradient_color(float t, float index, float num) {
96 return (uint8_t)(255.0f * v); 55 return (uint8_t)(255.0f * v);
97} 56}
98 57
99bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { 58bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state) {
100 (void)state; 59 (void)state;
101 keyframe_fade_all_leds_from_to(animation, 0, 255); 60 keyframe_fade_all_leds_from_to(animation, 0, 255);
102 return true; 61 return true;
103} 62}
104 63
105bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { 64bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state) {
106 (void)state; 65 (void)state;
107 keyframe_fade_all_leds_from_to(animation, 255, 0); 66 keyframe_fade_all_leds_from_to(animation, 255, 0);
108 return true; 67 return true;
109} 68}
110 69
111bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { 70bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
112 (void)state; 71 (void)state;
113 float frame_length = animation->frame_lengths[animation->current_frame]; 72 float frame_length = animation->frame_lengths[animation->current_frame];
114 float current_pos = frame_length - animation->time_left_in_frame; 73 float current_pos = frame_length - animation->time_left_in_frame;
@@ -120,7 +79,7 @@ bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visual
120 return true; 79 return true;
121} 80}
122 81
123bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { 82bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
124 (void)state; 83 (void)state;
125 float frame_length = animation->frame_lengths[animation->current_frame]; 84 float frame_length = animation->frame_lengths[animation->current_frame];
126 float current_pos = frame_length - animation->time_left_in_frame; 85 float current_pos = frame_length - animation->time_left_in_frame;
@@ -139,7 +98,7 @@ static void copy_current_led_state(uint8_t* dest) {
139 } 98 }
140 } 99 }
141} 100}
142bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) { 101bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) {
143 (void)state; 102 (void)state;
144 if (animation->first_update_of_frame) { 103 if (animation->first_update_of_frame) {
145 copy_current_led_state(&crossfade_start_frame[0][0]); 104 copy_current_led_state(&crossfade_start_frame[0][0]);
@@ -155,14 +114,14 @@ bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t*
155 return true; 114 return true;
156} 115}
157 116
158bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { 117bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
159 (void)state; 118 (void)state;
160 (void)animation; 119 (void)animation;
161 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); 120 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180);
162 return false; 121 return false;
163} 122}
164 123
165bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { 124bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
166 (void)state; 125 (void)state;
167 (void)animation; 126 (void)animation;
168 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); 127 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0);
diff --git a/quantum/visualizer/led_test.h b/quantum/visualizer/led_keyframes.h
index 5e2325753..a68943041 100644
--- a/quantum/visualizer/led_test.h
+++ b/quantum/visualizer/led_keyframes.h
@@ -22,20 +22,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE. 22SOFTWARE.
23*/ 23*/
24 24
25#ifndef TMK_VISUALIZER_LED_TEST_H_ 25#ifndef LED_KEYFRAMES_H
26#define TMK_VISUALIZER_LED_TEST_H_ 26#define LED_KEYFRAMES_H
27 27
28#include "visualizer.h" 28#include "visualizer.h"
29 29
30bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); 30bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state);
31bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); 31bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state);
32bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); 32bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
33bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state); 33bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
34bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state); 34bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state);
35bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); 35bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
36bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); 36bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
37 37
38extern keyframe_animation_t led_test_animation; 38extern keyframe_animation_t led_test_animation;
39 39
40 40
41#endif /* TMK_VISUALIZER_LED_TEST_H_ */ 41#endif /* LED_KEYFRAMES_H */
diff --git a/quantum/visualizer/resources/lcd_logo.c b/quantum/visualizer/resources/lcd_logo.c
new file mode 100644
index 000000000..d1a0ffa7f
--- /dev/null
+++ b/quantum/visualizer/resources/lcd_logo.c
@@ -0,0 +1,61 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "resources.h"
18
19
20// To generate an image array like this
21// Ensure the image is 128 x 32 or smaller
22// Convert the bitmap to a C array using a program like http://www.riuson.com/lcd-image-converter/
23// Ensure the the conversion process produces a monochrome format array - 1 bit/pixel, left to right, top to bottom
24// Update array in the source code with the C array produced by the conversion program
25
26// The image below is generated from lcd_logo.png
27const uint8_t resource_lcd_logo[512] = {
28 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
32 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
34 0x00, 0xf8, 0xfe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x38, 0x38, 0x38, 0x06, 0x29, 0x41, 0x24, 0x52, 0x24, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00,
37 0x00, 0x38, 0x38, 0x38, 0x09, 0x55, 0x42, 0xaa, 0xaa, 0xaa, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00,
38 0x00, 0x38, 0x38, 0x38, 0x09, 0x55, 0x82, 0x28, 0xaa, 0xae, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00,
39 0x00, 0x38, 0x38, 0x38, 0x09, 0x55, 0x43, 0x28, 0xaa, 0xaa, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
40 0x00, 0x38, 0x38, 0x38, 0x0a, 0x55, 0x42, 0x28, 0xaa, 0xaa, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
41 0x00, 0x38, 0x38, 0x38, 0x05, 0x45, 0x42, 0x28, 0x89, 0x4a, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00,
42 0x00, 0x18, 0x38, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
43 0x00, 0x1c, 0x38, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
44 0x00, 0x0e, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
45 0x00, 0x03, 0xff, 0x80, 0x04, 0x45, 0x14, 0xa4, 0x92, 0x83, 0x52, 0x22, 0x22, 0x36, 0x00, 0x00,
46 0x00, 0x00, 0x38, 0x00, 0x0a, 0xaa, 0xaa, 0xaa, 0xba, 0x84, 0x55, 0x55, 0x57, 0x45, 0x00, 0x00,
47 0x00, 0x00, 0x38, 0x00, 0x08, 0xaa, 0xaa, 0xaa, 0x92, 0xb2, 0x55, 0x55, 0x42, 0x65, 0x00, 0x00,
48 0x00, 0x00, 0x38, 0x00, 0x08, 0xaa, 0xaa, 0xaa, 0x92, 0x81, 0x56, 0x65, 0x42, 0x45, 0x00, 0x00,
49 0x00, 0x00, 0x38, 0x00, 0x0a, 0xaa, 0xaa, 0xaa, 0x92, 0x81, 0x54, 0x45, 0x42, 0x45, 0x00, 0x00,
50 0x00, 0x00, 0x38, 0x00, 0x04, 0x48, 0xa2, 0x4a, 0x89, 0x06, 0x24, 0x42, 0x41, 0x36, 0x00, 0x00,
51 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
54 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
60};
61
diff --git a/quantum/visualizer/resources/lcd_logo.png b/quantum/visualizer/resources/lcd_logo.png
new file mode 100644
index 000000000..6cf26fc67
--- /dev/null
+++ b/quantum/visualizer/resources/lcd_logo.png
Binary files differ
diff --git a/quantum/visualizer/resources/resources.h b/quantum/visualizer/resources/resources.h
new file mode 100644
index 000000000..1ea27a536
--- /dev/null
+++ b/quantum/visualizer/resources/resources.h
@@ -0,0 +1,27 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef QUANTUM_VISUALIZER_RESOURCES_RESOURCES_H_
18#define QUANTUM_VISUALIZER_RESOURCES_RESOURCES_H_
19
20#include <stdint.h>
21
22#ifdef LCD_ENABLE
23extern const uint8_t resource_lcd_logo[];
24#endif
25
26
27#endif /* QUANTUM_VISUALIZER_RESOURCES_RESOURCES_H_ */
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
index 5826d909e..6f134097f 100644
--- a/quantum/visualizer/visualizer.c
+++ b/quantum/visualizer/visualizer.c
@@ -48,20 +48,22 @@ SOFTWARE.
48#include "serial_link/system/serial_link.h" 48#include "serial_link/system/serial_link.h"
49#endif 49#endif
50 50
51#include "action_util.h"
52
51// Define this in config.h 53// Define this in config.h
52#ifndef VISUALIZER_THREAD_PRIORITY 54#ifndef VISUALIZER_THREAD_PRIORITY
53#define "Visualizer thread priority not defined" 55#define "Visualizer thread priority not defined"
54#endif 56#endif
55 57
56// mods status
57#include "action_util.h"
58
59static visualizer_keyboard_status_t current_status = { 58static visualizer_keyboard_status_t current_status = {
60 .layer = 0xFFFFFFFF, 59 .layer = 0xFFFFFFFF,
61 .default_layer = 0xFFFFFFFF, 60 .default_layer = 0xFFFFFFFF,
62 .mods = 0xFF, 61 .mods = 0xFF,
63 .leds = 0xFFFFFFFF, 62 .leds = 0xFFFFFFFF,
64 .suspended = false, 63 .suspended = false,
64#ifdef VISUALIZER_USER_DATA_SIZE
65 .user_data = {0}
66#endif
65}; 67};
66 68
67static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) { 69static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) {
@@ -69,11 +71,19 @@ static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboa
69 status1->default_layer == status2->default_layer && 71 status1->default_layer == status2->default_layer &&
70 status1->mods == status2->mods && 72 status1->mods == status2->mods &&
71 status1->leds == status2->leds && 73 status1->leds == status2->leds &&
72 status1->suspended == status2->suspended; 74 status1->suspended == status2->suspended
75#ifdef VISUALIZER_USER_DATA_SIZE
76 && memcmp(status1->user_data, status2->user_data, VISUALIZER_USER_DATA_SIZE) == 0
77#endif
78 ;
73} 79}
74 80
75static bool visualizer_enabled = false; 81static bool visualizer_enabled = false;
76 82
83#ifdef VISUALIZER_USER_DATA_SIZE
84static uint8_t user_data[VISUALIZER_USER_DATA_SIZE];
85#endif
86
77#define MAX_SIMULTANEOUS_ANIMATIONS 4 87#define MAX_SIMULTANEOUS_ANIMATIONS 4
78static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; 88static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {};
79 89
@@ -144,6 +154,14 @@ void stop_all_keyframe_animations(void) {
144 } 154 }
145} 155}
146 156
157static uint8_t get_num_running_animations(void) {
158 uint8_t count = 0;
159 for (int i=0;i<MAX_SIMULTANEOUS_ANIMATIONS;i++) {
160 count += animations[i] ? 1 : 0;
161 }
162 return count;
163}
164
147static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systemticks_t delta, systemticks_t* sleep_time) { 165static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systemticks_t delta, systemticks_t* sleep_time) {
148 // TODO: Clean up this messy code 166 // TODO: Clean up this messy code
149 dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame, 167 dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame,
@@ -212,175 +230,6 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat
212 (*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state); 230 (*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state);
213} 231}
214 232
215bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) {
216 (void)animation;
217 (void)state;
218 return false;
219}
220
221#ifdef LCD_BACKLIGHT_ENABLE
222bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) {
223 int frame_length = animation->frame_lengths[animation->current_frame];
224 int current_pos = frame_length - animation->time_left_in_frame;
225 uint8_t t_h = LCD_HUE(state->target_lcd_color);
226 uint8_t t_s = LCD_SAT(state->target_lcd_color);
227 uint8_t t_i = LCD_INT(state->target_lcd_color);
228 uint8_t p_h = LCD_HUE(state->prev_lcd_color);
229 uint8_t p_s = LCD_SAT(state->prev_lcd_color);
230 uint8_t p_i = LCD_INT(state->prev_lcd_color);
231
232 uint8_t d_h1 = t_h - p_h; //Modulo arithmetic since we want to wrap around
233 int d_h2 = t_h - p_h;
234 // Chose the shortest way around
235 int d_h = abs(d_h2) < d_h1 ? d_h2 : d_h1;
236 int d_s = t_s - p_s;
237 int d_i = t_i - p_i;
238
239 int hue = (d_h * current_pos) / frame_length;
240 int sat = (d_s * current_pos) / frame_length;
241 int intensity = (d_i * current_pos) / frame_length;
242 //dprintf("%X -> %X = %X\n", p_h, t_h, hue);
243 hue += p_h;
244 sat += p_s;
245 intensity += p_i;
246 state->current_lcd_color = LCD_COLOR(hue, sat, intensity);
247 lcd_backlight_color(
248 LCD_HUE(state->current_lcd_color),
249 LCD_SAT(state->current_lcd_color),
250 LCD_INT(state->current_lcd_color));
251
252 return true;
253}
254
255bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) {
256 (void)animation;
257 state->prev_lcd_color = state->target_lcd_color;
258 state->current_lcd_color = state->target_lcd_color;
259 lcd_backlight_color(
260 LCD_HUE(state->current_lcd_color),
261 LCD_SAT(state->current_lcd_color),
262 LCD_INT(state->current_lcd_color));
263 return false;
264}
265#endif // LCD_BACKLIGHT_ENABLE
266
267#ifdef LCD_ENABLE
268bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) {
269 (void)animation;
270 gdispClear(White);
271 gdispDrawString(0, 10, state->layer_text, state->font_dejavusansbold12, Black);
272 gdispFlush();
273 return false;
274}
275
276static void format_layer_bitmap_string(uint16_t default_layer, uint16_t layer, char* buffer) {
277 for (int i=0; i<16;i++)
278 {
279 uint32_t mask = (1u << i);
280 if (default_layer & mask) {
281 if (layer & mask) {
282 *buffer = 'B';
283 } else {
284 *buffer = 'D';
285 }
286 } else if (layer & mask) {
287 *buffer = '1';
288 } else {
289 *buffer = '0';
290 }
291 ++buffer;
292
293 if (i==3 || i==7 || i==11) {
294 *buffer = ' ';
295 ++buffer;
296 }
297 }
298 *buffer = 0;
299}
300
301bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
302 (void)animation;
303 const char* layer_help = "1=On D=Default B=Both";
304 char layer_buffer[16 + 4]; // 3 spaces and one null terminator
305 gdispClear(White);
306 gdispDrawString(0, 0, layer_help, state->font_fixed5x8, Black);
307 format_layer_bitmap_string(state->status.default_layer, state->status.layer, layer_buffer);
308 gdispDrawString(0, 10, layer_buffer, state->font_fixed5x8, Black);
309 format_layer_bitmap_string(state->status.default_layer >> 16, state->status.layer >> 16, layer_buffer);
310 gdispDrawString(0, 20, layer_buffer, state->font_fixed5x8, Black);
311 gdispFlush();
312 return false;
313}
314
315static void format_mods_bitmap_string(uint8_t mods, char* buffer) {
316 *buffer = ' ';
317 ++buffer;
318
319 for (int i = 0; i<8; i++)
320 {
321 uint32_t mask = (1u << i);
322 if (mods & mask) {
323 *buffer = '1';
324 } else {
325 *buffer = '0';
326 }
327 ++buffer;
328
329 if (i==3) {
330 *buffer = ' ';
331 ++buffer;
332 }
333 }
334 *buffer = 0;
335}
336
337bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
338 (void)animation;
339
340 const char* title = "Modifier states";
341 const char* mods_header = " CSAG CSAG ";
342 char status_buffer[12];
343
344 gdispClear(White);
345 gdispDrawString(0, 0, title, state->font_fixed5x8, Black);
346 gdispDrawString(0, 10, mods_header, state->font_fixed5x8, Black);
347 format_mods_bitmap_string(state->status.mods, status_buffer);
348 gdispDrawString(0, 20, status_buffer, state->font_fixed5x8, Black);
349
350 gdispFlush();
351 return false;
352}
353#endif // LCD_ENABLE
354
355bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
356 (void)animation;
357 (void)state;
358#ifdef LCD_ENABLE
359 gdispSetPowerMode(powerOff);
360#endif
361#ifdef LCD_BACKLIGHT_ENABLE
362 lcd_backlight_hal_color(0, 0, 0);
363#endif
364 return false;
365}
366
367bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
368 (void)animation;
369 (void)state;
370#ifdef LCD_ENABLE
371 gdispSetPowerMode(powerOn);
372#endif
373 return false;
374}
375
376bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state) {
377 (void)animation;
378 (void)state;
379 dprint("User visualizer inited\n");
380 visualizer_enabled = true;
381 return false;
382}
383
384// TODO: Optimize the stack size, this is probably way too big 233// TODO: Optimize the stack size, this is probably way too big
385static DECLARE_THREAD_STACK(visualizerThreadStack, 1024); 234static DECLARE_THREAD_STACK(visualizerThreadStack, 1024);
386static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { 235static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
@@ -396,6 +245,9 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
396 .mods = 0xFF, 245 .mods = 0xFF,
397 .leds = 0xFFFFFFFF, 246 .leds = 0xFFFFFFFF,
398 .suspended = false, 247 .suspended = false,
248#ifdef VISUALIZER_USER_DATA_SIZE
249 .user_data = {0},
250#endif
399 }; 251 };
400 252
401 visualizer_state_t state = { 253 visualizer_state_t state = {
@@ -418,13 +270,15 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
418 270
419 systemticks_t sleep_time = TIME_INFINITE; 271 systemticks_t sleep_time = TIME_INFINITE;
420 systemticks_t current_time = gfxSystemTicks(); 272 systemticks_t current_time = gfxSystemTicks();
273 bool force_update = true;
421 274
422 while(true) { 275 while(true) {
423 systemticks_t new_time = gfxSystemTicks(); 276 systemticks_t new_time = gfxSystemTicks();
424 systemticks_t delta = new_time - current_time; 277 systemticks_t delta = new_time - current_time;
425 current_time = new_time; 278 current_time = new_time;
426 bool enabled = visualizer_enabled; 279 bool enabled = visualizer_enabled;
427 if (!same_status(&state.status, &current_status)) { 280 if (force_update || !same_status(&state.status, &current_status)) {
281 force_update = false;
428 if (visualizer_enabled) { 282 if (visualizer_enabled) {
429 if (current_status.suspended) { 283 if (current_status.suspended) {
430 stop_all_keyframe_animations(); 284 stop_all_keyframe_animations();
@@ -433,8 +287,9 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
433 user_visualizer_suspend(&state); 287 user_visualizer_suspend(&state);
434 } 288 }
435 else { 289 else {
290 visualizer_keyboard_status_t prev_status = state.status;
436 state.status = current_status; 291 state.status = current_status;
437 update_user_visualizer_state(&state); 292 update_user_visualizer_state(&state, &prev_status);
438 } 293 }
439 state.prev_lcd_color = state.current_lcd_color; 294 state.prev_lcd_color = state.current_lcd_color;
440 } 295 }
@@ -458,13 +313,17 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
458 gdispGFlush(LED_DISPLAY); 313 gdispGFlush(LED_DISPLAY);
459#endif 314#endif
460 315
316#ifdef LCD_ENABLE
317 gdispGFlush(LCD_DISPLAY);
318#endif
319
461#ifdef EMULATOR 320#ifdef EMULATOR
462 draw_emulator(); 321 draw_emulator();
463#endif 322#endif
464 // The animation can enable the visualizer 323 // Enable the visualizer when the startup or the suspend animation has finished
465 // And we might need to update the state when that happens 324 if (!visualizer_enabled && state.status.suspended == false && get_num_running_animations() == 0) {
466 // so don't sleep 325 visualizer_enabled = true;
467 if (enabled != visualizer_enabled) { 326 force_update = true;
468 sleep_time = 0; 327 sleep_time = 0;
469 } 328 }
470 329
@@ -554,6 +413,12 @@ uint8_t visualizer_get_mods() {
554 return mods; 413 return mods;
555} 414}
556 415
416#ifdef VISUALIZER_USER_DATA_SIZE
417void visualizer_set_user_data(void* u) {
418 memcpy(user_data, u, VISUALIZER_USER_DATA_SIZE);
419}
420#endif
421
557void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds) { 422void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds) {
558 // Note that there's a small race condition here, the thread could read 423 // Note that there's a small race condition here, the thread could read
559 // a state where one of these are set but not the other. But this should 424 // a state where one of these are set but not the other. But this should
@@ -582,6 +447,9 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uin
582 .leds = leds, 447 .leds = leds,
583 .suspended = current_status.suspended, 448 .suspended = current_status.suspended,
584 }; 449 };
450#ifdef VISUALIZER_USER_DATA_SIZE
451 memcpy(new_status.user_data, user_data, VISUALIZER_USER_DATA_SIZE);
452#endif
585 if (!same_status(&current_status, &new_status)) { 453 if (!same_status(&current_status, &new_status)) {
586 changed = true; 454 changed = true;
587 current_status = new_status; 455 current_status = new_status;
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h
index 315af5022..d6f279e10 100644
--- a/quantum/visualizer/visualizer.h
+++ b/quantum/visualizer/visualizer.h
@@ -34,7 +34,7 @@ SOFTWARE.
34#include "lcd_backlight.h" 34#include "lcd_backlight.h"
35#endif 35#endif
36 36
37// use this function to merget both real_mods and oneshot_mods in a uint16_t 37// use this function to merge both real_mods and oneshot_mods in a uint16_t
38uint8_t visualizer_get_mods(void); 38uint8_t visualizer_get_mods(void);
39 39
40// This need to be called once at the start 40// This need to be called once at the start
@@ -68,6 +68,9 @@ typedef struct {
68 uint8_t mods; 68 uint8_t mods;
69 uint32_t leds; // See led.h for available statuses 69 uint32_t leds; // See led.h for available statuses
70 bool suspended; 70 bool suspended;
71#ifdef VISUALIZER_USER_DATA_SIZE
72 uint8_t user_data[VISUALIZER_USER_DATA_SIZE];
73#endif
71} visualizer_keyboard_status_t; 74} visualizer_keyboard_status_t;
72 75
73// The state struct is used by the various keyframe functions 76// The state struct is used by the various keyframe functions
@@ -123,32 +126,22 @@ void stop_keyframe_animation(keyframe_animation_t* animation);
123// Useful for crossfades for example 126// Useful for crossfades for example
124void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); 127void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state);
125 128
126// Some predefined keyframe functions that can be used by the user code 129// The master can set userdata which will be transferred to the slave
127// Does nothing, useful for adding delays 130#ifdef VISUALIZER_USER_DATA_SIZE
128bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); 131void visualizer_set_user_data(void* user_data);
129// Animates the LCD backlight color between the current color and the target color (of the state) 132#endif
130bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state);
131// Sets the backlight color to the target color
132bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state);
133// Displays the layer text centered vertically on the screen
134bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
135// Displays a bitmap (0/1) of all the currently active layers
136bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
137// Displays a bitmap (0/1) of all the currently active mods
138bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
139
140bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);
141bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);
142
143// Call this once, when the initial animation has finished, alternatively you can call it
144// directly from the initalize_user_visualizer function (the animation can be null)
145bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state);
146 133
147// These functions have to be implemented by the user 134// These functions have to be implemented by the user
148void initialize_user_visualizer(visualizer_state_t* state); 135// Called regularly each time the state has changed (but not every scan loop)
149void update_user_visualizer_state(visualizer_state_t* state); 136void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status);
137// Called when the computer goes to suspend, will also stop calling update_user_visualizer_state
150void user_visualizer_suspend(visualizer_state_t* state); 138void user_visualizer_suspend(visualizer_state_t* state);
139// You have to start at least one animation as a response to the following two functions
140// When the animation has finished the visualizer will resume normal operation and start calling the
141// update_user_visualizer_state again
142// Called when the keyboard boots up
143void initialize_user_visualizer(visualizer_state_t* state);
144// Called when the computer resumes from a suspend
151void user_visualizer_resume(visualizer_state_t* state); 145void user_visualizer_resume(visualizer_state_t* state);
152 146
153
154#endif /* VISUALIZER_H */ 147#endif /* VISUALIZER_H */
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk
index 2f4a41d66..5f710124b 100644
--- a/quantum/visualizer/visualizer.mk
+++ b/quantum/visualizer/visualizer.mk
@@ -20,7 +20,8 @@
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE. 21# SOFTWARE.
22 22
23SRC += $(VISUALIZER_DIR)/visualizer.c 23SRC += $(VISUALIZER_DIR)/visualizer.c \
24 $(VISUALIZER_DIR)/visualizer_keyframes.c
24EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) 25EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR)
25GFXLIB = $(LIB_PATH)/ugfx 26GFXLIB = $(LIB_PATH)/ugfx
26VPATH += $(VISUALIZER_PATH) 27VPATH += $(VISUALIZER_PATH)
@@ -32,25 +33,33 @@ OPT_DEFS += -DLCD_ENABLE
32ULIBS += -lm 33ULIBS += -lm
33endif 34endif
34 35
35ifdef LCD_BACKLIGHT_ENABLE 36ifeq ($(strip $(LCD_ENABLE)), yes)
36SRC += $(VISUALIZER_DIR)/lcd_backlight.c 37SRC += $(VISUALIZER_DIR)/lcd_backlight.c
38SRC += $(VISUALIZER_DIR)/lcd_keyframes.c
39SRC += $(VISUALIZER_DIR)/lcd_backlight_keyframes.c
40# Note, that the linker will strip out any resources that are not actually in use
41SRC += $(VISUALIZER_DIR)/resources/lcd_logo.c
37OPT_DEFS += -DLCD_BACKLIGHT_ENABLE 42OPT_DEFS += -DLCD_BACKLIGHT_ENABLE
38endif 43endif
39 44
40ifdef LED_ENABLE 45ifeq ($(strip $(LED_ENABLE)), yes)
41SRC += $(VISUALIZER_DIR)/led_test.c 46SRC += $(VISUALIZER_DIR)/led_keyframes.c
42OPT_DEFS += -DLED_ENABLE 47OPT_DEFS += -DLED_ENABLE
43endif 48endif
44 49
45include $(GFXLIB)/gfx.mk 50include $(GFXLIB)/gfx.mk
46SRC += $(patsubst $(TOP_DIR)/%,%,$(GFXSRC)) 51GFXSRC := $(patsubst $(TOP_DIR)/%,%,$(GFXSRC))
47OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) 52GFXDEFS := $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS)))
48 53
49ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","") 54ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","")
50 SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c 55 SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c
51else 56else
52 ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","") 57 ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","")
58 ifeq ("$(wildcard $(SUBPROJECT_PATH)/visualizer.c)","")
53$(error "$(KEYMAP_PATH)/visualizer.c" does not exist) 59$(error "$(KEYMAP_PATH)/visualizer.c" does not exist)
60 else
61 SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/visualizer.c
62 endif
54 else 63 else
55 SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c 64 SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c
56 endif 65 endif
diff --git a/quantum/visualizer/visualizer_keyframes.c b/quantum/visualizer/visualizer_keyframes.c
new file mode 100644
index 000000000..8f6a7e15a
--- /dev/null
+++ b/quantum/visualizer/visualizer_keyframes.c
@@ -0,0 +1,23 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "visualizer_keyframes.h"
18
19bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) {
20 (void)animation;
21 (void)state;
22 return false;
23}
diff --git a/quantum/visualizer/visualizer_keyframes.h b/quantum/visualizer/visualizer_keyframes.h
new file mode 100644
index 000000000..9ef7653c5
--- /dev/null
+++ b/quantum/visualizer/visualizer_keyframes.h
@@ -0,0 +1,26 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
18#define QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
19
20#include "visualizer.h"
21
22// Some predefined keyframe functions that can be used by the user code
23// Does nothing, useful for adding delays
24bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state);
25
26#endif /* QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ */
diff --git a/readme.md b/readme.md
index b2dfc5f75..f7bf14b6a 100644
--- a/readme.md
+++ b/readme.md
@@ -32,7 +32,7 @@ The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/j
32This is not a tiny project. While this is the main readme, there are many other files you might want to consult. Here are some points of interest: 32This is not a tiny project. While this is the main readme, there are many other files you might want to consult. Here are some points of interest:
33 33
34* [**The Wiki**](https://github.com/qmk/qmk_firmware/wiki) - the entirety of the readme has been moved here 34* [**The Wiki**](https://github.com/qmk/qmk_firmware/wiki) - the entirety of the readme has been moved here
35* The readme for your own keyboard: This is found under `keyboards/<your keyboards's name>/`. So for the ErgoDox EZ, it's [here](keyboards/ergodox/ez/); for the Planck, it's [here](keyboards/planck/) and so on. 35* The readme for your own keyboard: This is found under `keyboards/<your keyboards's name>/`. So for the ErgoDox, it's [here](keyboards/ergodox/); for the Planck, it's [here](keyboards/planck/) and so on.
36* The list of possible keycodes you can use in your keymap is actually spread out in a few different places: 36* The list of possible keycodes you can use in your keymap is actually spread out in a few different places:
37 * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes. 37 * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes.
38 * [quantum/quantum_keycodes.h](quantum/quantum_keycodes.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `quantum_keycodes.h` is where they're actually defined. 38 * [quantum/quantum_keycodes.h](quantum/quantum_keycodes.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `quantum_keycodes.h` is where they're actually defined.
diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c
index cb4b25264..77848c092 100644
--- a/tmk_core/common/action_util.c
+++ b/tmk_core/common/action_util.c
@@ -58,9 +58,13 @@ void set_oneshot_locked_mods(int8_t mods) { oneshot_locked_mods = mods; }
58void clear_oneshot_locked_mods(void) { oneshot_locked_mods = 0; } 58void clear_oneshot_locked_mods(void) { oneshot_locked_mods = 0; }
59#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) 59#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
60static int16_t oneshot_time = 0; 60static int16_t oneshot_time = 0;
61inline bool has_oneshot_mods_timed_out() { 61bool has_oneshot_mods_timed_out(void) {
62 return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT; 62 return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT;
63} 63}
64#else
65bool has_oneshot_mods_timed_out(void) {
66 return false;
67}
64#endif 68#endif
65#endif 69#endif
66 70