aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile9
-rw-r--r--Makefile21
-rw-r--r--build_keyboard.mk186
-rw-r--r--keyboards/M10A/M10A.c5
-rw-r--r--keyboards/M10A/M10A.h19
-rw-r--r--keyboards/M10A/Makefile (renamed from keyboards/s60-x/Makefile)0
-rw-r--r--keyboards/M10A/config.h82
-rw-r--r--keyboards/M10A/keymaps/default/Makefile3
-rw-r--r--keyboards/M10A/keymaps/default/keymap.c49
-rw-r--r--keyboards/M10A/rules.mk68
-rw-r--r--keyboards/amj60/amj60.h15
-rw-r--r--keyboards/amj60/keymaps/maximized/keymap.c61
-rw-r--r--keyboards/amjpad/amjpad.h17
-rw-r--r--keyboards/amjpad/keymaps/max/keymap.c102
-rw-r--r--keyboards/amjpad/keymaps/ortho_left/keymap.c65
-rw-r--r--keyboards/amjpad/keymaps/ortho_right/keymap.c65
-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/clueboard/keymaps/serubin/Makefile4
-rw-r--r--keyboards/clueboard/keymaps/serubin/keymap.c103
-rw-r--r--keyboards/clueboard/keymaps/serubin/layout-base.pngbin0 -> 38703 bytes
-rw-r--r--keyboards/clueboard/keymaps/serubin/layout-fn.pngbin0 -> 35216 bytes
-rw-r--r--keyboards/clueboard/keymaps/serubin/layout-media.pngbin0 -> 28944 bytes
-rw-r--r--keyboards/clueboard/keymaps/serubin/readme.md23
-rw-r--r--keyboards/clueboard/keymaps/shift_fn/keymap.c6
-rw-r--r--keyboards/clueboard/keymaps/skully/keymap.c35
-rw-r--r--keyboards/clueboard/keymaps/smt/keymap.c181
-rw-r--r--keyboards/clueboard/keymaps/smt/layout.pngbin0 -> 130672 bytes
-rw-r--r--keyboards/clueboard/keymaps/smt/readme.md30
-rw-r--r--keyboards/ergodox/config.h2
-rw-r--r--keyboards/ergodox/ez/config.h2
-rw-r--r--keyboards/ergodox/ez/matrix.c62
-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/matrix.c1
-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/coderkun_neo2/keymap.c53
-rw-r--r--keyboards/ergodox/keymaps/coderkun_neo2/readme.md122
-rw-r--r--keyboards/ergodox/keymaps/default/visualizer.c42
-rw-r--r--keyboards/ergodox/keymaps/dvorak_programmer/keymap.c6
-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/ordinary/keymap.c2
-rw-r--r--keyboards/ergodox/keymaps/siroken3/default.pngbin0 -> 193672 bytes
-rw-r--r--keyboards/ergodox/keymaps/siroken3/default_firmware_v1.2-2.pngbin0 -> 257921 bytes
-rw-r--r--keyboards/ergodox/keymaps/siroken3/default_highres.pngbin0 -> 1459389 bytes
-rw-r--r--keyboards/ergodox/keymaps/siroken3/keymap.c187
-rw-r--r--keyboards/ergodox/keymaps/siroken3/readme.md15
-rw-r--r--keyboards/ergodox/keymaps/yoruian/keymap.c4
-rw-r--r--keyboards/ergodox/keymaps/yoruian/yoruian.h56
-rw-r--r--keyboards/frosty_flake/matrix.c4
-rw-r--r--keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c1
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c1
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h (renamed from keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/Makefile (renamed from keyboards/handwired/MS-sculpt-mobile/Makefile)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/babblePaste.c (renamed from keyboards/handwired/MS-sculpt-mobile/babblePaste.c)7
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/babblePaste.h (renamed from keyboards/handwired/MS-sculpt-mobile/babblePaste.h)2
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/babblePaste.txt (renamed from keyboards/handwired/MS-sculpt-mobile/babblePaste.txt)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/config.h (renamed from keyboards/handwired/MS-sculpt-mobile/config.h)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h8
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c)2
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h)2
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c)4
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/readme.md (renamed from keyboards/handwired/MS-sculpt-mobile/readme.md)0
-rw-r--r--keyboards/handwired/MS_sculpt_mobile/rules.mk (renamed from keyboards/handwired/MS-sculpt-mobile/rules.mk)0
-rw-r--r--keyboards/handwired/atreus50/keymaps/default/keymap.c2
-rw-r--r--keyboards/handwired/promethium/color.h15
-rw-r--r--keyboards/handwired/promethium/config.h79
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/Makefile2
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/README.md4
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/config.h1
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/keymap.c289
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/rgbtheme.h1
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_carbon.h36
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_default.h36
-rw-r--r--keyboards/handwired/promethium/matrix.c306
-rw-r--r--keyboards/handwired/promethium/promethium.c5
-rw-r--r--keyboards/handwired/promethium/rules.mk6
-rw-r--r--keyboards/hhkb/keymaps/cinaeco/Makefile23
-rw-r--r--keyboards/hhkb/keymaps/cinaeco/README.md23
-rw-r--r--keyboards/hhkb/keymaps/cinaeco/config.h20
-rw-r--r--keyboards/hhkb/keymaps/cinaeco/keymap.c186
-rw-r--r--keyboards/hhkb/keymaps/smt/keymap.c176
-rw-r--r--keyboards/hhkb/rules.mk2
-rw-r--r--keyboards/kitten_paw/keymaps/ickerwx/config.h2
-rw-r--r--keyboards/kitten_paw/keymaps/ickerwx/keymap.c2
-rw-r--r--keyboards/mitosis/Makefile3
-rw-r--r--keyboards/mitosis/config.h87
-rw-r--r--keyboards/mitosis/keymaps/default/keymap.c221
-rw-r--r--keyboards/mitosis/matrix.c164
-rw-r--r--keyboards/mitosis/mitosis.c31
-rw-r--r--keyboards/mitosis/mitosis.h67
-rw-r--r--keyboards/mitosis/readme.md33
-rw-r--r--keyboards/mitosis/rules.mk81
-rw-r--r--keyboards/miuni32/config.h1
-rw-r--r--keyboards/miuni32/keymaps/adam-lee/Makefile21
-rw-r--r--keyboards/miuni32/keymaps/adam-lee/config.h (renamed from keyboards/handwired/MS-sculpt-mobile/keymaps/default/config.h)2
-rw-r--r--keyboards/miuni32/keymaps/adam-lee/keymap.c119
-rw-r--r--keyboards/miuni32/keymaps/adam-lee/readme.md1
-rw-r--r--keyboards/miuni32/keymaps/default/keymap.c104
-rw-r--r--keyboards/miuni32/keymaps/ht_156/Makefile21
-rw-r--r--keyboards/miuni32/keymaps/ht_156/config.h8
-rw-r--r--keyboards/miuni32/keymaps/ht_156/keymap.c181
-rw-r--r--keyboards/miuni32/keymaps/ht_156/readme.md1
-rw-r--r--keyboards/miuni32/miuni32.h4
-rw-r--r--keyboards/planck/keymaps/dshields/Makefile12
-rw-r--r--keyboards/planck/keymaps/dshields/config.h31
-rw-r--r--keyboards/planck/keymaps/dshields/keyboard-layout.jpgbin0 -> 50615 bytes
-rw-r--r--keyboards/planck/keymaps/dshields/keymap.c100
-rw-r--r--keyboards/planck/keymaps/dshields/readme.md12
-rw-r--r--keyboards/planck/keymaps/khord/config.h1
-rw-r--r--keyboards/planck/keymaps/khord/keymap.c42
-rw-r--r--keyboards/planck/keymaps/lae3/Makefile23
-rw-r--r--keyboards/planck/keymaps/lae3/config.h8
-rw-r--r--keyboards/planck/keymaps/lae3/keymap.c262
-rw-r--r--keyboards/planck/keymaps/lae3/readme.md111
-rw-r--r--keyboards/planck/keymaps/lucas/keymap.c6
-rw-r--r--keyboards/planck/keymaps/priyadi/config.h3
-rw-r--r--keyboards/planck/keymaps/vifon/keymap.c3
-rw-r--r--keyboards/preonic/keymaps/CMD-Preonic/keymap.c10
-rw-r--r--keyboards/ps2avrGB/keymaps/default/keymap.c16
-rw-r--r--keyboards/ps2avrGB/ps2avrGB.h18
-rw-r--r--keyboards/s60-x/config.h164
-rw-r--r--keyboards/s60-x/s60-x_precompiled.zipbin276106 -> 0 bytes
-rw-r--r--keyboards/s60_x/Makefile5
-rw-r--r--keyboards/s60_x/config.h59
-rw-r--r--keyboards/s60_x/default/Makefile3
-rw-r--r--keyboards/s60_x/default/config.h25
-rw-r--r--keyboards/s60_x/default/default.c (renamed from keyboards/s60-x/s60-x.c)2
-rw-r--r--keyboards/s60_x/default/default.h (renamed from keyboards/s60-x/s60-x.h)10
-rw-r--r--keyboards/s60_x/default/rules.mk9
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/Makefile (renamed from keyboards/s60-x/keymaps/ansi_qwertz/Makefile)0
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/config.h (renamed from keyboards/s60-x/keymaps/ansi_qwertz/config.h)0
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png)bin54748 -> 54748 bytes
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg)0
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg)0
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.png (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png)bin54041 -> 54041 bytes
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg)0
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/base_layer.PNG (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG)bin29411 -> 29411 bytes
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/function_layer.PNG (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG)bin25567 -> 25567 bytes
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/docs/gaming_layer.PNG (renamed from keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG)bin17895 -> 17895 bytes
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/keymap.c (renamed from keyboards/s60-x/keymaps/ansi_qwertz/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/ansi_qwertz/readme.md (renamed from keyboards/s60-x/keymaps/ansi_qwertz/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/custom/keymap.c (renamed from keyboards/s60-x/keymaps/custom/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/custom/readme.md (renamed from keyboards/s60-x/keymaps/custom/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/dbroqua/keymap.c205
-rw-r--r--keyboards/s60_x/keymaps/default/keymap.c (renamed from keyboards/s60-x/keymaps/default/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/default/readme.md (renamed from keyboards/s60-x/keymaps/default/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/hasu/keymap.c (renamed from keyboards/s60-x/keymaps/hasu/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/hasu/readme.md (renamed from keyboards/s60-x/keymaps/hasu/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/hhkb/keymap.c (renamed from keyboards/s60-x/keymaps/hhkb/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/hhkb/readme.md (renamed from keyboards/s60-x/keymaps/hhkb/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/iso/keymap.c (renamed from keyboards/s60-x/keymaps/iso/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/iso/readme.md (renamed from keyboards/s60-x/keymaps/iso/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/jpec/keymap.c (renamed from keyboards/s60-x/keymaps/jpec/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/jpec/readme.md (renamed from keyboards/s60-x/keymaps/jpec/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/plain/keymap.c (renamed from keyboards/s60-x/keymaps/plain/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/plain/readme.md (renamed from keyboards/s60-x/keymaps/plain/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/poker/keymap.c (renamed from keyboards/s60-x/keymaps/poker/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/poker/readme.md (renamed from keyboards/s60-x/keymaps/poker/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/poker_bit/keymap.c (renamed from keyboards/s60-x/keymaps/poker_bit/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/poker_bit/readme.md (renamed from keyboards/s60-x/keymaps/poker_bit/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/poker_set/keymap.c (renamed from keyboards/s60-x/keymaps/poker_set/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/poker_set/readme.md (renamed from keyboards/s60-x/keymaps/poker_set/readme.md)0
-rw-r--r--keyboards/s60_x/keymaps/spacefn/keymap.c (renamed from keyboards/s60-x/keymaps/spacefn/keymap.c)2
-rw-r--r--keyboards/s60_x/keymaps/spacefn/readme.md (renamed from keyboards/s60-x/keymaps/spacefn/readme.md)0
-rw-r--r--keyboards/s60_x/readme.md (renamed from keyboards/s60-x/readme.md)5
-rw-r--r--keyboards/s60_x/rgb/Makefile3
-rw-r--r--keyboards/s60_x/rgb/config.h32
-rw-r--r--keyboards/s60_x/rgb/rgb.c1
-rw-r--r--keyboards/s60_x/rgb/rgb.h37
-rw-r--r--keyboards/s60_x/rgb/rules.mk9
-rw-r--r--keyboards/s60_x/rules.mk (renamed from keyboards/s60-x/rules.mk)4
-rw-r--r--keyboards/s60_x/s60_x.c1
-rw-r--r--keyboards/s60_x/s60_x.h13
-rw-r--r--keyboards/tv44/keymaps/xyverz/keymap.c151
-rw-r--r--keyboards/xd60/keymaps/default/keymap.c4
-rw-r--r--keyboards/xd60/readme.md2
-rw-r--r--quantum/dynamic_macro.h82
-rw-r--r--quantum/fauxclicky.c15
-rw-r--r--quantum/fauxclicky.h10
-rw-r--r--quantum/keymap_common.c7
-rw-r--r--quantum/keymap_extras/keymap_german_ch.h4
-rw-r--r--quantum/led_tables.c71
-rw-r--r--quantum/led_tables.h30
-rw-r--r--quantum/process_keycode/process_printer.c22
-rw-r--r--quantum/process_keycode/process_printer.h2
-rw-r--r--quantum/process_keycode/process_printer_bb.c4
-rw-r--r--quantum/process_keycode/process_unicode.c1
-rw-r--r--quantum/process_keycode/process_unicode_common.c1
-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--tmk_core/avr.mk42
-rw-r--r--tmk_core/chibios.mk4
-rw-r--r--tmk_core/common/action.c17
-rw-r--r--tmk_core/common/action_util.c6
-rw-r--r--tmk_core/common/avr/suspend.c1
-rw-r--r--tmk_core/common/mousekey.h13
-rw-r--r--tmk_core/rules.mk6
238 files changed, 7334 insertions, 1958 deletions
diff --git a/Dockerfile b/Dockerfile
index 744ded857..88da06f02 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,7 @@
1FROM debian:jessie 1FROM debian:jessie
2MAINTAINER Erik Dasque <erik@frenchguys.com> 2MAINTAINER Erik Dasque <erik@frenchguys.com>
3 3
4RUN apt-get update 4RUN apt-get update && apt-get install --no-install-recommends -y build-essential \
5RUN apt-get install --no-install-recommends -y build-essential \
6 gcc \ 5 gcc \
7 unzip \ 6 unzip \
8 wget \ 7 wget \
@@ -15,10 +14,8 @@ RUN apt-get install --no-install-recommends -y build-essential \
15 gcc-arm-none-eabi \ 14 gcc-arm-none-eabi \
16 binutils-arm-none-eabi \ 15 binutils-arm-none-eabi \
17 libnewlib-arm-none-eabi \ 16 libnewlib-arm-none-eabi \
18 git 17 git \
19 18 && rm -rf /var/lib/apt/lists/*
20RUN apt-get clean
21RUN rm -rf /var/lib/apt/lists/*
22 19
23ENV keyboard=ergodox 20ENV keyboard=ergodox
24ENV subproject=ez 21ENV subproject=ez
diff --git a/Makefile b/Makefile
index 9d9c9629d..6a93692bf 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,8 @@ override SILENT := false
21 21
22ON_ERROR := error_occurred=1 22ON_ERROR := error_occurred=1
23 23
24BREAK_ON_ERRORS = no
25
24STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) 26STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
25ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) 27ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
26ROOT_DIR := $(dir $(ROOT_MAKEFILE)) 28ROOT_DIR := $(dir $(ROOT_MAKEFILE))
@@ -462,20 +464,25 @@ endef
462 464
463include $(ROOT_DIR)/message.mk 465include $(ROOT_DIR)/message.mk
464 466
467ifeq ($(strip $(BREAK_ON_ERRORS)), yes)
468HANDLE_ERROR = exit 1
469else
470HANDLE_ERROR = echo $$error_occurred > $(ERROR_FILE)
471endif
472
465# The empty line is important here, as it will force a new shell to be created for each command 473# The empty line is important here, as it will force a new shell to be created for each command
466# Otherwise the command line will become too long with a lot of keyboards and keymaps 474# Otherwise the command line will become too long with a lot of keyboards and keymaps
467define RUN_COMMAND 475define RUN_COMMAND
468+error_occurred=0;\ 476+error_occurred=0;\
469$(COMMAND_$(SILENT_MODE)_$(COMMAND))\ 477$(COMMAND_$(SILENT_MODE)_$(COMMAND))\
470if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi; 478if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
471 479
472 480
473endef 481endef
474define RUN_TEST 482define RUN_TEST
475+error_occurred=0;\ 483+error_occurred=0;\
476$($(TEST)_COMMAND)\ 484$($(TEST)_COMMAND)\
477if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi; 485if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
478
479endef 486endef
480 487
481# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps 488# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
@@ -527,14 +534,22 @@ test: test-all
527.PHONY: test-clean 534.PHONY: test-clean
528test-clean: test-all-clean 535test-clean: test-all-clean
529 536
537ifdef SKIP_VERSION
538SKIP_GIT := yes
539endif
540
530# Generate the version.h file 541# Generate the version.h file
531ifndef SKIP_GIT 542ifndef SKIP_GIT
532 GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") 543 GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
533else 544else
534 GIT_VERSION := NA 545 GIT_VERSION := NA
535endif 546endif
547ifndef SKIP_VERSION
536BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") 548BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
537$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) 549$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
538$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) 550$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
551else
552BUILD_DATE := NA
553endif
539 554
540include $(ROOT_DIR)/testlist.mk 555include $(ROOT_DIR)/testlist.mk
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 82464d583..9fa8c3126 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,65 +171,93 @@ 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 UNICODE_COMMON = yes
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 UNICODE_COMMON = yes
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 UNICODE_COMMON = yes
192 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c 192 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
193endif
194
195ifeq ($(strip $(UNICODE_COMMON)), yes)
196 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
193endif 197endif
194 198
195ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) 199ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
196 OPT_DEFS += -DRGBLIGHT_ENABLE 200 OPT_DEFS += -DRGBLIGHT_ENABLE
197 SRC += $(QUANTUM_DIR)/light_ws2812.c 201 SRC += $(QUANTUM_DIR)/light_ws2812.c
198 SRC += $(QUANTUM_DIR)/rgblight.c 202 SRC += $(QUANTUM_DIR)/rgblight.c
203 CIE1931_CURVE = yes
204 LED_BREATHING_TABLE = yes
199endif 205endif
200 206
201ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 207ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
202 OPT_DEFS += -DTAP_DANCE_ENABLE 208 OPT_DEFS += -DTAP_DANCE_ENABLE
203 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c 209 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
204endif 210endif
205 211
206ifeq ($(strip $(PRINTING_ENABLE)), yes) 212ifeq ($(strip $(PRINTING_ENABLE)), yes)
207 OPT_DEFS += -DPRINTING_ENABLE 213 OPT_DEFS += -DPRINTING_ENABLE
208 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c 214 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
209 SRC += $(TMK_DIR)/protocol/serial_uart.c 215 SRC += $(TMK_DIR)/protocol/serial_uart.c
210endif 216endif
211 217
212ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) 218ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
213 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) 219 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
214 OPT_DEFS += $(SERIAL_DEFS) 220 OPT_DEFS += $(SERIAL_DEFS)
215 VAPTH += $(SERIAL_PATH) 221 VAPTH += $(SERIAL_PATH)
216endif 222endif
217 223
218ifneq ($(strip $(VARIABLE_TRACE)),) 224ifneq ($(strip $(VARIABLE_TRACE)),)
219 SRC += $(QUANTUM_DIR)/variable_trace.c 225 SRC += $(QUANTUM_DIR)/variable_trace.c
220 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE)) 226 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
221ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),) 227ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
222 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE)) 228 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
223endif 229endif
224endif 230endif
225 231
232ifeq ($(strip $(LCD_ENABLE)), yes)
233 CIE1931_CURVE = yes
234endif
235
236ifeq ($(strip $(LED_ENABLE)), yes)
237 CIE1931_CURVE = yes
238endif
239
240ifeq ($(strip $(CIE1931_CURVE)), yes)
241 OPT_DEFS += -DUSE_CIE1931_CURVE
242 LED_TABLES = yes
243endif
244
245ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
246 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
247 LED_TABLES = yes
248endif
249
250ifeq ($(strip $(LED_TABLES)), yes)
251 SRC += $(QUANTUM_DIR)/led_tables.c
252endif
253
226# Optimize size but this may cause error "relocation truncated to fit" 254# Optimize size but this may cause error "relocation truncated to fit"
227#EXTRALDFLAGS = -Wl,--relax 255#EXTRALDFLAGS = -Wl,--relax
228 256
229# Search Path 257# Search Path
230VPATH += $(KEYMAP_PATH) 258VPATH += $(KEYMAP_PATH)
231ifneq ($(SUBPROJECT),) 259ifneq ($(SUBPROJECT),)
232 VPATH += $(SUBPROJECT_PATH) 260 VPATH += $(SUBPROJECT_PATH)
233endif 261endif
234VPATH += $(KEYBOARD_PATH) 262VPATH += $(KEYBOARD_PATH)
235VPATH += $(COMMON_VPATH) 263VPATH += $(COMMON_VPATH)
@@ -243,27 +271,27 @@ EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
243 271
244ifeq ($(PLATFORM),AVR) 272ifeq ($(PLATFORM),AVR)
245ifeq ($(strip $(PROTOCOL)), VUSB) 273ifeq ($(strip $(PROTOCOL)), VUSB)
246 include $(TMK_PATH)/protocol/vusb.mk 274 include $(TMK_PATH)/protocol/vusb.mk
247else 275else
248 include $(TMK_PATH)/protocol/lufa.mk 276 include $(TMK_PATH)/protocol/lufa.mk
249endif 277endif
250 include $(TMK_PATH)/avr.mk 278 include $(TMK_PATH)/avr.mk
251endif 279endif
252 280
253ifeq ($(strip $(VISUALIZER_ENABLE)), yes) 281ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
254 VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer 282 VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
255 VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer 283 VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
256 include $(VISUALIZER_PATH)/visualizer.mk 284 include $(VISUALIZER_PATH)/visualizer.mk
257endif 285endif
258 286
259OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) 287OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
260$(KEYMAP_OUTPUT)_SRC := $(SRC) 288$(KEYMAP_OUTPUT)_SRC := $(SRC)
261$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" 289$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
262$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) 290$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
263$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) 291$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
264$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) 292$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
265$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) 293$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
266$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) 294$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
267$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) 295$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
268 296
269# Default target. 297# Default target.
diff --git a/keyboards/M10A/M10A.c b/keyboards/M10A/M10A.c
new file mode 100644
index 000000000..9a3bd15e1
--- /dev/null
+++ b/keyboards/M10A/M10A.c
@@ -0,0 +1,5 @@
1#include "M10A.h"
2
3void matrix_init_kb(void) {
4 matrix_init_user();
5} \ No newline at end of file
diff --git a/keyboards/M10A/M10A.h b/keyboards/M10A/M10A.h
new file mode 100644
index 000000000..6ec334fb3
--- /dev/null
+++ b/keyboards/M10A/M10A.h
@@ -0,0 +1,19 @@
1#ifndef M10A_H
2#define M10A_H
3
4#include "quantum.h"
5
6#define M10A( \
7 k00, k01, k02, \
8 k10, k11, k12, \
9 k20, k21, k22, \
10 k30, k31, k32 \
11) \
12{ \
13 { k00, k01, k02 }, \
14 { k10, k11, k12 }, \
15 { k20, k21, k22 }, \
16 { k30, k31, k32 } \
17}
18
19#endif
diff --git a/keyboards/s60-x/Makefile b/keyboards/M10A/Makefile
index 4e2a6f00f..4e2a6f00f 100644
--- a/keyboards/s60-x/Makefile
+++ b/keyboards/M10A/Makefile
diff --git a/keyboards/M10A/config.h b/keyboards/M10A/config.h
new file mode 100644
index 000000000..f052ab629
--- /dev/null
+++ b/keyboards/M10A/config.h
@@ -0,0 +1,82 @@
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 0x0007
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Machine Industries
28#define PRODUCT M10-A
29#define DESCRIPTION RAMA x Machine Industries M10-A
30
31/* key matrix size */
32#define MATRIX_ROWS 4
33#define MATRIX_COLS 3
34
35/* Planck PCB default pin-out */
36#define MATRIX_ROW_PINS { B6, F7, F6, D6 }
37#define MATRIX_COL_PINS { F5, F1, F0 }
38#define UNUSED_PINS
39
40#define BACKLIGHT_PIN B7
41
42/* COL2ROW or ROW2COL */
43#define DIODE_DIRECTION ROW2COL
44
45/* define if matrix has ghost */
46//#define MATRIX_HAS_GHOST
47
48/* number of backlight levels */
49#define BACKLIGHT_LEVELS 6
50
51/* Set 0 if debouncing isn't needed */
52#define DEBOUNCING_DELAY 5
53
54/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
55#define LOCKING_SUPPORT_ENABLE
56/* Locking resynchronize hack */
57#define LOCKING_RESYNC_ENABLE
58
59/* key combination for command */
60#define IS_COMMAND() ( \
61 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
62)
63
64/*
65 * Feature disable options
66 * These options are also useful to firmware size reduction.
67 */
68
69/* disable debug print */
70//#define NO_DEBUG
71
72/* disable print */
73//#define NO_PRINT
74
75/* disable action features */
76//#define NO_ACTION_LAYER
77//#define NO_ACTION_TAPPING
78//#define NO_ACTION_ONESHOT
79//#define NO_ACTION_MACRO
80//#define NO_ACTION_FUNCTION
81
82#endif
diff --git a/keyboards/M10A/keymaps/default/Makefile b/keyboards/M10A/keymaps/default/Makefile
new file mode 100644
index 000000000..457a3d01d
--- /dev/null
+++ b/keyboards/M10A/keymaps/default/Makefile
@@ -0,0 +1,3 @@
1ifndef QUANTUM_DIR
2 include ../../../../Makefile
3endif
diff --git a/keyboards/M10A/keymaps/default/keymap.c b/keyboards/M10A/keymaps/default/keymap.c
new file mode 100644
index 000000000..75abeb5b7
--- /dev/null
+++ b/keyboards/M10A/keymaps/default/keymap.c
@@ -0,0 +1,49 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "M10A.h"
5#include "action_layer.h"
6#include "eeconfig.h"
7
8extern keymap_config_t keymap_config;
9
10// Each layer gets a name for readability, which is then used in the keymap matrix below.
11// The underscores don't mean anything - you can have a layer called STUFF or any other name.
12// Layer names don't all need to be of the same length, obviously, and you can also skip them
13// entirely and just use numbers.
14
15enum layers {
16 _LAYER0,
17 _LAYER1,
18 _LAYER2,
19 _LAYER3,
20 _LAYER4,
21 _LAYER5,
22 _LAYER6,
23 _LAYER7,
24 _LAYER8,
25 _LAYER9
26};
27
28// // Fillers to make layering more clear
29// #define _______ KC_TRNS
30// #define XXXXXXX KC_NO
31
32const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 [_LAYER0] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
34 [_LAYER1] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
35 [_LAYER2] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
36 [_LAYER3] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
37 [_LAYER4] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
38 [_LAYER5] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
39 [_LAYER6] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
40 [_LAYER7] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
41 [_LAYER8] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
42 [_LAYER9] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}}
43};
44
45void matrix_init_user(void) {
46 #ifdef BACKLIGHT_ENABLE
47 backlight_level(0);
48 #endif
49}
diff --git a/keyboards/M10A/rules.mk b/keyboards/M10A/rules.mk
new file mode 100644
index 000000000..f5a785dbc
--- /dev/null
+++ b/keyboards/M10A/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# LUFA specific
20#
21# Target architecture (see library "Board Types" documentation).
22ARCH = AVR8
23
24# Input clock frequency.
25# This will define a symbol, F_USB, in all source code files equal to the
26# input clock frequency (before any prescaling is performed) in Hz. This value may
27# differ from F_CPU if prescaling is used on the latter, and is required as the
28# raw input clock is fed directly to the PLL sections of the AVR for high speed
29# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
30# at the end, this will be done automatically to create a 32-bit value in your
31# source code.
32#
33# If no clock division is performed on the input clock inside the AVR (via the
34# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
35F_USB = $(F_CPU)
36
37# Interrupt driven control endpoint task(+60)
38OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
39
40
41# Boot Section Size in *bytes*
42# Teensy halfKay 512
43# Teensy++ halfKay 1024
44# Atmel DFU loader 4096
45# LUFA bootloader 4096
46# USBaspLoader 2048
47OPT_DEFS += -DBOOTLOADER_SIZE=4096
48
49# Build Options
50# change to "no" to disable the options, or define them in the Makefile in
51# the appropriate keymap folder that will get included automatically
52#
53BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
54MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
55EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
56CONSOLE_ENABLE ?= no # Console for debug(+400)
57COMMAND_ENABLE ?= no # Commands for debug and configuration
58NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
59BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
60MIDI_ENABLE ?= no # MIDI controls
61AUDIO_ENABLE ?= no # Audio output on port C6
62UNICODE_ENABLE ?= yes # Unicode
63BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
64RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight.
65API_SYSEX_ENABLE = yes
66
67# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
68SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
diff --git a/keyboards/amj60/amj60.h b/keyboards/amj60/amj60.h
index a0cb47331..c508e479c 100644
--- a/keyboards/amj60/amj60.h
+++ b/keyboards/amj60/amj60.h
@@ -147,6 +147,21 @@
147 {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ 147 {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
148} 148}
149 149
150#define KEYMAP_MAX( \
151 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49,\
152 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
153 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \
154 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \
155 k40, k41, k42, k45, k4a, k4b, k4c, k4d \
156) \
157{ \
158 {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
159 {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
160 {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \
161 {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \
162 {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \
163}
164
150void matrix_init_user(void); 165void matrix_init_user(void);
151void matrix_scan_user(void); 166void matrix_scan_user(void);
152 167
diff --git a/keyboards/amj60/keymaps/maximized/keymap.c b/keyboards/amj60/keymaps/maximized/keymap.c
new file mode 100644
index 000000000..d2a4be59f
--- /dev/null
+++ b/keyboards/amj60/keymaps/maximized/keymap.c
@@ -0,0 +1,61 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "amj60.h"
5
6// Each layer gets a name for readability, which is then used in the keymap matrix below.
7// The underscores don't mean anything - you can have a layer called STUFF or any other name.
8// Layer names don't all need to be of the same length, obviously, and you can also skip them
9// entirely and just use numbers.
10#define _DEF 0
11#define _SPC 1
12
13// dual-role shortcuts
14#define SPACEDUAL LT(_SPC, KC_SPACE)
15
16
17// increase readability
18#define _______ KC_TRNS
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21 /* Keymap _DEF: Default Layer
22 * ,-----------------------------------------------------------.
23 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | ~ |
24 * |-----------------------------------------------------------|
25 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| bspc|
26 * |-----------------------------------------------------------|
27 * |Caps | A| S| D| F| G| H| J| K| L| ;| '| Return |
28 * |-----------------------------------------------------------|
29 * |Sft | Fn0| Z| X| C| V| B| N| M| ,| .| /| Sft |Fn2|
30 * |-----------------------------------------------------------|
31 * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl|
32 * `-----------------------------------------------------------'
33 */
34 [_DEF] = KEYMAP_MAX(
35 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, \
36 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, \
37 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
38 KC_LSFT, F(0), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, F(1), \
39 KC_LCTL, KC_LALT, KC_LGUI, SPACEDUAL, KC_RGUI, KC_RALT, KC_RCTL, F(2)),
40
41 /* Keymap 1: F-and-vim Layer, modified with Space (by holding space)
42 * ,-----------------------------------------------------------.
43 * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |
44 * |-----------------------------------------------------------|
45 * | |Paus| Up| [ | ] | | | | ( | ) | | | | Del |
46 * |-----------------------------------------------------------|
47 * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY |
48 * |-----------------------------------------------------------|
49 * | | | | | < | > | |M0 | | | | | Vol+ | |
50 * |-----------------------------------------------------------|
51 * | | | | |Alt |Prev|Vol-|Next|
52 * `-----------------------------------------------------------'
53 */
54 [_SPC] = KEYMAP_MAX(
55 KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \
56 _______, KC_PAUS, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
57 _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, KC_MPLY, \
58 _______, _______, _______, _______, _______, _______, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \
59 _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
60
61};
diff --git a/keyboards/amjpad/amjpad.h b/keyboards/amjpad/amjpad.h
index b9b4d3686..ffba1c9b9 100644
--- a/keyboards/amjpad/amjpad.h
+++ b/keyboards/amjpad/amjpad.h
@@ -39,7 +39,22 @@
39 {k40, k41, k42, k43}, \ 39 {k40, k41, k42, k43}, \
40 {k50, XXX, k52, XXX} \ 40 {k50, XXX, k52, XXX} \
41} 41}
42 42#define MAXKEYMAP( \
43 k00, k01, k02, k03, \
44 k10, k11, k12, k13, \
45 k20, k21, k22, k23, \
46 k30, k31, k32, k33, \
47 k40, k41, k42, k43, \
48 k50, k51, k52, k53\
49) \
50{ \
51 {k00, k01, k02, k03}, \
52 {k10, k11, k12, k13}, \
53 {k20, k21, k22, k23}, \
54 {k30, k31, k32, k33}, \
55 {k40, k41, k42, k43}, \
56 {k50, k51, k52, k53} \
57}
43void matrix_init_user(void); 58void matrix_init_user(void);
44void matrix_scan_user(void); 59void matrix_scan_user(void);
45 60
diff --git a/keyboards/amjpad/keymaps/max/keymap.c b/keyboards/amjpad/keymaps/max/keymap.c
new file mode 100644
index 000000000..926a494a9
--- /dev/null
+++ b/keyboards/amjpad/keymaps/max/keymap.c
@@ -0,0 +1,102 @@
1#include "amjpad.h"
2
3#ifdef RGBLIGHT_ENABLE
4#include "rgblight.h"
5#endif
6
7// Used for SHIFT_ESC
8#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
9
10// Each layer gets a name for readability, which is then used in the keymap matrix below.
11// The underscores don't mean anything - you can have a layer called STUFF or any other name.
12// Layer names don't all need to be of the same length, obviously, and you can also skip them
13// entirely and just use numbers.
14#define _BL 0
15#define _FL 1
16
17#define _______ KC_TRNS
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 /* Keymap _BL: (Base Layer) Default Layer
21 * ,-------------------.
22 * |Esc |Setp| - | = |
23 * |----|----|----|----|
24 * | F1 | F2 | F3 | F4 |
25 * |----|----|----|----|
26 * | 7 | 8 | 9 | - |
27 * |----|----|----|----|
28 * | 4 | 5 | 6 | LF |
29 * |----|----|----|----|
30 * | 1 | 2 | 3 | \ |
31 * |----|----|----|----|
32 * |Left|Down| Up |Rght|
33 * `-------------------'
34 */
35
36[_BL] = MAXKEYMAP(
37
38 KC_ESC, KC_TAB, KC_MINS,KC_EQL, \
39 KC_F1, KC_F2, KC_F3, KC_F4, \
40 KC_P7, KC_P8, KC_P9, KC_PMNS, \
41 KC_P4, KC_P5, KC_P6, KC_PENT, \
42 KC_P1, KC_P2, KC_P3, KC_BSLS, \
43 KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
44
45 /* Keymap _FL: Function Layer
46 * ,-------------------.
47 * |Esc |TAB |BS | = |
48 * |----|----|----|----|
49 * | NL | / | * | - |
50 * |----|----|----|----|
51 * | 7 | 8 | 9 | |
52 * |----|----|----|RST |
53 * | 4 | 5 | 6 | |
54 * |----|----|----|----|
55 * | 1 | 2 | 3 | |
56 * |----|----|----| En |
57 * | 0 |./FN| |
58 * `-------------------'
59 */
60[_FL] = MAXKEYMAP(
61
62 KC_ESC,KC_TAB,KC_BSPC,KC_PEQL, \
63 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
64 KC_P7, KC_P8, KC_P9, RESET, \
65 KC_P4, KC_P5, KC_P6, KC_PENT, \
66 KC_P1, KC_P2, KC_P3, KC_PENT, \
67 KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
68};
69
70enum function_id {
71 SHIFT_ESC,
72};
73
74const uint16_t PROGMEM fn_actions[] = {
75 [0] = ACTION_FUNCTION(SHIFT_ESC),
76};
77
78void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
79 static uint8_t shift_esc_shift_mask;
80 switch (id) {
81 case SHIFT_ESC:
82 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
83 if (record->event.pressed) {
84 if (shift_esc_shift_mask) {
85 add_key(KC_GRV);
86 send_keyboard_report();
87 } else {
88 add_key(KC_ESC);
89 send_keyboard_report();
90 }
91 } else {
92 if (shift_esc_shift_mask) {
93 del_key(KC_GRV);
94 send_keyboard_report();
95 } else {
96 del_key(KC_ESC);
97 send_keyboard_report();
98 }
99 }
100 break;
101 }
102}
diff --git a/keyboards/amjpad/keymaps/ortho_left/keymap.c b/keyboards/amjpad/keymaps/ortho_left/keymap.c
new file mode 100644
index 000000000..d3e4d9944
--- /dev/null
+++ b/keyboards/amjpad/keymaps/ortho_left/keymap.c
@@ -0,0 +1,65 @@
1#include "amjpad.h"
2
3#ifdef RGBLIGHT_ENABLE
4#include "rgblight.h"
5#endif
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 _BL 0
12#define _FL 1
13
14#define _______ KC_TRNS
15
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Keymap _BL: (Base Layer) Default Layer
18 * ,-------------------.
19 * | T | G | B |Spac|
20 * |----|----|----|----|
21 * | R | F | V | Fn |
22 * |----|----|----|----|
23 * | E | D | C | OS |
24 * |----|----|----|----|
25 * | W | S | X | Alt|
26 * |----|----|----|----|
27 * | Q | A | Z | Ctl|
28 * |----|----|----|----|
29 * | Esc| Tab|Shft| Fn2|
30 * `-------------------'
31 */
32
33[_BL] = MAXKEYMAP(
34
35 KC_T, KC_G, KC_B, KC_SPACE,\
36 KC_R, KC_F, KC_V, MO(1), \
37 KC_E, KC_D, KC_C, KC_LGUI, \
38 KC_W, KC_S, KC_X, KC_LALT, \
39 KC_Q, KC_A, KC_Z, KC_LCTL, \
40 KC_TAB, KC_ESC, KC_LSHIFT, MO(1)),
41
42 /* Keymap _FL: Function Layer
43 * ,-------------------.
44 * | 5 | F5 | F11|Spac|
45 * |----|----|----|----|
46 * | 4 | F4 | F10| |
47 * |----|----|----|----|
48 * | 3 | F3 | F9 | OS |
49 * |----|----|----|----|
50 * | 2 | F2 | F8 | Alt|
51 * |----|----|----|----|
52 * | 1 | F1 | F7 | Ctl|
53 * |----|----|----|----|
54 * | ` | Del|Shft| |
55 * `-------------------'
56 */
57[_FL] = MAXKEYMAP(
58
59 KC_5, KC_F5, KC_F11, _______, \
60 KC_4, KC_F4, KC_F10, _______, \
61 KC_3, KC_F3, KC_F9, _______, \
62 KC_2, KC_F2, KC_F8, _______, \
63 KC_1, KC_F1, KC_F7, _______, \
64 KC_GRV,KC_DEL, _______, _______),
65};
diff --git a/keyboards/amjpad/keymaps/ortho_right/keymap.c b/keyboards/amjpad/keymaps/ortho_right/keymap.c
new file mode 100644
index 000000000..33e599abd
--- /dev/null
+++ b/keyboards/amjpad/keymaps/ortho_right/keymap.c
@@ -0,0 +1,65 @@
1#include "amjpad.h"
2
3#ifdef RGBLIGHT_ENABLE
4#include "rgblight.h"
5#endif
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 _BL 0
12#define _FL 1
13
14#define _______ KC_TRNS
15
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Keymap _BL: (Base Layer) Default Layer
18 * ,-------------------.
19 * |Spac| N | H | Y |
20 * |----|----|----|----|
21 * | Fn | M | J | U |
22 * |----|----|----|----|
23 * |Left| , | K | I |
24 * |----|----|----|----|
25 * |Down| . | L | O |
26 * |----|----|----|----|
27 * | Up | / | ; | P |
28 * |----|----|----|----|
29 * |Rght| Ret| " |Bspc|
30 * `-------------------'
31 */
32
33[_BL] = MAXKEYMAP(
34
35 KC_SPACE, KC_N, KC_H, KC_Y, \
36 MO(1), KC_M, KC_J, KC_U, \
37 KC_LEFT, KC_COMM, KC_K, KC_I, \
38 KC_DOWN, KC_DOT, KC_L, KC_O, \
39 KC_UP, KC_SLASH, KC_SCLN, KC_P, \
40 KC_RIGHT, KC_ENT, KC_QUOT, KC_BSPC),
41
42 /* Keymap _FL: Function Layer
43 * ,-------------------.
44 * |Esc | F12| F6 | 6 |
45 * |----|----|----|----|
46 * | NL | M | - | 7 |
47 * |----|----|----|----|
48 * |Left| , | = | 8 |
49 * |----|----|----|----|
50 * |Down| . | [ | 9 |
51 * |----|----|----|----|
52 * | Up | / | ] | 0 |
53 * |----|----|----|----|
54 * |Rght| Ret| \ | Del|
55 * `-------------------'
56 */
57[_FL] = MAXKEYMAP(
58
59 _______, KC_F12, KC_F6, KC_6, \
60 _______, _______, KC_MINS, KC_7, \
61 _______, _______, KC_EQL, KC_8, \
62 _______, _______, KC_LBRC, KC_9, \
63 _______, _______, KC_RBRC, KC_0, \
64 _______, _______, KC_BSLS, KC_DEL),
65};
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 66fdebb50..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_EQL} 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_EQL} 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_BSLS}, 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_PIPE}, 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/clueboard/keymaps/serubin/Makefile b/keyboards/clueboard/keymaps/serubin/Makefile
new file mode 100644
index 000000000..ba997f869
--- /dev/null
+++ b/keyboards/clueboard/keymaps/serubin/Makefile
@@ -0,0 +1,4 @@
1
2MOUSEKEY_ENABLE = yes
3EXTRAKEY_ENABLE = yes
4
diff --git a/keyboards/clueboard/keymaps/serubin/keymap.c b/keyboards/clueboard/keymaps/serubin/keymap.c
new file mode 100644
index 000000000..18446eb31
--- /dev/null
+++ b/keyboards/clueboard/keymaps/serubin/keymap.c
@@ -0,0 +1,103 @@
1#include "clueboard.h"
2
3// Helpful defines
4#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
5#define _______ KC_TRNS
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 _BL 0
12#define _FL 1
13#define _ME 2
14#define _CL 3
15
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Keymap _BL: Base Layer (Default Layer)
18 */
19[_BL] = KEYMAP(
20 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
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_PGDN, \
22 F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
23 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
24 KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RGUI, MO(_FL), MO(_ME), KC_LEFT, KC_DOWN, KC_RGHT),
25
26 /* Keymap _FL: Function Layer
27 */
28[_FL] = KEYMAP(
29 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, KC_HOME, \
30 _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, KC_PSCR, KC_END, \
31 _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
32 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
33 _______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_HOME, KC_PGDN, KC_END),
34
35/* Keymap _FL: Function Layer
36 */
37[_ME] = KEYMAP(
38 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \
39 _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, KC_VOLD, \
40 _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
41 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______ , _______, _______, \
42 _______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_MPRV, KC_MPLY, KC_MNXT),
43
44
45 /* Keymap _CL: Control layer
46 */
47[_CL] = KEYMAP(
48 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
49 _______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
50 _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
51 MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, MO(_FL), _______, RGB_SAI, \
52 _______, _______, _______,_______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
53};
54
55/* This is a list of user defined functions. F(N) corresponds to item N
56 of this list.
57 */
58const uint16_t PROGMEM fn_actions[] = {
59 [0] = ACTION_FUNCTION(0), // Calls action_function()
60 [1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
61};
62
63void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
64 static uint8_t mods_pressed;
65 static bool mod_flag;
66
67 switch (id) {
68 case 0:
69 /* Handle the combined Grave/Esc key
70 */
71 mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
72
73 if (record->event.pressed) {
74 /* The key is being pressed.
75 */
76 if (mods_pressed) {
77 mod_flag = true;
78 add_key(KC_GRV);
79 send_keyboard_report();
80 } else {
81 add_key(KC_ESC);
82 send_keyboard_report();
83 }
84 } else {
85 /* The key is being released.
86 */
87 if (mod_flag) {
88 mod_flag = false;
89 del_key(KC_GRV);
90 send_keyboard_report();
91 } else {
92 del_key(KC_ESC);
93 send_keyboard_report();
94 }
95 }
96 break;
97 case 1:
98 if(record->event.pressed) {
99 del_key(KC_ESC);
100 }
101 break;
102 }
103}
diff --git a/keyboards/clueboard/keymaps/serubin/layout-base.png b/keyboards/clueboard/keymaps/serubin/layout-base.png
new file mode 100644
index 000000000..8dcdc0643
--- /dev/null
+++ b/keyboards/clueboard/keymaps/serubin/layout-base.png
Binary files differ
diff --git a/keyboards/clueboard/keymaps/serubin/layout-fn.png b/keyboards/clueboard/keymaps/serubin/layout-fn.png
new file mode 100644
index 000000000..3cff46a72
--- /dev/null
+++ b/keyboards/clueboard/keymaps/serubin/layout-fn.png
Binary files differ
diff --git a/keyboards/clueboard/keymaps/serubin/layout-media.png b/keyboards/clueboard/keymaps/serubin/layout-media.png
new file mode 100644
index 000000000..753cb64fa
--- /dev/null
+++ b/keyboards/clueboard/keymaps/serubin/layout-media.png
Binary files differ
diff --git a/keyboards/clueboard/keymaps/serubin/readme.md b/keyboards/clueboard/keymaps/serubin/readme.md
new file mode 100644
index 000000000..e39adbb16
--- /dev/null
+++ b/keyboards/clueboard/keymaps/serubin/readme.md
@@ -0,0 +1,23 @@
1```
2 ___ _____ _ _ _ __ __ _ __
3|__ \ / ____| | | | | | / / / /(_) / /
4 ||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
5 |/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
6 |_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
7 (_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
8```
9
10# Serubin's Clueboard Layout
11
12This is the layout based on the clueboard default, modified for development on Mac, PC, and Windows. This layout also handles media and volume keys on all the previously listed platforms. Most importantly, Capslock has been replaced by a dual function Esc/Ctrl key. This is particularly handy for use in Vim.
13
14#### Base Layer
15![Base Layout Image](layout-base.png)
16
17#### Fn Layer
18![Fn Layout Image](layout-fn.png)
19
20#### Media Layer
21![Media Layer Image](layout-media.png)
22
23
diff --git a/keyboards/clueboard/keymaps/shift_fn/keymap.c b/keyboards/clueboard/keymaps/shift_fn/keymap.c
index c4fae0369..fdec37a54 100644
--- a/keyboards/clueboard/keymaps/shift_fn/keymap.c
+++ b/keyboards/clueboard/keymaps/shift_fn/keymap.c
@@ -19,8 +19,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \ 19 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
20 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_PGDN, \ 20 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_PGDN, \
21 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ 21 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
22 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \ 22 MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
23 KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), 23 KC_LCTL, KC_LGUI, KC_LALT,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
24 24
25 /* Keymap _FL: Function Layer 25 /* Keymap _FL: Function Layer
26 */ 26 */
@@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \ 29 S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
30 S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \ 30 S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
31 MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \ 31 MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
32 KC_LCTL, KC_LALT, KC_LGUI,MO(_FL), S(KC_SPC),S(KC_SPC), MO(_FL), KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END), 32 KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
33 33
34 /* Keymap _CL: Control layer 34 /* Keymap _CL: Control layer
35 */ 35 */
diff --git a/keyboards/clueboard/keymaps/skully/keymap.c b/keyboards/clueboard/keymaps/skully/keymap.c
index 077d214fa..df7757a92 100644
--- a/keyboards/clueboard/keymaps/skully/keymap.c
+++ b/keyboards/clueboard/keymaps/skully/keymap.c
@@ -16,33 +16,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
16 /* Keymap _BL: Base Layer (Default Layer) 16 /* Keymap _BL: Base Layer (Default Layer)
17 */ 17 */
18[_BL] = KEYMAP( 18[_BL] = KEYMAP(
19 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \ 19 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
20 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_PGDN, \ 20 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_PGDN, \
21 KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ 21 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
22 KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \ 22 MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
23 KC_LCTL,KC_LALT,KC_LGUI,MO(_FL), KC_SPC, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), 23 KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
24 24
25 /* Keymap _FL: Function Layer 25 /* Keymap _FL: Function Layer
26 */ 26 */
27[_FL] = KEYMAP( 27[_FL] = KEYMAP(
28 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_DEL, BL_STEP, \ 28 S(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, S(KC_GRV), KC_DEL, BL_STEP, \
29 _______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______, \ 29 S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
30 _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ 30 S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
31 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_PGUP, \ 31 MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
32 _______,_______,_______,MO(_FL), _______,_______, MO(_FL),_______,_______,MO(_FL),KC_HOME,KC_PGDN,KC_END), 32 KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
33 33
34 /* Keymap _CL: Control layer 34 /* Keymap _CL: Control layer
35 */ 35 */
36[_CL] = KEYMAP( 36[_CL] = KEYMAP(
37 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 37 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
38 _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 38 _______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
39 _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ 39 _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
40 _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 40 MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
41 _______,_______,_______,_______, _______,_______, _______,_______,_______,MO(_FL),_______, _______, _______), 41 _______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD,RGB_SAD,RGB_HUI),
42}; 42};
43 43
44/* This is a list of user defined functions. F(N) corresponds to item N
45 of this list.
46 */
44const uint16_t PROGMEM fn_actions[] = { 47const uint16_t PROGMEM fn_actions[] = {
45 [0] = ACTION_FUNCTION(0), 48 [0] = ACTION_FUNCTION(0), // Calls action_function()
46}; 49};
47 50
48void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { 51void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
diff --git a/keyboards/clueboard/keymaps/smt/keymap.c b/keyboards/clueboard/keymaps/smt/keymap.c
new file mode 100644
index 000000000..732086fb5
--- /dev/null
+++ b/keyboards/clueboard/keymaps/smt/keymap.c
@@ -0,0 +1,181 @@
1#include "clueboard.h"
2
3// Each layer gets a name for readability, which is then used in the keymap matrix below.
4// The underscores don't mean anything - you can have a layer called STUFF or any other name.
5// Layer names don't all need to be of the same length, obviously, and you can also skip them
6// entirely and just use numbers.
7#define _QWERTY 0
8#define _COLEMAK 1
9#define _DVORAK 2
10#define _FL 3
11#define _CL 4
12
13enum planck_keycodes {
14 QWERTY = SAFE_RANGE,
15 COLEMAK,
16 DVORAK
17};
18
19// Helpful defines
20#define _______ KC_TRNS
21#define XXXXXXX KC_NO
22#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
23
24// Custom macros
25#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
26#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt)
27#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
28
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 /* Keymap _QWERTY: Base Layer (Default Layer)
32 * ,-----------------------------------------------------------. ,---.
33 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| |PgU|
34 * |-----------------------------------------------------------| |---|
35 * |HpTab| Q| W| E| R| T| Y| U| I| O| P| [| ]| BS| |PgD|
36 * |-----------------------------------------------------------| `---'
37 * |CtlEsc| A| S| D| F| G| H| J| K| L| ;| '| | Ent|
38 * |--------------------------------------------------------------.
39 * |Shift| | Z| X| C| V| B| N| M| ,| .| /|Shift| Fn| Up|
40 * |------------------------------------------------------------------.
41 * |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt|
42 * `------------------------------------------------------------------'
43 */
44[_QWERTY] = KEYMAP(
45 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PGUP, \
46 HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, \
47 CTL_ESC, 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, \
48 KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, MO(_FL), KC_UP, \
49 KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC,KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
50
51 /* Keymap _COLEMAK: Base Layer
52 * ,-----------------------------------------------------------. ,---.
53 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| |PgU|
54 * |-----------------------------------------------------------| |---|
55 * |HpTab| Q| W| F| P| G| J| L| U| Y| ;| [| ]| BS| |PgD|
56 * |-----------------------------------------------------------| `---'
57 * |CtlEsc| A| R| S| T| D| H| N| E| I| O| '| | Ent|
58 * |--------------------------------------------------------------.
59 * |Shift| | Z| X| C| V| B| K| M| ,| .| /|Shift| Fn| Up|
60 * |------------------------------------------------------------------.
61 * |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt|
62 * `------------------------------------------------------------------'
63 */
64[_COLEMAK] = KEYMAP(
65 F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PGUP, \
66 HPR_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_BSPC, KC_PGDN, \
67 CTL_ESC, 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, \
68 KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, MO(_FL), KC_UP, \
69 KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC,KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
70
71 /* Keymap _DVORAK: Base Layer
72 * ,-----------------------------------------------------------. ,---.
73 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `| |PgU|
74 * |-----------------------------------------------------------| |---|
75 * |HpTab| '| ,| .| P| Y| F| G| C| R| L| /| =| BS| |PgD|
76 * |-----------------------------------------------------------| `---'
77 * |CtlEsc| A| O| E| U| I| D| H| T| N| S| -| | Ent|
78 * |--------------------------------------------------------------.
79 * |Shift| | ;| Q| J| K| X| B| M| W| V| Z|Shift| Fn| Up|
80 * |------------------------------------------------------------------.
81 * |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt|
82 * `------------------------------------------------------------------'
83 */
84[_DVORAK] = KEYMAP(
85 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_BSLS, KC_GRV, KC_PGUP, \
86 HPR_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_BSPC, KC_PGDN, \
87 CTL_ESC, 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, \
88 KC_LSFT, XXXXXXX, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, MO(_FL), KC_UP, \
89 KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC,KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
90
91 /* Keymap _FL: Function Layer
92 */
93[_FL] = KEYMAP(
94 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, _______, _______, BL_STEP, \
95 _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, KC_DEL, _______, \
96 _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
97 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), KC_PGUP, \
98 _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
99
100 /* Keymap _CL: Control layer
101 */
102[_CL] = KEYMAP(
103 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
104 _______, _______, _______,_______,RESET, _______,_______,QWERTY, COLEMAK,DVORAK, _______, _______, _______, _______, RGB_VAD, \
105 _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
106 MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
107 _______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
108};
109
110/* This is a list of user defined functions. F(N) corresponds to item N
111 of this list.
112 */
113const uint16_t PROGMEM fn_actions[] = {
114 [0] = ACTION_FUNCTION(0), // Calls action_function()
115};
116
117void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
118 static uint8_t mods_pressed;
119 static bool mod_flag;
120
121 switch (id) {
122 case 0:
123 /* Handle the combined Grave/Esc key
124 */
125 mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
126
127 if (record->event.pressed) {
128 /* The key is being pressed.
129 */
130 if (mods_pressed) {
131 mod_flag = true;
132 add_key(KC_GRV);
133 send_keyboard_report();
134 } else {
135 add_key(KC_ESC);
136 send_keyboard_report();
137 }
138 } else {
139 /* The key is being released.
140 */
141 if (mod_flag) {
142 mod_flag = false;
143 del_key(KC_GRV);
144 send_keyboard_report();
145 } else {
146 del_key(KC_ESC);
147 send_keyboard_report();
148 }
149 }
150 break;
151 }
152}
153
154void persistant_default_layer_set(uint16_t default_layer) {
155 eeconfig_update_default_layer(default_layer);
156 default_layer_set(default_layer);
157}
158
159bool process_record_user(uint16_t keycode, keyrecord_t *record) {
160 switch (keycode) {
161 case QWERTY:
162 if (record->event.pressed) {
163 persistant_default_layer_set(1UL<<_QWERTY);
164 }
165 return false;
166 break;
167 case COLEMAK:
168 if (record->event.pressed) {
169 persistant_default_layer_set(1UL<<_COLEMAK);
170 }
171 return false;
172 break;
173 case DVORAK:
174 if (record->event.pressed) {
175 persistant_default_layer_set(1UL<<_DVORAK);
176 }
177 return false;
178 break;
179 }
180 return true;
181} \ No newline at end of file
diff --git a/keyboards/clueboard/keymaps/smt/layout.png b/keyboards/clueboard/keymaps/smt/layout.png
new file mode 100644
index 000000000..6c27277a9
--- /dev/null
+++ b/keyboards/clueboard/keymaps/smt/layout.png
Binary files differ
diff --git a/keyboards/clueboard/keymaps/smt/readme.md b/keyboards/clueboard/keymaps/smt/readme.md
new file mode 100644
index 000000000..6a8b3edb4
--- /dev/null
+++ b/keyboards/clueboard/keymaps/smt/readme.md
@@ -0,0 +1,30 @@
1```
2 ___ _____ _ _ _ __ __ _ __
3|__ \ / ____| | | | | | / / / /(_) / /
4 ||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
5 |/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
6 |_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
7 (_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
8```
9
10# smt Clueboard Layout (HHKB variant)
11
12![Clueboard Layout Image](layout.png)
13
14This is smt's HHKB variant layout, based on the default layout that comes
15flashed on every Clueboard. The primary differences from the default are:
16
17- The Backspace key is moved down into the traditional `\` position
18- `\` and `` ` `` are assigned to the "split-backspace" positions
19- The right Shift is split to allow for a Fn key to its right
20- The modifiers on the right side now mirror the left side (`Alt`/`Super`/`Ctrl`)
21
22For the most part, it's a straightforward and easy to follow layout. There
23are a few special keys:
24
25- The Esc key sends `Esc` when tapped, `` ` `` when `Alt`/`Super`/`Ctrl`/`Fn` is held, or `~` when `Shift` is held
26- The Tab key sends `Tab` when tapped, or `Super+Ctrl+Alt+Shift` (a.k.a. [Hyper]) when held
27- The key traditionally in the Caps-Lock position has been re-mapped to send `Esc` when tapped, or `Ctrl` when held
28- The left Shift key sends `Enter` when tapped, or `Shift` when held
29
30[Hyper]: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
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 a3347de45..aa17c3e8d 100644
--- a/keyboards/ergodox/ez/config.h
+++ b/keyboards/ergodox/ez/config.h
@@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
58#define RGBW 1 58#define RGBW 1
59 59
60/* Set 0 if debouncing isn't needed */ 60/* Set 0 if debouncing isn't needed */
61#define DEBOUNCE 5 61#define DEBOUNCE 15
62 62
63#define USB_MAX_POWER_CONSUMPTION 500 63#define USB_MAX_POWER_CONSUMPTION 500
64 64
diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c
index 43f515259..21b60a542 100644
--- a/keyboards/ergodox/ez/matrix.c
+++ b/keyboards/ergodox/ez/matrix.c
@@ -53,11 +53,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
53#ifndef DEBOUNCE 53#ifndef DEBOUNCE
54# define DEBOUNCE 5 54# define DEBOUNCE 5
55#endif 55#endif
56static uint8_t debouncing = DEBOUNCE;
57 56
58/* matrix state(1:on, 0:off) */ 57/* matrix state(1:on, 0:off) */
59static matrix_row_t matrix[MATRIX_ROWS]; 58static matrix_row_t matrix[MATRIX_ROWS];
60static matrix_row_t matrix_debouncing[MATRIX_ROWS]; 59
60// Debouncing: store for each key the number of scans until it's eligible to
61// change. When scanning the matrix, ignore any changes in keys that have
62// already changed in the last DEBOUNCE scans.
63static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS];
61 64
62static matrix_row_t read_cols(uint8_t row); 65static matrix_row_t read_cols(uint8_t row);
63static void init_cols(void); 66static void init_cols(void);
@@ -113,7 +116,9 @@ void matrix_init(void)
113 // initialize matrix state: all keys off 116 // initialize matrix state: all keys off
114 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 117 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
115 matrix[i] = 0; 118 matrix[i] = 0;
116 matrix_debouncing[i] = 0; 119 for (uint8_t j=0; j < MATRIX_COLS; ++j) {
120 debounce_matrix[i * MATRIX_COLS + j] = 0;
121 }
117 } 122 }
118 123
119#ifdef DEBUG_MATRIX_SCAN_RATE 124#ifdef DEBUG_MATRIX_SCAN_RATE
@@ -134,14 +139,36 @@ void matrix_power_up(void) {
134 // initialize matrix state: all keys off 139 // initialize matrix state: all keys off
135 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 140 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
136 matrix[i] = 0; 141 matrix[i] = 0;
137 matrix_debouncing[i] = 0;
138 } 142 }
139 143
140#ifdef DEBUG_MATRIX_SCAN_RATE 144#ifdef DEBUG_MATRIX_SCAN_RATE
141 matrix_timer = timer_read32(); 145 matrix_timer = timer_read32();
142 matrix_scan_count = 0; 146 matrix_scan_count = 0;
143#endif 147#endif
148}
149
150// Returns a matrix_row_t whose bits are set if the corresponding key should be
151// eligible to change in this scan.
152matrix_row_t debounce_mask(uint8_t row) {
153 matrix_row_t result = 0;
154 for (uint8_t j=0; j < MATRIX_COLS; ++j) {
155 if (debounce_matrix[row * MATRIX_COLS + j]) {
156 --debounce_matrix[row * MATRIX_COLS + j];
157 } else {
158 result |= (1 << j);
159 }
160 }
161 return result;
162}
144 163
164// Report changed keys in the given row. Resets the debounce countdowns
165// corresponding to each set bit in 'change' to DEBOUNCE.
166void debounce_report(matrix_row_t change, uint8_t row) {
167 for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
168 if (change & (1 << i)) {
169 debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
170 }
171 }
145} 172}
146 173
147uint8_t matrix_scan(void) 174uint8_t matrix_scan(void)
@@ -178,26 +205,12 @@ uint8_t matrix_scan(void)
178 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 205 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
179 select_row(i); 206 select_row(i);
180 wait_us(30); // without this wait read unstable value. 207 wait_us(30); // without this wait read unstable value.
181 matrix_row_t cols = read_cols(i); 208 matrix_row_t mask = debounce_mask(i);
182 if (matrix_debouncing[i] != cols) { 209 matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
183 matrix_debouncing[i] = cols; 210 debounce_report(cols ^ matrix[i], i);
184 if (debouncing) { 211 matrix[i] = cols;
185 debug("bounce!: "); debug_hex(debouncing); debug("\n");
186 }
187 debouncing = DEBOUNCE;
188 }
189 unselect_rows();
190 }
191 212
192 if (debouncing) { 213 unselect_rows();
193 if (--debouncing) {
194 wait_us(1);
195 // this should be wait_ms(1) but has been left as-is at EZ's request
196 } else {
197 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
198 matrix[i] = matrix_debouncing[i];
199 }
200 }
201 } 214 }
202 215
203 matrix_scan_quantum(); 216 matrix_scan_quantum();
@@ -205,9 +218,8 @@ uint8_t matrix_scan(void)
205 return 1; 218 return 1;
206} 219}
207 220
208bool matrix_is_modified(void) 221bool matrix_is_modified(void) // deprecated and evidently not called.
209{ 222{
210 if (debouncing) return false;
211 return true; 223 return true;
212} 224}
213 225
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..9650ffb44 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 palSetPadModeNamed(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/matrix.c b/keyboards/ergodox/infinity/matrix.c
index 1fda90484..3364f8c90 100644
--- a/keyboards/ergodox/infinity/matrix.c
+++ b/keyboards/ergodox/infinity/matrix.c
@@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24#include "print.h" 24#include "print.h"
25#include "debug.h" 25#include "debug.h"
26#include "matrix.h" 26#include "matrix.h"
27#include "serial_link/system/serial_link.h"
27 28
28 29
29/* 30/*
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/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
index aaf75d58f..2d6f76856 100644
--- a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
+++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 * ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤ 22 * ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤
23 * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ 23 * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
24 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ 24 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
25 * │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │ 25 * │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ ALT │ CTL │
26 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ 26 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
27 * │ ↠│ ↑ │ │ ↓ │ → │ 27 * │ ↠│ ↑ │ │ ↓ │ → │
28 * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠28 * ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
@@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46 KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, 46 KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS,
47 NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, 47 NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R,
48 TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, 48 TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT,
49 NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, 49 NEO_L2_R,KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
50 KC_DOWN, KC_RGHT, 50 KC_DOWN, KC_RGHT,
51 KC_MINS, 51 KC_MINS,
52 MEH_T(KC_NO),KC_ENT,KC_SPC 52 MEH_T(KC_NO),KC_ENT,KC_SPC
@@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
63 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ 63 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
64 * │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │ 64 * │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │
65 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ 65 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
66 * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ 66 * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ ALT │ CTL │
67 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ 67 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
68 * │ ↠│ ↑ │ │ ↓ │ → │ 68 * │ ↠│ ↑ │ │ ↓ │ → │
69 * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠69 * ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
@@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y, 87 KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y,
88 DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R, 88 DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R,
89 KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT, 89 KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT,
90 MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, 90 MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
91 KC_DOWN, KC_RGHT, 91 KC_DOWN, KC_RGHT,
92 KC_MINS, 92 KC_MINS,
93 MEH_T(KC_NO),KC_ENT,KC_SPC 93 MEH_T(KC_NO),KC_ENT,KC_SPC
@@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
104 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ 104 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
105 * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ 105 * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
106 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ 106 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
107 * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ 107 * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ ALT │ CTL │
108 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ 108 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
109 * │ ↠│ ↑ │ │ ↓ │ → │ 109 * │ ↠│ ↑ │ │ ↓ │ → │
110 * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠110 * ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
@@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
127 KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, 127 KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS,
128 DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO, 128 DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO,
129 KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT, 129 KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT,
130 MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, 130 MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
131 KC_DOWN, KC_RGHT, 131 KC_DOWN, KC_RGHT,
132 KC_MINS, 132 KC_MINS,
133 MEH_T(KC_NO),KC_ENT,KC_SPC 133 MEH_T(KC_NO),KC_ENT,KC_SPC
@@ -135,13 +135,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
135 135
136/* Layer 3: F-keys, Mouse and Unicode 136/* Layer 3: F-keys, Mouse and Unicode
137 * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠137 * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────â”
138 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ 138 * │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
139 * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ 139 * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
140 * │ │ ┌ │ ┬ │ ┠│ ─ │ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ 140 * │ │ ┌ │ ┬ │ ┠│ ─ │ │ │ │ │ │ ↔ │ ↠│ → │ ↑ │ ↓ │ │
141 * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ 141 * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
142 * │ │ ├ │ ┼ │ ┤ │ ✓ │ ✕ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ 142 * │ │ ├ │ ┼ │ ┤ │ 〈 │ 〉 ├─────┤ ├─────┤ │ ✓ │ ✕ │ • │ ∶ │ │
143 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ 143 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
144 * │ │ └ │ ┴ │ ┘ │ ↔ │ ⇔ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ 144 * │ │ └ │ ┴ │ ┘ │ │ │ │ │ │ ⇔ │ ⇠│ ⇒ │ ⇑ │ ⇓ │ │
145 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ 145 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
146 * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ 146 * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
147 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ 147 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
@@ -154,23 +154,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
154 */ 154 */
155[FMU] = KEYMAP( 155[FMU] = KEYMAP(
156 // left hand 156 // left hand
157 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 157 KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
158 KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS, 158 KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS,
159 KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x2713),UC(0x2715), 159 KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x3008),UC(0x3009),
160 KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),UC(0x2194),UC(0x21D4),KC_TRNS, 160 KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),KC_TRNS, KC_TRNS, KC_TRNS,
161 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 161 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
162 KC_MS_L, KC_MS_U, 162 KC_MS_L, KC_MS_U,
163 KC_BTN1, 163 KC_BTN1,
164 KC_TRNS,KC_TRNS, KC_TRNS, 164 KC_TRNS, KC_TRNS, KC_TRNS,
165 // right hand 165 // right hand
166 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 166 KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
167 KC_TRNS, KC_TRNS,KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, 167 KC_TRNS, UC(0x2194),UC(0x2190),UC(0x2192),UC(0x2191),UC(0x2193),KC_TRNS,
168 KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, 168 KC_TRNS, UC(0x2713),UC(0x2715),UC(0x2022),UC(0x2236),KC_TRNS,
169 KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, 169 KC_TRNS, UC(0x21D4),UC(0x21D0),UC(0x21D2),UC(0x21D1),UC(0x21D3),KC_TRNS,
170 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 170 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
171 KC_MS_D, KC_MS_R, 171 KC_MS_D, KC_MS_R,
172 KC_BTN2, 172 KC_BTN2,
173 KC_TRNS, KC_TRNS,KC_TRNS 173 KC_TRNS, KC_TRNS, KC_TRNS
174 ), 174 ),
175 175
176/* Layer 4: Neo’s software layer 4 rebuilt in Hardware 176/* Layer 4: Neo’s software layer 4 rebuilt in Hardware
@@ -294,11 +294,10 @@ void unicode_input_start (void) {
294// Override method to use NEO_A instead of KC_A 294// Override method to use NEO_A instead of KC_A
295uint16_t hex_to_keycode(uint8_t hex) 295uint16_t hex_to_keycode(uint8_t hex)
296{ 296{
297 if (hex == 0x0) { 297 if(hex == 0x0) {
298 return KC_0; 298 return KC_0;
299 } else if (hex < 0xA) { 299 }
300 return KC_1 + (hex - 0x1); 300 else if(hex >= 0xA) {
301 } else {
302 switch(hex) { 301 switch(hex) {
303 case 0xA: 302 case 0xA:
304 return NEO_A; 303 return NEO_A;
@@ -316,4 +315,6 @@ uint16_t hex_to_keycode(uint8_t hex)
316 return KC_NO; 315 return KC_NO;
317 } 316 }
318 } 317 }
318
319 return KC_1 + (hex - 0x1);
319} 320}
diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/readme.md b/keyboards/ergodox/keymaps/coderkun_neo2/readme.md
index 2a4d3a535..0c9290bf0 100644
--- a/keyboards/ergodox/keymaps/coderkun_neo2/readme.md
+++ b/keyboards/ergodox/keymaps/coderkun_neo2/readme.md
@@ -4,10 +4,18 @@ The idea of this layout is to use it for [Neo2](http://www.neo-layout.org) but a
4 4
5The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course). 5The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course).
6 6
7It also features a layer for additional keys like F-keys (F1 – F12), some mouse keys and (hopefully in the near future) some useful Unicode symbols. 7It also features a layer for additional keys like F-keys (F1 – F12), some mouse keys and some useful Unicode symbols.
8 8
9 9
10## Layers 10## Build
11
12 ```
13 make clean
14 make coderkun_neo2
15 ```
16
17
18## Keymap
11 19
120. Default layer for Neo2 200. Default layer for Neo2
131. Poor man’s QWERTZ 211. Poor man’s QWERTZ
@@ -16,16 +24,106 @@ It also features a layer for additional keys like F-keys (F1 – F12), some mous
164. Neo’s software layers 4 rebuilt in hardware 244. Neo’s software layers 4 rebuilt in hardware
17 25
18 26
19## Build 27### Layer 0: Default layer for Neo2
20 28
211. Enable Unicode in Makefile 29 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────â”
30 │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
31 ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
32 │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │
33 ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
34 │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │
35 ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤
36 │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
37 └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
38 │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │
39 └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
40 │ ↠│ ↑ │ │ ↓ │ → │
41 ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
42 │ │ │ ─ │ │ ─ │ │ │
43 │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
44 │ │ │ HYP │ │ MEH │ │ │
45 └─────┴─────┴─────┘ └─────┴─────┴─────┘
22 46
23 ```
24 UNICODE_ENABLE = yes
25 ```
262. Build as usual
27 47
28 ``` 48### Layer 1: Poor man’s QWERTZ
29 make clean 49
30 make KEYMAP=coderkun_neo2 50 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────â”
31 ``` 51 │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
52 ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
53 │ C │ P │ T │ F │ K │ L │ HOM │ │ END │ B │ A │ S │ G │ V │ Y │
54 ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
55 │ Mod3 │ D │ H │ Ö │ O │ I ├─────┤ ├─────┤ U │ - │ Z │ E │ X │ Mod3 │
56 ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
57 │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │
58 └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
59 │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │
60 └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
61 │ ↠│ ↑ │ │ ↓ │ → │
62 ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
63 │ │ │ ─ │ │ ─ │ │ │
64 │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
65 │ │ │ HYP │ │ MEH │ │ │
66 └─────┴─────┴─────┘ └─────┴─────┴─────┘
67
68
69### Layer 2: Poor man’s Neo
70
71 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────â”
72 │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
73 ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
74 │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │
75 ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
76 │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │
77 ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
78 │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
79 └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
80 │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │
81 └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
82 │ ↠│ ↑ │ │ ↓ │ → │
83 ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
84 │ │ │ ─ │ │ ─ │ │ │
85 │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
86 │ │ │ HYP │ │ MEH │ │ │
87 └─────┴─────┴─────┘ └─────┴─────┴─────┘
88
89
90### Layer 3: F-keys, mouse keys und Unicode symbols
91
92 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────â”
93 │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
94 ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
95 │ │ ┌ │ ┬ │ ┠│ ─ │ │ │ │ │ │ ↔ │ ↠│ → │ ↑ │ ↓ │ │
96 ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
97 │ │ ├ │ ┼ │ ┤ │ 〈 │ 〉 ├─────┤ ├─────┤ │ ✓ │ ✕ │ • │ ∶ │ │
98 ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
99 │ │ └ │ ┴ │ ┘ │ │ │ │ │ │ ⇔ │ ⇠│ ⇒ │ ⇑ │ ⇓ │ │
100 └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
101 │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
102 └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
103 │ Ms↠│ Ms↑ │ │ Ms↓ │ Ms→ │
104 ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
105 │ │ │ MLC │ │ MRC │ │ │
106 │ │ ├─────┤ ├─────┤ │ │
107 │ │ │ │ │ │ │ │
108 └─────┴─────┴─────┘ └─────┴─────┴─────┘
109
110
111### Layer 4: Neo’s software layers 4 rebuilt in hardware
112
113 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────â”
114 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
115 ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
116 │ │ PgUp│ BSpc│ ↑ │ Del │ PgDn│ │ │ │ │ 7 │ 8 │ 9 │ + │ − │
117 ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
118 │ │ Home│ ↠│ ↓ │ → │ End ├─────┤ ├─────┤ │ 4 │ 5 │ 6 │ , │ . │
119 ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
120 │ │ Esc │ Tab │ Ins │ Ret │ Undo│ │ │ │ │ 1 │ 2 │ 3 │ │ │
121 └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
122 │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
123 └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘
124 │ │ │ │ │ │
125 ┌─────┼─────┼─────┤ ├─────┼─────┼─────â”
126 │ │ │ │ │ │ │ │
127 │ │ ├─────┤ ├─────┤ │ │
128 │ │ │ │ │ │ │ │
129 └─────┴─────┴─────┘ └─────┴─────┴─────┘
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/dvorak_programmer/keymap.c b/keyboards/ergodox/keymaps/dvorak_programmer/keymap.c
index ae4fd444d..d299d02c3 100644
--- a/keyboards/ergodox/keymaps/dvorak_programmer/keymap.c
+++ b/keyboards/ergodox/keymaps/dvorak_programmer/keymap.c
@@ -311,12 +311,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
311 break; 311 break;
312 case SWITCH_NDS: 312 case SWITCH_NDS:
313 if (record->event.pressed) { 313 if (record->event.pressed) {
314 return MACRO( D(LSFT), T(F11), U(LSFT), W(500), D(LALT), T(TAB), U(LALT), END); 314 return MACRO( D(LSFT), T(F11), U(LSFT), W(255), D(LALT), T(TAB), U(LALT), END);
315 } 315 }
316 break; 316 break;
317 case OPEN_CLOSE_PAREN: 317 case OPEN_CLOSE_PAREN:
318 if (record->event.pressed) { 318 if (record->event.pressed) {
319 return MACRO( D(LSFT), T(LPRN), T(RPRN), U(LSFT), T(LEFT), END); 319 return MACRO( D(LSFT), T(9), T(0), U(LSFT), T(LEFT), END);
320 } 320 }
321 break; 321 break;
322 case OPEN_CLOSE_BRACKET: 322 case OPEN_CLOSE_BRACKET:
@@ -326,7 +326,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
326 break; 326 break;
327 case OPEN_CLOSE_CURLY: 327 case OPEN_CLOSE_CURLY:
328 if (record->event.pressed) { 328 if (record->event.pressed) {
329 return MACRO( D(LSFT), T(LCBR), T(RCBR), U(LSFT), T(LEFT), END); 329 return MACRO( D(LSFT), T(LBRC), T(RBRC), U(LSFT), T(LEFT), END);
330 } 330 }
331 break; 331 break;
332 case OPEN_CLOSE_SINGLE_QUOTE: 332 case OPEN_CLOSE_SINGLE_QUOTE:
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/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c
index 1dfdf7e62..ac84df570 100644
--- a/keyboards/ergodox/keymaps/ordinary/keymap.c
+++ b/keyboards/ergodox/keymaps/ordinary/keymap.c
@@ -392,7 +392,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
392 392
393 case NotEq: 393 case NotEq:
394 if (record->event.pressed) { 394 if (record->event.pressed) {
395 return MACRO( I(10), D(LSFT), T(EXLM), U(LSFT), T(EQL), END ); // != 395 return MACRO( I(10), D(LSFT), T(1), U(LSFT), T(EQL), END ); // !=
396 } 396 }
397 break; 397 break;
398 398
diff --git a/keyboards/ergodox/keymaps/siroken3/default.png b/keyboards/ergodox/keymaps/siroken3/default.png
new file mode 100644
index 000000000..6575f7b5e
--- /dev/null
+++ b/keyboards/ergodox/keymaps/siroken3/default.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/siroken3/default_firmware_v1.2-2.png b/keyboards/ergodox/keymaps/siroken3/default_firmware_v1.2-2.png
new file mode 100644
index 000000000..e3c321cc0
--- /dev/null
+++ b/keyboards/ergodox/keymaps/siroken3/default_firmware_v1.2-2.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/siroken3/default_highres.png b/keyboards/ergodox/keymaps/siroken3/default_highres.png
new file mode 100644
index 000000000..7d9f045f4
--- /dev/null
+++ b/keyboards/ergodox/keymaps/siroken3/default_highres.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/siroken3/keymap.c b/keyboards/ergodox/keymaps/siroken3/keymap.c
new file mode 100644
index 000000000..258f122b4
--- /dev/null
+++ b/keyboards/ergodox/keymaps/siroken3/keymap.c
@@ -0,0 +1,187 @@
1// Netable differences vs. the default firmware for the ErgoDox EZ:
2// 1. The Cmd key is now on the right side, making Cmd+Space easier.
3// 2. The media keys work on OSX (But not on Windows).
4#include "ergodox.h"
5#include "debug.h"
6#include "action_layer.h"
7
8#define BASE 0 // default layer
9#define SYMB 1 // symbols
10#define MDIA 2 // media keys
11
12const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
13/* Keymap 0: Basic layer
14 *
15 * ,--------------------------------------------------. ,--------------------------------------------------.
16 * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
17 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
18 * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
19 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
20 * | LCtl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui |
21 * |--------+------+------+------+------+------| BkSp | | Meh |------+------+------+------+------+--------|
22 * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
23 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
24 * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
25 * `----------------------------------' `----------------------------------'
26 * ,-------------. ,---------------.
27 * | BkSp | LGui | | Alt |Ctrl/Esc|
28 * ,------|------|------| |------+--------+------.
29 * | | | Home | | PgUp | | |
30 * | Space|LANG1 |------| |------|LANG2 |Enter |
31 * | /LGui| | End | | PgDn | | |
32 * `--------------------' `----------------------'
33 */
34// If it accepts an argument (i.e, is a function), it doesn't need KC_.
35// Otherwise, it needs KC_*
36[BASE] = KEYMAP( // layer 0 : default
37 // left hand
38 KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
39 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
40 KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G,
41 KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_BSPC,
42 LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
43 KC_BSPC, KC_LGUI,
44 KC_HOME,
45 MT(MOD_LGUI, KC_SPC),KC_LANG1,KC_END,
46 // right hand
47 KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
48 TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
49 KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI,
50 MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
51 KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
52 KC_LALT, CTL_T(KC_ESC),
53 KC_PGUP,
54 KC_PGDN,KC_LANG2, KC_ENT
55 ),
56/* Keymap 1: Symbol Layer
57 *
58 * ,--------------------------------------------------. ,--------------------------------------------------.
59 * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
60 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
61 * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
62 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
63 * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
64 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
65 * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
66 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
67 * | | | | | | | | . | 0 | = | |
68 * `----------------------------------' `----------------------------------'
69 * ,-------------. ,-------------.
70 * | | | | | |
71 * ,------|------|------| |------+------+------.
72 * | | | | | | | |
73 * | | |------| |------| | |
74 * | | | | | | | |
75 * `--------------------' `--------------------'
76 */
77// SYMBOLS
78[SYMB] = KEYMAP(
79 // left hand
80 KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
81 KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
82 KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
83 KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
84 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
85 KC_TRNS,KC_TRNS,
86 KC_TRNS,
87 KC_TRNS,KC_TRNS,KC_TRNS,
88 // right hand
89 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
90 KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
91 KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
92 KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
93 KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
94 KC_TRNS, KC_TRNS,
95 KC_TRNS,
96 KC_TRNS, KC_TRNS, KC_TRNS
97),
98/* Keymap 2: Media and mouse keys
99 *
100 * ,--------------------------------------------------. ,--------------------------------------------------.
101 * | | | | | | | | | | | | | | | |
102 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
103 * | | | | MsUp | | | | | | | | | | | |
104 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
105 * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
106 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
107 * | | | | | | | | | | | | Prev | Next | | |
108 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
109 * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
110 * `----------------------------------' `----------------------------------'
111 * ,-------------. ,-------------.
112 * | | | | | |
113 * ,------|------|------| |------+------+------.
114 * | | | | | | |Brwser|
115 * | | |------| |------| |Back |
116 * | | | | | | | |
117 * `--------------------' `--------------------'
118 */
119// MEDIA AND MOUSE
120[MDIA] = KEYMAP(
121 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
122 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
123 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
124 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
125 KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
126 KC_TRNS, KC_TRNS,
127 KC_TRNS,
128 KC_TRNS, KC_TRNS, KC_TRNS,
129 // right hand
130 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
131 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
132 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
133 KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
134 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
135 KC_TRNS, KC_TRNS,
136 KC_TRNS,
137 KC_TRNS, KC_TRNS, KC_WBAK
138),
139};
140
141const uint16_t PROGMEM fn_actions[] = {
142 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
143};
144
145const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
146{
147 // MACRODOWN only works in this function
148 switch(id) {
149 case 0:
150 if (record->event.pressed) {
151 register_code(KC_RSFT);
152 } else {
153 unregister_code(KC_RSFT);
154 }
155 break;
156 }
157 return MACRO_NONE;
158};
159
160// Runs just one time when the keyboard initializes.
161void matrix_init_user(void) {
162
163};
164
165// Runs constantly in the background, in a loop.
166void matrix_scan_user(void) {
167
168 uint8_t layer = biton32(layer_state);
169
170 ergodox_board_led_off();
171 ergodox_right_led_1_off();
172 ergodox_right_led_2_off();
173 ergodox_right_led_3_off();
174 switch (layer) {
175 // TODO: Make this relevant to the ErgoDox EZ.
176 case 1:
177 ergodox_right_led_1_on();
178 break;
179 case 2:
180 ergodox_right_led_2_on();
181 break;
182 default:
183 // none
184 break;
185 }
186
187};
diff --git a/keyboards/ergodox/keymaps/siroken3/readme.md b/keyboards/ergodox/keymaps/siroken3/readme.md
new file mode 100644
index 000000000..979ce0f5b
--- /dev/null
+++ b/keyboards/ergodox/keymaps/siroken3/readme.md
@@ -0,0 +1,15 @@
1# ErgoDox EZ Default Configuration
2
3## Changelog
4
5* Dec 2016:
6 * Added LED keys
7 * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now.
8* Sep 22, 2016:
9 * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM.
10* Feb 2, 2016 (V1.1):
11 * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows).
12
13This is what we ship with out of the factory. :) The image says it all:
14
15![Default](default_firmware_v1.2-2.png)
diff --git a/keyboards/ergodox/keymaps/yoruian/keymap.c b/keyboards/ergodox/keymaps/yoruian/keymap.c
index d3635ddf3..41dfda3c6 100644
--- a/keyboards/ergodox/keymaps/yoruian/keymap.c
+++ b/keyboards/ergodox/keymaps/yoruian/keymap.c
@@ -17,7 +17,7 @@
17#include "yoruian.h" 17#include "yoruian.h"
18 18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20[0] = KEYMAP\ 20[0] = KEYMAP_YORUIAN\
21(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8, 21(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8,
22 ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q, 22 ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q,
23 LC, U, I, A, N, SCLN, M, H, T, S, C, RC, 23 LC, U, I, A, N, SCLN, M, H, T, S, C, RC,
@@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 BSPC, RALT, P2, TAB, 26 BSPC, RALT, P2, TAB,
27 NO, NO, 27 NO, NO,
28 E, LSFT, NO, NO, ENT, SPC), 28 E, LSFT, NO, NO, ENT, SPC),
29[1] = KEYMAP\ 29[1] = KEYMAP_YORUIAN\
30(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9, 30(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9,
31 TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT, 31 TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT,
32 TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE, 32 TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE,
diff --git a/keyboards/ergodox/keymaps/yoruian/yoruian.h b/keyboards/ergodox/keymaps/yoruian/yoruian.h
index 1adcb7fd3..b5aaf74b1 100644
--- a/keyboards/ergodox/keymaps/yoruian/yoruian.h
+++ b/keyboards/ergodox/keymaps/yoruian/yoruian.h
@@ -18,36 +18,32 @@
18#include "debug.h" 18#include "debug.h"
19#include "action_layer.h" 19#include "action_layer.h"
20 20
21#undef KEYMAP 21#define KEYMAP_YORUIAN( \
22#define KEYMAP\ 22 /* Spacial positions. */ \
23( \ 23 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \
24 /* Spacial positions. */ \ 24 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
25 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ 25 k20, k21, k22, k23, k24, k25, k28, k29, k2A, k2B, k2C, k2D, \
26 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ 26 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \
27 k20, k21, k22, k23, k24, k25, k28, k29, k2A, k2B, k2C, k2D, \ 27 k40, k41, k42, k43, k44, k49, k4A, k4B, k4C, k4D, \
28 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \ 28 k55, k56, k57, k58, \
29 k40, k41, k42, k43, k44, k49, k4A, k4B, k4C, k4D, \ 29 k54, k59, \
30 k55, k56, k57, k58, \ 30 k53, k52, k51, k5C, k5B, k5A) \
31 k54, k59, \ 31 KEYMAP(KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, \
32 k53, k52, k51, k5C, k5B, k5A) \ 32 KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, \
33 \ 33 KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, \
34 /* Matrix positions. */ \ 34 KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, \
35 { \ 35 KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, \
36 { KC_##k00, KC_##k10, KC_##k20, KC_##k30, KC_##k40, KC_NO }, \ 36 KC_##k55, KC_##k56, \
37 { KC_##k01, KC_##k11, KC_##k21, KC_##k31, KC_##k41, KC_##k51 }, \ 37 KC_##k54, \
38 { KC_##k02, KC_##k12, KC_##k22, KC_##k32, KC_##k42, KC_##k52 }, \ 38 KC_##k53, KC_##k52, KC_##k51, \
39 { KC_##k03, KC_##k13, KC_##k23, KC_##k33, KC_##k43, KC_##k53 }, \ 39 KC_##k07, KC_##k08, KC_##k09, KC_##k0A, KC_##k0B, KC_##k0C, KC_##k0D, \
40 { KC_##k04, KC_##k14, KC_##k24, KC_##k34, KC_##k44, KC_##k54 }, \ 40 KC_##k17, KC_##k18, KC_##k19, KC_##k1A, KC_##k1B, KC_##k1C, KC_##k1D, \
41 { KC_##k05, KC_##k15, KC_##k25, KC_##k35, KC_NO, KC_##k55 }, \ 41 KC_##k28, KC_##k29, KC_##k2A, KC_##k2B, KC_##k2C, KC_##k2D, \
42 { KC_##k06, KC_##k16, KC_NO, KC_##k36, KC_NO, KC_##k56 }, \ 42 KC_##k37, KC_##k38, KC_##k39, KC_##k3A, KC_##k3B, KC_##k3C, KC_##k3D, \
43 { KC_##k07, KC_##k17, KC_NO, KC_##k37, KC_NO, KC_##k57 }, \ 43 KC_##k49, KC_##k4A, KC_##k4B, KC_##k4C, KC_##k4D, \
44 { KC_##k08, KC_##k18, KC_##k28, KC_##k38, KC_NO, KC_##k58 }, \ 44 KC_##k57, KC_##k58, \
45 { KC_##k09, KC_##k19, KC_##k29, KC_##k39, KC_##k49, KC_##k59 }, \ 45 KC_##k59, \
46 { KC_##k0A, KC_##k1A, KC_##k2A, KC_##k3A, KC_##k4A, KC_##k5A }, \ 46 KC_##k5C, KC_##k5B, KC_##k5A)
47 { KC_##k0B, KC_##k1B, KC_##k2B, KC_##k3B, KC_##k4B, KC_##k5B }, \
48 { KC_##k0C, KC_##k1C, KC_##k2C, KC_##k3C, KC_##k4C, KC_##k5C }, \
49 { KC_##k0D, KC_##k1D, KC_##k2D, KC_##k3D, KC_##k4D, KC_NO } \
50 }
51 47
52#define KC_ES KC_ESC 48#define KC_ES KC_ESC
53#define KC_LC KC_LCTL 49#define KC_LC KC_LCTL
diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c
index 05dffdb64..cde7f63b9 100644
--- a/keyboards/frosty_flake/matrix.c
+++ b/keyboards/frosty_flake/matrix.c
@@ -115,6 +115,7 @@ inline matrix_row_t matrix_get_row(uint8_t row) {
115} 115}
116 116
117void matrix_print(void) { 117void matrix_print(void) {
118#ifndef NO_PRINT
118 print("\nr\\c ABCDEFGHIJKLMNOPQR\n"); 119 print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
119 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 120 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
120 matrix_row_t matrix_row = matrix_get_row(row); 121 matrix_row_t matrix_row = matrix_get_row(row);
@@ -125,6 +126,7 @@ void matrix_print(void) {
125 } 126 }
126 print("\n"); 127 print("\n");
127 } 128 }
129#endif
128} 130}
129 131
130uint8_t matrix_key_count(void) { 132uint8_t matrix_key_count(void) {
@@ -132,4 +134,4 @@ uint8_t matrix_key_count(void) {
132 for (uint8_t row = 0; row < MATRIX_ROWS; row++) 134 for (uint8_t row = 0; row < MATRIX_ROWS; row++)
133 count += bitpop32(matrix[row]); 135 count += bitpop32(matrix[row]);
134 return count; 136 return count;
135} \ No newline at end of file 137}
diff --git a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c b/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c
deleted file mode 100644
index 4c735a6c2..000000000
--- a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "MS-sculpt-mobile.h"
diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c
new file mode 100644
index 000000000..64982fb62
--- /dev/null
+++ b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c
@@ -0,0 +1 @@
#include "MS_sculpt_mobile.h"
diff --git a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h
index 1583dea6e..1583dea6e 100644
--- a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h
+++ b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h
diff --git a/keyboards/handwired/MS-sculpt-mobile/Makefile b/keyboards/handwired/MS_sculpt_mobile/Makefile
index bd09e5885..bd09e5885 100644
--- a/keyboards/handwired/MS-sculpt-mobile/Makefile
+++ b/keyboards/handwired/MS_sculpt_mobile/Makefile
diff --git a/keyboards/handwired/MS-sculpt-mobile/babblePaste.c b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c
index 3a9b86997..22394cc7d 100644
--- a/keyboards/handwired/MS-sculpt-mobile/babblePaste.c
+++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c
@@ -7,7 +7,8 @@ Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
7and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c 7and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c
8*/ 8*/
9 9
10#include "babblePaste.h" 10#include "../MS_sculpt_mobile/babblePaste.h"
11
11#include "action_macro.h" 12#include "action_macro.h"
12 13
13#ifdef USE_BABLPASTE 14#ifdef USE_BABLPASTE
@@ -27,7 +28,7 @@ macro_t* switch_babble_mode( uint8_t id) {
27// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 28// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15
28#define BABLM(ent, macro...) \ 29#define BABLM(ent, macro...) \
29 if ( ent == shortcut ) \ 30 if ( ent == shortcut ) \
30 { action_macro_play( MACRO(macro)); return MACRO_NONE; } 31 { action_macro_play( MACRO(macro)); return MACRO_NONE; }
31 32
32 33
33/* this function runs the appropriate babblepaste macro, given 34/* this function runs the appropriate babblepaste macro, given
@@ -456,4 +457,4 @@ const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) {
456} 457}
457 458
458 459
459#endif \ No newline at end of file 460#endif
diff --git a/keyboards/handwired/MS-sculpt-mobile/babblePaste.h b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h
index 3067c854d..cedd7d92b 100644
--- a/keyboards/handwired/MS-sculpt-mobile/babblePaste.h
+++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h
@@ -9,9 +9,9 @@ and jeebak & algernon's keymap
9*/ 9*/
10#ifndef _babblePaste_h_included__ 10#ifndef _babblePaste_h_included__
11#define _babblePaste_h_included__ 11#define _babblePaste_h_included__
12#include "../MS_sculpt_mobile/config.h"
12#include "action_layer.h" 13#include "action_layer.h"
13#include "quantum_keycodes.h" 14#include "quantum_keycodes.h"
14#include "config.h"
15 15
16#ifdef USE_BABLPASTE 16#ifdef USE_BABLPASTE
17 17
diff --git a/keyboards/handwired/MS-sculpt-mobile/babblePaste.txt b/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt
index cf75e153e..cf75e153e 100644
--- a/keyboards/handwired/MS-sculpt-mobile/babblePaste.txt
+++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt
diff --git a/keyboards/handwired/MS-sculpt-mobile/config.h b/keyboards/handwired/MS_sculpt_mobile/config.h
index f89514278..f89514278 100644
--- a/keyboards/handwired/MS-sculpt-mobile/config.h
+++ b/keyboards/handwired/MS_sculpt_mobile/config.h
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile
index 8b829218b..8b829218b 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile
diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h
new file mode 100644
index 000000000..4f3a425b7
--- /dev/null
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h
@@ -0,0 +1,8 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../../MS_sculpt_mobile/config.h"
5
6// place overrides here
7
8#endif
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c
index ab09dcdd1..a8802c99a 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c
@@ -1,4 +1,4 @@
1#include "MS-sculpt-mobile.h" 1#include "../../MS_sculpt_mobile.h"
2 2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4/* 4/*
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md
index e67ddc6fe..e67ddc6fe 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile
index 1209ad781..1209ad781 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h
index 8cf4202cd..5c04f647c 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h
@@ -1,7 +1,7 @@
1#ifndef CONFIG_USER_H 1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H 2#define CONFIG_USER_H
3 3
4#include "../../config.h" 4#include "../../../MS_sculpt_mobile/config.h"
5 5
6#define USE_BABLPASTE 6#define USE_BABLPASTE
7 7
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c
index 395a9fb47..c9a8ccdb6 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c
@@ -1,7 +1,7 @@
1#include "MS-sculpt-mobile.h" 1#include "../../../MS_sculpt_mobile/babblePaste.h"
2#include "../../MS_sculpt_mobile.h"
2#include "action_layer.h" 3#include "action_layer.h"
3#include "action_util.h" 4#include "action_util.h"
4#include "babblePaste.h"
5 5
6#ifdef AUDIO_ENABLE 6#ifdef AUDIO_ENABLE
7 #include "audio.h" 7 #include "audio.h"
diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md
index 96ee0e77a..96ee0e77a 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md
+++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md
diff --git a/keyboards/handwired/MS-sculpt-mobile/readme.md b/keyboards/handwired/MS_sculpt_mobile/readme.md
index d435b449f..d435b449f 100644
--- a/keyboards/handwired/MS-sculpt-mobile/readme.md
+++ b/keyboards/handwired/MS_sculpt_mobile/readme.md
diff --git a/keyboards/handwired/MS-sculpt-mobile/rules.mk b/keyboards/handwired/MS_sculpt_mobile/rules.mk
index 680389c84..680389c84 100644
--- a/keyboards/handwired/MS-sculpt-mobile/rules.mk
+++ b/keyboards/handwired/MS_sculpt_mobile/rules.mk
diff --git a/keyboards/handwired/atreus50/keymaps/default/keymap.c b/keyboards/handwired/atreus50/keymaps/default/keymap.c
index 415405ec2..77cf942c3 100644
--- a/keyboards/handwired/atreus50/keymaps/default/keymap.c
+++ b/keyboards/handwired/atreus50/keymaps/default/keymap.c
@@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
66 //,----+----+----+----+----+----. ,----+----+----+----+----+----. 66 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
67 TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, 67 TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS,
68 //|----+----+----+----+----+----| |----+----+----+----+----+----| 68 //|----+----+----+----+----+----| |----+----+----+----+----+----|
69 X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, 69 X0 , A , O , E , U , I , D , H , T , N , S ,SLSH,
70 //|----+----+----+----+----+----| |----+----+----+----+----+----| 70 //|----+----+----+----+----+----| |----+----+----+----+----+----|
71 LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , 71 LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 ,
72 //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| 72 //|----+----+----+----+----+----|----+----|----+----+----+----+----+----|
diff --git a/keyboards/handwired/promethium/color.h b/keyboards/handwired/promethium/color.h
new file mode 100644
index 000000000..077242d5f
--- /dev/null
+++ b/keyboards/handwired/promethium/color.h
@@ -0,0 +1,15 @@
1#define COLOR_BLANK 0, 0, 0
2
3#define COLOR_BLACK 0, 0, 0
4#define COLOR_WHITE 15,15,15
5#define COLOR_GRAY 7, 7, 7
6
7#define COLOR_RED 15, 0, 0
8#define COLOR_GREEN 0,15, 0
9#define COLOR_BLUE 0, 0,15
10
11#define COLOR_YELLOW 15,15, 0
12#define COLOR_MAGENTA 15, 0,15
13#define COLOR_CYAN 0,15,15
14
15#define COLOR_ORANGE 15, 5, 0 \ No newline at end of file
diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h
index 24f02993f..efb9ebdd7 100644
--- a/keyboards/handwired/promethium/config.h
+++ b/keyboards/handwired/promethium/config.h
@@ -35,12 +35,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
35#define DESCRIPTION 35#define DESCRIPTION
36 36
37/* key matrix size */ 37/* key matrix size */
38#define MATRIX_ROWS 8
39#define MATRIX_COLS 6 38#define MATRIX_COLS 6
39#define MATRIX_ROWS 9
40 40
41/* default pin-out */ 41/* default pin-out */
42#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 } 42#define MATRIX_COL_PINS { F4, F1, F0, D6, D0, D1 }
43#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 } 43#define MATRIX_ROW_PINS { F5, F6, F7 }
44#define TRACKPOINT_PINS { B7, B6, D7 }
44#define UNUSED_PINS 45#define UNUSED_PINS
45 46
46/* 47/*
@@ -152,17 +153,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
152//#define NO_ACTION_MACRO 153//#define NO_ACTION_MACRO
153//#define NO_ACTION_FUNCTION 154//#define NO_ACTION_FUNCTION
154 155
155#define PS2_INIT_DELAY 2000 156#define PS2_MOUSE_INIT_DELAY 2000
156#define BATTERY_PIN 9 157#define BATTERY_PIN 9
157#define BATTERY_POLL 30000 158#define BATTERY_POLL 30000
158#define MAX_VOLTAGE 4.2 159#define MAX_VOLTAGE 4.2
159#define MIN_VOLTAGE 3.2 160#define MIN_VOLTAGE 3.2
160 161
162#define ___ KC_NO
163
161#define KEYMAP( \ 164#define KEYMAP( \
162 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ 165 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
163 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ 166 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
164 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ 167 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
165 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \ 168 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
169 tp1, tp2, tp3 \
166) \ 170) \
167{ \ 171{ \
168 {k11, k12, k13, k14, k15, k16}, \ 172 {k11, k12, k13, k14, k15, k16}, \
@@ -172,25 +176,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
172 {k17, k18, k19, k1a, k1b, k1c}, \ 176 {k17, k18, k19, k1a, k1b, k1c}, \
173 {k27, k28, k29, k2a, k2b, k2c}, \ 177 {k27, k28, k29, k2a, k2b, k2c}, \
174 {k37, k38, k39, k3a, k3b, k3c}, \ 178 {k37, k38, k39, k3a, k3b, k3c}, \
175 {k47, k48, k49, k4a, k4b, k4c} \ 179 {k47, k48, k49, k4a, k4b, k4c}, \
180 {tp1, tp2, tp3, ___, ___, ___} \
176} 181}
177 182
178#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file 183#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
179enum led_sequence { 184enum led_sequence {
185 LED_IND_LINUX,
186 LED_IND_APPLE,
187 LED_IND_WINDOWS,
188 LED_IND_QWERTY,
189 LED_IND_ALT,
190 LED_IND_AUDIO,
180 LED_IND_BLUETOOTH, 191 LED_IND_BLUETOOTH,
181 LED_IND_USB, 192 LED_IND_USB,
182 LED_IND_BATTERY,
183 193
194 LED_IND_BATTERY,
195 LED_IND_CAPSLOCK,
196 LED_IND_GUI,
184 LED_IND_FUN, 197 LED_IND_FUN,
185 LED_IND_NUM, 198 LED_IND_NUM,
199 LED_IND_PUNC,
186 LED_IND_EMOJI, 200 LED_IND_EMOJI,
201 LED_IND_GREEK,
187 202
188 LED_BKSP, 203 LED_BKSP,
189 LED_ENT, 204 LED_ENT,
190 LED_RSFT, 205 LED_RSFT,
191 LED_RCTL, 206 LED_RCTL,
192 207
193 LED_RGUI, 208 LED_RALT,
194 LED_SLSH, 209 LED_SLSH,
195 LED_SCLN, 210 LED_SCLN,
196 LED_P, 211 LED_P,
@@ -198,9 +213,9 @@ enum led_sequence {
198 LED_O, 213 LED_O,
199 LED_L, 214 LED_L,
200 LED_DOT, 215 LED_DOT,
201 LED_RALT, 216 LED_RGUI,
202 217
203 LED_EMOJI, 218 LED_GREEK,
204 LED_COMM, 219 LED_COMM,
205 LED_K, 220 LED_K,
206 LED_I, 221 LED_I,
@@ -219,35 +234,35 @@ enum led_sequence {
219 LED_TRACKPOINT2, 234 LED_TRACKPOINT2,
220 LED_TRACKPOINT1, 235 LED_TRACKPOINT1,
221 236
222 LED_LSPC,
223 LED_B,
224 LED_G,
225 LED_T, 237 LED_T,
238 LED_G,
239 LED_B,
240 LED_LSPC,
226 241
227 LED_R,
228 LED_F,
229 LED_V,
230 LED_NUM, 242 LED_NUM,
243 LED_V,
244 LED_F,
245 LED_R,
231 246
232 LED_PUNC,
233 LED_C,
234 LED_D,
235 LED_E, 247 LED_E,
248 LED_D,
249 LED_C,
250 LED_EMPTY,
236 251
237 LED_W, 252 LED_LGUI,
238 LED_S,
239 LED_X, 253 LED_X,
240 LED_LALT, 254 LED_S,
255 LED_W,
241 256
242 LED_LGUI,
243 LED_Z,
244 LED_A,
245 LED_Q, 257 LED_Q,
258 LED_A,
259 LED_Z,
260 LED_LALT,
246 261
247 LED_TAB,
248 LED_ESC,
249 LED_LSFT,
250 LED_LCTL, 262 LED_LCTL,
263 LED_LSFT,
264 LED_ESC,
265 LED_TAB,
251 266
252 LED_TOTAL 267 LED_TOTAL
253}; 268};
@@ -261,7 +276,7 @@ enum led_sequence {
261# define PS2_CLOCK_PORT PORTD 276# define PS2_CLOCK_PORT PORTD
262# define PS2_CLOCK_PIN PIND 277# define PS2_CLOCK_PIN PIND
263# define PS2_CLOCK_DDR DDRD 278# define PS2_CLOCK_DDR DDRD
264# define PS2_CLOCK_BIT 1 279# define PS2_CLOCK_BIT 3
265# define PS2_DATA_PORT PORTD 280# define PS2_DATA_PORT PORTD
266# define PS2_DATA_PIN PIND 281# define PS2_DATA_PIN PIND
267# define PS2_DATA_DDR DDRD 282# define PS2_DATA_DDR DDRD
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/Makefile b/keyboards/handwired/promethium/keymaps/priyadi/Makefile
index 46fdfa011..bd1a06734 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/Makefile
+++ b/keyboards/handwired/promethium/keymaps/priyadi/Makefile
@@ -19,6 +19,8 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
19RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 19RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
20PS2_MOUSE_ENABLE = yes 20PS2_MOUSE_ENABLE = yes
21PS2_USE_INT = yes 21PS2_USE_INT = yes
22FAUXCLICKY_ENABLE = yes
23BLUETOOTH = AdafruitBLE
22 24
23# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 25# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
24SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 26SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/README.md b/keyboards/handwired/promethium/keymaps/priyadi/README.md
index ddeaed939..48824b9f7 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/README.md
+++ b/keyboards/handwired/promethium/keymaps/priyadi/README.md
@@ -37,8 +37,8 @@ On Promethium, USB or Bluetooth output is detected on startup. If USB is connect
37 37
38SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively. 38SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively.
39 39
40On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases. 40SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
41 41
42On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes. 42On Promethium there are 16 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 67 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
43 43
44On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. \ No newline at end of file 44On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h
index 3f5dd5817..fa86e2247 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/config.h
+++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h
@@ -14,6 +14,7 @@
14#define PREVENT_STUCK_MODIFIERS 14#define PREVENT_STUCK_MODIFIERS
15 15
16#define RGBSPS_ENABLE 16#define RGBSPS_ENABLE
17#define RGBSPS_DEMO_ENABLE
17 18
18#define UNICODE_TYPE_DELAY 0 19#define UNICODE_TYPE_DELAY 0
19 20
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
index cf7c67339..d562c7bbf 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
+++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
@@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
31#include "quantum.h" 31#include "quantum.h"
32#ifdef RGBSPS_ENABLE 32#ifdef RGBSPS_ENABLE
33#include "rgbsps.h" 33#include "rgbsps.h"
34#include "rgbtheme.h"
34#endif 35#endif
35#ifdef PS2_MOUSE_ENABLE 36#ifdef PS2_MOUSE_ENABLE
36#include "ps2_mouse.h" 37#include "ps2_mouse.h"
@@ -38,6 +39,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
38#endif 39#endif
39#ifdef FAUXCLICKY_ENABLE 40#ifdef FAUXCLICKY_ENABLE
40#include "fauxclicky.h" 41#include "fauxclicky.h"
42#ifdef RGBSPS_ENABLE
43#undef FAUXCLICKY_OFF
44#define FAUXCLICKY_OFF do { \
45 fauxclicky_enabled = false; \
46 rgbsps_set(LED_AUDIO, COLOR_BLANK); \
47 fauxclicky_stop(); \
48} while (0)
49#undef FAUXCLICKY_ON
50#define FAUXCLICKY_ON do { \
51 fauxclicky_enabled = true; \
52 rgbsps_set(LED_AUDIO, THEME_COLOR_AUDIO); \
53} while (0)
54#endif
41#endif 55#endif
42#include "outputselect.h" 56#include "outputselect.h"
43#include "led.h" 57#include "led.h"
@@ -128,9 +142,10 @@ enum planck_keycodes {
128#ifndef FAUXCLICKY_ENABLE 142#ifndef FAUXCLICKY_ENABLE
129 FC_TOG, 143 FC_TOG,
130#endif 144#endif
131#ifndef ADAFRUIT_BLE_ENABLE 145#ifndef MODULE_ADAFRUIT_BLE
132 OUT_BLE, 146 OUT_BT,
133#endif 147#endif
148 RGBDEMO,
134 KEYCODE_END 149 KEYCODE_END
135}; 150};
136 151
@@ -421,19 +436,30 @@ const uint8_t PROGMEM LED_MODS[] = {
421}; 436};
422 437
423const uint8_t PROGMEM LED_FN[] = { 438const uint8_t PROGMEM LED_FN[] = {
424 LED_PUNC, 439 LED_EMPTY,
425 LED_NUM, 440 LED_NUM,
426 LED_FUN, 441 LED_FUN,
427 LED_EMOJI 442 LED_GREEK
428}; 443};
429 444
430const uint8_t PROGMEM LED_INDICATORS[] = { 445const uint8_t PROGMEM LED_INDICATORS[] = {
431 LED_IND_EMOJI, 446 LED_IND_LINUX,
432 LED_IND_NUM, 447 LED_IND_APPLE,
433 LED_IND_FUN, 448 LED_IND_WINDOWS,
434 LED_IND_BATTERY, 449 LED_IND_QWERTY,
435 LED_IND_USB, 450 LED_IND_ALT,
451 LED_IND_AUDIO,
436 LED_IND_BLUETOOTH, 452 LED_IND_BLUETOOTH,
453 LED_IND_USB,
454
455 LED_IND_BATTERY,
456 LED_IND_CAPSLOCK,
457 LED_IND_GUI,
458 LED_IND_FUN,
459 LED_IND_NUM,
460 LED_IND_PUNC,
461 LED_IND_EMOJI,
462 LED_IND_GREEK,
437}; 463};
438 464
439const uint8_t PROGMEM LED_TRACKPOINT[] = { 465const uint8_t PROGMEM LED_TRACKPOINT[] = {
@@ -444,16 +470,37 @@ const uint8_t PROGMEM LED_TRACKPOINT[] = {
444 470
445void led_turnoff_keys(void) { 471void led_turnoff_keys(void) {
446 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { 472 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
447 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); 473 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), COLOR_BLACK);
448 } 474 }
449 for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { 475 for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
450 rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 0, 0); 476 rgbsps_set(pgm_read_byte(&LED_MODS[i]), COLOR_BLACK);
451 } 477 }
452 for(uint8_t i = 0; i < COUNT(LED_FN); i++) { 478 for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
453 rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 0); 479 rgbsps_set(pgm_read_byte(&LED_FN[i]), COLOR_BLACK);
454 } 480 }
455} 481}
456 482
483#ifdef RGBSPS_DEMO_ENABLE
484void led_demo(void) {
485 rgbsps_set(LED_IND_LINUX, THEME_COLOR_LINUX);
486 rgbsps_set(LED_IND_APPLE, THEME_COLOR_APPLE);
487 rgbsps_set(LED_IND_WINDOWS, THEME_COLOR_WINDOWS);
488 rgbsps_set(LED_IND_QWERTY, THEME_COLOR_QWERTY);
489 rgbsps_set(LED_IND_ALT, THEME_COLOR_ALT);
490 rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
491 rgbsps_set(LED_IND_BLUETOOTH, THEME_COLOR_BLUETOOTH);
492 rgbsps_set(LED_IND_USB, THEME_COLOR_USB);
493 rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
494 rgbsps_set(LED_IND_GUI, THEME_COLOR_GUI);
495 rgbsps_set(LED_IND_FUN, THEME_COLOR_FUN);
496 rgbsps_set(LED_IND_NUM, THEME_COLOR_NUM);
497 rgbsps_set(LED_IND_PUNC, THEME_COLOR_PUNC);
498 rgbsps_set(LED_IND_GREEK, THEME_COLOR_GREEK);
499 rgbsps_set(LED_IND_EMOJI, THEME_COLOR_EMOJI);
500 rgbsps_send();
501}
502#endif
503
457void led_reset(void) { 504void led_reset(void) {
458 switch (glow_mode) { 505 switch (glow_mode) {
459 case GLOW_NONE: 506 case GLOW_NONE:
@@ -462,39 +509,55 @@ void led_reset(void) {
462 case GLOW_MIN: 509 case GLOW_MIN:
463 led_turnoff_keys(); 510 led_turnoff_keys();
464 for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { 511 for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) {
465 rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 8, 8, 8); 512 rgbsps_set(pgm_read_byte(&LED_HOMING[i]), THEME_COLOR_GLOW1_HOME);
466 } 513 }
467 rgbsps_set(LED_F, 15, 0, 0); 514 rgbsps_set(LED_F, THEME_COLOR_GLOW1_HOMING);
468 rgbsps_set(LED_J, 15, 0, 0); 515 rgbsps_set(LED_J, THEME_COLOR_GLOW1_HOMING);
469 break; 516 break;
470 case GLOW_FULL: 517 case GLOW_FULL:
471 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { 518 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
472 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 8, 8, 8); 519 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), THEME_COLOR_GLOW2_ALPHA);
473 } 520 }
474 for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { 521 for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
475 rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 15, 0); 522 rgbsps_set(pgm_read_byte(&LED_MODS[i]), THEME_COLOR_GLOW2_MODS);
476 } 523 }
477 for(uint8_t i = 0; i < COUNT(LED_FN); i++) { 524 for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
478 rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 15); 525 rgbsps_set(pgm_read_byte(&LED_FN[i]), THEME_COLOR_GLOW2_FN);
479 } 526 }
480 for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { 527 for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) {
481 rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 15, 0, 0); 528 rgbsps_set(pgm_read_byte(&LED_HOMING[i]), THEME_COLOR_GLOW2_HOME);
482 } 529 }
483 rgbsps_set(LED_F, 15, 15, 0); 530 rgbsps_set(LED_F, THEME_COLOR_GLOW2_HOMING);
484 rgbsps_set(LED_J, 15, 15, 0); 531 rgbsps_set(LED_J, THEME_COLOR_GLOW2_HOMING);
485 break; 532 break;
486 } 533 }
487} 534}
488 535
536void led_set_default_layer_indicator(void) {
537 uint8_t default_layer = biton32(default_layer_state);
538 if (default_layer == _QWERTY) {
539 rgbsps_set(LED_IND_QWERTY, THEME_COLOR_QWERTY);
540 rgbsps_set(LED_IND_ALT, COLOR_BLANK);
541 } else {
542 rgbsps_set(LED_IND_QWERTY, COLOR_BLANK);
543 rgbsps_set(LED_IND_ALT, THEME_COLOR_ALT);
544 }
545 rgbsps_send();
546 return;
547}
548
489void led_set_layer_indicator(void) { 549void led_set_layer_indicator(void) {
490 static uint8_t oldlayer = 255; 550 static uint8_t oldlayer = 255;
491 551
492 rgbsps_set(LED_IND_FUN, 0, 0, 0);
493 // rgbsps_set(LED_IND_NUM, 0, 0, 0);
494 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
495
496 led_reset(); 552 led_reset();
497 553
554 rgbsps_set(LED_IND_GUI, COLOR_BLANK);
555 rgbsps_set(LED_IND_FUN, COLOR_BLANK);
556 rgbsps_set(LED_IND_NUM, COLOR_BLANK);
557 rgbsps_set(LED_IND_PUNC, COLOR_BLANK);
558 rgbsps_set(LED_IND_GREEK, COLOR_BLANK);
559 rgbsps_set(LED_IND_EMOJI, COLOR_BLANK);
560
498 uint8_t layer = biton32(layer_state); 561 uint8_t layer = biton32(layer_state);
499 if (oldlayer == layer) { 562 if (oldlayer == layer) {
500 return; 563 return;
@@ -508,39 +571,72 @@ void led_set_layer_indicator(void) {
508 } 571 }
509 572
510 switch(layer) { 573 switch(layer) {
574 case _GUI:
575 rgbsps_set(LED_IND_GUI, THEME_COLOR_GUI);
576 break;
511 case _FUN: 577 case _FUN:
512 rgbsps_set(LED_IND_FUN, 15, 0, 0); 578 rgbsps_set(LED_IND_FUN, THEME_COLOR_FUN);
579 break;
580 case _NUM:
581 rgbsps_set(LED_IND_NUM, THEME_COLOR_NUM);
582 break;
583 case _PUNC:
584 rgbsps_set(LED_IND_PUNC, THEME_COLOR_PUNC);
585 break;
586 case _GREEKL:
587 case _GREEKU:
588 rgbsps_set(LED_IND_GREEK, THEME_COLOR_GREEK);
513 break; 589 break;
514 // case _NUM:
515 // rgbsps_set(LED_IND_NUM, 0, 0, 15);
516 // break;
517 case _EMOJI: 590 case _EMOJI:
518 rgbsps_set(LED_IND_EMOJI, 15, 15, 0); 591 rgbsps_set(LED_IND_EMOJI, THEME_COLOR_EMOJI);
519 break; 592 break;
520 default: 593 default:
521 rgbsps_set(LED_IND_FUN, 3, 3, 3); 594 rgbsps_set(LED_IND_GUI, THEME_COLOR_OTHERLAYER);
522 // rgbsps_set(LED_IND_NUM, 3, 3, 3); 595 rgbsps_set(LED_IND_FUN, THEME_COLOR_OTHERLAYER);
523 rgbsps_set(LED_IND_EMOJI, 3, 3, 3); 596 rgbsps_set(LED_IND_NUM, THEME_COLOR_OTHERLAYER);
597 rgbsps_set(LED_IND_PUNC, THEME_COLOR_OTHERLAYER);
598 rgbsps_set(LED_IND_GREEK, THEME_COLOR_OTHERLAYER);
599 rgbsps_set(LED_IND_EMOJI, THEME_COLOR_OTHERLAYER);
524 } 600 }
525 601
526 rgbsps_send(); 602 rgbsps_send();
527} 603}
528 604
605void led_set_unicode_input_mode(void) {
606 rgbsps_set(LED_IND_LINUX, COLOR_BLANK);
607 rgbsps_set(LED_IND_APPLE, COLOR_BLANK);
608 rgbsps_set(LED_IND_WINDOWS, COLOR_BLANK);
609
610 switch (get_unicode_input_mode()) {
611 case UC_LNX:
612 rgbsps_set(LED_IND_LINUX, THEME_COLOR_LINUX);
613 break;
614 case UC_OSX:
615 rgbsps_set(LED_IND_APPLE, THEME_COLOR_APPLE);
616 break;
617 case UC_WIN:
618 case UC_WINC:
619 rgbsps_set(LED_IND_WINDOWS, THEME_COLOR_WINDOWS);
620 break;
621 }
622 rgbsps_send();
623}
624
529void led_set_output_ble(void) { 625void led_set_output_ble(void) {
530 rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); 626 rgbsps_set(LED_IND_BLUETOOTH, THEME_COLOR_BLUETOOTH);
531 rgbsps_set(LED_IND_USB, 0, 0, 0); 627 rgbsps_set(LED_IND_USB, COLOR_BLANK);
532 rgbsps_send(); 628 rgbsps_send();
533} 629}
534 630
535void led_set_output_usb(void) { 631void led_set_output_usb(void) {
536 rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); 632 rgbsps_set(LED_IND_BLUETOOTH, COLOR_BLANK);
537 rgbsps_set(LED_IND_USB, 15, 15, 15); 633 rgbsps_set(LED_IND_USB, THEME_COLOR_USB);
538 rgbsps_send(); 634 rgbsps_send();
539} 635}
540 636
541void led_set_output_none(void) { 637void led_set_output_none(void) {
542 rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); 638 rgbsps_set(LED_IND_BLUETOOTH, COLOR_BLANK);
543 rgbsps_set(LED_IND_USB, 0, 0, 0); 639 rgbsps_set(LED_IND_USB, COLOR_BLANK);
544 rgbsps_send(); 640 rgbsps_send();
545} 641}
546 642
@@ -549,10 +645,30 @@ void led_init(void) {
549 rgbsps_turnoff(); 645 rgbsps_turnoff();
550 646
551 // set trackpoint color 647 // set trackpoint color
552 rgbsps_set(LED_TRACKPOINT1, 15, 0, 0); 648 rgbsps_set(LED_TRACKPOINT1, THEME_COLOR_TP1);
553 rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); 649 rgbsps_set(LED_TRACKPOINT2, THEME_COLOR_TP2);
554 rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); 650 rgbsps_set(LED_TRACKPOINT3, THEME_COLOR_TP3);
651
652 // unicode input mode
653 led_set_unicode_input_mode();
654
655 // layer indicator
656 led_set_layer_indicator();
657 led_set_default_layer_indicator();
658
659 // clicky
660#ifdef FAUXCLICKY_ENABLE
661 if (fauxclicky_enabled) {
662 rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
663 } else {
664 rgbsps_set(LED_IND_AUDIO, COLOR_BLANK);
665 }
666#endif
667
668 rgbsps_send();
555} 669}
670
671
556#endif // RGBSPS_ENABLE 672#endif // RGBSPS_ENABLE
557 673
558// keymaps 674// keymaps
@@ -574,7 +690,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
574 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 690 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
575 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , 691 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT ,
576 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, 692 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
577 KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL 693 KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL,
694 _______, _______, _______
578), 695),
579 696
580/* Dvorak 697/* Dvorak
@@ -593,7 +710,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
593 _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, 710 _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______,
594 _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, 711 _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______,
595 _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, 712 _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______,
596 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 713 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
714 _______, _______, _______
597), 715),
598#endif 716#endif
599 717
@@ -614,7 +732,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
614 _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, 732 _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______,
615 _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, 733 _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______,
616 _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, 734 _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
617 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 735 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
736 _______, _______, _______
618), 737),
619#endif 738#endif
620 739
@@ -635,7 +754,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
635 _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, 754 _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______,
636 _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, 755 _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______,
637 _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, 756 _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
638 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 757 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
758 _______, _______, _______
639), 759),
640#endif 760#endif
641 761
@@ -656,7 +776,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
656 _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, 776 _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______,
657 _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, 777 _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______,
658 _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, 778 _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______,
659 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 779 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
780 _______, _______, _______
660), 781),
661#endif 782#endif
662 783
@@ -675,7 +796,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
675 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, 796 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______,
676 KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, 797 KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______,
677 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, 798 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______,
678 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______ 799 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______,
800 _______, _______, _______
679), 801),
680 802
681/* Num 803/* Num
@@ -690,10 +812,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
690 * `-----------------------------------------------------------------------------------' 812 * `-----------------------------------------------------------------------------------'
691 */ 813 */
692[_NUM] = KEYMAP( 814[_NUM] = KEYMAP(
693 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______, 815 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______,
694 KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, 816 KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
695 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), _______, 817 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______,
696 _______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______ 818 _______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______,
819 _______, _______, _______
697), 820),
698 821
699/* Func 822/* Func
@@ -711,7 +834,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
711 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, 834 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
712 KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, 835 KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______,
713 _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, 836 _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
714 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 837 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
838 _______, _______, _______
715), 839),
716 840
717/* Uppercase Greek 841/* Uppercase Greek
@@ -729,7 +853,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
729 _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, 853 _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
730 _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, 854 _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______,
731 _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, 855 _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______,
732 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 856 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
857 _______, _______, _______
733), 858),
734 859
735/* Lowercase Greek 860/* Lowercase Greek
@@ -747,7 +872,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
747 _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, 872 _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
748 _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, 873 _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______,
749 _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, 874 _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______,
750 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 875 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
876 _______, _______, _______
751), 877),
752 878
753/* Empty 879/* Empty
@@ -765,7 +891,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
765 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 891 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
766 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 892 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
767 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 893 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
768 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 894 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
895 _______, _______, _______
769), 896),
770 897
771/* Emoji 898/* Emoji
@@ -783,7 +910,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
783 X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), 910 X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
784 X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), 911 X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
785 X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), 912 X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
786 X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK) 913 X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK),
914 _______, _______, _______
787), 915),
788 916
789/* GUI 917/* GUI
@@ -801,7 +929,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
801 XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, 929 XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX,
802 KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, 930 KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
803 XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, 931 XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
804 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX 932 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
933 _______, _______, _______
805), 934),
806 935
807/* Sys 936/* Sys
@@ -816,10 +945,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
816 * `-----------------------------------------------------------------------------------' 945 * `-----------------------------------------------------------------------------------'
817 */ 946 */
818[_SYS] = KEYMAP( 947[_SYS] = KEYMAP(
819 XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 948 DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO,
820 XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, 949 XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
821 XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 950 XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
822 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ 951 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
952 _______, _______, _______
823), 953),
824 954
825 955
@@ -828,6 +958,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
828void persistant_default_layer_set(uint16_t default_layer) { 958void persistant_default_layer_set(uint16_t default_layer) {
829 eeconfig_update_default_layer(default_layer); 959 eeconfig_update_default_layer(default_layer);
830 default_layer_set(default_layer); 960 default_layer_set(default_layer);
961#ifdef RGBSPS_ENABLE
962 led_set_default_layer_indicator();
963#endif
831} 964}
832 965
833#ifdef DOUBLESPACE_LAYER_ENABLE 966#ifdef DOUBLESPACE_LAYER_ENABLE
@@ -1072,14 +1205,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
1072 // OS switchers 1205 // OS switchers
1073 case LINUX: 1206 case LINUX:
1074 set_unicode_input_mode(UC_LNX); 1207 set_unicode_input_mode(UC_LNX);
1208#ifdef RGBSPS_ENABLE
1209 led_set_unicode_input_mode();
1210#endif
1075 return false; 1211 return false;
1076 break; 1212 break;
1077 case WIN: 1213 case WIN:
1078 set_unicode_input_mode(UC_WINC); 1214 set_unicode_input_mode(UC_WINC);
1215#ifdef RGBSPS_ENABLE
1216 led_set_unicode_input_mode();
1217#endif
1079 return false; 1218 return false;
1080 break; 1219 break;
1081 case OSX: 1220 case OSX:
1082 set_unicode_input_mode(UC_OSX); 1221 set_unicode_input_mode(UC_OSX);
1222#ifdef RGBSPS_ENABLE
1223 led_set_unicode_input_mode();
1224#endif
1083 return false; 1225 return false;
1084 break; 1226 break;
1085 1227
@@ -1101,20 +1243,35 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
1101 // faux clicky indicator 1243 // faux clicky indicator
1102#ifdef FAUXCLICKY_ENABLE 1244#ifdef FAUXCLICKY_ENABLE
1103 case FC_TOG: 1245 case FC_TOG:
1246#ifdef RGBSPS_ENABLE
1247 if (fauxclicky_enabled) {
1248 rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
1249 } else {
1250 rgbsps_set(LED_IND_AUDIO, COLOR_BLANK);
1251 }
1252 rgbsps_send();
1253#endif
1104 return true; 1254 return true;
1105 break; 1255 break;
1106#endif 1256#endif
1257
1258#ifdef RGBSPS_DEMO_ENABLE
1259 case RGBDEMO:
1260 led_demo();
1261 return false;
1262 break;
1263#endif
1107 } 1264 }
1108 return true; 1265 return true;
1109} 1266}
1110 1267
1111void set_output_user(uint8_t output) { 1268void set_output_user(uint8_t output) {
1112#ifdef ADAFRUIT_BLE_ENABLE 1269#ifdef MODULE_ADAFRUIT_BLE
1113 switch(output) { 1270 switch(output) {
1114 case OUTPUT_USB: 1271 case OUTPUT_USB:
1115 led_set_output_usb(); 1272 led_set_output_usb();
1116 break; 1273 break;
1117 case OUTPUT_ADAFRUIT_BLE: 1274 case OUTPUT_BLUETOOTH:
1118 led_set_output_ble(); 1275 led_set_output_ble();
1119 break; 1276 break;
1120 default: 1277 default:
@@ -1133,12 +1290,12 @@ void matrix_init_user() {
1133#endif 1290#endif
1134 1291
1135 // auto detect output on init 1292 // auto detect output on init
1136#ifdef ADAFRUIT_BLE_ENABLE 1293#ifdef MODULE_ADAFRUIT_BLE
1137 uint8_t output = auto_detect_output(); 1294 uint8_t output = auto_detect_output();
1138 if (output == OUTPUT_USB) { 1295 if (output == OUTPUT_USB) {
1139 set_output(OUTPUT_USB); 1296 set_output(OUTPUT_USB);
1140 } else { 1297 } else {
1141 set_output(OUTPUT_ADAFRUIT_BLE); 1298 set_output(OUTPUT_BLUETOOTH);
1142 } 1299 }
1143#endif 1300#endif
1144} 1301}
@@ -1164,9 +1321,9 @@ void turn_off_capslock() {
1164 bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK); 1321 bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
1165 if (new_capslock ^ capslock) { // capslock state is different 1322 if (new_capslock ^ capslock) { // capslock state is different
1166 if ((capslock = new_capslock)) { 1323 if ((capslock = new_capslock)) {
1167 rgbsps_set(LED_IND_NUM, 15, 0, 0); 1324 rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
1168 } else { 1325 } else {
1169 rgbsps_set(LED_IND_NUM, 0, 0, 0); 1326 rgbsps_set(LED_IND_CAPSLOCK, COLOR_BLANK);
1170 } 1327 }
1171 rgbsps_send(); 1328 rgbsps_send();
1172 } 1329 }
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme.h b/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme.h
new file mode 100644
index 000000000..e60971035
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme.h
@@ -0,0 +1 @@
#include "rgbtheme_default.h"
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_carbon.h b/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_carbon.h
new file mode 100644
index 000000000..8e0a98b09
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_carbon.h
@@ -0,0 +1,36 @@
1#include "color.h"
2
3#define THEME_COLOR_LINUX COLOR_WHITE
4#define THEME_COLOR_APPLE COLOR_WHITE
5#define THEME_COLOR_WINDOWS COLOR_WHITE
6
7#define THEME_COLOR_QWERTY COLOR_RED
8#define THEME_COLOR_ALT COLOR_RED
9
10#define THEME_COLOR_AUDIO COLOR_GREEN
11
12#define THEME_COLOR_BLUETOOTH 7,7,15
13#define THEME_COLOR_USB COLOR_WHITE
14
15#define THEME_COLOR_CAPSLOCK COLOR_RED
16
17#define THEME_COLOR_GUI COLOR_MAGENTA
18#define THEME_COLOR_FUN COLOR_RED
19#define THEME_COLOR_NUM 7,7,15
20#define THEME_COLOR_PUNC COLOR_GREEN
21#define THEME_COLOR_GREEK COLOR_CYAN
22#define THEME_COLOR_EMOJI COLOR_YELLOW
23#define THEME_COLOR_OTHERLAYER COLOR_GRAY
24
25#define THEME_COLOR_GLOW1_HOME COLOR_ORANGE
26#define THEME_COLOR_GLOW1_HOMING COLOR_RED
27
28#define THEME_COLOR_GLOW2_ALPHA COLOR_ORANGE
29#define THEME_COLOR_GLOW2_MODS COLOR_ORANGE
30#define THEME_COLOR_GLOW2_FN COLOR_ORANGE
31#define THEME_COLOR_GLOW2_HOME COLOR_ORANGE
32#define THEME_COLOR_GLOW2_HOMING COLOR_RED
33
34#define THEME_COLOR_TP1 COLOR_ORANGE
35#define THEME_COLOR_TP2 COLOR_RED
36#define THEME_COLOR_TP3 COLOR_ORANGE \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_default.h b/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_default.h
new file mode 100644
index 000000000..4c3fb1369
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/rgbtheme_default.h
@@ -0,0 +1,36 @@
1#include "color.h"
2
3#define THEME_COLOR_LINUX COLOR_WHITE
4#define THEME_COLOR_APPLE COLOR_WHITE
5#define THEME_COLOR_WINDOWS COLOR_WHITE
6
7#define THEME_COLOR_QWERTY COLOR_RED
8#define THEME_COLOR_ALT COLOR_RED
9
10#define THEME_COLOR_AUDIO COLOR_GREEN
11
12#define THEME_COLOR_BLUETOOTH COLOR_BLUE
13#define THEME_COLOR_USB COLOR_WHITE
14
15#define THEME_COLOR_CAPSLOCK COLOR_RED
16
17#define THEME_COLOR_GUI COLOR_MAGENTA
18#define THEME_COLOR_FUN COLOR_RED
19#define THEME_COLOR_NUM COLOR_BLUE
20#define THEME_COLOR_PUNC COLOR_GREEN
21#define THEME_COLOR_GREEK COLOR_CYAN
22#define THEME_COLOR_EMOJI COLOR_YELLOW
23#define THEME_COLOR_OTHERLAYER COLOR_GRAY
24
25#define THEME_COLOR_GLOW1_HOME COLOR_GRAY
26#define THEME_COLOR_GLOW1_HOMING COLOR_RED
27
28#define THEME_COLOR_GLOW2_ALPHA COLOR_GRAY
29#define THEME_COLOR_GLOW2_MODS COLOR_GREEN
30#define THEME_COLOR_GLOW2_FN COLOR_BLUE
31#define THEME_COLOR_GLOW2_HOME COLOR_RED
32#define THEME_COLOR_GLOW2_HOMING COLOR_YELLOW
33
34#define THEME_COLOR_TP1 COLOR_RED
35#define THEME_COLOR_TP2 COLOR_BLUE
36#define THEME_COLOR_TP3 COLOR_RED \ No newline at end of file
diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c
new file mode 100644
index 000000000..72dbe8d4d
--- /dev/null
+++ b/keyboards/handwired/promethium/matrix.c
@@ -0,0 +1,306 @@
1/*
2Copyright 2012 Jun Wako
3Copyright 2014 Jack Humbert
4Copyright 2017 Priyadi Iman Nurcahyo
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include <stdint.h>
20#include <stdbool.h>
21#if defined(__AVR__)
22#include <avr/io.h>
23#endif
24#include "wait.h"
25#include "print.h"
26#include "debug.h"
27#include "util.h"
28#include "matrix.h"
29#include "timer.h"
30
31
32/* Set 0 if debouncing isn't needed */
33
34#ifndef DEBOUNCING_DELAY
35# define DEBOUNCING_DELAY 5
36#endif
37
38#if (DEBOUNCING_DELAY > 0)
39 static uint16_t debouncing_time;
40 static bool debouncing = false;
41#endif
42
43#if (MATRIX_COLS <= 8)
44# define print_matrix_header() print("\nr/c 01234567\n")
45# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
46# define matrix_bitpop(i) bitpop(matrix[i])
47# define ROW_SHIFTER ((uint8_t)1)
48#elif (MATRIX_COLS <= 16)
49# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
50# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
51# define matrix_bitpop(i) bitpop16(matrix[i])
52# define ROW_SHIFTER ((uint16_t)1)
53#elif (MATRIX_COLS <= 32)
54# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
55# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
56# define matrix_bitpop(i) bitpop32(matrix[i])
57# define ROW_SHIFTER ((uint32_t)1)
58#endif
59
60#ifdef MATRIX_MASKED
61 extern const matrix_row_t matrix_mask[];
62#endif
63
64static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
65static const uint8_t tp_pins[3] = TRACKPOINT_PINS;
66
67/* matrix state(1:on, 0:off) */
68static matrix_row_t matrix[MATRIX_ROWS];
69static matrix_row_t matrix_debouncing[MATRIX_ROWS];
70
71static void init_cols(void);
72static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
73static void unselect_rows(void);
74static void select_row(uint8_t row);
75static void unselect_row(uint8_t row);
76
77__attribute__ ((weak))
78void matrix_init_quantum(void) {
79 matrix_init_kb();
80}
81
82__attribute__ ((weak))
83void matrix_scan_quantum(void) {
84 matrix_scan_kb();
85}
86
87__attribute__ ((weak))
88void matrix_init_kb(void) {
89 matrix_init_user();
90}
91
92__attribute__ ((weak))
93void matrix_scan_kb(void) {
94 matrix_scan_user();
95}
96
97__attribute__ ((weak))
98void matrix_init_user(void) {
99}
100
101__attribute__ ((weak))
102void matrix_scan_user(void) {
103}
104
105inline
106uint8_t matrix_rows(void) {
107 return MATRIX_ROWS;
108}
109
110inline
111uint8_t matrix_cols(void) {
112 return MATRIX_COLS;
113}
114
115void matrix_init(void) {
116
117 // To use PORTF disable JTAG with writing JTD bit twice within four cycles.
118 #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
119 MCUCR |= _BV(JTD);
120 MCUCR |= _BV(JTD);
121 #endif
122
123 // initialize row and col
124 unselect_rows();
125 init_cols();
126
127 // initialize matrix state: all keys off
128 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
129 matrix[i] = 0;
130 matrix_debouncing[i] = 0;
131 }
132
133 matrix_init_quantum();
134}
135
136uint8_t matrix_scan(void)
137{
138 // Set row, read cols
139 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
140# if (DEBOUNCING_DELAY > 0)
141 bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
142
143 if (matrix_changed) {
144 debouncing = true;
145 debouncing_time = timer_read();
146 }
147
148# else
149 read_cols_on_row(matrix, current_row);
150# endif
151
152 }
153
154# if (DEBOUNCING_DELAY > 0)
155 if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
156 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
157 matrix[i] = matrix_debouncing[i];
158 }
159 debouncing = false;
160 }
161# endif
162
163 matrix_scan_quantum();
164 return 1;
165}
166
167bool matrix_is_modified(void)
168{
169#if (DEBOUNCING_DELAY > 0)
170 if (debouncing) return false;
171#endif
172 return true;
173}
174
175inline
176bool matrix_is_on(uint8_t row, uint8_t col)
177
178{
179 return (matrix[row] & ((matrix_row_t)1<col));
180}
181
182inline
183matrix_row_t matrix_get_row(uint8_t row)
184{
185 // Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
186 // switch blocker installed and the switch is always pressed.
187#ifdef MATRIX_MASKED
188 return matrix[row] & matrix_mask[row];
189#else
190 return matrix[row];
191#endif
192}
193
194void matrix_print(void)
195{
196 print_matrix_header();
197
198 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
199 phex(row); print(": ");
200 print_matrix_row(row);
201 print("\n");
202 }
203}
204
205uint8_t matrix_key_count(void)
206{
207 uint8_t count = 0;
208 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
209 count += matrix_bitpop(i);
210 }
211 return count;
212}
213
214
215#define ROW_MASK 0b11100000
216
217static const uint8_t row_bit[MATRIX_ROWS] = {
218 // 76543210
219 0b00000000,
220 0b00100000,
221 0b01000000,
222 0b01100000,
223 0b10000000,
224 0b10100000,
225 0b11000000,
226 0b11100000,
227};
228
229static void init_cols(void)
230{
231 // columns
232 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
233 uint8_t pin = col_pins[x];
234 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
235 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
236 }
237
238 // rows
239 DDRF |= ROW_MASK;
240 PORTF &= ~ROW_MASK;
241
242 // trackpoint
243 for(uint8_t x = 0; x < 3; x++) {
244 uint8_t pin = tp_pins[x];
245 _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
246 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
247 }
248}
249
250static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
251 {
252 // Store last value of row prior to reading
253 matrix_row_t last_row_value = current_matrix[current_row];
254
255 // Clear data in matrix row
256 current_matrix[current_row] = 0;
257
258 // special case for trackpoint
259 if (current_row == 8) {
260 for(uint8_t tp_index = 0; tp_index < 3; tp_index++) {
261
262 // Select the TP pin to read (active low)
263 uint8_t pin = tp_pins[tp_index];
264 uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
265
266 // Populate the matrix row with the state of the col pin
267 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << tp_index);
268 }
269 return (last_row_value != current_matrix[current_row]);
270 }
271
272 // Select row and wait for row selecton to stabilize
273 select_row(current_row);
274 _delay_us(5); // without this wait it won't read stable value.
275 // wait_us(50);
276
277 // For each col...
278 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
279
280 // Select the col pin to read (active low)
281 uint8_t pin = col_pins[col_index];
282 uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
283
284 // Populate the matrix row with the state of the col pin
285 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
286 }
287
288 // Unselect row
289 unselect_row(current_row);
290
291 return (last_row_value != current_matrix[current_row]);
292}
293
294static void select_row(uint8_t row)
295{
296 PORTF = row_bit[row] | (PORTF & ~ROW_MASK);
297}
298
299static void unselect_row(uint8_t row)
300{
301}
302
303static void unselect_rows(void)
304{
305}
306
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c
index 4943f8c9f..3cc0f5a8c 100644
--- a/keyboards/handwired/promethium/promethium.c
+++ b/keyboards/handwired/promethium/promethium.c
@@ -2,6 +2,11 @@
2#include "analog.h" 2#include "analog.h"
3#include "timer.h" 3#include "timer.h"
4#include "matrix.h" 4#include "matrix.h"
5#include "musical_notes.h"
6
7float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625);
8float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625);
9float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25);
5 10
6// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} 11// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100}
7 12
diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk
index e75cf4dde..a6dd43b85 100644
--- a/keyboards/handwired/promethium/rules.mk
+++ b/keyboards/handwired/promethium/rules.mk
@@ -65,12 +65,14 @@ BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
65RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 65RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
66PS2_MOUSE_ENABLE ?= yes 66PS2_MOUSE_ENABLE ?= yes
67PS2_USE_INT ?= yes 67PS2_USE_INT ?= yes
68ADAFRUIT_BLE_ENABLE ?= yes
69API_SYSEX_ENABLE ?= no 68API_SYSEX_ENABLE ?= no
69CUSTOM_MATRIX ?= yes
70BLUETOOTH ?= AdafruitBLE
70 71
71# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 72# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
72SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 73SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
73 74
74SRC += $(QUANTUM_DIR)/light_ws2812.c 75SRC += $(QUANTUM_DIR)/light_ws2812.c
75SRC += rgbsps.c 76SRC += rgbsps.c
76SRC += $(QUANTUM_DIR)/analog.c \ No newline at end of file 77SRC += $(QUANTUM_DIR)/analog.c
78SRC += matrix.c
diff --git a/keyboards/hhkb/keymaps/cinaeco/Makefile b/keyboards/hhkb/keymaps/cinaeco/Makefile
new file mode 100644
index 000000000..05b724051
--- /dev/null
+++ b/keyboards/hhkb/keymaps/cinaeco/Makefile
@@ -0,0 +1,23 @@
1# cinaeco's HHKB firmware
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
20
21ifndef QUANTUM_DIR
22 include ../../../../Makefile
23endif
diff --git a/keyboards/hhkb/keymaps/cinaeco/README.md b/keyboards/hhkb/keymaps/cinaeco/README.md
new file mode 100644
index 000000000..c1c48e609
--- /dev/null
+++ b/keyboards/hhkb/keymaps/cinaeco/README.md
@@ -0,0 +1,23 @@
1# QMK Keyboard Firmware for HHKB
2
3## Modifications
4
5### HHKB Fn Layer
6
7Added some Media keys.
8
9### Utility Layer (SpaceFN)
10
11Hold `Space` for:
12
13- Vi-style direction keys.
14- WASD-style mouse keys.
15- Dynamic macro playback on `1` and `2`.
16- Qwerty/Colemak/Dvorak layout selection on `-`, `=` and `\ `
17
18### Dynamic Macros
19
20Hold `q` and press:
21
22- `1` or `2` to record macro 1 or 2.
23- `s` to stop recording.
diff --git a/keyboards/hhkb/keymaps/cinaeco/config.h b/keyboards/hhkb/keymaps/cinaeco/config.h
new file mode 100644
index 000000000..c7b4c784c
--- /dev/null
+++ b/keyboards/hhkb/keymaps/cinaeco/config.h
@@ -0,0 +1,20 @@
1#ifndef CONFIG_CINAECO_H
2#define CONFIG_CINAECO_H
3
4#include "../../config.h"
5
6#undef MANUFACTURER
7#undef PRODUCT
8#undef DESCRIPTION
9#define MANUFACTURER QMK
10#define PRODUCT HHKB QMK cinaeco
11#define DESCRIPTION HHKB on QMK Firmware with cinaeco keymap
12
13// Increase "Tap" detection window. Avoid missing 'q' or 'z' when typing slowly.
14#undef TAPPING_TERM
15#define TAPPING_TERM 230
16
17// Uncomment to enable NKRO by default. May cause issues with KVM switches.
18//#define FORCE_NKRO
19
20#endif
diff --git a/keyboards/hhkb/keymaps/cinaeco/keymap.c b/keyboards/hhkb/keymaps/cinaeco/keymap.c
new file mode 100644
index 000000000..0b204600d
--- /dev/null
+++ b/keyboards/hhkb/keymaps/cinaeco/keymap.c
@@ -0,0 +1,186 @@
1/* -*- eval: (turn-on-orgtbl); -*-
2 * cinaeco's HHKB Layout
3 */
4#include "hhkb.h"
5
6// Layers.
7#define QWER 0
8#define COLE 1
9#define DVOR 2
10#define HHKB 3
11#define UTIL 4
12#define MREC 5
13
14// Easier-to-read Layer Arrays.
15#define ____ KC_TRNS
16
17enum hhkb_keycodes {
18 DYNAMIC_MACRO_RANGE = SAFE_RANGE,
19};
20
21#include "dynamic_macro.h"
22
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24
25
26 /* QWER Layer: Qwerty Default
27 *
28 * ,--------------------------------------------------------------.
29 * |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
30 * |--------------------------------------------------------------|
31 * |Tab |Q/MREC| W| E| R| T| Y| U| I| O| P| [| ]|Backs|
32 * |--------------------------------------------------------------|
33 * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ent/Ctrl|
34 * |--------------------------------------------------------------|
35 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
36 * `--------------------------------------------------------------'
37 * |Alt|Gui | Space/UTIL |Gui |Alt|
38 * `-------------------------------------------'
39 *
40 */
41
42 [QWER] = KEYMAP(
43 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, \
44 KC_TAB, LT(MREC, 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, \
45 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, CTL_T(KC_ENT), \
46 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
47 KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
48
49
50 /* COLE Layer: Colemak
51 *
52 * ,--------------------------------------------------------------.
53 * |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
54 * |--------------------------------------------------------------|
55 * |Tab |Q/MREC| W| F| P| G| J| L| U| Y| ;| [| ]|Backs|
56 * |--------------------------------------------------------------|
57 * |Ctrl | A| R| S| T| D| H| N| E| I| O| '|Ent/Ctrl|
58 * |--------------------------------------------------------------|
59 * |Shift | Z| X| C| V| K| B| M| ,| .| /|Shift |Fn0|
60 * `--------------------------------------------------------------'
61 * |Alt|Gui | Space/UTIL |Gui |Alt|
62 * `-------------------------------------------'
63 *
64 */
65
66 [COLE] = KEYMAP(
67 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, \
68 KC_TAB, LT(MREC, 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_BSPC, \
69 KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, CTL_T(KC_ENT), \
70 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_K, KC_B, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
71 KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
72
73
74 /* DVOR Layer: Dvorak
75 *
76 * ,--------------------------------------------------------------.
77 * |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `|
78 * |--------------------------------------------------------------|
79 * |Tab |'/MREC| ,| .| P| Y| F| G| C| R| L| /| =|Backs|
80 * |--------------------------------------------------------------|
81 * |Ctrl | A| O| E| U| I| D| H| T| N| S| -|Ent/Ctrl|
82 * |--------------------------------------------------------------|
83 * |Shift | ;| Q| J| K| X| B| M| W| V| Z|Shift |Fn0|
84 * `--------------------------------------------------------------'
85 * |Alt|Gui | Space/UTIL |Gui |Alt|
86 * `-------------------------------------------'
87 *
88 */
89
90 [DVOR] = KEYMAP(
91 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_BSLS, KC_GRV, \
92 KC_TAB, LT(MREC, 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_BSPC, \
93 KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, CTL_T(KC_ENT), \
94 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(HHKB), \
95 KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
96
97
98 /* HHKB Layer: HHKB mode (HHKB Fn)
99 *
100 * ,-----------------------------------------------------------.
101 * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
102 * |-----------------------------------------------------------|
103 * |Caps |PLA|PRV|NXT| | | | |Psc|Slk|Pus|Up | |Backs|
104 * |-----------------------------------------------------------|
105 * | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter |
106 * |-----------------------------------------------------------|
107 * | | | | | | | +| -|End|PgD|Dow| | |
108 * `-----------------------------------------------------------'
109 * | | | |STOP | |
110 * `-------------------------------------------'
111 */
112
113 [HHKB] = KEYMAP(
114 KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
115 KC_CAPS, KC_MPLY, KC_MPRV, KC_MNXT, ____, ____, ____, ____, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ____, KC_BSPC, \
116 ____, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, ____, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
117 ____, ____, ____, ____, ____, ____, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ____, ____, \
118 ____, ____, ____, KC_MSTP, ____),
119
120
121 /* UTIL Layer: Extra utilities
122 *
123 * ,-------------------------------------------------------------.
124 * |DFU|PLY1|PLY2| | | | | | | | |QWE|COL|DVO|DBG|
125 * |-------------------------------------------------------------|
126 * | |MLB |M-Up|MRB|MwU| |Hom|PgD|PgU|End| | | | |
127 * |-------------------------------------------------------------|
128 * | |M-Lt|M-Dn|M-R|MwD| |LEF|DOW|UP |RIG| | | |
129 * |-------------------------------------------------------------|
130 * | | | | | |SPC| | | | | | | |
131 * `-------------------------------------------------------------'
132 * | | | | | |
133 * `-------------------------------------------'
134 *
135 */
136
137 [UTIL] = KEYMAP(
138 RESET, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, ____, ____, ____, ____, ____, ____, ____, ____, DF(QWER), DF(COLE), DF(DVOR), DEBUG, \
139 ____, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, ____, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ____, ____, ____, ____, \
140 ____, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ____, ____, ____, \
141 ____, ____, ____, ____, ____, KC_SPC, ____, ____, ____, ____, ____, ____, ____, \
142 ____, ____, ____, ____, ____),
143
144
145 /* MREC Layer: Record macros with `q`
146 *
147 * ,-------------------------------------------------------------.
148 * | |REC1|REC2| | | | | | | | | | | | |
149 * |-------------------------------------------------------------|
150 * | | | | | | | | | | | | | | |
151 * |-------------------------------------------------------------|
152 * | | |RSTP| | | | | | | | | | |
153 * |-------------------------------------------------------------|
154 * | | | | | | | | | | | | | |
155 * `-------------------------------------------------------------'
156 * | | | | | |
157 * `-------------------------------------------'
158 *
159 */
160
161 [MREC] = KEYMAP(
162 ____, DYN_REC_START1, DYN_REC_START2, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
163 ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
164 ____, ____, DYN_REC_STOP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
165 ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
166 ____, ____, ____, ____, ____)
167
168};
169
170
171
172const uint16_t PROGMEM fn_actions[] = {
173
174};
175
176const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
177 return MACRO_NONE;
178};
179
180// For Dynamic Macros.
181bool process_record_user(uint16_t keycode, keyrecord_t *record) {
182 if (!process_record_dynamic_macro(keycode, record)) {
183 return false;
184 }
185 return true;
186}
diff --git a/keyboards/hhkb/keymaps/smt/keymap.c b/keyboards/hhkb/keymaps/smt/keymap.c
new file mode 100644
index 000000000..a7ea54de8
--- /dev/null
+++ b/keyboards/hhkb/keymaps/smt/keymap.c
@@ -0,0 +1,176 @@
1/* -*- eval: (turn-on-orgtbl); -*-
2 * default HHKB Layout
3 */
4#include "hhkb.h"
5
6#define _QWERTY 0
7#define _COLEMAK 1
8#define _DVORAK 2
9#define _HHKB 3
10
11enum planck_keycodes {
12 QWERTY = SAFE_RANGE,
13 COLEMAK,
14 DVORAK,
15 HHKB
16};
17
18// Fillers to make layering more clear
19#define _______ KC_TRNS
20#define XXXXXXX KC_NO
21
22// Custom macros
23#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
24#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
25#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift)
26#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift)
27
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29
30 /* Layer QWERTY: Qwerty Layer
31 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
32 | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
33 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
34 | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
35 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
36 | Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
37 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
38 | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn | | |
39 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
40
41 |------+------+-----------------------+------+------|
42 | LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
43 |------+------+-----------------------+------+------|
44 */
45
46 [_QWERTY] = KEYMAP( // Qwerty layer
47 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, MEH_GRV, \
48 HPR_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, \
49 CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, SFT_ENT, \
50 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
51 KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
52
53
54
55 /* Layer COLEMAK: Colemak Layer
56 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
57 | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
58 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
59 | Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | Backs | |
60 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
61 | Cont | A | R | S | T | D | H | N | E | I | O | ' | Ent | | |
62 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
63 | Shift | Z | X | C | V | B | K | M | , | . | / | Shift | Fn | | |
64 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
65
66 |------+------+-----------------------+------+------|
67 | LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
68 |------+------+-----------------------+------+------|
69 */
70
71 [_COLEMAK] = KEYMAP( // Colemak layer
72 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, MEH_GRV, \
73 HPR_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_BSPC, \
74 CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, SFT_ENT, \
75 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
76 KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
77
78
79
80 /* Layer DVORAK: Dvorak Layer
81 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
82 | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ` |
83 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
84 | Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | Backs | |
85 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
86 | Cont | A | O | E | U | I | D | H | T | N | S | - | Ent | | |
87 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
88 | Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn | | |
89 |-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
90
91 |------+------+-----------------------+------+------|
92 | LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
93 |------+------+-----------------------+------+------|
94 */
95
96 [_DVORAK] = KEYMAP( // Dvorak layer
97 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_BSLS, MEH_GRV, \
98 HPR_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_BSPC, \
99 CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, SFT_ENT, \
100 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(_HHKB), \
101 KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
102
103
104
105 /* Layer HHKB: HHKB mode (HHKB Fn)
106 |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
107 | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
108 |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
109 | Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
110 |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
111 | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
112 |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
113 | | | Qwt | Cmk | Dvk | | + | - | End | PgD | Dow | | | | |
114 |------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
115
116 |------+------+----------------------+------+------+
117 | **** | **** | ******************** | **** | **** |
118 |------+------+----------------------+------+------+
119
120 */
121
122 [_HHKB] = KEYMAP(
123 KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
124 KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \
125 _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
126 _______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
127 _______, _______, _______, _______, _______)};
128
129
130const uint16_t PROGMEM fn_actions[] = {
131
132};
133
134const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
135{
136 // MACRODOWN only works in this function
137 switch(id) {
138 case 0:
139 if (record->event.pressed) {
140 register_code(KC_RSFT);
141 } else {
142 unregister_code(KC_RSFT);
143 }
144 break;
145 }
146 return MACRO_NONE;
147};
148
149void persistant_default_layer_set(uint16_t default_layer) {
150 eeconfig_update_default_layer(default_layer);
151 default_layer_set(default_layer);
152}
153
154bool process_record_user(uint16_t keycode, keyrecord_t *record) {
155 switch (keycode) {
156 case QWERTY:
157 if (record->event.pressed) {
158 persistant_default_layer_set(1UL<<_QWERTY);
159 }
160 return false;
161 break;
162 case COLEMAK:
163 if (record->event.pressed) {
164 persistant_default_layer_set(1UL<<_COLEMAK);
165 }
166 return false;
167 break;
168 case DVORAK:
169 if (record->event.pressed) {
170 persistant_default_layer_set(1UL<<_DVORAK);
171 }
172 return false;
173 break;
174 }
175 return true;
176}
diff --git a/keyboards/hhkb/rules.mk b/keyboards/hhkb/rules.mk
index a46271f02..e4190039f 100644
--- a/keyboards/hhkb/rules.mk
+++ b/keyboards/hhkb/rules.mk
@@ -53,7 +53,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
53#OPT_DEFS += -DBOOTLOADER_SIZE=4096 53#OPT_DEFS += -DBOOTLOADER_SIZE=4096
54 54
55# as per original hasu settings 55# as per original hasu settings
56OPT_DEFS += -DBOOTLOADER_SIZE=512 56OPT_DEFS += -DBOOTLOADER_SIZE=4096
57 57
58# Build Options 58# Build Options
59# comment out to disable the options. 59# comment out to disable the options.
diff --git a/keyboards/kitten_paw/keymaps/ickerwx/config.h b/keyboards/kitten_paw/keymaps/ickerwx/config.h
index 04a2d253c..142aba890 100644
--- a/keyboards/kitten_paw/keymaps/ickerwx/config.h
+++ b/keyboards/kitten_paw/keymaps/ickerwx/config.h
@@ -22,7 +22,7 @@
22#undef MOUSEKEY_WHEEL_MAX_SPEED 22#undef MOUSEKEY_WHEEL_MAX_SPEED
23#define MOUSEKEY_WHEEL_MAX_SPEED 3 23#define MOUSEKEY_WHEEL_MAX_SPEED 3
24#undef MOUSEKEY_WHEEL_TIME_TO_MAX 24#undef MOUSEKEY_WHEEL_TIME_TO_MAX
25#define MOUSEKEY_WHEEL_TIME_TO_MAX 1000 25#define MOUSEKEY_WHEEL_TIME_TO_MAX 255
26#undef ONESHOT_TIMEOUT 26#undef ONESHOT_TIMEOUT
27#define ONESHOT_TIMEOUT 500 27#define ONESHOT_TIMEOUT 500
28#undef TAPPING_TOGGLE 28#undef TAPPING_TOGGLE
diff --git a/keyboards/kitten_paw/keymaps/ickerwx/keymap.c b/keyboards/kitten_paw/keymaps/ickerwx/keymap.c
index 9a00c80dc..9dffbb272 100644
--- a/keyboards/kitten_paw/keymaps/ickerwx/keymap.c
+++ b/keyboards/kitten_paw/keymaps/ickerwx/keymap.c
@@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
64 _______,S(NUBS),_______,_______,_______,_______,_______,_______,_______,KC_NUBS,S(NUBS),S(MINS), _______, _______, _______,_______,_______,_______, \ 64 _______,S(NUBS),_______,_______,_______,_______,_______,_______,_______,KC_NUBS,S(NUBS),S(MINS), _______, _______, _______,_______,_______,_______, \
65 _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), 65 _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______),
66 /* Layer 3: media layer */ 66 /* Layer 3: media layer */
67 [MEDIA] = KEYMAP(\ 67 [MEDIA] = KEYMAP(\
68 KC_PWR,KC_SLEP,KC_WAKE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \ 68 KC_PWR,KC_SLEP,KC_WAKE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \
69 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_MPRV,KC_MPLY,KC_MNXT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ 69 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_MPRV,KC_MPLY,KC_MNXT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \
70 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_VOLD,KC_MUTE,KC_VOLU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ 70 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_VOLD,KC_MUTE,KC_VOLU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \
diff --git a/keyboards/mitosis/Makefile b/keyboards/mitosis/Makefile
new file mode 100644
index 000000000..4e2a6f00f
--- /dev/null
+++ b/keyboards/mitosis/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/mitosis/config.h b/keyboards/mitosis/config.h
new file mode 100644
index 000000000..cb6378ab4
--- /dev/null
+++ b/keyboards/mitosis/config.h
@@ -0,0 +1,87 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24
25#define VENDOR_ID 0xFEED
26#define PRODUCT_ID 0x6060
27#define DEVICE_VER 0x0001
28#define MANUFACTURER unknown
29#define PRODUCT Mitosis
30#define DESCRIPTION q.m.k. keyboard firmware for Mitosis
31
32/* key matrix size */
33#define MATRIX_ROWS 5
34#define MATRIX_COLS 10
35
36/* define if matrix has ghost */
37//#define MATRIX_HAS_GHOST
38
39/* number of backlight levels */
40//#define BACKLIGHT_LEVELS 3
41
42#define ONESHOT_TIMEOUT 500
43
44
45/* key combination for command */
46#define IS_COMMAND() ( \
47 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
48)
49
50/*
51 * Feature disable options
52 * These options are also useful to firmware size reduction.
53 */
54
55#define PREVENT_STUCK_MODIFIERS
56
57/* disable debug print */
58//#define NO_DEBUG
59
60/* disable print */
61//#define NO_PRINT
62
63/* disable action features */
64//#define NO_ACTION_LAYER
65//#define NO_ACTION_TAPPING
66//#define NO_ACTION_ONESHOT
67//#define NO_ACTION_MACRO
68//#define NO_ACTION_FUNCTION
69
70//UART settings for communication with the RF microcontroller
71#define SERIAL_UART_BAUD 1000000
72#define SERIAL_UART_DATA UDR1
73#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
74#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
75#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
76#define SERIAL_UART_INIT() do { \
77 /* baud rate */ \
78 UBRR1L = SERIAL_UART_UBRR; \
79 /* baud rate */ \
80 UBRR1H = SERIAL_UART_UBRR >> 8; \
81 /* enable TX and RX */ \
82 UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
83 /* 8-bit data */ \
84 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
85 } while(0)
86
87#endif
diff --git a/keyboards/mitosis/keymaps/default/keymap.c b/keyboards/mitosis/keymaps/default/keymap.c
new file mode 100644
index 000000000..320d33db6
--- /dev/null
+++ b/keyboards/mitosis/keymaps/default/keymap.c
@@ -0,0 +1,221 @@
1// this is the style you want to emulate.
2// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
3
4#include "mitosis.h"
5
6// Each layer gets a name for readability, which is then used in the keymap matrix below.
7// The underscores don't mean anything - you can have a layer called STUFF or any other name.
8// Layer names don't all need to be of the same length, obviously, and you can also skip them
9// entirely and just use numbers.
10enum mitosis_layers
11{
12 _MALT,
13 _SHIFTED,
14 _FUNCTION,
15 _FUNCSHIFT
16};
17
18enum mitosis_keycodes
19{
20 FNKEY = SAFE_RANGE,
21 SHIFT
22};
23
24
25// Macro definitions for readability
26enum mitosis_macros
27{
28 VOLU,
29 VOLD,
30 ESCM
31};
32
33#define LONGPRESS_DELAY 150
34#define LAYER_TOGGLE_DELAY 300
35
36// Fillers to make layering more clear
37#define _______ KC_TRNS
38#define XXXXXXX KC_NO
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41[_MALT] = { /* Malt Layout, customised for reduced columns (ex: quote and shift locations) */
42 {KC_Q, KC_P, KC_Y, KC_C, KC_B, KC_V, KC_M, KC_U, KC_Z, KC_L },
43 {KC_A, KC_N, KC_I, KC_S, KC_F, KC_D, KC_T, KC_H, KC_O, KC_R },
44 {KC_COMM, KC_DOT, KC_J, KC_G, KC_SLSH, KC_SCLN, KC_W, KC_K, KC_QUOT, KC_X },
45 {XXXXXXX, M(VOLU), M(ESCM), KC_TAB, KC_LCTL, KC_LALT, KC_ENT, KC_DEL, KC_PGUP, XXXXXXX },
46 {XXXXXXX, M(VOLD), KC_LGUI, KC_E, FNKEY, SHIFT, KC_SPC, KC_BSPC, KC_PGDN, XXXXXXX }
47},
48
49
50[_SHIFTED] = { /* Shifted Layer, layered so that tri_layer can be used, or selectively
51 able to modify individual key's shifted behaviour */
52 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
53 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
54 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
55 {XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX },
56 {XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX }
57},
58
59
60
61[_FUNCTION] = { /* Function Layer, primary alternative layer featuring numpad on right hand,
62 cursor keys on left hand, and all symbols*/
63 {KC_AMPR, KC_PERC, KC_UP, KC_CIRC, KC_PIPE, KC_LBRC, KC_7, KC_8, KC_9, KC_MINS },
64 {KC_AT, KC_LEFT, KC_DOWN, KC_RGHT, KC_HASH, KC_LPRN, KC_4, KC_5, KC_6, KC_PLUS },
65 {KC_ASTR, KC_UNDS, KC_EXLM, KC_DLR, KC_BSLS, KC_LCBR, KC_1, KC_2, KC_3, KC_ENT },
66 {XXXXXXX, KC_HOME, KC_GRV, KC_PWR, _______, _______, KC_EQL, KC_TILD, KC_DOT, XXXXXXX },
67 {XXXXXXX, KC_END, _______, _______, _______, _______, KC_0, _______, KC_PSCR, XXXXXXX }
68},
69
70
71[_FUNCSHIFT] = { /* Function Shifted Layer, secondary alternative layer with closing brackets,
72 and F-keys under their numpad equivalents*/
73 {_______, _______, _______, _______, _______, KC_RBRC, KC_F7, KC_F8, KC_F9, KC_F10 },
74 {_______, _______, _______, _______, _______, KC_RPRN, KC_F4, KC_F5, KC_F6, KC_F11 },
75 {_______, _______, _______, _______, _______, KC_RCBR, KC_F1, KC_F2, KC_F3, KC_F12 },
76 {XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX },
77 {XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX }
78}
79
80};
81
82
83const uint16_t PROGMEM fn_actions[] = {
84
85};
86
87static uint16_t key_timer;
88
89const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
90{
91 // MACRODOWN only works in this function
92 switch(id) {
93
94 //switch multiplexing for media, short tap for volume up, long press for play/pause
95 case VOLU:
96 if (record->event.pressed) {
97 key_timer = timer_read(); // if the key is being pressed, we start the timer.
98 } else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
99 if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { // LONGPRESS_DELAY being 150ms, the threshhold we pick for counting something as a tap.
100 return MACRO(T(MPLY), END);
101 } else {
102 return MACRO(T(VOLU), END);
103 }
104 }
105 break;
106
107 //switch multiplexing for media, short tap for volume down, long press for next track
108 case VOLD:
109 if (record->event.pressed) {
110 key_timer = timer_read();
111 } else {
112 if (timer_elapsed(key_timer) > LONGPRESS_DELAY) {
113 return MACRO(T(MNXT), END);
114 } else {
115 return MACRO(T(VOLD), END);
116 }
117 }
118 break;
119
120 //switch multiplexing for escape, short tap for escape, long press for context menu
121 case ESCM:
122 if (record->event.pressed) {
123 key_timer = timer_read();
124 } else {
125 if (timer_elapsed(key_timer) > LONGPRESS_DELAY) {
126 return MACRO(T(APP), END);
127 } else {
128 return MACRO(T(ESC), END);
129 }
130 }
131 break;
132
133 break;
134 }
135 return MACRO_NONE;
136};
137
138static bool singular_key = false;
139
140bool process_record_user(uint16_t keycode, keyrecord_t *record) {
141
142 uint8_t layer;
143 layer = biton32(layer_state); // get the current layer
144
145 //custom layer handling for tri_layer,
146 switch (keycode) {
147 case FNKEY:
148 if (record->event.pressed) {
149 key_timer = timer_read();
150 singular_key = true;
151 layer_on(_FUNCTION);
152 } else {
153 if (timer_elapsed(key_timer) < LAYER_TOGGLE_DELAY || !singular_key) {
154 layer_off(_FUNCTION);
155 }
156 }
157 update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT);
158 return false;
159 break;
160 //SHIFT is handled as LSHIFT in the general case
161 case SHIFT:
162 if (record->event.pressed) {
163 key_timer = timer_read();
164 singular_key = true;
165 layer_on(_SHIFTED);
166 register_code(KC_LSFT);
167 } else {
168 if (timer_elapsed(key_timer) < LAYER_TOGGLE_DELAY || !singular_key) {
169 layer_off(_SHIFTED);
170 unregister_code(KC_LSFT);
171 }
172 }
173 update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT);
174 return false;
175 break;
176
177 //If any other key was pressed during the layer mod hold period,
178 //then the layer mod was used momentarily, and should block latching
179 default:
180 singular_key = false;
181 break;
182 }
183
184 //FUNCSHIFT has been shifted by the SHIFT handling, some keys need to be excluded
185 if (layer == _FUNCSHIFT) {
186 //F1-F12 should be sent as unshifted keycodes,
187 //and ] needs to be unshifted or it is sent as }
188 if ( (keycode >= KC_F1 && keycode <= KC_F12)
189 || keycode == KC_RBRC ) {
190 if (record->event.pressed) {
191 unregister_mods(MOD_LSFT);
192 } else {
193 register_mods(MOD_LSFT);
194 }
195 }
196 }
197
198 return true;
199};
200
201void matrix_scan_user(void) {
202 uint8_t layer = biton32(layer_state);
203
204 switch (layer) {
205 case _MALT:
206 set_led_off;
207 break;
208 case _FUNCTION:
209 set_led_blue;
210 break;
211 case _SHIFTED:
212 set_led_red;
213 break;
214 case _FUNCSHIFT:
215 set_led_green;
216 break;
217 default:
218 break;
219 }
220};
221
diff --git a/keyboards/mitosis/matrix.c b/keyboards/mitosis/matrix.c
new file mode 100644
index 000000000..0d046339e
--- /dev/null
+++ b/keyboards/mitosis/matrix.c
@@ -0,0 +1,164 @@
1/*
2Copyright 2012 Jun Wako
3Copyright 2014 Jack Humbert
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include <stdint.h>
19#include <stdbool.h>
20#if defined(__AVR__)
21#include <avr/io.h>
22#endif
23#include "wait.h"
24#include "print.h"
25#include "debug.h"
26#include "util.h"
27#include "matrix.h"
28#include "timer.h"
29
30#if (MATRIX_COLS <= 8)
31# define print_matrix_header() print("\nr/c 01234567\n")
32# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
33# define matrix_bitpop(i) bitpop(matrix[i])
34# define ROW_SHIFTER ((uint8_t)1)
35#elif (MATRIX_COLS <= 16)
36# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
37# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
38# define matrix_bitpop(i) bitpop16(matrix[i])
39# define ROW_SHIFTER ((uint16_t)1)
40#elif (MATRIX_COLS <= 32)
41# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
42# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
43# define matrix_bitpop(i) bitpop32(matrix[i])
44# define ROW_SHIFTER ((uint32_t)1)
45#endif
46
47/* matrix state(1:on, 0:off) */
48static matrix_row_t matrix[MATRIX_ROWS];
49
50__attribute__ ((weak))
51void matrix_init_quantum(void) {
52 matrix_init_kb();
53}
54
55__attribute__ ((weak))
56void matrix_scan_quantum(void) {
57 matrix_scan_kb();
58}
59
60__attribute__ ((weak))
61void matrix_init_kb(void) {
62 matrix_init_user();
63}
64
65__attribute__ ((weak))
66void matrix_scan_kb(void) {
67 matrix_scan_user();
68}
69
70__attribute__ ((weak))
71void matrix_init_user(void) {
72}
73
74__attribute__ ((weak))
75void matrix_scan_user(void) {
76}
77
78inline
79uint8_t matrix_rows(void) {
80 return MATRIX_ROWS;
81}
82
83inline
84uint8_t matrix_cols(void) {
85 return MATRIX_COLS;
86}
87
88void matrix_init(void) {
89
90 matrix_init_quantum();
91}
92
93uint8_t matrix_scan(void)
94{
95 SERIAL_UART_INIT();
96
97 uint32_t timeout = 0;
98
99 //the s character requests the RF slave to send the matrix
100 SERIAL_UART_DATA = 's';
101
102 //trust the external keystates entirely, erase the last data
103 uint8_t uart_data[11] = {0};
104
105 //there are 10 bytes corresponding to 10 columns, and an end byte
106 for (uint8_t i = 0; i < 11; i++) {
107 //wait for the serial data, timeout if it's been too long
108 //this only happened in testing with a loose wire, but does no
109 //harm to leave it in here
110 while(!SERIAL_UART_RXD_PRESENT){
111 timeout++;
112 if (timeout > 10000){
113 break;
114 }
115 }
116 uart_data[i] = SERIAL_UART_DATA;
117 }
118
119 //check for the end packet, the key state bytes use the LSBs, so 0xE0
120 //will only show up here if the correct bytes were recieved
121 if (uart_data[10] == 0xE0)
122 {
123 //shifting and transferring the keystates to the QMK matrix variable
124 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
125 matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5;
126 }
127 }
128
129
130 matrix_scan_quantum();
131 return 1;
132}
133
134inline
135bool matrix_is_on(uint8_t row, uint8_t col)
136{
137 return (matrix[row] & ((matrix_row_t)1<col));
138}
139
140inline
141matrix_row_t matrix_get_row(uint8_t row)
142{
143 return matrix[row];
144}
145
146void matrix_print(void)
147{
148 print_matrix_header();
149
150 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
151 phex(row); print(": ");
152 print_matrix_row(row);
153 print("\n");
154 }
155}
156
157uint8_t matrix_key_count(void)
158{
159 uint8_t count = 0;
160 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
161 count += matrix_bitpop(i);
162 }
163 return count;
164}
diff --git a/keyboards/mitosis/mitosis.c b/keyboards/mitosis/mitosis.c
new file mode 100644
index 000000000..24de82724
--- /dev/null
+++ b/keyboards/mitosis/mitosis.c
@@ -0,0 +1,31 @@
1#include "mitosis.h"
2
3void uart_init(void) {
4 SERIAL_UART_INIT();
5}
6
7void led_init(void) {
8 DDRD |= (1<<1);
9 PORTD |= (1<<1);
10 DDRF |= (1<<4) | (1<<5);
11 PORTF |= (1<<4) | (1<<5);
12}
13
14
15void matrix_init_kb(void) {
16 // put your keyboard start-up code here
17 // runs once when the firmware starts up
18 matrix_init_user();
19 uart_init();
20 led_init();
21}
22
23void matrix_scan_kb(void) {
24 // put your looping keyboard code here
25 // runs every cycle (a lot)
26 matrix_scan_user();
27}
28
29void led_set_kb(uint8_t usb_led) {
30
31} \ No newline at end of file
diff --git a/keyboards/mitosis/mitosis.h b/keyboards/mitosis/mitosis.h
new file mode 100644
index 000000000..1b04600e8
--- /dev/null
+++ b/keyboards/mitosis/mitosis.h
@@ -0,0 +1,67 @@
1#ifndef MITOSIS_H
2#define MITOSIS_H
3
4#include "quantum.h"
5#include "matrix.h"
6#include "backlight.h"
7#include <stddef.h>
8
9#define red_led_off PORTF |= (1<<5)
10#define red_led_on PORTF &= ~(1<<5)
11#define blu_led_off PORTF |= (1<<4)
12#define blu_led_on PORTF &= ~(1<<4)
13#define grn_led_off PORTD |= (1<<1)
14#define grn_led_on PORTD &= ~(1<<1)
15
16#define set_led_off red_led_off; grn_led_off; blu_led_off
17#define set_led_red red_led_on; grn_led_off; blu_led_off
18#define set_led_blue red_led_off; grn_led_off; blu_led_on
19#define set_led_green red_led_off; grn_led_on; blu_led_off
20#define set_led_yellow red_led_on; grn_led_on; blu_led_off
21#define set_led_magenta red_led_on; grn_led_off; blu_led_on
22#define set_led_cyan red_led_off; grn_led_on; blu_led_on
23#define set_led_white red_led_on; grn_led_on; blu_led_on
24
25/*
26#define LED_B 5
27#define LED_R 6
28#define LED_G 7
29
30#define all_leds_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
31
32#define red_led_on PORTF |= (1<<LED_R)
33#define red_led_off PORTF &= ~(1<<LED_R)
34#define grn_led_on PORTF |= (1<<LED_G)
35#define grn_led_off PORTF &= ~(1<<LED_G)
36#define blu_led_on PORTF |= (1<<LED_B)
37#define blu_led_off PORTF &= ~(1<<LED_B)
38
39#define set_led_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
40#define set_led_red PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_G) | (1<<LED_R)
41#define set_led_blue PORTF = PORTF & ~(1<<LED_G) & ~(1<<LED_R) | (1<<LED_B)
42#define set_led_green PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_R) | (1<<LED_G)
43#define set_led_yellow PORTF = PORTF & ~(1<<LED_B) | (1<<LED_R) | (1<<LED_G)
44#define set_led_magenta PORTF = PORTF & ~(1<<LED_G) | (1<<LED_R) | (1<<LED_B)
45#define set_led_cyan PORTF = PORTF & ~(1<<LED_R) | (1<<LED_B) | (1<<LED_G)
46#define set_led_white PORTF |= (1<<LED_B) | (1<<LED_R) | (1<<LED_G)
47*/
48
49// This a shortcut to help you visually see your layout.
50// The first section contains all of the arguements
51// The second converts the arguments into a two-dimensional array
52#define KEYMAP( \
53 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
54 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
55 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
56 k31, k32, k33, k34, k35, k36, k37, k38, \
57 k41, k42, k43, k44, k45, k46, k47, k48 \
58) \
59{ \
60 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \
61 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
62 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
63 { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, KC_NO } \
64 { KC_NO, k41, k42, k43, k44, k45, k46, k47, k48, KC_NO }, \
65}
66
67#endif
diff --git a/keyboards/mitosis/readme.md b/keyboards/mitosis/readme.md
new file mode 100644
index 000000000..70755e32a
--- /dev/null
+++ b/keyboards/mitosis/readme.md
@@ -0,0 +1,33 @@
1Mitosis Keyboard Firmware
2======================
3
4These configuration files were based off the Atreus keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported.
5
6Build log of the keyboard can be found [here](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/)
7
8Hardware design files can be found [here](https://github.com/reversebias/mitosis-hardware)
9
10Firmware for the nordic MCUs can be found [here](https://github.com/reversebias/mitosis)
11
12## Quantum MK Firmware
13
14For the full Quantum feature list, see [the parent readme](/).
15
16## Building
17
18Download or clone the whole firmware and navigate to the keyboards/atreus folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button.
19
20Depending on which keymap you would like to use, you will have to compile slightly differently.
21
22### Default
23To build with the default keymap, simply run `make default`.
24
25### Other Keymaps
26Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` and see keymap document (you can find in top readme.md) and existent keymap files.
27
28To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
29
30```
31$ make [default|jack|<name>]
32```
33Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/mitosis/rules.mk b/keyboards/mitosis/rules.mk
new file mode 100644
index 000000000..4e4eba82b
--- /dev/null
+++ b/keyboards/mitosis/rules.mk
@@ -0,0 +1,81 @@
1
2OPT_DEFS += -DMITOSIS_PROMICRO
3OPT_DEFS += -DCATERINA_BOOTLOADER
4MITOSIS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
5 avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
6
7# # project specific files
8SRC = matrix.c
9
10
11# MCU name
12#MCU = at90usb1287
13MCU = atmega32u4
14
15# Processor frequency.
16# This will define a symbol, F_CPU, in all source code files equal to the
17# processor frequency in Hz. You can then use this symbol in your source code to
18# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
19# automatically to create a 32-bit value in your source code.
20#
21# This will be an integer division of F_USB below, as it is sourced by
22# F_USB after it has run through any CPU prescalers. Note that this value
23# does not *change* the processor frequency - it should merely be updated to
24# reflect the processor speed set externally so that the code can use accurate
25# software delays.
26F_CPU = 16000000
27
28
29#
30# LUFA specific
31#
32# Target architecture (see library "Board Types" documentation).
33ARCH = AVR8
34
35# Input clock frequency.
36# This will define a symbol, F_USB, in all source code files equal to the
37# input clock frequency (before any prescaling is performed) in Hz. This value may
38# differ from F_CPU if prescaling is used on the latter, and is required as the
39# raw input clock is fed directly to the PLL sections of the AVR for high speed
40# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
41# at the end, this will be done automatically to create a 32-bit value in your
42# source code.
43#
44# If no clock division is performed on the input clock inside the AVR (via the
45# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
46F_USB = $(F_CPU)
47
48# Interrupt driven control endpoint task(+60)
49OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
50
51
52# Boot Section Size in *bytes*
53# Teensy halfKay 512
54# Teensy++ halfKay 1024
55# Atmel DFU loader 4096
56# LUFA bootloader 4096
57# USBaspLoader 2048
58OPT_DEFS += -DBOOTLOADER_SIZE=4096
59
60
61# Build Options
62# comment out to disable the options.
63#
64#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
65MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
66EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
67CONSOLE_ENABLE ?= yes # Console for debug(+400)
68COMMAND_ENABLE ?= yes # Commands for debug and configuration
69CUSTOM_MATRIX ?= yes # Remote matrix from the wireless bridge
70# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
71# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
72NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
73# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
74# MIDI_ENABLE ?= YES # MIDI controls
75UNICODE_ENABLE ?= YES # Unicode
76# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
77
78USB ?= /dev/ttyACM0
79
80upload: build
81 $(MITOSIS_UPLOAD_COMMAND)
diff --git a/keyboards/miuni32/config.h b/keyboards/miuni32/config.h
index 4f9b68551..9f26b2291 100644
--- a/keyboards/miuni32/config.h
+++ b/keyboards/miuni32/config.h
@@ -163,6 +163,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
163#define RGB_DI_PIN D0 // The pin your RGB strip is wired to 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) 164#define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio)
165#define RGBLED_NUM 7 // Number of LEDs 165#define RGBLED_NUM 7 // Number of LEDs
166#define RGBLIGHT_ANIMATIONS
166#define RGBLIGHT_HUE_STEP 10 167#define RGBLIGHT_HUE_STEP 10
167#define RGBLIGHT_SAT_STEP 17 168#define RGBLIGHT_SAT_STEP 17
168#define RGBLIGHT_VAL_STEP 17 169#define RGBLIGHT_VAL_STEP 17
diff --git a/keyboards/miuni32/keymaps/adam-lee/Makefile b/keyboards/miuni32/keymaps/adam-lee/Makefile
new file mode 100644
index 000000000..88a3aea74
--- /dev/null
+++ b/keyboards/miuni32/keymaps/adam-lee/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/handwired/MS-sculpt-mobile/keymaps/default/config.h b/keyboards/miuni32/keymaps/adam-lee/config.h
index 8893d122e..df06a2620 100644
--- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/config.h
+++ b/keyboards/miuni32/keymaps/adam-lee/config.h
@@ -5,4 +5,4 @@
5 5
6// place overrides here 6// place overrides here
7 7
8#endif 8#endif \ No newline at end of file
diff --git a/keyboards/miuni32/keymaps/adam-lee/keymap.c b/keyboards/miuni32/keymaps/adam-lee/keymap.c
new file mode 100644
index 000000000..f799b8929
--- /dev/null
+++ b/keyboards/miuni32/keymaps/adam-lee/keymap.c
@@ -0,0 +1,119 @@
1#include "miuni32.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 /* Level 0: Default Layer
5 * ,---------------------------------------------------------------------------------------.
6 * | Q | W | E | R | T | Y | U | I | O | P | BSP |
7 * |---------------------------------------------------------------------------------------|
8 * | A | S | D | F | G | H | J | K | L | ENT |LT(1|,)|
9 * |---------------------------------------------------------------------------------------|
10 * |LT(3|Z)| X | C | V | NO | SPC | B | N | M | RSFT |LT(2|.)|
11 * |---------------------------------------------------------------------------------------|
12 */
13 [0] ={
14 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
15 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, LT(1, KC_COMMA)},
16 {LT(3, KC_Z), KC_X, KC_C, KC_V, KC_NO, KC_SPC, KC_B, KC_N, KC_M, KC_RSFT, LT(2, KC_DOT)}
17 },
18 /* Level 1: Numbers Layer
19 * ,---------------------------------------------------------------------------------------.
20 * | ESC | 7 | 8 | 9 | / | * | . | , | ( | ) | DEL |
21 * |---------------------------------------------------------------------------------------|
22 * | TAB | 4 | 5 | 6 | - | + | HOME | UP | END | PGUP | TRNS |
23 * |---------------------------------------------------------------------------------------|
24 * | LATL | 1 | 2 | 3 | 0 | NO | LEFT | DOWN | RGHT | PGDN | RSHFT |
25 * |---------------------------------------------------------------------------------------|
26 */
27 [1] ={
28 {KC_ESC, KC_7, KC_8, KC_9, KC_SLSH, KC_ASTR, KC_DOT, KC_COMM, KC_LPRN, KC_RPRN, KC_DEL},
29 {KC_TAB, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS},
30 {KC_LALT, KC_1, KC_2, KC_3, KC_0, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_RSFT}
31 },
32 /* Level 2: Symbols Layer
33 * ,---------------------------------------------------------------------------------------.
34 * | ! | @ | # | $ | % | ^ | & | * | - | + | = |
35 * |---------------------------------------------------------------------------------------|
36 * | { | } | [ | ] | TRNS | TRNS | \ | ; | : | ` | ? |
37 * |---------------------------------------------------------------------------------------|
38 * | LSFT | LCTL | L | T | TRNS | TAB | N | TRNS | TRNS | RCTL | TRNS |
39 * |---------------------------------------------------------------------------------------|
40 */
41 [2] ={
42 {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL},
43 {KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_BSLS, KC_SCLN, KC_COLN, KC_GRV, KC_QUES},
44 {KC_LSFT, KC_LCTL, KC_L, KC_T, KC_TRNS, KC_TAB, KC_N, KC_TRNS, KC_TRNS, KC_RCTL, KC_TRNS}
45 },
46 /* Level 3: RGB Layer
47 * ,---------------------------------------------------------------------------------------.
48 * | RESET | TRNS | TRNS | TRNS | TRNS | F1 | F2 | F3 | F4 | F5 | F6 |
49 * |---------------------------------------------------------------------------------------|
50 * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD| NO |RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| TRNS | TRNS |
51 * |---------------------------------------------------------------------------------------|
52 * | TRNS | TRNS | TRNS | TRNS | NO | F7 | F8 | F9 | F10 | F11 | F12 |
53 * |---------------------------------------------------------------------------------------|
54 */
55 [3] ={
56 {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6},
57 {RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_NO, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS},
58 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}
59 }
60};
61
62const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
63{
64 // MACRODOWN only works in this function
65 switch(id) {
66 case 0:
67 if (record->event.pressed) {
68 register_code(KC_RSFT);
69 } else {
70 unregister_code(KC_RSFT);
71 }
72 break;
73 }
74 return MACRO_NONE;
75};
76
77void matrix_init_user(void) {
78}
79
80void matrix_scan_user(void) {
81}
82
83bool process_record_user(uint16_t keycode, keyrecord_t *record) {
84 return true;
85}
86
87void led_set_user(uint8_t usb_led) {
88
89 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
90
91 } else {
92
93 }
94
95 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
96
97 } else {
98
99 }
100
101 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
102
103 } else {
104
105 }
106
107 if (usb_led & (1 << USB_LED_COMPOSE)) {
108
109 } else {
110
111 }
112
113 if (usb_led & (1 << USB_LED_KANA)) {
114
115 } else {
116
117 }
118
119}
diff --git a/keyboards/miuni32/keymaps/adam-lee/readme.md b/keyboards/miuni32/keymaps/adam-lee/readme.md
new file mode 100644
index 000000000..4cff8ef5a
--- /dev/null
+++ b/keyboards/miuni32/keymaps/adam-lee/readme.md
@@ -0,0 +1 @@
# The default keymap for miuni32 \ No newline at end of file
diff --git a/keyboards/miuni32/keymaps/default/keymap.c b/keyboards/miuni32/keymaps/default/keymap.c
index 15e2fa45c..f799b8929 100644
--- a/keyboards/miuni32/keymaps/default/keymap.c
+++ b/keyboards/miuni32/keymaps/default/keymap.c
@@ -1,19 +1,62 @@
1#include "miuni32.h" 1#include "miuni32.h"
2 2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4[0] ={ 4 /* Level 0: Default Layer
5 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, 5 * ,---------------------------------------------------------------------------------------.
6 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, KC_ENT}, 6 * | Q | W | E | R | T | Y | U | I | O | P | BSP |
7 {KC_Z, KC_X, KC_C, KC_V, KC_V, KC_SPC, KC_B, KC_N, KC_M , MO(1), KC_RCTL} 7 * |---------------------------------------------------------------------------------------|
8 }, 8 * | A | S | D | F | G | H | J | K | L | ENT |LT(1|,)|
9[1] ={ 9 * |---------------------------------------------------------------------------------------|
10 {KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL}, 10 * |LT(3|Z)| X | C | V | NO | SPC | B | N | M | RSFT |LT(2|.)|
11 {KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_TRNS}, 11 * |---------------------------------------------------------------------------------------|
12 {RGB_TOG, RGB_HUI, RGB_HUD, RGB_SAI, KC_TRNS, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, RGB_MOD}, 12 */
13 } 13 [0] ={
14}; 14 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
15const uint16_t PROGMEM fn_actions[] = { 15 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, LT(1, KC_COMMA)},
16 16 {LT(3, KC_Z), KC_X, KC_C, KC_V, KC_NO, KC_SPC, KC_B, KC_N, KC_M, KC_RSFT, LT(2, KC_DOT)}
17 },
18 /* Level 1: Numbers Layer
19 * ,---------------------------------------------------------------------------------------.
20 * | ESC | 7 | 8 | 9 | / | * | . | , | ( | ) | DEL |
21 * |---------------------------------------------------------------------------------------|
22 * | TAB | 4 | 5 | 6 | - | + | HOME | UP | END | PGUP | TRNS |
23 * |---------------------------------------------------------------------------------------|
24 * | LATL | 1 | 2 | 3 | 0 | NO | LEFT | DOWN | RGHT | PGDN | RSHFT |
25 * |---------------------------------------------------------------------------------------|
26 */
27 [1] ={
28 {KC_ESC, KC_7, KC_8, KC_9, KC_SLSH, KC_ASTR, KC_DOT, KC_COMM, KC_LPRN, KC_RPRN, KC_DEL},
29 {KC_TAB, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS},
30 {KC_LALT, KC_1, KC_2, KC_3, KC_0, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_RSFT}
31 },
32 /* Level 2: Symbols Layer
33 * ,---------------------------------------------------------------------------------------.
34 * | ! | @ | # | $ | % | ^ | & | * | - | + | = |
35 * |---------------------------------------------------------------------------------------|
36 * | { | } | [ | ] | TRNS | TRNS | \ | ; | : | ` | ? |
37 * |---------------------------------------------------------------------------------------|
38 * | LSFT | LCTL | L | T | TRNS | TAB | N | TRNS | TRNS | RCTL | TRNS |
39 * |---------------------------------------------------------------------------------------|
40 */
41 [2] ={
42 {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL},
43 {KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_BSLS, KC_SCLN, KC_COLN, KC_GRV, KC_QUES},
44 {KC_LSFT, KC_LCTL, KC_L, KC_T, KC_TRNS, KC_TAB, KC_N, KC_TRNS, KC_TRNS, KC_RCTL, KC_TRNS}
45 },
46 /* Level 3: RGB Layer
47 * ,---------------------------------------------------------------------------------------.
48 * | RESET | TRNS | TRNS | TRNS | TRNS | F1 | F2 | F3 | F4 | F5 | F6 |
49 * |---------------------------------------------------------------------------------------|
50 * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD| NO |RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| TRNS | TRNS |
51 * |---------------------------------------------------------------------------------------|
52 * | TRNS | TRNS | TRNS | TRNS | NO | F7 | F8 | F9 | F10 | F11 | F12 |
53 * |---------------------------------------------------------------------------------------|
54 */
55 [3] ={
56 {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6},
57 {RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_NO, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS},
58 {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}
59 }
17}; 60};
18 61
19const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 62const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
@@ -31,19 +74,46 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
31 return MACRO_NONE; 74 return MACRO_NONE;
32}; 75};
33 76
34
35void matrix_init_user(void) { 77void matrix_init_user(void) {
36
37} 78}
38 79
39void matrix_scan_user(void) { 80void matrix_scan_user(void) {
40
41} 81}
42 82
43bool process_record_user(uint16_t keycode, keyrecord_t *record) { 83bool process_record_user(uint16_t keycode, keyrecord_t *record) {
44 return true; 84 return true;
45} 85}
46 86
47void led_set_user(uint8_t usb_led) { 87void led_set_user(uint8_t usb_led) {
48 88
89 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
90
91 } else {
92
93 }
94
95 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
96
97 } else {
98
99 }
100
101 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
102
103 } else {
104
105 }
106
107 if (usb_led & (1 << USB_LED_COMPOSE)) {
108
109 } else {
110
111 }
112
113 if (usb_led & (1 << USB_LED_KANA)) {
114
115 } else {
116
117 }
118
49} 119}
diff --git a/keyboards/miuni32/keymaps/ht_156/Makefile b/keyboards/miuni32/keymaps/ht_156/Makefile
new file mode 100644
index 000000000..88a3aea74
--- /dev/null
+++ b/keyboards/miuni32/keymaps/ht_156/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/ht_156/config.h b/keyboards/miuni32/keymaps/ht_156/config.h
new file mode 100644
index 000000000..df06a2620
--- /dev/null
+++ b/keyboards/miuni32/keymaps/ht_156/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/ht_156/keymap.c b/keyboards/miuni32/keymaps/ht_156/keymap.c
new file mode 100644
index 000000000..e40180d49
--- /dev/null
+++ b/keyboards/miuni32/keymaps/ht_156/keymap.c
@@ -0,0 +1,181 @@
1#include "miuni32.h"
2
3// Keyboard layer definitions
4#define BASE 0
5#define NUMBERS 1
6#define SYMBOLS 2
7#define MEDIA 3
8
9// Keyboard macro defintions
10#define GIT_ST M(0)
11#define GIT_PU M(1)
12#define GIT_CM M(2)
13#define HM_DIR M(3)
14
15const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
16 /* Level 0: Default Layer
17 * ,---------------------------------------------------------------------------------------.
18 * | Q | W | E | R | T | Y | U | I | O | P | BSP |
19 * |---------------------------------------------------------------------------------------|
20 * | A | S | D | F | G | H | J | K | L | ENT | RSFT |
21 * |---------------------------------------------------------------------------------------|
22 * |LT(2|Z)|LT(3|X)| C | V | B | SPC | N | M | , |LT(1|.)| RCTL |
23 * |---------------------------------------------------------------------------------------|
24 */
25 [BASE] ={
26 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
27 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_RSFT},
28 {LT(2, KC_Z), LT(3, KC_X), KC_C, KC_V, KC_B, KC_SPC, KC_N, KC_M, KC_COMMA, LT(1, KC_DOT), KC_RCTL}
29 },
30 /* Level 1: Numbers Layer
31 * ,---------------------------------------------------------------------------------------.
32 * | ESC | 7 | 8 | 9 | / | * | . | , | ( | ) | DEL |
33 * |---------------------------------------------------------------------------------------|
34 * | TAB | 4 | 5 | 6 | - | + | HOME | UP | END | INS | PGUP |
35 * |---------------------------------------------------------------------------------------|
36 * | LATL | 1 | 2 | 3 | 0 | ENT | LEFT | DOWN | RGHT | !TRNS!| PGDN |
37 * |---------------------------------------------------------------------------------------|
38 */
39 [NUMBERS] ={
40 {KC_ESC, KC_7, KC_8, KC_9, KC_SLSH, KC_ASTR, KC_DOT, KC_COMM, KC_LPRN, KC_RPRN, KC_DEL},
41 {KC_TAB, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, KC_HOME, KC_UP, KC_END, KC_INSERT, KC_PGUP},
42 {KC_LALT, KC_1, KC_2, KC_3, KC_0, KC_ENT, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_PGDN}
43 },
44 /* Level 2: Symbols Layer
45 * ,---------------------------------------------------------------------------------------.
46 * | ! | @ | # | $ | % | ^ | & | * | _ | = | ? |
47 * |---------------------------------------------------------------------------------------|
48 * | RESET | LSFT | ~ | { | } | \ | | | ; | : | ` | " |
49 * |---------------------------------------------------------------------------------------|
50 * | !TRNS!| LCTL | TRNS | [ | ] | TAB | < | > | TRNS | RCTL | TRNS |
51 * |---------------------------------------------------------------------------------------|
52 */
53 [SYMBOLS] ={
54 {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_EQL, KC_QUES},
55 {RESET, KC_LSFT, KC_TILD, KC_LCBR, KC_RCBR, KC_BSLS, KC_PIPE, KC_SCLN, KC_COLN, KC_GRV, KC_DQUO},
56 {KC_TRNS, KC_LCTL, KC_TRNS, KC_LBRC, KC_RBRC, KC_TAB, KC_LABK, KC_RABK, KC_TRNS, KC_RCTL, KC_TRNS}
57 },
58 /* Level 3: Media Layer
59 * ,---------------------------------------------------------------------------------------.
60 * |RGB_TOG|RGB_HUI|RGB_SAI|RGB_VAI| GIT_CM| CALC | WREF | WFAV | MUTE | VOLD | VOLU |
61 * |---------------------------------------------------------------------------------------|
62 * |RGB_MOD|RGB_HUD|RGB_SAD|RGB_VAD| GIT_ST| WHOM | WBAK | WFWD | TRNS | STOP | PLAY |
63 * |---------------------------------------------------------------------------------------|
64 * | TRNS | !TRNS!| TRNS | HM_DIR| GIT_PU| MYCM | WSTP | WSCH | MSEL | MPRV | MNXT |
65 * |---------------------------------------------------------------------------------------|
66 */
67 [MEDIA] ={
68 {RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, GIT_CM, KC_CALC, KC_WREF, KC_WFAV, KC_MUTE, KC_VOLD, KC_VOLU},
69 {RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, GIT_ST, KC_WHOM, KC_WBAK, KC_WFWD, KC_TRNS, KC_MSTP, KC_MPLY},
70 {KC_TRNS, KC_TRNS, KC_TRNS, HM_DIR, GIT_PU, KC_MYCM, KC_WSTP, KC_WSCH, KC_MSEL, KC_MPRV, KC_MNXT}
71 }
72};
73
74void press_and_release_key(uint8_t code)
75{
76 register_code(code);
77 unregister_code(code);
78}
79
80void press_and_release_mod_key(uint8_t mod, uint8_t code)
81{
82 register_code(mod);
83 register_code(code);
84 unregister_code(code);
85 unregister_code(mod);
86}
87
88const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
89{
90 // MACRODOWN only works in this function
91 switch(id)
92 {
93 case 0:
94 if (record->event.pressed)
95 {
96 return MACRO(T(G), T(I), T(T), T(SPC),
97 T(S), T(T), T(A), T(T), T(U), T(S), END);
98 }
99 break;
100 case 1:
101 if (record->event.pressed)
102 {
103 return MACRO(T(G), T(I), T(T), T(SPC),
104 T(P), T(U), T(L), T(L), END);
105 }
106 break;
107 case 2:
108 if (record->event.pressed)
109 {
110 return MACRO(T(G), T(I), T(T), T(SPC),
111 T(C), T(O), T(M), T(M), T(I), T(T), END);
112 }
113 break;
114 case 3:
115 if (record->event.pressed)
116 {
117 /*press_and_release_key(KC_C);
118 press_and_release_key(KC_D);
119 press_and_release_key(KC_SPC);
120 press_and_release_mod_key(KC_LSFT, KC_GRV);
121 press_and_release_key(KC_SLSH);
122 press_and_release_key(KC_Q);
123 press_and_release_key(KC_M);
124 press_and_release_key(KC_K);
125 press_and_release_mod_key(KC_LSFT, KC_MINS);*/
126 return MACRO(I(0),
127 T(C), T(D), T(SPC),
128 D(LSFT), T(GRV), U(LSFT), T(SLSH),
129 T(Q), T(M), T(K), D(LSFT), T(MINS), U(LSFT),
130 T(F), T(I), T(R), T(M), T(W), T(A), T(R), T(E), T(SLSH),
131 T(K), T(E), T(Y), T(B), T(O), T(A), T(R), T(D), T(S), T(SLSH),
132 T(M), T(I), T(U), T(N), T(I), T(3), T(2), T(SLSH),
133 T(K), T(E), T(Y), T(M), T(A), T(P), T(S), END);
134 }
135 }
136 return MACRO_NONE;
137};
138
139void matrix_init_user(void) {
140}
141
142void matrix_scan_user(void) {
143}
144
145bool process_record_user(uint16_t keycode, keyrecord_t *record) {
146 return true;
147}
148
149void led_set_user(uint8_t usb_led) {
150
151 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
152
153 } else {
154
155 }
156
157 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
158
159 } else {
160
161 }
162
163 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
164
165 } else {
166
167 }
168
169 if (usb_led & (1 << USB_LED_COMPOSE)) {
170
171 } else {
172
173 }
174
175 if (usb_led & (1 << USB_LED_KANA)) {
176
177 } else {
178
179 }
180
181}
diff --git a/keyboards/miuni32/keymaps/ht_156/readme.md b/keyboards/miuni32/keymaps/ht_156/readme.md
new file mode 100644
index 000000000..e46cc6d53
--- /dev/null
+++ b/keyboards/miuni32/keymaps/ht_156/readme.md
@@ -0,0 +1 @@
# ht_156's keymap for miuni32, using 33 keys
diff --git a/keyboards/miuni32/miuni32.h b/keyboards/miuni32/miuni32.h
index eecb17f81..8e1b4a38c 100644
--- a/keyboards/miuni32/miuni32.h
+++ b/keyboards/miuni32/miuni32.h
@@ -6,10 +6,10 @@
6#define KEYMAP( \ 6#define KEYMAP( \
7 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ 7 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
8 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ 8 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
9 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A ) { \ 9 K20, K21, K22, K23, 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 }, \ 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 }, \ 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 } \ 12 { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_NO, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A } \
13} 13}
14 14
15#endif 15#endif
diff --git a/keyboards/planck/keymaps/dshields/Makefile b/keyboards/planck/keymaps/dshields/Makefile
new file mode 100644
index 000000000..9e18a3542
--- /dev/null
+++ b/keyboards/planck/keymaps/dshields/Makefile
@@ -0,0 +1,12 @@
1ifndef QUANTUM_DIR
2 include ../../../../Makefile
3endif
4
5MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
6COMMAND_ENABLE = yes # Commands for debug and configuration
7BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
8# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
9SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
10TAP_DANCE_ENABLE = yes
11AUDIO_ENABLE = no
12API_SYSEX_ENABLE = no
diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h
new file mode 100644
index 000000000..4d5be0a26
--- /dev/null
+++ b/keyboards/planck/keymaps/dshields/config.h
@@ -0,0 +1,31 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define _______ KC_TRNS
7#define XXXXXXX KC_NO
8
9#define ONESHOT_TAP_TOGGLE 2
10#define ONESHOT_TIMEOUT 500
11
12#define MOUSEKEY_INTERVAL 20
13#define MOUSEKEY_DELAY 0
14#define MOUSEKEY_TIME_TO_MAX 60
15#define MOUSEKEY_MAX_SPEED 7
16#define MOUSEKEY_WHEEL_DELAY 0
17
18#define DM_PLAY DYN_MACRO_PLAY1
19#define DM_STRT DYN_REC_START1
20#define DM_STOP DYN_REC_STOP
21
22#define OSL_RSE OSL(RSE)
23#define OSL_LWR OSL(LWR)
24#define OSL_FUN OSL(FUN)
25
26#define OSM_CTL OSM(MOD_LCTL)
27#define OSM_ALT OSM(MOD_LALT)
28#define OSM_SFT OSM(MOD_LSFT)
29
30#endif
31
diff --git a/keyboards/planck/keymaps/dshields/keyboard-layout.jpg b/keyboards/planck/keymaps/dshields/keyboard-layout.jpg
new file mode 100644
index 000000000..142f82130
--- /dev/null
+++ b/keyboards/planck/keymaps/dshields/keyboard-layout.jpg
Binary files differ
diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c
new file mode 100644
index 000000000..ed7621c77
--- /dev/null
+++ b/keyboards/planck/keymaps/dshields/keymap.c
@@ -0,0 +1,100 @@
1#include "planck.h"
2#include "backlight.h"
3#include "config.h"
4#include "action_layer.h"
5#include "eeconfig.h"
6
7extern keymap_config_t keymap_config;
8
9enum planck_layers { DEF, LWR, RSE, FUN };
10enum planck_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE };
11enum tap_dance_keys { TD_SCLN };
12
13#include "dynamic_macro.h"
14
15const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
16 /* Default
17 * ,-----------------------------------------------------------------------------------.
18 * | Q | W | E | R | T | Esc | Bksp | Y | U | I | O | P |
19 * |------+------+------+------+------+-------------+------+------+------+------+------|
20 * | A | S | D | F | G | Tab | Enter| H | J | K | L | ; |
21 * |------+------+------+------+------+------|------+------+------+------+------+------|
22 * | Z | X | C | V | B | Shift|DmPlay| N | M | , | . | / |
23 * |------+------+------+------+------+------+------+------+------+------+------+------|
24 * | Ctrl | Super| Alt | Fun | Lower| Space | Raise| Left | Down | Up |Right |
25 * `-----------------------------------------------------------------------------------'
26 */
27 [DEF] = {
28 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P},
29 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, TD(TD_SCLN)},
30 {KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
31 {OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, KC_SPC, KC_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
32 },
33 /* Lower
34 * ,-----------------------------------------------------------------------------------.
35 * | ! | @ | # | $ | % | | | ^ | & | * | ( | ) |
36 * |------+------+------+------+------+-------------+------+------+------+------+------|
37 * | ~ | | | | | | | _ | + | | { | } |
38 * |------+------+------+------+------+------|------+------+------+------+------+------|
39 * | | | | | | | | | | | " | | |
40 * |------+------+------+------+------+------+------+------+------+------+------+------|
41 * | | | | | | | | Home | PgDn | PgUp | End |
42 * `-----------------------------------------------------------------------------------'
43 */
44 [LWR] = {
45 {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
46 {S(KC_GRV), _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, S(KC_LBRC), S(KC_RBRC)},
47 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, S(KC_QUOT), S(KC_BSLS)},
48 {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END}
49 },
50 /* Raise
51 * ,-----------------------------------------------------------------------------------.
52 * | 1 | 2 | 3 | 4 | 5 | | | 6 | 7 | 8 | 9 | 0 |
53 * |------+------+------+------+------+-------------+------+------+------+------+------|
54 * | ` | | | | | | | - | = | | [ | ] |
55 * |------+------+------+------+------+------|------+------+------+------+------+------|
56 * | | | | | | | | | | | ' | \ |
57 * |------+------+------+------+------+------+------+------+------+------+------+------|
58 * | | | | | | | | Home | PgDn | PgUp | End |
59 * `-----------------------------------------------------------------------------------'
60 */
61 [RSE] = {
62 {KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0},
63 {KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC},
64 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_BSLS},
65 {_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END}
66 },
67 /* Function
68 * ,-----------------------------------------------------------------------------------.
69 * | F1 | F2 | F3 | F4 | F5 | Reset|Delete| F6 | F7 | F8 | F9 | F10 |
70 * |------+------+------+------+------+-------------+------+------+------+------+------|
71 * | F11 | F12 | F13 | F14 | F15 | | | |MsWhLt|MsWhDn|MsWhUp|MsWhRt|
72 * |------+------+------+------+------+------|------+------+------+------+------+------|
73 * |BlTggl|BlStep| | | |DmStrt|DmStop| | |MsBtn1|MsBtn2|MsBtn3|
74 * |------+------+------+------+------+------+------+------+------+------+------+------|
75 * | | | | | | | |MsLeft|MsDown| MsUp |MsRght|
76 * `-----------------------------------------------------------------------------------'
77 */
78 [FUN] = {
79 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_DEL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10},
80 {KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R},
81 {BL_TOGG, BL_STEP, _______, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3},
82 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R}
83 },
84
85};
86
87qk_tap_dance_action_t tap_dance_actions[] = {
88 [TD_SCLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, S(KC_SCLN)) // once for semi-colon, twice for colon
89};
90
91bool process_record_user(uint16_t keycode, keyrecord_t *record) {
92 if (!process_record_dynamic_macro(keycode, record)) {
93 return false;
94 }
95 return true;
96}
97
98void matrix_init_user(void) {
99}
100
diff --git a/keyboards/planck/keymaps/dshields/readme.md b/keyboards/planck/keymaps/dshields/readme.md
new file mode 100644
index 000000000..447eaae97
--- /dev/null
+++ b/keyboards/planck/keymaps/dshields/readme.md
@@ -0,0 +1,12 @@
1
2About
3------
4
5A simple split qwerty Planck layout that makes use of one-shot modifiers,
6one-shot layers, tap-dance keys and dynamic macros.
7
8Layout
9-------
10
11![Layout](keyboard-layout.jpg "Keyboard Layout")
12
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/lae3/Makefile b/keyboards/planck/keymaps/lae3/Makefile
new file mode 100644
index 000000000..595803e32
--- /dev/null
+++ b/keyboards/planck/keymaps/lae3/Makefile
@@ -0,0 +1,23 @@
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 = yes # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = yes # 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.
17
18# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
19SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
20
21ifndef QUANTUM_DIR
22 include ../../../../Makefile
23endif
diff --git a/keyboards/planck/keymaps/lae3/config.h b/keyboards/planck/keymaps/lae3/config.h
new file mode 100644
index 000000000..a28634e69
--- /dev/null
+++ b/keyboards/planck/keymaps/lae3/config.h
@@ -0,0 +1,8 @@
1#ifndef LAE3_KEYMAP_H
2#define LAE3_KEYMAP_H
3
4#include "../../config.h"
5
6#define PREVENT_STUCK_MODIFIERS
7
8#endif
diff --git a/keyboards/planck/keymaps/lae3/keymap.c b/keyboards/planck/keymaps/lae3/keymap.c
new file mode 100644
index 000000000..4127a3ae1
--- /dev/null
+++ b/keyboards/planck/keymaps/lae3/keymap.c
@@ -0,0 +1,262 @@
1#include "planck.h"
2#include "action_layer.h"
3#ifdef AUDIO_ENABLE
4#include "audio.h"
5#endif
6#include "eeconfig.h"
7
8extern keymap_config_t keymap_config;
9
10// Each layer gets a name for readability, which is then used in the keymap matrix below.
11// The underscores don't mean anything - you can have a layer called STUFF or any other name.
12// Layer names don't all need to be of the same length, obviously, and you can also skip them
13// entirely and just use numbers.
14enum planck_layers {
15 _QWERTY,
16 _ARROW,
17 _NUMPAD,
18 _MOVEMENT,
19 _LOWER,
20 _RAISE,
21 _ADJUST
22};
23
24#define _MV _MOVEMENT
25
26enum planck_keycodes {
27 QWERTY = SAFE_RANGE,
28 ARROW,
29 NUMPAD,
30 LOWER,
31 RAISE,
32};
33
34// Fillers to make layering more clear
35#define _______ KC_TRNS
36#define XXXXXXX KC_NO
37
38#define KC_MUP KC_MS_UP
39#define KC_MDN KC_MS_DOWN
40#define KC_MLFT KC_MS_LEFT
41#define KC_MRGT KC_MS_RIGHT
42#define KC_MB1 KC_MS_BTN1
43#define KC_MB2 KC_MS_BTN2
44#define KC_MB3 KC_MS_BTN3
45#define KC_MB4 KC_MS_BTN4
46#define KC_MB5 KC_MS_BTN5
47#define KC_MWUP KC_MS_WH_UP
48#define KC_MWDN KC_MS_WH_DOWN
49
50const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
51
52 /* Qwerty
53 * ,-----------------------------------------------------------------------------------.
54 * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
55 * |------+------+------+------+------+------+------+------+------+------+------+------|
56 * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
57 * |------+------+------+------+------+------+------+------+------+------+------+------|
58 * |Shift | Z | X | C | V | B | N | M | , | . | / |Shift |
59 * |------+------+------+------+------+-------------+------+------+------+------+------|
60 * | Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl |
61 * `-----------------------------------------------------------------------------------'
62 */
63 [_QWERTY] = {
64 {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
65 {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
66 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
67 {KC_LCTL, KC_LGUI, KC_LALT, MO(_MV), LOWER, KC_SPC, KC_SPC, RAISE, MO(_MV), KC_RALT, KC_RGUI, KC_RCTL}
68 },
69
70 /* Arrow
71 * ,-----------------------------------------------------------------------------------.
72 * | | | | | | | | | | | | |
73 * |------+------+------+------+------+------+------+------+------+------+------+------|
74 * | | | | | | | | | | | | |
75 * |------+------+------+------+------+------+------+------+------+------+------+------|
76 * | | | | | | | | | | | Up | |
77 * |------+------+------+------+------+-------------+------+------+------+------+------|
78 * | | | | | | | | | Left | Down | Right|
79 * `-----------------------------------------------------------------------------------'
80 */
81 [_ARROW] = {
82 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
83 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
84 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______},
85 {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT}
86 },
87
88 /* Numpad
89 * ,-----------------------------------------------------------------------------------.
90 * | | | | | | |NumLck| 7 | 8 | 9 | / | |
91 * |------+------+------+------+------+------+------+------+------+------+------+------|
92 * | | | | | | |Enter | 4 | 5 | 6 | * | |
93 * |------+------+------+------+------+------+------+------+------+------+------+------|
94 * | | | | | | | | 3 | 2 | 1 | - | |
95 * |------+------+------+------+------+-------------+------+------+------+------+------|
96 * | | | | | | | | 0 | . | + | |
97 * `-----------------------------------------------------------------------------------'
98 */
99 [_NUMPAD] = {
100 {_______, _______, _______, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______},
101 {_______, _______, _______, _______, _______, _______, KC_PENT, KC_P4, KC_P5, KC_P6, KC_PAST, _______},
102 {_______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______},
103 {_______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PPLS, _______}
104 },
105
106 /* Movement
107 * ,-----------------------------------------------------------------------------------.
108 * | |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | |
109 * |------+------+------+------+------+------+------+------+------+------+------+------|
110 * | |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | |
111 * |------+------+------+------+------+------+------+------+------+------+------+------|
112 * | | | | | | | | | | | | |
113 * |------+------+------+------+------+-------------+------+------+------+------+------|
114 * | | | | | | | | | | | |
115 * `-----------------------------------------------------------------------------------'
116 */
117 [_MOVEMENT] = {
118 {_______, KC_MB2, KC_MUP, KC_MB1, KC_MWUP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______},
119 {_______, KC_MLFT, KC_MDN, KC_MRGT, KC_MWDN, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______},
120 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
121 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
122 },
123
124 /* Lower
125 * ,-----------------------------------------------------------------------------------.
126 * | ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | |
127 * |------+------+------+------+------+------+------+------+------+------+------+------|
128 * | Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | |
129 * |------+------+------+------+------+------+------+------+------+------+------+------|
130 * | | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | |
131 * |------+------+------+------+------+-------------+------+------+------+------+------|
132 * | | | | | | | | | | | |
133 * `-----------------------------------------------------------------------------------'
134 */
135 [_LOWER] = {
136 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_DEL, KC_END, KC_PGDN, _______},
137 {KC_CAPS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, XXXXXXX, _______},
138 {_______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, _______},
139 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
140 },
141
142 /* Raise
143 * ,-----------------------------------------------------------------------------------.
144 * | ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | |
145 * |------+------+------+------+------+------+------+------+------+------+------+------|
146 * | Caps | ^ | & | * | ( | ) | { | } | | | " | | |
147 * |------+------+------+------+------+------+------+------+------+------+------+------|
148 * | | F9 | F10 | F11 | F12 | | | | | | | |
149 * |------+------+------+------+------+-------------+------+------+------+------+------|
150 * | | | | | | | | | | | |
151 * `-----------------------------------------------------------------------------------'
152 */
153 [_RAISE] = {
154 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_INS, KC_HOME, KC_PGUP, _______},
155 {KC_CAPS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, XXXXXXX, _______},
156 {_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______},
157 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
158 },
159
160 /* Adjust (Lower + Raise)
161 * ,-----------------------------------------------------------------------------------.
162 * |Reset | | | | | | | | | | | |
163 * |------+------+------+------+------+------+------+------+------+------+------+------|
164 * | |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | |
165 * |------+------+------+------+------+------+------+------+------+------+------+------|
166 * | | | | | | | | | | | | |
167 * |------+------+------+------+------+-------------+------+------+------+------+------|
168 * | | | | | | | | | | | |
169 * `-----------------------------------------------------------------------------------'
170 */
171 [_ADJUST] = {
172 {RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
173 {_______, BL_STEP, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, QWERTY, ARROW, NUMPAD, _______, _______},
174 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
175 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
176 }
177
178};
179
180#ifdef AUDIO_ENABLE
181
182float tone_startup[][2] = SONG(STARTUP_SOUND);
183float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
184
185float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
186
187#endif
188
189bool process_record_user(uint16_t keycode, keyrecord_t *record)
190{
191 switch (keycode) {
192 case LOWER:
193 if (record->event.pressed) {
194 layer_on(_LOWER);
195 } else {
196 layer_off(_LOWER);
197 }
198 update_tri_layer(_LOWER, _RAISE, _ADJUST);
199 return false;
200 case RAISE:
201 if (record->event.pressed) {
202 layer_on(_RAISE);
203 } else {
204 layer_off(_RAISE);
205 }
206 update_tri_layer(_LOWER, _RAISE, _ADJUST);
207 return false;
208 case QWERTY:
209 if (record->event.pressed) {
210 layer_off(_ARROW);
211 layer_off(_NUMPAD);
212 }
213 return false;
214 case ARROW:
215 if (record->event.pressed) {
216 layer_off(_NUMPAD);
217 layer_on(_ARROW);
218 }
219 return false;
220 case NUMPAD:
221 if (record->event.pressed) {
222 layer_off(_ARROW);
223 layer_on(_NUMPAD);
224 }
225 return false;
226 }
227 return true;
228}
229
230void matrix_init_user(void)
231{
232#ifdef AUDIO_ENABLE
233 startup_user();
234#endif
235}
236
237#ifdef AUDIO_ENABLE
238
239void startup_user()
240{
241 _delay_ms(100); // gets rid of tick
242 PLAY_NOTE_ARRAY(tone_startup, false, 0);
243}
244
245void shutdown_user()
246{
247 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
248 _delay_ms(150);
249 stop_all_notes();
250}
251
252void music_on_user(void)
253{
254 music_scale_user();
255}
256
257void music_scale_user(void)
258{
259 PLAY_NOTE_ARRAY(music_scale, false, 0);
260}
261
262#endif
diff --git a/keyboards/planck/keymaps/lae3/readme.md b/keyboards/planck/keymaps/lae3/readme.md
new file mode 100644
index 000000000..57a2f38dd
--- /dev/null
+++ b/keyboards/planck/keymaps/lae3/readme.md
@@ -0,0 +1,111 @@
1# Lae3
2_Keymap based around mode-switching for extended functionality_
3
4## Base Layout
5
6 ┌-----------------------------------------------------------------------------------â”
7 | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
8 |------+------+------+------+------+------+------+------+------+------+------+------|
9 | Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
10 |------+------+------+------+------+------+------+------+------+------+------+------|
11 |Shift | Z | X | C | V | B | N | M | , | . | / |Shift |
12 |------+------+------+------+------+-------------+------+------+------+------+------|
13 | Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl |
14 └-----------------------------------------------------------------------------------┘
15
16This is more similar to a standard keyboard layout than the standard planck
17layout, but I have found that this is better for programming, especially for
18editor shortcuts.
19
20## Lower Layer
21
22 ┌-----------------------------------------------------------------------------------â”
23 | ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | |
24 |------+------+------+------+------+------+------+------+------+------+------+------|
25 | Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | |
26 |------+------+------+------+------+------+------+------+------+------+------+------|
27 | | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | |
28 |------+------+------+------+------+-------------+------+------+------+------+------|
29 | | | | | | | | | | | |
30 └-----------------------------------------------------------------------------------┘
31
32All the numbers are on one hand so that they can all be easily accessed when
33playing games. The punctuation was placed in a way that is as similar as
34possible the qwerty punctuation layout on a standard keyboard.
35
36## Raise Layer
37
38 ┌-----------------------------------------------------------------------------------â”
39 | ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | |
40 |------+------+------+------+------+------+------+------+------+------+------+------|
41 | Caps | ^ | & | * | ( | ) | { | } | | | " | | |
42 |------+------+------+------+------+------+------+------+------+------+------+------|
43 | | F9 | F10 | F11 | F12 | | | | | | | |
44 |------+------+------+------+------+-------------+------+------+------+------+------|
45 | | | | | | | | | | | |
46 └-----------------------------------------------------------------------------------┘
47
48This layer with the exception of the function and control keys is effectively
49the lower layer in combination with the shift key, like on the standard planck
50layout.
51
52## Movement Layer
53
54 ┌-----------------------------------------------------------------------------------â”
55 | |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | |
56 |------+------+------+------+------+------+------+------+------+------+------+------|
57 | |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | |
58 |------+------+------+------+------+------+------+------+------+------+------+------|
59 | | | | | | | | | | | | |
60 |------+------+------+------+------+-------------+------+------+------+------+------|
61 | | | | | | | | | | | |
62 └-----------------------------------------------------------------------------------┘
63
64Layer for simplifying movement.
65
66## Meta Layer
67
68 ┌-----------------------------------------------------------------------------------â”
69 |Reset | | | | | | | | | | | |
70 |------+------+------+------+------+------+------+------+------+------+------+------|
71 | |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | |
72 |------+------+------+------+------+------+------+------+------+------+------+------|
73 | | | | | | | | | | | | |
74 |------+------+------+------+------+-------------+------+------+------+------+------|
75 | | | | | | | | | | | |
76 └-----------------------------------------------------------------------------------┘
77
78This Layer is activated when pressing both the Lower and Raise keys. The Arrow
79and Numpad keys each activate a layer between the base layer and the Movement
80layer. The Qwerty key disables both of the layers leaving just the base layer
81active.
82
83## Arrow Layer
84
85 ┌-----------------------------------------------------------------------------------â”
86 | | | | | | | | | | | | |
87 |------+------+------+------+------+------+------+------+------+------+------+------|
88 | | | | | | | | | | | | |
89 |------+------+------+------+------+------+------+------+------+------+------+------|
90 | | | | | | | | | | | Up | |
91 |------+------+------+------+------+-------------+------+------+------+------+------|
92 | | | | | | | | | Left | Down | Right|
93 └-----------------------------------------------------------------------------------┘
94
95Replaces the bottom right of the keyboard with arrow keys for games like The
96Binding of Isaac.
97
98## Numpad Layer
99
100 ┌-----------------------------------------------------------------------------------â”
101 | | | | | | |NumLck| 7 | 8 | 9 | / | |
102 |------+------+------+------+------+------+------+------+------+------+------+------|
103 | | | | | | |Enter | 4 | 5 | 6 | * | |
104 |------+------+------+------+------+------+------+------+------+------+------+------|
105 | | | | | | | | 3 | 2 | 1 | - | |
106 |------+------+------+------+------+-------------+------+------+------+------+------|
107 | | | | | | | | 0 | . | + | |
108 └-----------------------------------------------------------------------------------┘
109
110Replaces the majority of the right side of the keyboard with a numpad because
111why not?
diff --git a/keyboards/planck/keymaps/lucas/keymap.c b/keyboards/planck/keymaps/lucas/keymap.c
index 2208780b1..491cd1d07 100644
--- a/keyboards/planck/keymaps/lucas/keymap.c
+++ b/keyboards/planck/keymaps/lucas/keymap.c
@@ -153,12 +153,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
153 case 1: // M(1) 153 case 1: // M(1)
154 if (record->event.pressed) { 154 if (record->event.pressed) {
155 unregister_code(KC_LSFT); 155 unregister_code(KC_LSFT);
156 register_code(DE_MORE); 156 register_code(DE_LESS);
157 } else { 157 } else {
158 unregister_code(DE_MORE); 158 unregister_code(DE_LESS);
159 } 159 }
160 break; 160 break;
161 } 161 }
162 return MACRO_NONE; 162 return MACRO_NONE;
163 163
164}; \ No newline at end of file 164};
diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h
index 82e4a25c6..adc1c69aa 100644
--- a/keyboards/planck/keymaps/priyadi/config.h
+++ b/keyboards/planck/keymaps/priyadi/config.h
@@ -27,7 +27,8 @@
27 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ 27 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
28 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ 28 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
29 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ 29 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
30 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \ 30 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
31 tp1, tp2, tp3 \
31) \ 32) \
32{ \ 33{ \
33 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \ 34 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \
diff --git a/keyboards/planck/keymaps/vifon/keymap.c b/keyboards/planck/keymaps/vifon/keymap.c
index ee0c0ac36..ecd5c2cc4 100644
--- a/keyboards/planck/keymaps/vifon/keymap.c
+++ b/keyboards/planck/keymaps/vifon/keymap.c
@@ -107,7 +107,8 @@ const uint16_t PROGMEM fn_actions[] = {
107bool process_record_user(uint16_t keycode, keyrecord_t *record) { 107bool process_record_user(uint16_t keycode, keyrecord_t *record) {
108 static uint16_t key_timer; 108 static uint16_t key_timer;
109 109
110 if (!process_record_dynamic_macro(keycode, record)) { 110 uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
111 if (!process_record_dynamic_macro(macro_kc, record)) {
111 return false; 112 return false;
112 } 113 }
113 114
diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c
index 5d217e261..a500a3649 100644
--- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c
+++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c
@@ -212,10 +212,10 @@ const uint16_t PROGMEM fn_actions[] = {
212 212
213#ifdef AUDIO_ENABLE 213#ifdef AUDIO_ENABLE
214float start_up[][2] = { 214float start_up[][2] = {
215 {440.0*pow(2.0,(14)/12.0), 20}, 215 MUSICAL_NOTE(_B5, 20),
216 {440.0*pow(2.0,(26)/12.0), 8}, 216 MUSICAL_NOTE(_B6, 8),
217 {440.0*pow(2.0,(18)/12.0), 20}, 217 MUSICAL_NOTE(_DS6, 20),
218 {440.0*pow(2.0,(26)/12.0), 8} 218 MUSICAL_NOTE(_B6, 8),
219}; 219};
220 220
221float tone_qwerty[][2] = SONG(QWERTY_SOUND); 221float tone_qwerty[][2] = SONG(QWERTY_SOUND);
@@ -323,7 +323,7 @@ void matrix_init_user(void) {
323 323
324#ifdef AUDIO_ENABLE 324#ifdef AUDIO_ENABLE
325 325
326void play_goodbye_tone() 326void play_goodbye_tone(void)
327{ 327{
328 PLAY_NOTE_ARRAY(goodbye, false, 0); 328 PLAY_NOTE_ARRAY(goodbye, false, 0);
329 _delay_ms(150); 329 _delay_ms(150);
diff --git a/keyboards/ps2avrGB/keymaps/default/keymap.c b/keyboards/ps2avrGB/keymaps/default/keymap.c
index 5c66cde59..3e4cebc81 100644
--- a/keyboards/ps2avrGB/keymaps/default/keymap.c
+++ b/keyboards/ps2avrGB/keymaps/default/keymap.c
@@ -18,14 +18,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "ps2avrGB.h" 18#include "ps2avrGB.h"
19 19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21 KEYMAP( \ 21 KC_KEYMAP(
22 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END, \ 22 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END,
23 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL, \ 23 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL,
24 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS, \ 24 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS,
25 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,\ 25 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,
26 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,\ 26 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,
27 LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT \ 27 LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT
28 ), 28 )
29}; 29};
30 30
31const uint16_t PROGMEM fn_actions[] = { 31const uint16_t PROGMEM fn_actions[] = {
diff --git a/keyboards/ps2avrGB/ps2avrGB.h b/keyboards/ps2avrGB/ps2avrGB.h
index 6432e3be9..813f31f80 100644
--- a/keyboards/ps2avrGB/ps2avrGB.h
+++ b/keyboards/ps2avrGB/ps2avrGB.h
@@ -22,6 +22,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
22#include "action.h" 22#include "action.h"
23 23
24#define KEYMAP( \ 24#define KEYMAP( \
25 K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
26 K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
27 K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
28 K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
29 K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
30 K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \
31){ \
32 { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KD0, KE0 }, \
33 { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \
34 { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KE2 }, \
35 { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \
36 { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \
37 { K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \
38 { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \
39 { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \
40}
41
42#define KC_KEYMAP( \
25 K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \ 43 K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
26 K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \ 44 K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
27 K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \ 45 K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
diff --git a/keyboards/s60-x/config.h b/keyboards/s60-x/config.h
deleted file mode 100644
index ac7951c24..000000000
--- a/keyboards/s60-x/config.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2016 Julien Pecqueur <julien@peclu.net>
4Copyright 2016 Felix Uhl <ifreilicht@gmail.com>
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef CONFIG_H
21#define CONFIG_H
22
23#include "config_common.h"
24
25/* USB Device descriptor parameter */
26#define VENDOR_ID 0xFEED
27#define PRODUCT_ID 0x6060
28#define DEVICE_VER 0x0001
29#define MANUFACTURER Massdrop
30#define PRODUCT S60-X
31#define DESCRIPTION q.m.k. keyboard firmware for S60-X
32
33/* key matrix size */
34#define MATRIX_ROWS 5
35#define MATRIX_COLS 15
36
37/*
38 * Keyboard Matrix Assignments
39 *
40 * Change this to how you wired your keyboard
41 * COLS: AVR pins used for columns, left to right
42 * ROWS: AVR pins used for rows, top to bottom
43 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
44 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
45 *
46*/
47#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 }
48#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 }
49#define UNUSED_PINS { F0 }
50
51/* COL2ROW or ROW2COL */
52#define DIODE_DIRECTION COL2ROW
53
54// #define BACKLIGHT_PIN B7
55// #define BACKLIGHT_BREATHING
56// #define BACKLIGHT_LEVELS 3
57
58
59/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
60#define DEBOUNCING_DELAY 5
61
62/* define if matrix has ghost (lacks anti-ghosting diodes) */
63//#define MATRIX_HAS_GHOST
64
65/* number of backlight levels */
66
67/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
68#define LOCKING_SUPPORT_ENABLE
69/* Locking resynchronize hack */
70#define LOCKING_RESYNC_ENABLE
71
72/*
73 * Force NKRO
74 *
75 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
76 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
77 * makefile for this to work.)
78 *
79 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
80 * until the next keyboard reset.
81 *
82 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
83 * fully operational during normal computer usage.
84 *
85 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
86 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
87 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
88 * power-up.
89 *
90 */
91//#define FORCE_NKRO
92
93/*
94 * Magic Key Options
95 *
96 * Magic keys are hotkey commands that allow control over firmware functions of
97 * the keyboard. They are best used in combination with the HID Listen program,
98 * found here: https://www.pjrc.com/teensy/hid_listen.html
99 *
100 * The options below allow the magic key functionality to be changed. This is
101 * useful if your keyboard/keypad is missing keys and you want magic key support.
102 *
103 */
104
105/* key combination for magic key command */
106#define IS_COMMAND() ( \
107 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
108)
109
110/* control how magic key switches layers */
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
113//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
114
115/* override magic key keymap */
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
117//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
118//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
119//#define MAGIC_KEY_HELP1 H
120//#define MAGIC_KEY_HELP2 SLASH
121//#define MAGIC_KEY_DEBUG D
122//#define MAGIC_KEY_DEBUG_MATRIX X
123//#define MAGIC_KEY_DEBUG_KBD K
124//#define MAGIC_KEY_DEBUG_MOUSE M
125//#define MAGIC_KEY_VERSION V
126//#define MAGIC_KEY_STATUS S
127//#define MAGIC_KEY_CONSOLE C
128//#define MAGIC_KEY_LAYER0_ALT1 ESC
129//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
130//#define MAGIC_KEY_LAYER0 0
131//#define MAGIC_KEY_LAYER1 1
132//#define MAGIC_KEY_LAYER2 2
133//#define MAGIC_KEY_LAYER3 3
134//#define MAGIC_KEY_LAYER4 4
135//#define MAGIC_KEY_LAYER5 5
136//#define MAGIC_KEY_LAYER6 6
137//#define MAGIC_KEY_LAYER7 7
138//#define MAGIC_KEY_LAYER8 8
139//#define MAGIC_KEY_LAYER9 9
140//#define MAGIC_KEY_BOOTLOADER PAUSE
141//#define MAGIC_KEY_LOCK CAPS
142//#define MAGIC_KEY_EEPROM E
143//#define MAGIC_KEY_NKRO N
144//#define MAGIC_KEY_SLEEP_LED Z
145
146/*
147 * Feature disable options
148 * These options are also useful to firmware size reduction.
149 */
150
151/* disable debug print */
152//#define NO_DEBUG
153
154/* disable print */
155//#define NO_PRINT
156
157/* disable action features */
158//#define NO_ACTION_LAYER
159//#define NO_ACTION_TAPPING
160#define NO_ACTION_ONESHOT
161#define NO_ACTION_MACRO
162#define NO_ACTION_FUNCTION
163
164#endif
diff --git a/keyboards/s60-x/s60-x_precompiled.zip b/keyboards/s60-x/s60-x_precompiled.zip
deleted file mode 100644
index 00d99ca8a..000000000
--- a/keyboards/s60-x/s60-x_precompiled.zip
+++ /dev/null
Binary files differ
diff --git a/keyboards/s60_x/Makefile b/keyboards/s60_x/Makefile
new file mode 100644
index 000000000..879e493a2
--- /dev/null
+++ b/keyboards/s60_x/Makefile
@@ -0,0 +1,5 @@
1SUBPROJECT_DEFAULT = default
2
3ifndef MAKEFILE_INCLUDED
4 include ../../Makefile
5endif \ No newline at end of file
diff --git a/keyboards/s60_x/config.h b/keyboards/s60_x/config.h
new file mode 100644
index 000000000..8b97b3c81
--- /dev/null
+++ b/keyboards/s60_x/config.h
@@ -0,0 +1,59 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3Copyright 2016 Julien Pecqueur <julien@peclu.net>
4Copyright 2016 Felix Uhl <ifreilicht@gmail.com>
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef CONFIG_H
21#define CONFIG_H
22
23#include "config_common.h"
24
25/* USB Device descriptor parameter */
26#define VENDOR_ID 0xFEED
27#define PRODUCT_ID 0x6060
28#define DEVICE_VER 0x0001
29#define MANUFACTURER Massdrop
30
31/* key matrix size */
32#define MATRIX_ROWS 5
33#define MATRIX_COLS 15
34
35/* number of backlight levels */
36#define BACKLIGHT_PIN B7
37#ifdef BACKLIGHT_PIN
38#define BACKLIGHT_LEVELS 3
39#endif
40
41/* COL2ROW or ROW2COL */
42#define DIODE_DIRECTION COL2ROW
43
44/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
45#define DEBOUNCING_DELAY 5
46
47/* key combination for command */
48#define IS_COMMAND() ( \
49 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
50)
51
52#ifdef SUBPROJECT_default
53 #include "default/config.h"
54#endif
55#ifdef SUBPROJECT_rgb
56 #include "rgb/config.h"
57#endif
58
59#endif
diff --git a/keyboards/s60_x/default/Makefile b/keyboards/s60_x/default/Makefile
new file mode 100644
index 000000000..191c6bb66
--- /dev/null
+++ b/keyboards/s60_x/default/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/s60_x/default/config.h b/keyboards/s60_x/default/config.h
new file mode 100644
index 000000000..436c6fa8b
--- /dev/null
+++ b/keyboards/s60_x/default/config.h
@@ -0,0 +1,25 @@
1#ifndef DEFAULT_CONFIG_H
2#define DEFAULT_CONFIG_H
3
4#include "../config.h"
5
6#define PRODUCT S60-X
7#define DESCRIPTION q.m.k. keyboard firmware for S60-X
8
9#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 }
10#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 }
11#define UNUSED_PINS { F0 }
12
13#define LOCKING_SUPPORT_ENABLE
14#define LOCKING_RESYNC_ENABLE
15
16/* key combination for magic key command */
17#define IS_COMMAND() ( \
18 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
19)
20
21#define NO_ACTION_ONESHOT
22#define NO_ACTION_MACRO
23#define NO_ACTION_FUNCTION
24
25#endif
diff --git a/keyboards/s60-x/s60-x.c b/keyboards/s60_x/default/default.c
index 417358140..253f5495c 100644
--- a/keyboards/s60-x/s60-x.c
+++ b/keyboards/s60_x/default/default.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "default.h"
2 2
3void matrix_init_kb(void) { 3void matrix_init_kb(void) {
4 // put your keyboard start-up code here 4 // put your keyboard start-up code here
diff --git a/keyboards/s60-x/s60-x.h b/keyboards/s60_x/default/default.h
index 29a2a27b2..86233ef7e 100644
--- a/keyboards/s60-x/s60-x.h
+++ b/keyboards/s60_x/default/default.h
@@ -1,6 +1,6 @@
1/* 1/*
2Copyright 2012,2013 Jun Wako <wakojun@gmail.com> 2Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
3Copyright 2015 Vinícius Nery Cordeiro <vinicius.nery.cordeiro@gmail.com> 3Copyright 2015 Vin�cius Nery Cordeiro <vinicius.nery.cordeiro@gmail.com>
4Copyright 2016 Felix Uhl <ifreilicht@gmail.com> 4Copyright 2016 Felix Uhl <ifreilicht@gmail.com>
5 5
6This program is free software: you can redistribute it and/or modify 6This program is free software: you can redistribute it and/or modify
@@ -17,14 +17,14 @@ You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>. 17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/ 18*/
19 19
20#ifndef S60X_H 20#ifndef DEFAULT_H
21#define S60X_H 21#define DEFAULT_H
22 22
23#include "quantum.h" 23#include "quantum.h"
24 24
25#ifdef __INTELLISENSE__ 25#ifdef __INTELLISENSE__
26#define PROGMEM 26#define PROGMEM
27#include "config.h" 27#include "../config.h"
28#endif 28#endif
29 29
30/* S60-X keymap definition macro 30/* S60-X keymap definition macro
@@ -66,4 +66,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
66 { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_NO } \ 66 { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_NO } \
67} 67}
68 68
69#endif 69#endif \ No newline at end of file
diff --git a/keyboards/s60_x/default/rules.mk b/keyboards/s60_x/default/rules.mk
new file mode 100644
index 000000000..aaa3764df
--- /dev/null
+++ b/keyboards/s60_x/default/rules.mk
@@ -0,0 +1,9 @@
1CONSOLE_ENABLE ?= no # Console for debug(+400)
2COMMAND_ENABLE ?= no # Commands for debug and configuration
3NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
4BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
5RGBLIGHT_ENABLE ?= no
6
7ifndef QUANTUM_DIR
8 include ../../../Makefile
9endif \ No newline at end of file
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/Makefile b/keyboards/s60_x/keymaps/ansi_qwertz/Makefile
index 6a078bcc3..6a078bcc3 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/Makefile
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/Makefile
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/config.h b/keyboards/s60_x/keymaps/ansi_qwertz/config.h
index 6c01d579f..6c01d579f 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/config.h
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/config.h
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png
index 168780c82..168780c82 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png
Binary files differ
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg
index f03858993..f03858993 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg
index 2304b2a4c..2304b2a4c 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.png
index 875eb3652..875eb3652 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.png
Binary files differ
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg
index 1ca6a9c87..1ca6a9c87 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/KB_US-International.svg
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG b/keyboards/s60_x/keymaps/ansi_qwertz/docs/base_layer.PNG
index c730c2d65..c730c2d65 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/base_layer.PNG
Binary files differ
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG b/keyboards/s60_x/keymaps/ansi_qwertz/docs/function_layer.PNG
index fae2439ca..fae2439ca 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/function_layer.PNG
Binary files differ
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG b/keyboards/s60_x/keymaps/ansi_qwertz/docs/gaming_layer.PNG
index 59b202be2..59b202be2 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/docs/gaming_layer.PNG
Binary files differ
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c b/keyboards/s60_x/keymaps/ansi_qwertz/keymap.c
index 317a245be..ebb3aece3 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/keymap.c
@@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License
14along with this program. If not, see <http://www.gnu.org/licenses/>. 14along with this program. If not, see <http://www.gnu.org/licenses/>.
15*/ 15*/
16 16
17#include "s60-x.h" 17#include "s60_x.h"
18 18
19//make keymap a little easier to read 19//make keymap a little easier to read
20#define _______ KC_TRNS 20#define _______ KC_TRNS
diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60_x/keymaps/ansi_qwertz/readme.md
index b22010612..b22010612 100644
--- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md
+++ b/keyboards/s60_x/keymaps/ansi_qwertz/readme.md
diff --git a/keyboards/s60-x/keymaps/custom/keymap.c b/keyboards/s60_x/keymaps/custom/keymap.c
index fb2a40b85..66eac3335 100644
--- a/keyboards/s60-x/keymaps/custom/keymap.c
+++ b/keyboards/s60_x/keymaps/custom/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* Main layer: Test layout, using all keys. 3/* Main layer: Test layout, using all keys.
4 4
diff --git a/keyboards/s60-x/keymaps/custom/readme.md b/keyboards/s60_x/keymaps/custom/readme.md
index cf87bd915..cf87bd915 100644
--- a/keyboards/s60-x/keymaps/custom/readme.md
+++ b/keyboards/s60_x/keymaps/custom/readme.md
diff --git a/keyboards/s60_x/keymaps/dbroqua/keymap.c b/keyboards/s60_x/keymaps/dbroqua/keymap.c
new file mode 100644
index 000000000..8d1887e75
--- /dev/null
+++ b/keyboards/s60_x/keymaps/dbroqua/keymap.c
@@ -0,0 +1,205 @@
1#include "s60_x.h"
2
3#define _DEFAULT 0
4#define _FN 1
5#define _SFX 2
6
7// Fillers to make layering more clear
8#define ______ KC_TRNS
9
10const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11/* Qwerty gui/alt/space/alt/gui
12 * ,-----------------------------------------------------------------------------------------.
13 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
14 * |-----------------------------------------------------------------------------------------+
15 * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
16 * |-----------------------------------------------------------------------------------------+
17 * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
18 * |-----------------------------------------------------------------------------------------+
19 * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
20 * |-----------------------------------------------------------------------------------------+
21 * |LGUI | LAlt | Space | RAlt |RGUI |
22 * `-----------------------------------------------------------------'
23 */
24 [_DEFAULT] = KEYMAP( /* Basic QWERTY */
25 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, \
26 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
27 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, \
28 KC_LSFT, ______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ______, KC_RSFT, MO(_FN), \
29 ______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \
30 ),
31
32/* FN Layer
33 * ,-----------------------------------------------------------------------------------------.
34 * | SFX | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
35 * |-----------------------------------------------------------------------------------------+
36 * | CAPS | | | | | | | | Psc | Slck| Paus| Up | | |
37 * |-----------------------------------------------------------------------------------------+
38 * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
39 * |-----------------------------------------------------------------------------------------+
40 * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
41 * |-----------------------------------------------------------------------------------------+
42 * | | | | Stop | |
43 * `-----------------------------------------------------------------'
44 */
45 [_FN] = KEYMAP( /* Layer 1 */
46 TG(_SFX),KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
47 KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
48 ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, ______, \
49 ______, ______, KC_MPRV, KC_MPLY, KC_MNXT,______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN,______, ______, ______, \
50 ______, ______, ______, ______, KC_MSTP, ______, ______, ______ \
51 ),
52
53
54/* SFX Layer
55 * ,-----------------------------------------------------------------------------------------.
56 * | | | | | | | | | | | | | | | |
57 * |-----------------------------------------------------------------------------------------+
58 * | | BL- | BL+ | BL | | | | | | | | | | |
59 * |-----------------------------------------------------------------------------------------+
60 * | | RGBT| RGBM| | | | | | | | | | |
61 * |-----------------------------------------------------------------------------------------+
62 * | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | |
63 * |-----------------------------------------------------------------------------------------+
64 * | | | | | |
65 * `-----------------------------------------------------------------'
66 */
67 [_SFX] = KEYMAP(
68 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
69 ______, BL_TOGG,BL_STEP,BL_DEC, BL_INC, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
70 ______, F(0), F(1), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
71 ______, ______, F(2), F(3), F(4), F(5), F(6), F(7), ______, ______, ______, ______, ______, ______, ______, \
72 ______, ______, ______, ______, ______, ______, ______, ______ \
73 )
74};
75
76const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
77 return MACRO_NONE;
78}
79
80enum function_id {
81 RGBLED_TOGGLE,
82 RGBLED_STEP_MODE,
83 RGBLED_INCREASE_HUE,
84 RGBLED_DECREASE_HUE,
85 RGBLED_INCREASE_SAT,
86 RGBLED_DECREASE_SAT,
87 RGBLED_INCREASE_VAL,
88 RGBLED_DECREASE_VAL
89};
90
91const uint16_t PROGMEM fn_actions[] = {
92 [0] = ACTION_FUNCTION(RGBLED_TOGGLE),
93 [1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
94 [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
95 [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
96 [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
97 [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
98 [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
99 [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL)
100};
101
102void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
103 switch (id) {
104 case RGBLED_TOGGLE:
105 if (record->event.pressed) {
106 #ifdef RGB_ENABLE
107 rgblight_toggle();
108 #endif
109 }
110 break;
111 case RGBLED_INCREASE_HUE:
112 if (record->event.pressed) {
113 #ifdef RGB_ENABLE
114 rgblight_increase_hue();
115 #endif
116 }
117 break;
118 case RGBLED_DECREASE_HUE:
119 if (record->event.pressed) {
120 #ifdef RGB_ENABLE
121 rgblight_decrease_hue();
122 #endif
123 }
124 break;
125 case RGBLED_INCREASE_SAT:
126 if (record->event.pressed) {
127 #ifdef RGB_ENABLE
128 rgblight_increase_sat();
129 #endif
130 }
131 break;
132 case RGBLED_DECREASE_SAT:
133 if (record->event.pressed) {
134 #ifdef RGB_ENABLE
135 rgblight_decrease_sat();
136 #endif
137 }
138 break;
139 case RGBLED_INCREASE_VAL:
140 if (record->event.pressed) {
141 #ifdef RGB_ENABLE
142 rgblight_increase_val();
143 #endif
144 }
145 break;
146 case RGBLED_DECREASE_VAL:
147 if (record->event.pressed) {
148 #ifdef RGB_ENABLE
149 rgblight_decrease_val();
150 #endif
151 }
152 break;
153 case RGBLED_STEP_MODE:
154 if (record->event.pressed) {
155 #ifdef RGB_ENABLE
156 rgblight_step();
157 #endif
158 }
159 break;
160 }
161}
162
163void matrix_init_user(void) {
164}
165
166void matrix_scan_user(void) {
167}
168
169bool process_record_user(uint16_t keycode, keyrecord_t *record) {
170 return true;
171}
172
173void led_set_user(uint8_t usb_led) {
174
175 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
176
177 } else {
178
179 }
180
181 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
182
183 } else {
184
185 }
186
187 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
188
189 } else {
190
191 }
192
193 if (usb_led & (1 << USB_LED_COMPOSE)) {
194
195 } else {
196
197 }
198
199 if (usb_led & (1 << USB_LED_KANA)) {
200
201 } else {
202
203 }
204
205} \ No newline at end of file
diff --git a/keyboards/s60-x/keymaps/default/keymap.c b/keyboards/s60_x/keymaps/default/keymap.c
index eb0c6b056..a616e79b3 100644
--- a/keyboards/s60-x/keymaps/default/keymap.c
+++ b/keyboards/s60_x/keymaps/default/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* 0: Main layer 3/* 0: Main layer
4┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠4┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────â”
diff --git a/keyboards/s60-x/keymaps/default/readme.md b/keyboards/s60_x/keymaps/default/readme.md
index 01cda9df9..01cda9df9 100644
--- a/keyboards/s60-x/keymaps/default/readme.md
+++ b/keyboards/s60_x/keymaps/default/readme.md
diff --git a/keyboards/s60-x/keymaps/hasu/keymap.c b/keyboards/s60_x/keymaps/hasu/keymap.c
index cbeaae028..ac90dc6b2 100644
--- a/keyboards/s60-x/keymaps/hasu/keymap.c
+++ b/keyboards/s60_x/keymaps/hasu/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* 3/*
4 * Hasu 4 * Hasu
diff --git a/keyboards/s60-x/keymaps/hasu/readme.md b/keyboards/s60_x/keymaps/hasu/readme.md
index 64969b616..64969b616 100644
--- a/keyboards/s60-x/keymaps/hasu/readme.md
+++ b/keyboards/s60_x/keymaps/hasu/readme.md
diff --git a/keyboards/s60-x/keymaps/hhkb/keymap.c b/keyboards/s60_x/keymaps/hhkb/keymap.c
index 9afd1247f..dc1bfffc4 100644
--- a/keyboards/s60-x/keymaps/hhkb/keymap.c
+++ b/keyboards/s60_x/keymaps/hhkb/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* 3/*
4 * HHKB Layout 4 * HHKB Layout
diff --git a/keyboards/s60-x/keymaps/hhkb/readme.md b/keyboards/s60_x/keymaps/hhkb/readme.md
index 2bceb26dd..2bceb26dd 100644
--- a/keyboards/s60-x/keymaps/hhkb/readme.md
+++ b/keyboards/s60_x/keymaps/hhkb/readme.md
diff --git a/keyboards/s60-x/keymaps/iso/keymap.c b/keyboards/s60_x/keymaps/iso/keymap.c
index 43a9c48b0..f6fc74172 100644
--- a/keyboards/s60-x/keymaps/iso/keymap.c
+++ b/keyboards/s60_x/keymaps/iso/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* 0: Main layer 3/* 0: Main layer
4┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠4┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────â”
diff --git a/keyboards/s60-x/keymaps/iso/readme.md b/keyboards/s60_x/keymaps/iso/readme.md
index 2c06bf86f..2c06bf86f 100644
--- a/keyboards/s60-x/keymaps/iso/readme.md
+++ b/keyboards/s60_x/keymaps/iso/readme.md
diff --git a/keyboards/s60-x/keymaps/jpec/keymap.c b/keyboards/s60_x/keymaps/jpec/keymap.c
index c8fc13328..21e77c10b 100644
--- a/keyboards/s60-x/keymaps/jpec/keymap.c
+++ b/keyboards/s60_x/keymaps/jpec/keymap.c
@@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License
14along with this program. If not, see <http://www.gnu.org/licenses/>. 14along with this program. If not, see <http://www.gnu.org/licenses/>.
15*/ 15*/
16 16
17#include "s60-x.h" 17#include "s60_x.h"
18 18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 /* Layout 0: Default Layer 20 /* Layout 0: Default Layer
diff --git a/keyboards/s60-x/keymaps/jpec/readme.md b/keyboards/s60_x/keymaps/jpec/readme.md
index 73318dad7..73318dad7 100644
--- a/keyboards/s60-x/keymaps/jpec/readme.md
+++ b/keyboards/s60_x/keymaps/jpec/readme.md
diff --git a/keyboards/s60-x/keymaps/plain/keymap.c b/keyboards/s60_x/keymaps/plain/keymap.c
index 790ac88e7..d5075a07b 100644
--- a/keyboards/s60-x/keymaps/plain/keymap.c
+++ b/keyboards/s60_x/keymaps/plain/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* Main layer: 3/* Main layer:
4┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠4┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────â”
diff --git a/keyboards/s60-x/keymaps/plain/readme.md b/keyboards/s60_x/keymaps/plain/readme.md
index ab13323e3..ab13323e3 100644
--- a/keyboards/s60-x/keymaps/plain/readme.md
+++ b/keyboards/s60_x/keymaps/plain/readme.md
diff --git a/keyboards/s60-x/keymaps/poker/keymap.c b/keyboards/s60_x/keymaps/poker/keymap.c
index 0a8691792..5b917704e 100644
--- a/keyboards/s60-x/keymaps/poker/keymap.c
+++ b/keyboards/s60_x/keymaps/poker/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 /* 0: qwerty 4 /* 0: qwerty
diff --git a/keyboards/s60-x/keymaps/poker/readme.md b/keyboards/s60_x/keymaps/poker/readme.md
index 0d8be9d0f..0d8be9d0f 100644
--- a/keyboards/s60-x/keymaps/poker/readme.md
+++ b/keyboards/s60_x/keymaps/poker/readme.md
diff --git a/keyboards/s60-x/keymaps/poker_bit/keymap.c b/keyboards/s60_x/keymaps/poker_bit/keymap.c
index 7626038f4..1f7b1b633 100644
--- a/keyboards/s60-x/keymaps/poker_bit/keymap.c
+++ b/keyboards/s60_x/keymaps/poker_bit/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3// Poker fix with toggle and bit operation 3// Poker fix with toggle and bit operation
4// Fn + Esc = ` 4// Fn + Esc = `
diff --git a/keyboards/s60-x/keymaps/poker_bit/readme.md b/keyboards/s60_x/keymaps/poker_bit/readme.md
index 0d8be9d0f..0d8be9d0f 100644
--- a/keyboards/s60-x/keymaps/poker_bit/readme.md
+++ b/keyboards/s60_x/keymaps/poker_bit/readme.md
diff --git a/keyboards/s60-x/keymaps/poker_set/keymap.c b/keyboards/s60_x/keymaps/poker_set/keymap.c
index 09423e75b..52eee5321 100644
--- a/keyboards/s60-x/keymaps/poker_set/keymap.c
+++ b/keyboards/s60_x/keymaps/poker_set/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3// Poker fix with set(state transition) 3// Poker fix with set(state transition)
4// Fn + Esc = ` 4// Fn + Esc = `
diff --git a/keyboards/s60-x/keymaps/poker_set/readme.md b/keyboards/s60_x/keymaps/poker_set/readme.md
index 0d8be9d0f..0d8be9d0f 100644
--- a/keyboards/s60-x/keymaps/poker_set/readme.md
+++ b/keyboards/s60_x/keymaps/poker_set/readme.md
diff --git a/keyboards/s60-x/keymaps/spacefn/keymap.c b/keyboards/s60_x/keymaps/spacefn/keymap.c
index b6dc7ca7e..28369580e 100644
--- a/keyboards/s60-x/keymaps/spacefn/keymap.c
+++ b/keyboards/s60_x/keymaps/spacefn/keymap.c
@@ -1,4 +1,4 @@
1#include "s60-x.h" 1#include "s60_x.h"
2 2
3/* 3/*
4 * SpaceFN 4 * SpaceFN
diff --git a/keyboards/s60-x/keymaps/spacefn/readme.md b/keyboards/s60_x/keymaps/spacefn/readme.md
index d04bd9486..d04bd9486 100644
--- a/keyboards/s60-x/keymaps/spacefn/readme.md
+++ b/keyboards/s60_x/keymaps/spacefn/readme.md
diff --git a/keyboards/s60-x/readme.md b/keyboards/s60_x/readme.md
index 408ad13ac..e30b2f76c 100644
--- a/keyboards/s60-x/readme.md
+++ b/keyboards/s60_x/readme.md
@@ -5,11 +5,6 @@ DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps
5## S60X Resources 5## S60X Resources
6- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) 6- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open)
7 7
8## Quickstart
9
10If you just want to test a few layouts, the archive [s60-x_precompiled.zip](s60-x_precompiled.zip) contains pre-compiled .hex-files for all available keymaps. Not all of them are tested.
11You only need to flash them onto your keyboard, which is explained below, there's no need to setup a build environment. For a full list
12
13## Flashing your keyboard 8## Flashing your keyboard
14The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows). 9The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows).
15 10
diff --git a/keyboards/s60_x/rgb/Makefile b/keyboards/s60_x/rgb/Makefile
new file mode 100644
index 000000000..bd09e5885
--- /dev/null
+++ b/keyboards/s60_x/rgb/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile
3endif
diff --git a/keyboards/s60_x/rgb/config.h b/keyboards/s60_x/rgb/config.h
new file mode 100644
index 000000000..81efc87d5
--- /dev/null
+++ b/keyboards/s60_x/rgb/config.h
@@ -0,0 +1,32 @@
1#ifndef RBG_CONFIG_H
2#define RBG_CONFIG_H
3
4#include "../config.h"
5
6#define PRODUCT S60-X-RGB
7#define DESCRIPTION q.m.k. keyboard firmware for S60-X RGB
8
9/* key matrix pins */
10#define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 }
11#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 }
12#define UNUSED_PINS
13
14/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
15#define LOCKING_SUPPORT_ENABLE
16
17/* Locking resynchronize hack */
18#define LOCKING_RESYNC_ENABLE
19
20/* prevent stuck modifiers */
21#define PREVENT_STUCK_MODIFIERS
22
23#define RGB_DI_PIN F6
24#ifdef RGB_DI_PIN
25#define RGBLIGHT_ANIMATIONS
26#define RGBLED_NUM 10
27#define RGBLIGHT_HUE_STEP 8
28#define RGBLIGHT_SAT_STEP 8
29#define RGBLIGHT_VAL_STEP 8
30#endif
31
32#endif \ No newline at end of file
diff --git a/keyboards/s60_x/rgb/rgb.c b/keyboards/s60_x/rgb/rgb.c
new file mode 100644
index 000000000..0117e14ae
--- /dev/null
+++ b/keyboards/s60_x/rgb/rgb.c
@@ -0,0 +1 @@
#include "rgb.h"
diff --git a/keyboards/s60_x/rgb/rgb.h b/keyboards/s60_x/rgb/rgb.h
new file mode 100644
index 000000000..cb7a5f567
--- /dev/null
+++ b/keyboards/s60_x/rgb/rgb.h
@@ -0,0 +1,37 @@
1#ifndef S60XRGB_H
2#define S60XRGB_H
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
8 K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
9 K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \
10 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \
11 K400, K401, K402, K406, K410, K411, K412, K413 \
12) { \
13 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
14 { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
15 { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \
16 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \
17 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \
18}
19
20/*This special definition is used for S60-X keymaps that were ported from TMK
21 * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended
22 */
23#define LEGACY_KEYMAP( \
24 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
25 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
26 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
27 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
28 K40, K41, K42, K46, K4A, K4B, K4C, K4D \
29) { \
30 { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \
31 { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO }, \
32 { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO }, \
33 { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \
34 { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_NO } \
35}
36
37#endif \ No newline at end of file
diff --git a/keyboards/s60_x/rgb/rules.mk b/keyboards/s60_x/rgb/rules.mk
new file mode 100644
index 000000000..6953cc6d6
--- /dev/null
+++ b/keyboards/s60_x/rgb/rules.mk
@@ -0,0 +1,9 @@
1CONSOLE_ENABLE ?= no # Console for debug(+400)
2COMMAND_ENABLE ?= no # Commands for debug and configuration
3NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
4BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
5RGBLIGHT_ENABLE ?= yes # Enable RGB light
6
7ifndef QUANTUM_DIR
8 include ../../../Makefile
9endif \ No newline at end of file
diff --git a/keyboards/s60-x/rules.mk b/keyboards/s60_x/rules.mk
index 7ec93933a..0c568efe9 100644
--- a/keyboards/s60-x/rules.mk
+++ b/keyboards/s60_x/rules.mk
@@ -56,13 +56,9 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
56BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) 56BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
57MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) 57MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
58EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) 58EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
59CONSOLE_ENABLE ?= yes # Console for debug(+400)
60COMMAND_ENABLE ?= yes # Commands for debug and configuration
61# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
62SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
63# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
64NKRO_ENABLE ?= no # USB Nkey Rollover
65BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
66MIDI_ENABLE ?= no # MIDI controls 62MIDI_ENABLE ?= no # MIDI controls
67UNICODE_ENABLE ?= no # Unicode 63UNICODE_ENABLE ?= no # Unicode
68BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID 64BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
diff --git a/keyboards/s60_x/s60_x.c b/keyboards/s60_x/s60_x.c
new file mode 100644
index 000000000..595418bfa
--- /dev/null
+++ b/keyboards/s60_x/s60_x.c
@@ -0,0 +1 @@
#include "s60_x.h" \ No newline at end of file
diff --git a/keyboards/s60_x/s60_x.h b/keyboards/s60_x/s60_x.h
new file mode 100644
index 000000000..5bf8cfcef
--- /dev/null
+++ b/keyboards/s60_x/s60_x.h
@@ -0,0 +1,13 @@
1#ifndef S60X_H
2#define S60X_H
3
4#ifdef SUBPROJECT_default
5 #include "default.h"
6#endif
7#ifdef SUBPROJECT_rgb
8 #include "rgb.h"
9#endif
10
11#include "quantum.h"
12
13#endif
diff --git a/keyboards/tv44/keymaps/xyverz/keymap.c b/keyboards/tv44/keymaps/xyverz/keymap.c
index 00347b019..3ff16de35 100644
--- a/keyboards/tv44/keymaps/xyverz/keymap.c
+++ b/keyboards/tv44/keymaps/xyverz/keymap.c
@@ -4,16 +4,23 @@
4 4
5extern keymap_config_t keymap_config; 5extern keymap_config_t keymap_config;
6 6
7#define _DV 0 7enum planck_layers {
8#define _QW 1 8 _QWERTY,
9#define _CM 2 9 _COLEMAK,
10#define _L1 3 10 _DVORAK,
11#define _L2 4 11 _LOWER,
12 _RAISE,
13 _ADJUST
14};
12 15
13// Macro name shortcuts 16enum planck_keycodes {
14#define DVORAK M(_DV) 17 DVORAK = SAFE_RANGE,
15#define QWERTY M(_QW) 18 QWERTY,
16#define COLEMAK M(_CM) 19 COLEMAK,
20 LOWER,
21 RAISE,
22 ADJUST
23};
17 24
18// Fillers to make layering more clear 25// Fillers to make layering more clear
19#define _______ KC_TRNS 26#define _______ KC_TRNS
@@ -21,45 +28,47 @@ extern keymap_config_t keymap_config;
21 28
22 29
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24 [_DV] = { /* 0: Dvorak */ 31 [_DVORAK] = { /* 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_SLSH }, 32 {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, LT(_L2, KC_MINS)}, 33 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, 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 }, 34 {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_BSLS, KC_EQL, XXXXXXX, KC_ENT } 35 {KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
29 }, 36 },
30 37
31 [_QW] = { /* 1: Qwerty */ 38 [_QWERTY] = { /* 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 }, 39 {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, LT(_L2, KC_QUOT)}, 40 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, 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 }, 41 {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, KC_ENT } 42 {KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
36 }, 43 },
37 44
38 [_CM] = { /* 2: Colemak */ 45 [_COLEMAK] = { /* 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 }, 46 {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, LT(_L2, KC_QUOT)}, 47 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, 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 }, 48 {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, KC_ENT } 49 {KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
43 }, 50 },
44 51
45 [_L1] = {/* 1: FN 1 */ 52 [_LOWER] = {/* 1: FN 1 */
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 }, 53 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE},
47 {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, 54 {_______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
48 {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, 55 {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______},
49 {KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_EQL, _______, _______ } 56 {KC_LEFT, KC_RGHT, _______, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, _______, KC_UP, XXXXXXX, KC_DOWN}
50 }, 57 },
51 58
52 [_L2] = { /* 2: FN 2 */ 59 [_RAISE] = { /* 2: FN 2 */
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 }, 60 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS},
54 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_HOME, KC_PGUP, KC_VOLU, _______ }, 61 {_______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
55 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, 62 {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______},
56 {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PLUS, _______, _______ } 63 {KC_LEFT, KC_RGHT, _______, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, _______, KC_UP, XXXXXXX, KC_DOWN}
57 } 64 },
58
59};
60
61const uint16_t PROGMEM fn_actions[] = {
62 65
66 [_ADJUST] = {
67 {KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 },
68 {_______, RESET, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______},
69 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
70 {KC_HOME, KC_END, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PGUP, XXXXXXX, KC_PGDN}
71 }
63}; 72};
64 73
65void persistant_default_layer_set(uint16_t default_layer) { 74void persistant_default_layer_set(uint16_t default_layer) {
@@ -67,26 +76,46 @@ void persistant_default_layer_set(uint16_t default_layer) {
67 default_layer_set(default_layer); 76 default_layer_set(default_layer);
68} 77}
69 78
70const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 79bool process_record_user(uint16_t keycode, keyrecord_t *record) {
71{ 80 switch (keycode) {
72 switch(id) { 81 case QWERTY:
73 case _DV: 82 if (record->event.pressed) {
74 if (record->event.pressed) { 83 persistant_default_layer_set(1UL<<_QWERTY);
75 persistant_default_layer_set(1UL<<_DV);
76 }
77 break;
78 case _QW:
79 if (record->event.pressed) {
80 persistant_default_layer_set(1UL<<_QW);
81 }
82 break;
83 case _CM:
84 if (record->event.pressed) {
85 persistant_default_layer_set(1UL<<_CM);
86 }
87 break;
88 } 84 }
89 return MACRO_NONE; 85 return false;
90}; 86 break;
91 87 case COLEMAK:
92 88 if (record->event.pressed) {
89 persistant_default_layer_set(1UL<<_COLEMAK);
90 }
91 return false;
92 break;
93 case DVORAK:
94 if (record->event.pressed) {
95 persistant_default_layer_set(1UL<<_DVORAK);
96 }
97 return false;
98 break;
99 case LOWER:
100 if (record->event.pressed) {
101 layer_on(_LOWER);
102 update_tri_layer(_LOWER, _RAISE, _ADJUST);
103 } else {
104 layer_off(_LOWER);
105 update_tri_layer(_LOWER, _RAISE, _ADJUST);
106 }
107 return false;
108 break;
109 case RAISE:
110 if (record->event.pressed) {
111 layer_on(_RAISE);
112 update_tri_layer(_LOWER, _RAISE, _ADJUST);
113 } else {
114 layer_off(_RAISE);
115 update_tri_layer(_LOWER, _RAISE, _ADJUST);
116 }
117 return false;
118 break;
119 }
120 return true;
121}
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/keyboards/xd60/readme.md b/keyboards/xd60/readme.md
index 224498caa..dcc45ead2 100644
--- a/keyboards/xd60/readme.md
+++ b/keyboards/xd60/readme.md
@@ -1,6 +1,6 @@
1# QMK Firmware for XIUDI's 60% XD60 PCB 1# QMK Firmware for XIUDI's 60% XD60 PCB
2 2
3![Top View of a pair of XD60 Keyboard](./xd60.JPG) 3![Top View of a pair of XD60 Keyboard](./xd60.jpg)
4 4
5## Quantum MK Firmware 5## Quantum MK Firmware
6For the full Quantum feature list, see [the parent readme.md](/readme.md). 6For the full Quantum feature list, see [the parent readme.md](/readme.md).
diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h
index 64093f293..f242405de 100644
--- a/quantum/dynamic_macro.h
+++ b/quantum/dynamic_macro.h
@@ -40,6 +40,7 @@
40enum dynamic_macro_keycodes { 40enum dynamic_macro_keycodes {
41 DYN_REC_START1 = DYNAMIC_MACRO_RANGE, 41 DYN_REC_START1 = DYNAMIC_MACRO_RANGE,
42 DYN_REC_START2, 42 DYN_REC_START2,
43 DYN_REC_STOP,
43 DYN_MACRO_PLAY1, 44 DYN_MACRO_PLAY1,
44 DYN_MACRO_PLAY2, 45 DYN_MACRO_PLAY2,
45}; 46};
@@ -47,11 +48,22 @@ enum dynamic_macro_keycodes {
47/* Blink the LEDs to notify the user about some event. */ 48/* Blink the LEDs to notify the user about some event. */
48void dynamic_macro_led_blink(void) 49void dynamic_macro_led_blink(void)
49{ 50{
51#ifdef BACKLIGHT_ENABLE
50 backlight_toggle(); 52 backlight_toggle();
51 _delay_ms(100); 53 _delay_ms(100);
52 backlight_toggle(); 54 backlight_toggle();
55#endif
53} 56}
54 57
58/* Convenience macros used for retrieving the debug info. All of them
59 * need a `direction` variable accessible at the call site.
60 */
61#define DYNAMIC_MACRO_CURRENT_SLOT() (direction > 0 ? 1 : 2)
62#define DYNAMIC_MACRO_CURRENT_LENGTH(BEGIN, POINTER) \
63 ((int)(direction * ((POINTER) - (BEGIN))))
64#define DYNAMIC_MACRO_CURRENT_CAPACITY(BEGIN, END2) \
65 ((int)(direction * ((END2) - (BEGIN)) + 1))
66
55/** 67/**
56 * Start recording of the dynamic macro. 68 * Start recording of the dynamic macro.
57 * 69 *
@@ -61,6 +73,8 @@ void dynamic_macro_led_blink(void)
61void dynamic_macro_record_start( 73void dynamic_macro_record_start(
62 keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) 74 keyrecord_t **macro_pointer, keyrecord_t *macro_buffer)
63{ 75{
76 dprintln("dynamic macro recording: started");
77
64 dynamic_macro_led_blink(); 78 dynamic_macro_led_blink();
65 79
66 clear_keyboard(); 80 clear_keyboard();
@@ -78,6 +92,8 @@ void dynamic_macro_record_start(
78void dynamic_macro_play( 92void dynamic_macro_play(
79 keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction) 93 keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction)
80{ 94{
95 dprintf("dynamic macro: slot %d playback\n", DYNAMIC_MACRO_CURRENT_SLOT());
96
81 uint32_t saved_layer_state = layer_state; 97 uint32_t saved_layer_state = layer_state;
82 98
83 clear_keyboard(); 99 clear_keyboard();
@@ -96,35 +112,68 @@ void dynamic_macro_play(
96/** 112/**
97 * Record a single key in a dynamic macro. 113 * Record a single key in a dynamic macro.
98 * 114 *
115 * @param macro_buffer[in] The start of the used macro buffer.
99 * @param macro_pointer[in,out] The current buffer position. 116 * @param macro_pointer[in,out] The current buffer position.
100 * @param macro_end2[in] The end of the other macro which shouldn't be overwritten. 117 * @param macro2_end[in] The end of the other macro.
101 * @param direction[in] Either +1 or -1, which way to iterate the buffer. 118 * @param direction[in] Either +1 or -1, which way to iterate the buffer.
102 * @param record[in] The current keypress. 119 * @param record[in] The current keypress.
103 */ 120 */
104void dynamic_macro_record_key( 121void dynamic_macro_record_key(
122 keyrecord_t *macro_buffer,
105 keyrecord_t **macro_pointer, 123 keyrecord_t **macro_pointer,
106 keyrecord_t *macro_end2, 124 keyrecord_t *macro2_end,
107 int8_t direction, 125 int8_t direction,
108 keyrecord_t *record) 126 keyrecord_t *record)
109{ 127{
110 if (*macro_pointer + direction != macro_end2) { 128 /* If we've just started recording, ignore all the key releases. */
129 if (!record->event.pressed && *macro_pointer == macro_buffer) {
130 dprintln("dynamic macro: ignoring a leading key-up event");
131 return;
132 }
133
134 /* The other end of the other macro is the last buffer element it
135 * is safe to use before overwriting the other macro.
136 */
137 if (*macro_pointer - direction != macro2_end) {
111 **macro_pointer = *record; 138 **macro_pointer = *record;
112 *macro_pointer += direction; 139 *macro_pointer += direction;
113 } else { 140 } else {
114 /* Notify about the end of buffer. The blinks are paired 141 dynamic_macro_led_blink();
115 * because they should happen on both down and up events. */
116 backlight_toggle();
117 } 142 }
143
144 dprintf(
145 "dynamic macro: slot %d length: %d/%d\n",
146 DYNAMIC_MACRO_CURRENT_SLOT(),
147 DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, *macro_pointer),
148 DYNAMIC_MACRO_CURRENT_CAPACITY(macro_buffer, macro2_end));
118} 149}
119 150
120/** 151/**
121 * End recording of the dynamic macro. Essentially just update the 152 * End recording of the dynamic macro. Essentially just update the
122 * pointer to the end of the macro. 153 * pointer to the end of the macro.
123 */ 154 */
124void dynamic_macro_record_end(keyrecord_t *macro_pointer, keyrecord_t **macro_end) 155void dynamic_macro_record_end(
156 keyrecord_t *macro_buffer,
157 keyrecord_t *macro_pointer,
158 int8_t direction,
159 keyrecord_t **macro_end)
125{ 160{
126 dynamic_macro_led_blink(); 161 dynamic_macro_led_blink();
127 162
163 /* Do not save the keys being held when stopping the recording,
164 * i.e. the keys used to access the layer DYN_REC_STOP is on.
165 */
166 while (macro_pointer != macro_buffer &&
167 (macro_pointer - direction)->event.pressed) {
168 dprintln("dynamic macro: trimming a trailing key-down event");
169 macro_pointer -= direction;
170 }
171
172 dprintf(
173 "dynamic macro: slot %d saved, length: %d\n",
174 DYNAMIC_MACRO_CURRENT_SLOT(),
175 DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, macro_pointer));
176
128 *macro_end = macro_pointer; 177 *macro_end = macro_pointer;
129} 178}
130 179
@@ -152,7 +201,7 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
152 * &macro_buffer macro_end 201 * &macro_buffer macro_end
153 * v v 202 * v v
154 * +------------------------------------------------------------+ 203 * +------------------------------------------------------------+
155 * |>>>>>> MACRO1 >>>>>>| |<<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| 204 * |>>>>>> MACRO1 >>>>>> <<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<|
156 * +------------------------------------------------------------+ 205 * +------------------------------------------------------------+
157 * ^ ^ 206 * ^ ^
158 * r_macro_end r_macro_buffer 207 * r_macro_end r_macro_buffer
@@ -209,18 +258,17 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
209 } else { 258 } else {
210 /* A macro is being recorded right now. */ 259 /* A macro is being recorded right now. */
211 switch (keycode) { 260 switch (keycode) {
212 case MO(_DYN): 261 case DYN_REC_STOP:
213 /* Use the layer key used to access the macro recording as 262 /* Stop the macro recording. */
214 * a stop button. */
215 if (record->event.pressed) { /* Ignore the initial release 263 if (record->event.pressed) { /* Ignore the initial release
216 * just after the recoding 264 * just after the recoding
217 * starts. */ 265 * starts. */
218 switch (macro_id) { 266 switch (macro_id) {
219 case 1: 267 case 1:
220 dynamic_macro_record_end(macro_pointer, &macro_end); 268 dynamic_macro_record_end(macro_buffer, macro_pointer, +1, &macro_end);
221 break; 269 break;
222 case 2: 270 case 2:
223 dynamic_macro_record_end(macro_pointer, &r_macro_end); 271 dynamic_macro_record_end(r_macro_buffer, macro_pointer, -1, &r_macro_end);
224 break; 272 break;
225 } 273 }
226 macro_id = 0; 274 macro_id = 0;
@@ -230,10 +278,10 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
230 /* Store the key in the macro buffer and process it normally. */ 278 /* Store the key in the macro buffer and process it normally. */
231 switch (macro_id) { 279 switch (macro_id) {
232 case 1: 280 case 1:
233 dynamic_macro_record_key(&macro_pointer, r_macro_end, +1, record); 281 dynamic_macro_record_key(macro_buffer, &macro_pointer, r_macro_end, +1, record);
234 break; 282 break;
235 case 2: 283 case 2:
236 dynamic_macro_record_key(&macro_pointer, macro_end, -1, record); 284 dynamic_macro_record_key(r_macro_buffer, &macro_pointer, macro_end, -1, record);
237 break; 285 break;
238 } 286 }
239 return true; 287 return true;
@@ -244,4 +292,8 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
244 return true; 292 return true;
245} 293}
246 294
295#undef DYNAMIC_MACRO_CURRENT_SLOT
296#undef DYNAMIC_MACRO_CURRENT_LENGTH
297#undef DYNAMIC_MACRO_CURRENT_CAPACITY
298
247#endif 299#endif
diff --git a/quantum/fauxclicky.c b/quantum/fauxclicky.c
index 13273e705..c3341ca33 100644
--- a/quantum/fauxclicky.c
+++ b/quantum/fauxclicky.c
@@ -20,13 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include <stdbool.h> 20#include <stdbool.h>
21#include <musical_notes.h> 21#include <musical_notes.h>
22 22
23__attribute__ ((weak))
24float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2);
25__attribute__ ((weak))
26float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2);
27__attribute__ ((weak))
28float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2);
29
30bool fauxclicky_enabled = true; 23bool fauxclicky_enabled = true;
31uint16_t note_start = 0; 24uint16_t note_start = 0;
32bool note_playing = false; 25bool note_playing = false;
@@ -48,13 +41,13 @@ void fauxclicky_stop()
48 note_playing = false; 41 note_playing = false;
49} 42}
50 43
51void fauxclicky_play(float note[2]) { 44void fauxclicky_play(float note[]) {
52 if (!fauxclicky_enabled) return; 45 if (!fauxclicky_enabled) return;
53 if (note_playing) fauxclicky_stop(); 46 if (note_playing) fauxclicky_stop();
54 FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)); 47 FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER));
55 FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2); 48 FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER)) / (float)2);
56 note_playing = true; 49 note_playing = true;
57 note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this 50 note_period = (note[1] / (float)16) * ((float)60 / (float)FAUXCLICKY_TEMPO) * 1000;
58 note_start = timer_read(); 51 note_start = timer_read();
59 FAUXCLICKY_ENABLE_OUTPUT; 52 FAUXCLICKY_ENABLE_OUTPUT;
60} 53}
diff --git a/quantum/fauxclicky.h b/quantum/fauxclicky.h
index 109bd0d83..1a8e188dd 100644
--- a/quantum/fauxclicky.h
+++ b/quantum/fauxclicky.h
@@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include "stdbool.h" 21#include "stdbool.h"
22 22
23__attribute__ ((weak)) 23__attribute__ ((weak))
24float fauxclicky_pressed_note[2]; 24float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
25__attribute__ ((weak)) 25__attribute__ ((weak))
26float fauxclicky_released_note[2]; 26float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
27__attribute__ ((weak)) 27__attribute__ ((weak))
28float fauxclicky_beep_note[2]; 28float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
29 29
30bool fauxclicky_enabled; 30bool fauxclicky_enabled;
31 31
@@ -73,11 +73,11 @@ bool fauxclicky_enabled;
73#endif 73#endif
74 74
75#ifndef FAUXCLICKY_ENABLE_OUTPUT 75#ifndef FAUXCLICKY_ENABLE_OUTPUT
76#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1); 76#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1)
77#endif 77#endif
78 78
79#ifndef FAUXCLICKY_DISABLE_OUTPUT 79#ifndef FAUXCLICKY_DISABLE_OUTPUT
80#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0)); 80#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0))
81#endif 81#endif
82 82
83#ifndef FAUXCLICKY_TIMER_PERIOD 83#ifndef FAUXCLICKY_TIMER_PERIOD
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 6cf4f031f..9dafc8b51 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -179,5 +179,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
179__attribute__ ((weak)) 179__attribute__ ((weak))
180uint16_t keymap_function_id_to_action( uint16_t function_id ) 180uint16_t keymap_function_id_to_action( uint16_t function_id )
181{ 181{
182 // The compiler sees the empty (weak) fn_actions and generates a warning
183 // This function should not be called in that case, so the warning is too strict
184 // If this function is called however, the keymap should have overridden fn_actions, and then the compile
185 // is comparing against the wrong array
186 #pragma GCC diagnostic push
187 #pragma GCC diagnostic ignored "-Warray-bounds"
182 return pgm_read_word(&fn_actions[function_id]); 188 return pgm_read_word(&fn_actions[function_id]);
189 #pragma GCC diagnostic pop
183} 190}
diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h
index 8332e00af..67350d660 100644
--- a/quantum/keymap_extras/keymap_german_ch.h
+++ b/quantum/keymap_extras/keymap_german_ch.h
@@ -33,6 +33,10 @@
33#define CH_E KC_E 33#define CH_E KC_E
34#define CH_F KC_F 34#define CH_F KC_F
35#define CH_G KC_G 35#define CH_G KC_G
36#ifdef CH_H
37// The ChibiOS ch.h file defines this...
38#undef CH_H
39#endif
36#define CH_H KC_H 40#define CH_H KC_H
37#define CH_I KC_I 41#define CH_I KC_I
38#define CH_J KC_J 42#define CH_J KC_J
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/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c
index 807f7a0b9..613af7018 100644
--- a/quantum/process_keycode/process_printer.c
+++ b/quantum/process_keycode/process_printer.c
@@ -20,12 +20,12 @@
20bool printing_enabled = false; 20bool printing_enabled = false;
21uint8_t character_shift = 0; 21uint8_t character_shift = 0;
22 22
23void enabled_printing() { 23void enable_printing(void) {
24 printing_enabled = true; 24 printing_enabled = true;
25 serial_init(); 25 serial_init();
26} 26}
27 27
28void disable_printing() { 28void disable_printing(void) {
29 printing_enabled = false; 29 printing_enabled = false;
30} 30}
31 31
@@ -41,9 +41,14 @@ void print_char(char c) {
41 USB_Init(); 41 USB_Init();
42} 42}
43 43
44void print_box_string(uint8_t text[]) { 44void print_string(char c[]) {
45 uint8_t len = strlen(text); 45 for(uint8_t i = 0; i < strlen(c); i++)
46 uint8_t out[len * 3 + 8]; 46 print_char(c[i]);
47}
48
49void print_box_string(const char text[]) {
50 size_t len = strlen(text);
51 char out[len * 3 + 8];
47 out[0] = 0xDA; 52 out[0] = 0xDA;
48 for (uint8_t i = 0; i < len; i++) { 53 for (uint8_t i = 0; i < len; i++) {
49 out[i+1] = 0xC4; 54 out[i+1] = 0xC4;
@@ -69,14 +74,9 @@ void print_box_string(uint8_t text[]) {
69 print_string(out); 74 print_string(out);
70} 75}
71 76
72void print_string(char c[]) {
73 for(uint8_t i = 0; i < strlen(c); i++)
74 print_char(c[i]);
75}
76
77bool process_printer(uint16_t keycode, keyrecord_t *record) { 77bool process_printer(uint16_t keycode, keyrecord_t *record) {
78 if (keycode == PRINT_ON) { 78 if (keycode == PRINT_ON) {
79 enabled_printing(); 79 enable_printing();
80 return false; 80 return false;
81 } 81 }
82 if (keycode == PRINT_OFF) { 82 if (keycode == PRINT_OFF) {
diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h
index aa494ac8a..71d3a4b56 100644
--- a/quantum/process_keycode/process_printer.h
+++ b/quantum/process_keycode/process_printer.h
@@ -21,4 +21,6 @@
21 21
22#include "protocol/serial.h" 22#include "protocol/serial.h"
23 23
24bool process_printer(uint16_t keycode, keyrecord_t *record);
25
24#endif 26#endif
diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c
index 55d3b552b..3a00f169d 100644
--- a/quantum/process_keycode/process_printer_bb.c
+++ b/quantum/process_keycode/process_printer_bb.c
@@ -46,7 +46,7 @@ void serial_output(void) {
46} 46}
47 47
48 48
49void enabled_printing() { 49void enable_printing() {
50 printing_enabled = true; 50 printing_enabled = true;
51 serial_output(); 51 serial_output();
52 serial_high(); 52 serial_high();
@@ -82,7 +82,7 @@ void print_string(char c[]) {
82 82
83bool process_printer(uint16_t keycode, keyrecord_t *record) { 83bool process_printer(uint16_t keycode, keyrecord_t *record) {
84 if (keycode == PRINT_ON) { 84 if (keycode == PRINT_ON) {
85 enabled_printing(); 85 enable_printing();
86 return false; 86 return false;
87 } 87 }
88 if (keycode == PRINT_OFF) { 88 if (keycode == PRINT_OFF) {
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c
index 678a15234..fd008eca1 100644
--- a/quantum/process_keycode/process_unicode.c
+++ b/quantum/process_keycode/process_unicode.c
@@ -15,6 +15,7 @@
15 */ 15 */
16#include "process_unicode.h" 16#include "process_unicode.h"
17#include "action_util.h" 17#include "action_util.h"
18#include "eeprom.h"
18 19
19static uint8_t first_flag = 0; 20static uint8_t first_flag = 0;
20 21
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
index 1dbdec3e7..84b5d673d 100644
--- a/quantum/process_keycode/process_unicode_common.c
+++ b/quantum/process_keycode/process_unicode_common.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include "process_unicode_common.h" 17#include "process_unicode_common.h"
18#include "eeprom.h"
18 19
19static uint8_t input_mode; 20static uint8_t input_mode;
20uint8_t mods; 21uint8_t mods;
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..82e4184d2
--- /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", 4);
129 pos += 4;
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/tmk_core/avr.mk b/tmk_core/avr.mk
index 5df539def..ccecdb192 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -89,9 +89,9 @@ DEBUG_HOST = localhost
89#============================================================================ 89#============================================================================
90# Autodecct teensy loader 90# Autodecct teensy loader
91ifneq (, $(shell which teensy-loader-cli 2>/dev/null)) 91ifneq (, $(shell which teensy-loader-cli 2>/dev/null))
92 TEENSY_LOADER_CLI = teensy-loader-cli 92 TEENSY_LOADER_CLI ?= teensy-loader-cli
93else 93else
94 TEENSY_LOADER_CLI = teensy_loader_cli 94 TEENSY_LOADER_CLI ?= teensy_loader_cli
95endif 95endif
96 96
97# Program the device. 97# Program the device.
@@ -100,43 +100,47 @@ program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
100 100
101teensy: $(BUILD_DIR)/$(TARGET).hex 101teensy: $(BUILD_DIR)/$(TARGET).hex
102 $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex 102 $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex
103
104BATCHISP ?= batchisp
103 105
104flip: $(BUILD_DIR)/$(TARGET).hex 106flip: $(BUILD_DIR)/$(TARGET).hex
105 batchisp -hardware usb -device $(MCU) -operation erase f 107 $(BATCHISP) -hardware usb -device $(MCU) -operation erase f
106 batchisp -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program 108 $(BATCHISP) -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program
107 batchisp -hardware usb -device $(MCU) -operation start reset 0 109 $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0
110
111DFU_PROGRAMMER ?= dfu-programmer
108 112
109dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter 113dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter
110 until dfu-programmer $(MCU) get bootloader-version; do\ 114 until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
111 echo "Error: Bootloader not found. Trying again in 5s." ;\ 115 echo "Error: Bootloader not found. Trying again in 5s." ;\
112 sleep 5 ;\ 116 sleep 5 ;\
113 done 117 done
114ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) 118ifneq (, $(findstring 0.7, $(shell $(DFU_PROGRAMMER) --version 2>&1)))
115 dfu-programmer $(MCU) erase --force 119 $(DFU_PROGRAMMER) $(MCU) erase --force
116else 120else
117 dfu-programmer $(MCU) erase 121 $(DFU_PROGRAMMER) $(MCU) erase
118endif 122endif
119 dfu-programmer $(MCU) flash $(BUILD_DIR)/$(TARGET).hex 123 $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex
120 dfu-programmer $(MCU) reset 124 $(DFU_PROGRAMMER) $(MCU) reset
121 125
122dfu-start: 126dfu-start:
123 dfu-programmer $(MCU) reset 127 $(DFU_PROGRAMMER) $(MCU) reset
124 dfu-programmer $(MCU) start 128 $(DFU_PROGRAMMER) $(MCU) start
125 129
126flip-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep 130flip-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
127 $(COPY) $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET)eep.hex 131 $(COPY) $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET)eep.hex
128 batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase 132 $(BATCHISP) -hardware usb -device $(MCU) -operation memory EEPROM erase
129 batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(BUILD_DIR)/$(TARGET)eep.hex program 133 $(BATCHISP) -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(BUILD_DIR)/$(TARGET)eep.hex program
130 batchisp -hardware usb -device $(MCU) -operation start reset 0 134 $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0
131 $(REMOVE) $(BUILD_DIR)/$(TARGET)eep.hex 135 $(REMOVE) $(BUILD_DIR)/$(TARGET)eep.hex
132 136
133dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep 137dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
134ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) 138ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
135 dfu-programmer $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep 139 $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep
136else 140else
137 dfu-programmer $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep 141 $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep
138endif 142endif
139 dfu-programmer $(MCU) reset 143 $(DFU_PROGRAMMER) $(MCU) reset
140 144
141# Convert hex to bin. 145# Convert hex to bin.
142flashbin: $(BUILD_DIR)/$(TARGET).hex 146flashbin: $(BUILD_DIR)/$(TARGET).hex
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index eb0c40138..2a8d32fb9 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -151,5 +151,7 @@ endif
151# List any extra directories to look for libraries here. 151# List any extra directories to look for libraries here.
152EXTRALIBDIRS = $(RULESPATH)/ld 152EXTRALIBDIRS = $(RULESPATH)/ld
153 153
154DFU_UTIL ?= dfu-util
155
154dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter 156dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
155 dfu-util $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin 157 $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 94de36918..8640dfab3 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -140,7 +140,6 @@ void process_record(keyrecord_t *record)
140 140
141void process_action(keyrecord_t *record, action_t action) 141void process_action(keyrecord_t *record, action_t action)
142{ 142{
143 bool do_release_oneshot = false;
144 keyevent_t event = record->event; 143 keyevent_t event = record->event;
145#ifndef NO_ACTION_TAPPING 144#ifndef NO_ACTION_TAPPING
146 uint8_t tap_count = record->tap.count; 145 uint8_t tap_count = record->tap.count;
@@ -152,6 +151,7 @@ void process_action(keyrecord_t *record, action_t action)
152 } 151 }
153 152
154#ifndef NO_ACTION_ONESHOT 153#ifndef NO_ACTION_ONESHOT
154 bool do_release_oneshot = false;
155 // notice we only clear the one shot layer if the pressed key is not a modifier. 155 // notice we only clear the one shot layer if the pressed key is not a modifier.
156 if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) { 156 if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) {
157 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 157 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
@@ -537,6 +537,21 @@ void process_action(keyrecord_t *record, action_t action)
537 break; 537 break;
538 } 538 }
539 539
540#ifndef NO_ACTION_LAYER
541 // if this event is a layer action, update the leds
542 switch (action.kind.id) {
543 case ACT_LAYER:
544 #ifndef NO_ACTION_TAPPING
545 case ACT_LAYER_TAP:
546 case ACT_LAYER_TAP_EXT:
547 #endif
548 led_set(host_keyboard_leds());
549 break;
550 default:
551 break;
552 }
553#endif
554
540#ifndef NO_ACTION_ONESHOT 555#ifndef NO_ACTION_ONESHOT
541 /* Because we switch layers after a oneshot event, we need to release the 556 /* Because we switch layers after a oneshot event, we need to release the
542 * key before we leave the layer or no key up event will be generated. 557 * key before we leave the layer or no key up event will be generated.
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
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 0c81e8361..1c7618ff5 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -9,6 +9,7 @@
9#include "suspend.h" 9#include "suspend.h"
10#include "timer.h" 10#include "timer.h"
11#include "led.h" 11#include "led.h"
12#include "host.h"
12 13
13#ifdef PROTOCOL_LUFA 14#ifdef PROTOCOL_LUFA
14 #include "lufa.h" 15 #include "lufa.h"
diff --git a/tmk_core/common/mousekey.h b/tmk_core/common/mousekey.h
index 6eede06b4..9338d0af7 100644
--- a/tmk_core/common/mousekey.h
+++ b/tmk_core/common/mousekey.h
@@ -23,8 +23,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23 23
24 24
25/* max value on report descriptor */ 25/* max value on report descriptor */
26#define MOUSEKEY_MOVE_MAX 127 26#ifndef MOUSEKEY_MOVE_MAX
27#define MOUSEKEY_WHEEL_MAX 127 27 #define MOUSEKEY_MOVE_MAX 127
28#elif MOUSEKEY_MOVE_MAX > 127
29 #error MOUSEKEY_MOVE_MAX needs to be smaller than 127
30#endif
31
32#ifndef MOUSEKEY_WHEEL_MAX
33 #define MOUSEKEY_WHEEL_MAX 127
34#elif MOUSEKEY_WHEEL_MAX > 127
35 #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
36#endif
28 37
29#ifndef MOUSEKEY_MOVE_DELTA 38#ifndef MOUSEKEY_MOVE_DELTA
30#define MOUSEKEY_MOVE_DELTA 5 39#define MOUSEKEY_MOVE_DELTA 5
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index e4c8aecb2..b7cb0a559 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -92,6 +92,9 @@ endif
92endif 92endif
93CFLAGS += -Wall 93CFLAGS += -Wall
94CFLAGS += -Wstrict-prototypes 94CFLAGS += -Wstrict-prototypes
95ifneq ($(strip $(ALLOW_WARNINGS)), yes)
96 CFLAGS += -Werror
97endif
95#CFLAGS += -mshort-calls 98#CFLAGS += -mshort-calls
96#CFLAGS += -fno-unit-at-a-time 99#CFLAGS += -fno-unit-at-a-time
97#CFLAGS += -Wundef 100#CFLAGS += -Wundef
@@ -115,6 +118,9 @@ CPPFLAGS += -O$(OPT)
115CPPFLAGS += -w 118CPPFLAGS += -w
116CPPFLAGS += -Wall 119CPPFLAGS += -Wall
117CPPFLAGS += -Wundef 120CPPFLAGS += -Wundef
121ifneq ($(strip $(ALLOW_WARNINGS)), yes)
122 CPPFLAGS += -Werror
123endif
118#CPPFLAGS += -mshort-calls 124#CPPFLAGS += -mshort-calls
119#CPPFLAGS += -fno-unit-at-a-time 125#CPPFLAGS += -fno-unit-at-a-time
120#CPPFLAGS += -Wstrict-prototypes 126#CPPFLAGS += -Wstrict-prototypes